mirror of
https://github.com/nextcloud/server.git
synced 2026-06-10 17:23:59 -04:00
Merge pull request #53567 from nextcloud/fix/files-plural
fix(files): add plural form for selected nodes
This commit is contained in:
commit
da7a9024ed
9 changed files with 18 additions and 15 deletions
|
|
@ -21,7 +21,9 @@
|
|||
</template>
|
||||
|
||||
<template v-if="!isNoneSelected" #header-overlay>
|
||||
<span class="files-list__selected">{{ t('files', '{count} selected', { count: selectedNodes.length }) }}</span>
|
||||
<span class="files-list__selected">
|
||||
{{ n('files', '{count} selected', '{count} selected', selectedNodes.length, { count: selectedNodes.length }) }}
|
||||
</span>
|
||||
<FilesListTableHeaderActions :current-view="currentView"
|
||||
:selected-nodes="selectedNodes" />
|
||||
</template>
|
||||
|
|
@ -68,7 +70,7 @@ import type { Location } from 'vue-router'
|
|||
import { Folder, Permission, View, getFileActions, FileType } from '@nextcloud/files'
|
||||
import { showError } from '@nextcloud/dialogs'
|
||||
import { subscribe, unsubscribe } from '@nextcloud/event-bus'
|
||||
import { translate as t } from '@nextcloud/l10n'
|
||||
import { n, t } from '@nextcloud/l10n'
|
||||
import { useHotKey } from '@nextcloud/vue/composables/useHotKey'
|
||||
import { defineComponent } from 'vue'
|
||||
|
||||
|
|
@ -140,6 +142,7 @@ export default defineComponent({
|
|||
selectionStore,
|
||||
userConfigStore,
|
||||
|
||||
n,
|
||||
t,
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ describe('files: Select all files', { testIsolation: true }, () => {
|
|||
|
||||
selectAllFiles()
|
||||
|
||||
cy.get('.files-list__selected').should('have.text', '7 selected')
|
||||
cy.get('.files-list__selected').should('contain.text', '7 selected')
|
||||
cy.get('[data-cy-files-list-row-checkbox]').findByRole('checkbox').should('be.checked')
|
||||
|
||||
deselectAllFiles()
|
||||
|
|
@ -59,7 +59,7 @@ describe('files: Select all files', { testIsolation: true }, () => {
|
|||
|
||||
randomFiles.forEach(name => selectRowForFile(name))
|
||||
|
||||
cy.get('.files-list__selected').should('have.text', `${randomFiles.length} selected`)
|
||||
cy.get('.files-list__selected').should('contain.text', `${randomFiles.length} selected`)
|
||||
cy.get('[data-cy-files-list-row-checkbox] input[type="checkbox"]:checked').should('have.length', randomFiles.length)
|
||||
})
|
||||
|
||||
|
|
@ -70,7 +70,7 @@ describe('files: Select all files', { testIsolation: true }, () => {
|
|||
selectRowForFile('readme.md')
|
||||
cy.window().trigger('keyup', { key: 'ShiftLeft', shiftKey: true })
|
||||
|
||||
cy.get('.files-list__selected').should('have.text', '4 selected')
|
||||
cy.get('.files-list__selected').should('contain.text', '4 selected')
|
||||
cy.get('[data-cy-files-list-row-checkbox] input[type="checkbox"]:checked').should('have.length', 4)
|
||||
|
||||
})
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ describe('files_trashbin: download files', { testIsolation: true }, () => {
|
|||
it('does not offer bulk download', () => {
|
||||
cy.get('[data-cy-files-list-row-checkbox]').should('have.length', 2)
|
||||
selectAllFiles()
|
||||
cy.get('.files-list__selected').should('have.text', '2 selected')
|
||||
cy.get('.files-list__selected').should('contain.text', '2 selected')
|
||||
cy.get('[data-cy-files-list-selection-action="restore"]').should('be.visible')
|
||||
cy.get('[data-cy-files-list-selection-action="download"]').should('not.exist')
|
||||
})
|
||||
|
|
|
|||
4
dist/7729-7729.js
vendored
4
dist/7729-7729.js
vendored
File diff suppressed because one or more lines are too long
2
dist/7729-7729.js.map
vendored
2
dist/7729-7729.js.map
vendored
File diff suppressed because one or more lines are too long
4
dist/files-init.js
vendored
4
dist/files-init.js
vendored
File diff suppressed because one or more lines are too long
2
dist/files-init.js.map
vendored
2
dist/files-init.js.map
vendored
File diff suppressed because one or more lines are too long
4
dist/files-main.js
vendored
4
dist/files-main.js
vendored
File diff suppressed because one or more lines are too long
2
dist/files-main.js.map
vendored
2
dist/files-main.js.map
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue