Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable expiration date for alias link #10083

Merged
merged 5 commits into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ export default defineComponent({
})
}
})
} else {
} else if (!this.isAliasLink) {
result.push({
id: 'add-expiration',
title: this.$gettext('Set expiration date'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down