[AAE-10766] presentational and reusable About (#7969)

This commit is contained in:
Denys Vuika
2022-11-11 16:01:02 +00:00
committed by GitHub
parent 5abe22b9c8
commit 1109a73a19
13 changed files with 319 additions and 192 deletions

View File

@@ -1,4 +1,34 @@
<mat-slide-toggle [(ngModel)]="dev">{{'APP.ABOUT.DEVELOPMENT' | translate }}</mat-slide-toggle>
<adf-about [dev]="dev" [pkg]="pkg"> </adf-about>
<adf-about>
<adf-about-panel *ngIf="dev" [label]="'ABOUT.SERVER_SETTINGS.TITLE' | translate">
<ng-template>
<adf-about-server-settings></adf-about-server-settings>
</ng-template>
</adf-about-panel>
<adf-about-panel *ngIf="dev" [label]="'ABOUT.PACKAGES.TITLE' | translate">
<ng-template>
<adf-about-package-list [dependencies]="pkg?.dependencies"></adf-about-package-list>
</ng-template>
</adf-about-panel>
<adf-about-panel [label]="'ABOUT.REPOSITORY' | translate" *ngIf="repository">
<ng-template>
<adf-about-repository-info [data]="repository"></adf-about-repository-info>
</ng-template>
</adf-about-panel>
<adf-about-panel [label]="'ABOUT.VERSIONS.TITLE' | translate">
<ng-template>
<adf-about-platform-version [repository]="repository" [process]="bpmVersion"></adf-about-platform-version>
</ng-template>
</adf-about-panel>
<adf-about-panel *ngIf="extensions$ | async as extensions" [label]="'ABOUT.PLUGINS.TITLE' | translate">
<ng-template>
<adf-about-extension-list [data]="extensions"></adf-about-extension-list>
</ng-template>
</adf-about-panel>
</adf-about>

View File

@@ -1,3 +0,0 @@
.adf-extension-details-container {
padding: 4px;
}

View File

@@ -15,20 +15,52 @@
* limitations under the License.
*/
import { Component } from '@angular/core';
import { Component, OnInit } from '@angular/core';
import { AppExtensionService, ExtensionRef } from '@alfresco/adf-extensions';
import { AuthenticationService, BpmProductVersionModel, DiscoveryApiService, RepositoryInfo } from '@alfresco/adf-core';
import pkg from '../../../../../package.json';
import { Observable } from 'rxjs';
@Component({
selector: 'app-about-page',
templateUrl: './about.component.html',
styleUrls: ['./about.component.scss']
templateUrl: './about.component.html'
})
export class AboutComponent {
export class AboutComponent implements OnInit {
pkg: any;
dev: true;
constructor() {
extensions$: Observable<ExtensionRef[]>;
repository: RepositoryInfo = null;
bpmVersion: BpmProductVersionModel = null;
constructor(
private authService: AuthenticationService,
private appExtensions: AppExtensionService,
private discovery: DiscoveryApiService
) {
this.pkg = pkg;
this.extensions$ = this.appExtensions.references$;
}
ngOnInit(): void {
if (this.authService.isEcmLoggedIn()) {
this.setECMInfo();
}
if (this.authService.isBpmLoggedIn()) {
this.setBPMInfo();
}
}
setECMInfo() {
this.discovery.getEcmProductInfo().subscribe((repository) => {
this.repository = repository as RepositoryInfo;
});
}
setBPMInfo() {
this.discovery.getBpmProductInfo().subscribe((bpmVersion) => {
this.bpmVersion = bpmVersion;
});
}
}