add info and link on current last git commit (#1940)

This commit is contained in:
Eugenio Romano
2017-06-07 07:32:56 +01:00
committed by Eugenio Romano
parent 0599f1a441
commit 6258aa3dd0
2 changed files with 32 additions and 4 deletions

View File

@@ -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>

View File

@@ -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;
}
}
}
}