mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
add info and link on current last git commit (#1940)
This commit is contained in:
committed by
Eugenio Romano
parent
0599f1a441
commit
6258aa3dd0
@@ -1,4 +1,10 @@
|
||||
<div class="about-container">
|
||||
<div *ngIf="githubUrlCommitAlpha">
|
||||
<h3>Current Commit position</h3>
|
||||
<a [href]="githubUrlCommitAlpha">{{githubUrlCommitAlpha}}</a>
|
||||
</div>
|
||||
|
||||
|
||||
<h3>Packages</h3>
|
||||
<alfresco-datatable [data]="data"></alfresco-datatable>
|
||||
</div>
|
||||
|
@@ -29,6 +29,8 @@ export class AboutComponent implements OnInit {
|
||||
|
||||
data: ObjectDataTableAdapter;
|
||||
|
||||
githubUrlCommitAlpha: string = 'https://github.com/Alfresco/alfresco-ng2-components/commits/';
|
||||
|
||||
constructor(private http: Http,
|
||||
private logService: LogService) {
|
||||
}
|
||||
@@ -42,18 +44,38 @@ export class AboutComponent implements OnInit {
|
||||
return regexp.test(val);
|
||||
});
|
||||
|
||||
let alfrescoPackagesTableRappresentation = [];
|
||||
let alfrescoPackagesTableRepresentation = [];
|
||||
alfrescoPackages.forEach((val) => {
|
||||
this.logService.log(response.json().dependencies[val]);
|
||||
alfrescoPackagesTableRappresentation.push({name: val, version: response.json().dependencies[val].version});
|
||||
alfrescoPackagesTableRepresentation.push({
|
||||
name: val,
|
||||
version: response.json().dependencies[val].version
|
||||
});
|
||||
});
|
||||
|
||||
this.logService.log(alfrescoPackagesTableRappresentation);
|
||||
this.gitHubLinkCreation(alfrescoPackagesTableRepresentation);
|
||||
|
||||
this.data = new ObjectDataTableAdapter(alfrescoPackagesTableRappresentation, [
|
||||
this.logService.log(alfrescoPackagesTableRepresentation);
|
||||
|
||||
this.data = new ObjectDataTableAdapter(alfrescoPackagesTableRepresentation, [
|
||||
{type: 'text', key: 'name', title: 'Name', sortable: true},
|
||||
{type: 'text', key: 'version', title: 'Version', sortable: true}
|
||||
]);
|
||||
});
|
||||
}
|
||||
|
||||
private gitHubLinkCreation(alfrescoPackagesTableRepresentation): void {
|
||||
let corePackage = alfrescoPackagesTableRepresentation.find((packageUp) => {
|
||||
return packageUp.name === 'ng2-alfresco-core';
|
||||
});
|
||||
|
||||
if (corePackage) {
|
||||
let commitIsh = corePackage.version.split('-');
|
||||
if (commitIsh.length > 1) {
|
||||
this.githubUrlCommitAlpha = this.githubUrlCommitAlpha + commitIsh;
|
||||
} else {
|
||||
this.githubUrlCommitAlpha = this.githubUrlCommitAlpha + corePackage.version;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user