mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[AAE-10766] presentational and reusable About (#7969)
This commit is contained in:
@@ -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>
|
||||
|
||||
|
@@ -1,3 +0,0 @@
|
||||
.adf-extension-details-container {
|
||||
padding: 4px;
|
||||
}
|
@@ -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;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user