Skip to content

Commit

Permalink
fix(description): 5688 no need to encode filename
Browse files Browse the repository at this point in the history
Signed-off-by: Max <[email protected]>

[skip ci]
  • Loading branch information
max-nextcloud authored and backportbot[bot] committed Apr 22, 2024
1 parent 6423302 commit 6b84f24
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
8 changes: 8 additions & 0 deletions cypress/e2e/workspace.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,14 @@ describe('Workspace', function() {
.should('contain', 'Hello world')
})

it('creates description with localized name properly rendered', function() {
cy.modifyUser(user, 'language', 'es')
cy.visitTestFolder()
cy.createDescription('Añadir descripción a carpeta')
cy.getFile('Léeme.md')
cy.get('#rich-workspace .editor__content').should('be.visible')
})

it('ignores localized file name in other language', function() {
cy.modifyUser(user, 'language', 'fr')
cy.uploadFile('test.md', 'text/markdown', `${this.testFolder}/Anleitung.md`)
Expand Down
2 changes: 1 addition & 1 deletion cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ Cypress.Commands.add('showHiddenFiles', (value = true) => {
})
})

Cypress.Commands.add('createDescription', () => {
Cypress.Commands.add('createDescription', (buttonLabel = 'Add folder description') => {
const url = '**/remote.php/dav/files/**'
cy.intercept({ method: 'PUT', url })
.as('addDescription')
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ export const addMenuRichWorkspace = () => {
})
const fileid = parseInt(response.headers['oc-fileid'])
const file = new File({
source: context.source + '/' + encodeURIComponent(descriptionFile),
source: context.source + '/' + descriptionFile,
id: fileid,
mtime: new Date(),
mime: 'text/markdown',
Expand Down

0 comments on commit 6b84f24

Please sign in to comment.