Skip to content
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
fix(description): 5688 no need to encode filename
Signed-off-by: Max <[email protected]>
  • Loading branch information
max-nextcloud committed Apr 22, 2024
commit 17450ca8aed3a6dc7431e8ab3ffa7e6c55643d30
8 changes: 8 additions & 0 deletions cypress/e2e/workspace.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,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
4 changes: 2 additions & 2 deletions cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -542,14 +542,14 @@ 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')

cy.get('[data-cy-files-list] tr[data-cy-files-list-row-name="Readme.md"]').should('not.exist')
cy.get('[data-cy-upload-picker] button.action-item__menutoggle').click()
cy.get('li.upload-picker__menu-entry button').contains('Add folder description').click()
cy.get('li.upload-picker__menu-entry button').contains(buttonLabel).click()

cy.wait('@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 @@ -160,7 +160,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