+
-
+
-
Options and Flags
-
VCS Commit Message Suffix
-
- - {{ sessionInfo.messageSuffix | showEmpty }}
-
-
VCS
- Commit-On-Fail {{ sessionInfo.commitOnFail | onOff }}
-
Git
- Auto-Push {{ sessionInfo.gitAutoPush | onOff }}
+
Version Control System
+
+
+
+ {{ sessionInfo.vcsName }} |
+
+
+
+ {{ sessionInfo.vcsSession }} |
+
+
+
+ {{ sessionInfo.gitAutoPush | onOff }} |
+
+
diff --git a/webapp/src/app/components/tcr-session-info/tcr-session-info.component.spec.ts b/webapp/src/app/components/tcr-session-info/tcr-session-info.component.spec.ts
index 887ad5ad..9fbdfac6 100644
--- a/webapp/src/app/components/tcr-session-info/tcr-session-info.component.spec.ts
+++ b/webapp/src/app/components/tcr-session-info/tcr-session-info.component.spec.ts
@@ -28,7 +28,7 @@ import {TcrSessionInfoComponent} from "./tcr-session-info.component";
const sample: TcrSessionInfo = {
baseDir: "/my/base/dir",
- commitOnFail: false,
+ variant: "relaxed",
gitAutoPush: false,
language: "java",
messageSuffix: "my-suffix",
@@ -65,15 +65,19 @@ describe('TcrSessionInfoComponent', () => {
fixture.detectChanges();
});
- it('should be created', () => {
- expect(component).toBeTruthy();
- });
+ describe('component instance', () => {
+ it('should be created', () => {
+ expect(component).toBeTruthy();
+ });
- it('should have title "TCR Session Information"', () => {
- expect(component.title).toEqual('TCR Session Information');
+ it('should have title "TCR Session Information"', () => {
+ expect(component.title).toEqual('TCR Session Information');
+ });
});
- it('should fetch TCR session info on init', () => {
- expect(component.sessionInfo).toEqual(sample);
+ describe('component initialization', () => {
+ it('should fetch TCR session info on init', () => {
+ expect(component.sessionInfo).toEqual(sample);
+ });
});
});
diff --git a/webapp/src/app/components/tcr-session-info/tcr-session-info.component.ts b/webapp/src/app/components/tcr-session-info/tcr-session-info.component.ts
index 3ddd3f55..52b8e14d 100644
--- a/webapp/src/app/components/tcr-session-info/tcr-session-info.component.ts
+++ b/webapp/src/app/components/tcr-session-info/tcr-session-info.component.ts
@@ -23,9 +23,11 @@ SOFTWARE.
import {Component, Input, OnInit} from '@angular/core';
import {TcrSessionInfo} from "../../interfaces/tcr-session-info";
import {TcrSessionInfoService} from "../../services/tcr-session-info.service";
-import {DatePipe, NgIf} from "@angular/common";
+import {DatePipe, NgIf, NgOptimizedImage} from "@angular/common";
import {OnOffPipe} from "../../pipes/on-off.pipe";
import {ShowEmptyPipe} from "../../pipes/show-empty.pipe";
+import {VariantDescriptionPipe} from "../../pipes/variant-description.pipe";
+import {VariantImagePathPipe} from "../../pipes/variant-image-path.pipe";
@Component({
selector: 'app-tcr-session-info',
@@ -34,7 +36,10 @@ import {ShowEmptyPipe} from "../../pipes/show-empty.pipe";
DatePipe,
NgIf,
OnOffPipe,
- ShowEmptyPipe
+ ShowEmptyPipe,
+ NgOptimizedImage,
+ VariantDescriptionPipe,
+ VariantImagePathPipe
],
templateUrl: './tcr-session-info.component.html',
styleUrl: './tcr-session-info.component.css'
@@ -55,4 +60,5 @@ export class TcrSessionInfoComponent implements OnInit {
this.sessionInfoService.getSessionInfo()
.subscribe(sessionInfo => this.sessionInfo = sessionInfo);
}
+
}
diff --git a/webapp/src/app/interfaces/tcr-session-info.ts b/webapp/src/app/interfaces/tcr-session-info.ts
index 0366831f..a626fb18 100644
--- a/webapp/src/app/interfaces/tcr-session-info.ts
+++ b/webapp/src/app/interfaces/tcr-session-info.ts
@@ -27,7 +27,31 @@ export interface TcrSessionInfo {
toolchain: string;
vcsName: string;
vcsSession: string;
- commitOnFail: boolean;
+ variant: string;
gitAutoPush: boolean;
messageSuffix: string;
}
+
+export interface TcrVariant {
+ description: string;
+ statechartImageFile: string;
+}
+
+export const tcrVariants: { [key: string]: TcrVariant } = {
+ "original": {
+ description: "The Original",
+ statechartImageFile: "variant-original.png",
+ },
+ "btcr": {
+ description: "BTCR -- Build && Test && Commit || Revert",
+ statechartImageFile: "variant-btcr.png",
+ },
+ "relaxed": {
+ description: "The Relaxed",
+ statechartImageFile: "variant-relaxed.png",
+ },
+ "introspective": {
+ description: "The Introspective",
+ statechartImageFile: "variant-introspective.png",
+ },
+};
diff --git a/webapp/src/app/pipes/format-timer.pipe.ts b/webapp/src/app/pipes/format-timer.pipe.ts
index 6dcc83d2..f081e7bf 100644
--- a/webapp/src/app/pipes/format-timer.pipe.ts
+++ b/webapp/src/app/pipes/format-timer.pipe.ts
@@ -31,7 +31,8 @@ const SECONDS_PER_HOUR = 3600;
standalone: true
})
export class FormatTimerPipe implements PipeTransform {
- transform(value: unknown, ..._args: unknown[]): unknown {
+
+ transform(value: number | string | null | undefined, ..._args: unknown[]): string {
const duration: number = parseInt(value as string, 10);
if (isNaN(duration)) {
return `--${SEPARATOR}--`;
diff --git a/webapp/src/app/pipes/on-off.pipe.ts b/webapp/src/app/pipes/on-off.pipe.ts
index b5e356fe..57503105 100644
--- a/webapp/src/app/pipes/on-off.pipe.ts
+++ b/webapp/src/app/pipes/on-off.pipe.ts
@@ -28,7 +28,7 @@ import {Pipe, PipeTransform} from '@angular/core';
})
export class OnOffPipe implements PipeTransform {
- transform(value: unknown, ..._args: unknown[]): unknown {
+ transform(value: boolean | string | null | undefined, ..._args: unknown[]): string {
return value ? "✅" : "❌";
}
diff --git a/webapp/src/app/pipes/show-empty.pipe.ts b/webapp/src/app/pipes/show-empty.pipe.ts
index 03055727..1ab556b6 100644
--- a/webapp/src/app/pipes/show-empty.pipe.ts
+++ b/webapp/src/app/pipes/show-empty.pipe.ts
@@ -29,8 +29,7 @@ const NOT_SET: string = "[not set]";
standalone: true
})
export class ShowEmptyPipe implements PipeTransform {
- transform(value: unknown, ..._args: unknown[]): unknown {
+ transform(value: string | null | undefined, ..._args: unknown[]): string {
return value || NOT_SET;
}
-
}
diff --git a/webapp/src/app/pipes/variant-description.pipe.spec.ts b/webapp/src/app/pipes/variant-description.pipe.spec.ts
new file mode 100644
index 00000000..12ba2740
--- /dev/null
+++ b/webapp/src/app/pipes/variant-description.pipe.spec.ts
@@ -0,0 +1,47 @@
+/*
+Copyright (c) 2024 Murex
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+
+import {VariantDescriptionPipe} from './variant-description.pipe';
+
+describe('VariantDescriptionPipe', () => {
+ let pipe: VariantDescriptionPipe;
+
+ beforeEach(() => {
+ pipe = new VariantDescriptionPipe();
+ });
+
+ const notSet = '⚠️ [unknown]';
+
+ [
+ {input: 'relaxed', expected: 'The Relaxed'},
+ {input: 'btcr', expected: 'BTCR -- Build && Test && Commit || Revert'},
+ {input: 'original', expected: 'The Original'},
+ {input: 'introspective', expected: 'The Introspective'},
+ {input: null, expected: notSet},
+ {input: undefined, expected: notSet},
+ {input: '', expected: notSet}
+ ].forEach(testCase => {
+ it(`should return "${testCase.expected}" when the variant value is "${testCase.input}"`, () => {
+ expect(pipe.transform(testCase.input)).toEqual(testCase.expected);
+ });
+ });
+});
diff --git a/webapp/src/app/pipes/variant-description.pipe.ts b/webapp/src/app/pipes/variant-description.pipe.ts
new file mode 100644
index 00000000..cc7eb3b3
--- /dev/null
+++ b/webapp/src/app/pipes/variant-description.pipe.ts
@@ -0,0 +1,38 @@
+/*
+Copyright (c) 2024 Murex
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+
+import {Pipe, PipeTransform} from '@angular/core';
+import {tcrVariants} from "../interfaces/tcr-session-info";
+
+const UNKNOWN = "⚠️ [unknown]";
+
+@Pipe({
+ name: 'variantDescription',
+ standalone: true
+})
+export class VariantDescriptionPipe implements PipeTransform {
+
+ transform(value: string | null | undefined, ..._args: unknown[]): string {
+ return (value && value in tcrVariants) ? tcrVariants[value].description : UNKNOWN;
+ }
+
+}
diff --git a/webapp/src/app/pipes/variant-image-path.pipe.spec.ts b/webapp/src/app/pipes/variant-image-path.pipe.spec.ts
new file mode 100644
index 00000000..c396f827
--- /dev/null
+++ b/webapp/src/app/pipes/variant-image-path.pipe.spec.ts
@@ -0,0 +1,45 @@
+/*
+Copyright (c) 2024 Murex
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+
+import {VariantImagePathPipe} from './variant-image-path.pipe';
+
+describe('VariantImagePathPipe', () => {
+ let pipe: VariantImagePathPipe;
+
+ beforeEach(() => {
+ pipe = new VariantImagePathPipe();
+ });
+
+ [
+ {input: 'relaxed', expected: 'assets/images/variant-relaxed.png'},
+ {input: 'btcr', expected: 'assets/images/variant-btcr.png'},
+ {input: 'original', expected: 'assets/images/variant-original.png'},
+ {input: 'introspective', expected: 'assets/images/variant-introspective.png'},
+ {input: null, expected: ''},
+ {input: undefined, expected: ''},
+ {input: '', expected: ''}
+ ].forEach(testCase => {
+ it(`should return "${testCase.expected}" when the variant value is "${testCase.input}"`, () => {
+ expect(pipe.transform(testCase.input)).toEqual(testCase.expected);
+ });
+ });
+});
diff --git a/webapp/src/app/pipes/variant-image-path.pipe.ts b/webapp/src/app/pipes/variant-image-path.pipe.ts
new file mode 100644
index 00000000..50a4abed
--- /dev/null
+++ b/webapp/src/app/pipes/variant-image-path.pipe.ts
@@ -0,0 +1,39 @@
+/*
+Copyright (c) 2024 Murex
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+
+import {Pipe, PipeTransform} from '@angular/core';
+import {tcrVariants} from "../interfaces/tcr-session-info";
+
+const IMAGES_PATH = "assets/images"
+
+@Pipe({
+ name: 'variantImagePath',
+ standalone: true
+})
+export class VariantImagePathPipe implements PipeTransform {
+
+ transform(value: string | null | undefined, ..._args: unknown[]): string {
+ return (value && value in tcrVariants)
+ ? `${IMAGES_PATH}/${tcrVariants[value].statechartImageFile}` : "";
+ }
+
+}
diff --git a/webapp/src/app/services/tcr-session-info.service.spec.ts b/webapp/src/app/services/tcr-session-info.service.spec.ts
index bd9a674a..1d4cd490 100644
--- a/webapp/src/app/services/tcr-session-info.service.spec.ts
+++ b/webapp/src/app/services/tcr-session-info.service.spec.ts
@@ -57,7 +57,7 @@ describe('TcrSessionInfoService', () => {
it('should return session info when called', () => {
const sample: TcrSessionInfo = {
baseDir: "/my/base/dir",
- commitOnFail: false,
+ variant: "nice",
gitAutoPush: false,
language: "java",
messageSuffix: "my-suffix",
diff --git a/webapp/src/assets/.gitkeep b/webapp/src/assets/.gitkeep
deleted file mode 100644
index e69de29b..00000000
diff --git a/webapp/src/assets/images/variant-btcr.png b/webapp/src/assets/images/variant-btcr.png
new file mode 100644
index 00000000..11b8fe96
Binary files /dev/null and b/webapp/src/assets/images/variant-btcr.png differ
diff --git a/webapp/src/assets/images/variant-introspective.png b/webapp/src/assets/images/variant-introspective.png
new file mode 100644
index 00000000..38ecc75a
Binary files /dev/null and b/webapp/src/assets/images/variant-introspective.png differ
diff --git a/webapp/src/assets/images/variant-original.png b/webapp/src/assets/images/variant-original.png
new file mode 100644
index 00000000..f0be058a
Binary files /dev/null and b/webapp/src/assets/images/variant-original.png differ
diff --git a/webapp/src/assets/images/variant-relaxed.png b/webapp/src/assets/images/variant-relaxed.png
new file mode 100644
index 00000000..c59fb954
Binary files /dev/null and b/webapp/src/assets/images/variant-relaxed.png differ