+
diff --git a/projects/aca-about/src/lib/about.component.scss b/projects/aca-about/src/lib/about.component.scss
index bcaae901e..caf329f4a 100644
--- a/projects/aca-about/src/lib/about.component.scss
+++ b/projects/aca-about/src/lib/about.component.scss
@@ -1,25 +1,4 @@
-.app-about {
- .main-content {
- padding: 10px;
-
- article {
- color: var(--theme-text-color);
- padding: 25px 0 25px 0;
-
- & > header {
- line-height: 24px;
- font-size: 14px;
- font-weight: 800;
- letter-spacing: -0.2px;
- }
- }
-
- article:first-of-type {
- padding-bottom: 0;
- }
-
- article:last-of-type {
- margin-bottom: 50px;
- }
- }
+adf-about {
+ padding: 10px;
+ width: 100%;
}
diff --git a/projects/aca-about/src/lib/about.component.ts b/projects/aca-about/src/lib/about.component.ts
index a29631c50..1b6ce0ed1 100644
--- a/projects/aca-about/src/lib/about.component.ts
+++ b/projects/aca-about/src/lib/about.component.ts
@@ -23,75 +23,21 @@
* along with Alfresco. If not, see .
*/
-import { ExtensionRef } from '@alfresco/adf-extensions';
-import { Component, OnInit, ViewEncapsulation } from '@angular/core';
-import { RepositoryInfo } from '@alfresco/js-api';
-import { Observable } from 'rxjs';
-import { map } from 'rxjs/operators';
-import { AppExtensionService, ContentApiService } from '@alfresco/aca-shared';
-import { dependencies, version, name, commit } from 'package.json';
+import { Component, Inject } from '@angular/core';
+import { DEV_MODE_TOKEN } from './dev-mode.tokens';
+import pkg from 'package.json';
@Component({
- selector: 'app-about',
+ selector: 'app-about-page',
templateUrl: './about.component.html',
- styleUrls: ['./about.component.scss'],
- encapsulation: ViewEncapsulation.None,
- host: { class: 'app-about' }
+ styleUrls: ['./about.component.scss']
})
-export class AboutComponent implements OnInit {
- repository: RepositoryInfo;
- extensions$: Observable;
- dependencyEntries: Array<{ name: string; version: string }>;
- statusEntries: Array<{ property: string; value: string }>;
- licenseEntries: Array<{ property: string; value: string }>;
- adfRepoUrl = 'https://github.com/Alfresco/alfresco-ng2-components/commits';
- appRepoUrl = !!commit ? `https://github.com/Alfresco/${name}/commits/${commit}` : null;
- adfVersion = '';
- appVersion = version;
+export class AboutComponent {
+ pkg: any;
+ dev = false;
- constructor(private contentApi: ContentApiService, appExtensions: AppExtensionService) {
- this.extensions$ = appExtensions.references$;
- }
-
- ngOnInit() {
- this.dependencyEntries = Object.keys(dependencies).map((key) => {
- if (key === '@alfresco/adf-core') {
- this.adfVersion = dependencies[key].split('-')[0];
- const adfCurrentCommit = dependencies[key].split('-')[1] || '';
-
- if (adfCurrentCommit) {
- this.adfRepoUrl = this.adfRepoUrl.concat('/', adfCurrentCommit);
- } else {
- this.adfRepoUrl = null;
- }
- }
- return {
- name: key,
- version: dependencies[key]
- };
- });
-
- this.contentApi
- .getRepositoryInformation()
- .pipe(map((node) => node.entry.repository))
- .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]
- };
- });
- }
- });
+ constructor(@Inject(DEV_MODE_TOKEN) devMode) {
+ this.dev = !devMode;
+ this.pkg = pkg;
}
}
diff --git a/projects/aca-about/src/lib/aca-about.module.ts b/projects/aca-about/src/lib/aca-about.module.ts
index a9c0d9ebe..4359cc050 100644
--- a/projects/aca-about/src/lib/aca-about.module.ts
+++ b/projects/aca-about/src/lib/aca-about.module.ts
@@ -23,23 +23,18 @@
* along with Alfresco. If not, see .
*/
-import { NgModule } from '@angular/core';
+import { ModuleWithProviders, NgModule } from '@angular/core';
import { AboutComponent } from './about.component';
import { CommonModule } from '@angular/common';
import { CoreModule } from '@alfresco/adf-core';
-import { MatTableModule } from '@angular/material/table';
import { SharedModule, PageLayoutModule } from '@alfresco/aca-shared';
-import { PackageListComponent } from './package-list/package-list.component';
-import { ExtensionListComponent } from './extension-list/extension-list.component';
-import { StatusListComponent } from './status-list/status-list.component';
-import { ModuleListComponent } from './module-list/module-list.component';
-import { LicenseListComponent } from './license-list/license-list.component';
import { ExtensionService, provideExtensionConfig } from '@alfresco/adf-extensions';
+import { DEV_MODE_TOKEN } from './dev-mode.tokens';
@NgModule({
- imports: [CommonModule, CoreModule.forChild(), MatTableModule, SharedModule, PageLayoutModule],
- declarations: [AboutComponent, PackageListComponent, ExtensionListComponent, StatusListComponent, ModuleListComponent, LicenseListComponent],
+ imports: [CommonModule, CoreModule.forChild(), SharedModule, PageLayoutModule],
+ declarations: [AboutComponent],
providers: [provideExtensionConfig(['about.plugin.json'])]
})
export class AcaAboutModule {
@@ -48,4 +43,11 @@ export class AcaAboutModule {
'app.about.component': AboutComponent
});
}
+
+ public static forRoot(devMode: any): ModuleWithProviders {
+ return {
+ ngModule: AcaAboutModule,
+ providers: [{ provide: DEV_MODE_TOKEN, useValue: devMode }]
+ };
+ }
}
diff --git a/projects/aca-about/src/lib/about.component.spec.ts b/projects/aca-about/src/lib/dev-mode.tokens.ts
similarity index 86%
rename from projects/aca-about/src/lib/about.component.spec.ts
rename to projects/aca-about/src/lib/dev-mode.tokens.ts
index 8b94a7361..46d6497bb 100644
--- a/projects/aca-about/src/lib/about.component.spec.ts
+++ b/projects/aca-about/src/lib/dev-mode.tokens.ts
@@ -23,10 +23,6 @@
* along with Alfresco. If not, see .
*/
-import { AboutComponent } from './about.component';
+import { InjectionToken } from '@angular/core';
-describe('AboutComponent', () => {
- it('should be defined', () => {
- expect(AboutComponent).toBeDefined();
- });
-});
+export const DEV_MODE_TOKEN = new InjectionToken('devMode');
diff --git a/projects/aca-about/src/lib/extension-list/extension-list.component.html b/projects/aca-about/src/lib/extension-list/extension-list.component.html
deleted file mode 100644
index f58a2cf6f..000000000
--- a/projects/aca-about/src/lib/extension-list/extension-list.component.html
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
- {{ column.header | translate }}
-
- {{ column.cell(row) }}
-
-
-
-
-
diff --git a/projects/aca-about/src/lib/extension-list/extension-list.component.ts b/projects/aca-about/src/lib/extension-list/extension-list.component.ts
deleted file mode 100644
index ae5643550..000000000
--- a/projects/aca-about/src/lib/extension-list/extension-list.component.ts
+++ /dev/null
@@ -1,73 +0,0 @@
-/*!
- * @license
- * Alfresco Example Content Application
- *
- * Copyright (C) 2005 - 2020 Alfresco Software Limited
- *
- * This file is part of the Alfresco Example Content Application.
- * If the software was purchased under a paid Alfresco license, the terms of
- * the paid license agreement will prevail. Otherwise, the software is
- * provided under the following open source license terms:
- *
- * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * The Alfresco Example Content Application is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-
-import { Component, ViewEncapsulation, ChangeDetectionStrategy, Input } from '@angular/core';
-import { ExtensionRef } from '@alfresco/adf-extensions';
-
-@Component({
- selector: 'app-extension-list',
- templateUrl: './extension-list.component.html',
- encapsulation: ViewEncapsulation.None,
- changeDetection: ChangeDetectionStrategy.OnPush
-})
-export class ExtensionListComponent {
- columns = [
- {
- columnDef: 'id',
- header: 'APP.ABOUT.PLUGINS.ID',
- cell: (row: ExtensionRef) => `${row.$id}`
- },
- {
- columnDef: 'name',
- header: 'APP.ABOUT.PLUGINS.NAME',
- cell: (row: ExtensionRef) => `${row.$name}`
- },
- {
- columnDef: 'version',
- header: 'APP.ABOUT.PLUGINS.VERSION',
- cell: (row: ExtensionRef) => `${row.$version}`
- },
- {
- columnDef: 'vendor',
- header: 'APP.ABOUT.PLUGINS.VENDOR',
- cell: (row: ExtensionRef) => `${row.$vendor}`
- },
- {
- columnDef: 'license',
- header: 'APP.ABOUT.PLUGINS.LICENSE',
- cell: (row: ExtensionRef) => `${row.$license}`
- },
- {
- columnDef: 'runtime',
- header: 'APP.ABOUT.PLUGINS.RUNTIME',
- cell: (row: ExtensionRef) => `${row.$runtime}`
- }
- ];
-
- displayedColumns = this.columns.map((x) => x.columnDef);
-
- @Input()
- data: Array = [];
-}
diff --git a/projects/aca-about/src/lib/license-list/license-list.component.html b/projects/aca-about/src/lib/license-list/license-list.component.html
deleted file mode 100644
index f58a2cf6f..000000000
--- a/projects/aca-about/src/lib/license-list/license-list.component.html
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
- {{ column.header | translate }}
-
- {{ column.cell(row) }}
-
-
-
-
-
diff --git a/projects/aca-about/src/lib/license-list/license-list.component.ts b/projects/aca-about/src/lib/license-list/license-list.component.ts
deleted file mode 100644
index 2f0721e16..000000000
--- a/projects/aca-about/src/lib/license-list/license-list.component.ts
+++ /dev/null
@@ -1,57 +0,0 @@
-/*!
- * @license
- * Alfresco Example Content Application
- *
- * Copyright (C) 2005 - 2020 Alfresco Software Limited
- *
- * This file is part of the Alfresco Example Content Application.
- * If the software was purchased under a paid Alfresco license, the terms of
- * the paid license agreement will prevail. Otherwise, the software is
- * provided under the following open source license terms:
- *
- * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * The Alfresco Example Content Application is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-
-export interface LicenseData {
- property: string;
- value: string;
-}
-
-import { Component, ViewEncapsulation, ChangeDetectionStrategy, Input } from '@angular/core';
-
-@Component({
- selector: 'app-license-list',
- templateUrl: './license-list.component.html',
- encapsulation: ViewEncapsulation.None,
- changeDetection: ChangeDetectionStrategy.OnPush
-})
-export class LicenseListComponent {
- columns = [
- {
- columnDef: 'property',
- header: 'APP.ABOUT.LICENSE.PROPERTY',
- cell: (row: LicenseData) => `${row.property}`
- },
- {
- columnDef: 'value',
- header: 'APP.ABOUT.LICENSE.VALUE',
- cell: (row: LicenseData) => `${row.value}`
- }
- ];
-
- displayedColumns = this.columns.map((x) => x.columnDef);
-
- @Input()
- data: Array = [];
-}
diff --git a/projects/aca-about/src/lib/module-list/module-list.component.html b/projects/aca-about/src/lib/module-list/module-list.component.html
deleted file mode 100644
index f58a2cf6f..000000000
--- a/projects/aca-about/src/lib/module-list/module-list.component.html
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
- {{ column.header | translate }}
-
- {{ column.cell(row) }}
-
-
-
-
-
diff --git a/projects/aca-about/src/lib/module-list/module-list.component.ts b/projects/aca-about/src/lib/module-list/module-list.component.ts
deleted file mode 100644
index 59a1636f3..000000000
--- a/projects/aca-about/src/lib/module-list/module-list.component.ts
+++ /dev/null
@@ -1,58 +0,0 @@
-/*!
- * @license
- * Alfresco Example Content Application
- *
- * Copyright (C) 2005 - 2020 Alfresco Software Limited
- *
- * This file is part of the Alfresco Example Content Application.
- * If the software was purchased under a paid Alfresco license, the terms of
- * the paid license agreement will prevail. Otherwise, the software is
- * provided under the following open source license terms:
- *
- * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * The Alfresco Example Content Application is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-
-import { Component, ViewEncapsulation, ChangeDetectionStrategy, Input } from '@angular/core';
-import { ModuleInfo } from '@alfresco/js-api';
-
-@Component({
- selector: 'app-module-list',
- templateUrl: './module-list.component.html',
- encapsulation: ViewEncapsulation.None,
- changeDetection: ChangeDetectionStrategy.OnPush
-})
-export class ModuleListComponent {
- columns = [
- {
- columnDef: 'id',
- header: 'APP.ABOUT.MODULES.ID',
- cell: (row: ModuleInfo) => `${row.id}`
- },
- {
- columnDef: 'title',
- header: 'APP.ABOUT.MODULES.NAME',
- cell: (row: ModuleInfo) => `${row.title}`
- },
- {
- columnDef: 'version',
- header: 'APP.ABOUT.MODULES.VERSION',
- cell: (row: ModuleInfo) => `${row.version}`
- }
- ];
-
- displayedColumns = this.columns.map((x) => x.columnDef);
-
- @Input()
- data: Array = [];
-}
diff --git a/projects/aca-about/src/lib/package-list/package-list.component.html b/projects/aca-about/src/lib/package-list/package-list.component.html
deleted file mode 100644
index f58a2cf6f..000000000
--- a/projects/aca-about/src/lib/package-list/package-list.component.html
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
- {{ column.header | translate }}
-
- {{ column.cell(row) }}
-
-
-
-
-
diff --git a/projects/aca-about/src/lib/package-list/package-list.component.ts b/projects/aca-about/src/lib/package-list/package-list.component.ts
deleted file mode 100644
index ad97012e6..000000000
--- a/projects/aca-about/src/lib/package-list/package-list.component.ts
+++ /dev/null
@@ -1,57 +0,0 @@
-/*!
- * @license
- * Alfresco Example Content Application
- *
- * Copyright (C) 2005 - 2020 Alfresco Software Limited
- *
- * This file is part of the Alfresco Example Content Application.
- * If the software was purchased under a paid Alfresco license, the terms of
- * the paid license agreement will prevail. Otherwise, the software is
- * provided under the following open source license terms:
- *
- * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * The Alfresco Example Content Application is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-
-import { Component, ViewEncapsulation, ChangeDetectionStrategy, Input } from '@angular/core';
-
-export interface PackageInfo {
- name: string;
- version: string;
-}
-
-@Component({
- selector: 'app-package-list',
- templateUrl: './package-list.component.html',
- encapsulation: ViewEncapsulation.None,
- changeDetection: ChangeDetectionStrategy.OnPush
-})
-export class PackageListComponent {
- columns = [
- {
- columnDef: 'title',
- header: 'APP.ABOUT.PACKAGES.NAME',
- cell: (row: PackageInfo) => `${row.name}`
- },
- {
- columnDef: 'version',
- header: 'APP.ABOUT.PACKAGES.VERSION',
- cell: (row: PackageInfo) => `${row.version}`
- }
- ];
-
- displayedColumns = this.columns.map((x) => x.columnDef);
-
- @Input()
- data: Array = [];
-}
diff --git a/projects/aca-about/src/lib/status-list/status-list.component.html b/projects/aca-about/src/lib/status-list/status-list.component.html
deleted file mode 100644
index f58a2cf6f..000000000
--- a/projects/aca-about/src/lib/status-list/status-list.component.html
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
- {{ column.header | translate }}
-
- {{ column.cell(row) }}
-
-
-
-
-
diff --git a/projects/aca-about/src/lib/status-list/status-list.component.ts b/projects/aca-about/src/lib/status-list/status-list.component.ts
deleted file mode 100644
index a2a55e680..000000000
--- a/projects/aca-about/src/lib/status-list/status-list.component.ts
+++ /dev/null
@@ -1,57 +0,0 @@
-/*!
- * @license
- * Alfresco Example Content Application
- *
- * Copyright (C) 2005 - 2020 Alfresco Software Limited
- *
- * This file is part of the Alfresco Example Content Application.
- * If the software was purchased under a paid Alfresco license, the terms of
- * the paid license agreement will prevail. Otherwise, the software is
- * provided under the following open source license terms:
- *
- * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * The Alfresco Example Content Application is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-
-import { Component, ViewEncapsulation, ChangeDetectionStrategy, Input } from '@angular/core';
-
-export interface StatusData {
- property: string;
- value: string;
-}
-
-@Component({
- selector: 'app-status-list',
- templateUrl: './status-list.component.html',
- encapsulation: ViewEncapsulation.None,
- changeDetection: ChangeDetectionStrategy.OnPush
-})
-export class StatusListComponent {
- columns = [
- {
- columnDef: 'property',
- header: 'APP.ABOUT.STATUS.PROPERTY',
- cell: (row: StatusData) => `${row.property}`
- },
- {
- columnDef: 'value',
- header: 'APP.ABOUT.STATUS.VALUE',
- cell: (row: StatusData) => `${row.value}`
- }
- ];
-
- displayedColumns = this.columns.map((x) => x.columnDef);
-
- @Input()
- data: Array = [];
-}
diff --git a/projects/aca-about/src/public-api.ts b/projects/aca-about/src/public-api.ts
index 3060648a2..a3fcd24c4 100644
--- a/projects/aca-about/src/public-api.ts
+++ b/projects/aca-about/src/public-api.ts
@@ -23,10 +23,5 @@
* along with Alfresco. If not, see .
*/
-export * from './lib/extension-list/extension-list.component';
-export * from './lib/license-list/license-list.component';
-export * from './lib/module-list/module-list.component';
-export * from './lib/package-list/package-list.component';
-export * from './lib/status-list/status-list.component';
export * from './lib/about.component';
export * from './lib/aca-about.module';
diff --git a/src/app/extensions.module.ts b/src/app/extensions.module.ts
index 0ae3fead7..dc7035838 100644
--- a/src/app/extensions.module.ts
+++ b/src/app/extensions.module.ts
@@ -30,6 +30,6 @@ import { AcaSettingsModule } from '@alfresco/aca-settings';
import { environment } from '../environments/environment';
@NgModule({
- imports: [AosExtensionModule, ...(environment.devTools ? [AcaAboutModule, AcaSettingsModule] : [])]
+ imports: [AosExtensionModule, ...(environment.devTools ? [AcaSettingsModule] : []), AcaAboutModule.forRoot(environment.production)]
})
export class AppExtensionsModule {}