mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-24 17:31:52 +00:00
improve compatibility (#2256)
* improve compatibility * fix * fix * fix * fix
This commit is contained in:
@@ -5,7 +5,8 @@ This library was generated with [Angular CLI](https://github.com/angular/angular
|
||||
## Code scaffolding
|
||||
|
||||
Run `ng generate component component-name --project aca-shared` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project aca-shared`.
|
||||
> Note: Don't forget to add `--project aca-shared` or else it will be added to the default project in your `angular.json` file.
|
||||
|
||||
> Note: Don't forget to add `--project aca-shared` or else it will be added to the default project in your `angular.json` file.
|
||||
|
||||
## Build
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
// Karma configuration file, see link for more information
|
||||
// https://karma-runner.github.io/1.0/config/configuration-file.html
|
||||
|
||||
module.exports = function(config) {
|
||||
module.exports = function (config) {
|
||||
config.set({
|
||||
basePath: '',
|
||||
frameworks: ['jasmine', '@angular-devkit/build-angular'],
|
||||
|
@@ -2,28 +2,15 @@
|
||||
<mat-progress-bar mode="indeterminate"></mat-progress-bar>
|
||||
</div>
|
||||
<ng-container *ngIf="!isLoading && !!displayNode">
|
||||
<adf-info-drawer
|
||||
[title]="'APP.INFO_DRAWER.TITLE'"
|
||||
cdkTrapFocus
|
||||
cdkTrapFocusAutoCapture
|
||||
>
|
||||
<adf-info-drawer [title]="'APP.INFO_DRAWER.TITLE'" cdkTrapFocus cdkTrapFocusAutoCapture>
|
||||
<adf-toolbar class="adf-toolbar--inline" info-drawer-buttons>
|
||||
<ng-container *ngFor="let entry of actions; trackBy: trackByActionId">
|
||||
<aca-toolbar-action [actionRef]="entry" [color]="getEntryColor(entry)"></aca-toolbar-action>
|
||||
</ng-container>
|
||||
</adf-toolbar>
|
||||
|
||||
<adf-info-drawer-tab
|
||||
*ngFor="let tab of tabs"
|
||||
[icon]="tab.icon"
|
||||
[label]="tab.title"
|
||||
>
|
||||
<adf-dynamic-tab
|
||||
[node]="$any(displayNode)"
|
||||
[id]="tab.component"
|
||||
[attr.data-automation-id]="tab.component"
|
||||
>
|
||||
</adf-dynamic-tab>
|
||||
<adf-info-drawer-tab *ngFor="let tab of tabs" [icon]="tab.icon" [label]="tab.title">
|
||||
<adf-dynamic-tab [node]="$any(displayNode)" [id]="tab.component" [attr.data-automation-id]="tab.component"> </adf-dynamic-tab>
|
||||
</adf-info-drawer-tab>
|
||||
</adf-info-drawer>
|
||||
</ng-container>
|
||||
|
@@ -1,28 +1,19 @@
|
||||
<ng-container [ngSwitch]="actionRef.type">
|
||||
<ng-container *ngSwitchCase="'default'">
|
||||
<app-toolbar-button [type]="type" [actionRef]="actionRef" [color]="color">
|
||||
</app-toolbar-button>
|
||||
<app-toolbar-button [type]="type" [actionRef]="actionRef" [color]="color"> </app-toolbar-button>
|
||||
</ng-container>
|
||||
|
||||
<ng-container *ngSwitchCase="'button'">
|
||||
<app-toolbar-button [type]="type" [actionRef]="actionRef" [color]="color">
|
||||
</app-toolbar-button>
|
||||
<app-toolbar-button [type]="type" [actionRef]="actionRef" [color]="color"> </app-toolbar-button>
|
||||
</ng-container>
|
||||
|
||||
<adf-toolbar-divider
|
||||
*ngSwitchCase="'separator'"
|
||||
[id]="actionRef.id"
|
||||
></adf-toolbar-divider>
|
||||
<adf-toolbar-divider *ngSwitchCase="'separator'" [id]="actionRef.id"></adf-toolbar-divider>
|
||||
|
||||
<ng-container *ngSwitchCase="'menu'">
|
||||
<app-toolbar-menu [actionRef]="actionRef" [color]="color">
|
||||
</app-toolbar-menu>
|
||||
<app-toolbar-menu [actionRef]="actionRef" [color]="color"> </app-toolbar-menu>
|
||||
</ng-container>
|
||||
|
||||
<ng-container *ngSwitchCase="'custom'">
|
||||
<adf-dynamic-component
|
||||
[data]="actionRef.data"
|
||||
[id]="actionRef.component"
|
||||
></adf-dynamic-component>
|
||||
<adf-dynamic-component [data]="actionRef.data" [id]="actionRef.component"></adf-dynamic-component>
|
||||
</ng-container>
|
||||
</ng-container>
|
||||
|
@@ -58,28 +58,62 @@ import { map } from 'rxjs/operators';
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class ContentApiService {
|
||||
private nodesApi: NodesApi;
|
||||
private trashcanApi: TrashcanApi;
|
||||
private sharedLinksApi: SharedlinksApi;
|
||||
private discoveryApi: DiscoveryApi;
|
||||
private favoritesApi: FavoritesApi;
|
||||
private contentApi: ContentApi;
|
||||
private sitesApi: SitesApi;
|
||||
private searchApi: SearchApi;
|
||||
private peopleApi: PeopleApi;
|
||||
|
||||
constructor(private api: AlfrescoApiService, private preferences: UserPreferencesService) {
|
||||
this.nodesApi = new NodesApi(this.api.getInstance());
|
||||
this.trashcanApi = new TrashcanApi(this.api.getInstance());
|
||||
this.sharedLinksApi = new SharedlinksApi(this.api.getInstance());
|
||||
this.discoveryApi = new DiscoveryApi(this.api.getInstance());
|
||||
this.favoritesApi = new FavoritesApi(this.api.getInstance());
|
||||
this.contentApi = new ContentApi(this.api.getInstance());
|
||||
this.sitesApi = new SitesApi(this.api.getInstance());
|
||||
this.searchApi = new SearchApi(this.api.getInstance());
|
||||
this.peopleApi = new PeopleApi(this.api.getInstance());
|
||||
_nodesApi: NodesApi;
|
||||
get nodesApi(): NodesApi {
|
||||
this._nodesApi = this._nodesApi ?? new NodesApi(this.api.getInstance());
|
||||
return this._nodesApi;
|
||||
}
|
||||
|
||||
_trashcanApi: TrashcanApi;
|
||||
get trashcanApi(): TrashcanApi {
|
||||
this._trashcanApi = this._trashcanApi ?? new TrashcanApi(this.api.getInstance());
|
||||
return this._trashcanApi;
|
||||
}
|
||||
|
||||
_sharedLinksApi: SharedlinksApi;
|
||||
get sharedLinksApi(): SharedlinksApi {
|
||||
this._sharedLinksApi = this._sharedLinksApi ?? new SharedlinksApi(this.api.getInstance());
|
||||
return this._sharedLinksApi;
|
||||
}
|
||||
|
||||
_discoveryApi: DiscoveryApi;
|
||||
get discoveryApi(): DiscoveryApi {
|
||||
this._discoveryApi = this._discoveryApi ?? new DiscoveryApi(this.api.getInstance());
|
||||
return this._discoveryApi;
|
||||
}
|
||||
|
||||
_favoritesApi: FavoritesApi;
|
||||
get favoritesApi(): FavoritesApi {
|
||||
this._favoritesApi = this._favoritesApi ?? new FavoritesApi(this.api.getInstance());
|
||||
return this._favoritesApi;
|
||||
}
|
||||
|
||||
_contentApi: ContentApi;
|
||||
get contentApi(): ContentApi {
|
||||
this._contentApi = this._contentApi ?? new ContentApi(this.api.getInstance());
|
||||
return this._contentApi;
|
||||
}
|
||||
|
||||
_sitesApi: SitesApi;
|
||||
get sitesApi(): SitesApi {
|
||||
this._sitesApi = this._sitesApi ?? new SitesApi(this.api.getInstance());
|
||||
return this._sitesApi;
|
||||
}
|
||||
|
||||
_searchApi: SearchApi;
|
||||
get searchApi(): SearchApi {
|
||||
this._searchApi = this._searchApi ?? new SearchApi(this.api.getInstance());
|
||||
return this._searchApi;
|
||||
}
|
||||
|
||||
_peopleApi: PeopleApi;
|
||||
get peopleApi(): PeopleApi {
|
||||
this._peopleApi = this._peopleApi ?? new PeopleApi(this.api.getInstance());
|
||||
return this._peopleApi;
|
||||
}
|
||||
|
||||
constructor(private api: AlfrescoApiService, private preferences: UserPreferencesService) {}
|
||||
|
||||
/**
|
||||
* Moves a node to the trashcan.
|
||||
* @param nodeId ID of the target node
|
||||
|
@@ -1,52 +0,0 @@
|
||||
/*!
|
||||
* @license
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
*
|
||||
* This file is part of the Alfresco Example Content Application.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
* the paid license agreement will prevail. Otherwise, the software is
|
||||
* provided under the following open source license terms:
|
||||
*
|
||||
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { APP_BOOTSTRAP_LISTENER, InjectionToken, Inject, Type } from '@angular/core';
|
||||
import { EffectSources } from '@ngrx/effects';
|
||||
|
||||
export const BOOTSTRAP_EFFECTS = new InjectionToken('Bootstrap Effects');
|
||||
|
||||
export function bootstrapEffects(effects: Type<any>[], sources: EffectSources) {
|
||||
return () => {
|
||||
effects.forEach((effect) => sources.addEffects(effect));
|
||||
};
|
||||
}
|
||||
|
||||
export function createInstances(...instances: any[]) {
|
||||
return instances;
|
||||
}
|
||||
|
||||
export function provideBootstrapEffects(effects: Type<any>[]) {
|
||||
return [
|
||||
effects,
|
||||
{ provide: BOOTSTRAP_EFFECTS, deps: effects, useFactory: createInstances },
|
||||
{
|
||||
provide: APP_BOOTSTRAP_LISTENER,
|
||||
multi: true,
|
||||
useFactory: bootstrapEffects,
|
||||
deps: [[new Inject(BOOTSTRAP_EFFECTS)], EffectSources]
|
||||
}
|
||||
];
|
||||
}
|
@@ -49,4 +49,3 @@ export * from './selectors/app.selectors';
|
||||
export * from './states/app.state';
|
||||
|
||||
export * from './store.module';
|
||||
export * from './bootstrap-effect';
|
||||
|
@@ -3,4 +3,4 @@
|
||||
"angularCompilerOptions": {
|
||||
"enableIvy": false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user