Code cleanup and optimisations (#3383)

* cleanup unused css

* remove unused store/reducer blocks

* fix typo in toolbar ("tool-bar")

* toolbar action: break dependency on adf-core

* unified toolbar component

* break dependency on adf toolbar module

* update e2e

* update e2e

* update e2e

* update e2e

* update e2e

* fix search results toolbar spacing

* cleanup unused app state

* cleanup unused code

* fix toolbar divider color

* fix missing buttons in the info drawer

* fix css nesting

* fix search results css
This commit is contained in:
Denys Vuika
2023-08-14 19:43:33 +01:00
committed by GitHub
parent 5279472a0a
commit 27eddf3596
78 changed files with 316 additions and 634 deletions

View File

@@ -28,9 +28,7 @@
</adf-viewer-open-with>
<adf-viewer-toolbar-actions *ngIf="!simplestMode">
<ng-container *ngFor="let action of viewerToolbarActions; trackBy: trackByActionId">
<aca-toolbar-action [actionRef]="action"></aca-toolbar-action>
</ng-container>
<aca-toolbar [items]="viewerToolbarActions"></aca-toolbar>
</adf-viewer-toolbar-actions>
</adf-alfresco-viewer>
</ng-container>

View File

@@ -83,7 +83,6 @@ export const INITIAL_APP_STATE: AppState = {
infoDrawerMetadataAspect: '',
showFacetFilter: true,
fileUploadingDialog: true,
documentDisplayMode: 'list',
showLoader: false,
repository: {
status: {

View File

@@ -34,7 +34,7 @@ import {
ContentApiService,
InfoDrawerComponent,
ToolbarMenuItemComponent,
ToolbarActionComponent
ToolbarComponent
} from '@alfresco/aca-shared';
import { ContentActionRef, ViewerExtensionRef } from '@alfresco/adf-extensions';
import { SearchRequest } from '@alfresco/js-api';
@@ -44,7 +44,7 @@ import { AlfrescoViewerModule, NodesApiService } from '@alfresco/adf-content-ser
@Component({
standalone: true,
imports: [CommonModule, ViewerModule, AlfrescoViewerModule, InfoDrawerComponent, ToolbarMenuItemComponent, ToolbarActionComponent],
imports: [CommonModule, ViewerModule, AlfrescoViewerModule, InfoDrawerComponent, ToolbarMenuItemComponent, ToolbarComponent],
selector: 'app-preview',
templateUrl: './preview.component.html',
styleUrls: ['./preview.component.scss'],

View File

@@ -1,12 +1,7 @@
<aca-page-layout>
<div class="aca-page-layout-header">
<adf-breadcrumb [root]="title" [folderNode]="node" (navigate)="goBack()"> </adf-breadcrumb>
<adf-toolbar class="adf-toolbar--inline">
<ng-container *ngFor="let entry of actions; trackBy: trackByActionId">
<aca-toolbar-action [actionRef]="entry"></aca-toolbar-action>
</ng-container>
</adf-toolbar>
<aca-toolbar [items]="actions"></aca-toolbar>
</div>
<div class="aca-page-layout-content">

View File

@@ -24,11 +24,10 @@
import { Component, OnInit, ViewEncapsulation, OnDestroy } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { ContentApiService, PageComponent, PageLayoutComponent, ToolbarActionComponent } from '@alfresco/aca-shared';
import { ContentApiService, PageComponent, PageLayoutComponent, ToolbarComponent } from '@alfresco/aca-shared';
import { NavigateToPreviousPage, SetSelectedNodesAction } from '@alfresco/aca-shared/store';
import { Subject } from 'rxjs';
import { BreadcrumbModule, PermissionManagerModule } from '@alfresco/adf-content-services';
import { ToolbarModule } from '@alfresco/adf-core';
import { CommonModule } from '@angular/common';
import { TranslateModule } from '@ngx-translate/core';
import { MatIconModule } from '@angular/material/icon';
@@ -45,15 +44,14 @@ import { CommentsTabComponent } from '../info-drawer/comments-tab/comments-tab.c
TranslateModule,
PermissionManagerModule,
BreadcrumbModule,
ToolbarModule,
MatIconModule,
MatTabsModule,
MatProgressBarModule,
MatButtonModule,
MetadataTabComponent,
CommentsTabComponent,
ToolbarActionComponent,
PageLayoutComponent
PageLayoutComponent,
ToolbarComponent
],
selector: 'app-details-manager',
templateUrl: './details.component.html',

View File

@@ -1,12 +1,7 @@
<aca-page-layout>
<div class="aca-page-layout-header">
<h1 class="aca-page-title">{{ 'APP.BROWSE.LIBRARIES.MENU.FAVORITE_LIBRARIES.TITLE' | translate }}</h1>
<adf-toolbar class="adf-toolbar--inline">
<ng-container *ngFor="let entry of actions; trackBy: trackByActionId">
<aca-toolbar-action [actionRef]="entry"></aca-toolbar-action>
</ng-container>
</adf-toolbar>
<aca-toolbar [items]="actions"></aca-toolbar>
</div>
<div class="aca-page-layout-content">
@@ -15,7 +10,6 @@
#documentList
acaDocumentList
acaContextActions
[display]="documentDisplayMode$ | async"
[node]="$any(list)"
[loading]="isLoading"
[selectionMode]="'single'"

View File

@@ -31,10 +31,10 @@ import {
InfoDrawerComponent,
PageComponent,
PageLayoutComponent,
ToolbarActionComponent
ToolbarComponent
} from '@alfresco/aca-shared';
import { NavigateLibraryAction } from '@alfresco/aca-shared/store';
import { DataTableModule, PaginationModule, TemplateModule, ToolbarModule, UserPreferencesService } from '@alfresco/adf-core';
import { DataTableModule, PaginationModule, TemplateModule, UserPreferencesService } from '@alfresco/adf-core';
import { DocumentListPresetRef, ExtensionsModule } from '@alfresco/adf-extensions';
import { CommonModule } from '@angular/common';
import { DocumentListModule } from '@alfresco/adf-content-services';
@@ -45,7 +45,6 @@ import { TranslateModule } from '@ngx-translate/core';
standalone: true,
imports: [
CommonModule,
ToolbarModule,
DocumentListModule,
DocumentListDirective,
ContextActionsDirective,
@@ -54,9 +53,9 @@ import { TranslateModule } from '@ngx-translate/core';
ExtensionsModule,
PaginationModule,
InfoDrawerComponent,
ToolbarActionComponent,
PageLayoutComponent,
TranslateModule
TranslateModule,
ToolbarComponent
],
templateUrl: './favorite-libraries.component.html',
encapsulation: ViewEncapsulation.None

View File

@@ -1,12 +1,7 @@
<aca-page-layout>
<div class="aca-page-layout-header">
<h1 class="aca-page-title">{{ 'APP.BROWSE.FAVORITES.TITLE' | translate }}</h1>
<adf-toolbar class="adf-toolbar--inline">
<ng-container *ngFor="let entry of actions; trackBy: trackByActionId">
<aca-toolbar-action [actionRef]="entry"></aca-toolbar-action>
</ng-container>
</adf-toolbar>
<aca-toolbar [items]="actions"></aca-toolbar>
</div>
<div class="aca-page-layout-content">
@@ -15,7 +10,6 @@
#documentList
acaDocumentList
acaContextActions
[display]="documentDisplayMode$ | async"
[currentFolderId]="'-favorites-'"
[selectionMode]="'multiple'"
[navigate]="false"

View File

@@ -29,7 +29,7 @@ import {
PageComponent,
PageLayoutComponent,
PaginationDirective,
ToolbarActionComponent
ToolbarComponent
} from '@alfresco/aca-shared';
import { MinimalNodeEntity, MinimalNodeEntryEntity, PathElementEntity, PathInfo } from '@alfresco/js-api';
import { Component, OnInit, ViewEncapsulation } from '@angular/core';
@@ -37,7 +37,7 @@ import { debounceTime, map } from 'rxjs/operators';
import { DocumentListPresetRef, ExtensionsModule } from '@alfresco/adf-extensions';
import { CommonModule } from '@angular/common';
import { DocumentListModule } from '@alfresco/adf-content-services';
import { DataTableModule, PaginationModule, TemplateModule, ToolbarModule } from '@alfresco/adf-core';
import { DataTableModule, PaginationModule, TemplateModule } from '@alfresco/adf-core';
import { DocumentListDirective } from '../../directives/document-list.directive';
import { TranslateModule } from '@ngx-translate/core';
@@ -45,7 +45,6 @@ import { TranslateModule } from '@ngx-translate/core';
standalone: true,
imports: [
CommonModule,
ToolbarModule,
DocumentListModule,
DocumentListDirective,
ContextActionsDirective,
@@ -55,9 +54,9 @@ import { TranslateModule } from '@ngx-translate/core';
PaginationModule,
PaginationDirective,
InfoDrawerComponent,
ToolbarActionComponent,
PageLayoutComponent,
TranslateModule
TranslateModule,
ToolbarComponent
],
templateUrl: './favorites.component.html',
encapsulation: ViewEncapsulation.None

View File

@@ -1,12 +1,7 @@
<aca-page-layout [hasError]="!isValidPath">
<div class="aca-page-layout-header">
<adf-breadcrumb [root]="title" [folderNode]="node" [maxItems]="isSmallScreen ? 1 : 0" (navigate)="onBreadcrumbNavigate($event)"> </adf-breadcrumb>
<adf-toolbar class="adf-toolbar--inline">
<ng-container *ngFor="let entry of actions; trackBy: trackByActionId">
<aca-toolbar-action [actionRef]="entry"></aca-toolbar-action>
</ng-container>
</adf-toolbar>
<aca-toolbar [items]="actions"></aca-toolbar>
</div>
<div class="aca-page-layout-error">
@@ -20,7 +15,6 @@
#documentList
acaDocumentList
acaContextActions
[display]="documentDisplayMode$ | async"
[selectionMode]="'multiple'"
[multiselect]="false"
[currentFolderId]="node?.id"

View File

@@ -22,7 +22,7 @@
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
*/
import { DataTableModule, PaginationModule, ShowHeaderMode, ToolbarModule } from '@alfresco/adf-core';
import { DataTableModule, PaginationModule, ShowHeaderMode } from '@alfresco/adf-core';
import { Component, OnDestroy, OnInit, ViewEncapsulation } from '@angular/core';
import { ActivatedRoute, Params } from '@angular/router';
import { MinimalNodeEntity, MinimalNodeEntryEntity, PathElement, PathElementEntity } from '@alfresco/js-api';
@@ -35,7 +35,7 @@ import {
PageComponent,
PageLayoutComponent,
PaginationDirective,
ToolbarActionComponent
ToolbarComponent
} from '@alfresco/aca-shared';
import { SetCurrentFolderAction, isAdmin, UploadFileVersionAction, showLoaderSelector } from '@alfresco/aca-shared/store';
import { debounceTime, takeUntil } from 'rxjs/operators';
@@ -52,7 +52,6 @@ import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
CommonModule,
TranslateModule,
BreadcrumbModule,
ToolbarModule,
GenericErrorComponent,
UploadModule,
DocumentListModule,
@@ -63,9 +62,9 @@ import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
PaginationModule,
MatProgressSpinnerModule,
InfoDrawerComponent,
ToolbarActionComponent,
PaginationDirective,
PageLayoutComponent
PageLayoutComponent,
ToolbarComponent
],
templateUrl: './files.component.html',
encapsulation: ViewEncapsulation.None

View File

@@ -1,12 +1,7 @@
<aca-page-layout>
<div class="aca-page-layout-header">
<h1 class="aca-page-title">{{ 'APP.BROWSE.LIBRARIES.MENU.MY_LIBRARIES.TITLE' | translate }}</h1>
<adf-toolbar class="adf-toolbar--inline">
<ng-container *ngFor="let entry of actions; trackBy: trackByActionId">
<aca-toolbar-action [actionRef]="entry"></aca-toolbar-action>
</ng-container>
</adf-toolbar>
<aca-toolbar [items]="actions"></aca-toolbar>
</div>
<div class="aca-page-layout-content">
@@ -15,7 +10,6 @@
#documentList
acaDocumentList
acaContextActions
[display]="documentDisplayMode$ | async"
[currentFolderId]="'-mysites-'"
[selectionMode]="'single'"
[navigate]="false"

View File

@@ -32,12 +32,12 @@ import {
PageComponent,
PageLayoutComponent,
PaginationDirective,
ToolbarActionComponent
ToolbarComponent
} from '@alfresco/aca-shared';
import { DocumentListPresetRef, ExtensionsModule } from '@alfresco/adf-extensions';
import { CommonModule } from '@angular/common';
import { DocumentListModule } from '@alfresco/adf-content-services';
import { DataTableModule, PaginationModule, TemplateModule, ToolbarModule } from '@alfresco/adf-core';
import { DataTableModule, PaginationModule, TemplateModule } from '@alfresco/adf-core';
import { DocumentListDirective } from '../../directives/document-list.directive';
import { TranslateModule } from '@ngx-translate/core';
@@ -45,7 +45,6 @@ import { TranslateModule } from '@ngx-translate/core';
standalone: true,
imports: [
CommonModule,
ToolbarModule,
DocumentListModule,
DocumentListDirective,
ContextActionsDirective,
@@ -55,9 +54,9 @@ import { TranslateModule } from '@ngx-translate/core';
PaginationModule,
PaginationDirective,
InfoDrawerComponent,
ToolbarActionComponent,
PageLayoutComponent,
TranslateModule
TranslateModule,
ToolbarComponent
],
templateUrl: './libraries.component.html',
encapsulation: ViewEncapsulation.None

View File

@@ -1,12 +1,7 @@
<aca-page-layout>
<div class="aca-page-layout-header">
<h1 class="aca-page-title">{{ 'APP.BROWSE.RECENT.TITLE' | translate }}</h1>
<adf-toolbar class="adf-toolbar--inline">
<ng-container *ngFor="let entry of actions; trackBy: trackByActionId">
<aca-toolbar-action [actionRef]="entry"></aca-toolbar-action>
</ng-container>
</adf-toolbar>
<aca-toolbar [items]="actions"></aca-toolbar>
</div>
<div class="aca-page-layout-content">
@@ -15,7 +10,6 @@
#documentList
acaDocumentList
acaContextActions
[display]="documentDisplayMode$ | async"
[currentFolderId]="'-recent-'"
[selectionMode]="'multiple'"
[navigate]="false"

View File

@@ -31,12 +31,12 @@ import {
PageComponent,
PageLayoutComponent,
PaginationDirective,
ToolbarActionComponent
ToolbarComponent
} from '@alfresco/aca-shared';
import { DocumentListPresetRef, ExtensionsModule } from '@alfresco/adf-extensions';
import { CommonModule } from '@angular/common';
import { DocumentListModule } from '@alfresco/adf-content-services';
import { DataTableModule, PaginationModule, TemplateModule, ToolbarModule } from '@alfresco/adf-core';
import { DataTableModule, PaginationModule, TemplateModule } from '@alfresco/adf-core';
import { DocumentListDirective } from '../../directives/document-list.directive';
import { TranslateModule } from '@ngx-translate/core';
@@ -44,7 +44,6 @@ import { TranslateModule } from '@ngx-translate/core';
standalone: true,
imports: [
CommonModule,
ToolbarModule,
DocumentListModule,
DocumentListDirective,
ContextActionsDirective,
@@ -54,9 +53,9 @@ import { TranslateModule } from '@ngx-translate/core';
PaginationModule,
PaginationDirective,
InfoDrawerComponent,
ToolbarActionComponent,
PageLayoutComponent,
TranslateModule
TranslateModule,
ToolbarComponent
],
templateUrl: './recent-files.component.html',
encapsulation: ViewEncapsulation.None

View File

@@ -1,12 +1,8 @@
<aca-page-layout>
<div class="aca-page-layout-header">
<aca-search-input></aca-search-input>
<div class="adf-toolbar--spacer adf-toolbar-divider"></div>
<adf-toolbar class="adf-toolbar--inline">
<ng-container *ngFor="let entry of actions; trackBy: trackByActionId">
<aca-toolbar-action [actionRef]="entry"></aca-toolbar-action>
</ng-container>
</adf-toolbar>
<div class="aca-search-toolbar-spacer"></div>
<aca-toolbar [items]="actions"></aca-toolbar>
</div>
<div class="aca-page-layout-content">

View File

@@ -1,6 +1,10 @@
@import '../../../ui/mixins';
aca-search-results {
.aca-search-toolbar-spacer {
width: 100%;
}
.adf-search-results {
@include flex-row;

View File

@@ -35,13 +35,13 @@ import {
PageComponent,
PageLayoutComponent,
PaginationDirective,
ToolbarActionComponent
ToolbarComponent
} from '@alfresco/aca-shared';
import { DocumentListPresetRef, ExtensionsModule } from '@alfresco/adf-extensions';
import { CommonModule } from '@angular/common';
import { TranslateModule } from '@ngx-translate/core';
import { SearchInputComponent } from '../search-input/search-input.component';
import { DataTableModule, PaginationModule, ToolbarModule } from '@alfresco/adf-core';
import { DataTableModule, PaginationModule } from '@alfresco/adf-core';
import { MatProgressBarModule } from '@angular/material/progress-bar';
import { DocumentListModule } from '@alfresco/adf-content-services';
import { DocumentListDirective } from '../../../directives/document-list.directive';
@@ -52,7 +52,6 @@ import { DocumentListDirective } from '../../../directives/document-list.directi
CommonModule,
TranslateModule,
SearchInputComponent,
ToolbarModule,
MatProgressBarModule,
DocumentListModule,
DataTableModule,
@@ -61,9 +60,9 @@ import { DocumentListDirective } from '../../../directives/document-list.directi
InfoDrawerComponent,
ContextActionsDirective,
DocumentListDirective,
ToolbarActionComponent,
PaginationDirective,
PageLayoutComponent
PageLayoutComponent,
ToolbarComponent
],
selector: 'aca-search-results',
templateUrl: './search-libraries-results.component.html',

View File

@@ -1,12 +1,8 @@
<aca-page-layout>
<div class="aca-page-layout-header">
<aca-search-input></aca-search-input>
<div class="adf-toolbar--spacer adf-toolbar-divider"></div>
<adf-toolbar class="adf-toolbar--inline">
<ng-container *ngFor="let entry of actions; trackBy: trackByActionId">
<aca-toolbar-action [actionRef]="entry"></aca-toolbar-action>
</ng-container>
</adf-toolbar>
<div class="aca-search-toolbar-spacer"></div>
<aca-toolbar [items]="actions"></aca-toolbar>
</div>
<div class="aca-page-layout-content">

View File

@@ -1,5 +1,11 @@
@import '../../../ui/mixins';
aca-search-results {
.aca-search-toolbar-spacer {
width: 100%;
}
}
.adf-search-results {
@include flex-row;

View File

@@ -35,7 +35,7 @@ import {
ShowInfoDrawerPreviewAction,
SnackbarErrorAction
} from '@alfresco/aca-shared/store';
import { DataTableModule, PaginationModule, ToolbarModule, TranslationService, ViewerModule } from '@alfresco/adf-core';
import { DataTableModule, PaginationModule, TranslationService, ViewerModule } from '@alfresco/adf-core';
import { combineLatest } from 'rxjs';
import {
ContextActionsDirective,
@@ -43,7 +43,7 @@ import {
PageComponent,
PageLayoutComponent,
PaginationDirective,
ToolbarActionComponent
ToolbarComponent
} from '@alfresco/aca-shared';
import { SearchSortingDefinition } from '@alfresco/adf-content-services/lib/search/models/search-sorting-definition.interface';
import { takeUntil } from 'rxjs/operators';
@@ -66,7 +66,6 @@ import { SearchResultsRowComponent } from '../search-results-row/search-results-
CommonModule,
TranslateModule,
SearchInputComponent,
ToolbarModule,
MatProgressBarModule,
SearchModule,
MatDividerModule,
@@ -85,8 +84,8 @@ import { SearchResultsRowComponent } from '../search-results-row/search-results-
SearchResultsRowComponent,
PaginationDirective,
ViewerModule,
ToolbarActionComponent,
PageLayoutComponent
PageLayoutComponent,
ToolbarComponent
],
selector: 'aca-search-results',
templateUrl: './search-results.component.html',

View File

@@ -1,12 +1,7 @@
<aca-page-layout>
<div class="aca-page-layout-header">
<h1 class="aca-page-title">{{ 'APP.BROWSE.SHARED.TITLE' | translate }}</h1>
<adf-toolbar class="adf-toolbar--inline">
<ng-container *ngFor="let entry of actions; trackBy: trackByActionId">
<aca-toolbar-action [actionRef]="entry"></aca-toolbar-action>
</ng-container>
</adf-toolbar>
<aca-toolbar [items]="actions"></aca-toolbar>
</div>
<div class="aca-page-layout-content">
@@ -15,7 +10,6 @@
#documentList
acaDocumentList
acaContextActions
[display]="documentDisplayMode$ | async"
[currentFolderId]="'-sharedlinks-'"
[selectionMode]="'multiple'"
[sorting]="['modifiedAt', 'desc']"

View File

@@ -32,12 +32,12 @@ import {
PageComponent,
PageLayoutComponent,
PaginationDirective,
ToolbarActionComponent
ToolbarComponent
} from '@alfresco/aca-shared';
import { DocumentListPresetRef, ExtensionsModule } from '@alfresco/adf-extensions';
import { CommonModule } from '@angular/common';
import { DocumentListModule } from '@alfresco/adf-content-services';
import { DataTableModule, PaginationModule, TemplateModule, ToolbarModule } from '@alfresco/adf-core';
import { DataTableModule, PaginationModule, TemplateModule } from '@alfresco/adf-core';
import { DocumentListDirective } from '../../directives/document-list.directive';
import { TranslateModule } from '@ngx-translate/core';
@@ -45,7 +45,6 @@ import { TranslateModule } from '@ngx-translate/core';
standalone: true,
imports: [
CommonModule,
ToolbarModule,
DocumentListModule,
DocumentListDirective,
ContextActionsDirective,
@@ -55,9 +54,9 @@ import { TranslateModule } from '@ngx-translate/core';
PaginationModule,
InfoDrawerComponent,
PaginationDirective,
ToolbarActionComponent,
PageLayoutComponent,
TranslateModule
TranslateModule,
ToolbarComponent
],
templateUrl: './shared-files.component.html',
encapsulation: ViewEncapsulation.None

View File

@@ -1,9 +1,7 @@
<ng-container *ngIf="sharedLinkId">
<adf-alfresco-viewer [allowPrint]="false" [allowDownload]="false" [allowFullScreen]="false" [sharedLinkId]="sharedLinkId" [allowGoBack]="false">
<adf-viewer-toolbar-actions>
<ng-container *ngFor="let action of viewerToolbarActions; trackBy: trackByActionId">
<aca-toolbar-action [actionRef]="action"></aca-toolbar-action>
</ng-container>
<aca-toolbar [items]="viewerToolbarActions"></aca-toolbar>
</adf-viewer-toolbar-actions>
</adf-alfresco-viewer>
</ng-container>

View File

@@ -31,13 +31,13 @@ import { ActivatedRoute } from '@angular/router';
import { Store } from '@ngrx/store';
import { forkJoin, from, of, Subject } from 'rxjs';
import { catchError, mergeMap, takeUntil } from 'rxjs/operators';
import { AppExtensionService, AppService, ToolbarActionComponent } from '@alfresco/aca-shared';
import { AppExtensionService, AppService, ToolbarComponent } from '@alfresco/aca-shared';
import { CommonModule } from '@angular/common';
import { AlfrescoViewerModule } from '@alfresco/adf-content-services';
@Component({
standalone: true,
imports: [CommonModule, ViewerModule, AlfrescoViewerModule, ToolbarActionComponent],
imports: [CommonModule, ViewerModule, AlfrescoViewerModule, ToolbarComponent],
selector: 'app-shared-link-view',
templateUrl: './shared-link-view.component.html',
styleUrls: ['shared-link-view.component.scss'],
@@ -87,8 +87,4 @@ export class SharedLinkViewComponent implements OnInit, OnDestroy {
this.onDestroy$.next(true);
this.onDestroy$.complete();
}
trackByActionId(_: number, action: ContentActionRef) {
return action.id;
}
}

View File

@@ -14,8 +14,6 @@
{{ appName$ | async | translate }}
</div>
<ng-container *ngFor="let actionRef of actions; trackBy: trackByActionId">
<aca-toolbar-action [actionRef]="actionRef"></aca-toolbar-action>
</ng-container>
<aca-toolbar [items]="actions"></aca-toolbar>
</div>
</div>

View File

@@ -22,13 +22,13 @@
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
*/
import { Component, EventEmitter, OnDestroy, OnInit, Output, ViewEncapsulation } from '@angular/core';
import { Component, EventEmitter, inject, OnDestroy, OnInit, Output, ViewEncapsulation } from '@angular/core';
import { Store } from '@ngrx/store';
import { Observable, Subject } from 'rxjs';
import { Subject } from 'rxjs';
import { AppStore, getAppName, getLogoPath } from '@alfresco/aca-shared/store';
import { AppConfigService } from '@alfresco/adf-core';
import { ContentActionRef } from '@alfresco/adf-extensions';
import { AppExtensionService, ToolbarActionComponent } from '@alfresco/aca-shared';
import { AppExtensionService, ToolbarComponent } from '@alfresco/aca-shared';
import { takeUntil } from 'rxjs/operators';
import { CommonModule } from '@angular/common';
import { TranslateModule } from '@ngx-translate/core';
@@ -36,7 +36,7 @@ import { RouterModule } from '@angular/router';
@Component({
standalone: true,
imports: [CommonModule, TranslateModule, RouterModule, ToolbarActionComponent],
imports: [CommonModule, TranslateModule, RouterModule, ToolbarComponent],
selector: 'app-sidenav-header',
templateUrl: `./sidenav-header.component.html`,
encapsulation: ViewEncapsulation.None,
@@ -44,21 +44,18 @@ import { RouterModule } from '@angular/router';
})
export class SidenavHeaderComponent implements OnInit, OnDestroy {
private onDestroy$ = new Subject<boolean>();
private store = inject<Store<AppStore>>(Store);
private appConfigService = inject(AppConfigService);
private appExtensions = inject(AppExtensionService);
appName$: Observable<string>;
logo$: Observable<string>;
landingPage: string;
appName$ = this.store.select(getAppName);
logo$ = this.store.select(getLogoPath);
landingPage = this.appConfigService.get('landingPage', '/personal-files');
actions: Array<ContentActionRef> = [];
@Output()
toggleNavBar = new EventEmitter();
constructor(public store: Store<AppStore>, private appConfigService: AppConfigService, private appExtensions: AppExtensionService) {
this.appName$ = store.select(getAppName);
this.logo$ = store.select(getLogoPath);
this.landingPage = this.appConfigService.get('landingPage', '/personal-files');
}
ngOnInit() {
this.appExtensions
.getHeaderActions()
@@ -72,8 +69,4 @@ export class SidenavHeaderComponent implements OnInit, OnDestroy {
this.onDestroy$.next(true);
this.onDestroy$.complete();
}
trackByActionId(_: number, action: ContentActionRef) {
return action.id;
}
}

View File

@@ -1,12 +1,7 @@
<aca-page-layout>
<div class="aca-page-layout-header">
<h1 class="aca-page-title">{{ 'APP.BROWSE.TRASHCAN.TITLE' | translate }}</h1>
<adf-toolbar class="adf-toolbar--inline">
<ng-container *ngFor="let entry of actions; trackBy: trackByActionId">
<aca-toolbar-action [actionRef]="entry"></aca-toolbar-action>
</ng-container>
</adf-toolbar>
<aca-toolbar [items]="actions"></aca-toolbar>
</div>
<div class="aca-page-layout-content">
@@ -15,7 +10,6 @@
#documentList
acaDocumentList
acaContextActions
[display]="documentDisplayMode$ | async"
[currentFolderId]="'-trashcan-'"
[selectionMode]="'multiple'"
[multiselect]="false"

View File

@@ -25,11 +25,11 @@
import { getUserProfile } from '@alfresco/aca-shared/store';
import { DocumentListPresetRef, ExtensionsModule } from '@alfresco/adf-extensions';
import { Component, OnInit, ViewEncapsulation } from '@angular/core';
import { ContextActionsDirective, PageComponent, PageLayoutComponent, PaginationDirective, ToolbarActionComponent } from '@alfresco/aca-shared';
import { ContextActionsDirective, PageComponent, PageLayoutComponent, PaginationDirective, ToolbarComponent } from '@alfresco/aca-shared';
import { CommonModule } from '@angular/common';
import { TranslateModule } from '@ngx-translate/core';
import { DocumentListModule } from '@alfresco/adf-content-services';
import { DataTableModule, PaginationModule, TemplateModule, ToolbarModule } from '@alfresco/adf-core';
import { DataTableModule, PaginationModule, TemplateModule } from '@alfresco/adf-core';
import { DocumentListDirective } from '../../directives/document-list.directive';
@Component({
@@ -37,7 +37,6 @@ import { DocumentListDirective } from '../../directives/document-list.directive'
imports: [
CommonModule,
TranslateModule,
ToolbarModule,
DocumentListModule,
TemplateModule,
PaginationModule,
@@ -46,8 +45,8 @@ import { DocumentListDirective } from '../../directives/document-list.directive'
DocumentListDirective,
ContextActionsDirective,
PaginationDirective,
ToolbarActionComponent,
PageLayoutComponent
PageLayoutComponent,
ToolbarComponent
],
templateUrl: './trashcan.component.html',
encapsulation: ViewEncapsulation.None

View File

@@ -51,7 +51,6 @@ export const INITIAL_APP_STATE: AppState = {
infoDrawerMetadataAspect: '',
showFacetFilter: true,
fileUploadingDialog: true,
documentDisplayMode: 'list',
showLoader: false,
repository: {
status: {

View File

@@ -73,9 +73,6 @@ export function appReducer(state: AppState = INITIAL_APP_STATE, action: Action):
case AppActionTypes.SetInfoDrawerMetadataAspect:
newState = setInfoDrawerAspect(state, action as SetInfoDrawerMetadataAspectAction);
break;
case AppActionTypes.ToggleDocumentDisplayMode:
newState = toggleDocumentDisplayMode(state);
break;
case AppActionTypes.SetRepositoryInfo:
newState = updateRepositoryStatus(state, action as SetRepositoryInfoAction);
break;
@@ -173,11 +170,6 @@ function showInfoDrawerPreview(state: AppState) {
return newState;
}
const toggleDocumentDisplayMode = (state: AppState) => ({
...state,
documentDisplayMode: state.documentDisplayMode === 'list' ? 'gallery' : 'list'
});
function updateSelectedNodes(state: AppState, action: SetSelectedNodesAction): AppState {
const newState = { ...state };
const nodes = [...action.payload];

View File

@@ -2,7 +2,6 @@
@use '@angular/material' as mat;
@import 'mixins';
@import 'theme';
@import 'variables/font-family';
$foreground: map-get($custom-theme, foreground);
@@ -11,7 +10,7 @@ body {
@include flex-column;
font-size: 14px;
font-family: $default-font-family;
font-family: 'Open Sans', serif;
color: mat.get-color-from-palette($foreground, text, 0.87);
margin: 0;

View File

@@ -1,14 +0,0 @@
/* stylelint-disable scss/no-global-function-names */
@function get-custom-background-color($background-color, $theme) {
$background: map-get($theme, background);
$card: map-get($background, card);
$new-card-color: lighten($background-color, 10%);
$new-selected-button: lighten($background-color, 5%);
$background: map_merge($background, (background: $background-color));
$background: map_merge($background, (card: $new-card-color));
$background: map_merge($background, (modal: $new-card-color));
$background: map_merge($background, (dialog: $new-card-color));
$background: map_merge($background, (selected-button: $new-selected-button));
@return $background;
}

View File

@@ -1,132 +0,0 @@
/* stylelint-disable scss/dollar-variable-pattern */
/* stylelint-disable scss/no-global-function-names */
/* stylelint-disable value-keyword-case */
@use "sass:math";
@function multiply($fore, $back) {
$red: red($back) * red($fore) / 255;
$green: green($back) * green($fore) / 255;
$blue: blue($back) * blue($fore) / 255;
@return rgb($red, $green, $blue);
}
@function get-color-luminance($color) {
$colors: (
'red': red($color),
'green': green($color),
'blue': blue($color)
);
@each $name, $value in $colors {
$adjusted: 0;
$value: $value / 255;
@if $value < 0.0393 {
$value: $value / 12.92;
} @else {
$value: ($value + .055) / 1.055;
$value: math.pow($value, 2.4);
}
$colors: map-merge($colors, ($name: $value));
}
@return (map-get($colors, 'red') * .2126) + (map-get($colors, 'green') * .7152) + (map-get($colors, 'blue') * .0722);
}
@function create-text-color($color, $color-type: 'primary') {
$red: red($color);
$green: green($color);
$blue: blue($color);
$light-text: $light-primary-text;
$dark-text: $dark-primary-text;
@if $color-type == 'accent' {
$light-text: $light-secondary-text;
$dark-text: $dark-secondary-text;
}
$light-text-luminance: get-color-luminance($light-text);
$dark-text-luminance: get-color-luminance($dark-text);
$background-color-luminance: get-color-luminance($color);
$light-text-luminance: $light-text-luminance + 0.5;
$dark-text-luminance: $dark-text-luminance + 0.5;
$background-color-luminance: $background-color-luminance + 0.5;
$luminance-contrast-for-light-text: $light-text-luminance / $background-color-luminance;
$luminance-contrast-for-dark-text: $background-color-luminance / $dark-text-luminance;
$text-colour: $light-text;
@if $luminance-contrast-for-dark-text > $luminance-contrast-for-light-text {
$text-colour: $dark-text;
}
@return $text-colour;
}
@function create-color-palette($color, $color-type: 'primary') {
$light: #fff;
$dark: multiply($color, $color);
$color50: mix($light, $color, 88%);
$color100: mix($light, $color, 70%);
$color200: mix($light, $color, 50%);
$color300: mix($light, $color, 30%);
$color400: mix($light, $color, 15%);
$color500: mix($light, $color, 0%);
$color600: mix($dark, $color, 13%);
$color700: mix($dark, $color, 30%);
$color800: mix($dark, $color, 46%);
$color900: mix($dark, $color, 75%);
$colorA100: lighten(saturate(mix($dark, $color, 15%), 80%), 45.6%);
$colorA200: lighten(saturate(mix($dark, $color, 15%), 80%), 35.6%);
$colorA400: lighten(saturate(mix($dark, $color, 15%), 100%), 25.6%);
$colorA700: lighten(saturate(mix($dark, $color, 15%), 100%), 20.5%);
$contrast50: create-text-color($color50, $color-type);
$contrast100: create-text-color($color100, $color-type);
$contrast200: create-text-color($color200, $color-type);
$contrast300: create-text-color($color300, $color-type);
$contrast400: create-text-color($color400, $color-type);
$contrast500: create-text-color($color500, $color-type);
$contrast600: create-text-color($color600, $color-type);
$contrast700: create-text-color($color700, $color-type);
$contrast800: create-text-color($color800, $color-type);
$contrast900: create-text-color($color900, $color-type);
$contrastA100: create-text-color($colorA100, $color-type);
$contrastA200: create-text-color($colorA200, $color-type);
$contrastA400: create-text-color($colorA400, $color-type);
$contrastA700: create-text-color($colorA700, $color-type);
$palette: (
50: $color50,
100: $color50,
200: $color50,
300: $color50,
400: $color400,
500: $color500,
600: $color600,
700: $color700,
800: $color800,
900: $color900,
A100: $colorA100,
A200: $colorA200,
A400: $colorA400,
A700: $colorA700,
contrast: (
50: $contrast50,
100: $contrast100,
200: $contrast200,
300: $contrast300,
400: $contrast400,
500: $contrast500,
600: $contrast600,
700: $contrast700,
800: $contrast800,
900: $contrast900,
A100: $contrastA100,
A200: $contrastA200,
A400: $contrastA400,
A700: $contrastA700
)
);
@return $palette;
}

View File

@@ -1,8 +0,0 @@
/* stylelint-disable scss/no-global-function-names */
@function get-custom-text-color($text-color, $theme) {
$foreground: map-get($custom-theme, foreground);
$foreground: map_merge($foreground, (text: $text-color));
$foreground: map_merge($foreground, (secondary-text: $text-color));
@return $foreground;
}

View File

@@ -1,33 +0,0 @@
/* stylelint-disable value-keyword-case */
@use '@angular/material' as mat;
@import '../colors';
@import './custom-palette-creator';
@function get-mat-palettes($primary-color, $accent-color) {
$mat-primary-palette: null;
@if $primary-color {
$custom-theme-primary-palette: create-color-palette($primary-color, 'primary');
$mat-primary-palette: mat.define-palette($custom-theme-primary-palette, 500);
} @else {
$mat-primary-palette: mat.define-palette($aca-primary-blue, A100);
}
$mat-accent-palette: null;
@if $accent-color {
$custom-theme-accent-palette: create-color-palette($accent-color, 'accent');
$mat-accent-palette: mat.define-palette($custom-theme-accent-palette, 500);
} @else {
$mat-accent-palette: mat.define-palette($aca-accent-green, A200);
}
$mat-warn-palette: mat.define-palette($aca-warn, A100);
@return (
primary: $mat-primary-palette,
accent: $mat-accent-palette,
warning: $mat-warn-palette,
)
}

View File

@@ -1,72 +0,0 @@
@import '@angular/material/theming';
@import './overrides/adf-style-fixes.theme';
@import './overrides/adf-pagination.theme';
@import './overrides/adf-about.theme.scss';
@import "./dynamic-theme/theme-configuration";
@import "./dynamic-theme/typography";
@import "./dynamic-theme/custom-theme-palettes";
@import "./dynamic-theme/custom-background-color";
@import "./dynamic-theme/custom-text-color";
$primary-color: map-get($theme-config, 'primaryColor');
$accent-color: map-get($theme-config, 'accentColor');
$background-color: map-get($theme-config, 'backgroundColor');
$text-color: map-get($theme-config, 'textColor');
$base-font-size: map-get($theme-config, 'baseFontSize');
$font-family: map-get($theme-config, 'fontFamily');
$app-typography: get-mat-typography(
$base-font-size,
$font-family
);
@include mat-core();
$palettes: get-mat-palettes($primary-color, $accent-color);
$custom-theme: mat-light-theme(
(
color: (
primary: map-get($palettes, primary),
accent: map-get($palettes, accent),
warn: map-get($palettes, warning)
),
typography: $app-typography
)
);
@if $background-color {
$custom-background: get-custom-background-color($background-color, $custom-theme);
$custom-theme: map_merge($custom-theme, (background: $custom-background));
$color: map_get($custom-theme, color);
$new-color: map_merge($color, (background: $custom-background));
$custom-theme: map_merge($custom-theme, (color: $new-color));
}
@if $text-color {
$custom-foreground: get-custom-text-color($text-color, $custom-theme);
$custom-theme: map_merge($custom-theme, (foreground: $custom-foreground));
$color: map_get($custom-theme, color);
$new-color: map_merge($color, (foreground: $custom-foreground));
$custom-theme: map_merge($custom-theme, (color: $new-color));
}
@mixin custom-theme($theme) {
@include angular-material-theme($theme);
@if $base-font-size {
@include adf-core-theme($theme, get-custom-adf-font-sizes());
@include base-font-size($base-font-size);
} @else {
@include adf-core-theme($theme);
}
@if $font-family {
@include base-font-family($font-family);
}
@include adf-style-fixes($theme);
@include adf-pagination-theme($theme);
@include adf-about-theme($theme);
}

View File

@@ -1 +0,0 @@
@import '../theme';

View File

@@ -1,14 +0,0 @@
/*
Specify theme parameters e.g.:
$theme-config: (
primaryColor: #5175d2,
backgroundColor: #FAFAFA,
textColor: #793942,
accentColor: #C64F73,
baseFontSize: 26px,
fontFamily: Cursive
);
*/
${THEME_CONFIGURATION}

View File

@@ -1,94 +0,0 @@
/* stylelint-disable scss/no-global-function-names */
@use '@angular/material' as mat;
@import '../variables/font-family';
@function get-mat-typography($base-font-size, $font-family) {
$custom-typography: mat.define-typography-config(
$font-family: 'Muli, Roboto, "Helvetica Neue", sans-serif',
$display-4: mat.define-typography-level(112px, 112px, 300),
$display-3: mat.define-typography-level(56px, 56px, 400),
$display-2: mat.define-typography-level(45px, 48px, 400),
$display-1: mat.define-typography-level(34px, 40px, 400),
$headline: mat.define-typography-level(24px, 32px, 400),
$title: mat.define-typography-level(20px, 32px, 500),
$subheading-2: mat.define-typography-level(16px, 28px, 400),
$subheading-1: mat.define-typography-level(15px, 24px, 400),
$body-2: mat.define-typography-level(14px, 24px, 500),
$body-1: mat.define-typography-level(14px, 20px, 400),
$caption: mat.define-typography-level(12px, 20px, 400),
$button: mat.define-typography-level(14px, 14px, 500),
// Line-height must be unit-less fraction of the font-size.
$input: mat.define-typography-level(16px, 1.25, 400)
);
@if $base-font-size {
$custom-typography: mat.define-typography-config(
$display-4: mat.define-typography-level(8rem, 8rem, 300),
$display-3: mat.define-typography-level(4rem, 4rem, 400),
$display-2: mat.define-typography-level(3.21rem, 3.21rem, 400),
$display-1: mat.define-typography-level(2.42rem, 2.85rem, 400),
$headline: mat.define-typography-level(1.71rem, 2.28rem, 400),
$title: mat.define-typography-level(1.42rem, 2.28rem, 500),
$subheading-2: mat.define-typography-level(1.14rem, 2rem, 400),
$subheading-1: mat.define-typography-level(1.07rem, 1.71rem, 400),
$body-2: mat.define-typography-level(1rem, 1.71rem, 500),
$body-1: mat.define-typography-level(1rem, 1.42rem, 400),
$caption: mat.define-typography-level(0.86rem, 1.42rem, 400),
$button: mat.define-typography-level(1rem, 1rem, 500),
$font-family: $default-font-family,
$input: mat.define-typography-level(1.14em, 1.25, 400)
);
}
@if $font-family {
@each $key, $level in $custom-typography {
@if type-of($level) == 'map' {
$new-level: map-merge(
$level,
(
font-family: $font-family
)
);
$custom-typography: map-merge(
$custom-typography,
(
$key: $new-level
)
);
}
}
$custom-typography: map-merge(
$custom-typography,
(
font-family: $font-family
)
);
}
@return $custom-typography;
}
@function get-custom-adf-font-sizes() {
@return (
'theme-adf-icon-1-font-size': 1.2rem,
'theme-adf-picture-1-font-size': 1.28rem,
'theme-adf-task-footer-font-size': 1.28rem,
'theme-adf-task-title-font-size': 1.28rem,
'theme-adf-spacing': 16px
);
}
@mixin base-font-size($font-size) {
html,
body {
font-size: $font-size;
}
}
@mixin base-font-family($font-family) {
html,
body {
font-family: $font-family;
}
}

View File

@@ -1 +0,0 @@
$default-font-family: "Open Sans";

View File

@@ -30,9 +30,7 @@
</adf-viewer-open-with>
<adf-viewer-toolbar-actions>
<ng-container *ngFor="let action of toolbarActions; trackBy: trackByActionId">
<aca-toolbar-action [actionRef]="action"></aca-toolbar-action>
</ng-container>
<aca-toolbar [items]="toolbarActions"></aca-toolbar>
</adf-viewer-toolbar-actions>
</adf-alfresco-viewer>
</ng-container>

View File

@@ -27,7 +27,7 @@ import {
AppHookService,
ContentApiService,
InfoDrawerComponent,
ToolbarActionComponent,
ToolbarComponent,
ToolbarMenuItemComponent
} from '@alfresco/aca-shared';
import {
@@ -56,7 +56,7 @@ import { CommonModule } from '@angular/common';
@Component({
standalone: true,
imports: [CommonModule, ViewerModule, AlfrescoViewerModule, InfoDrawerComponent, AppConfigModule, ToolbarMenuItemComponent, ToolbarActionComponent],
imports: [CommonModule, ViewerModule, AlfrescoViewerModule, InfoDrawerComponent, AppConfigModule, ToolbarMenuItemComponent, ToolbarComponent],
selector: 'aca-viewer',
templateUrl: './viewer.component.html',
styleUrls: ['./viewer.component.scss'],