Skip to content

Commit

Permalink
Merge pull request #4 from NorskHelsenett/feature/shortsha
Browse files Browse the repository at this point in the history
Adding SHORTSHA in about page
  • Loading branch information
rogerwesterbo authored Jan 10, 2025
2 parents f636d82 + 4dad7ae commit 78027ef
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 4 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,11 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: '22.x'
- name: Build webapp
run: |
echo "Building ${{ env.APP }} ${{ needs.setenv.outputs.rorversion}} (${{ needs.setenv.outputs.shortsha}})"
- run: mv package.json package-backup.json
- run: jq --arg rorversion $ROR_VERSION '.version = $rorversion' package-backup.json > package.json
- run: jq --arg rorversion ${{ needs.setenv.outputs.rorversion}} --arg shortsha ${{ needs.setenv.outputs.shortsha}} '.version = $rorversion | .commit = $shortsha' package-backup.json > package.json
- run: npm ci
- run: npm run build:prod

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "ror-web",
"version": "0.1.0",
"commit": "FFFFFF",
"scripts": {
"ng": "ng",
"start": "ng serve --port 11000",
Expand Down
2 changes: 1 addition & 1 deletion src/app/about/about.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ <h4 class="dark:text-light text-lg font-semibold text-gray-500">{{ 'pages.about.
<tbody>
<tr class="py-1 transition duration-300 ease-in-out hover:bg-gray-200 dark:hover:bg-gray-500">
<td class="px-2 py-1">{{ 'app.titleLong' | translate }}</td>
<td class="px-2 py-1">{{ appVersion }}</td>
<td class="px-2 py-1">{{ appVersion }} ({{ commit }})</td>
</tr>
<tr class="py-1 transition duration-300 ease-in-out hover:bg-gray-200 dark:hover:bg-gray-500" *ngIf="version">
<td class="px-2 py-1">Api version</td>
Expand Down
1 change: 1 addition & 0 deletions src/app/about/about.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { VersionService } from '../core/services/version.service';
})
export class AboutComponent implements OnInit {
appVersion = environment.appVersion;
commit = environment.commit;

health$: Observable<any> | undefined;
healthError: any;
Expand Down
3 changes: 2 additions & 1 deletion src/environments/environment.prod.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
declare let require: any;
const { version: appVersion } = require('../../package.json');
const { version: appVersion, commit: commit } = require('../../package.json');

export const environment = {
appVersion,
commit,
configPath: 'assets/config/config.json',
production: true,
};
3 changes: 2 additions & 1 deletion src/environments/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
// `ng build` replaces `environment.ts` with `environment.prod.ts`.
// The list of file replacements can be found in `angular.json`.
declare let require: any;
const { version: appVersion } = require('../../package.json');
const { version: appVersion, commit: commit } = require('../../package.json');

export const environment = {
appVersion,
commit,
production: false,
configPath: 'assets/config/config.json',
};
Expand Down

0 comments on commit 78027ef

Please sign in to comment.