This is the codeAbility Sharing Platform! Learn more about the codeAbility Sharing Platform.

Skip to content
Snippets Groups Projects
Commit 9c0a113d authored by Michael Breu's avatar Michael Breu :speech_balloon:
Browse files

Adding Commit Date in Footer

parent 997cbe67
Branches
Tags
1 merge request!62created achievementService and separated some functionality out of...
......@@ -20,6 +20,7 @@ services:
- APPLICATION_GITLAB_GENERALACCESSTOKEN=${APPLICATION_GITLAB_GENERALACCESSTOKEN}
- gitBranch=${GIT_BRANCH}
- gitCommitId=${COMMIT_ID}
- gitCommitDate=${COMMIT_DATE}
ports:
- 10084:8080
......
......@@ -192,8 +192,9 @@ public class ApplicationProperties {
public String toString() {
return "DeploymentInfo [" + commitId + "/" + branch + "]";
}
private String commitId;
private String branch;
private String commitId = "---";
private String branch = "---";
private String deploymentDate = "";
/**
* @return the commitId
*/
......@@ -218,5 +219,17 @@ public class ApplicationProperties {
public void setBranch(String branch) {
this.branch = branch;
}
/**
* @return the deploymentDate
*/
public String getDeploymentDate() {
return deploymentDate;
}
/**
* @param deploymentDate the deploymentDate to set
*/
public void setDeploymentDate(String deploymentDate) {
this.deploymentDate = deploymentDate;
}
}
}
......@@ -37,7 +37,7 @@ public class ApplicationInfoResource {
@GetMapping("/applicationInfo/deploymentInfo")
public ApplicationProperties.DeploymentInfo getApplicationInfo() {
final DeploymentInfo deploymentInfo = applicationProperties.getDeploymentInfo();
if(deploymentInfo==null || "${git.branch}".equals(deploymentInfo.getBranch())) {
if(deploymentInfo==null || "${gitBranch}".equals(deploymentInfo.getBranch())) {
return new ApplicationProperties.DeploymentInfo(); // application info is not initialized properly! Return an empty info
}
return deploymentInfo;
......
......@@ -173,4 +173,5 @@ application:
highlight-post: </strong></mark>
deployment-info:
commit-id: "${gitCommitId}"
branch: "${gitBranch}"
\ No newline at end of file
branch: "${gitBranch}"
deploymentDate: ${gitCommitDate}
\ No newline at end of file
......@@ -7,6 +7,7 @@ import { SERVER_API_URL } from 'app/app.constants';
export class DeploymentInfo {
branch = '';
commitId = '';
deploymentDate = '';
}
@Injectable({ providedIn: 'root' })
export class ApplicationInfoService {
......
......@@ -22,7 +22,7 @@
<li><a href="https://artemis.codeability.uibk.ac.at/#/datenschutz" jhiTranslate="global.footer.privacy">Privacy</a></li>
</ul>
</div>
<div style="float: right; font-size: 50%;padding-top: 15px;" *ngIf="applicationInfoService.getDeploymentInfo().branch">{{applicationInfoService.getDeploymentInfo().branch}}/{{applicationInfoService.getDeploymentInfo().commitId}}</div>
<div style="float: right; font-size: 50%;padding-top: 15px;" *ngIf="applicationInfoService.getDeploymentInfo().branch">{{applicationInfoService.getDeploymentInfo().branch}}/{{applicationInfoService.getDeploymentInfo().commitId}} ({{applicationInfoService.getDeploymentInfo().deploymentDate}})</div>
</div>
</div>
</div>
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment