From baae00e32ce2947a5226140529f792ad9869fc79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Calvi=C3=B1o=20S=C3=A1nchez?= Date: Tue, 11 Aug 2026 13:30:48 +0200 Subject: [PATCH 01/10] fix: Do not update the share when checking/unchecking "Hide download" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The SharingDetailsTab provides buttons to cancel and save the share, so the share should be saved only when doing it explicitly. Signed-off-by: Daniel Calviño Sánchez --- .../src/views/SharingDetailsTab.vue | 3 +-- .../public-share/share-editor.spec.ts | 4 ++-- .../playwright/support/sections/SharingTab.ts | 22 +------------------ 3 files changed, 4 insertions(+), 25 deletions(-) diff --git a/apps/files_sharing/src/views/SharingDetailsTab.vue b/apps/files_sharing/src/views/SharingDetailsTab.vue index c1cc67ca72289..c49ed7a240d2e 100644 --- a/apps/files_sharing/src/views/SharingDetailsTab.vue +++ b/apps/files_sharing/src/views/SharingDetailsTab.vue @@ -178,8 +178,7 @@ + :disabled="canChangeHideDownload"> {{ t('files_sharing', 'Hide download') }} { await sharingTab.openLinkShareDetails() await sharingTab.openAdvancedSettings() await expect(sharingTab.checkbox('Hide download')).not.toBeChecked() - await sharingTab.setCheckbox('Hide download', true, { persists: true }) - await sharingTab.closeDetails() + await sharingTab.setCheckbox('Hide download', true) + await sharingTab.save() // Still set when the editor is opened again … await sharingTab.openLinkShareDetails() diff --git a/tests/playwright/support/sections/SharingTab.ts b/tests/playwright/support/sections/SharingTab.ts index 06d8a60bfd07e..9938ca28732b3 100644 --- a/tests/playwright/support/sections/SharingTab.ts +++ b/tests/playwright/support/sections/SharingTab.ts @@ -216,24 +216,14 @@ export class SharingTab { * whose real input is visually hidden, hence the forced check plus an explicit * state assertion. * - * Some public-share options ("Hide download") are queued for saving the moment - * they change rather than when the editor is saved — pass `persists` for those - * so the update is awaited here, and close the editor with - * {@link closeDetails} instead of {@link save} afterwards. - * * @param name - The checkbox label * @param checked - The state to set - * @param options - `persists` awaits the share update the toggle triggers */ - async setCheckbox(name: string | RegExp, checked: boolean, { persists = false }: { persists?: boolean } = {}): Promise { - const updated = persists - ? this.page.waitForResponse((r) => r.request().method() === 'PUT' && r.url().includes(SHARES_API)) - : undefined + async setCheckbox(name: string | RegExp, checked: boolean): Promise { const box = this.checkbox(name) await box.scrollIntoViewIfNeeded() await box.setChecked(checked, { force: true }) await expect(box).toBeChecked({ checked }) - await updated } /** The note-to-recipient text area (only rendered once its checkbox is on). */ @@ -270,16 +260,6 @@ export class SharingTab { return this.panel().getByRole('button', { name: /^(Save|Update|Create) share$/ }) } - /** - * Leave the open editor through its save button without expecting a request — - * for edits that were already persisted when they were made (see - * {@link setCheckbox}). Returns once the share list is back. - */ - async closeDetails(): Promise { - await this.saveButton().click() - await expect(this.saveButton()).toBeHidden() - } - /** * Save the open editor and wait for the share request to land, returning its * parsed OCS payload so callers can assert on the stored share (e.g. its From 9091f4667efb86c5eb5e58ba5d9a97647853e1dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Calvi=C3=B1o=20S=C3=A1nchez?= Date: Tue, 11 Aug 2026 13:39:20 +0200 Subject: [PATCH 02/10] fix: Remove dead code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit "onNoteChange" is not called from anywhere, so "newNote" is never set and therefore "onNoteSubmit" does nothing. "onMenuClose" is not called from anywhere either in "SharingEntry". Signed-off-by: Daniel Calviño Sánchez --- .../src/components/SharingEntry.vue | 9 -------- .../src/components/SharingEntryLink.vue | 1 - apps/files_sharing/src/mixins/SharesMixin.js | 21 ------------------- 3 files changed, 31 deletions(-) diff --git a/apps/files_sharing/src/components/SharingEntry.vue b/apps/files_sharing/src/components/SharingEntry.vue index 24b7b3f9da6e5..28ad1d4d89f33 100644 --- a/apps/files_sharing/src/components/SharingEntry.vue +++ b/apps/files_sharing/src/components/SharingEntry.vue @@ -128,15 +128,6 @@ export default { return (typeof this.share.status === 'object' && !Array.isArray(this.share.status)) }, }, - - methods: { - /** - * Save potential changed data on menu close - */ - onMenuClose() { - this.onNoteSubmit() - }, - }, } diff --git a/apps/files_sharing/src/components/SharingEntryLink.vue b/apps/files_sharing/src/components/SharingEntryLink.vue index 7e2c22713e2d7..93df565a1f068 100644 --- a/apps/files_sharing/src/components/SharingEntryLink.vue +++ b/apps/files_sharing/src/components/SharingEntryLink.vue @@ -890,7 +890,6 @@ export default { */ onMenuClose() { this.onPasswordSubmit() - this.onNoteSubmit() }, /** diff --git a/apps/files_sharing/src/mixins/SharesMixin.js b/apps/files_sharing/src/mixins/SharesMixin.js index 651640223865a..481f8cfa5523f 100644 --- a/apps/files_sharing/src/mixins/SharesMixin.js +++ b/apps/files_sharing/src/mixins/SharesMixin.js @@ -261,27 +261,6 @@ export default { this.share.expireDate = this.formatDateToString(parsedDate) }, - /** - * Note changed, let's save it to a different key - * - * @param {string} note the share note - */ - onNoteChange(note) { - this.$set(this.share, 'newNote', note.trim()) - }, - - /** - * When the note change, we trim, save and dispatch - * - */ - onNoteSubmit() { - if (this.share.newNote) { - this.share.note = this.share.newNote - this.$delete(this.share, 'newNote') - this.queueUpdate('note') - } - }, - /** * Delete share button handler */ From e52166af9960354ced386efc6eb085760ab8a383 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Calvi=C3=B1o=20S=C3=A1nchez?= Date: Tue, 11 Aug 2026 14:00:28 +0200 Subject: [PATCH 03/10] fix: Do not update the password share when closing the menu MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The SharingDetailsTab provides buttons to cancel and save the share, so the share should be saved only when doing it explicitly. Moreover, the documentation of "onPasswordSubmit" mentions that it was saved when closing the menu because the password is the only property that is not automatically synced, so this was clearly a legacy behaviour. Signed-off-by: Daniel Calviño Sánchez --- .../src/components/SharingEntryLink.vue | 26 +------------------ 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/apps/files_sharing/src/components/SharingEntryLink.vue b/apps/files_sharing/src/components/SharingEntryLink.vue index 93df565a1f068..dbd68b0c74b18 100644 --- a/apps/files_sharing/src/components/SharingEntryLink.vue +++ b/apps/files_sharing/src/components/SharingEntryLink.vue @@ -147,8 +147,7 @@ class="sharing-entry__actions" :aria-label="actionsTooltip" menu-align="right" - :open.sync="open" - @close="onMenuClose"> + :open.sync="open">