Skip to content

Commit

Permalink
feat: add version to demo app
Browse files Browse the repository at this point in the history
  • Loading branch information
Lerke committed Sep 27, 2024
1 parent 9a76e6e commit 36ae0e6
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.PAGES_SECRET }}
run: |
sed -i 's/\[\[VERSION\]\]/$GITHUB_REF_NAME/g' ./projects/demo/src/environments/environment.prod.ts
sed -i 's/\[\[BUILD_DATE\]\]/$(git log -1 --format=%cd --date=format:%Y%m%dh%H%M%S)/g' ./projects/demo/src/environments/environment.prod.ts
ng build --base-href "/angular-toastify/"
npx angular-cli-ghpages --repo=https://github.com/scenius-software/angular-toastify.git --dir=dist/demo --name="Scenius Software Engineering" --email="support@scenius.nl"
2 changes: 1 addition & 1 deletion projects/demo/src/app/demo-page/demo-page.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<div class="row center-xs main">
<mat-card>
<mat-card-title>Angular Toastify</mat-card-title>
<mat-card-title>Angular Toastify ({{environment.version}})</mat-card-title>
<mat-card-subtitle>Inspired by <a target="_blank" href="https://github.com/fkhadra/react-toastify">React Toastify</a></mat-card-subtitle>
<mat-card-content style="text-align: left">
<div>
Expand Down
2 changes: 2 additions & 0 deletions projects/demo/src/app/demo-page/demo-page.component.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Component, OnInit } from '@angular/core';
import { ToastType } from 'projects/angular-toastify/src/lib/toast-type';
import { ToastService } from '../../../../angular-toastify/src/lib/toast.service';
import { environment } from '../../environments/environment';

@Component({
selector: 'app-demo-page',
Expand All @@ -25,6 +26,7 @@ export class DemoPageComponent {
closeOnClick = true;
pauseDelayHover = true;
pauseVisibilityChange = true;
environment = environment;


constructor(private _toastService: ToastService) { }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<div class="row center-xs main">
<mat-card>
<mat-card-title>Angular Toastify</mat-card-title>
<mat-card-title>Angular Toastify ({{environment.version}})</mat-card-title>
<mat-card-subtitle>Inspired by <a target="_blank" href="https://github.com/fkhadra/react-toastify">React Toastify</a></mat-card-subtitle>
<mat-card-content style="text-align: left">
<div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Component, OnInit } from '@angular/core';
import { ToastType } from 'projects/angular-toastify/src/lib/toast-type';
import { environment } from 'projects/demo/src/environments/environment';
import { ToastService } from '../../../../../../angular-toastify/src/lib/toast.service';

@Component({
Expand All @@ -24,6 +25,7 @@ export class TestcomponentComponent {
closeOnClick = true;
pauseDelayHover = true;
pauseVisibilityChange = true;
environment = environment;


constructor(private _toastService: ToastService) { }
Expand Down
4 changes: 3 additions & 1 deletion projects/demo/src/environments/environment.prod.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
export const environment = {
production: true
production: true,
version: '[[VERSION]]',
build_date: '[[BUILD_DATE]]'
};
4 changes: 3 additions & 1 deletion projects/demo/src/environments/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
// The list of file replacements can be found in `angular.json`.

export const environment = {
production: false
production: false,
version: 'Development',
build_date: 'NOW'
};

/*
Expand Down

0 comments on commit 36ae0e6

Please sign in to comment.