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

[#42158] fixed last styling issues

Eric Schubert8a855eb71f8e
diff --git a/frontend/src/app/shared/components/file-links/file-link-list/file-link-list.component.ts b/frontend/src/app/shared/components/file-links/file-link-list/file-link-list.component.ts
index a60c018291f..a2e454c44b8 100644
--- a/frontend/src/app/shared/components/file-links/file-link-list/file-link-list.component.ts
+++ b/frontend/src/app/shared/components/file-links/file-link-list/file-link-list.component.ts
@@ -29,7 +29,7 @@
import {
ChangeDetectionStrategy, Component, Input, OnInit,
} from '@angular/core';
-import { Observable } from 'rxjs';
+import { Observable, Subject } from 'rxjs';
import { HalResource } from 'core-app/features/hal/resources/hal-resource';
import { IFileLink } from 'core-app/core/state/file-links/file-link.model';
import { IStorage } from 'core-app/core/state/storages/storage.model';
@@ -61,9 +61,9 @@ export class FileLinkListComponent extends UntilDestroyedMixin implements OnInit
allowEditing = false;
- showInformationBox = false;
+ showInformationBox$ = new Subject<boolean>();
- showFileLinks = false;
+ showFileLinks$ = new Subject<boolean>();
private readonly storageTypeMap:{ [urn:string]:string; } = {
'urn:openproject-org:api:v3:storages:Nextcloud': 'Nextcloud',
@@ -138,7 +138,7 @@ export class FileLinkListComponent extends UntilDestroyedMixin implements OnInit
private deriveStorageInformation(fileLinkCount:number):void {
switch (this.storage._links?.connectionState.href) {
case 'urn:openproject-org:api:v3:storages:connection:FailedAuthentication':
- this.setAuthenticationFailureState();
+ this.setAuthenticationFailureState(fileLinkCount);
break;
case 'urn:openproject-org:api:v3:storages:connection:Error':
this.setConnectionErrorState();
@@ -147,23 +147,23 @@ export class FileLinkListComponent extends UntilDestroyedMixin implements OnInit
if (fileLinkCount === 0) {
this.setEmptyFileLinkListState();
} else {
- this.showInformationBox = false;
- this.showFileLinks = true;
+ this.showInformationBox$.next(false);
+ this.showFileLinks$.next(true);
}
break;
default:
- this.showInformationBox = false;
- this.showFileLinks = false;
+ this.showInformationBox$.next(false);
+ this.showFileLinks$.next(false);
}
}
- private setAuthenticationFailureState():void {
+ private setAuthenticationFailureState(fileLinkCount:number):void {
this.informationBoxHeader = this.text.infoBox.authenticationFailureHeader;
this.informationBoxContent = this.text.infoBox.authenticationFailureContent;
this.informationBoxButton = this.text.infoBox.loginButton;
this.informationBoxIcon = 'import';
- this.showInformationBox = true;
- this.showFileLinks = true;
+ this.showInformationBox$.next(true);
+ this.showFileLinks$.next(fileLinkCount > 0);
}
private setConnectionErrorState():void {
@@ -171,8 +171,8 @@ export class FileLinkListComponent extends UntilDestroyedMixin implements OnInit
this.informationBoxContent = this.text.infoBox.connectionErrorContent;
this.informationBoxButton = this.text.infoBox.loginButton;
this.informationBoxIcon = 'remove-link';
- this.showInformationBox = true;
- this.showFileLinks = false;
+ this.showInformationBox$.next(true);
+ this.showFileLinks$.next(false);
}
private setEmptyFileLinkListState():void {
@@ -180,8 +180,8 @@ export class FileLinkListComponent extends UntilDestroyedMixin implements OnInit
this.informationBoxContent = this.text.infoBox.emptyStorageContent;
this.informationBoxButton = this.text.infoBox.emptyStorageButton;
this.informationBoxIcon = 'add-link';
- this.showInformationBox = true;
- this.showFileLinks = true;
+ this.showInformationBox$.next(true);
+ this.showFileLinks$.next(false);
}
private initializeLocales():void {
diff --git a/frontend/src/app/shared/components/file-links/file-link-list/file-link-list.html b/frontend/src/app/shared/components/file-links/file-link-list/file-link-list.html
index c661fbf1cbb..ca2c6788034 100644
--- a/frontend/src/app/shared/components/file-links/file-link-list/file-link-list.html
+++ b/frontend/src/app/shared/components/file-links/file-link-list/file-link-list.html
@@ -1,9 +1,9 @@
-<div
+<ng-container
*ngIf="resource"
- data-qa-selector="op-files-tab--file-link-list"
>
<op-storage-information
- *ngIf="showInformationBox"
+ *ngIf="showInformationBox$ | async"
+ class="op-files-tab--storage-info-box"
[infoIcon]="informationBoxIcon"
[infoTextHeader]="informationBoxHeader"
[infoTextContent]="informationBoxContent"
@@ -12,8 +12,9 @@
></op-storage-information>
<ul
- *ngIf="showFileLinks"
+ *ngIf="showFileLinks$ | async"
class="spot-list"
+ data-qa-selector="op-files-tab--file-link-list"
>
<li
*ngFor="let fileLink of fileLinks$ | async; let i = index;"
@@ -31,12 +32,16 @@
</li>
</ul>
- <a
- *ngIf="!showInformationBox"
- class="spot-link op-files-tab--file-list-action-button"
- (click)="openStorageLocation()"
+ <p
+ *ngIf="(showInformationBox$ | async) === false"
+ class="spot-body-small"
>
- <span class="spot-icon spot-icon_external-link"></span>
- <span [textContent]="text.actions.linkFile"></span>
- </a>
-</div>
+ <a
+ class="spot-link op-files-tab--file-list-action-button"
+ (click)="openStorageLocation()"
+ >
+ <span class="spot-icon spot-icon_external-link"></span>
+ <span [textContent]="text.actions.linkFile"></span>
+ </a>
+ </p>
+</ng-container>
diff --git a/frontend/src/app/shared/components/file-links/file-link-list/storage-information.html b/frontend/src/app/shared/components/file-links/file-link-list/storage-information.html
index 14cafa80aba..03fdcc4bba3 100644
--- a/frontend/src/app/shared/components/file-links/file-link-list/storage-information.html
+++ b/frontend/src/app/shared/components/file-links/file-link-list/storage-information.html
@@ -1,32 +1,28 @@
+<span class="spot-icon big spot-icon_{{infoIcon}}"></span>
+
<div
- class="op-files-tab--storage-info-box"
+ class="text-box"
>
- <span class="spot-icon big spot-icon_{{infoIcon}}"></span>
-
<div
- class="text-box"
+ class="text-box-header"
>
- <div
- class="text-box-header"
- >
- <span [textContent]="infoTextHeader"></span>
- </div>
- <div
- class="text-box-content"
- >
- <span [textContent]="infoTextContent"></span>
- </div>
+ <span [textContent]="infoTextHeader"></span>
</div>
-
<div
- class="button-box"
+ class="text-box-content"
>
- <button
- class="action-button"
- (click)="buttonClickEventEmitter.emit()"
- >
- <span class="spot-icon with-text spot-icon_external-link"></span>
- <span [textContent]="buttonText"></span>
- </button>
+ <span [textContent]="infoTextContent"></span>
</div>
</div>
+
+<div
+ class="button-box"
+>
+ <button
+ class="action-button"
+ (click)="buttonClickEventEmitter.emit()"
+ >
+ <span class="spot-icon with-text spot-icon_external-link"></span>
+ <span [textContent]="buttonText"></span>
+ </button>
+</div>
diff --git a/frontend/src/global_styles/content/work_packages/tabs/_files.sass b/frontend/src/global_styles/content/work_packages/tabs/_files.sass
index eb77a6ed8be..b8994b72d9b 100644
--- a/frontend/src/global_styles/content/work_packages/tabs/_files.sass
+++ b/frontend/src/global_styles/content/work_packages/tabs/_files.sass
@@ -48,8 +48,15 @@
&.file-info
flex: 1 5 auto
- text-align: right
font-size: 12px
+ display: flex
+ align-items: center
+ justify-content: flex-end
+
+ > :last-child
+ white-space: nowrap
+ overflow: hidden
+ text-overflow: ellipsis
&.hover-menu
position: absolute
@@ -117,12 +124,12 @@
font-size: 14px
line-height: 20px
- &--file-list-action-button
- &.spot-link
- font-size: 14px
-
- .spot-icon:first-child
- margin: 0
+ //&--file-list-action-button
+ // &.spot-link
+ // font-size: 14px
+ //
+ // .spot-icon:first-child
+ // margin: 0
&--color
&-red
diff --git a/frontend/src/global_styles/content/work_packages/tabs/_tab_content.sass b/frontend/src/global_styles/content/work_packages/tabs/_tab_content.sass
index d8687b52603..eeafedf005f 100644
--- a/frontend/src/global_styles/content/work_packages/tabs/_tab_content.sass
+++ b/frontend/src/global_styles/content/work_packages/tabs/_tab_content.sass
@@ -40,6 +40,9 @@
.spot-list:not(:last-child)
margin-bottom: $spot-spacing-0-75
+ .op-files-tab--storage-info-box:not(:last-child)
+ margin-bottom: $spot-spacing-1
+
&--tab-section
margin-bottom: 32px