diff --git a/changelog/unreleased/enhancement-show-webdav-information-in-details b/changelog/unreleased/enhancement-show-webdav-information-in-details new file mode 100644 index 00000000000..cb0be4a2767 --- /dev/null +++ b/changelog/unreleased/enhancement-show-webdav-information-in-details @@ -0,0 +1,9 @@ +Enhancement: Show webdav information in details view + +We've added WebDav path and WebDav url information to the details view, +this might be usefully when the user wants to add an external WebDav client. + +By default this view option is disabled but can be enabled via account->preferences view. + +https://github.com/owncloud/web/pull/10062 +https://github.com/owncloud/web/issues/9714 diff --git a/packages/web-app-files/src/components/SideBar/Details/FileDetails.vue b/packages/web-app-files/src/components/SideBar/Details/FileDetails.vue index c86615bdff2..d3f6e5ea1b0 100644 --- a/packages/web-app-files/src/components/SideBar/Details/FileDetails.vue +++ b/packages/web-app-files/src/components/SideBar/Details/FileDetails.vue @@ -83,7 +83,7 @@ - + @@ -217,6 +217,9 @@ export default defineComponent({ matchingSpace: unref(space) || getMatchingSpace(unref(resource)) }) }) + const showWebDavDetails = computed(() => { + return store.getters['Files/areWebDavDetailsShown'] + }) const formatDateRelative = (date) => { return formatRelativeDateFromJSDate(new Date(date), language.current) } @@ -248,7 +251,8 @@ export default defineComponent({ sharedAncestor, sharedAncestorRoute, formatDateRelative, - contextualHelper + contextualHelper, + showWebDavDetails } }, computed: { diff --git a/packages/web-app-files/src/store/getters.ts b/packages/web-app-files/src/store/getters.ts index df94306d1e6..6247b9ac4d8 100644 --- a/packages/web-app-files/src/store/getters.ts +++ b/packages/web-app-files/src/store/getters.ts @@ -67,5 +67,14 @@ export default { }, versions: (state) => { return state.versions + }, + areHiddenFilesShown: (state) => { + return state.areHiddenFilesShown + }, + areFileExtensionsShown: (state) => { + return state.areFileExtensionsShown + }, + areWebDavDetailsShown: (state) => { + return state.areWebDavDetailsShown } } diff --git a/packages/web-app-files/src/store/mutations.ts b/packages/web-app-files/src/store/mutations.ts index f0ef2588c20..c052df50ecc 100644 --- a/packages/web-app-files/src/store/mutations.ts +++ b/packages/web-app-files/src/store/mutations.ts @@ -214,6 +214,12 @@ export default { state.areFileExtensionsShown = value window.localStorage.setItem('oc_fileExtensionsShown', value) + }, + + SET_FILE_WEB_DAV_DETAILS_VISIBILITY(state, value) { + state.areWebDavDetailsShown = value + + window.localStorage.setItem('oc_webDavDetailsShown', value) } } diff --git a/packages/web-app-files/src/store/state.ts b/packages/web-app-files/src/store/state.ts index 090e15c880c..3450f9194af 100644 --- a/packages/web-app-files/src/store/state.ts +++ b/packages/web-app-files/src/store/state.ts @@ -19,5 +19,6 @@ export default { * View settings */ areHiddenFilesShown: true, - areFileExtensionsShown: true + areFileExtensionsShown: true, + areWebDavDetailsShown: false } diff --git a/packages/web-app-files/tests/unit/components/FilesList/__snapshots__/ResourceDetails.spec.ts.snap b/packages/web-app-files/tests/unit/components/FilesList/__snapshots__/ResourceDetails.spec.ts.snap index 7898c33f273..dfe995ba008 100644 --- a/packages/web-app-files/tests/unit/components/FilesList/__snapshots__/ResourceDetails.spec.ts.snap +++ b/packages/web-app-files/tests/unit/components/FilesList/__snapshots__/ResourceDetails.spec.ts.snap @@ -54,32 +54,7 @@ exports[`ResourceDetails component renders resource details correctly 1`] = ` Size 24 kB - - WebDav path - -
- - - - - WebDav url - -
/
- - - + diff --git a/packages/web-pkg/src/components/AppBar/AppBar.vue b/packages/web-pkg/src/components/AppBar/AppBar.vue index aad011ce93d..75801eda724 100644 --- a/packages/web-pkg/src/components/AppBar/AppBar.vue +++ b/packages/web-pkg/src/components/AppBar/AppBar.vue @@ -75,7 +75,7 @@ - diff --git a/packages/web-runtime/tests/unit/pages/__snapshots__/account.spec.ts.snap b/packages/web-runtime/tests/unit/pages/__snapshots__/account.spec.ts.snap index bb19103d6c4..93392b416f8 100644 --- a/packages/web-runtime/tests/unit/pages/__snapshots__/account.spec.ts.snap +++ b/packages/web-runtime/tests/unit/pages/__snapshots__/account.spec.ts.snap @@ -23,12 +23,6 @@ exports[`account page account information displays basic user information 1`] = You are not part of any group - - `; diff --git a/packages/web-runtime/tests/unit/pages/account.spec.ts b/packages/web-runtime/tests/unit/pages/account.spec.ts index 438596ef22b..f967bb66f09 100644 --- a/packages/web-runtime/tests/unit/pages/account.spec.ts +++ b/packages/web-runtime/tests/unit/pages/account.spec.ts @@ -319,6 +319,22 @@ describe('account page', () => { expect(storeOptions.actions.showErrorMessage).toHaveBeenCalled() }) }) + + describe('Method "updateViewOptionsWebDavDetails', () => { + it('should show a message on success', async () => { + const { wrapper, storeOptions } = getWrapper({}) + + await wrapper.vm.loadAccountBundleTask.last + await wrapper.vm.loadValuesListTask.last + await wrapper.vm.loadGraphUserTask.last + + await wrapper.vm.updateViewOptionsWebDavDetails(true) + expect(storeOptions.actions.showMessage).toHaveBeenCalled() + expect( + storeOptions.modules.Files.mutations.SET_FILE_WEB_DAV_DETAILS_VISIBILITY + ).toHaveBeenCalled() + }) + }) }) function getWrapper({ diff --git a/packages/web-test-helpers/src/mocks/store/filesModuleMockOptions.ts b/packages/web-test-helpers/src/mocks/store/filesModuleMockOptions.ts index 61b677350dd..95f838c0b1a 100644 --- a/packages/web-test-helpers/src/mocks/store/filesModuleMockOptions.ts +++ b/packages/web-test-helpers/src/mocks/store/filesModuleMockOptions.ts @@ -26,6 +26,7 @@ export const filesModuleMockOptions = { RENAME_FILE: jest.fn(), SET_HIDDEN_FILES_VISIBILITY: jest.fn(), SET_FILE_EXTENSIONS_VISIBILITY: jest.fn(), + SET_FILE_WEB_DAV_DETAILS_VISIBILITY: jest.fn(), UPSERT_RESOURCE: jest.fn(), CLEAR_CURRENT_FILES_LIST: jest.fn(), SET_CURRENT_FOLDER: jest.fn(),