[ADF-4125] simplify extension load in extension module (#4214)

* add extension load in extension module

* add viewer extensions

* fix license header

* fix node passed in the viewer extension

* fix node passed in the viewer extension

* startup factory extension

* startup factory extension

* fix script

* fix beta tag build

* fix build

* fix build

* refactoring configuration files

* extension using map

* fix build

* fix config

* fix test

* fix test
This commit is contained in:
Eugenio Romano
2019-02-22 14:19:41 +00:00
committed by GitHub
parent bf4d1a2806
commit bda7e07b52
92 changed files with 1035 additions and 785 deletions
@@ -27,6 +27,7 @@ import { of } from 'rxjs';
import { ContentTestingModule } from '../testing/content.testing.module';
import { DocumentListService } from '../document-list/services/document-list.service';
import { DocumentListComponent } from '../document-list/components/document-list.component';
import { ShareDataRow } from '../document-list';
describe('ContentNodeSelectorDialogComponent', () => {
@@ -36,7 +37,10 @@ describe('ContentNodeSelectorDialogComponent', () => {
title: 'Move along citizen...',
actionName: 'move',
select: new EventEmitter<Node>(),
rowFilter: () => {
rowFilter: (shareDataRow: ShareDataRow) => {
if (shareDataRow.node.entry.name === 'impossible-name') {
return true;
}
},
imageResolver: () => 'piccolo',
currentFolderId: 'cat-girl-nuku-nuku'
@@ -88,14 +92,25 @@ describe('ContentNodeSelectorDialogComponent', () => {
expect(documentList.componentInstance.currentFolderId).toBe('cat-girl-nuku-nuku');
});
xit('should pass through the injected rowFilter to the documentList', (done) => {
fixture.whenStable().then(() => {
let documentList = fixture.debugElement.query(By.directive(DocumentListComponent));
expect(documentList).not.toBeNull('Document list should be shown');
expect(documentList.componentInstance.rowFilter).toBe(data.rowFilter);
done();
});
it('should pass through the injected rowFilter to the documentList', () => {
let documentList = fixture.debugElement.query(By.directive(DocumentListComponent));
expect(documentList).not.toBeNull('Document list should be shown');
expect(documentList.componentInstance.rowFilter({
node: {
entry: new Node({
name: 'impossible-name',
id: 'name'
})
}
}))
.toBe(data.rowFilter(<ShareDataRow> {
node: {
entry: new Node({
name: 'impossible-name',
id: 'name'
})
}
}));
});
it('should pass through the injected imageResolver to the documentList', () => {
@@ -120,31 +120,6 @@ describe('ShareDialogComponent', () => {
});
}));
xit(`should copy shared link and notify on button event`, (done) => {
node.entry.properties['qshare:sharedId'] = 'sharedId';
spyOn(document, 'execCommand').and.callThrough();
component.data = {
node,
baseShareUrl: 'some-url/'
};
fixture.detectChanges();
fixture.whenStable().then(() => {
fixture.detectChanges();
fixture.nativeElement.querySelector('.adf-input-action')
.dispatchEvent(new MouseEvent('click'));
fixture.detectChanges();
expect(document.execCommand).toHaveBeenCalledWith('copy');
expect(notificationServiceMock.openSnackMessage).toHaveBeenCalledWith('SHARE.CLIPBOARD-MESSAGE');
done();
});
});
it('should open a confirmation dialog when unshare button is triggered', () => {
spyOn(matDialog, 'open').and.returnValue({ beforeClose: () => of(false) });
spyOn(sharedLinksApiService, 'deleteSharedLink').and.callThrough();
@@ -1219,7 +1219,7 @@ describe('DocumentList', () => {
documentList.loadFolderByNodeId('-recent-');
});
xit('should emit error when fetch recent fails on search call', (done) => {
it('should emit error when fetch recent fails on search call', (done) => {
spyOn(customResourcesService, 'loadFolderByNodeId').and.returnValue(throwError('error'));
let disposableError = documentList.error.subscribe((val) => {
@@ -55,7 +55,6 @@ class TestComponent {
describe('FolderCreateDirective', () => {
let fixture: ComponentFixture<TestTypeComponent | TestComponent>;
let element;
let node: any;
let dialog: MatDialog;
let contentService: ContentService;
let dialogRefMock;
@@ -85,8 +84,6 @@ describe('FolderCreateDirective', () => {
});
beforeEach(() => {
node = { entry: { id: 'nodeId' } };
dialogRefMock = {
afterClosed: (val) => of(val),
componentInstance: {
@@ -106,22 +103,6 @@ describe('FolderCreateDirective', () => {
spyOn(dialog, 'open').and.returnValue(dialogRefMock);
});
xit('should emit folderCreate event when input value is not undefined', (done) => {
spyOn(dialogRefMock, 'afterClosed').and.returnValue(of(node));
spyOn(contentService.folderCreate, 'next');
contentService.folderCreate.subscribe((val) => {
expect(val).toBe(node);
done();
});
fixture.detectChanges();
fixture.whenStable().then(() => {
element.nativeElement.click();
});
});
it('should not emit folderCreate event when input value is undefined', () => {
spyOn(dialogRefMock, 'afterClosed').and.returnValue(of(null));
spyOn(contentService.folderCreate, 'next');
+1 -1
View File
@@ -9,7 +9,7 @@
"entryFile": "./public-api.ts",
"flatModuleFile": "adf-content-services",
"umdModuleIds": {
"@alfresco/js-api": "@alfresco/js-ap",
"@alfresco/js-api": "@alfresco/js-api",
"minimatch": "minimatch",
"@angular/platform-browser/animations": "@angular/platform-browser/animations",
"@angular/material": "@angular/material",
@@ -20,7 +20,7 @@ import { TreeViewService } from './tree-view.service';
import { TestBed } from '@angular/core/testing';
import { ContentTestingModule } from '../../testing/content.testing.module';
import { of } from 'rxjs';
import { TreeBaseNode } from 'tree-view/models/tree-view.model';
import { TreeBaseNode } from '../models/tree-view.model';
describe('TreeViewService', () => {
-41
View File
@@ -1,41 +0,0 @@
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"skipLibCheck": false,
"noLib": false,
"allowUnreachableCode": false,
"allowUnusedLabels": false,
"noImplicitAny": false,
"noImplicitReturns": false,
"noImplicitUseStrict": false,
"noFallthroughCasesInSwitch": true,
"removeComments": true,
"declaration": true,
"outDir": "../dist/content-services/",
"baseUrl" : "./",
"paths": {
"@alfresco/adf-process-services": ["../process-services"],
"@alfresco/adf-core": ["../core"]
},
"lib": [
"es2016",
"dom"
],
"suppressImplicitAnyIndexErrors": true,
"noUnusedLocals": true
},
"exclude": [
"demo",
"node_modules",
"dist"
],
"angularCompilerOptions": {
"strictMetadataEmit": false,
"skipTemplateCodegen": true
}
}
+6
View File
@@ -0,0 +1,6 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../dist/content-services/"
}
}
+6
View File
@@ -0,0 +1,6 @@
{
"extends": "../tsconfig.spec.json",
"files": [
"test.ts"
]
}
-1
View File
@@ -1106,7 +1106,6 @@
},
"categories": {
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"required": [
+2
View File
@@ -52,10 +52,12 @@ import { startupServiceFactory } from './services/startup-service-factory';
import { SortingPickerModule } from './sorting-picker/sorting-picker.module';
import { IconModule } from './icon/icon.module';
import { TranslateLoaderService } from './services/translate-loader.service';
import { ExtensionsModule } from '@alfresco/adf-extensions';
@NgModule({
imports: [
TranslateModule,
ExtensionsModule.forChild(),
AboutModule,
ViewerModule,
SidenavLayoutModule,
@@ -627,14 +627,14 @@ describe('FormComponent', () => {
it('should parse form from json', () => {
let form = formComponent.parseForm({
id: '<id>',
id: 1,
fields: [
{ id: 'field1', type: FormFieldTypes.CONTAINER }
]
});
expect(form).toBeDefined();
expect(form.id).toBe('<id>');
expect(form.id).toBe(1);
expect(form.fields.length).toBe(1);
expect(form.fields[0].id).toBe('field1');
});
@@ -642,7 +642,7 @@ describe('FormComponent', () => {
it('should provide outcomes for form definition', () => {
spyOn(formComponent, 'getFormDefinitionOutcomes').and.callThrough();
let form = formComponent.parseForm({ id: '<id>' });
let form = formComponent.parseForm({ id: 1 });
expect(formComponent.getFormDefinitionOutcomes).toHaveBeenCalledWith(form);
});
+3 -2
View File
@@ -9,7 +9,7 @@
"entryFile": "./public-api.ts",
"flatModuleFile": "adf-core",
"umdModuleIds": {
"@alfresco/js-api": "@alfresco/js-ap",
"@alfresco/js-api": "@alfresco/js-api",
"minimatch": "minimatch-browser",
"@angular/platform-browser/animations": "@angular/platform-browser/animations",
"@angular/material": "@angular/material",
@@ -23,7 +23,8 @@
"moment": "moment",
"moment-es6": "moment-es6",
"moment/src/moment": "moment/src/moment",
"@ngx-translate/core": "@ngx-translate/core"
"@ngx-translate/core": "@ngx-translate/core",
"rxjs": "rxjs"
}
}
}
-46
View File
@@ -1,46 +0,0 @@
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"skipLibCheck": false,
"noLib": false,
"allowUnreachableCode": false,
"allowUnusedLabels": false,
"noImplicitAny": false,
"noImplicitReturns": false,
"noImplicitUseStrict": false,
"noFallthroughCasesInSwitch": true,
"removeComments": true,
"declaration": true,
"outDir": "../dist/core/",
"baseUrl": "./",
"allowSyntheticDefaultImports": true,
"paths": {
"@alfresco/adf-process-services": [
"../process-services"
],
"@alfresco/adf-content-services": [
"../content-services"
]
},
"lib": [
"es2016",
"dom"
],
"suppressImplicitAnyIndexErrors": true,
"noUnusedLocals": true
},
"exclude": [
"demo",
"node_modules",
"dist"
],
"angularCompilerOptions": {
"strictMetadataEmit": false,
"skipTemplateCodegen": true
}
}
+6
View File
@@ -0,0 +1,6 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../dist/core/"
}
}
+6
View File
@@ -0,0 +1,6 @@
{
"extends": "../tsconfig.spec.json",
"files": [
"test.ts"
]
}
@@ -76,7 +76,7 @@
mat-icon-button
title="{{ 'ADF_VIEWER.ACTIONS.DOWNLOAD' | translate }}"
data-automation-id="adf-toolbar-download"
[adfNodeDownload]="node">
[adfNodeDownload]="nodeEntry">
<mat-icon>file_download</mat-icon>
</button>
@@ -169,6 +169,7 @@
<div *ngIf="!isLoading" class="adf-viewer-main" fxFlexOrder="1" fxFlex="1 1 auto">
<div class="adf-viewer-layout-content adf-viewer__fullscreen-container">
<div class="adf-viewer-content-container" [ngSwitch]="viewerType">
<ng-container *ngSwitchCase="'pdf'">
<adf-pdf-viewer [thumbnailsTemplate]="thumbnailsTemplate" [allowThumbnails]="allowThumbnails" [blobFile]="blobFile" [urlFile]="urlFileContent" [nameFile]="displayName"></adf-pdf-viewer>
</ng-container>
@@ -195,8 +196,22 @@
</ng-container>
<ng-container *ngSwitchCase="'custom'">
<ng-container *ngFor="let ext of viewerExtensions">
<adf-preview-extension
*ngIf="extension === ext.fileExtension"
[id]="ext.component"
[node]="nodeEntry.entry"
[url]="urlFileContent"
[extension]="extension"
[attr.data-automation-id]="ext.component">
</adf-preview-extension>
</ng-container>
<span class="adf-viewer-custom-content" *ngFor="let extensionTemplate of extensionTemplates">
<ng-template *ngIf="extensionTemplate.isVisible" [ngTemplateOutlet]="extensionTemplate.template" [ngTemplateOutletContext]="{ urlFileContent: urlFileContent, extension:extension }">
<ng-template *ngIf="extensionTemplate.isVisible"
[ngTemplateOutlet]="extensionTemplate.template"
[ngTemplateOutletContext]="{ urlFileContent: urlFileContent, extension:extension }">
</ng-template>
</span>
</ng-container>
@@ -600,10 +600,10 @@ describe('ViewerComponent', () => {
});
it('should get and assign node for download', (done) => {
const node = { id: 'fake-node' };
component.nodeId = '12';
component.urlFile = '';
const displayName = 'the-name';
const node = new NodeEntry({ entry: { name: displayName, id: '12', content: { mimeType: 'txt' } } });
const nodeDetails = { name: displayName, id: '12', content: { mimeType: 'txt' } };
const contentUrl = '/content/url/path';
const alfrescoApiInstanceMock = {
@@ -618,7 +618,7 @@ describe('ViewerComponent', () => {
component.ngOnChanges(null);
fixture.whenStable().then(() => {
fixture.detectChanges();
expect(component.node).toBe(node);
expect(component.nodeEntry).toBe(node);
done();
});
});
+15 -3
View File
@@ -31,6 +31,7 @@ import { ViewerSidebarComponent } from './viewer-sidebar.component';
import { ViewerToolbarComponent } from './viewer-toolbar.component';
import { Subscription } from 'rxjs';
import { ViewUtilService } from '../services/view-util.service';
import { ExtensionService, ViewerExtensionRef } from '@alfresco/adf-extensions';
@Component({
selector: 'adf-viewer',
@@ -201,7 +202,7 @@ export class ViewerComponent implements OnChanges, OnInit, OnDestroy {
viewerType = 'unknown';
isLoading = false;
node: NodeEntry;
nodeEntry: NodeEntry;
extensionTemplates: { template: TemplateRef<any>, isVisible: boolean }[] = [];
externalExtensions: string[] = [];
@@ -211,6 +212,7 @@ export class ViewerComponent implements OnChanges, OnInit, OnDestroy {
sidebarRightTemplateContext: { node: Node } = { node: null };
sidebarLeftTemplateContext: { node: Node } = { node: null };
fileTitle: string;
viewerExtensions: Array<ViewerExtensionRef> = [];
private cacheBusterNumber;
@@ -220,7 +222,7 @@ export class ViewerComponent implements OnChanges, OnInit, OnDestroy {
private extensions = {
image: ['png', 'jpg', 'jpeg', 'gif', 'bpm', 'svg'],
media: ['wav', 'mp4', 'mp3', 'webm', 'ogg'],
text: ['txt', 'xml', 'js', 'html', 'json', 'ts', 'css', 'md'],
text: ['txt', 'xml', 'html', 'json', 'ts', 'css', 'md'],
pdf: ['pdf']
};
@@ -236,6 +238,7 @@ export class ViewerComponent implements OnChanges, OnInit, OnDestroy {
private viewUtils: ViewUtilService,
private logService: LogService,
private location: Location,
private extensionService: ExtensionService,
private el: ElementRef) {
}
@@ -247,6 +250,15 @@ export class ViewerComponent implements OnChanges, OnInit, OnDestroy {
this.subscriptions.push(
this.apiService.nodeUpdated.subscribe((node) => this.onNodeUpdated(node))
);
this.extensionLoad();
}
private extensionLoad() {
this.viewerExtensions = this.extensionService.getFeature('viewer.content');
this.viewerExtensions.forEach((currentViewerExtension: ViewerExtensionRef) => {
this.externalExtensions.push(currentViewerExtension.fileExtension);
});
}
ngOnDestroy() {
@@ -280,7 +292,7 @@ export class ViewerComponent implements OnChanges, OnInit, OnDestroy {
} else if (this.nodeId) {
this.apiService.nodesApi.getNode(this.nodeId, { include: ['allowableOperations'] }).then(
(node: NodeEntry) => {
this.node = node;
this.nodeEntry = node;
this.setUpNodeFile(node.entry).then(() => {
this.isLoading = false;
});
+3
View File
@@ -21,6 +21,8 @@ import { TranslateModule } from '@ngx-translate/core';
import { FlexLayoutModule } from '@angular/flex-layout';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { ExtensionsModule } from '@alfresco/adf-extensions';
import { MaterialModule } from '../material.module';
import { ToolbarModule } from '../toolbar/toolbar.module';
import { PipeModule } from '../pipes/pipe.module';
@@ -43,6 +45,7 @@ import { DirectiveModule } from '../directives/directive.module';
@NgModule({
imports: [
ExtensionsModule,
CommonModule,
MaterialModule,
TranslateModule.forChild(),
+17 -1
View File
@@ -7,7 +7,23 @@
"entryFile": "src/public-api.ts",
"flatModuleFile": "adf-extensions",
"umdModuleIds": {
"@alfresco/js-api": "@alfresco/js-ap"
"@alfresco/js-api": "@alfresco/js-api",
"minimatch": "minimatch",
"@angular/platform-browser/animations": "@angular/platform-browser/animations",
"@angular/material": "@angular/material",
"@mat-datetimepicker": "@mat-datetimepicker",
"@angular/flex-layout": "@angular/flex-layout",
"@alfresco/adf-core": "@alfresco/adf-core",
"@alfresco/adf-content-services": "@alfresco/adf-content-services",
"@angular/material-moment-adapter": "@angular/material-moment-adapter",
"@angular/animations": "@angular/animations",
"@angular/cdk/platform": "@angular/cdk/platform",
"@angular/material/core": "@angular/material/core",
"moment": "moment",
"moment-es6": "moment-es6",
"moment/src/moment": "moment/src/moment",
"@ngx-translate/core": "@ngx-translate/core",
"rxjs": "rxjs"
}
}
}
+12 -5
View File
@@ -2,7 +2,6 @@
"name": "@alfresco/adf-extensions",
"description": "Provides extensibility support for ADF applications.",
"version": "3.0.0",
"license": "Apache-2.0",
"author": "Alfresco Software, Ltd.",
"main": "bundles/adf-extensions.js",
"repository": {
@@ -13,9 +12,17 @@
"url": "https://github.com/Alfresco/alfresco-ng2-components/issues"
},
"peerDependencies": {
"@angular/common": "^6.0.0",
"@angular/core": "^6.0.0",
"@angular/http": "^6.1.4",
"@angular/common": ">=7.0.3",
"@angular/core": ">=7.0.3",
"@angular/http": ">=7.0.3",
"@alfresco/js-api": "3.0.0"
}
},
"keywords": [
"extensions",
"alfresco-component",
"angular",
"activiti",
"components"
],
"license": "Apache-2.0"
}
@@ -0,0 +1,21 @@
/*!
* @license
* Copyright 2019 Alfresco Software, Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export * from './viewer/preview-extension.component';
export * from './dynamic-column/dynamic-column.component';
export * from './dynamic-component/dynamic.component';
export * from './dynamic-tab/dynamic-tab.component';
@@ -0,0 +1,99 @@
/*!
* @license
* Copyright 2019 Alfresco Software, Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {
Component,
Input,
ComponentRef,
OnInit,
ComponentFactoryResolver,
ViewChild,
ViewContainerRef,
OnDestroy,
OnChanges
} from '@angular/core';
import { ExtensionService } from '../../services/extension.service';
import { Node } from '@alfresco/js-api';
@Component({
selector: 'adf-preview-extension',
template: `
<div #content></div>
`
})
export class PreviewExtensionComponent implements OnInit, OnChanges, OnDestroy {
@ViewChild('content', { read: ViewContainerRef })
content: ViewContainerRef;
@Input()
id: string;
@Input()
url: string;
@Input()
extension: string;
@Input()
node: Node;
private componentRef: ComponentRef<any>;
constructor(
private extensionService: ExtensionService,
private componentFactoryResolver: ComponentFactoryResolver
) {}
ngOnInit() {
if (!this.id) {
return;
}
const componentType = this.extensionService.getComponentById(this.id);
if (componentType) {
const factory = this.componentFactoryResolver.resolveComponentFactory(
componentType
);
if (factory) {
this.content.clear();
this.componentRef = this.content.createComponent(factory, 0);
this.updateInstance();
}
}
}
ngOnChanges() {
this.updateInstance();
}
ngOnDestroy() {
if (this.componentRef) {
this.componentRef.destroy();
this.componentRef = null;
}
}
private updateInstance() {
if (this.componentRef && this.componentRef.instance) {
const instance = this.componentRef.instance;
instance.node = this.node;
instance.url = this.url;
instance.extension = this.extension;
}
}
}
@@ -146,5 +146,5 @@ export function mergeArrays(left: any[], right: any[]): any[] {
}
});
return Object.values(map).concat(result);
return Object.keys(map).map((key) => map[key]).concat(result);
}
@@ -0,0 +1,18 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"id": "https://github.com/Alfresco/alfresco-ng2-components/tree/master/lib/extensions/config/schema/app-extension.schema.json",
"title": "ACA Extension Schema",
"description": "Provides a validation schema for extensions",
"type": "object",
"properties": {
"$references": {
"description": "References to external files",
"type": "array",
"items": {
"type": "string"
},
"minItems": 0,
"uniqueItems": true
}
}
}
@@ -0,0 +1,751 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"id": "https://github.com/Alfresco/alfresco-ng2-components/tree/master/lib/extensions/config/schema/extension.schema.json",
"title": "ACA Extension Schema",
"description": "Provides a validation schema for extensions plugin JSON",
"definitions": {
"ruleRef": {
"type": "object",
"required": ["id", "type"],
"properties": {
"id": {
"description": "Unique rule definition id",
"type": "string"
},
"type": {
"description": "Rule evaluator type",
"type": "string"
},
"parameters": {
"description": "Rule evaluator parameters",
"type": "array",
"items": { "$ref": "#/definitions/ruleParameter" },
"minItems": 1
}
}
},
"ruleParameter": {
"type": "object",
"required": ["type", "value"],
"properties": {
"type": {
"description": "Rule parameter type",
"type": "string"
},
"value": {
"description": "Rule parameter value",
"type": "string"
},
"parameters": {
"description": "Parameters",
"type": "array",
"items": { "$ref": "#/definitions/ruleParameter" },
"minItems": 1
}
}
},
"routeRef": {
"type": "object",
"required": ["id", "path", "component"],
"properties": {
"id": {
"description": "Unique route reference identifier.",
"type": "string"
},
"path": {
"description": "Route path to register.",
"type": "string"
},
"component": {
"description": "Unique identifier for the Component to use with the route.",
"type": "string"
},
"layout": {
"description": "Unique identifier for the custom layout component to use.",
"type": "string"
},
"auth": {
"description": "List of the authentication guards to use with the route.",
"type": "array",
"items": {
"type": "string"
},
"minLength": 1,
"uniqueItems": true
},
"data": {
"description": "Custom data to pass to the activated route so that your components can access it",
"type": "object"
}
}
},
"actionRef": {
"type": "object",
"required": ["id", "type"],
"properties": {
"id": {
"description": "Unique action identifier",
"type": "string"
},
"type": {
"description": "Action type",
"type": "string"
},
"payload": {
"description": "Action payload value (string or expression)",
"type": "string"
}
}
},
"contentActionRef": {
"type": "object",
"required": ["id"],
"properties": {
"id": {
"description": "Unique action identifier.",
"type": "string"
},
"type": {
"description": "Element type",
"type": "string",
"enum": ["default", "button", "separator", "menu", "custom"]
},
"title": {
"description": "Element title",
"type": "string"
},
"description": {
"description": "Element description, used for the tooltips.",
"type": "string"
},
"description-disabled": {
"description": "Description to use when element is in the disabled state.",
"type": "string"
},
"order": {
"description": "Element order",
"type": "number"
},
"icon": {
"description": "Element icon",
"type": "string"
},
"disabled": {
"description": "Toggles disabled state",
"type": "boolean"
},
"component": {
"description": "Custom component id (requires type to be 'custom')",
"type": "string"
},
"children": {
"description": "Child entries for the container types.",
"type": "array",
"items": { "$ref": "#/definitions/contentActionRef" },
"minItems": 1
},
"actions": {
"description": "Element actions",
"type": "object",
"properties": {
"click": {
"description": "Action reference for the click handler",
"type": "string"
}
}
},
"rules": {
"description": "Element rules",
"type": "object",
"properties": {
"enabled": {
"description": "Rule to evaluate the enabled state",
"type": "string"
},
"visible": {
"description": "Rule to evaluate the visibility state",
"type": "string"
}
}
}
}
},
"navBarLinkRef": {
"type": "object",
"required": ["id", "icon", "title"],
"properties": {
"id": {
"description": "Unique identifier",
"type": "string"
},
"icon": {
"description": "Element icon",
"type": "string"
},
"title": {
"description": "Element title",
"type": "string"
},
"route": {
"description": "Route reference identifier",
"type": "string"
},
"description": {
"description": "Element description or tooltip",
"type": "string"
},
"order": {
"description": "Element order",
"type": "number"
},
"children": {
"description": "Navigation children items",
"type": "array",
"items": {
"oneOf": [
{
"type": "object",
"required": [
"id",
"title",
"route"
],
"properties": {
"id": {
"description": "Unique identifier",
"type": "string"
},
"title": {
"description": "Element title",
"type": "string"
},
"route": {
"description": "Route reference identifier",
"type": "string"
}
},
"not": {
"required": ["children"]
}
}
]
},
"minItems": 1
},
"rules": {
"description": "Element rules",
"type": "object",
"properties": {
"visible": {
"description": "Rule to evaluate the visibility state",
"type": "string"
}
}
}
},
"oneOf": [
{
"required": ["route"],
"not": {
"required": ["children"]
}
},
{
"required": ["children"],
"not": {
"required": ["route"]
}
}
]
},
"navBarGroupRef": {
"type": "object",
"required": ["id", "items"],
"properties": {
"id": {
"description": "Unique identifier for the navigation group",
"type": "string"
},
"items": {
"description": "Navigation group items",
"type": "array",
"items": { "$ref": "#/definitions/navBarLinkRef" },
"minItems": 1
},
"order": {
"description": "Group order",
"type": "number"
},
"rules": {
"description": "Element rules",
"type": "object",
"properties": {
"visible": {
"description": "Rule to evaluate the visibility state",
"type": "string"
}
}
}
}
},
"sidebarTabRef": {
"type": "object",
"required": ["id", "component"],
"properties": {
"id": {
"description": "Unique identifier for the navigation group",
"type": "string"
},
"title": {
"description": "Element title",
"type": "string"
},
"component": {
"description": "Component id",
"type": "string"
},
"icon": {
"description": "Material icon name",
"type": "string"
},
"disabled": {
"description": "Toggles disabled state",
"type": "boolean"
},
"order": {
"description": "Element order",
"type": "number"
},
"rules": {
"description": "Element rules",
"type": "object",
"properties": {
"visible": {
"description": "Rule to evaluate the visibility state",
"type": "string"
}
}
}
}
},
"viewerExtensionRef": {
"type": "object",
"required": ["id", "component", "fileExtension"],
"properties": {
"id": {
"description": "Unique identifier for the navigation group",
"type": "string"
},
"component": {
"description": "Component id",
"type": "string"
},
"fileExtension": {
"description": "Target file extension",
"type": "string"
},
"order": {
"description": "Group order",
"type": "number"
},
"disabled": {
"description": "Toggles the disabled state",
"type": "boolean"
}
}
},
"content-metadata-aspect": {
"description": "Content metadata aspect definition",
"type": "object",
"required": ["id"],
"properties": {
"id": {
"type": "string",
"description": "Unique identifier"
}
},
"patternProperties": {
".*": {
"oneOf": [
{
"description": "Wildcard for every property",
"type": "string",
"pattern": "^\\*$"
},
{
"description": "Properties array",
"type": "array",
"items": {
"description": "Property name",
"type": "string"
}
}
]
}
}
},
"content-metadata-layout-group": {
"description": "Content metadata's layout groups definition",
"type": "array",
"items": [
{
"description": "Content metadata's one layout group definition",
"type": "object",
"required": ["id"],
"properties": {
"id": {
"type": "string",
"description": "Unique identifier"
},
"title": {
"type": "string",
"description": "Content metadata's one layout group definition's title"
},
"items": {
"type": "array",
"description": "Content metadata's one layout group definition's items",
"items": {
"oneOf": [
{
"type": "object",
"required": [
"id",
"aspect",
"properties"
],
"properties": {
"id": {
"description": "Unique identifier",
"type": "string"
},
"aspect": {
"description": "Aspect group",
"type": "string"
},
"properties": {
"description": "Wildcard character",
"type": "string",
"pattern": "^\\*$"
}
}
},
{
"type": "object",
"required": [
"id",
"aspect",
"properties"
],
"properties": {
"id": {
"description": "Unique identifier",
"type": "string"
},
"aspect": {
"description": "Aspect group",
"type": "string"
},
"properties": {
"description": "list of aspect properties",
"type": "array"
}
}
},
{
"type": "object",
"required": [
"id",
"type",
"properties"
],
"properties": {
"id": {
"description": "Unique identifier",
"type": "string"
},
"type": {
"description": "Type group",
"type": "string"
},
"properties": {
"description": "Wildcard character",
"type": "string",
"pattern": "^\\*$"
}
}
},
{
"type": "object",
"required": [
"id",
"type",
"properties"
],
"properties": {
"id": {
"description": "Unique identifier",
"type": "string"
},
"type": {
"description": "Type group",
"type": "string"
},
"properties": {
"description": "list of type properties",
"type": "array"
}
}
},
{
"type": "object",
"required": [
"id",
"disabled"
],
"properties": {
"id": {
"description": "Unique identifier",
"type": "string"
},
"disabled": {
"description": "Toggles disabled state",
"type": "boolean"
}
}
}
]
}
}
}
}
]
},
"documentListPresetRef": {
"type": "object",
"required": ["id", "key", "type"],
"properties": {
"id": {
"description": "Unique identifier.",
"type": "string"
},
"key": {
"description": "Property key",
"type": "string"
},
"type": {
"description": "Column type",
"type": "string",
"enum": ["text", "image", "date", "fileSize"]
},
"title": {
"description": "Column title",
"type": "string"
},
"format": {
"description": "Column format",
"type": "string"
},
"class": {
"description": "CSS class name",
"type": "string"
},
"sortable": {
"description": "Toggles sortable state of the column",
"type": "boolean"
},
"template": {
"description": "Column template id",
"type": "string"
},
"desktopOnly": {
"description": "Display column only for large screens",
"type": "boolean"
}
}
}
},
"type": "object",
"required": ["$name", "$version"],
"properties": {
"$name": {
"description": "Extension name",
"type": "string"
},
"$version": {
"description": "Extension version",
"type": "string"
},
"$description": {
"description": "Brief description on what the extension does"
},
"$references": {
"description": "References to external files",
"type": "array",
"items": {
"type": "string"
},
"minItems": 0,
"uniqueItems": true
},
"rules": {
"description": "List of rule definitions",
"type": "array",
"items": { "$ref": "#/definitions/ruleRef" },
"minItems": 1
},
"routes": {
"description": "List of custom application routes",
"type": "array",
"items": { "$ref": "#/definitions/routeRef" },
"minItems": 1
},
"actions": {
"description": "List of action definitions",
"type": "array",
"items": { "$ref": "#/definitions/actionRef" },
"minItems": 1
},
"features": {
"description": "Application-specific features and extensions",
"type": "object",
"properties": {
"header": {
"description": "Application header extensions",
"type": "array",
"items": { "$ref": "#/definitions/contentActionRef" },
"minItems": 1
},
"create": {
"description": "The [New] menu component extensions",
"type": "array",
"items": { "$ref": "#/definitions/contentActionRef" },
"minItems": 1
},
"viewer": {
"description": "Viewer component extensions",
"type": "object",
"properties": {
"openWith": {
"description": "The [Open With] menu extensions",
"type": "array",
"items": { "$ref": "#/definitions/contentActionRef" },
"minItems": 1
},
"toolbarMoreMenu": {
"description": "Toolbar entries from the More actions menu",
"type": "array",
"items": { "$ref": "#/definitions/contentActionRef" },
"minItems": 1
},
"toolbarActions": {
"description": "Toolbar entries from outside the More menu",
"type": "array",
"items": { "$ref": "#/definitions/contentActionRef" },
"minItems": 1
},
"content": {
"description": "Viewer content extensions",
"type": "array",
"items": { "$ref": "#/definitions/viewerExtensionRef" },
"minItems": 1
}
}
},
"navbar": {
"description": "Navigation bar extensions",
"type": "array",
"items": { "$ref": "#/definitions/navBarGroupRef" },
"minItems": 1
},
"sidebar": {
"description": "Sidebar extensions",
"type": "array",
"items": { "$ref": "#/definitions/sidebarTabRef" },
"minItems": 1
},
"toolbar": {
"description": "Toolbar entries",
"type": "array",
"items": { "$ref": "#/definitions/contentActionRef" },
"minItems": 1
},
"contextMenu": {
"description": "Context menu entries",
"type": "array",
"items": { "$ref": "#/definitions/contentActionRef" },
"minItems": 1
},
"content-metadata-presets": {
"description": "Configuration for the presets for content metadata component",
"type": "array",
"items": {
"type": "object",
"required": ["id"],
"properties": {
"id": {
"type": "string",
"description": "Unique identifier"
}
},
"patternProperties": {
".*": {
"oneOf": [
{
"type": "string",
"pattern": "^\\*$",
"description": "Wildcard for every aspect"
},
{ "$ref": "#/definitions/content-metadata-aspect" },
{ "$ref": "#/definitions/content-metadata-layout-group" }
]
}
}
}
},
"documentList": {
"description": "Document list extensions",
"type": "object",
"properties": {
"files": {
"description": "Files document list preset",
"type": "array",
"items": { "$ref": "#/definitions/documentListPresetRef" },
"minItems": 1
},
"libraries": {
"description": "Libraries document list preset",
"type": "array",
"items": { "$ref": "#/definitions/documentListPresetRef" },
"minItems": 1
},
"shared": {
"description": "Shared Files document list preset",
"type": "array",
"items": { "$ref": "#/definitions/documentListPresetRef" },
"minItems": 1
},
"recent": {
"description": "Recent Files document list preset",
"type": "array",
"items": { "$ref": "#/definitions/documentListPresetRef" },
"minItems": 1
},
"favorites": {
"description": "Favorites document list preset",
"type": "array",
"items": { "$ref": "#/definitions/documentListPresetRef" },
"minItems": 1
},
"trashcan": {
"description": "Trashcan document list preset",
"type": "array",
"items": { "$ref": "#/definitions/documentListPresetRef" },
"minItems": 1
}
}
}
}
}
}
}
+29 -4
View File
@@ -15,21 +15,46 @@
* limitations under the License.
*/
import { NgModule } from '@angular/core';
import { DynamicExtensionComponent } from './components/dynamic-component/dynamic.component';
import { DynamicTabComponent } from './components/dynamic-tab/dynamic-tab.component';
import { DynamicColumnComponent } from './components/dynamic-column/dynamic-column.component';
import { PreviewExtensionComponent } from './components/viewer/preview-extension.component';
import { NgModule, ModuleWithProviders, APP_INITIALIZER } from '@angular/core';
import { AppExtensionService } from './services/app-extension.service';
import { setupExtensions } from './services/startup-extension-factory';
@NgModule({
declarations: [
DynamicExtensionComponent,
DynamicTabComponent,
DynamicColumnComponent
DynamicColumnComponent,
PreviewExtensionComponent
],
exports: [
DynamicExtensionComponent,
DynamicTabComponent,
DynamicColumnComponent
DynamicColumnComponent,
PreviewExtensionComponent
]
})
export class ExtensionsModule {}
export class ExtensionsModule {
static forRoot(): ModuleWithProviders {
return {
ngModule: ExtensionsModule,
providers: [
{
provide: APP_INITIALIZER,
useFactory: setupExtensions,
deps: [AppExtensionService],
multi: true
}
]
};
}
static forChild(): ModuleWithProviders {
return {
ngModule: ExtensionsModule
};
}
}
@@ -0,0 +1,50 @@
/*!
* @license
* Copyright 2019 Alfresco Software, Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { Injectable } from '@angular/core';
import { ExtensionConfig, ExtensionRef } from '../config/extension.config';
import { ExtensionService } from '../services/extension.service';
import { Observable, BehaviorSubject } from 'rxjs';
@Injectable({
providedIn: 'root'
})
export class AppExtensionService {
private _references = new BehaviorSubject<ExtensionRef[]>([]);
references$: Observable<ExtensionRef[]>;
constructor(protected extensionService: ExtensionService) {
this.references$ = this._references.asObservable();
}
async load() {
const config = await this.extensionService.load();
this.setup(config);
}
setup(config: ExtensionConfig) {
if (!config) {
return;
}
const references = (config.$references || [])
.filter((entry) => typeof entry === 'object')
.map((entry) => <ExtensionRef> entry);
this._references.next(references);
}
}
@@ -34,38 +34,40 @@ export class ExtensionLoaderService {
load(configPath: string, pluginsPath: string): Promise<ExtensionConfig> {
return new Promise<any>((resolve) => {
this.loadConfig(configPath, 0).then((result) => {
let config = result.config;
if (result) {
let config = result.config;
const override = sessionStorage.getItem('app.extension.config');
if (override) {
config = JSON.parse(override);
}
const override = sessionStorage.getItem('app.extension.config');
if (override) {
config = JSON.parse(override);
}
if (config.$references && config.$references.length > 0) {
const plugins = config.$references.map((name, idx) =>
this.loadConfig(`${pluginsPath}/${name}`, idx)
);
if (config.$references && config.$references.length > 0) {
const plugins = config.$references.map((name, idx) =>
this.loadConfig(`${pluginsPath}/${name}`, idx)
);
Promise.all(plugins).then((results) => {
const configs = results
.filter((entry) => entry)
.sort(sortByOrder)
.map((entry) => entry.config);
Promise.all(plugins).then((results) => {
const configs = results
.filter((entry) => entry)
.sort(sortByOrder)
.map((entry) => entry.config);
if (configs.length > 0) {
config = mergeObjects(config, ...configs);
}
if (configs.length > 0) {
config = mergeObjects(config, ...configs);
}
config = {
...config,
...this.getMetadata(result.config),
$references: configs.map((ext) => this.getMetadata(ext))
};
config = {
...config,
...this.getMetadata(result.config),
$references: configs.map((ext) => this.getMetadata(ext))
};
resolve(config);
});
} else {
resolve(config);
});
} else {
resolve(config);
}
}
});
});
@@ -140,6 +142,13 @@ export class ExtensionLoaderService {
return [];
}
getFeatures(config: ExtensionConfig): any {
if (config) {
return config.features || [];
}
return [];
}
protected setActionDefaults(action: ContentActionRef): ContentActionRef {
if (action) {
action.type = action.type || ContentActionType.default;
@@ -34,6 +34,7 @@ export class ExtensionService {
rules: Array<RuleRef> = [];
routes: Array<RouteRef> = [];
actions: Array<ActionRef> = [];
features: Array<any> = [];
authGuards: { [key: string]: Type<{}> } = {};
evaluators: { [key: string]: RuleEvaluator } = {};
@@ -41,7 +42,8 @@ export class ExtensionService {
constructor(
private loader: ExtensionLoaderService,
private componentRegister: ComponentRegisterService
) {}
) {
}
/**
* Loads and registers an extension config file and plugins (specified by path properties).
@@ -75,6 +77,12 @@ export class ExtensionService {
this.rules = this.loader.getRules(config);
this.actions = this.loader.getActions(config);
this.routes = this.loader.getRoutes(config);
this.features = this.loader.getFeatures(config);
}
getFeature(key: string): any[] {
let properties: string[] = Array.isArray(key) ? [key] : key.split('.');
return properties.reduce((prev, curr) => prev && prev[curr], this.features) || [];
}
/**
@@ -0,0 +1,22 @@
/*!
* @license
* Copyright 2019 Alfresco Software, Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { AppExtensionService } from './app-extension.service';
export function setupExtensions(appExtensionService: AppExtensionService): Function {
return () => appExtensionService.load();
}
+4 -1
View File
@@ -15,6 +15,8 @@
* limitations under the License.
*/
export * from './lib/extensions.module';
export * from './lib/config/action.extensions';
export * from './lib/config/extension-element';
export * from './lib/config/extension-utils';
@@ -29,10 +31,11 @@ export * from './lib/config/viewer.extensions';
export * from './lib/services/extension-loader.service';
export * from './lib/services/extension.service';
export * from './lib/services/component-register.service';
export * from './lib/services/app-extension.service';
export * from './lib/store/states/navigation.state';
export * from './lib/store/states/profile.state';
export * from './lib/store/states/selection.state';
export * from './lib/store/states/repository.state';
export * from './lib/extensions.module';
export * from './lib/components/public-api';
+4 -31
View File
@@ -1,34 +1,7 @@
{
"extends": "../../tsconfig.json",
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../../out-tsc/lib",
"target": "es2015",
"module": "es2015",
"moduleResolution": "node",
"declaration": true,
"sourceMap": true,
"inlineSources": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"importHelpers": true,
"types": [],
"lib": [
"dom",
"es2015"
]
},
"angularCompilerOptions": {
"annotateForClosureCompiler": true,
"skipTemplateCodegen": true,
"strictMetadataEmit": true,
"fullTemplateTypeCheck": true,
"strictInjectionParameters": true,
"flatModuleId": "AUTOGENERATED",
"flatModuleOutFile": "AUTOGENERATED",
"enableResourceInlining": true
},
"exclude": [
"src/test.ts",
"**/*.spec.ts"
]
"outDir": "../dist/extensions/",
"baseUrl": "src"
}
}
+1 -12
View File
@@ -1,17 +1,6 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "../../out-tsc/spec",
"types": [
"jasmine",
"node"
]
},
"extends": "../tsconfig.spec.json",
"files": [
"src/test.ts"
],
"include": [
"**/*.spec.ts",
"**/*.d.ts"
]
}
-17
View File
@@ -1,17 +0,0 @@
{
"extends": "../../tslint.json",
"rules": {
"directive-selector": [
true,
"attribute",
"adf",
"camelCase"
],
"component-selector": [
true,
"element",
"adf",
"kebab-case"
]
}
}
+1 -1
View File
@@ -9,7 +9,7 @@
"entryFile": "./public-api.ts",
"flatModuleFile": "adf-insights",
"umdModuleIds": {
"@alfresco/js-api": "@alfresco/js-ap",
"@alfresco/js-api": "@alfresco/js-api",
"minimatch": "minimatch",
"@angular/platform-browser/animations": "@angular/platform-browser/animations",
"@angular/material": "@angular/material",
-42
View File
@@ -1,42 +0,0 @@
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"skipLibCheck": false,
"noLib": false,
"allowUnreachableCode": false,
"allowUnusedLabels": false,
"noImplicitAny": false,
"noImplicitReturns": false,
"noImplicitUseStrict": false,
"noFallthroughCasesInSwitch": true,
"removeComments": true,
"declaration": true,
"outDir": "../dist/insights/",
"baseUrl" : "./",
"paths": {
"@alfresco/adf-process-services": ["../process-services"],
"@alfresco/adf-content-services": ["../content-services"],
"@alfresco/adf-core": ["../core"]
},
"lib": [
"es2016",
"dom"
],
"suppressImplicitAnyIndexErrors": true,
"noUnusedLocals": true
},
"exclude": [
"demo",
"node_modules",
"dist"
],
"angularCompilerOptions": {
"strictMetadataEmit": false,
"skipTemplateCodegen": true
}
}
+6
View File
@@ -0,0 +1,6 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../dist/insights/"
}
}
+6
View File
@@ -0,0 +1,6 @@
{
"extends": "../tsconfig.spec.json",
"files": [
"test.ts"
]
}
+17 -1
View File
@@ -6,7 +6,23 @@
"entryFile": "src/public-api.ts",
"flatModuleFile": "adf-process-services-cloud",
"umdModuleIds": {
"@alfresco/js-api": "@alfresco/js-ap"
"@alfresco/js-api": "@alfresco/js-api",
"minimatch": "minimatch",
"@angular/platform-browser/animations": "@angular/platform-browser/animations",
"@angular/material": "@angular/material",
"@mat-datetimepicker": "@mat-datetimepicker",
"@angular/flex-layout": "@angular/flex-layout",
"@alfresco/adf-core": "@alfresco/adf-core",
"@alfresco/adf-content-services": "@alfresco/adf-content-services",
"@angular/material-moment-adapter": "@angular/material-moment-adapter",
"@angular/animations": "@angular/animations",
"@angular/cdk/platform": "@angular/cdk/platform",
"@angular/material/core": "@angular/material/core",
"moment": "moment",
"moment-es6": "moment-es6",
"moment/src/moment": "moment/src/moment",
"@ngx-translate/core": "@ngx-translate/core",
"rxjs": "rxjs"
}
}
}
@@ -30,7 +30,7 @@ import { TemplateModule, CoreModule } from '@alfresco/adf-core';
TemplateModule,
MaterialModule,
FlexLayoutModule,
CoreModule.forChild()
CoreModule
],
declarations: [
AppListCloudComponent,
@@ -35,7 +35,7 @@ import { InitialGroupNamePipe } from './pipe/group-initial.pipe';
FormsModule,
ReactiveFormsModule,
FormModule,
CoreModule.forChild()
CoreModule
],
declarations: [GroupCloudComponent, InitialGroupNamePipe],
exports: [GroupCloudComponent, InitialGroupNamePipe]
@@ -24,7 +24,7 @@ import { GroupCloudModule } from './group/group-cloud.module';
@NgModule({
imports: [
CoreModule.forChild(),
CoreModule,
AppListCloudModule,
ProcessCloudModule,
TaskCloudModule,
@@ -26,7 +26,7 @@ import { CoreModule } from '@alfresco/adf-core';
ProcessFiltersCloudModule,
ProcessListCloudModule,
StartProcessCloudModule,
CoreModule.forChild()
CoreModule
],
exports: [
ProcessFiltersCloudModule,
@@ -36,7 +36,7 @@ import { AppListCloudModule } from './../../app/app-list-cloud.module';
FlexLayoutModule,
MaterialModule,
AppListCloudModule,
CoreModule.forChild()
CoreModule
],
declarations: [ProcessFiltersCloudComponent, EditProcessFilterCloudComponent, ProcessFilterDialogCloudComponent],
@@ -28,7 +28,7 @@ import { ProcessListCloudService } from './services/process-list-cloud.service';
MaterialModule,
DataTableModule,
TemplateModule,
CoreModule.forChild()
CoreModule
],
declarations: [ProcessListCloudComponent],
@@ -30,7 +30,7 @@ import { CoreModule } from '@alfresco/adf-core';
MaterialModule,
FlexLayoutModule,
ReactiveFormsModule,
CoreModule.forChild()
CoreModule
],
declarations: [
StartProcessCloudComponent
@@ -38,7 +38,7 @@ import { GroupCloudModule } from '../../group/group-cloud.module';
GroupCloudModule,
FormModule,
GroupCloudModule,
CoreModule.forChild()
CoreModule
],
declarations: [StartTaskCloudComponent, PeopleCloudComponent],
providers: [
@@ -37,7 +37,7 @@ import { AppListCloudModule } from './../../app/app-list-cloud.module';
FlexLayoutModule,
MaterialModule,
AppListCloudModule,
CoreModule.forChild()
CoreModule
],
declarations: [TaskFiltersCloudComponent, EditTaskFilterCloudComponent, TaskFilterDialogCloudComponent],
exports: [TaskFiltersCloudComponent, EditTaskFilterCloudComponent],
@@ -29,7 +29,7 @@ import { TaskHeaderCloudService } from './services/task-header-cloud.service';
DataTableModule,
TemplateModule,
CardViewModule,
CoreModule.forChild()
CoreModule
],
declarations: [
TaskHeaderCloudComponent
@@ -28,7 +28,7 @@ import { TaskListCloudService } from './services/task-list-cloud.service';
MaterialModule,
DataTableModule,
TemplateModule,
CoreModule.forChild()
CoreModule
],
declarations: [TaskListCloudComponent],
exports: [TaskListCloudComponent],
@@ -16,6 +16,7 @@
*/
export * from './lib/process-services-cloud.module';
export * from './lib/app/public-api';
export * from './lib/process/public-api';
export * from './lib/task/public-api';
+4 -29
View File
@@ -1,32 +1,7 @@
{
"extends": "../../tsconfig.json",
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../../out-tsc/lib",
"target": "es2015",
"module": "es2015",
"moduleResolution": "node",
"declaration": true,
"sourceMap": true,
"inlineSources": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"importHelpers": true,
"types": [],
"lib": [
"dom",
"es2015"
]
},
"angularCompilerOptions": {
"annotateForClosureCompiler": true,
"skipTemplateCodegen": true,
"strictMetadataEmit": true,
"fullTemplateTypeCheck": true,
"strictInjectionParameters": true,
"enableResourceInlining": true
},
"exclude": [
"src/test.ts",
"**/*.spec.ts"
]
"outDir": "../dist/process-services-cloud/",
"baseUrl": "src"
}
}
+1 -12
View File
@@ -1,17 +1,6 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../out-tsc/spec",
"types": [
"jasmine",
"node"
]
},
"extends": "../tsconfig.spec.json",
"files": [
"src/test.ts"
],
"include": [
"**/*.spec.ts",
"**/*.d.ts"
]
}
+1 -1
View File
@@ -1,5 +1,5 @@
{
"extends": "../../tslint.json",
"extends": "../tslint.json",
"rules": {
"directive-selector": [
true,
+1 -1
View File
@@ -9,7 +9,7 @@
"entryFile": "./public-api.ts",
"flatModuleFile": "adf-process-services",
"umdModuleIds": {
"@alfresco/js-api": "@alfresco/js-ap",
"@alfresco/js-api": "@alfresco/js-api",
"minimatch": "minimatch",
"@angular/platform-browser/animations": "@angular/platform-browser/animations",
"@angular/material": "@angular/material",
@@ -29,7 +29,7 @@ import { fakeProcessInstance, fakeProcessInstancesWithNoName, fakeProcessInstanc
import { ProcessService } from '../services/process.service';
import { ProcessTestingModule } from '../../testing/process.testing.module';
import { fakeProcessCustomSchema } from '../../mock';
import { ProcessListModule } from 'process-list/process-list.module';
import { ProcessListModule } from '../process-list.module';
describe('ProcessInstanceListComponent', () => {
@@ -26,7 +26,7 @@ import { ProcessTestingModule } from '../../testing/process.testing.module';
import { fakeGlobalTask, fakeCustomSchema, fakeEmptyTask } from '../../mock';
import { TranslateService } from '@ngx-translate/core';
import { of } from 'rxjs';
import { TaskListModule } from 'task-list/task-list.module';
import { TaskListModule } from '../task-list.module';
declare let jasmine: any;
-42
View File
@@ -1,42 +0,0 @@
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"skipLibCheck": false,
"noLib": false,
"allowUnreachableCode": false,
"allowUnusedLabels": false,
"noImplicitAny": false,
"noImplicitReturns": false,
"noImplicitUseStrict": false,
"noFallthroughCasesInSwitch": true,
"removeComments": true,
"declaration": true,
"outDir": "../dist/process-services/",
"baseUrl" : "./",
"paths": {
"@alfresco/adf-content-services": ["../content-services"],
"@alfresco/adf-insights": ["../analytics"],
"@alfresco/adf-core": ["../core"]
},
"lib": [
"es2016",
"dom"
],
"suppressImplicitAnyIndexErrors": true,
"noUnusedLocals": true
},
"exclude": [
"demo",
"node_modules",
"dist"
],
"angularCompilerOptions": {
"strictMetadataEmit": false,
"skipTemplateCodegen": true
}
}
+6
View File
@@ -0,0 +1,6 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../dist/process-services/"
}
}
+6
View File
@@ -0,0 +1,6 @@
{
"extends": "../tsconfig.spec.json",
"files": [
"test.ts"
]
}
+3 -29
View File
@@ -1,32 +1,6 @@
{
"extends": "../../tsconfig.json",
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../../out-tsc/lib",
"target": "es2015",
"module": "es2015",
"moduleResolution": "node",
"declaration": true,
"sourceMap": true,
"inlineSources": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"importHelpers": true,
"types": [],
"lib": [
"dom",
"es2018"
]
},
"angularCompilerOptions": {
"annotateForClosureCompiler": true,
"skipTemplateCodegen": true,
"strictMetadataEmit": true,
"fullTemplateTypeCheck": true,
"strictInjectionParameters": true,
"enableResourceInlining": true
},
"exclude": [
"src/test.ts",
"**/*.spec.ts"
]
"outDir": "../dist/testing/"
}
}
+1 -12
View File
@@ -1,17 +1,6 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "../../out-tsc/spec",
"types": [
"jasmine",
"node"
]
},
"extends": "../tsconfig.spec.json",
"files": [
"src/test.ts"
],
"include": [
"**/*.spec.ts",
"**/*.d.ts"
]
}
+15
View File
@@ -0,0 +1,15 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../out-tsc/spec",
"types": [
"jasmine",
"node"
]
},
"include": [
"**/*.spec.ts",
"**/*.d.ts",
"**/test.ts"
]
}