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

[stable29] fix(description): 5688 no need to encode filename #5719

Merged
merged 1 commit into from
May 2, 2024
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
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
Loading