From 0676a4ca893e9313a7b3ad02898919bc34319cb5 Mon Sep 17 00:00:00 2001 From: Wilfred Asomani Date: Wed, 1 Mar 2023 13:56:49 +0000 Subject: [PATCH] web/satellite: use correct table icons This change uses the corresponding icons for different types of files in the file browser. Issue: https://github.com/storj/storj/issues/5477 Change-Id: I8b10ac4ece03563a465c7823a1e7482244a324b9 --- .../src/components/browser/FileBrowser.vue | 15 +---- .../src/components/browser/FileEntry.vue | 34 +++++++++- .../components/browser/LockedFilesEntry.vue | 2 +- .../src/components/browser/UpEntry.vue | 22 +++++++ .../src/components/common/TableItem.vue | 66 +++++++++++++++---- .../src/components/objects/BucketItem.vue | 3 +- .../static/images/browser/tableLocked.svg | 1 - web/satellite/static/images/objects/audio.svg | 3 + .../static/images/objects/chevronLeft.svg | 3 + .../static/images/objects/colorBucket.svg | 3 + .../static/images/objects/colorFolder.svg | 5 ++ web/satellite/static/images/objects/graph.svg | 3 + web/satellite/static/images/objects/pdf.svg | 6 ++ .../static/images/objects/picture.svg | 3 + web/satellite/static/images/objects/txt.svg | 3 + web/satellite/static/images/objects/video.svg | 3 + web/satellite/static/images/objects/zip.svg | 14 ++++ 17 files changed, 158 insertions(+), 31 deletions(-) create mode 100644 web/satellite/src/components/browser/UpEntry.vue create mode 100644 web/satellite/static/images/objects/audio.svg create mode 100644 web/satellite/static/images/objects/chevronLeft.svg create mode 100644 web/satellite/static/images/objects/colorBucket.svg create mode 100644 web/satellite/static/images/objects/colorFolder.svg create mode 100644 web/satellite/static/images/objects/graph.svg create mode 100644 web/satellite/static/images/objects/pdf.svg create mode 100644 web/satellite/static/images/objects/picture.svg create mode 100644 web/satellite/static/images/objects/txt.svg create mode 100644 web/satellite/static/images/objects/video.svg create mode 100644 web/satellite/static/images/objects/zip.svg diff --git a/web/satellite/src/components/browser/FileBrowser.vue b/web/satellite/src/components/browser/FileBrowser.vue index 5ee2ebe97..645e702ec 100644 --- a/web/satellite/src/components/browser/FileBrowser.vue +++ b/web/satellite/src/components/browser/FileBrowser.vue @@ -148,19 +148,7 @@ - - - - ... - - - - - - + @@ -224,6 +212,7 @@ import VButton from '@/components/common/VButton.vue'; import BucketSettingsNav from '@/components/objects/BucketSettingsNav.vue'; import VTable from '@/components/common/VTable.vue'; import MultiplePassphraseBanner from '@/components/browser/MultiplePassphrasesBanner.vue'; +import UpEntry from '@/components/browser/UpEntry.vue'; import FileIcon from '@/../static/images/objects/file.svg'; import BlackArrowExpand from '@/../static/images/common/BlackArrowExpand.svg'; diff --git a/web/satellite/src/components/browser/FileEntry.vue b/web/satellite/src/components/browser/FileEntry.vue index 080ef41d4..fbe33ac01 100644 --- a/web/satellite/src/components/browser/FileEntry.vue +++ b/web/satellite/src/components/browser/FileEntry.vue @@ -8,7 +8,7 @@ :on-click="selectFile" :on-primary-click="openModal" :item="{'name': file.Key, 'size': size, 'date': uploadDate}" - table-type="file" + :item-type="fileType" >
{ + const image = /(\.jpg|\.jpeg|\.png|\.gif)$/i; + const video = /(\.mp4|\.mkv|\.mov)$/i; + const audio = /(\.mp3|\.aac|\.wav|\.m4a)$/i; + const text = /(\.txt|\.docx|\.doc|\.pages)$/i; + const pdf = /(\.pdf)$/i; + const archive = /(\.zip|\.tar.gz|\.7z|\.rar)$/i; + const spreadsheet = /(\.xls|\.numbers|\.csv|\.xlsx|\.tsv)$/i; + + if (image.exec(props.file.Key)) { + return 'image'; + } else if (video.exec(props.file.Key)) { + return 'video'; + } else if (audio.exec(props.file.Key)) { + return 'audio'; + } else if (text.exec(props.file.Key)) { + return 'text'; + } else if (pdf.exec(props.file.Key)) { + return 'pdf'; + } else if (archive.exec(props.file.Key)) { + return 'archive'; + } else if (spreadsheet.exec(props.file.Key)) { + return 'spreadsheet'; + } + return 'file'; +}); + /** * Return the size of the file formatted. */ diff --git a/web/satellite/src/components/browser/LockedFilesEntry.vue b/web/satellite/src/components/browser/LockedFilesEntry.vue index 7caddcce2..05caf903a 100644 --- a/web/satellite/src/components/browser/LockedFilesEntry.vue +++ b/web/satellite/src/components/browser/LockedFilesEntry.vue @@ -6,7 +6,7 @@ :on-click="openModal" :on-primary-click="openModal" :item="{'name': 'Objects locked', 'size': '', 'date': ''}" - table-type="locked" + item-type="locked" > diff --git a/web/satellite/src/components/browser/UpEntry.vue b/web/satellite/src/components/browser/UpEntry.vue new file mode 100644 index 000000000..c81eae513 --- /dev/null +++ b/web/satellite/src/components/browser/UpEntry.vue @@ -0,0 +1,22 @@ +// Copyright (C) 2023 Storj Labs, Inc. +// See LICENSE for copying information. + + + + diff --git a/web/satellite/src/components/common/TableItem.vue b/web/satellite/src/components/common/TableItem.vue index af414aacd..4946b12bc 100644 --- a/web/satellite/src/components/common/TableItem.vue +++ b/web/satellite/src/components/common/TableItem.vue @@ -18,12 +18,11 @@

{{ str }}

- - - - +
+ +

- + {{ val }}

@@ -37,46 +36,73 @@ @@ -200,4 +228,16 @@ function cellContentClicked(cellIndex: number, event: Event) { margin-right: 12px; min-width: 18px; } + + .file-background { + background: var(--c-white); + border: 1px solid var(--c-grey-2); + padding: 2px; + border-radius: 8px; + height: 32px; + width: 32px; + display: flex; + align-items: center; + justify-content: center; + } diff --git a/web/satellite/src/components/objects/BucketItem.vue b/web/satellite/src/components/objects/BucketItem.vue index 271e8bcd0..8b9a60f16 100644 --- a/web/satellite/src/components/objects/BucketItem.vue +++ b/web/satellite/src/components/objects/BucketItem.vue @@ -5,9 +5,10 @@ diff --git a/web/satellite/static/images/browser/tableLocked.svg b/web/satellite/static/images/browser/tableLocked.svg index e65778ea1..988e5bb58 100644 --- a/web/satellite/static/images/browser/tableLocked.svg +++ b/web/satellite/static/images/browser/tableLocked.svg @@ -1,4 +1,3 @@ - diff --git a/web/satellite/static/images/objects/audio.svg b/web/satellite/static/images/objects/audio.svg new file mode 100644 index 000000000..c2663887a --- /dev/null +++ b/web/satellite/static/images/objects/audio.svg @@ -0,0 +1,3 @@ + + + diff --git a/web/satellite/static/images/objects/chevronLeft.svg b/web/satellite/static/images/objects/chevronLeft.svg new file mode 100644 index 000000000..1b6cc3fb9 --- /dev/null +++ b/web/satellite/static/images/objects/chevronLeft.svg @@ -0,0 +1,3 @@ + + + diff --git a/web/satellite/static/images/objects/colorBucket.svg b/web/satellite/static/images/objects/colorBucket.svg new file mode 100644 index 000000000..445210b67 --- /dev/null +++ b/web/satellite/static/images/objects/colorBucket.svg @@ -0,0 +1,3 @@ + + + diff --git a/web/satellite/static/images/objects/colorFolder.svg b/web/satellite/static/images/objects/colorFolder.svg new file mode 100644 index 000000000..a8a2c2b2c --- /dev/null +++ b/web/satellite/static/images/objects/colorFolder.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/web/satellite/static/images/objects/graph.svg b/web/satellite/static/images/objects/graph.svg new file mode 100644 index 000000000..f13589c52 --- /dev/null +++ b/web/satellite/static/images/objects/graph.svg @@ -0,0 +1,3 @@ + + + diff --git a/web/satellite/static/images/objects/pdf.svg b/web/satellite/static/images/objects/pdf.svg new file mode 100644 index 000000000..5669020b7 --- /dev/null +++ b/web/satellite/static/images/objects/pdf.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/web/satellite/static/images/objects/picture.svg b/web/satellite/static/images/objects/picture.svg new file mode 100644 index 000000000..ce6a06e86 --- /dev/null +++ b/web/satellite/static/images/objects/picture.svg @@ -0,0 +1,3 @@ + + + diff --git a/web/satellite/static/images/objects/txt.svg b/web/satellite/static/images/objects/txt.svg new file mode 100644 index 000000000..b6117a094 --- /dev/null +++ b/web/satellite/static/images/objects/txt.svg @@ -0,0 +1,3 @@ + + + diff --git a/web/satellite/static/images/objects/video.svg b/web/satellite/static/images/objects/video.svg new file mode 100644 index 000000000..01f318031 --- /dev/null +++ b/web/satellite/static/images/objects/video.svg @@ -0,0 +1,3 @@ + + + diff --git a/web/satellite/static/images/objects/zip.svg b/web/satellite/static/images/objects/zip.svg new file mode 100644 index 000000000..3547a450b --- /dev/null +++ b/web/satellite/static/images/objects/zip.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + +