mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-06-30 18:15:11 +00:00
[ACA-4382 ] About Page refactoring to use it across all the platform (#7365)
* about page refactor for global usage * Development About * add storybook * fix build * fix * fix * fix imports * fix * fix lint * fix * fix * fix * fix
This commit is contained in:
parent
dcb966f391
commit
c8688bf0bf
@ -1,5 +1,8 @@
|
|||||||
{
|
{
|
||||||
"APP": {
|
"APP": {
|
||||||
|
"ABOUT": {
|
||||||
|
"DEVELOPMENT":"Dev Mode"
|
||||||
|
},
|
||||||
"INFO_DRAWER": {
|
"INFO_DRAWER": {
|
||||||
"TITLE": "Details",
|
"TITLE": "Details",
|
||||||
"COMMENTS": "Comments",
|
"COMMENTS": "Comments",
|
||||||
|
@ -1,11 +1,4 @@
|
|||||||
<adf-about-github-link [application]="application" [url]="url" [version]="version"></adf-about-github-link>
|
<mat-slide-toggle [(ngModel)]="dev">{{'APP.ABOUT.DEVELOPMENT' | translate }}</mat-slide-toggle>
|
||||||
|
|
||||||
<adf-about-server-settings></adf-about-server-settings>
|
<adf-about [dev]="dev" [pkg]="pkg"> </adf-about>
|
||||||
|
|
||||||
<adf-about-product-version> </adf-about-product-version>
|
|
||||||
|
|
||||||
<adf-about-application-modules
|
|
||||||
[dependencies]="dependencies"
|
|
||||||
[showExtensions]="showExtensions"
|
|
||||||
>
|
|
||||||
</adf-about-application-modules>
|
|
||||||
|
@ -15,27 +15,20 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { Component, OnInit } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
import pkg from '../../../../../package.json';
|
import pkg from '../../../../../package.json';
|
||||||
import { AppConfigService } from '@alfresco/adf-core';
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-about-page',
|
selector: 'app-about-page',
|
||||||
templateUrl: './about.component.html',
|
templateUrl: './about.component.html',
|
||||||
styleUrls: ['./about.component.scss']
|
styleUrls: ['./about.component.scss']
|
||||||
})
|
})
|
||||||
export class AboutComponent implements OnInit {
|
export class AboutComponent {
|
||||||
url = `https://github.com/Alfresco/${pkg.name}/commits/${pkg.commit}`;
|
pkg: any;
|
||||||
version = pkg.version;
|
dev: true;
|
||||||
dependencies = pkg.dependencies;
|
|
||||||
showExtensions = true;
|
|
||||||
application = '';
|
|
||||||
|
|
||||||
constructor(private appConfigService: AppConfigService) {}
|
constructor() {
|
||||||
|
this.pkg = pkg;
|
||||||
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
|
||||||
this.application = this.appConfigService.get<string>(
|
|
||||||
'application.name'
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -1,62 +0,0 @@
|
|||||||
<div class="adf-about-modules-container">
|
|
||||||
<h3 data-automation-id="adf-about-modules-title">{{ 'ABOUT.PACKAGES.TITLE' | translate }}</h3>
|
|
||||||
<small>{{ 'ABOUT.PACKAGES.DESCRIPTION' | translate }}</small>
|
|
||||||
<adf-datatable [data]="dependencyEntries"></adf-datatable>
|
|
||||||
|
|
||||||
<div class="adf-extension-details-container" *ngIf="showExtensions && extensions.length">
|
|
||||||
<h3>{{ 'ABOUT.EXTENSIONS.TITLE' | translate }}</h3>
|
|
||||||
<mat-table [dataSource]="extensions">
|
|
||||||
<!-- $id Column -->
|
|
||||||
<ng-container matColumnDef="$id">
|
|
||||||
<mat-header-cell
|
|
||||||
*matHeaderCellDef>{{ 'ABOUT.EXTENSIONS.TABLE_HEADERS.ID' | translate }}</mat-header-cell>
|
|
||||||
<mat-cell *matCellDef="let element">{{element.$id}}</mat-cell>
|
|
||||||
</ng-container>
|
|
||||||
|
|
||||||
<!-- $name Column -->
|
|
||||||
<ng-container matColumnDef="$name">
|
|
||||||
<mat-header-cell
|
|
||||||
*matHeaderCellDef>{{ 'ABOUT.EXTENSIONS.TABLE_HEADERS.NAME' | translate }}</mat-header-cell>
|
|
||||||
<mat-cell *matCellDef="let element">{{element.$name}}</mat-cell>
|
|
||||||
</ng-container>
|
|
||||||
|
|
||||||
<!-- $version Column -->
|
|
||||||
<ng-container matColumnDef="$version">
|
|
||||||
<mat-header-cell
|
|
||||||
*matHeaderCellDef>{{ 'ABOUT.EXTENSIONS.TABLE_HEADERS.VERSION' | translate }}</mat-header-cell>
|
|
||||||
<mat-cell *matCellDef="let element">{{element.$version}}</mat-cell>
|
|
||||||
</ng-container>
|
|
||||||
|
|
||||||
<!-- $vendor Column -->
|
|
||||||
<ng-container matColumnDef="$vendor">
|
|
||||||
<mat-header-cell
|
|
||||||
*matHeaderCellDef>{{ 'ABOUT.EXTENSIONS.TABLE_HEADERS.VENDOR' | translate }}</mat-header-cell>
|
|
||||||
<mat-cell *matCellDef="let element">{{element.$vendor}}</mat-cell>
|
|
||||||
</ng-container>
|
|
||||||
|
|
||||||
<!-- $license Column -->
|
|
||||||
<ng-container matColumnDef="$license">
|
|
||||||
<mat-header-cell
|
|
||||||
*matHeaderCellDef>{{ 'ABOUT.EXTENSIONS.TABLE_HEADERS.LICENSE' | translate }}</mat-header-cell>
|
|
||||||
<mat-cell *matCellDef="let element">{{element.$license}}</mat-cell>
|
|
||||||
</ng-container>
|
|
||||||
|
|
||||||
<!-- $runtime Column -->
|
|
||||||
<ng-container matColumnDef="$runtime">
|
|
||||||
<mat-header-cell
|
|
||||||
*matHeaderCellDef>{{ 'ABOUT.EXTENSIONS.TABLE_HEADERS.RUNTIME' | translate }}</mat-header-cell>
|
|
||||||
<mat-cell *matCellDef="let element">{{element.$runtime}}</mat-cell>
|
|
||||||
</ng-container>
|
|
||||||
|
|
||||||
<!-- $description Column -->
|
|
||||||
<ng-container matColumnDef="$description">
|
|
||||||
<mat-header-cell
|
|
||||||
*matHeaderCellDef>{{ 'ABOUT.EXTENSIONS.TABLE_HEADERS.DESCRIPTION' | translate }}</mat-header-cell>
|
|
||||||
<mat-cell *matCellDef="let element">{{element.$description}}</mat-cell>
|
|
||||||
</ng-container>
|
|
||||||
|
|
||||||
<mat-header-row *matHeaderRowDef="extensionColumns"></mat-header-row>
|
|
||||||
<mat-row *matRowDef="let row; columns: extensionColumns;"></mat-row>
|
|
||||||
</mat-table>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
@ -1,3 +0,0 @@
|
|||||||
.adf-about-modules-container {
|
|
||||||
padding: 10px;
|
|
||||||
}
|
|
@ -1,107 +0,0 @@
|
|||||||
/*!
|
|
||||||
* @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 { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
||||||
import { CoreTestingModule } from '../../testing/core.testing.module';
|
|
||||||
import { setupTestBed } from '../../testing/setup-test-bed';
|
|
||||||
import { AboutApplicationModulesComponent } from './about-application-modules.component';
|
|
||||||
import { mockDependencies, mockPlugins } from '../about.mock';
|
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
|
||||||
|
|
||||||
describe('AboutApplicationModulesComponent', () => {
|
|
||||||
let fixture: ComponentFixture<AboutApplicationModulesComponent>;
|
|
||||||
let component: AboutApplicationModulesComponent;
|
|
||||||
|
|
||||||
setupTestBed({
|
|
||||||
imports: [
|
|
||||||
TranslateModule.forRoot(),
|
|
||||||
CoreTestingModule
|
|
||||||
]
|
|
||||||
});
|
|
||||||
|
|
||||||
beforeEach(() => {
|
|
||||||
fixture = TestBed.createComponent(AboutApplicationModulesComponent);
|
|
||||||
component = fixture.componentInstance;
|
|
||||||
component.dependencies = mockDependencies;
|
|
||||||
fixture.detectChanges();
|
|
||||||
});
|
|
||||||
|
|
||||||
afterEach(() => {
|
|
||||||
fixture.destroy();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('Should display title', () => {
|
|
||||||
const titleElement = fixture.nativeElement.querySelector('[data-automation-id="adf-about-modules-title"]');
|
|
||||||
expect(titleElement.innerText).toEqual('ABOUT.PACKAGES.TITLE');
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should display dependencies', async() => {
|
|
||||||
fixture.detectChanges();
|
|
||||||
await fixture.whenStable();
|
|
||||||
const dataTable = fixture.nativeElement.querySelector('.adf-datatable');
|
|
||||||
|
|
||||||
const depOne = fixture.nativeElement.querySelector('[data-automation-id="text_@alfresco/mock-core"]');
|
|
||||||
const depTwo = fixture.nativeElement.querySelector('[data-automation-id="text_@alfresco/mock-services"]');
|
|
||||||
const depVersionOne = fixture.nativeElement.querySelector('[data-automation-id="text_3.7.0"]');
|
|
||||||
const depVersionTwo = fixture.nativeElement.querySelector('[data-automation-id="text_2.0.0"]');
|
|
||||||
|
|
||||||
expect(dataTable).not.toBeNull();
|
|
||||||
|
|
||||||
expect(depOne.innerText).toEqual('@alfresco/mock-core');
|
|
||||||
expect(depTwo.innerText).toEqual('@alfresco/mock-services');
|
|
||||||
|
|
||||||
expect(depVersionOne.innerText).toEqual('3.7.0');
|
|
||||||
expect(depVersionTwo.innerText).toEqual('2.0.0');
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should display extensions', async() => {
|
|
||||||
component.extensions = mockPlugins;
|
|
||||||
fixture.detectChanges();
|
|
||||||
await fixture.whenStable();
|
|
||||||
const dataTable = fixture.nativeElement.querySelector('.mat-table');
|
|
||||||
const nameColumn = fixture.nativeElement.querySelector('.mat-column--name');
|
|
||||||
const versionColumn = fixture.nativeElement.querySelector('.mat-column--version');
|
|
||||||
const licenseColumn = fixture.nativeElement.querySelector('.mat-column--license');
|
|
||||||
const nameRows = fixture.nativeElement.querySelector('.mat-row .mat-column--name');
|
|
||||||
const versionRows = fixture.nativeElement.querySelector('.mat-row .mat-column--version');
|
|
||||||
const licenseRows = fixture.nativeElement.querySelector('.mat-row .mat-column--license');
|
|
||||||
|
|
||||||
expect(dataTable).not.toBeNull();
|
|
||||||
|
|
||||||
expect(versionColumn.innerText).toEqual('ABOUT.EXTENSIONS.TABLE_HEADERS.VERSION');
|
|
||||||
expect(nameColumn.innerText).toEqual('ABOUT.EXTENSIONS.TABLE_HEADERS.NAME');
|
|
||||||
expect(licenseColumn.innerText).toEqual('ABOUT.EXTENSIONS.TABLE_HEADERS.LICENSE');
|
|
||||||
|
|
||||||
expect(nameRows.innerText).toEqual('plugin1');
|
|
||||||
expect(versionRows.innerText).toEqual('1.0.0');
|
|
||||||
expect(licenseRows.innerText).toEqual('MockLicense-2.0');
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should not display extensions if showExtensions set to false ', async() => {
|
|
||||||
component.extensions = mockPlugins;
|
|
||||||
component.showExtensions = false;
|
|
||||||
fixture.detectChanges();
|
|
||||||
await fixture.whenStable();
|
|
||||||
const dataTable = fixture.nativeElement.querySelector('.mat-table');
|
|
||||||
const nameColumn = fixture.nativeElement.querySelector('.mat-column--name');
|
|
||||||
const nameRows = fixture.nativeElement.querySelector('.mat-row .mat-column--name');
|
|
||||||
|
|
||||||
expect(dataTable).toBeNull();
|
|
||||||
expect(nameColumn).toBeNull();
|
|
||||||
expect(nameRows).toBeNull();
|
|
||||||
});
|
|
||||||
});
|
|
@ -1,78 +0,0 @@
|
|||||||
/*!
|
|
||||||
* @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, OnDestroy, OnInit, ViewEncapsulation } from '@angular/core';
|
|
||||||
import { ObjectDataTableAdapter } from '../../datatable/data/object-datatable-adapter';
|
|
||||||
import { AppExtensionService, ExtensionRef } from '@alfresco/adf-extensions';
|
|
||||||
import { Subject } from 'rxjs';
|
|
||||||
import { takeUntil } from 'rxjs/operators';
|
|
||||||
|
|
||||||
@Component({
|
|
||||||
selector: 'adf-about-application-modules',
|
|
||||||
templateUrl: './about-application-modules.component.html',
|
|
||||||
encapsulation: ViewEncapsulation.None
|
|
||||||
})
|
|
||||||
export class AboutApplicationModulesComponent implements OnInit, OnDestroy {
|
|
||||||
|
|
||||||
extensionColumns: string[] = ['$id', '$name', '$version', '$vendor', '$license', '$runtime', '$description'];
|
|
||||||
|
|
||||||
dependencyEntries: ObjectDataTableAdapter;
|
|
||||||
extensions: ExtensionRef[];
|
|
||||||
|
|
||||||
/** Toggles showing/hiding of extensions block. */
|
|
||||||
@Input()
|
|
||||||
showExtensions = true;
|
|
||||||
|
|
||||||
/** Regular expression for filtering dependencies packages. */
|
|
||||||
@Input() regexp = '^(@alfresco)';
|
|
||||||
|
|
||||||
/** Current version of the app running */
|
|
||||||
@Input() dependencies: any;
|
|
||||||
|
|
||||||
private onDestroy$ = new Subject<boolean>();
|
|
||||||
|
|
||||||
constructor(private appExtensions: AppExtensionService) {
|
|
||||||
}
|
|
||||||
|
|
||||||
ngOnInit() {
|
|
||||||
const alfrescoPackages = Object.keys(this.dependencies).filter((val) => {
|
|
||||||
return new RegExp(this.regexp).test(val);
|
|
||||||
});
|
|
||||||
|
|
||||||
const alfrescoPackagesTableRepresentation = [];
|
|
||||||
alfrescoPackages.forEach((val) => {
|
|
||||||
alfrescoPackagesTableRepresentation.push({
|
|
||||||
name: val,
|
|
||||||
version: (this.dependencies[val])
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
this.dependencyEntries = new ObjectDataTableAdapter(alfrescoPackagesTableRepresentation, [
|
|
||||||
{ type: 'text', key: 'name', title: 'Name', sortable: true },
|
|
||||||
{ type: 'text', key: 'version', title: 'Version', sortable: true }
|
|
||||||
]);
|
|
||||||
|
|
||||||
this.appExtensions.references$
|
|
||||||
.pipe(takeUntil(this.onDestroy$))
|
|
||||||
.subscribe((extensions) => this.extensions = extensions);
|
|
||||||
}
|
|
||||||
|
|
||||||
ngOnDestroy() {
|
|
||||||
this.onDestroy$.next(true);
|
|
||||||
this.onDestroy$.complete();
|
|
||||||
}
|
|
||||||
}
|
|
@ -0,0 +1,11 @@
|
|||||||
|
<mat-table [dataSource]="data">
|
||||||
|
<ng-container *ngFor="let column of columns" [matColumnDef]="column.columnDef">
|
||||||
|
<mat-header-cell *matHeaderCellDef>
|
||||||
|
{{ column.header | translate }}
|
||||||
|
</mat-header-cell>
|
||||||
|
<mat-cell *matCellDef="let row">{{ column.cell(row) }}</mat-cell>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
|
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
|
||||||
|
<mat-row *matRowDef="let row; columns: displayedColumns"></mat-row>
|
||||||
|
</mat-table>
|
@ -0,0 +1,45 @@
|
|||||||
|
/*!
|
||||||
|
* @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, ViewEncapsulation, ChangeDetectionStrategy, Input } from '@angular/core';
|
||||||
|
import { ExtensionRef } from '@alfresco/adf-extensions';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'adf-about-extension-list',
|
||||||
|
templateUrl: './about-extension-list.component.html',
|
||||||
|
encapsulation: ViewEncapsulation.None,
|
||||||
|
changeDetection: ChangeDetectionStrategy.OnPush
|
||||||
|
})
|
||||||
|
export class AboutExtensionListComponent {
|
||||||
|
columns = [
|
||||||
|
{
|
||||||
|
columnDef: 'name',
|
||||||
|
header: 'ABOUT.PLUGINS.NAME',
|
||||||
|
cell: (row: ExtensionRef) => `${row.$name}`
|
||||||
|
},
|
||||||
|
{
|
||||||
|
columnDef: 'version',
|
||||||
|
header: 'ABOUT.PLUGINS.VERSION',
|
||||||
|
cell: (row: ExtensionRef) => `${row.$version}`
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
displayedColumns = this.columns.map((x) => x.columnDef);
|
||||||
|
|
||||||
|
@Input()
|
||||||
|
data: Array<ExtensionRef> = [];
|
||||||
|
}
|
@ -1,7 +1,6 @@
|
|||||||
<div class="adf-github-link-container">
|
<div class="adf-github-link-container">
|
||||||
<div>
|
<header data-automation-id="adf-github-source-code-title">{{ 'ABOUT.SOURCE_CODE.TITLE' | translate }}</header>
|
||||||
<h3 data-automation-id="adf-github-source-code-title">{{ 'ABOUT.SOURCE_CODE.TITLE' | translate }}</h3>
|
<mat-card class="mat-elevation-z0">
|
||||||
<mat-card>
|
|
||||||
<h3 data-automation-id="adf-github-app-title">{{application}}</h3>
|
<h3 data-automation-id="adf-github-app-title">{{application}}</h3>
|
||||||
<p *ngIf="version" data-automation-id="adf-github-version">{{ 'ABOUT.VERSION' | translate }}: {{ version }}</p>
|
<p *ngIf="version" data-automation-id="adf-github-version">{{ 'ABOUT.VERSION' | translate }}: {{ version }}</p>
|
||||||
|
|
||||||
@ -13,4 +12,3 @@
|
|||||||
</div>
|
</div>
|
||||||
</mat-card>
|
</mat-card>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
@ -0,0 +1,11 @@
|
|||||||
|
<mat-table [dataSource]="data">
|
||||||
|
<ng-container *ngFor="let column of columns" [matColumnDef]="column.columnDef">
|
||||||
|
<mat-header-cell *matHeaderCellDef>
|
||||||
|
{{ column.header | translate }}
|
||||||
|
</mat-header-cell>
|
||||||
|
<mat-cell *matCellDef="let row">{{ column.cell(row) }}</mat-cell>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
|
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
|
||||||
|
<mat-row *matRowDef="let row; columns: displayedColumns"></mat-row>
|
||||||
|
</mat-table>
|
@ -0,0 +1,45 @@
|
|||||||
|
/*!
|
||||||
|
* @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, ViewEncapsulation, ChangeDetectionStrategy, Input } from '@angular/core';
|
||||||
|
import { LicenseData } from '../interfaces';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'adf-about-license-list',
|
||||||
|
templateUrl: './about-license-list.component.html',
|
||||||
|
encapsulation: ViewEncapsulation.None,
|
||||||
|
changeDetection: ChangeDetectionStrategy.OnPush
|
||||||
|
})
|
||||||
|
export class AboutLicenseListComponent {
|
||||||
|
columns = [
|
||||||
|
{
|
||||||
|
columnDef: 'property',
|
||||||
|
header: 'ABOUT.LICENSE.PROPERTY',
|
||||||
|
cell: (row: LicenseData) => `${row.property}`
|
||||||
|
},
|
||||||
|
{
|
||||||
|
columnDef: 'value',
|
||||||
|
header: 'ABOUT.LICENSE.VALUE',
|
||||||
|
cell: (row: LicenseData) => `${row.value}`
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
displayedColumns = this.columns.map((x) => x.columnDef);
|
||||||
|
|
||||||
|
@Input()
|
||||||
|
data: LicenseData[] = [];
|
||||||
|
}
|
11
lib/core/about/about-module-list/module-list.component.html
Normal file
11
lib/core/about/about-module-list/module-list.component.html
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<mat-table [dataSource]="data">
|
||||||
|
<ng-container *ngFor="let column of columns" [matColumnDef]="column.columnDef">
|
||||||
|
<mat-header-cell *matHeaderCellDef>
|
||||||
|
{{ column.header | translate }}
|
||||||
|
</mat-header-cell>
|
||||||
|
<mat-cell *matCellDef="let row">{{ column.cell(row) }}</mat-cell>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
|
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
|
||||||
|
<mat-row *matRowDef="let row; columns: displayedColumns"></mat-row>
|
||||||
|
</mat-table>
|
45
lib/core/about/about-module-list/module-list.component.ts
Normal file
45
lib/core/about/about-module-list/module-list.component.ts
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
/*!
|
||||||
|
* @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, ViewEncapsulation, ChangeDetectionStrategy, Input } from '@angular/core';
|
||||||
|
import { ModuleInfo } from '@alfresco/js-api';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'adf-about-module-list',
|
||||||
|
templateUrl: './module-list.component.html',
|
||||||
|
encapsulation: ViewEncapsulation.None,
|
||||||
|
changeDetection: ChangeDetectionStrategy.OnPush
|
||||||
|
})
|
||||||
|
export class ModuleListComponent {
|
||||||
|
columns = [
|
||||||
|
{
|
||||||
|
columnDef: 'title',
|
||||||
|
header: 'ABOUT.MODULES.NAME',
|
||||||
|
cell: (row: ModuleInfo) => `${row.title}`
|
||||||
|
},
|
||||||
|
{
|
||||||
|
columnDef: 'version',
|
||||||
|
header: 'ABOUT.MODULES.VERSION',
|
||||||
|
cell: (row: ModuleInfo) => `${row.version}`
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
displayedColumns = this.columns.map((x) => x.columnDef);
|
||||||
|
|
||||||
|
@Input()
|
||||||
|
data: Array<ModuleInfo> = [];
|
||||||
|
}
|
11
lib/core/about/about-package/package-list.component.html
Normal file
11
lib/core/about/about-package/package-list.component.html
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<mat-table [dataSource]="data">
|
||||||
|
<ng-container *ngFor="let column of columns" [matColumnDef]="column.columnDef">
|
||||||
|
<mat-header-cell *matHeaderCellDef>
|
||||||
|
{{ column.header | translate }}
|
||||||
|
</mat-header-cell>
|
||||||
|
<mat-cell *matCellDef="let row">{{ column.cell(row) }}</mat-cell>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
|
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
|
||||||
|
<mat-row *matRowDef="let row; columns: displayedColumns"></mat-row>
|
||||||
|
</mat-table>
|
45
lib/core/about/about-package/package-list.component.ts
Normal file
45
lib/core/about/about-package/package-list.component.ts
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
/*!
|
||||||
|
* @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, ViewEncapsulation, ChangeDetectionStrategy, Input } from '@angular/core';
|
||||||
|
import { PackageInfo } from '../interfaces';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'adf-about-package-list',
|
||||||
|
templateUrl: './package-list.component.html',
|
||||||
|
encapsulation: ViewEncapsulation.None,
|
||||||
|
changeDetection: ChangeDetectionStrategy.OnPush
|
||||||
|
})
|
||||||
|
export class PackageListComponent {
|
||||||
|
columns = [
|
||||||
|
{
|
||||||
|
columnDef: 'title',
|
||||||
|
header: 'ABOUT.PACKAGES.NAME',
|
||||||
|
cell: (row: PackageInfo) => `${row.name}`
|
||||||
|
},
|
||||||
|
{
|
||||||
|
columnDef: 'version',
|
||||||
|
header: 'ABOUT.PACKAGES.VERSION',
|
||||||
|
cell: (row: PackageInfo) => `${row.version}`
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
displayedColumns = this.columns.map((x) => x.columnDef);
|
||||||
|
|
||||||
|
@Input()
|
||||||
|
data: Array<PackageInfo> = [];
|
||||||
|
}
|
@ -0,0 +1,67 @@
|
|||||||
|
<header data-automation-id="adf-about-product-version-title">{{ 'ABOUT.VERSIONS.TITLE' | translate }}</header>
|
||||||
|
<mat-card class="mat-elevation-z0">
|
||||||
|
|
||||||
|
<ng-container *ngIf="process" data-automation-id="adf-about-bpm-service">
|
||||||
|
<article>
|
||||||
|
<div>{{ 'ABOUT.VERSIONS.PROCESS_SERVICE' | translate }}</div>
|
||||||
|
<p data-automation-id="adf-about-bpm-version">
|
||||||
|
{{ 'ABOUT.VERSIONS.LABELS.VERSION' | translate }}: {{ process.majorVersion }}.{{
|
||||||
|
process.minorVersion }}.{{ process.revisionVersion }}
|
||||||
|
</p>
|
||||||
|
</article>
|
||||||
|
</ng-container>
|
||||||
|
<br>
|
||||||
|
<ng-container *ngIf="repository" data-automation-id="adf-about-ecm-service">
|
||||||
|
<article>
|
||||||
|
<div>{{ 'ABOUT.VERSIONS.CONTENT_SERVICE' | translate }}</div>
|
||||||
|
<p data-automation-id="adf-about-ecm-edition">
|
||||||
|
{{ 'ABOUT.VERSIONS.LABELS.EDITION' | translate }}: {{ repository.edition }}
|
||||||
|
</p>
|
||||||
|
<p data-automation-id="adf-about-ecm-version">
|
||||||
|
{{ 'ABOUT.VERSIONS.LABELS.VERSION' | translate }}: {{ repository.version.display }}
|
||||||
|
</p>
|
||||||
|
</article>
|
||||||
|
</ng-container>
|
||||||
|
<br>
|
||||||
|
<ng-container *ngIf="modeling$ | async as modeling" data-automation-id="adf-about-ecm-service">
|
||||||
|
<article>
|
||||||
|
<div>{{ 'ABOUT.VERSIONS.MODELING_SERVICE' | translate }}</div>
|
||||||
|
<p>
|
||||||
|
{{ 'ABOUT.VERSIONS.LABELS.VERSION' | translate }}: {{ modeling.version }}
|
||||||
|
</p>
|
||||||
|
</article>
|
||||||
|
</ng-container>
|
||||||
|
<br>
|
||||||
|
<ng-container *ngIf="deployment$| async as deployment" data-automation-id="adf-about-ecm-service">
|
||||||
|
<article>
|
||||||
|
<div>{{ 'ABOUT.VERSIONS.DEPLOYMENT_SERVICE' | translate }}</div>
|
||||||
|
<p>
|
||||||
|
{{ 'ABOUT.VERSIONS.LABELS.VERSION' | translate }}: {{ deployment.version }}
|
||||||
|
</p>
|
||||||
|
</article>
|
||||||
|
</ng-container>
|
||||||
|
<br>
|
||||||
|
<ng-container *ngIf="rb$ | async as rb" data-automation-id="adf-about-ecm-service">
|
||||||
|
<article>
|
||||||
|
<div>{{ 'ABOUT.VERSIONS.RB' | translate }}</div>
|
||||||
|
<p>
|
||||||
|
{{ 'ABOUT.VERSIONS.LABELS.EDITION' | translate }}: {{ rb.artifact }}
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
{{ 'ABOUT.VERSIONS.LABELS.VERSION' | translate }}: {{ rb.version }}
|
||||||
|
</p>
|
||||||
|
</article>
|
||||||
|
</ng-container>
|
||||||
|
<br>
|
||||||
|
<ng-container *ngIf="query$ | async as query" data-automation-id="adf-about-ecm-service">
|
||||||
|
<article>
|
||||||
|
<div>{{ 'ABOUT.VERSIONS.QUERY_SERVICE' | translate }}</div>
|
||||||
|
<p>
|
||||||
|
{{ 'ABOUT.VERSIONS.LABELS.VERSION' | translate }}: {{ query.version }}
|
||||||
|
</p>
|
||||||
|
</article>
|
||||||
|
</ng-container>
|
||||||
|
</mat-card>
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,67 @@
|
|||||||
|
/*!
|
||||||
|
* @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, ViewEncapsulation } from '@angular/core';
|
||||||
|
import { RepositoryInfo } from '@alfresco/js-api';
|
||||||
|
import { Observable } from 'rxjs';
|
||||||
|
|
||||||
|
import { BpmProductVersionModel } from '../../models/product-version.model';
|
||||||
|
import { AaeInfoService, ActivitiDependencyInfo } from '../services/aae-info.service';
|
||||||
|
import { AppConfigService } from '../../app-config/app-config.service';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'adf-about-platform-version',
|
||||||
|
templateUrl: './about-platform-version.component.html',
|
||||||
|
encapsulation: ViewEncapsulation.None
|
||||||
|
})
|
||||||
|
export class AboutPlatformVersionComponent {
|
||||||
|
|
||||||
|
/** repository info. */
|
||||||
|
@Input()
|
||||||
|
repository: RepositoryInfo = null;
|
||||||
|
|
||||||
|
/** process info. */
|
||||||
|
@Input()
|
||||||
|
process: BpmProductVersionModel = null;
|
||||||
|
|
||||||
|
modeling$: Observable<ActivitiDependencyInfo>;
|
||||||
|
deployment$: Observable<ActivitiDependencyInfo>;
|
||||||
|
rb$: Observable<ActivitiDependencyInfo>;
|
||||||
|
query$: Observable<ActivitiDependencyInfo>;
|
||||||
|
|
||||||
|
constructor(private aaeInfoService: AaeInfoService, private appConfigService: AppConfigService) {
|
||||||
|
this.modelingInfo();
|
||||||
|
this.deploymentInfo();
|
||||||
|
this.rbInfo();
|
||||||
|
}
|
||||||
|
|
||||||
|
modelingInfo() {
|
||||||
|
this.modeling$ = this.aaeInfoService.getServiceVersion('modeling-service');
|
||||||
|
}
|
||||||
|
|
||||||
|
deploymentInfo() {
|
||||||
|
this.deployment$ = this.aaeInfoService.getServiceVersion('deployment-service');
|
||||||
|
}
|
||||||
|
|
||||||
|
rbInfo() {
|
||||||
|
this.rb$ = this.aaeInfoService.getServiceVersion(`${this.appConfigService.get('oauth2.clientId')}/rb`);
|
||||||
|
}
|
||||||
|
|
||||||
|
queryInfo() {
|
||||||
|
this.query$ = this.aaeInfoService.getServiceVersion(`${this.appConfigService.get('oauth2.clientId')}/query`);
|
||||||
|
}
|
||||||
|
}
|
@ -1,35 +0,0 @@
|
|||||||
<div class="adf-about-product-version-container" *ngIf="bpmVersion || ecmVersion">
|
|
||||||
<h3 data-automation-id="adf-about-product-version-title">{{ 'ABOUT.VERSIONS.TITLE' | translate }}</h3>
|
|
||||||
<mat-card>
|
|
||||||
<div *ngIf="bpmVersion" data-automation-id="adf-about-bpm-service">
|
|
||||||
<h3>{{ 'ABOUT.VERSIONS.PROCESS_SERVICE' | translate }}</h3>
|
|
||||||
<p data-automation-id="adf-about-bpm-edition">
|
|
||||||
{{ 'ABOUT.VERSIONS.LABELS.EDITION' | translate }}: {{ bpmVersion.edition }}
|
|
||||||
</p>
|
|
||||||
<p data-automation-id="adf-about-bpm-version">
|
|
||||||
{{ 'ABOUT.VERSIONS.LABELS.VERSION' | translate }}: {{ bpmVersion.majorVersion }}.{{
|
|
||||||
bpmVersion.minorVersion }}.{{ bpmVersion.revisionVersion }}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<div *ngIf="ecmVersion" data-automation-id="adf-about-ecm-service">
|
|
||||||
<h3>{{ 'ABOUT.VERSIONS.CONTENT_SERVICE' | translate }}</h3>
|
|
||||||
<p data-automation-id="adf-about-ecm-edition">
|
|
||||||
{{ 'ABOUT.VERSIONS.LABELS.EDITION' | translate }}: {{ ecmVersion.edition }}
|
|
||||||
</p>
|
|
||||||
<p data-automation-id="adf-about-ecm-version">
|
|
||||||
{{ 'ABOUT.VERSIONS.LABELS.VERSION' | translate }}: {{ ecmVersion.version.display }}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</mat-card>
|
|
||||||
<div *ngIf="ecmVersion" data-automation-id="adf-about-ecm">
|
|
||||||
<h3 data-automation-id="adf-about-ecm-license-title">{{ 'ABOUT.VERSIONS.LABELS.LICENSE' | translate }}</h3>
|
|
||||||
<adf-datatable [data]="license"></adf-datatable>
|
|
||||||
<h3 data-automation-id="adf-about-ecm-status-title"> {{ 'ABOUT.VERSIONS.LABELS.STATUS' | translate }}</h3>
|
|
||||||
<adf-datatable [data]="status"></adf-datatable>
|
|
||||||
<h3 data-automation-id="adf-about-ecm-modules-title">{{ 'ABOUT.VERSIONS.LABELS.MODULES' | translate }}</h3>
|
|
||||||
<adf-datatable [data]="modules"></adf-datatable>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
|||||||
.adf-about-product-version-container {
|
|
||||||
padding: 10px;
|
|
||||||
}
|
|
@ -1,116 +0,0 @@
|
|||||||
/*!
|
|
||||||
* @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 { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
||||||
import { CoreTestingModule } from '../../testing/core.testing.module';
|
|
||||||
import { setupTestBed } from '../../testing/setup-test-bed';
|
|
||||||
import { AboutProductVersionComponent } from './about-product-version.component';
|
|
||||||
import { DiscoveryApiService } from '../../services/discovery-api.service';
|
|
||||||
import { AuthenticationService } from '../../services/authentication.service';
|
|
||||||
import { of } from 'rxjs';
|
|
||||||
import { aboutAPSMockDetails, mockModules } from '../about.mock';
|
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
|
||||||
|
|
||||||
describe('AboutProductVersionComponent', () => {
|
|
||||||
let fixture: ComponentFixture<AboutProductVersionComponent>;
|
|
||||||
let authenticationService: AuthenticationService;
|
|
||||||
let discoveryApiService: DiscoveryApiService;
|
|
||||||
|
|
||||||
setupTestBed({
|
|
||||||
imports: [
|
|
||||||
TranslateModule.forRoot(),
|
|
||||||
CoreTestingModule
|
|
||||||
]
|
|
||||||
});
|
|
||||||
|
|
||||||
beforeEach(() => {
|
|
||||||
fixture = TestBed.createComponent(AboutProductVersionComponent);
|
|
||||||
authenticationService = TestBed.inject(AuthenticationService);
|
|
||||||
discoveryApiService = TestBed.inject(DiscoveryApiService);
|
|
||||||
spyOn(discoveryApiService, 'getEcmProductInfo').and.returnValue(of(mockModules));
|
|
||||||
spyOn(authenticationService, 'isBpmLoggedIn').and.returnValue(true);
|
|
||||||
spyOn(authenticationService, 'isEcmLoggedIn').and.returnValue(true);
|
|
||||||
spyOn(discoveryApiService, 'getBpmProductInfo').and.returnValue(of(aboutAPSMockDetails));
|
|
||||||
fixture.detectChanges();
|
|
||||||
});
|
|
||||||
|
|
||||||
afterEach(() => {
|
|
||||||
fixture.destroy();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('Should display title', () => {
|
|
||||||
const titleElement = fixture.nativeElement.querySelector('[data-automation-id="adf-about-product-version-title"]');
|
|
||||||
expect(titleElement === null).toBeFalsy();
|
|
||||||
expect(titleElement.innerText).toBe('ABOUT.VERSIONS.TITLE');
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should display bpm details', async() => {
|
|
||||||
fixture.detectChanges();
|
|
||||||
await fixture.whenStable();
|
|
||||||
const version = fixture.nativeElement.querySelector('[data-automation-id="adf-about-bpm-version"]');
|
|
||||||
expect(version.innerText).toEqual('ABOUT.VERSIONS.LABELS.VERSION: 1.10.0');
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should display ecm details', async() => {
|
|
||||||
fixture.detectChanges();
|
|
||||||
await fixture.whenStable();
|
|
||||||
const version = fixture.nativeElement.querySelector('[data-automation-id="adf-about-ecm-version"]');
|
|
||||||
expect(version.innerText).toEqual('ABOUT.VERSIONS.LABELS.VERSION: 6.2.0.0');
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should display both bpm & ecm details', async() => {
|
|
||||||
fixture.detectChanges();
|
|
||||||
await fixture.whenStable();
|
|
||||||
const bpmVersion = fixture.nativeElement.querySelector('[data-automation-id="adf-about-bpm-version"]');
|
|
||||||
const ecmVersion = fixture.nativeElement.querySelector('[data-automation-id="adf-about-ecm-version"]');
|
|
||||||
expect(bpmVersion.innerText).toEqual('ABOUT.VERSIONS.LABELS.VERSION: 1.10.0');
|
|
||||||
expect(ecmVersion.innerText).toEqual('ABOUT.VERSIONS.LABELS.VERSION: 6.2.0.0');
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should display license details', async() => {
|
|
||||||
fixture.detectChanges();
|
|
||||||
await fixture.whenStable();
|
|
||||||
const dataTable = fixture.nativeElement.querySelector('.adf-datatable');
|
|
||||||
const issueAt = fixture.nativeElement.querySelector('[data-automation-id="text_2018-12-20T12:07:31.276+0000"]');
|
|
||||||
const expiresAt = fixture.nativeElement.querySelector('[data-automation-id="text_2019-05-31T23:00:00.000+0000"]');
|
|
||||||
expect(dataTable).not.toBeNull();
|
|
||||||
expect(issueAt.innerText).toEqual('2018-12-20T12:07:31.276+0000');
|
|
||||||
expect(expiresAt.innerText).toEqual('2019-05-31T23:00:00.000+0000');
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should display status details', async() => {
|
|
||||||
fixture.detectChanges();
|
|
||||||
await fixture.whenStable();
|
|
||||||
const dataTable = fixture.nativeElement.querySelector('.adf-datatable');
|
|
||||||
const readOnly = fixture.nativeElement.querySelector('[data-automation-id="text_false"]');
|
|
||||||
const isAuditEnabled = fixture.nativeElement.querySelector('[data-automation-id="text_true"]');
|
|
||||||
expect(dataTable).not.toBeNull();
|
|
||||||
expect(readOnly.innerText).toEqual('false');
|
|
||||||
expect(isAuditEnabled.innerText).toEqual('true');
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should display module details', async() => {
|
|
||||||
fixture.detectChanges();
|
|
||||||
await fixture.whenStable();
|
|
||||||
const dataTable = fixture.nativeElement.querySelector('.adf-datatable');
|
|
||||||
const moduleTitle = fixture.nativeElement.querySelector('[data-automation-id="text_ABC Repo"]');
|
|
||||||
const moduleTitleTwo = fixture.nativeElement.querySelector('[data-automation-id="text_AOFS Module"]');
|
|
||||||
expect(dataTable).not.toBeNull();
|
|
||||||
expect(moduleTitle.innerText).toEqual('ABC Repo');
|
|
||||||
expect(moduleTitleTwo.innerText).toEqual('AOFS Module');
|
|
||||||
});
|
|
||||||
});
|
|
@ -1,139 +0,0 @@
|
|||||||
/*!
|
|
||||||
* @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, OnInit, ViewEncapsulation } from '@angular/core';
|
|
||||||
import { BpmProductVersionModel, EcmProductVersionModel } from '../../models/product-version.model';
|
|
||||||
import { ObjectDataTableAdapter } from '../../datatable/data/object-datatable-adapter';
|
|
||||||
import { AuthenticationService } from '../../services/authentication.service';
|
|
||||||
import { DiscoveryApiService } from '../../services/discovery-api.service';
|
|
||||||
|
|
||||||
@Component({
|
|
||||||
selector: 'adf-about-product-version',
|
|
||||||
templateUrl: './about-product-version.component.html',
|
|
||||||
encapsulation: ViewEncapsulation.None
|
|
||||||
})
|
|
||||||
export class AboutProductVersionComponent implements OnInit {
|
|
||||||
|
|
||||||
ecmVersion: EcmProductVersionModel = null;
|
|
||||||
bpmVersion: BpmProductVersionModel = null;
|
|
||||||
|
|
||||||
status: ObjectDataTableAdapter;
|
|
||||||
license: ObjectDataTableAdapter;
|
|
||||||
modules: ObjectDataTableAdapter;
|
|
||||||
|
|
||||||
constructor(private authService: AuthenticationService,
|
|
||||||
private discovery: DiscoveryApiService) {}
|
|
||||||
|
|
||||||
ngOnInit() {
|
|
||||||
if (this.authService.isEcmLoggedIn()) {
|
|
||||||
this.setECMInfo();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.authService.isBpmLoggedIn()) {
|
|
||||||
this.setBPMInfo();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
setECMInfo() {
|
|
||||||
this.discovery.getEcmProductInfo().subscribe((ecmVers) => {
|
|
||||||
this.ecmVersion = ecmVers;
|
|
||||||
|
|
||||||
this.modules = new ObjectDataTableAdapter(this.ecmVersion.modules, [
|
|
||||||
{ type: 'text', key: 'id', title: 'ABOUT.TABLE_HEADERS.MODULES.ID', sortable: true },
|
|
||||||
{ type: 'text', key: 'title', title: 'ABOUT.TABLE_HEADERS.MODULES.TITLE', sortable: true },
|
|
||||||
{ type: 'text', key: 'version', title: 'ABOUT.TABLE_HEADERS.MODULES.DESCRIPTION', sortable: true },
|
|
||||||
{
|
|
||||||
type: 'text',
|
|
||||||
key: 'installDate',
|
|
||||||
title: 'ABOUT.TABLE_HEADERS.MODULES.INSTALL_DATE',
|
|
||||||
sortable: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'text',
|
|
||||||
key: 'installState',
|
|
||||||
title: 'ABOUT.TABLE_HEADERS.MODULES.INSTALL_STATE',
|
|
||||||
sortable: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'text',
|
|
||||||
key: 'versionMin',
|
|
||||||
title: 'ABOUT.TABLE_HEADERS.MODULES.VERSION_MIN',
|
|
||||||
sortable: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'text',
|
|
||||||
key: 'versionMax',
|
|
||||||
title: 'ABOUT.TABLE_HEADERS.MODULES.VERSION_MAX',
|
|
||||||
sortable: true
|
|
||||||
}
|
|
||||||
]);
|
|
||||||
|
|
||||||
this.status = new ObjectDataTableAdapter([this.ecmVersion.status], [
|
|
||||||
{ type: 'text', key: 'isReadOnly', title: 'ABOUT.TABLE_HEADERS.STATUS.READ_ONLY', sortable: true },
|
|
||||||
{
|
|
||||||
type: 'text',
|
|
||||||
key: 'isAuditEnabled',
|
|
||||||
title: 'ABOUT.TABLE_HEADERS.STATUS.AUDIT_ENABLED',
|
|
||||||
sortable: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'text',
|
|
||||||
key: 'isQuickShareEnabled',
|
|
||||||
title: 'ABOUT.TABLE_HEADERS.STATUS.QUICK_SHARE_ENABLED',
|
|
||||||
sortable: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'text',
|
|
||||||
key: 'isThumbnailGenerationEnabled',
|
|
||||||
title: 'ABOUT.TABLE_HEADERS.STATUS.THUMBNAIL_ENABLED',
|
|
||||||
sortable: true
|
|
||||||
}
|
|
||||||
]);
|
|
||||||
|
|
||||||
this.license = new ObjectDataTableAdapter([this.ecmVersion.license], [
|
|
||||||
{ type: 'text', key: 'issuedAt', title: 'ABOUT.TABLE_HEADERS.LICENSE.ISSUES_AT', sortable: true },
|
|
||||||
{ type: 'text', key: 'expiresAt', title: 'ABOUT.TABLE_HEADERS.LICENSE.EXPIRES_AT', sortable: true },
|
|
||||||
{
|
|
||||||
type: 'text',
|
|
||||||
key: 'remainingDays',
|
|
||||||
title: 'ABOUT.TABLE_HEADERS.LICENSE.REMAINING_DAYS',
|
|
||||||
sortable: true
|
|
||||||
},
|
|
||||||
{ type: 'text', key: 'holder', title: 'ABOUT.TABLE_HEADERS.LICENSE.HOLDER', sortable: true },
|
|
||||||
{ type: 'text', key: 'mode', title: 'ABOUT.TABLE_HEADERS.LICENSE.MODE', sortable: true },
|
|
||||||
{
|
|
||||||
type: 'text',
|
|
||||||
key: 'isClusterEnabled',
|
|
||||||
title: 'ABOUT.TABLE_HEADERS.LICENSE.CLUSTER_ENABLED',
|
|
||||||
sortable: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'text',
|
|
||||||
key: 'isCryptodocEnabled',
|
|
||||||
title: 'ABOUT.TABLE_HEADERS.LICENSE.CRYPTODOC_ENABLED',
|
|
||||||
sortable: true
|
|
||||||
}
|
|
||||||
]);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
setBPMInfo() {
|
|
||||||
this.discovery.getBpmProductInfo().subscribe((bpmVersion) => {
|
|
||||||
this.bpmVersion = bpmVersion;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,7 +1,6 @@
|
|||||||
<div class="adf-github-link-container">
|
<div class="adf-github-link-container">
|
||||||
<h3 data-automation-id="adf-about-setting-title">{{ 'ABOUT.SERVER_SETTINGS.TITLE' | translate }}</h3>
|
<header data-automation-id="adf-about-setting-title">{{ 'ABOUT.SERVER_SETTINGS.TITLE' | translate }}</header>
|
||||||
<small>{{ 'ABOUT.SERVER_SETTINGS.DESCRIPTION' | translate }}</small>
|
<mat-card class="mat-elevation-z0">
|
||||||
<mat-card>
|
|
||||||
<p data-automation-id="adf-process-service-host">
|
<p data-automation-id="adf-process-service-host">
|
||||||
{{ 'ABOUT.SERVER_SETTINGS.PROCESS_SERVICE_HOST' | translate: {value: bpmHost} }}
|
{{ 'ABOUT.SERVER_SETTINGS.PROCESS_SERVICE_HOST' | translate: {value: bpmHost} }}
|
||||||
</p>
|
</p>
|
||||||
|
@ -0,0 +1,11 @@
|
|||||||
|
<mat-table [dataSource]="data">
|
||||||
|
<ng-container *ngFor="let column of columns" [matColumnDef]="column.columnDef">
|
||||||
|
<mat-header-cell *matHeaderCellDef>
|
||||||
|
{{ column.header | translate }}
|
||||||
|
</mat-header-cell>
|
||||||
|
<mat-cell *matCellDef="let row">{{ column.cell(row) }}</mat-cell>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
|
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
|
||||||
|
<mat-row *matRowDef="let row; columns: displayedColumns"></mat-row>
|
||||||
|
</mat-table>
|
@ -0,0 +1,45 @@
|
|||||||
|
/*!
|
||||||
|
* @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, ViewEncapsulation, ChangeDetectionStrategy, Input } from '@angular/core';
|
||||||
|
import { StatusData } from '../interfaces';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'adf-about-status-list',
|
||||||
|
templateUrl: './about-status-list.component.html',
|
||||||
|
encapsulation: ViewEncapsulation.None,
|
||||||
|
changeDetection: ChangeDetectionStrategy.OnPush
|
||||||
|
})
|
||||||
|
export class AboutStatusListComponent {
|
||||||
|
columns = [
|
||||||
|
{
|
||||||
|
columnDef: 'property',
|
||||||
|
header: 'ABOUT.STATUS.PROPERTY',
|
||||||
|
cell: (row: StatusData) => `${row.property}`
|
||||||
|
},
|
||||||
|
{
|
||||||
|
columnDef: 'value',
|
||||||
|
header: 'ABOUT.STATUS.VALUE',
|
||||||
|
cell: (row: StatusData) => `${row.value}`
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
displayedColumns = this.columns.map((x) => x.columnDef);
|
||||||
|
|
||||||
|
@Input()
|
||||||
|
data: StatusData[] = [];
|
||||||
|
}
|
41
lib/core/about/about.component.html
Normal file
41
lib/core/about/about.component.html
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
<div class="adf-about-container">
|
||||||
|
|
||||||
|
<adf-about-github-link *ngIf="dev" [application]="pkg.application" [url]="url" ></adf-about-github-link>
|
||||||
|
|
||||||
|
<adf-about-server-settings *ngIf="dev" ></adf-about-server-settings>
|
||||||
|
|
||||||
|
<adf-about-platform-version [repository]="repository"
|
||||||
|
[process]="bpmVersion">
|
||||||
|
</adf-about-platform-version>
|
||||||
|
|
||||||
|
<ng-container *ngIf="repository">
|
||||||
|
|
||||||
|
<article *ngIf="licenseEntries">
|
||||||
|
<header>{{ 'ABOUT.LICENSE.TITLE' | translate }}</header>
|
||||||
|
<adf-about-license-list [data]="licenseEntries"></adf-about-license-list>
|
||||||
|
</article>
|
||||||
|
|
||||||
|
<article *ngIf="statusEntries">
|
||||||
|
<header>{{ 'ABOUT.STATUS.TITLE' | translate }}</header>
|
||||||
|
<adf-about-status-list [data]="statusEntries"></adf-about-status-list>
|
||||||
|
</article>
|
||||||
|
|
||||||
|
<article *ngIf="repository?.modules">
|
||||||
|
<header>{{ 'ABOUT.MODULES.TITLE' | translate }}</header>
|
||||||
|
<adf-about-module-list [data]="repository.modules"></adf-about-module-list>
|
||||||
|
</article>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
|
<article *ngIf="dependencyEntries && dev" >
|
||||||
|
<header>{{ 'ABOUT.PACKAGES.TITLE' | translate }}</header>
|
||||||
|
<adf-about-package-list [data]="dependencyEntries"></adf-about-package-list>
|
||||||
|
</article>
|
||||||
|
|
||||||
|
<ng-container *ngIf="extensions$ | async as extensions">
|
||||||
|
<article *ngIf="extensions.length > 0">
|
||||||
|
<header>{{ 'ABOUT.PLUGINS.TITLE' | translate }}</header>
|
||||||
|
<adf-about-extension-list [data]="extensions"></adf-about-extension-list>
|
||||||
|
</article>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
|
</div>
|
12
lib/core/about/about.component.scss
Normal file
12
lib/core/about/about.component.scss
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
adf-about {
|
||||||
|
|
||||||
|
.adf-about-container {
|
||||||
|
margin: 10px 0 5px 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
header {
|
||||||
|
margin: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
67
lib/core/about/about.component.stories.ts
Normal file
67
lib/core/about/about.component.stories.ts
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
/*!
|
||||||
|
* @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 { Meta, moduleMetadata, Story } from '@storybook/angular';
|
||||||
|
import { AboutComponent } from './about.component';
|
||||||
|
import { AboutModule } from './about.module';
|
||||||
|
import { AuthenticationService, DiscoveryApiService } from '../services';
|
||||||
|
import { AppConfigServiceMock, AuthenticationMock } from '../mock';
|
||||||
|
import { DiscoveryApiServiceMock } from '../mock/discovery-api.service.mock';
|
||||||
|
import { AppExtensionService, AppExtensionServiceMock } from '@alfresco/adf-extensions';
|
||||||
|
import { AppConfigService } from '../app-config/app-config.service';
|
||||||
|
import { CoreStoryModule } from '../testing/core.story.module';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
component: AboutComponent,
|
||||||
|
title: 'Core/Components/About',
|
||||||
|
decorators: [
|
||||||
|
moduleMetadata({
|
||||||
|
imports: [CoreStoryModule, AboutModule],
|
||||||
|
providers: [
|
||||||
|
{ provide: AuthenticationService, useClass: AuthenticationMock },
|
||||||
|
{ provide: DiscoveryApiService, useClass: DiscoveryApiServiceMock },
|
||||||
|
{ provide: AppExtensionService, useClass: AppExtensionServiceMock },
|
||||||
|
{ provide: AppConfigService, useClass: AppConfigServiceMock }
|
||||||
|
]
|
||||||
|
})
|
||||||
|
]
|
||||||
|
} as Meta;
|
||||||
|
|
||||||
|
const template: Story<AboutComponent> = (args: AboutComponent) => ({
|
||||||
|
props: args
|
||||||
|
});
|
||||||
|
|
||||||
|
export const devAbout = template.bind({});
|
||||||
|
|
||||||
|
devAbout.args = {
|
||||||
|
dev: true,
|
||||||
|
pkg: {
|
||||||
|
name: 'My Storybook App', commit: 'my-commit-value', version: '1.0.0', dependencies: {
|
||||||
|
'@alfresco/adf-content-services': '4.7.0',
|
||||||
|
'@alfresco/adf-core': '4.7.0',
|
||||||
|
'@alfresco/adf-extensions': '4.7.0',
|
||||||
|
'@alfresco/adf-process-services': '4.7.0',
|
||||||
|
'@alfresco/adf-process-services-cloud': '4.7.0',
|
||||||
|
'@alfresco/js-api': '4.7.0-3976'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export const prodAbout = template.bind({});
|
||||||
|
prodAbout.args = {
|
||||||
|
dev: false
|
||||||
|
};
|
124
lib/core/about/about.component.ts
Normal file
124
lib/core/about/about.component.ts
Normal file
@ -0,0 +1,124 @@
|
|||||||
|
/*!
|
||||||
|
* @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, OnInit, ViewEncapsulation } from '@angular/core';
|
||||||
|
import { AppExtensionService, ExtensionRef } from '@alfresco/adf-extensions';
|
||||||
|
import { Observable } from 'rxjs';
|
||||||
|
import { AppConfigService } from '../app-config/app-config.service';
|
||||||
|
import { RepositoryInfo } from '@alfresco/js-api';
|
||||||
|
|
||||||
|
import { BpmProductVersionModel } from '../models/product-version.model';
|
||||||
|
import { AuthenticationService } from '../services/authentication.service';
|
||||||
|
import { DiscoveryApiService } from '../services/discovery-api.service';
|
||||||
|
import { LicenseData, PackageInfo, StatusData } from './interfaces';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'adf-about',
|
||||||
|
templateUrl: './about.component.html',
|
||||||
|
styleUrls: ['./about.component.scss'],
|
||||||
|
encapsulation: ViewEncapsulation.None
|
||||||
|
})
|
||||||
|
export class AboutComponent implements OnInit {
|
||||||
|
|
||||||
|
repository: RepositoryInfo = null;
|
||||||
|
bpmVersion: BpmProductVersionModel = null;
|
||||||
|
|
||||||
|
statusEntries: StatusData[];
|
||||||
|
licenseEntries: LicenseData[];
|
||||||
|
|
||||||
|
dependencyEntries: PackageInfo[] = [];
|
||||||
|
url: string;
|
||||||
|
version: string;
|
||||||
|
dependencies: string;
|
||||||
|
application: string;
|
||||||
|
|
||||||
|
/** If active show more information about the app and the platform useful in debug. */
|
||||||
|
@Input() dev: boolean = false;
|
||||||
|
|
||||||
|
/** pkg json. */
|
||||||
|
@Input() pkg: any;
|
||||||
|
|
||||||
|
/** Regular expression for filtering dependencies packages. */
|
||||||
|
@Input() regexp = '^(@alfresco)';
|
||||||
|
|
||||||
|
extensions$: Observable<ExtensionRef[]>;
|
||||||
|
|
||||||
|
constructor(private authService: AuthenticationService,
|
||||||
|
private discovery: DiscoveryApiService,
|
||||||
|
private appExtensions: AppExtensionService,
|
||||||
|
private appConfigService: AppConfigService) {
|
||||||
|
this.extensions$ = this.appExtensions.references$;
|
||||||
|
this.application = this.appConfigService.get<string>(
|
||||||
|
'application.name'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
this.url = `https://github.com/Alfresco/${this.pkg?.name}/commits/${this.pkg?.commit}`;
|
||||||
|
this.version = this.pkg?.version;
|
||||||
|
this.dependencies = this.pkg?.dependencies;
|
||||||
|
|
||||||
|
if (this.dependencies) {
|
||||||
|
const alfrescoPackages = Object.keys(this.dependencies).filter((val) => {
|
||||||
|
return new RegExp(this.regexp).test(val);
|
||||||
|
});
|
||||||
|
|
||||||
|
alfrescoPackages.forEach((val) => {
|
||||||
|
this.dependencyEntries.push({
|
||||||
|
name: val,
|
||||||
|
version: (this.dependencies[val])
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (this.authService.isEcmLoggedIn()) {
|
||||||
|
this.setECMInfo();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.authService.isBpmLoggedIn()) {
|
||||||
|
this.setBPMInfo();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
setECMInfo() {
|
||||||
|
this.discovery.getEcmProductInfo().subscribe((repository) => {
|
||||||
|
this.repository = repository;
|
||||||
|
|
||||||
|
this.statusEntries = Object.keys(repository.status).map((key) => {
|
||||||
|
return {
|
||||||
|
property: key,
|
||||||
|
value: repository.status[key]
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
if (repository.license) {
|
||||||
|
this.licenseEntries = Object.keys(repository.license).map((key) => {
|
||||||
|
return {
|
||||||
|
property: key,
|
||||||
|
value: repository.license[key]
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
setBPMInfo() {
|
||||||
|
this.discovery.getBpmProductInfo().subscribe((bpmVersion) => {
|
||||||
|
this.bpmVersion = bpmVersion;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -19,30 +19,44 @@ import { CommonModule } from '@angular/common';
|
|||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
import { MaterialModule } from '../material.module';
|
import { MaterialModule } from '../material.module';
|
||||||
import { DataTableModule } from '../datatable/datatable.module';
|
|
||||||
import { AboutApplicationModulesComponent } from './about-application-modules/about-application-modules.component';
|
|
||||||
import { AboutProductVersionComponent } from './about-product-version/about-product-version.component';
|
|
||||||
import { AboutGithubLinkComponent } from './about-github-link/about-github-link.component';
|
import { AboutGithubLinkComponent } from './about-github-link/about-github-link.component';
|
||||||
import { AboutServerSettingsComponent } from './about-server-settings/about-server-settings.component';
|
import { AboutServerSettingsComponent } from './about-server-settings/about-server-settings.component';
|
||||||
|
import { AboutExtensionListComponent } from './about-extension-list/about-extension-list.component';
|
||||||
|
import { AboutLicenseListComponent } from './about-license-list/about-license-list.component';
|
||||||
|
import { PackageListComponent } from './about-package/package-list.component';
|
||||||
|
import { AboutStatusListComponent } from './about-status-list/about-status-list.component';
|
||||||
|
import { ModuleListComponent } from './about-module-list/module-list.component';
|
||||||
|
import { AboutPlatformVersionComponent } from './about-platform-version/about-platform-version.component';
|
||||||
|
import { AboutComponent } from './about.component';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
CommonModule,
|
CommonModule,
|
||||||
MaterialModule,
|
MaterialModule,
|
||||||
TranslateModule,
|
TranslateModule
|
||||||
DataTableModule
|
|
||||||
],
|
],
|
||||||
declarations: [
|
declarations: [
|
||||||
AboutApplicationModulesComponent,
|
AboutComponent,
|
||||||
AboutProductVersionComponent,
|
AboutPlatformVersionComponent,
|
||||||
AboutGithubLinkComponent,
|
AboutGithubLinkComponent,
|
||||||
AboutServerSettingsComponent
|
AboutServerSettingsComponent,
|
||||||
|
AboutExtensionListComponent,
|
||||||
|
AboutLicenseListComponent,
|
||||||
|
PackageListComponent,
|
||||||
|
AboutStatusListComponent,
|
||||||
|
ModuleListComponent
|
||||||
],
|
],
|
||||||
exports: [
|
exports: [
|
||||||
AboutApplicationModulesComponent,
|
AboutComponent,
|
||||||
AboutProductVersionComponent,
|
AboutPlatformVersionComponent,
|
||||||
AboutGithubLinkComponent,
|
AboutGithubLinkComponent,
|
||||||
AboutServerSettingsComponent
|
AboutServerSettingsComponent,
|
||||||
|
AboutExtensionListComponent,
|
||||||
|
AboutLicenseListComponent,
|
||||||
|
PackageListComponent,
|
||||||
|
AboutStatusListComponent,
|
||||||
|
ModuleListComponent
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
export class AboutModule {}
|
export class AboutModule {}
|
||||||
|
31
lib/core/about/interfaces.ts
Normal file
31
lib/core/about/interfaces.ts
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
/*!
|
||||||
|
* @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 interface PackageInfo {
|
||||||
|
name: string;
|
||||||
|
version: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface StatusData {
|
||||||
|
property: string;
|
||||||
|
value: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface LicenseData {
|
||||||
|
property: string;
|
||||||
|
value: string;
|
||||||
|
}
|
@ -15,9 +15,14 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
export * from './about-extension-list/about-extension-list.component';
|
||||||
export * from './about-github-link/about-github-link.component';
|
export * from './about-github-link/about-github-link.component';
|
||||||
export * from './about-product-version/about-product-version.component';
|
export * from './about-license-list/about-license-list.component';
|
||||||
export * from './about-application-modules/about-application-modules.component';
|
export * from './about-module-list/module-list.component';
|
||||||
|
export * from './about-package/package-list.component';
|
||||||
|
export * from './about-platform-version/about-platform-version.component';
|
||||||
export * from './about-server-settings/about-server-settings.component';
|
export * from './about-server-settings/about-server-settings.component';
|
||||||
|
export * from './about-status-list/about-status-list.component';
|
||||||
|
export * from './about.component';
|
||||||
|
|
||||||
export * from './about.module';
|
export * from './about.module';
|
||||||
|
55
lib/core/about/services/aae-info.service.ts
Normal file
55
lib/core/about/services/aae-info.service.ts
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
/*!
|
||||||
|
* @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 { HttpClient } from '@angular/common/http';
|
||||||
|
import { map } from 'rxjs/operators';
|
||||||
|
import { Observable } from 'rxjs';
|
||||||
|
import { AppConfigService } from '../../app-config/app-config.service';
|
||||||
|
|
||||||
|
export interface ActivitiDependencyInfo {
|
||||||
|
artifact: string;
|
||||||
|
version: string;
|
||||||
|
activiti: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Injectable({
|
||||||
|
providedIn: 'root'
|
||||||
|
})
|
||||||
|
export class AaeInfoService {
|
||||||
|
contextRoot = '';
|
||||||
|
|
||||||
|
constructor(protected httpClient: HttpClient, protected appConfigService: AppConfigService) {
|
||||||
|
this.contextRoot = appConfigService.get('bpmHost', '');
|
||||||
|
}
|
||||||
|
|
||||||
|
getServiceVersion(serviceName: string): Observable<ActivitiDependencyInfo> {
|
||||||
|
return this.httpClient.get<any>(`${this.contextRoot}/${serviceName}/actuator/info`).pipe(
|
||||||
|
map((response: any) => {
|
||||||
|
let activitiVersion = 'N/A';
|
||||||
|
if (response.build.activiti) {
|
||||||
|
activitiVersion = response.build.activiti.version;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
artifact: response.build.artifact,
|
||||||
|
version: response.build.version,
|
||||||
|
activiti: activitiVersion
|
||||||
|
};
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@ -22,7 +22,10 @@ import { CardViewUpdateService } from '../../services/card-view-update.service';
|
|||||||
import { CardViewTextItemComponent } from './card-view-textitem.component';
|
import { CardViewTextItemComponent } from './card-view-textitem.component';
|
||||||
import { setupTestBed } from '../../../testing/setup-test-bed';
|
import { setupTestBed } from '../../../testing/setup-test-bed';
|
||||||
import { CoreTestingModule } from '../../../testing/core.testing.module';
|
import { CoreTestingModule } from '../../../testing/core.testing.module';
|
||||||
import { CardViewItemFloatValidator, CardViewItemIntValidator, CardViewIntItemModel, CardViewFloatItemModel } from '@alfresco/adf-core';
|
import { CardViewItemFloatValidator } from '../../validators/card-view-item-float.validator';
|
||||||
|
import { CardViewItemIntValidator } from '../../validators/card-view-item-int.validator';
|
||||||
|
import { CardViewIntItemModel } from '../../models/card-view-intitem.model';
|
||||||
|
import { CardViewFloatItemModel } from '../../models/card-view-floatitem.model';
|
||||||
import { MatChipsModule } from '@angular/material/chips';
|
import { MatChipsModule } from '@angular/material/chips';
|
||||||
import { ClipboardService } from '../../../clipboard/clipboard.service';
|
import { ClipboardService } from '../../../clipboard/clipboard.service';
|
||||||
import { DebugElement, SimpleChange } from '@angular/core';
|
import { DebugElement, SimpleChange } from '@angular/core';
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
import { DateCellComponent } from '../date-cell/date-cell.component';
|
import { DateCellComponent } from '../date-cell/date-cell.component';
|
||||||
import { Subject } from 'rxjs';
|
import { Subject } from 'rxjs';
|
||||||
import { AppConfigService } from '@alfresco/adf-core';
|
import { AppConfigService } from '../../../app-config/app-config.service';
|
||||||
import { Node } from '@alfresco/js-api';
|
import { Node } from '@alfresco/js-api';
|
||||||
import { TestBed } from '@angular/core/testing';
|
import { TestBed } from '@angular/core/testing';
|
||||||
import { CoreTestingModule } from '../../../testing';
|
import { CoreTestingModule } from '../../../testing';
|
||||||
|
@ -20,7 +20,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
import { of, throwError } from 'rxjs';
|
import { of, throwError } from 'rxjs';
|
||||||
import { AuthenticationService } from '../services';
|
import { AuthenticationService } from '../services';
|
||||||
import { AppConfigService } from '../app-config';
|
import { AppConfigService } from '../app-config/app-config.service';
|
||||||
import { setupTestBed } from '../testing/setup-test-bed';
|
import { setupTestBed } from '../testing/setup-test-bed';
|
||||||
import { LogoutDirective } from './logout.directive';
|
import { LogoutDirective } from './logout.directive';
|
||||||
import { CoreTestingModule } from '../testing/core.testing.module';
|
import { CoreTestingModule } from '../testing/core.testing.module';
|
||||||
|
@ -22,7 +22,7 @@ import { TestBed, ComponentFixture } from '@angular/core/testing';
|
|||||||
import { setupTestBed } from '../testing/setup-test-bed';
|
import { setupTestBed } from '../testing/setup-test-bed';
|
||||||
import { CoreTestingModule } from '../testing/core.testing.module';
|
import { CoreTestingModule } from '../testing/core.testing.module';
|
||||||
import { VersionCompatibilityService } from '../services/version-compatibility.service';
|
import { VersionCompatibilityService } from '../services/version-compatibility.service';
|
||||||
import { VersionModel } from '../models/product-version.model';
|
import { VersionInfo } from '@alfresco/js-api';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
template: `
|
template: `
|
||||||
@ -52,7 +52,7 @@ describe('VersionCompatibilityDirective', () => {
|
|||||||
let fixture: ComponentFixture<TestComponent>;
|
let fixture: ComponentFixture<TestComponent>;
|
||||||
let versionCompatibilityService: VersionCompatibilityService;
|
let versionCompatibilityService: VersionCompatibilityService;
|
||||||
|
|
||||||
const acsResponceMock = new VersionModel({
|
const acsResponceMock = new VersionInfo({
|
||||||
display: '7.0.1',
|
display: '7.0.1',
|
||||||
major: '7',
|
major: '7',
|
||||||
minor: '0',
|
minor: '0',
|
||||||
|
@ -493,14 +493,17 @@
|
|||||||
"VERSION": "Version",
|
"VERSION": "Version",
|
||||||
"SERVER_SETTINGS": {
|
"SERVER_SETTINGS": {
|
||||||
"TITLE": "Server settings",
|
"TITLE": "Server settings",
|
||||||
"DESCRIPTION": "The values below are taken from the AppConfigService",
|
|
||||||
"CONTENT_SERVICE_HOST": "Alfresco Content Services URL: {{ value }}",
|
"CONTENT_SERVICE_HOST": "Alfresco Content Services URL: {{ value }}",
|
||||||
"PROCESS_SERVICE_HOST": "Alfresco Process Services URL: {{ value }}"
|
"PROCESS_SERVICE_HOST": "Alfresco Process Services URL: {{ value }}"
|
||||||
},
|
},
|
||||||
"VERSIONS": {
|
"VERSIONS": {
|
||||||
"TITLE": "Product Versions",
|
"TITLE": "Product Versions",
|
||||||
"CONTENT_SERVICE": "ECM",
|
"CONTENT_SERVICE": "Content Services",
|
||||||
"PROCESS_SERVICE": "BPM",
|
"PROCESS_SERVICE": "Process Services",
|
||||||
|
"MODELING_SERVICE": "Modeling Services",
|
||||||
|
"DEPLOYMENT_SERVICE": "Deployment Services",
|
||||||
|
"QUERY_SERVICE": "Deployment Services",
|
||||||
|
"RB": "Runtime",
|
||||||
"LABELS": {
|
"LABELS": {
|
||||||
"EDITION": "Edition",
|
"EDITION": "Edition",
|
||||||
"VERSION": "Version",
|
"VERSION": "Version",
|
||||||
@ -515,33 +518,8 @@
|
|||||||
},
|
},
|
||||||
"PACKAGES": {
|
"PACKAGES": {
|
||||||
"TITLE": "Packages",
|
"TITLE": "Packages",
|
||||||
"DESCRIPTION": "Current project is using the following ADF libraries:"
|
"NAME": "Name",
|
||||||
},
|
"VERSION": "Version"
|
||||||
"TABLE_HEADERS": {
|
|
||||||
"MODULES": {
|
|
||||||
"ID": "ID",
|
|
||||||
"TITLE": "Title",
|
|
||||||
"DESCRIPTION": "Description",
|
|
||||||
"INSTALL_DATE": "Install Date",
|
|
||||||
"INSTALL_STATE": "Install State",
|
|
||||||
"VERSION_MIN": "Version Minor",
|
|
||||||
"VERSION_MAX": "Version Max"
|
|
||||||
},
|
|
||||||
"STATUS": {
|
|
||||||
"READ_ONLY": "ReadOnly",
|
|
||||||
"AUDIT_ENABLED": "Is Audit Enabled",
|
|
||||||
"QUICK_SHARE_ENABLED": "Is Quick Shared Enabled",
|
|
||||||
"THUMBNAIL_ENABLED": "Thumbnail Generation"
|
|
||||||
},
|
|
||||||
"LICENSE": {
|
|
||||||
"ISSUES_AT": "Issued At",
|
|
||||||
"EXPIRES_AT": "Expires At",
|
|
||||||
"REMAINING_DAYS": "Remaining Days",
|
|
||||||
"HOLDER": "Holder",
|
|
||||||
"MODE": "Mode",
|
|
||||||
"CLUSTER_ENABLED": "Is Cluster Enabled",
|
|
||||||
"CRYPTODOC_ENABLED": "Is Cryptodoc Enabled"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"EXTENSIONS": {
|
"EXTENSIONS": {
|
||||||
"TITLE": "Plugins",
|
"TITLE": "Plugins",
|
||||||
@ -554,6 +532,26 @@
|
|||||||
"RUNTIME": "Runtime",
|
"RUNTIME": "Runtime",
|
||||||
"DESCRIPTION": "Description"
|
"DESCRIPTION": "Description"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"LICENSE": {
|
||||||
|
"TITLE": "License",
|
||||||
|
"PROPERTY": "Property",
|
||||||
|
"VALUE": "Value"
|
||||||
|
},
|
||||||
|
"STATUS": {
|
||||||
|
"TITLE": "Status",
|
||||||
|
"PROPERTY": "Property",
|
||||||
|
"VALUE": "Value"
|
||||||
|
},
|
||||||
|
"MODULES": {
|
||||||
|
"TITLE": "Modules",
|
||||||
|
"NAME": "Name",
|
||||||
|
"VERSION": "Version"
|
||||||
|
},
|
||||||
|
"PLUGINS": {
|
||||||
|
"TITLE": "Plugins",
|
||||||
|
"NAME": "Name",
|
||||||
|
"VERSION": "Version"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"CLIPBOARD": {
|
"CLIPBOARD": {
|
||||||
|
@ -31,7 +31,7 @@ import { UserPreferencesService } from '../../../services/user-preferences.servi
|
|||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import { Direction } from '@angular/cdk/bidi';
|
import { Direction } from '@angular/cdk/bidi';
|
||||||
import { of } from 'rxjs';
|
import { of } from 'rxjs';
|
||||||
import { setupTestBed } from '@alfresco/adf-core';
|
import { setupTestBed } from '../../../testing/setup-test-bed';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'adf-layout-container',
|
selector: 'adf-layout-container',
|
||||||
|
@ -18,14 +18,21 @@
|
|||||||
import { Observable, of, throwError } from 'rxjs';
|
import { Observable, of, throwError } from 'rxjs';
|
||||||
import { RedirectionModel } from '../models/redirection.model';
|
import { RedirectionModel } from '../models/redirection.model';
|
||||||
|
|
||||||
// TODO: should be extending AuthenticationService
|
export class AuthenticationMock {
|
||||||
export class AuthenticationMock /*extends AuthenticationService*/ {
|
|
||||||
private redirectUrl: RedirectionModel = null;
|
private redirectUrl: RedirectionModel = null;
|
||||||
|
|
||||||
setRedirectUrl(url: RedirectionModel) {
|
setRedirectUrl(url: RedirectionModel) {
|
||||||
this.redirectUrl = url;
|
this.redirectUrl = url;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
isEcmLoggedIn(): boolean {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
isBpmLoggedIn(): boolean {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
getRedirectUrl(): string | null {
|
getRedirectUrl(): string | null {
|
||||||
return this.redirectUrl ? this.redirectUrl.url : null;
|
return this.redirectUrl ? this.redirectUrl.url : null;
|
||||||
}
|
}
|
||||||
@ -50,7 +57,10 @@ export class AuthenticationMock /*extends AuthenticationService*/ {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (username === 'fake-username-ECM-access-error' && password === 'fake-password') {
|
if (username === 'fake-username-ECM-access-error' && password === 'fake-password') {
|
||||||
return throwError({message: 'ERROR: 00170728 Access Denied. The system is currently in read-only mode', status: 403});
|
return throwError({
|
||||||
|
message: 'ERROR: 00170728 Access Denied. The system is currently in read-only mode',
|
||||||
|
status: 403
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return throwError('Fake server error');
|
return throwError('Fake server error');
|
||||||
|
117
lib/core/mock/discovery-api.service.mock.ts
Normal file
117
lib/core/mock/discovery-api.service.mock.ts
Normal file
@ -0,0 +1,117 @@
|
|||||||
|
/*!
|
||||||
|
* @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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* tslint:disable */
|
||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { Observable, Subject, of } from 'rxjs';
|
||||||
|
import { BpmProductVersionModel } from '../models/product-version.model';
|
||||||
|
import {
|
||||||
|
RepositoryInfo,
|
||||||
|
SystemPropertiesRepresentation
|
||||||
|
} from '@alfresco/js-api';
|
||||||
|
|
||||||
|
@Injectable({
|
||||||
|
providedIn: 'root'
|
||||||
|
})
|
||||||
|
export class DiscoveryApiServiceMock {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets product information for Content Services.
|
||||||
|
*/
|
||||||
|
ecmProductInfo$ = new Subject<RepositoryInfo>();
|
||||||
|
|
||||||
|
public getEcmProductInfo(): Observable<RepositoryInfo | any> {
|
||||||
|
return of({
|
||||||
|
edition: 'Enterprise',
|
||||||
|
version: {
|
||||||
|
major: '7',
|
||||||
|
minor: '2',
|
||||||
|
patch: '0',
|
||||||
|
hotfix: '0',
|
||||||
|
schema: 16000,
|
||||||
|
label: 'rde8705d0-blocal',
|
||||||
|
display: '7.2.0.0 (rde8705d0-blocal) schema 16000'
|
||||||
|
},
|
||||||
|
license: {
|
||||||
|
issuedAt: '2021-11-10T23:30:30.234+0000',
|
||||||
|
expiresAt: '2021-11-12T00:00:00.000+0000',
|
||||||
|
remainingDays: 1,
|
||||||
|
holder: 'Trial User',
|
||||||
|
mode: 'ENTERPRISE',
|
||||||
|
entitlements: { isClusterEnabled: true, isCryptodocEnabled: false }
|
||||||
|
},
|
||||||
|
status: {
|
||||||
|
isReadOnly: false,
|
||||||
|
isAuditEnabled: true,
|
||||||
|
isQuickShareEnabled: true,
|
||||||
|
isThumbnailGenerationEnabled: true,
|
||||||
|
isDirectAccessUrlEnabled: true
|
||||||
|
},
|
||||||
|
modules: [{
|
||||||
|
id: 'org_alfresco_module_rm',
|
||||||
|
title: 'AGS Repo',
|
||||||
|
description: 'Alfresco Governance Services Repository Extension',
|
||||||
|
version: '14.26',
|
||||||
|
installState: 'UNKNOWN',
|
||||||
|
versionMin: '7.0.0',
|
||||||
|
versionMax: '999'
|
||||||
|
}, {
|
||||||
|
id: 'org_alfresco_integrations_S3Connector',
|
||||||
|
title: 'S3 Connector',
|
||||||
|
description: 'Provides Amazon S3 content storage for the contentstore and deleted contentstore',
|
||||||
|
version: '5.0.0-A1',
|
||||||
|
installDate: '2021-11-10T23:29:19.560+0000',
|
||||||
|
installState: 'INSTALLED',
|
||||||
|
versionMin: '7.2',
|
||||||
|
versionMax: '999'
|
||||||
|
}, {
|
||||||
|
id: 'alfresco-trashcan-cleaner',
|
||||||
|
title: 'alfresco-trashcan-cleaner project',
|
||||||
|
description: 'The Alfresco Trashcan Cleaner (Alfresco Module)',
|
||||||
|
version: '2.4.1',
|
||||||
|
installState: 'UNKNOWN',
|
||||||
|
versionMin: '0',
|
||||||
|
versionMax: '999'
|
||||||
|
}, {
|
||||||
|
id: 'alfresco-content-connector-for-salesforce-repo',
|
||||||
|
title: 'Alfresco Content Connector for Salesforce Repository AMP',
|
||||||
|
description: 'Alfresco Repository artifacts needed for the Alfresco Content Connector for Salesforce Repository Amp',
|
||||||
|
version: '2.3.0.3',
|
||||||
|
installDate: '2021-11-10T23:29:18.918+0000',
|
||||||
|
installState: 'INSTALLED',
|
||||||
|
versionMin: '6.2.0',
|
||||||
|
versionMax: '999'
|
||||||
|
}]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public getBpmProductInfo(): Observable<BpmProductVersionModel> {
|
||||||
|
return of({
|
||||||
|
revisionVersion: '0-RC1',
|
||||||
|
edition: 'Alfresco Process Services (powered by Activiti)',
|
||||||
|
type: 'bpmSuite',
|
||||||
|
majorVersion: '2',
|
||||||
|
minorVersion: '1'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public getBPMSystemProperties(): Observable<SystemPropertiesRepresentation> {
|
||||||
|
return of({});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* tslint:enable */
|
@ -32,110 +32,3 @@ export class BpmProductVersionModel {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class VersionModel {
|
|
||||||
major: string;
|
|
||||||
minor: string;
|
|
||||||
patch: string;
|
|
||||||
hotfix: string;
|
|
||||||
schema: number;
|
|
||||||
label: string;
|
|
||||||
display: string;
|
|
||||||
|
|
||||||
constructor(obj?: any) {
|
|
||||||
if (obj) {
|
|
||||||
this.major = obj.major || null;
|
|
||||||
this.minor = obj.minor || null;
|
|
||||||
this.patch = obj.patch || null;
|
|
||||||
this.hotfix = obj.hotfix || null;
|
|
||||||
this.schema = obj.schema || null;
|
|
||||||
this.label = obj.label || null;
|
|
||||||
this.display = obj.display || null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export class LicenseModel {
|
|
||||||
issuedAt: string;
|
|
||||||
expiresAt: string;
|
|
||||||
remainingDays: number;
|
|
||||||
holder: string;
|
|
||||||
mode: string;
|
|
||||||
isClusterEnabled: boolean;
|
|
||||||
isCryptodocEnabled: boolean;
|
|
||||||
|
|
||||||
constructor(obj?: any) {
|
|
||||||
if (obj) {
|
|
||||||
this.issuedAt = obj.issuedAt || null;
|
|
||||||
this.expiresAt = obj.expiresAt || null;
|
|
||||||
this.remainingDays = obj.remainingDays || null;
|
|
||||||
this.holder = obj.holder || null;
|
|
||||||
this.mode = obj.mode || null;
|
|
||||||
this.isClusterEnabled = !!obj.isClusterEnabled;
|
|
||||||
this.isCryptodocEnabled = !!obj.isCryptodocEnabled;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export class VersionStatusModel {
|
|
||||||
isReadOnly: boolean;
|
|
||||||
isAuditEnabled: boolean;
|
|
||||||
isQuickShareEnabled: boolean;
|
|
||||||
isThumbnailGenerationEnabled: boolean;
|
|
||||||
|
|
||||||
constructor(obj?: any) {
|
|
||||||
if (obj) {
|
|
||||||
this.isReadOnly = !!obj.isReadOnly;
|
|
||||||
this.isAuditEnabled = !!obj.isAuditEnabled;
|
|
||||||
this.isQuickShareEnabled = !!obj.isQuickShareEnabled;
|
|
||||||
this.isThumbnailGenerationEnabled = !!obj.isThumbnailGenerationEnabled;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export class VersionModuleModel {
|
|
||||||
id: string;
|
|
||||||
title: string;
|
|
||||||
description: string;
|
|
||||||
version: string;
|
|
||||||
installDate: string;
|
|
||||||
installState: string;
|
|
||||||
versionMin: string;
|
|
||||||
versionMax: string;
|
|
||||||
|
|
||||||
constructor(obj?: any) {
|
|
||||||
if (obj) {
|
|
||||||
this.id = obj.id || null;
|
|
||||||
this.title = obj.title || null;
|
|
||||||
this.description = obj.description || null;
|
|
||||||
this.version = obj.version || null;
|
|
||||||
this.installDate = obj.installDate || null;
|
|
||||||
this.installState = obj.installState || null;
|
|
||||||
this.versionMin = obj.versionMin || null;
|
|
||||||
this.versionMax = obj.versionMax || null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export class EcmProductVersionModel {
|
|
||||||
edition: string;
|
|
||||||
version: VersionModel;
|
|
||||||
license: LicenseModel;
|
|
||||||
status: VersionStatusModel;
|
|
||||||
modules: VersionModuleModel[] = [];
|
|
||||||
|
|
||||||
constructor(obj?: any) {
|
|
||||||
if (obj && obj.entry && obj.entry.repository) {
|
|
||||||
this.edition = obj.entry.repository.edition || null;
|
|
||||||
this.version = new VersionModel(obj.entry.repository.version);
|
|
||||||
this.license = new LicenseModel(obj.entry.repository.license);
|
|
||||||
this.status = new VersionStatusModel(obj.entry.repository.status);
|
|
||||||
if (obj.entry.repository.modules) {
|
|
||||||
obj.entry.repository.modules.forEach((module) => {
|
|
||||||
this.modules.push(new VersionModuleModel(module));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
@ -17,10 +17,11 @@
|
|||||||
|
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { from, Observable, throwError, Subject } from 'rxjs';
|
import { from, Observable, throwError, Subject } from 'rxjs';
|
||||||
import { BpmProductVersionModel, EcmProductVersionModel } from '../models/product-version.model';
|
|
||||||
import { AlfrescoApiService } from './alfresco-api.service';
|
|
||||||
import { catchError, map, switchMap, filter, take } from 'rxjs/operators';
|
import { catchError, map, switchMap, filter, take } from 'rxjs/operators';
|
||||||
import { AboutApi, DiscoveryApi, SystemPropertiesApi, SystemPropertiesRepresentation } from '@alfresco/js-api';
|
import { AboutApi, DiscoveryApi, RepositoryInfo, SystemPropertiesApi, SystemPropertiesRepresentation } from '@alfresco/js-api';
|
||||||
|
|
||||||
|
import { BpmProductVersionModel } from '../models/product-version.model';
|
||||||
|
import { AlfrescoApiService } from './alfresco-api.service';
|
||||||
import { AuthenticationService } from './authentication.service';
|
import { AuthenticationService } from './authentication.service';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
@ -31,7 +32,7 @@ export class DiscoveryApiService {
|
|||||||
/**
|
/**
|
||||||
* Gets product information for Content Services.
|
* Gets product information for Content Services.
|
||||||
*/
|
*/
|
||||||
ecmProductInfo$ = new Subject<EcmProductVersionModel>();
|
ecmProductInfo$ = new Subject<RepositoryInfo>();
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private apiService: AlfrescoApiService,
|
private apiService: AlfrescoApiService,
|
||||||
@ -50,12 +51,12 @@ export class DiscoveryApiService {
|
|||||||
* Gets product information for Content Services.
|
* Gets product information for Content Services.
|
||||||
* @returns ProductVersionModel containing product details
|
* @returns ProductVersionModel containing product details
|
||||||
*/
|
*/
|
||||||
public getEcmProductInfo(): Observable<EcmProductVersionModel> {
|
public getEcmProductInfo(): Observable<RepositoryInfo> {
|
||||||
const discoveryApi = new DiscoveryApi(this.apiService.getInstance());
|
const discoveryApi = new DiscoveryApi(this.apiService.getInstance());
|
||||||
|
|
||||||
return from(discoveryApi.getRepositoryInformation())
|
return from(discoveryApi.getRepositoryInformation())
|
||||||
.pipe(
|
.pipe(
|
||||||
map((res) => new EcmProductVersionModel(res)),
|
map((res) => res.entry.repository),
|
||||||
catchError((err) => throwError(err))
|
catchError((err) => throwError(err))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,11 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { fakeAsync, TestBed } from '@angular/core/testing';
|
import { fakeAsync, TestBed } from '@angular/core/testing';
|
||||||
import { setupTestBed, AlfrescoApiService, IdentityGroupService, IdentityGroupSearchParam } from '@alfresco/adf-core';
|
import { setupTestBed } from '../testing/setup-test-bed';
|
||||||
|
import { AlfrescoApiService } from './alfresco-api.service';
|
||||||
|
import { IdentityGroupService } from './identity-group.service';
|
||||||
|
import { IdentityGroupSearchParam } from '../models/identity-group.model';
|
||||||
|
|
||||||
import { HttpErrorResponse } from '@angular/common/http';
|
import { HttpErrorResponse } from '@angular/common/http';
|
||||||
import { throwError, of } from 'rxjs';
|
import { throwError, of } from 'rxjs';
|
||||||
import {
|
import {
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { setupTestBed } from '@alfresco/adf-core';
|
import { setupTestBed } from '../testing/setup-test-bed';
|
||||||
import { HttpClientModule, HttpErrorResponse, HttpResponse } from '@angular/common/http';
|
import { HttpClientModule, HttpErrorResponse, HttpResponse } from '@angular/common/http';
|
||||||
import { TestBed } from '@angular/core/testing';
|
import { TestBed } from '@angular/core/testing';
|
||||||
import { of, throwError } from 'rxjs';
|
import { of, throwError } from 'rxjs';
|
||||||
|
@ -24,11 +24,10 @@ import { AppConfigService } from '../app-config/app-config.service';
|
|||||||
|
|
||||||
import { setupTestBed } from '../testing/setup-test-bed';
|
import { setupTestBed } from '../testing/setup-test-bed';
|
||||||
import { CoreTestingModule } from '../testing/core.testing.module';
|
import { CoreTestingModule } from '../testing/core.testing.module';
|
||||||
import { AssocChildBody, AssociationBody } from '@alfresco/js-api';
|
import { AssocChildBody, AssociationBody, RepositoryInfo } from '@alfresco/js-api';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
import { DiscoveryApiService } from './discovery-api.service';
|
import { DiscoveryApiService } from './discovery-api.service';
|
||||||
import { BehaviorSubject } from 'rxjs';
|
import { BehaviorSubject } from 'rxjs';
|
||||||
import { EcmProductVersionModel } from '../models';
|
|
||||||
|
|
||||||
declare let jasmine: any;
|
declare let jasmine: any;
|
||||||
|
|
||||||
@ -37,7 +36,7 @@ describe('UploadService', () => {
|
|||||||
let appConfigService: AppConfigService;
|
let appConfigService: AppConfigService;
|
||||||
let uploadFileSpy: jasmine.Spy;
|
let uploadFileSpy: jasmine.Spy;
|
||||||
|
|
||||||
const mockProductInfo = new BehaviorSubject<EcmProductVersionModel>(null);
|
const mockProductInfo = new BehaviorSubject<RepositoryInfo>(null);
|
||||||
|
|
||||||
setupTestBed({
|
setupTestBed({
|
||||||
imports: [
|
imports: [
|
||||||
@ -82,7 +81,7 @@ describe('UploadService', () => {
|
|||||||
uploadFileSpy = spyOn(service.uploadApi, 'uploadFile').and.callThrough();
|
uploadFileSpy = spyOn(service.uploadApi, 'uploadFile').and.callThrough();
|
||||||
|
|
||||||
jasmine.Ajax.install();
|
jasmine.Ajax.install();
|
||||||
mockProductInfo.next({ status: { isThumbnailGenerationEnabled: true } } as EcmProductVersionModel);
|
mockProductInfo.next({ status: { isThumbnailGenerationEnabled: true } } as RepositoryInfo);
|
||||||
});
|
});
|
||||||
|
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
@ -539,7 +538,7 @@ describe('UploadService', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('Should not pass rendition if it is disabled', () => {
|
it('Should not pass rendition if it is disabled', () => {
|
||||||
mockProductInfo.next({ status: { isThumbnailGenerationEnabled: false } } as EcmProductVersionModel);
|
mockProductInfo.next({ status: { isThumbnailGenerationEnabled: false } } as RepositoryInfo);
|
||||||
|
|
||||||
const filesFake = new FileModel(
|
const filesFake = new FileModel(
|
||||||
<File> { name: 'fake-name', size: 10 },
|
<File> { name: 'fake-name', size: 10 },
|
||||||
|
@ -22,12 +22,12 @@ import { CoreTestingModule } from '../testing/core.testing.module';
|
|||||||
import { VersionCompatibilityService } from './version-compatibility.service';
|
import { VersionCompatibilityService } from './version-compatibility.service';
|
||||||
import { BehaviorSubject } from 'rxjs';
|
import { BehaviorSubject } from 'rxjs';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
import { EcmProductVersionModel } from './../models/product-version.model';
|
import { RepositoryInfo } from '@alfresco/js-api';
|
||||||
|
|
||||||
describe('VersionCompatibilityService', () => {
|
describe('VersionCompatibilityService', () => {
|
||||||
let versionCompatibilityService: VersionCompatibilityService;
|
let versionCompatibilityService: VersionCompatibilityService;
|
||||||
let discoveryApiService: DiscoveryApiService;
|
let discoveryApiService: DiscoveryApiService;
|
||||||
const mockProductInfo = new BehaviorSubject<EcmProductVersionModel>(null);
|
const mockProductInfo = new BehaviorSubject<RepositoryInfo>(null);
|
||||||
|
|
||||||
const acsResponceMock = {
|
const acsResponceMock = {
|
||||||
version: {
|
version: {
|
||||||
@ -56,7 +56,7 @@ describe('VersionCompatibilityService', () => {
|
|||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
discoveryApiService = TestBed.inject(DiscoveryApiService);
|
discoveryApiService = TestBed.inject(DiscoveryApiService);
|
||||||
versionCompatibilityService = TestBed.inject(VersionCompatibilityService);
|
versionCompatibilityService = TestBed.inject(VersionCompatibilityService);
|
||||||
mockProductInfo.next(acsResponceMock as EcmProductVersionModel);
|
mockProductInfo.next(acsResponceMock as RepositoryInfo);
|
||||||
versionCompatibilityService = new VersionCompatibilityService(discoveryApiService);
|
versionCompatibilityService = new VersionCompatibilityService(discoveryApiService);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -16,31 +16,31 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { DiscoveryApiService } from './discovery-api.service';
|
|
||||||
import { VersionModel, EcmProductVersionModel } from '../models/product-version.model';
|
|
||||||
import { filter } from 'rxjs/operators';
|
import { filter } from 'rxjs/operators';
|
||||||
import { ReplaySubject } from 'rxjs';
|
import { ReplaySubject } from 'rxjs';
|
||||||
|
import { VersionInfo, RepositoryInfo } from '@alfresco/js-api';
|
||||||
|
import { DiscoveryApiService } from './discovery-api.service';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
})
|
})
|
||||||
export class VersionCompatibilityService {
|
export class VersionCompatibilityService {
|
||||||
private acsVersion: VersionModel;
|
private acsVersion: VersionInfo;
|
||||||
|
|
||||||
acsVersionInitialized$ = new ReplaySubject();
|
acsVersionInitialized$ = new ReplaySubject();
|
||||||
|
|
||||||
constructor(private discoveryApiService: DiscoveryApiService) {
|
constructor(private discoveryApiService: DiscoveryApiService) {
|
||||||
this.discoveryApiService.ecmProductInfo$
|
this.discoveryApiService.ecmProductInfo$
|
||||||
.pipe(filter(acsInfo => !!acsInfo))
|
.pipe(filter(acsInfo => !!acsInfo))
|
||||||
.subscribe((acsInfo: EcmProductVersionModel) => this.initializeAcsVersion(acsInfo.version));
|
.subscribe((acsInfo: RepositoryInfo) => this.initializeAcsVersion(acsInfo.version));
|
||||||
}
|
}
|
||||||
|
|
||||||
private initializeAcsVersion(acsVersion: VersionModel) {
|
private initializeAcsVersion(acsVersion: VersionInfo) {
|
||||||
this.acsVersion = acsVersion;
|
this.acsVersion = acsVersion;
|
||||||
this.acsVersionInitialized$.next();
|
this.acsVersionInitialized$.next();
|
||||||
}
|
}
|
||||||
|
|
||||||
getAcsVersion(): VersionModel {
|
getAcsVersion(): VersionInfo {
|
||||||
return this.acsVersion;
|
return this.acsVersion;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -66,7 +66,7 @@ export class VersionCompatibilityService {
|
|||||||
return versionSupported;
|
return versionSupported;
|
||||||
}
|
}
|
||||||
|
|
||||||
private parseVersion(version: string): VersionModel {
|
private parseVersion(version: string): VersionInfo {
|
||||||
const major = version.split('.')[0];
|
const major = version.split('.')[0];
|
||||||
const minor = version.split('.')[1] || '0';
|
const minor = version.split('.')[1] || '0';
|
||||||
const patch = version.split('.')[2] || '0';
|
const patch = version.split('.')[2] || '0';
|
||||||
@ -75,6 +75,6 @@ export class VersionCompatibilityService {
|
|||||||
major: major,
|
major: major,
|
||||||
minor: minor,
|
minor: minor,
|
||||||
patch: patch
|
patch: patch
|
||||||
} as VersionModel;
|
} as VersionInfo;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
import { By } from '@angular/platform-browser';
|
import { By } from '@angular/platform-browser';
|
||||||
import { setupTestBed } from '@alfresco/adf-core';
|
import { setupTestBed } from '../../testing/setup-test-bed';
|
||||||
import { TranslateService, TranslateModule } from '@ngx-translate/core';
|
import { TranslateService, TranslateModule } from '@ngx-translate/core';
|
||||||
import { of } from 'rxjs';
|
import { of } from 'rxjs';
|
||||||
import { CoreTestingModule } from '../../testing/core.testing.module';
|
import { CoreTestingModule } from '../../testing/core.testing.module';
|
||||||
|
@ -19,12 +19,23 @@ import { NgModule } from '@angular/core';
|
|||||||
import { CoreModule } from '../core.module';
|
import { CoreModule } from '../core.module';
|
||||||
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
|
import { TRANSLATION_PROVIDER } from '../services/translation.service';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
TranslateModule.forRoot(),
|
TranslateModule.forRoot(),
|
||||||
CoreModule.forRoot(),
|
CoreModule.forRoot(),
|
||||||
BrowserAnimationsModule
|
BrowserAnimationsModule
|
||||||
|
],
|
||||||
|
providers: [
|
||||||
|
{
|
||||||
|
provide: TRANSLATION_PROVIDER,
|
||||||
|
multi: true,
|
||||||
|
useValue: {
|
||||||
|
name: 'adf-core',
|
||||||
|
source: 'assets/adf-core'
|
||||||
|
}
|
||||||
|
}
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
export class CoreStoryModule { }
|
export class CoreStoryModule { }
|
||||||
|
@ -20,7 +20,7 @@ import { ComponentFixture, fakeAsync, TestBed, tick } from '@angular/core/testin
|
|||||||
import { ContentService } from '../../services/content.service';
|
import { ContentService } from '../../services/content.service';
|
||||||
import { ImgViewerComponent } from './img-viewer.component';
|
import { ImgViewerComponent } from './img-viewer.component';
|
||||||
import { setupTestBed, CoreTestingModule } from '../../testing';
|
import { setupTestBed, CoreTestingModule } from '../../testing';
|
||||||
import { AppConfigService } from '@alfresco/adf-core';
|
import { AppConfigService } from '../../app-config/app-config.service';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
import { By } from '@angular/platform-browser';
|
import { By } from '@angular/platform-browser';
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ import { MatDialog } from '@angular/material/dialog';
|
|||||||
import { of } from 'rxjs';
|
import { of } from 'rxjs';
|
||||||
import { setupTestBed } from '../../testing/setup-test-bed';
|
import { setupTestBed } from '../../testing/setup-test-bed';
|
||||||
import { take } from 'rxjs/operators';
|
import { take } from 'rxjs/operators';
|
||||||
import { AppConfigService } from '@alfresco/adf-core';
|
import { AppConfigService } from '../../app-config/app-config.service';
|
||||||
import { CoreTestingModule } from '../../testing/core.testing.module';
|
import { CoreTestingModule } from '../../testing/core.testing.module';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
|
|
||||||
|
39
lib/extensions/src/lib/mock/app-extension.service.mock.ts
Normal file
39
lib/extensions/src/lib/mock/app-extension.service.mock.ts
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
/*!
|
||||||
|
* @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 { ExtensionRef } from '../config/extension.config';
|
||||||
|
import { Observable, BehaviorSubject } from 'rxjs';
|
||||||
|
import { ViewerExtensionRef } from '../config/viewer.extensions';
|
||||||
|
|
||||||
|
@Injectable({
|
||||||
|
providedIn: 'root'
|
||||||
|
})
|
||||||
|
export class AppExtensionServiceMock {
|
||||||
|
private _references = new BehaviorSubject<ExtensionRef[]>([]);
|
||||||
|
|
||||||
|
references$: Observable<ExtensionRef[]>;
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
this.references$ = this._references.asObservable();
|
||||||
|
}
|
||||||
|
|
||||||
|
getViewerExtensions(): ViewerExtensionRef[] {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
18
lib/extensions/src/lib/mock/public-api.ts
Normal file
18
lib/extensions/src/lib/mock/public-api.ts
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
/*!
|
||||||
|
* @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 './app-extension.service.mock';
|
@ -41,3 +41,5 @@ export * from './lib/store/states/repository.state';
|
|||||||
|
|
||||||
export * from './lib/components/public-api';
|
export * from './lib/components/public-api';
|
||||||
export * from './lib/extensions.module';
|
export * from './lib/extensions.module';
|
||||||
|
|
||||||
|
export * from './lib/mock/public-api';
|
||||||
|
@ -29,6 +29,7 @@ export * from './components/widgets/dropdown/dropdown-cloud.widget';
|
|||||||
export * from './components/widgets/group/group-cloud.widget';
|
export * from './components/widgets/group/group-cloud.widget';
|
||||||
export * from './components/widgets/people/people-cloud.widget';
|
export * from './components/widgets/people/people-cloud.widget';
|
||||||
export * from './components/widgets/properties-viewer/properties-viewer.widget';
|
export * from './components/widgets/properties-viewer/properties-viewer.widget';
|
||||||
|
export * from './components/widgets/radio-buttons/radio-buttons-cloud.widget';
|
||||||
|
|
||||||
export * from './services/content-cloud-node-selector.service';
|
export * from './services/content-cloud-node-selector.service';
|
||||||
export * from './services/form-cloud.service';
|
export * from './services/form-cloud.service';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user