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

[#46057] There is no empty status for empty folders

Eric Schubertcce4af8eff09
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 66aeef9a641..682756053df 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
@@ -13,6 +13,7 @@
<ng-container *ngIf="(loading$ | async) === false; else loadingTemplate">
<ul
+ *ngIf="(listItems$ | async).length > 0; else emptyTemplate"
class="spot-list spot-list_compact op-file-list op-file-picker--scrollable-content"
data-qa-selector="op-files-picker-modal--file-list"
>
@@ -29,6 +30,13 @@
<ng-template #loadingTemplate>
<op-loading-file-list class="spot-body-big"></op-loading-file-list>
</ng-template>
+
+ <ng-template #emptyTemplate>
+ <div class="spot-body-big spot-body-big_bold op-file-picker--empty">
+ <span class="spot-icon spot-icon_folder-open op-file-picker--empty-icon"></span>
+ <span [textContent]="text.content.empty"></span>
+ </div>
+ </ng-template>
</div>
<div class="spot-action-bar">
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 a6e25fdb3a5..c8e801e751f 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
@@ -58,6 +58,9 @@ import { HttpErrorResponse } from '@angular/common/http';
export class FilePickerModalComponent extends FilePickerBaseModalComponent {
public readonly text = {
header: this.i18n.t('js.storages.file_links.select'),
+ content: {
+ empty: this.i18n.t('js.storages.files.empty_folder'),
+ },
buttons: {
submit: (count:number):string => this.i18n.t('js.storages.file_links.selection', { count }),
cancel: this.i18n.t('js.button_cancel'),
diff --git a/frontend/src/app/shared/components/storages/location-picker-modal/location-picker-modal.component.html b/frontend/src/app/shared/components/storages/location-picker-modal/location-picker-modal.component.html
index b0a905e0604..8ba223626de 100644
--- a/frontend/src/app/shared/components/storages/location-picker-modal/location-picker-modal.component.html
+++ b/frontend/src/app/shared/components/storages/location-picker-modal/location-picker-modal.component.html
@@ -13,6 +13,7 @@
<ng-container *ngIf="(loading$ | async) === false; else loadingTemplate">
<ul
+ *ngIf="(listItems$ | async).length > 0; else emptyTemplate"
class="spot-list spot-list_compact op-file-list op-file-picker--scrollable-content"
data-qa-selector="op-files-picker-modal--file-list"
>
@@ -29,6 +30,14 @@
<ng-template #loadingTemplate>
<op-loading-file-list class="spot-body-big"></op-loading-file-list>
</ng-template>
+
+ <ng-template #emptyTemplate>
+ <div class="spot-body-big spot-body-big_bold op-file-picker--empty">
+ <span class="spot-icon spot-icon_folder-open op-file-picker--empty-icon"></span>
+ <span [textContent]="text.content.empty"></span>
+ <span class="spot-body-small op-file-picker--empty-sub-text" [textContent]="text.content.emptyHint"></span>
+ </div>
+ </ng-template>
</div>
<div class="spot-action-bar">
diff --git a/frontend/src/app/shared/components/storages/location-picker-modal/location-picker-modal.component.ts b/frontend/src/app/shared/components/storages/location-picker-modal/location-picker-modal.component.ts
index 55fde0ccd73..42498c40147 100644
--- a/frontend/src/app/shared/components/storages/location-picker-modal/location-picker-modal.component.ts
+++ b/frontend/src/app/shared/components/storages/location-picker-modal/location-picker-modal.component.ts
@@ -58,6 +58,10 @@ export class LocationPickerModalComponent extends FilePickerBaseModalComponent {
public readonly text = {
header: this.i18n.t('js.storages.select_location'),
+ content: {
+ empty: this.i18n.t('js.storages.files.empty_folder'),
+ emptyHint: this.i18n.t('js.storages.files.empty_folder_location_hint'),
+ },
buttons: {
submit: this.i18n.t('js.storages.choose_location'),
submitEmptySelection: this.i18n.t('js.storages.file_links.selection_none'),
diff --git a/frontend/src/global_styles/content/work_packages/shared/_file_picker.sass b/frontend/src/global_styles/content/work_packages/shared/_file_picker.sass
index 3063f960f3c..559103ee5a3 100644
--- a/frontend/src/global_styles/content/work_packages/shared/_file_picker.sass
+++ b/frontend/src/global_styles/content/work_packages/shared/_file_picker.sass
@@ -41,3 +41,21 @@
@media #{$spot-mq-desktop}
height: 50vh
max-height: 32rem
+
+ &--empty
+ display: flex
+ flex-direction: column
+ align-items: center
+ justify-content: center
+ height: 100%
+ text-align: center
+
+ &-icon
+ width: 9.5rem
+ height: 9.5rem
+ font-size: 5.5rem
+ margin-bottom: $spot-spacing-0_25
+ color: $spot-color-basic-gray-4
+
+ &-sub-text
+ color: $spot-color-basic-gray-3
diff --git a/modules/storages/config/locales/js-en.yml b/modules/storages/config/locales/js-en.yml
index 949bc76307d..99299e758f5 100644
--- a/modules/storages/config/locales/js-en.yml
+++ b/modules/storages/config/locales/js-en.yml
@@ -31,6 +31,8 @@ en:
files:
directory_not_writeable: "You do not have to permission to add files to this folder."
dragging_many_files: "The upload to %{storageType} supports only one file at once."
+ empty_folder: "This folder is empty."
+ empty_folder_location_hint: "Click the button below to upload the file to this location."
file_not_selectable_location: "Selecting a file is not possible in the process of choosing a location."
file_links: