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

[#667008] introduced more icons for files tab

Eric Schubert466bcdbd393a
diff --git a/frontend/src/app/shared/components/attachments/attachment-list/attachment-list-item.component.html b/frontend/src/app/shared/components/attachments/attachment-list/attachment-list-item.component.html
index e98706b085e..29c83683267 100644
--- a/frontend/src/app/shared/components/attachments/attachment-list/attachment-list-item.component.html
+++ b/frontend/src/app/shared/components/attachments/attachment-list/attachment-list-item.component.html
@@ -11,48 +11,99 @@
class="spot-list--item-title op-file-list--item-title"
data-test-selector="op-files-tab--file-list-item-title"
>
- <span
- *ngIf="attachment.status === 'quarantined'"
- class="spot-icon spot-icon_bug op-files-tab-icon"></span>
- <span
- *ngIf="attachment.status !== 'quarantined'"
- class="spot-icon spot-icon_{{fileIcon.icon}} op-files-tab--icon op-files-tab--icon_{{fileIcon.clazz}}"
- ></span>
+ @if (attachment.status === 'quarantined') {
+ <svg bug-icon size="small" class="op-files-tab--icon op-files-tab--icon_{{fileIcon.clazz}}"></svg>
+ } @else {
+ @switch (fileIcon.icon) {
+ @case ('file-media') {
+ <svg
+ file-media-icon
+ size="small"
+ class="op-files-tab--icon op-files-tab--icon_{{fileIcon.clazz}}"
+ ></svg>
+ }
+ @case ('op-file-csv') {
+ <svg
+ op-file-csv-icon
+ size="small"
+ class="op-files-tab--icon op-files-tab--icon_{{fileIcon.clazz}}"
+ ></svg>
+ }
+ @case ('op-file-doc') {
+ <svg
+ op-file-doc-icon
+ size="small"
+ class="op-files-tab--icon op-files-tab--icon_{{fileIcon.clazz}}"
+ ></svg>
+ }
+ @case ('op-file-presentation') {
+ <svg
+ op-file-presentation-icon
+ size="small"
+ class="op-files-tab--icon op-files-tab--icon_{{fileIcon.clazz}}"
+ ></svg>
+ }
+ @case ('op-file-sheet') {
+ <svg
+ op-file-sheet-icon
+ size="small"
+ class="op-files-tab--icon op-files-tab--icon_{{fileIcon.clazz}}"
+ ></svg>
+ }
+ @case ('op-file-text') {
+ <svg
+ op-file-text-icon
+ size="small"
+ class="op-files-tab--icon op-files-tab--icon_{{fileIcon.clazz}}"
+ ></svg>
+ }
+ @case ('op-pdf') {
+ <svg
+ op-pdf-icon
+ size="small"
+ class="op-files-tab--icon op-files-tab--icon_{{fileIcon.clazz}}"
+ ></svg>
+ }
+ @default {
+ <svg
+ file-icon
+ size="small"
+ class="op-files-tab--icon op-files-tab--icon_{{fileIcon.clazz}}"
+ ></svg>
+ }
+ }
+ }
<span [textContent]="attachment.fileName"></span>
</div>
- <span
- *ngIf="showTimestamp"
- class="op-file-list--item-text hide-when-print"
- [textContent]="timestampText"
- ></span>
+ @if (showTimestamp) {
+ <span class="op-file-list--item-text hide-when-print" [textContent]="timestampText"></span>
+ }
- <div
- #avatar
- class="op-file-list--item-avatar"
- ></div>
+ <div #avatar class="op-file-list--item-avatar"></div>
</a>
- <div
- class="spot-list--item-floating-actions op-file-list--item-floating-actions hidden-for-mobile"
- >
- <a
- *ngIf="!!attachment._links.originOpen"
- class="spot-link"
- [href]="attachment._links.staticDownloadLocation.href"
- target="_blank"
- >
- <span class="spot-icon spot-icon_download-arrow"></span>
- </a>
- <button
- *ngIf="showDelete && !!attachment._links.delete"
- type="button"
- class="spot-link"
- [title]="deleteIconTitle"
- (click)="confirmRemoveAttachment()"
- >
- <span class="spot-icon spot-icon_delete"></span>
- </button>
+
+ <div class="spot-list--item-floating-actions op-file-list--item-floating-actions hidden-for-mobile">
+ @if (!!attachment._links.originOpen) {
+ <a
+ class="spot-link"
+ [href]="attachment._links.staticDownloadLocation.href"
+ target="_blank"
+ >
+ <svg download-icon size="small" class="octicon"></svg>
+ </a>
+ }
+ @if (showDelete && !!attachment._links.delete) {
+ <button
+ type="button"
+ class="spot-link"
+ [title]="deleteIconTitle"
+ (click)="confirmRemoveAttachment()"
+ >
+ <svg trash-icon size="small" class="octicon"></svg>
+ </button>
+ }
</div>
</div>
diff --git a/frontend/src/app/shared/components/icon/icon.module.ts b/frontend/src/app/shared/components/icon/icon.module.ts
index fe01d4cfa5f..ea2003fe97d 100644
--- a/frontend/src/app/shared/components/icon/icon.module.ts
+++ b/frontend/src/app/shared/components/icon/icon.module.ts
@@ -59,29 +59,68 @@ import {
ArrowLeftIconComponent,
GrabberIconComponent,
PlusIconComponent,
+ OpFileCsvIconComponent,
+ OpFileDocIconComponent,
+ OpFileSheetIconComponent,
+ OpFileTextIconComponent,
+ OpFilePresentationIconComponent,
+ OpPdfIconComponent,
+ CloudIconComponent,
+ DownloadIconComponent,
+ FileDirectoryFillIconComponent,
+ FileDirectoryOpenFillIconComponent,
+ ServerIconComponent,
+ FileIconComponent,
+ FileMediaIconComponent,
+ TasklistIconComponent,
+ LinkIconComponent,
+ LinkExternalIconComponent,
+ UploadIconComponent,
+ UnlinkIconComponent,
+ OpMarkNextcloudIconComponent,
+ AlertFillIconComponent,
+ BugIconComponent,
+ TrashIconComponent,
} from '@openproject/octicons-angular';
@NgModule({
imports: [
CommonModule,
+ AlertFillIconComponent,
+ BugIconComponent,
ChevronLeftIconComponent,
ChevronRightIconComponent,
ClockIconComponent,
+ CloudIconComponent,
+ DownloadIconComponent,
+ FileDirectoryFillIconComponent,
+ FileDirectoryOpenFillIconComponent,
+ FileIconComponent,
+ FileMediaIconComponent,
HomeIconComponent,
InfoIconComponent,
+ LinkIconComponent,
+ LinkExternalIconComponent,
OpAlarmIconComponent,
OpAlarmSetIconComponent,
OpCursorRectangleSelectIconComponent,
OpCursorSelectIconComponent,
OpEnterpriseAddonsIconComponent,
OpEraseIconComponent,
+ OpFileCsvIconComponent,
+ OpFileDocIconComponent,
+ OpFilePresentationIconComponent,
+ OpFileSheetIconComponent,
+ OpFileTextIconComponent,
OpFirstPersonViewIconComponent,
OpGridMenuIconComponent,
OpGroupIconComponent,
OpHierarchyIconComponent,
OpNoHierarchyIconComponent,
+ OpMarkNextcloudIconComponent,
OpOrthographicPerspectiveIconComponent,
+ OpPdfIconComponent,
OpResizerVerticalLinesIconComponent,
OpScissorsIconComponent,
OpThreedReturnDefaultIconComponent,
@@ -92,9 +131,14 @@ import {
PersonIconComponent,
QuestionIconComponent,
ScreenFullIconComponent,
+ ServerIconComponent,
ShareAndroidIconComponent,
StarFillIconComponent,
StarIconComponent,
+ TasklistIconComponent,
+ TrashIconComponent,
+ UploadIconComponent,
+ UnlinkIconComponent,
XIconComponent,
OpGitlabIssueClosedIconComponent,
@@ -133,23 +177,40 @@ import {
exports: [
OpIconComponent,
+ AlertFillIconComponent,
+ BugIconComponent,
ChevronLeftIconComponent,
ChevronRightIconComponent,
ClockIconComponent,
+ CloudIconComponent,
+ DownloadIconComponent,
+ FileDirectoryFillIconComponent,
+ FileDirectoryOpenFillIconComponent,
+ FileIconComponent,
+ FileMediaIconComponent,
HomeIconComponent,
InfoIconComponent,
+ LinkIconComponent,
+ LinkExternalIconComponent,
OpAlarmIconComponent,
OpAlarmSetIconComponent,
OpCursorRectangleSelectIconComponent,
OpCursorSelectIconComponent,
OpEnterpriseAddonsIconComponent,
OpEraseIconComponent,
+ OpFileCsvIconComponent,
+ OpFileDocIconComponent,
+ OpFilePresentationIconComponent,
+ OpFileSheetIconComponent,
+ OpFileTextIconComponent,
OpFirstPersonViewIconComponent,
OpGridMenuIconComponent,
OpGroupIconComponent,
OpHierarchyIconComponent,
OpNoHierarchyIconComponent,
+ OpMarkNextcloudIconComponent,
OpOrthographicPerspectiveIconComponent,
+ OpPdfIconComponent,
OpResizerVerticalLinesIconComponent,
OpScissorsIconComponent,
OpThreedReturnDefaultIconComponent,
@@ -160,11 +221,17 @@ import {
PersonIconComponent,
QuestionIconComponent,
ScreenFullIconComponent,
+ ServerIconComponent,
ShareAndroidIconComponent,
StarFillIconComponent,
StarIconComponent,
+ TasklistIconComponent,
+ TrashIconComponent,
+ UploadIconComponent,
+ UnlinkIconComponent,
XIconComponent,
+
OpGitlabIssueOpenIconComponent,
OpGitlabIssueClosedIconComponent,
OpGitlabLabelsIconComponent,
@@ -194,4 +261,5 @@ import {
PlusIconComponent,
],
})
+// eslint-disable-next-line @typescript-eslint/no-extraneous-class
export class IconModule {}
diff --git a/frontend/src/app/shared/components/storages/file-link-list-item/file-link-list-item.html b/frontend/src/app/shared/components/storages/file-link-list-item/file-link-list-item.html
index 91f420a18fa..fcae8436015 100644
--- a/frontend/src/app/shared/components/storages/file-link-list-item/file-link-list-item.html
+++ b/frontend/src/app/shared/components/storages/file-link-list-item/file-link-list-item.html
@@ -22,14 +22,79 @@
[href]="fileLink._links.staticOriginOpen.href"
target="_blank"
>
- <div
- class="spot-list--item-title op-file-list--item-title"
- >
- <ng-container [ngSwitch]="fileLinkIcon.icon">
- <svg *ngSwitchCase="'file'" file-icon size="small" class="op-files-tab--icon"></svg>
- <svg *ngSwitchCase="'file-media'" file-media-icon size="small" class="op-files-tab--icon"></svg>
- <svg *ngSwitchDefault file-icon size="small" class="op-files-tab--icon"></svg>
- </ng-container>
+ <div class="spot-list--item-title op-file-list--item-title">
+ @switch (fileLinkIcon.icon) {
+ @case ('file-media') {
+ <svg
+ file-media-icon
+ size="small"
+ class="op-files-tab--icon op-files-tab--icon_{{fileLinkIcon.clazz}}"
+ ></svg>
+ }
+ @case ('file-directory-fill') {
+ <svg
+ file-directory-fill-icon
+ size="small"
+ class="op-files-tab--icon op-files-tab--icon_{{fileLinkIcon.clazz}}"
+ ></svg>
+ }
+ @case ('op-file-csv') {
+ <svg
+ op-file-csv-icon
+ size="small"
+ class="op-files-tab--icon op-files-tab--icon_{{fileLinkIcon.clazz}}"
+ ></svg>
+ }
+ @case ('op-file-doc') {
+ <svg
+ op-file-doc-icon
+ size="small"
+ class="op-files-tab--icon op-files-tab--icon_{{fileLinkIcon.clazz}}"
+ ></svg>
+ }
+ @case ('op-file-presentation') {
+ <svg
+ op-file-presentation-icon
+ size="small"
+ class="op-files-tab--icon op-files-tab--icon_{{fileLinkIcon.clazz}}"
+ ></svg>
+ }
+ @case ('op-file-sheet') {
+ <svg
+ op-file-sheet-icon
+ size="small"
+ class="op-files-tab--icon op-files-tab--icon_{{fileLinkIcon.clazz}}"
+ ></svg>
+ }
+ @case ('op-file-text') {
+ <svg
+ op-file-text-icon
+ size="small"
+ class="op-files-tab--icon op-files-tab--icon_{{fileLinkIcon.clazz}}"
+ ></svg>
+ }
+ @case ('op-pdf') {
+ <svg
+ op-pdf-icon
+ size="small"
+ class="op-files-tab--icon op-files-tab--icon_{{fileLinkIcon.clazz}}"
+ ></svg>
+ }
+ @case ('server') {
+ <svg
+ server-icon
+ size="small"
+ class="op-files-tab--icon op-files-tab--icon_{{fileLinkIcon.clazz}}"
+ ></svg>
+ }
+ @default {
+ <svg
+ file-icon
+ size="small"
+ class="op-files-tab--icon op-files-tab--icon_{{fileLinkIcon.clazz}}"
+ ></svg>
+ }
+ }
<span class="ellipsis" [textContent]="fileLink.originData.name"></span>
</div>
@@ -43,35 +108,50 @@
class="op-file-list--item-avatar"
></div>
</a>
- <div
- *ngIf="floatingActions.length > 0"
- class="spot-list--item-floating-actions op-file-list--item-floating-actions hidden-for-mobile"
- >
- <ng-container *ngFor="let action of floatingActions">
- <a *ngIf="!!action.href"
- class="spot-link octicon-link"
- [title]="action.title"
- [href]="action.href.url"
- [target]="action.href.target"
- >
- <ng-container [ngSwitch]="action.iconClass">
- <svg *ngSwitchCase="'remove-link'" unlink-icon size="small" class="octicon" vertical-align="middle"></svg>
- <svg *ngSwitchCase="'download'" download-icon class="octicon" size="small" vertical-align="middle"></svg>
- <svg *ngSwitchCase="'folder-open'" file-directory-open-fill-icon class="octicon" size="small" vertical-align="middle"></svg>
- </ng-container>
- </a>
- <button *ngIf="!!action.action"
- class="spot-link octicon-link"
- [title]="action.title"
- (click)="action.action()"
- >
- <ng-container [ngSwitch]="action.iconClass">
- <svg *ngSwitchCase="'remove-link'" unlink-icon size="small" class="octicon" vertical-align="middle"></svg>
- <svg *ngSwitchCase="'download'" download-icon class="octicon" size="small" vertical-align="middle"></svg>
- <svg *ngSwitchCase="'folder-open'" file-directory-open-fill-icon class="octicon" size="small" vertical-align="middle"></svg>
- </ng-container>
- </button>
- </ng-container>
- </div>
+
+ @if (floatingActions.length > 0) {
+ <div class="spot-list--item-floating-actions op-file-list--item-floating-actions hidden-for-mobile">
+ @for (action of floatingActions; track action) {
+ @if (!!action.href) {
+ <a
+ class="spot-link spot-link_octicon"
+ [title]="action.title"
+ [href]="action.href.url"
+ [target]="action.href.target"
+ >
+ <ng-container
+ [ngTemplateOutlet]="floatingAction"
+ [ngTemplateOutletContext]="{icon:action.iconClass}"
+ ></ng-container>
+ </a>
+ } @else if (!!action.action) {
+ <button
+ class="spot-link spot-link_octicon"
+ [title]="action.title"
+ (click)="action.action()"
+ >
+ <ng-container
+ [ngTemplateOutlet]="floatingAction"
+ [ngTemplateOutletContext]="{icon:action.iconClass}"
+ ></ng-container>
+ </button>
+ }
+ }
+
+ <ng-template #floatingAction let-iconClass="icon">
+ @switch (iconClass) {
+ @case ('remove-link') {
+ <svg unlink-icon size="small" class="octicon"></svg>
+ }
+ @case ('download') {
+ <svg download-icon size="small" class="octicon"></svg>
+ }
+ @case ('folder-open') {
+ <svg file-directory-open-fill-icon size="small" class="octicon"></svg>
+ }
+ }
+ </ng-template>
+ </div>
+ }
</ng-container>
</spot-tooltip>
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 b000450c93f..519261e9e24 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
@@ -3,96 +3,89 @@
data-test-selector="op-files-picker-modal"
>
<div class="spot-modal--header">
- <span id="spotModalTitle" class="spot-modal--header-title">{{text.header}}</span>
+ <span id="spotModalTitle" class="spot-modal--header-title">{{ text.header }}</span>
</div>
<div class="spot-divider"></div>
<div class="spot-modal--body spot-container op-file-picker--modal-body">
- <div
- *ngIf="(showAlert | async) !== 'none'"
- class="op-toast -warning"
- >
- <div class="op-toast--content">
- <p>{{alertText | async}}</p>
- <button
- class="spot-link op-toast--close"
- (click)="closeAlert()"
- >
- <svg x-icon size="small"></svg>
- </button>
+ @if ((showAlert | async) !== 'none') {
+ <div class="op-toast -warning">
+ <div class="op-toast--content">
+ <p>{{ alertText | async }}</p>
+ <button class="spot-link op-toast--close" (click)="closeAlert()">
+ <svg x-icon size="small"></svg>
+ </button>
+ </div>
</div>
- </div>
+ }
<spot-breadcrumbs [content]="breadcrumbs"></spot-breadcrumbs>
- <ng-container *ngIf="(loading$ | async) === 'success'; then listTemplate"></ng-container>
- <ng-container *ngIf="(loading$ | async) === 'error'; then notFoundTemplate"></ng-container>
- <ng-container *ngIf="(loading$ | async) === 'loading'; then loadingTemplate"></ng-container>
-
- <ng-template #listTemplate>
- <ul
- *ngIf="(listItems$ | async).length > 0; else emptyTemplate"
- class="spot-list spot-list_compact op-file-list op-file-picker--scrollable-content"
- data-test-selector="op-files-picker-modal--file-list"
- >
- <li
- *ngFor="let file of listItems$ | async; let i = index;"
- class="spot-list--item op-file-list--item"
- data-test-selector="op-file-list--item"
- op-storage-file-list-item
- [content]="file"
- ></li>
- </ul>
- </ng-template>
-
- <ng-template #loadingTemplate>
- <op-loading-file-list class="spot-body-small"></op-loading-file-list>
- </ng-template>
-
- <ng-template #emptyTemplate>
- <div class="spot-body-small spot-body-small_bold op-file-picker--info">
- <svg
- class="op-file-picker--info-icon"
- file-directory-fill-icon
- size="small"
- ></svg>
- <span [textContent]="text.content.empty"></span>
- </div>
- </ng-template>
-
- <ng-template #notFoundTemplate>
- <div class="spot-body-small spot-body-small_bold op-file-picker--info">
- <svg x-circle-icon size="small" class="op-file-picker--info-icon"></svg>
- <span [textContent]="text.content.noConnection(storageType)"></span>
- <span class="spot-body-small op-file-picker--info-sub-text"
- [textContent]="text.content.noConnectionHint(storageType)"></span>
- </div>
- </ng-template>
+ @switch (loading$ | async) {
+ @case ('success') {
+ @if ((listItems$ | async).length > 0) {
+ <ul
+ class="spot-list spot-list_compact op-file-list op-file-picker--scrollable-content"
+ data-test-selector="op-files-picker-modal--file-list"
+ >
+ @for (file of listItems$ | async; track file.storageFile.id) {
+ <li
+ class="spot-list--item op-file-list--item"
+ data-test-selector="op-file-list--item"
+ op-storage-file-list-item
+ [content]="file"
+ ></li>
+ }
+ </ul>
+ } @else {
+ <div class="spot-body-small spot-body-small_bold op-file-picker--info">
+ <svg
+ class="op-file-picker--info-icon"
+ file-directory-fill-icon
+ size="small"
+ ></svg>
+ <span [textContent]="text.content.empty"></span>
+ </div>
+ }
+ }
+ @case ('error') {
+ <div class="spot-body-small spot-body-small_bold op-file-picker--info">
+ <svg x-circle-icon size="small" class="op-file-picker--info-icon"></svg>
+ <span [textContent]="text.content.noConnection(storageType)"></span>
+ <span class="spot-body-small op-file-picker--info-sub-text"
+ [textContent]="text.content.noConnectionHint(storageType)"></span>
+ </div>
+ }
+ @case ('loading') {
+ <op-loading-file-list class="spot-body-small"></op-loading-file-list>
+ }
+ }
</div>
<div class="spot-action-bar">
- <div
- *ngIf="showSelectAll"
- class="spot-action-bar--left"
- >
- <button
- type="button"
- class="spot-link spot-action-bar--action"
- data-test-selector="op-files-picker-modal--select-all"
- (click)="selectAllOfCurrentLevel()"
- >
- <svg tasklist-icon size="small" class="octicon"></svg>
- <span [textContent]="text.buttons.selectAll"></span>
- </button>
- </div>
+ @if (showSelectAll) {
+ <div class="spot-action-bar--left">
+ <button
+ type="button"
+ class="spot-link spot-action-bar--action"
+ data-test-selector="op-files-picker-modal--select-all"
+ (click)="selectAllOfCurrentLevel()"
+ >
+ <svg tasklist-icon size="small" class="octicon"></svg>
+ <span [textContent]="text.buttons.selectAll"></span>
+ </button>
+ </div>
+ }
+
<div class="spot-action-bar--right">
<button
type="button"
class="button spot-modal--cancel-button spot-action-bar--action"
- [textContent]="text.buttons.cancel"
(click)="closeMe()"
- ></button>
+ >
+ {{ text.buttons.cancel }}
+ </button>
<button
type="button"
class="button spot-action-bar--action"
@@ -102,7 +95,7 @@
(click)="createSelectedFileLinks()"
>
<svg link-icon size="small"></svg>
- <span>{{text.buttons.submit(selectedFileCount)}}</span>
+ <span>{{ text.buttons.submit(selectedFileCount) }}</span>
</button>
</div>
</div>
diff --git a/frontend/src/app/shared/components/storages/icons.mapping.ts b/frontend/src/app/shared/components/storages/icons.mapping.ts
index e0077e486f3..0f0ff768654 100644
--- a/frontend/src/app/shared/components/storages/icons.mapping.ts
+++ b/frontend/src/app/shared/components/storages/icons.mapping.ts
@@ -29,12 +29,12 @@
import { nextcloud } from 'core-app/shared/components/storages/storages-constants.const';
export interface IFileIcon {
- icon:'file'|'file-media'
+ icon:'file'|'file-directory-fill'|'file-media'|'op-file-csv'|'op-file-doc'|'op-file-presentation'|'op-file-sheet'|'op-file-text'|'op-pdf'|'server'
clazz:'pdf'|'img'|'txt'|'doc'|'sheet'|'presentation'|'form'|'primary'|'mov'|'default'
}
export const fileIconMappings:Record<string, IFileIcon> = {
- 'application/pdf': { icon: 'file', clazz: 'pdf' },
+ 'application/pdf': { icon: 'op-pdf', clazz: 'pdf' },
'image/jpeg': { icon: 'file-media', clazz: 'img' },
'image/png': { icon: 'file-media', clazz: 'img' },
@@ -48,43 +48,44 @@ export const fileIconMappings:Record<string, IFileIcon> = {
'image/avif': { icon: 'file-media', clazz: 'img' },
'image/cgm': { icon: 'file-media', clazz: 'img' },
- 'text/plain': { icon: 'file', clazz: 'txt' },
- 'text/markdown': { icon: 'file', clazz: 'txt' },
- 'text/html': { icon: 'file', clazz: 'txt' },
- 'application/rtf': { icon: 'file', clazz: 'txt' },
- 'application/xml': { icon: 'file', clazz: 'txt' },
- 'application/xhtml+xml': { icon: 'file', clazz: 'txt' },
- 'application/x-tex': { icon: 'file', clazz: 'txt' },
+ 'text/plain': { icon: 'op-file-text', clazz: 'txt' },
+ 'text/markdown': { icon: 'op-file-text', clazz: 'txt' },
+ 'text/html': { icon: 'op-file-text', clazz: 'txt' },
+ 'application/rtf': { icon: 'op-file-text', clazz: 'txt' },
+ 'application/xml': { icon: 'op-file-text', clazz: 'txt' },
+ 'application/xhtml+xml': { icon: 'op-file-text', clazz: 'txt' },
+ 'application/x-tex': { icon: 'op-file-text', clazz: 'txt' },
- 'application/vnd.oasis.opendocument.text': { icon: 'file', clazz: 'doc' },
- 'application/vnd.oasis.opendocument.text-template': { icon: 'file', clazz: 'doc' },
- 'application/msword': { icon: 'file', clazz: 'doc' },
- 'application/vnd.apple.pages': { icon: 'file', clazz: 'doc' },
- 'application/vnd.stardivision.writer': { icon: 'file', clazz: 'doc' },
- 'application/x-abiword': { icon: 'file', clazz: 'doc' },
- 'application/vnd.openxmlformats-officedocument.wordprocessingml.document': { icon: 'file', clazz: 'doc' },
- 'font/otf': { icon: 'file', clazz: 'doc' },
+ 'application/vnd.oasis.opendocument.text': { icon: 'op-file-doc', clazz: 'doc' },
+ 'application/vnd.oasis.opendocument.text-template': { icon: 'op-file-doc', clazz: 'doc' },
+ 'application/msword': { icon: 'op-file-doc', clazz: 'doc' },
+ 'application/vnd.apple.pages': { icon: 'op-file-doc', clazz: 'doc' },
+ 'application/vnd.stardivision.writer': { icon: 'op-file-doc', clazz: 'doc' },
+ 'application/x-abiword': { icon: 'op-file-doc', clazz: 'doc' },
+ 'application/vnd.openxmlformats-officedocument.wordprocessingml.document': { icon: 'op-file-doc', clazz: 'doc' },
+ 'font/otf': { icon: 'op-file-doc', clazz: 'doc' },
- 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet': { icon: 'file', clazz: 'sheet' },
- 'application/vnd.oasis.opendocument.spreadsheet': { icon: 'file', clazz: 'sheet' },
- 'application/vnd.oasis.opendocument.spreadsheet-template': { icon: 'file', clazz: 'sheet' },
- 'application/vnd.ms-excel': { icon: 'file', clazz: 'sheet' },
- 'application/vnd.stardivision.calc': { icon: 'file', clazz: 'sheet' },
- 'application/vnd.apple.numbers': { icon: 'file', clazz: 'sheet' },
- 'application/x-starcalc': { icon: 'file', clazz: 'sheet' },
- 'application/x-quattro-pro': { icon: 'file', clazz: 'sheet' },
- 'application/csv': { icon: 'file', clazz: 'sheet' },
+ 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet': { icon: 'op-file-sheet', clazz: 'sheet' },
+ 'application/vnd.oasis.opendocument.spreadsheet': { icon: 'op-file-sheet', clazz: 'sheet' },
+ 'application/vnd.oasis.opendocument.spreadsheet-template': { icon: 'op-file-sheet', clazz: 'sheet' },
+ 'application/vnd.ms-excel': { icon: 'op-file-sheet', clazz: 'sheet' },
+ 'application/vnd.stardivision.calc': { icon: 'op-file-sheet', clazz: 'sheet' },
+ 'application/vnd.apple.numbers': { icon: 'op-file-sheet', clazz: 'sheet' },
+ 'application/x-starcalc': { icon: 'op-file-sheet', clazz: 'sheet' },
+ 'application/x-quattro-pro': { icon: 'op-file-sheet', clazz: 'sheet' },
- 'application/vnd.oasis.opendocument.presentation': { icon: 'file', clazz: 'presentation' },
- 'application/vnd.oasis.opendocument.presentation-template': { icon: 'file', clazz: 'presentation' },
- 'application/vnd.apple.keynote': { icon: 'file', clazz: 'presentation' },
- 'application/vnd.ms-powerpoint': { icon: 'file', clazz: 'presentation' },
+ 'application/csv': { icon: 'op-file-csv', clazz: 'sheet' },
+
+ 'application/vnd.oasis.opendocument.presentation': { icon: 'op-file-presentation', clazz: 'presentation' },
+ 'application/vnd.oasis.opendocument.presentation-template': { icon: 'op-file-presentation', clazz: 'presentation' },
+ 'application/vnd.apple.keynote': { icon: 'op-file-presentation', clazz: 'presentation' },
+ 'application/vnd.ms-powerpoint': { icon: 'op-file-presentation', clazz: 'presentation' },
'application/vnd.openxmlformats-officedocument.presentationml.presentation': {
- icon: 'file',
+ icon: 'op-file-presentation',
clazz: 'presentation',
},
- 'application/vnd.stardivision.impress': { icon: 'file', clazz: 'presentation' },
- 'application/mathematica': { icon: 'file', clazz: 'presentation' },
+ 'application/vnd.stardivision.impress': { icon: 'op-file-presentation', clazz: 'presentation' },
+ 'application/mathematica': { icon: 'op-file-presentation', clazz: 'presentation' },
'video/mp4': { icon: 'file-media', clazz: 'mov' },
'video/x-m4v': { icon: 'file-media', clazz: 'mov' },
@@ -99,8 +100,8 @@ export const fileIconMappings:Record<string, IFileIcon> = {
'video/3gpp-tt': { icon: 'file-media', clazz: 'mov' },
'video/3gpp-2': { icon: 'file-media', clazz: 'mov' },
- 'application/x-op-directory': { icon: 'file', clazz: 'primary' },
- 'application/x-op-drive': { icon: 'file', clazz: 'primary' },
+ 'application/x-op-directory': { icon: 'file-directory-fill', clazz: 'primary' },
+ 'application/x-op-drive': { icon: 'server', clazz: 'primary' },
default: { icon: 'file', clazz: 'default' },
};
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 206a34a750e..f1d299068a7 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
@@ -3,72 +3,69 @@
data-test-selector="op-files-picker-modal"
>
<div class="spot-modal--header">
- <span id="spotModalTitle" class="spot-modal--header-title">{{text.header}}</span>
+ <span id="spotModalTitle" class="spot-modal--header-title">{{ text.header }}</span>
</div>
<div class="spot-divider"></div>
<div class="spot-modal--body spot-container op-file-picker--modal-body">
- <div
- *ngIf="(showAlert | async) !== 'none'"
- class="op-toast -warning"
- >
- <div class="op-toast--content">
- <p>{{alertText | async}}</p>
- <button
- class="spot-link op-toast--close"
- (click)="closeAlert()"
- >
- <svg x-icon size="small"></svg>
- </button>
+ @if ((showAlert | async) !== 'none') {
+ <div class="op-toast -warning">
+ <div class="op-toast--content">
+ <p>{{ alertText | async }}</p>
+ <button
+ class="spot-link op-toast--close"
+ (click)="closeAlert()"
+ >
+ <svg x-icon size="small"></svg>
+ </button>
+ </div>
</div>
- </div>
+ }
<spot-breadcrumbs [content]="breadcrumbs"></spot-breadcrumbs>
- <ng-container *ngIf="(loading$ | async) === 'success'; then listTemplate"></ng-container>
- <ng-container *ngIf="(loading$ | async) === 'error'; then notFoundTemplate"></ng-container>
- <ng-container *ngIf="(loading$ | async) === 'loading'; then loadingTemplate"></ng-container>
-
- <ng-template #listTemplate>
- <ul
- *ngIf="(listItems$ | async).length > 0; else emptyTemplate"
- class="spot-list spot-list_compact op-file-list op-file-picker--scrollable-content"
- data-test-selector="op-files-picker-modal--file-list"
- >
- <li
- *ngFor="let file of listItems$ | async; let i = index;"
- class="spot-list--item op-file-list--item"
- data-test-selector="op-file-list--item"
- op-storage-file-list-item
- [content]="file"
- ></li>
- </ul>
- </ng-template>
-
- <ng-template #loadingTemplate>
- <op-loading-file-list
- class="spot-body-small"
- data-test-selector="op-file-list--loading-indicator"
- ></op-loading-file-list>
- </ng-template>
-
- <ng-template #emptyTemplate>
- <div class="spot-body-small spot-body-small_bold op-file-picker--info">
- <svg file-directory-fill-icon size="small" class="op-file-picker--info-icon"></svg>
- <span [textContent]="text.content.empty"></span>
- <span class="spot-body-small op-file-picker--info-sub-text" [textContent]="text.content.emptyHint"></span>
- </div>
- </ng-template>
-
- <ng-template #notFoundTemplate>
- <div class="spot-body-small spot-body-small_bold op-file-picker--info">
- <svg x-circle-icon size="small" class="op-file-picker--info-icon"></svg>
- <span [textContent]="text.content.noConnection(storageType)"></span>
- <span class="spot-body-small op-file-picker--info-sub-text"
- [textContent]="text.content.noConnectionHint(storageType)"></span>
- </div>
- </ng-template>
+ @switch (loading$ | async) {
+ @case ('success') {
+ @if ((listItems$ | async).length > 0) {
+ <ul
+ class="spot-list spot-list_compact op-file-list op-file-picker--scrollable-content"
+ data-test-selector="op-files-picker-modal--file-list"
+ >
+ @for (file of listItems$ | async; track file.storageFile.id) {
+ <li
+ class="spot-list--item op-file-list--item"
+ data-test-selector="op-file-list--item"
+ op-storage-file-list-item
+ [content]="file"
+ ></li>
+ }
+ </ul>
+ } @else {
+ <div class="spot-body-small spot-body-small_bold op-file-picker--info">
+ <svg file-directory-fill-icon size="small" class="op-file-picker--info-icon"></svg>
+ <span [textContent]="text.content.empty"></span>
+ <span class="spot-body-small op-file-picker--info-sub-text" [textContent]="text.content.emptyHint"></span>
+ </div>
+ }
+ }
+ @case ('error') {
+ <div class="spot-body-small spot-body-small_bold op-file-picker--info">
+ <svg x-circle-icon size="small" class="op-file-picker--info-icon"></svg>
+ <span [textContent]="text.content.noConnection(storageType)"></span>
+ <span
+ class="spot-body-small op-file-picker--info-sub-text"
+ [textContent]="text.content.noConnectionHint(storageType)"
+ ></span>
+ </div>
+ }
+ @case ('loading') {
+ <op-loading-file-list
+ class="spot-body-small"
+ data-test-selector="op-file-list--loading-indicator"
+ ></op-loading-file-list>
+ }
+ }
</div>
<div class="spot-action-bar">
@@ -87,9 +84,10 @@
<button
type="button"
class="button spot-action-bar--action"
- [textContent]="text.buttons.cancel"
(click)="closeMe()"
- ></button>
+ >
+ {{ text.buttons.cancel }}
+ </button>
<button
type="button"
class="button spot-action-bar--action -primary"
@@ -97,7 +95,9 @@
[disabled]="!canChooseLocation"
[textContent]="text.buttons.submit"
(click)="chooseLocation()"
- ></button>
+ >
+ {{ text.buttons.submit }}
+ </button>
</div>
</div>
</div>
diff --git a/frontend/src/app/shared/components/storages/openproject-storages.module.ts b/frontend/src/app/shared/components/storages/openproject-storages.module.ts
index 30366f43096..d4f7f96f237 100644
--- a/frontend/src/app/shared/components/storages/openproject-storages.module.ts
+++ b/frontend/src/app/shared/components/storages/openproject-storages.module.ts
@@ -64,39 +64,12 @@ import {
StorageLoginButtonComponent,
} from 'core-app/shared/components/storages/storage-login-button/storage-login-button.component';
-import {
- CloudIconComponent,
- DownloadIconComponent,
- FileDirectoryFillIconComponent,
- FileDirectoryOpenFillIconComponent,
- ServerIconComponent,
- FileIconComponent,
- FileMediaIconComponent,
- TasklistIconComponent,
- LinkIconComponent,
- UploadIconComponent,
- LinkExternalIconComponent,
- UnlinkIconComponent
-} from '@openproject/octicons-angular';
-
@NgModule({
imports: [
CommonModule,
IconModule,
OpSpotModule,
- OpSharedModule,
- CloudIconComponent,
- DownloadIconComponent,
- FileDirectoryFillIconComponent,
- FileDirectoryOpenFillIconComponent,
- ServerIconComponent,
- FileIconComponent,
- FileMediaIconComponent,
- TasklistIconComponent,
- LinkIconComponent,
- LinkExternalIconComponent,
- UploadIconComponent,
- UnlinkIconComponent
+ OpSharedModule
],
declarations: [
StorageComponent,
@@ -119,4 +92,5 @@ import {
StorageInformationService,
],
})
+// eslint-disable-next-line @typescript-eslint/no-extraneous-class
export class OpenprojectStoragesModule {}
diff --git a/frontend/src/app/shared/components/storages/storage-file-list-item/storage-file-list-item.html b/frontend/src/app/shared/components/storages/storage-file-list-item/storage-file-list-item.html
index b500614fc3a..a89a891686b 100644
--- a/frontend/src/app/shared/components/storages/storage-file-list-item/storage-file-list-item.html
+++ b/frontend/src/app/shared/components/storages/storage-file-list-item/storage-file-list-item.html
@@ -1,11 +1,5 @@
-<spot-tooltip
- [alignment]="getTooltipAlignment"
- [disabled]="!content.tooltip"
->
- <p
- slot="body"
- class="spot-body-small"
- >{{content.tooltip}}</p>
+<spot-tooltip [alignment]="getTooltipAlignment" [disabled]="!content.tooltip">
+ <p slot="body" class="spot-body-small">{{ content.tooltip }}</p>
<!-- eslint-disable-next-line @angular-eslint/template/label-has-associated-control -->
<label
@@ -13,8 +7,6 @@
class="spot-list--item-action"
data-test-selector="op-files-picker-modal--list-item"
(click)="enterDirectoryOnLabel($event)"
- (keydown.enter)="enterDirectoryOnLabel($event)"
- (keydown.space)="enterDirectoryOnLabel($event)"
tabindex="0"
role="button"
[ngClass]="{
@@ -22,54 +14,94 @@
'op-file-list--item-action_view-not-allowed': content.isConstrained
}"
>
- <spot-checkbox
- *ngIf="!!content.checkbox"
- [checked]="content.disabled || content.checkbox.selected"
- (checkedChange)="content.checkbox.changeSelection()"
- [disabled]="content.disabled"
- ></spot-checkbox>
+ @if (!!content.checkbox) {
+ <spot-checkbox
+ [checked]="content.disabled || content.checkbox.selected"
+ (checkedChange)="content.checkbox.changeSelection()"
+ [disabled]="content.disabled"
+ ></spot-checkbox>
+ }
<div class="spot-list--item-title op-file-list--item-title">
- <ng-container *ngIf="content.isDirectory; else fileIconTemplate">
- <svg
- *ngIf="content.mimeType === 'application/x-op-drive'; else folderIconTemplate"
- server-icon
- size="small"
- class="op-files-tab--icon op-files-tab--icon_primary"
- ></svg>
- <ng-template #folderIconTemplate>
+ @switch (content.icon.icon) {
+ @case ('file-media') {
+ <svg
+ file-media-icon
+ size="small"
+ class="op-files-tab--icon op-files-tab--icon_{{content.icon.clazz}}"
+ ></svg>
+ }
+ @case ('file-directory-fill') {
<svg
file-directory-fill-icon
size="small"
- class="op-files-tab--icon op-files-tab--icon_primary"
+ class="op-files-tab--icon op-files-tab--icon_{{content.icon.clazz}}"
+ ></svg>
+ }
+ @case ('op-file-csv') {
+ <svg
+ op-file-csv-icon
+ size="small"
+ class="op-files-tab--icon op-files-tab--icon_{{content.icon.clazz}}"
+ ></svg>
+ }
+ @case ('op-file-doc') {
+ <svg
+ op-file-doc-icon
+ size="small"
+ class="op-files-tab--icon op-files-tab--icon_{{content.icon.clazz}}"
+ ></svg>
+ }
+ @case ('op-file-presentation') {
+ <svg
+ op-file-presentation-icon
+ size="small"
+ class="op-files-tab--icon op-files-tab--icon_{{content.icon.clazz}}"
+ ></svg>
+ }
+ @case ('op-file-sheet') {
+ <svg
+ op-file-sheet-icon
+ size="small"
+ class="op-files-tab--icon op-files-tab--icon_{{content.icon.clazz}}"
+ ></svg>
+ }
+ @case ('op-file-text') {
+ <svg
+ op-file-text-icon
+ size="small"
+ class="op-files-tab--icon op-files-tab--icon_{{content.icon.clazz}}"
+ ></svg>
+ }
+ @case ('op-pdf') {
+ <svg
+ op-pdf-icon
+ size="small"
+ class="op-files-tab--icon op-files-tab--icon_{{content.icon.clazz}}"
></svg>
- </ng-template>
- </ng-container>
- <ng-template #fileIconTemplate>
- <ng-container [ngSwitch]="content.icon.icon">
- <svg *ngSwitchCase="'file'"
- file-icon
- size="small"
- class="op-files-tab--icon op-files-tab--icon_{{content.icon.clazz}}"></svg>
- <svg *ngSwitchCase="'file-media'"
- file-media-icon
- size="small"
- class="op-files-tab--icon op-files-tab--icon_{{content.icon.clazz}}"></svg>
- <svg *ngSwitchDefault
- file-icon
- size="small"
- class="op-files-tab--icon op-files-tab--icon_{{content.icon.clazz}}"></svg>
- </ng-container>
- </ng-template>
+ }
+ @case ('server') {
+ <svg
+ server-icon
+ size="small"
+ class="op-files-tab--icon op-files-tab--icon_{{content.icon.clazz}}"
+ ></svg>
+ }
+ @default {
+ <svg
+ file-icon
+ size="small"
+ class="op-files-tab--icon op-files-tab--icon_{{content.icon.clazz}}"
+ ></svg>
+ }
+ }
<span [textContent]="content.name"></span>
</div>
- <span
- *ngIf="!content.isDirectory"
- class="op-file-list--item-text"
- [textContent]="content.timestamp"
- ></span>
+ @if (!content.isDirectory) {
+ <span class="op-file-list--item-text" [textContent]="content.timestamp"></span>
+ }
<op-principal
*ngIf="!content.isDirectory"
@@ -80,15 +112,16 @@
[link]="false"
></op-principal>
- <button
- *ngIf="content.isDirectory"
- class="spot-link op-file-list--item-button"
- data-test-selector="op-files-picker-modal--list-item-caret"
- (click)="content.enterDirectory()"
- (keydown.enter)="content.enterDirectory()"
- (keydown.space)="content.enterDirectory()"
- >
- <svg chevron-right-icon size="small"></svg>
- </button>
+ @if (content.isDirectory) {
+ <button
+ class="spot-link op-file-list--item-button"
+ data-test-selector="op-files-picker-modal--list-item-caret"
+ (click)="content.enterDirectory()"
+ (keydown.enter)="content.enterDirectory()"
+ (keydown.space)="content.enterDirectory()"
+ >
+ <svg chevron-right-icon size="small"></svg>
+ </button>
+ }
</label>
</spot-tooltip>
diff --git a/frontend/src/app/shared/components/storages/storage-information/storage-information.html b/frontend/src/app/shared/components/storages/storage-information/storage-information.html
index 2d9022b7d97..254b7adf232 100644
--- a/frontend/src/app/shared/components/storages/storage-information/storage-information.html
+++ b/frontend/src/app/shared/components/storages/storage-information/storage-information.html
@@ -1,28 +1,29 @@
-<svg *ngIf="content.iconClass === 'warning'" alert-fill-icon size="small" class="info-icon-box"></svg>
-<svg *ngIf="content.iconClass === 'info'" info-icon size="small" class="info-icon-box"></svg>
-<svg *ngIf="content.iconClass !== 'warning' && content.iconClass !== 'info'" question-icon size="small" class="info-icon-box"></svg>
+@switch (content.iconClass) {
+ @case ('warning') {
+ <svg alert-fill-icon size="small" class="info-icon-box"></svg>
+ }
+ @case ('info') {
+ <svg info-icon size="small" class="info-icon-box"></svg>
+ }
+ @default {
+ <svg question-icon size="small" class="info-icon-box"></svg>
+ }
+}
-<div
- class="text-box"
->
- <div
- class="text-box-header"
- >
+<div class="text-box">
+ <div class="text-box-header">
<span [textContent]="content.header"></span>
</div>
- <div
- class="text-box-content"
- >
+ <div class="text-box-content">
<span [textContent]="content.content"></span>
</div>
</div>
-<div
- *ngIf="content.login"
- class="button-box"
->
- <op-storage-login-button
- class="op-files-tab--storage-info-box-button"
- [input]="content.login"
- ></op-storage-login-button>
-</div>
+@if (content.login) {
+ <div class="button-box">
+ <op-storage-login-button
+ class="op-files-tab--storage-info-box-button"
+ [input]="content.login"
+ ></op-storage-login-button>
+ </div>
+}
diff --git a/frontend/src/app/shared/components/storages/storage-login-button/storage-login-button.component.html b/frontend/src/app/shared/components/storages/storage-login-button/storage-login-button.component.html
index 561296e0307..7275b0cf2c8 100644
--- a/frontend/src/app/shared/components/storages/storage-login-button/storage-login-button.component.html
+++ b/frontend/src/app/shared/components/storages/storage-login-button/storage-login-button.component.html
@@ -2,6 +2,6 @@
class="button button_no-margin"
(click)="login()"
>
- <span>{{label}}</span>
+ <span>{{ label }}</span>
<svg link-external-icon size="small"></svg>
</button>
diff --git a/frontend/src/app/shared/components/storages/storage/storage.component.html b/frontend/src/app/shared/components/storages/storage/storage.component.html
index 68a29ea6365..917c2c84cef 100644
--- a/frontend/src/app/shared/components/storages/storage/storage.component.html
+++ b/frontend/src/app/shared/components/storages/storage/storage.component.html
@@ -1,6 +1,4 @@
-<ng-container
- *ngIf="resource"
->
+@if (resource) {
<div class=op-tab-content--header>
<svg
class="op-tab-content--header-icon op-files-tab--icon op-files-tab--icon_primary"
@@ -8,116 +6,124 @@
size="small"
></svg>
<span class="op-tab-content--header-text" [textContent]="(storage | async)?.name"></span>
- <a *ngIf="openStorageLink"
- class="op-tab-content--header-action"
- aria-label="{{text.openStorage(storageType | async)}}"
- [title]="text.openStorage(storageType | async)"
- [href]="openStorageLink"
- target="_blank"
- >
- <svg link-external-icon size="small"></svg>
- </a>
+
+ @if (openStorageLink) {
+ <a
+ class="op-tab-content--header-action"
+ aria-label="{{text.openStorage(storageType | async)}}"
+ [title]="text.openStorage(storageType | async)"
+ [href]="openStorageLink"
+ target="_blank"
+ >
+ <svg link-external-icon size="small"></svg>
+ </a>
+ }
</div>
- <op-storage-information
- *ngFor="let infoBox of storageErrors | async"
- class="op-files-tab--storage-info-box"
- data-test-selector="op-storage--information"
- [content]="infoBox"
- ></op-storage-information>
+ @for (infoBox of storageErrors | async; track infoBox) {
+ <op-storage-information
+ class="op-files-tab--storage-info-box"
+ data-test-selector="op-storage--information"
+ [content]="infoBox"
+ ></op-storage-information>
+ }
<div class="op-file-section">
- <ul
- *ngIf="(fileLinks | async)?.length > 0"
- class="spot-list spot-list_compact op-file-list"
- [ngClass]="{
- 'op-file-section': true,
- 'op-file-section--list_dragging': dragging > 0
- }"
- data-test-selector="file-list"
- >
- <li
- *ngFor="let fileLink of fileLinks | async; let i = index;"
- class="spot-list--item op-file-list--item"
- data-test-selector="file-list--item"
- op-file-link-list-item
- [fileLink]="fileLink"
- [disabled]="disabled | async"
- [allowEditing]="allowLinking"
- (removeFileLink)="removeFileLink(fileLink)"
- ></li>
- </ul>
-
- <span
- *ngIf="!allowUploading && (storageErrors | async)?.length === 0 && (fileLinks | async)?.length === 0"
- class="op-file-section--empty-list-hint"
- [textContent]="text.emptyList(this.storageType | async)"
- ></span>
+ @if ((fileLinks | async)?.length > 0) {
+ <ul
+ class="spot-list spot-list_compact op-file-list"
+ [ngClass]="{
+ 'op-file-section': true,
+ 'op-file-section--list_dragging': dragging > 0
+ }"
+ data-test-selector="file-list"
+ >
+ <li
+ *ngFor="let fileLink of fileLinks | async; let i = index;"
+ class="spot-list--item op-file-list--item"
+ data-test-selector="file-list--item"
+ op-file-link-list-item
+ [fileLink]="fileLink"
+ [disabled]="disabled | async"
+ [allowEditing]="allowLinking"
+ (removeFileLink)="removeFileLink(fileLink)"
+ ></li>
+ </ul>
+ }
- <input
- *ngIf="allowUploading"
- #hiddenFileInput
- type="file"
- id="upload_files"
- name="upload_files"
- (change)="onFilePickerChanged()"
- hidden
- />
+ @if (!allowUploading && (storageErrors | async)?.length === 0 && (fileLinks | async)?.length === 0) {
+ <span class="op-file-section--empty-list-hint" [textContent]="text.emptyList(this.storageType | async)"></span>
+ }
- <button
- *ngIf="allowUploading && (storageErrors | async)?.length === 0"
- [attr.aria-label]="text.dropBox.uploadLabel"
- data-test-selector="op-storage--drop-box"
- [ngClass]="{
- 'hide-when-print': true,
- 'op-file-section--drop-box': true,
- 'op-file-section--drop-box_dragging': dragging > 0,
- 'op-file-section--drop-box_dragging-over': draggingOverDropZone,
- 'op-file-section--drop-box_float': (fileLinks | async)?.length
- }"
- type="button"
- (dragover)="onDragOver($event)"
- (dragleave)="onDragLeave($event)"
- (drop)="onDropFiles($event)"
- (click)="triggerFileInput()"
- >
- <svg upload-icon size="small" class="op-file-section--drop-box-icon"></svg>
- <span
- *ngIf="(fileLinks | async)?.length > 0"
- class="op-file-section--drop-box-text"
- [textContent]="text.dropBox.dropFiles(this.storageType | async)"
- ></span>
- <span
- *ngIf="(fileLinks | async)?.length === 0"
- class="op-file-section--drop-box-text"
- [textContent]="text.dropBox.dropClickFiles(this.storageType | async)"
- ></span>
- </button>
+ @if (allowUploading) {
+ <input
+ #hiddenFileInput
+ type="file"
+ id="upload_files"
+ name="upload_files"
+ (change)="onFilePickerChanged()"
+ hidden
+ />
+ }
- <div
- *ngIf="(storageErrors | async)?.length === 0"
- class="op-file-section--actions"
- >
+ @if (allowUploading && (storageErrors | async)?.length === 0) {
<button
- *ngIf="allowUploading"
+ [attr.aria-label]="text.dropBox.uploadLabel"
+ data-test-selector="op-storage--drop-box"
+ [ngClass]="{
+ 'hide-when-print': true,
+ 'op-file-section--drop-box': true,
+ 'op-file-section--drop-box_dragging': dragging > 0,
+ 'op-file-section--drop-box_dragging-over': draggingOverDropZone,
+ 'op-file-section--drop-box_float': (fileLinks | async)?.length
+ }"
type="button"
- class="spot-link"
- data-test-selector="op-storage--upload-file-button"
+ (dragover)="onDragOver($event)"
+ (dragleave)="onDragLeave($event)"
+ (drop)="onDropFiles($event)"
(click)="triggerFileInput()"
>
- <svg upload-icon size="small" class="octicon"></svg>
- <span [textContent]="text.actions.uploadFile"></span>
- </button>
- <button
- *ngIf="allowLinking"
- type="button"
- class="spot-link"
- data-test-selector="op-storage--link-existing-file-button"
- (click)="openLinkFilesDialog()"
- >
- <svg link-icon size="small" class="octicon"></svg>
- <span [textContent]="text.actions.linkExisting"></span>
+ <svg upload-icon size="small" class="op-file-section--drop-box-icon"></svg>
+ @if ((fileLinks | async)?.length === 0) {
+ <span
+ class="op-file-section--drop-box-text"
+ [textContent]="text.dropBox.dropClickFiles(this.storageType | async)"
+ ></span>
+ } @else {
+ <span
+ class="op-file-section--drop-box-text"
+ [textContent]="text.dropBox.dropFiles(this.storageType | async)"
+ ></span>
+ }
</button>
- </div>
+ }
+
+ @if ((storageErrors | async)?.length === 0) {
+ <div class="op-file-section--actions">
+ @if (allowUploading) {
+ <button
+ type="button"
+ class="spot-link"
+ data-test-selector="op-storage--upload-file-button"
+ (click)="triggerFileInput()"
+ >
+ <svg upload-icon size="small" class="octicon"></svg>
+ <span [textContent]="text.actions.uploadFile"></span>
+ </button>
+ }
+
+ @if (allowLinking) {
+ <button
+ type="button"
+ class="spot-link"
+ data-test-selector="op-storage--link-existing-file-button"
+ (click)="openLinkFilesDialog()"
+ >
+ <svg link-icon size="small" class="octicon"></svg>
+ <span [textContent]="text.actions.linkExisting"></span>
+ </button>
+ }
+ </div>
+ }
</div>
-</ng-container>
+}
diff --git a/frontend/src/app/spot/components/breadcrumbs/breadcrumbs.component.html b/frontend/src/app/spot/components/breadcrumbs/breadcrumbs.component.html
index f5f424cc68f..2da746fd12b 100644
--- a/frontend/src/app/spot/components/breadcrumbs/breadcrumbs.component.html
+++ b/frontend/src/app/spot/components/breadcrumbs/breadcrumbs.component.html
@@ -1,62 +1,56 @@
-<ng-container
- *ngFor="let crumb of content.crumbs; let i = index; let last = last; let first = first"
->
- <div
- *ngIf="(first && !last) || i === content.crumbs.length - 2 || i === content.crumbs.length - 3"
- class="spot-breadcrumbs--crumb"
- data-test-selector="op-breadcrumb"
- [ngClass]="{
- 'spot-breadcrumbs--crumb_root': first,
- 'spot-breadcrumbs--crumb_parent': i === content.crumbs.length - 2,
- 'spot-breadcrumbs--crumb_grandparent': i === content.crumbs.length - 3
- }"
- >
- <button
- type="button"
- class="spot-link spot-breadcrumbs--crumb-action-item"
- [title]="crumb.text"
- (click)="crumb.navigate()"
+@for (crumb of content.crumbs; track crumb; let i = $index, first = $first, last = $last) {
+ @if ((first && !last) || i === content.crumbs.length - 2 || i === content.crumbs.length - 3) {
+ <div
+ class="spot-breadcrumbs--crumb"
+ data-test-selector="op-breadcrumb"
+ [ngClass]="{
+ 'spot-breadcrumbs--crumb_root': first,
+ 'spot-breadcrumbs--crumb_parent': i === content.crumbs.length - 2,
+ 'spot-breadcrumbs--crumb_grandparent': i === content.crumbs.length - 3
+ }"
>
- <ng-container *ngIf="crumb.icon">
- <svg
- *ngIf="crumb.icon === 'hosting' || crumb.icon === 'nextcloud-circle' || crumb.icon === 'cloud'"
- cloud-icon
- size="small"
- class="octicon"
- ></svg>
- <span *ngIf="crumb.icon !== 'hosting' && crumb.icon !== 'nextcloud-circle' && crumb.icon !== 'cloud'" class="spot-icon spot-icon_{{crumb.icon}}"></span>
- </ng-container>
- <span [textContent]="crumb.text" class="spot-breadcrumbs--crumb-action-item-text"></span>
- <span class="spot-breadcrumbs--crumb-action-item-dots"></span>
- </button>
+ <button
+ type="button"
+ class="spot-link spot-breadcrumbs--crumb-action-item"
+ [title]="crumb.text"
+ (click)="crumb.navigate()"
+ >
+ @if (crumb.icon) {
+ <ng-container [ngTemplateOutlet]="storageIcon" [ngTemplateOutletContext]="{icon:crumb.icon}"></ng-container>
+ }
- <span class="spot-breadcrumbs--crumb-divider spot-icon spot-icon_arrow-right5"></span>
- </div>
+ <span [textContent]="crumb.text" class="spot-breadcrumbs--crumb-action-item-text"></span>
+ <span class="spot-breadcrumbs--crumb-action-item-dots"></span>
+ </button>
- <div
- *ngIf="i === 1 && content.crumbs.length > 4"
- class="spot-breadcrumbs--crumb spot-breadcrumbs--crumb_collapsed"
- >
- <span class="spot-breadcrumbs--crumb-divider spot-icon spot-icon_arrow-right5"></span>
- </div>
+ <span class="spot-breadcrumbs--crumb-divider spot-icon spot-icon_arrow-right5"></span>
+ </div>
+ }
- <div
- *ngIf="last"
- class="spot-breadcrumbs--crumb spot-breadcrumbs--crumb_last"
- data-test-selector="op-breadcrumb"
- >
- <ng-container *ngIf="crumb.icon">
- <svg
- *ngIf="crumb.icon === 'hosting' || crumb.icon === 'nextcloud-circle' || crumb.icon === 'cloud'"
- cloud-icon
- size="small"
- class="octicon"
- ></svg>
- <span *ngIf="crumb.icon !== 'hosting' && crumb.icon !== 'nextcloud-circle' && crumb.icon !== 'cloud'" class="spot-icon spot-icon_{{crumb.icon}}"></span>
- </ng-container>
- <span
- class="spot-breadcrumbs--crumb-action-item-text"
- [textContent]="crumb.text"
- ></span>
- </div>
-</ng-container>
+ @if (i === 1 && content.crumbs.length > 4) {
+ <div class="spot-breadcrumbs--crumb spot-breadcrumbs--crumb_collapsed">
+ <span class="spot-breadcrumbs--crumb-divider spot-icon spot-icon_arrow-right5"></span>
+ </div>
+ }
+
+ @if (last) {
+ <div class="spot-breadcrumbs--crumb spot-breadcrumbs--crumb_last" data-test-selector="op-breadcrumb">
+ @if (crumb.icon) {
+ <ng-container [ngTemplateOutlet]="storageIcon" [ngTemplateOutletContext]="{icon:crumb.icon}"></ng-container>
+ }
+
+ <span class="spot-breadcrumbs--crumb-action-item-text" [textContent]="crumb.text"></span>
+ </div>
+ }
+}
+
+<ng-template #storageIcon let-iconClass="icon">
+ @switch (iconClass) {
+ @case ('nextcloud-circle') {
+ <svg op-mark-nextcloud-icon size="small" class="octicon"></svg>
+ }
+ @default {
+ <svg cloud-icon size="small" class="octicon"></svg>
+ }
+ }
+</ng-template>
diff --git a/frontend/src/app/spot/spot.module.ts b/frontend/src/app/spot/spot.module.ts
index 5bca8dcd2a6..0f8fd3a86f0 100644
--- a/frontend/src/app/spot/spot.module.ts
+++ b/frontend/src/app/spot/spot.module.ts
@@ -7,6 +7,7 @@ import { CommonModule } from '@angular/common';
import { A11yModule } from '@angular/cdk/a11y';
import { I18nService } from 'core-app/core/i18n/i18n.service';
+import { IconModule } from 'core-app/shared/components/icon/icon.module';
import { SpotCheckboxComponent } from './components/checkbox/checkbox.component';
import { SpotSwitchComponent } from './components/switch/switch.component';
import { SpotToggleComponent } from './components/toggle/toggle.component';
@@ -19,7 +20,6 @@ import { SpotFormBindingDirective } from './components/form-field/form-binding.d
import { SpotBreadcrumbsComponent } from './components/breadcrumbs/breadcrumbs.component';
import { SpotSelectorFieldComponent } from './components/selector-field/selector-field.component';
import { SpotDropModalPortalComponent } from './components/drop-modal/drop-modal-portal.component';
-import { CloudIconComponent } from '@openproject/octicons-angular';
@NgModule({
imports: [
@@ -27,7 +27,7 @@ import { CloudIconComponent } from '@openproject/octicons-angular';
ReactiveFormsModule,
CommonModule,
A11yModule,
- CloudIconComponent,
+ IconModule,
],
providers: [
@@ -66,4 +66,5 @@ import { CloudIconComponent } from '@openproject/octicons-angular';
SpotSelectorFieldComponent,
],
})
-export class OpSpotModule { }
+// eslint-disable-next-line @typescript-eslint/no-extraneous-class
+export class OpSpotModule {}
diff --git a/frontend/src/app/spot/styles/sass/components/link.sass b/frontend/src/app/spot/styles/sass/components/link.sass
index fdca359fd85..22478314a6c 100644
--- a/frontend/src/app/spot/styles/sass/components/link.sass
+++ b/frontend/src/app/spot/styles/sass/components/link.sass
@@ -33,7 +33,7 @@
&:last-child:not(:first-child)
margin-left: $spot-spacing-0_25
- &.octicon-link
+ &_octicon
display: inline-block
// Ensure op-icon within a link gets inline-block
diff --git a/frontend/src/global_styles/content/work_packages/shared/_file_list.sass b/frontend/src/global_styles/content/work_packages/shared/_file_list.sass
index 324458370cd..31bc1ebd7c5 100644
--- a/frontend/src/global_styles/content/work_packages/shared/_file_list.sass
+++ b/frontend/src/global_styles/content/work_packages/shared/_file_list.sass
@@ -93,6 +93,14 @@
& &--item &--item-floating-actions
padding-right: 0
+ //& &--item &--item-floating-actions
+ // opacity: 0
+ // padding: $spot-spacing-0_25 0 $spot-spacing-0_25 $spot-spacing-1
+ //
+ //& &--item &--item-floating-actions:hover,
+ //& &--item &--item-floating-actions:focus-within
+ // opacity: 1
+
& &--item &--item-floating-text
padding-right: $spot-spacing-0_5