diff --git a/changelog/unreleased/bugfix-disable-expiration-date-alias-link b/changelog/unreleased/bugfix-disable-expiration-date-alias-link new file mode 100644 index 00000000000..6997b2e8089 --- /dev/null +++ b/changelog/unreleased/bugfix-disable-expiration-date-alias-link @@ -0,0 +1,7 @@ +Bugfix: Disable expiration date for alias link (internal) + +We've disabled the option to set an expiration date on an internal link, +since it could be misleading and doesn't serve any use. + +https://github.com/owncloud/web/pull/10083 +https://github.com/owncloud/web/issues/9923 diff --git a/packages/web-app-files/src/components/SideBar/Shares/Links/DetailsAndEdit.vue b/packages/web-app-files/src/components/SideBar/Shares/Links/DetailsAndEdit.vue index 24be0e4b18a..74fc87fd8de 100644 --- a/packages/web-app-files/src/components/SideBar/Shares/Links/DetailsAndEdit.vue +++ b/packages/web-app-files/src/components/SideBar/Shares/Links/DetailsAndEdit.vue @@ -326,7 +326,7 @@ export default defineComponent({ }) } }) - } else { + } else if (!this.isAliasLink) { result.push({ id: 'add-expiration', title: this.$gettext('Set expiration date'), diff --git a/packages/web-app-files/tests/unit/components/SideBar/Shares/Links/DetailsAndEdit.spec.ts b/packages/web-app-files/tests/unit/components/SideBar/Shares/Links/DetailsAndEdit.spec.ts index 6759172ff5e..ba0bc196701 100644 --- a/packages/web-app-files/tests/unit/components/SideBar/Shares/Links/DetailsAndEdit.spec.ts +++ b/packages/web-app-files/tests/unit/components/SideBar/Shares/Links/DetailsAndEdit.spec.ts @@ -49,6 +49,23 @@ describe('DetailsAndEdit component', () => { expect(setModalInputErrorMessageStub).toHaveBeenCalledWith(expect.anything()) }) }) + + describe('editOptions computed property', () => { + it('does not add "add-expiration" option if isAliasLink is true', () => { + const exampleLinkInternal = { + name: 'Example link', + url: 'https://some-url.com/abc', + permissions: 0 + } + const { wrapper } = getShallowMountedWrapper(exampleLinkInternal, false, true) + expect(wrapper.vm.editOptions.some((option) => option.id === 'add-expiration')).toBe(false) + }) + + it('adds "add-expiration" option if isAliasLink is false', () => { + const { wrapper } = getShallowMountedWrapper(exampleLink, false, true) + expect(wrapper.vm.editOptions.some((option) => option.id === 'add-expiration')).toBe(true) + }) + }) }) function getShallowMountedWrapper(link, expireDateEnforced = false, isModifiable = false) {