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

[#43698] added select all button to file picker

Eric Schubertfe8f1d94ad10
diff --git a/frontend/src/app/shared/components/file-links/file-picker-modal/file-picker-modal.component.ts b/frontend/src/app/shared/components/file-links/file-picker-modal/file-picker-modal.component.ts
index f0bf15b91cc..4a10d40363b 100644
--- a/frontend/src/app/shared/components/file-links/file-picker-modal/file-picker-modal.component.ts
+++ b/frontend/src/app/shared/components/file-links/file-picker-modal/file-picker-modal.component.ts
@@ -73,6 +73,7 @@ export class FilePickerModalComponent extends OpModalComponent implements OnInit
submit: ():string => this.i18n.t('js.storages.file_links.selection_any', { number: this.selectedFileCount }),
submitEmptySelection: this.i18n.t('js.storages.file_links.selection_none'),
cancel: this.i18n.t('js.button_cancel'),
+ selectAll: this.i18n.t('js.storages.file_links.select_all'),
},
};
@@ -148,6 +149,21 @@ export class FilePickerModalComponent extends OpModalComponent implements OnInit
this.service.close();
}
+ public selectAllOfCurrentLevel():void {
+ this.storageFiles$
+ .pipe(take(1))
+ .subscribe((files) => {
+ files.forEach((file) => {
+ const id = file.id as string;
+ if (!this.selection.has(id) && !this.isAlreadyLinked(file)) {
+ this.selection.add(id);
+ }
+ });
+
+ this.storageFiles$.next(files);
+ });
+ }
+
public changeSelection(file:IStorageFile):void {
const fileId = file.id as string;
if (this.selection.has(fileId)) {
diff --git a/frontend/src/app/shared/components/file-links/file-picker-modal/file-picker-modal.html b/frontend/src/app/shared/components/file-links/file-picker-modal/file-picker-modal.html
index 606bbd79ea6..4a49e0bdb6f 100644
--- a/frontend/src/app/shared/components/file-links/file-picker-modal/file-picker-modal.html
+++ b/frontend/src/app/shared/components/file-links/file-picker-modal/file-picker-modal.html
@@ -39,6 +39,16 @@
</div>
<div class="spot-action-bar">
+ <div class="spot-action-bar--left">
+ <button
+ type="button"
+ class="spot-link spot-action-bar--action"
+ (click)="selectAllOfCurrentLevel()"
+ >
+ <span class="spot-icon spot-icon_checkmark"></span>
+ <span [textContent]="text.buttons.selectAll"></span>
+ </button>
+ </div>
<div class="spot-action-bar--right">
<button
type="button"
diff --git a/frontend/src/stories/ActionBarMoreButtons.example.html b/frontend/src/stories/ActionBarMoreButtons.example.html
index ade68208cfb..8768869ef7f 100644
--- a/frontend/src/stories/ActionBarMoreButtons.example.html
+++ b/frontend/src/stories/ActionBarMoreButtons.example.html
@@ -19,7 +19,7 @@
class="spot-action-bar--action button"
>
<span [textContent]="'More'"></span>
- <span class="spot-icon spot-icon_arrow-down1"></span>
+ <span class="spot-icon spot-icon_pulldown"></span>
</button>
</div>
</div>
diff --git a/modules/storages/config/locales/js-en.yml b/modules/storages/config/locales/js-en.yml
index ce94fe7ce59..243a3561e0b 100644
--- a/modules/storages/config/locales/js-en.yml
+++ b/modules/storages/config/locales/js-en.yml
@@ -34,6 +34,7 @@ en:
and only removes the connection to this work package.
remove_short: "Remove link"
select: "Select files"
+ select_all: "Select all"
selection_none: "Select files to link"
selection_any: "Link %{number} files"
not_allowed_tooltip: "Please log in to Nextcloud to access this file"