diff --git a/packages/web-app-files/src/components/FilesList/ResourceTable.vue b/packages/web-app-files/src/components/FilesList/ResourceTable.vue index 06e00a936da..96c2b2360a4 100644 --- a/packages/web-app-files/src/components/FilesList/ResourceTable.vue +++ b/packages/web-app-files/src/components/FilesList/ResourceTable.vue @@ -299,6 +299,15 @@ export default { required: false, default: undefined }, + /** + * Define what fields should be displayed in the table + * If null, all fields are displayed + */ + fieldsDisplayed: { + type: Array, + required: false, + default: null + }, /** * Show that the table is sorted ascendingly/descendingly (no actual sorting takes place) */ @@ -427,13 +436,9 @@ export default { } ] .filter((field) => { - if (!Object.prototype.hasOwnProperty.call(firstResource, field.name)) { - return false - } - if (field.name !== 'indicators') { - return true - } - return this.resources.some((resource) => resource.indicators.length > 0) + const hasProperty = Object.prototype.hasOwnProperty.call(firstResource, field.name) + if (!this.fieldsDisplayed) return hasProperty + return hasProperty && this.fieldsDisplayed.includes(field.name) }) .map((field) => { const sortField = sortFields.find((f) => f.name === field.name) diff --git a/packages/web-app-files/src/views/shares/SharedViaLink.vue b/packages/web-app-files/src/views/shares/SharedViaLink.vue index 5e682bb8b7f..9836bd7f929 100644 --- a/packages/web-app-files/src/views/shares/SharedViaLink.vue +++ b/packages/web-app-files/src/views/shares/SharedViaLink.vue @@ -17,6 +17,7 @@ id="files-shared-via-link-table" v-model="selected" class="files-table" + :fields-displayed="['name', 'sharedWith', 'sdate']" :class="{ 'files-table-squashed': !sidebarClosed }" :are-thumbnails-displayed="displayThumbnails" :are-paths-displayed="true" diff --git a/packages/web-app-files/src/views/shares/SharedWithOthers.vue b/packages/web-app-files/src/views/shares/SharedWithOthers.vue index 4db04838a7e..367c6964f4d 100644 --- a/packages/web-app-files/src/views/shares/SharedWithOthers.vue +++ b/packages/web-app-files/src/views/shares/SharedWithOthers.vue @@ -19,6 +19,7 @@ id="files-shared-with-others-table" v-model="selected" class="files-table" + :fields-displayed="['name', 'sharedWith', 'sdate']" :class="{ 'files-table-squashed': !sidebarClosed }" :are-thumbnails-displayed="displayThumbnails" :are-paths-displayed="true" diff --git a/packages/web-app-files/tests/unit/components/__snapshots__/TrashBin.spec.js.snap b/packages/web-app-files/tests/unit/components/__snapshots__/TrashBin.spec.js.snap index 4655f395437..be6249ff7c9 100644 --- a/packages/web-app-files/tests/unit/components/__snapshots__/TrashBin.spec.js.snap +++ b/packages/web-app-files/tests/unit/components/__snapshots__/TrashBin.spec.js.snap @@ -8,6 +8,9 @@ exports[`Trashbin component when the view is not loading anymore when length of Name + Shares + + Status @@ -29,6 +32,7 @@ exports[`Trashbin component when the view is not loading anymore when length of +
@@ -48,6 +52,7 @@ exports[`Trashbin component when the view is not loading anymore when length of
+
@@ -67,6 +72,7 @@ exports[`Trashbin component when the view is not loading anymore when length of
+
@@ -77,7 +83,7 @@ exports[`Trashbin component when the view is not loading anymore when length of - + diff --git a/packages/web-app-files/tests/unit/views/__snapshots__/Trashbin.spec.js.snap b/packages/web-app-files/tests/unit/views/__snapshots__/Trashbin.spec.js.snap new file mode 100644 index 00000000000..be6249ff7c9 --- /dev/null +++ b/packages/web-app-files/tests/unit/views/__snapshots__/Trashbin.spec.js.snap @@ -0,0 +1,93 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Trashbin component when the view is not loading anymore when length of the paginated resources is greater than zero should load the resource table with correct props 1`] = ` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
Name Shares + + Status + + Actions + +
+
+
file-name-1234 + +
+ file-path +
+
+
+
+
+
+
+
+
+
file-name-5896 + +
+ file-path +
+
+
+
+
+
+
+
+
+
file-name-9856 + +
+ file-path +
+
+
+
+
+
+
+
+`; diff --git a/packages/web-runtime/tests/unit/components/Topbar/__snapshots__/ApplicationsMenu.spec.js.snap b/packages/web-runtime/tests/unit/components/Topbar/__snapshots__/ApplicationsMenu.spec.js.snap index 63da2736dc9..1cd53adf2af 100644 --- a/packages/web-runtime/tests/unit/components/Topbar/__snapshots__/ApplicationsMenu.spec.js.snap +++ b/packages/web-runtime/tests/unit/components/Topbar/__snapshots__/ApplicationsMenu.spec.js.snap @@ -2,18 +2,18 @@ exports[`ApplicationsMenu component should render navigation with button and menu items in dropdown 1`] = `