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

Added tooltip to FileLinkListItem if not accessable

Andreas Pfohl9a215d536345
diff --git a/frontend/src/app/shared/components/file-links/file-link-list-item/file-link-list-item.component.ts b/frontend/src/app/shared/components/file-links/file-link-list-item/file-link-list-item.component.ts
index 3dad8f2b66a..6a73a5aeae7 100644
--- a/frontend/src/app/shared/components/file-links/file-link-list-item/file-link-list-item.component.ts
+++ b/frontend/src/app/shared/components/file-links/file-link-list-item/file-link-list-item.component.ts
@@ -47,6 +47,7 @@ import { PrincipalRendererService } from 'core-app/shared/components/principal/p
import {
getIconForMimeType,
} from 'core-app/shared/components/file-links/file-link-icons/file-link-list-item-icon.factory';
+import SpotDropAlignmentOption from 'core-app/spot/drop-alignment-options';
@Component({
// eslint-disable-next-line @angular-eslint/component-selector
@@ -73,6 +74,8 @@ export class FileLinkListItemComponent implements OnInit, AfterViewInit {
viewAllowed:boolean;
+ tooltipAllignment:SpotDropAlignmentOption = SpotDropAlignmentOption.TopLeft;
+
text = {
title: {
openFile: this.i18n.t('js.storages.file_links.open'),
@@ -84,6 +87,7 @@ export class FileLinkListItemComponent implements OnInit, AfterViewInit {
noViewPermission: this.i18n.t('js.storages.file_links.no_permission'),
},
removalConfirmation: this.i18n.t('js.storages.file_links.remove_confirmation'),
+ notAllowdTooltipText: this.i18n.t('js.storages.file_links.not_allowed_tooltip'),
};
constructor(
diff --git a/frontend/src/app/shared/components/file-links/file-link-list-item/file-link-list-item.html b/frontend/src/app/shared/components/file-links/file-link-list-item/file-link-list-item.html
index c77a53b6676..327548bcb05 100644
--- a/frontend/src/app/shared/components/file-links/file-link-list-item/file-link-list-item.html
+++ b/frontend/src/app/shared/components/file-links/file-link-list-item/file-link-list-item.html
@@ -1,68 +1,82 @@
-<div
- class="spot-list--item-floating-wrapper op-files-tab--file-list-item-floating-wrapper"
- [ngClass]="{ 'op-files-tab--file-list-item-floating-wrapper_disabled': disabled }"
+<spot-tooltip
+ [disabled]="!disabled"
+ [alignment]="tooltipAllignment"
>
- <a
- class="spot-list--item-action spot-list--item-action_link op-files-tab--file-list-item-action"
- [ngClass]="{ 'disabled': disabled, 'view-not-allowed': !viewAllowed }"
- [href]="fileLink._links.staticOriginOpen.href"
- [title]="fileLink.originData.name"
- target="_blank"
+ <p
+ slot="body"
+ class="spot-body-small"
+ >{{text.notAllowdTooltipText}}</p>
+
+ <ng-container
+ slot="trigger"
>
+ <div
+ class="spot-list--item-floating-wrapper op-files-tab--file-list-item-floating-wrapper"
+ [ngClass]="{ 'op-files-tab--file-list-item-floating-wrapper_disabled': disabled }"
+ >
+ <a
+ class="spot-list--item-action spot-list--item-action_link op-files-tab--file-list-item-action"
+ [ngClass]="{ 'disabled': disabled, 'view-not-allowed': !viewAllowed }"
+ [href]="fileLink._links.staticOriginOpen.href"
+ [title]="fileLink.originData.name"
+ target="_blank"
+ >
<span
class="spot-icon spot-icon_{{fileLinkIcon.icon}} op-files-tab--icon op-files-tab--icon_{{fileLinkIcon.clazz}}"
></span>
- <span
- [textContent]="fileLink.originData.name"
- [title]="fileLink.originData.name"
- class="spot-list--item-title op-files-tab--file-list-item-title"
- ></span>
+ <span
+ [textContent]="fileLink.originData.name"
+ [title]="fileLink.originData.name"
+ class="spot-list--item-title op-files-tab--file-list-item-title"
+ ></span>
- <span
- class="op-files-tab--file-list-item-text"
- [textContent]="infoTimestampText"
- ></span>
+ <span
+ class="op-files-tab--file-list-item-text"
+ [textContent]="infoTimestampText"
+ ></span>
- <div
- #avatar
- class="op-files-tab--file-list-item-avatar"
- ></div>
- </a>
- <div
- *ngIf="!disabled && viewAllowed"
- class="spot-list--item-floating-actions op-files-tab--file-list-item-floating-actions hidden-for-mobile"
- >
- <a
- *ngIf="downloadAllowed"
- class="spot-link"
- [title]="text.title.downloadFileLink"
- [href]="fileLink._links.staticOriginDownload.href"
- >
- <span class="spot-icon spot-icon_download-arrow"></span>
- </a>
- <a
- class="spot-link"
- [title]="text.title.openFileLocation"
- [href]="fileLink._links.staticOriginOpenLocation.href"
- target="_blank"
- >
- <span class="spot-icon spot-icon_folder-open"></span>
- </a>
- <button
- *ngIf="allowEditing"
- class="spot-link"
- [title]="text.title.removeFileLink"
- (click)="confirmRemoveFileLink()"
- >
- <span class="spot-icon spot-icon_remove-link"></span>
- </button>
- </div>
- <div
- *ngIf="!disabled && !viewAllowed"
- class="spot-list--item-floating-actions op-files-tab--file-list-item-floating-text hidden-for-mobile"
- >
- <span class="spot-icon spot-icon_info2 op-files-tab--file-list-item-floating-text-icon"></span>
- <span [textContent]="text.floatingText.noViewPermission"></span>
- </div>
-</div>
+ <div
+ #avatar
+ class="op-files-tab--file-list-item-avatar"
+ ></div>
+ </a>
+ <div
+ *ngIf="!disabled && viewAllowed"
+ class="spot-list--item-floating-actions op-files-tab--file-list-item-floating-actions hidden-for-mobile"
+ >
+ <a
+ *ngIf="downloadAllowed"
+ class="spot-link"
+ [title]="text.title.downloadFileLink"
+ [href]="fileLink._links.staticOriginDownload.href"
+ >
+ <span class="spot-icon spot-icon_download-arrow"></span>
+ </a>
+ <a
+ class="spot-link"
+ [title]="text.title.openFileLocation"
+ [href]="fileLink._links.staticOriginOpenLocation.href"
+ target="_blank"
+ >
+ <span class="spot-icon spot-icon_folder-open"></span>
+ </a>
+ <button
+ *ngIf="allowEditing"
+ class="spot-link"
+ [title]="text.title.removeFileLink"
+ (click)="confirmRemoveFileLink()"
+ >
+ <span class="spot-icon spot-icon_remove-link"></span>
+ </button>
+ </div>
+ <div
+ *ngIf="!disabled && !viewAllowed"
+ class="spot-list--item-floating-actions op-files-tab--file-list-item-floating-text hidden-for-mobile"
+ >
+ <span class="spot-icon spot-icon_info2 op-files-tab--file-list-item-floating-text-icon"></span>
+ <span [textContent]="text.floatingText.noViewPermission"></span>
+ </div>
+ </div>
+ </ng-container>
+</spot-tooltip>
diff --git a/frontend/src/app/shared/components/file-links/openproject-file-links.module.ts b/frontend/src/app/shared/components/file-links/openproject-file-links.module.ts
index 90f011a38e5..7841874153c 100644
--- a/frontend/src/app/shared/components/file-links/openproject-file-links.module.ts
+++ b/frontend/src/app/shared/components/file-links/openproject-file-links.module.ts
@@ -31,6 +31,7 @@ import { CommonModule } from '@angular/common';
import { CookieService } from 'ngx-cookie-service';
import { IconModule } from 'core-app/shared/components/icon/icon.module';
+import { OpSpotModule } from 'core-app/spot/spot.module';
import { FileLinkListComponent } from 'core-app/shared/components/file-links/file-link-list/file-link-list.component';
import {
@@ -44,6 +45,7 @@ import {
imports: [
CommonModule,
IconModule,
+ OpSpotModule,
],
declarations: [
FileLinkListComponent,