Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

[#44954] Submit button display text

Eric Schubert83bd9be37bbd
diff --git a/frontend/src/app/shared/components/storages/file-picker-modal/file-picker-modal.component.html b/frontend/src/app/shared/components/storages/file-picker-modal/file-picker-modal.component.html
index 565c9cee24c..a69ff168466 100644
--- a/frontend/src/app/shared/components/storages/file-picker-modal/file-picker-modal.component.html
+++ b/frontend/src/app/shared/components/storages/file-picker-modal/file-picker-modal.component.html
@@ -67,7 +67,7 @@
(click)="createSelectedFileLinks()"
>
<span class="spot-icon spot-icon_add-link"></span>
- <span>{{selectedFileCount > 0 ? text.buttons.submit() : text.buttons.submitEmptySelection}}</span>
+ <span>{{text.buttons.submit(selectedFileCount)}}</span>
</button>
</div>
</div>
diff --git a/frontend/src/app/shared/components/storages/file-picker-modal/file-picker-modal.component.ts b/frontend/src/app/shared/components/storages/file-picker-modal/file-picker-modal.component.ts
index 3461af07250..f04a9746749 100644
--- a/frontend/src/app/shared/components/storages/file-picker-modal/file-picker-modal.component.ts
+++ b/frontend/src/app/shared/components/storages/file-picker-modal/file-picker-modal.component.ts
@@ -61,8 +61,7 @@ export class FilePickerModalComponent extends FilePickerBaseModalComponent {
header: this.i18n.t('js.storages.file_links.select'),
buttons: {
openStorage: ():string => this.i18n.t('js.storages.open_storage', { storageType: this.locals.storageTypeName as string }),
- submit: ():string => this.i18n.t('js.storages.file_links.selection_any', { number: this.selectedFileCount }),
- submitEmptySelection: this.i18n.t('js.storages.file_links.selection_none'),
+ submit: (count:number):string => this.i18n.t('js.storages.file_links.selection', { count }),
cancel: this.i18n.t('js.button_cancel'),
selectAll: this.i18n.t('js.storages.file_links.select_all'),
},
diff --git a/modules/storages/config/locales/js-en.yml b/modules/storages/config/locales/js-en.yml
index 64deaa498bd..e67396d352a 100644
--- a/modules/storages/config/locales/js-en.yml
+++ b/modules/storages/config/locales/js-en.yml
@@ -38,8 +38,10 @@ en:
remove_short: "Remove link"
select: "Select files"
select_all: "Select all"
- selection_none: "Select files to link"
- selection_any: "Link %{number} files"
+ selection:
+ zero: "Select files to link"
+ one: "Link 1 file"
+ other: "Link %{count} files"
not_allowed_tooltip: "Please log in to Nextcloud to access this file"
already_linked_file: "This file is already linked to this work package."
already_linked_directory: "This directory is already linked to this work package."
diff --git a/modules/storages/spec/support/components/file_picker_dialog.rb b/modules/storages/spec/support/components/file_picker_dialog.rb
index 525cfa0b006..4d3bc92eef7 100644
--- a/modules/storages/spec/support/components/file_picker_dialog.rb
+++ b/modules/storages/spec/support/components/file_picker_dialog.rb
@@ -42,12 +42,13 @@ module Components
def confirm_button_state(selection_count:)
page.within(container) do
- if selection_count > 0
- expect(page).to have_button(disabled: false,
- exact_text: I18n.t('js.storages.file_links.selection_any', number: selection_count))
- else
+ case selection_count
+ when 0
expect(page).to have_button(disabled: true,
- exact_text: I18n.t('js.storages.file_links.selection_none'))
+ exact_text: I18n.t('js.storages.file_links.selection.zero'))
+ else
+ expect(page).to have_button(disabled: false,
+ exact_text: I18n.t('js.storages.file_links.selection', count: selection_count))
end
end
end