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

@@ -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;
}
}