diff --git a/simulator-ui/.eslintrc.json b/simulator-ui/.eslintrc.json index 6ec524114..5a3cb9410 100644 --- a/simulator-ui/.eslintrc.json +++ b/simulator-ui/.eslintrc.json @@ -24,7 +24,7 @@ "error", { "type": "element", - "prefix": ["app", "jhi"], + "prefix": "app", "style": "kebab-case" } ], diff --git a/simulator-ui/src/main/webapp/app/app-routing.module.ts b/simulator-ui/src/main/webapp/app/app-routing.module.ts index c485b3f8b..4fdf13500 100644 --- a/simulator-ui/src/main/webapp/app/app-routing.module.ts +++ b/simulator-ui/src/main/webapp/app/app-routing.module.ts @@ -30,6 +30,11 @@ import NavbarComponent from './layouts/navbar/navbar.component'; data: { pageTitle: 'citrusSimulatorApp.scenario.home.title' }, loadChildren: () => import(`./scenario/scenario.routes`), }, + { + path: 'scenario-result', + data: { pageTitle: 'citrusSimulatorApp.scenarioExecution.home.title' }, + loadChildren: () => import(`./scenario-result/scenario-result.routes`), + }, ...errorRoute, ], { enableTracing: DEBUG_INFO_ENABLED, bindToComponentInputs: true }, diff --git a/simulator-ui/src/main/webapp/app/app.module.ts b/simulator-ui/src/main/webapp/app/app.module.ts index 6823ff032..0a81695df 100644 --- a/simulator-ui/src/main/webapp/app/app.module.ts +++ b/simulator-ui/src/main/webapp/app/app.module.ts @@ -1,25 +1,30 @@ -import { NgModule, LOCALE_ID } from '@angular/core'; import { registerLocaleData } from '@angular/common'; import { HttpClientModule } from '@angular/common/http'; import locale from '@angular/common/locales/en'; +import { NgModule, LOCALE_ID } from '@angular/core'; import { BrowserModule, Title } from '@angular/platform-browser'; import { TitleStrategy } from '@angular/router'; import { ServiceWorkerModule } from '@angular/service-worker'; + import { FaIconLibrary } from '@fortawesome/angular-fontawesome'; -import dayjs from 'dayjs/esm'; + import { NgbDateAdapter, NgbDatepickerConfig } from '@ng-bootstrap/ng-bootstrap'; +import dayjs from 'dayjs/esm'; + import { ApplicationConfigService } from 'app/core/config/application-config.service'; -import './config/dayjs'; +import { httpInterceptorProviders } from 'app/core/interceptor'; import { TranslationModule } from 'app/shared/language/translation.module'; -import { httpInterceptorProviders } from 'app/core/interceptor/index'; + +import { AppPageTitleStrategy } from './app-page-title-strategy'; import { AppRoutingModule } from './app-routing.module'; -// jhipster-needle-angular-add-module-import JHipster will add new module here +import './config/dayjs'; import { NgbDateDayjsAdapter } from './config/datepicker-adapter'; import { fontAwesomeIcons } from './config/font-awesome-icons'; import MainComponent from './layouts/main/main.component'; import MainModule from './layouts/main/main.module'; -import { AppPageTitleStrategy } from './app-page-title-strategy'; + +// jhipster-needle-angular-add-module-import JHipster will add new module here @NgModule({ imports: [ diff --git a/simulator-ui/src/main/webapp/app/config/font-awesome-icons.ts b/simulator-ui/src/main/webapp/app/config/font-awesome-icons.ts index 6e5f94ebc..c09f8e0f3 100644 --- a/simulator-ui/src/main/webapp/app/config/font-awesome-icons.ts +++ b/simulator-ui/src/main/webapp/app/config/font-awesome-icons.ts @@ -9,6 +9,7 @@ import { faCalendarAlt, faChartPie, faCheck, + faCircleInfo, faCloud, faCogs, faDatabase, @@ -31,6 +32,7 @@ import { faSort, faSortDown, faSortUp, + faSquarePollVertical, faSync, faTachometerAlt, faTasks, @@ -58,6 +60,7 @@ export const fontAwesomeIcons = [ faCalendarAlt, faChartPie, faCheck, + faCircleInfo, faCloud, faCogs, faDatabase, @@ -81,6 +84,7 @@ export const fontAwesomeIcons = [ faSort, faSortDown, faSortUp, + faSquarePollVertical, faSync, faTachometerAlt, faTasks, diff --git a/simulator-ui/src/main/webapp/app/config/pagination.constants.ts b/simulator-ui/src/main/webapp/app/config/pagination.constants.ts index 6bee3ff5a..21fdfe2ee 100644 --- a/simulator-ui/src/main/webapp/app/config/pagination.constants.ts +++ b/simulator-ui/src/main/webapp/app/config/pagination.constants.ts @@ -1,3 +1,3 @@ export const TOTAL_COUNT_RESPONSE_HEADER = 'X-Total-Count'; export const PAGE_HEADER = 'page'; -export const ITEMS_PER_PAGE = 20; +export const ITEMS_PER_PAGE = 10; diff --git a/simulator-ui/src/main/webapp/app/entities/message-header/detail/message-header-detail.component.html b/simulator-ui/src/main/webapp/app/entities/message-header/detail/message-header-detail.component.html index 97ef51f87..88e142171 100644 --- a/simulator-ui/src/main/webapp/app/entities/message-header/detail/message-header-detail.component.html +++ b/simulator-ui/src/main/webapp/app/entities/message-header/detail/message-header-detail.component.html @@ -7,9 +7,9 @@


- + - +
ID
diff --git a/simulator-ui/src/main/webapp/app/entities/message-header/detail/message-header-detail.component.ts b/simulator-ui/src/main/webapp/app/entities/message-header/detail/message-header-detail.component.ts index bbfa90fdb..4496bcb0b 100644 --- a/simulator-ui/src/main/webapp/app/entities/message-header/detail/message-header-detail.component.ts +++ b/simulator-ui/src/main/webapp/app/entities/message-header/detail/message-header-detail.component.ts @@ -7,7 +7,7 @@ import { IMessageHeader } from '../message-header.model'; @Component({ standalone: true, - selector: 'jhi-message-header-detail', + selector: 'app-message-header-detail', templateUrl: './message-header-detail.component.html', imports: [SharedModule, RouterModule, DurationPipe, FormatMediumDatetimePipe, FormatMediumDatePipe], }) diff --git a/simulator-ui/src/main/webapp/app/entities/message-header/list/message-header.component.html b/simulator-ui/src/main/webapp/app/entities/message-header/list/message-header.component.html index 60d156e14..ce7a979dd 100644 --- a/simulator-ui/src/main/webapp/app/entities/message-header/list/message-header.component.html +++ b/simulator-ui/src/main/webapp/app/entities/message-header/list/message-header.component.html @@ -10,11 +10,11 @@

- + - + - +
No Message Headers found @@ -97,7 +97,7 @@

- +
diff --git a/simulator-ui/src/main/webapp/app/entities/message-header/list/message-header.component.ts b/simulator-ui/src/main/webapp/app/entities/message-header/list/message-header.component.ts index 23666575c..a7c2b13ec 100644 --- a/simulator-ui/src/main/webapp/app/entities/message-header/list/message-header.component.ts +++ b/simulator-ui/src/main/webapp/app/entities/message-header/list/message-header.component.ts @@ -17,7 +17,7 @@ import { IMessageHeader } from '../message-header.model'; @Component({ standalone: true, - selector: 'jhi-message-header', + selector: 'app-message-header', templateUrl: './message-header.component.html', imports: [ RouterModule, diff --git a/simulator-ui/src/main/webapp/app/entities/message/detail/message-detail.component.html b/simulator-ui/src/main/webapp/app/entities/message/detail/message-detail.component.html index 3de3fc491..e8bf8d91c 100644 --- a/simulator-ui/src/main/webapp/app/entities/message/detail/message-detail.component.html +++ b/simulator-ui/src/main/webapp/app/entities/message/detail/message-detail.component.html @@ -5,9 +5,9 @@

ID
diff --git a/simulator-ui/src/main/webapp/app/entities/message/detail/message-detail.component.ts b/simulator-ui/src/main/webapp/app/entities/message/detail/message-detail.component.ts index 5c15b69d0..c3d53402c 100644 --- a/simulator-ui/src/main/webapp/app/entities/message/detail/message-detail.component.ts +++ b/simulator-ui/src/main/webapp/app/entities/message/detail/message-detail.component.ts @@ -7,7 +7,7 @@ import { IMessage } from '../message.model'; @Component({ standalone: true, - selector: 'jhi-message-detail', + selector: 'app-message-detail', templateUrl: './message-detail.component.html', imports: [SharedModule, RouterModule, DurationPipe, FormatMediumDatetimePipe, FormatMediumDatePipe], }) diff --git a/simulator-ui/src/main/webapp/app/entities/message/list/message.component.html b/simulator-ui/src/main/webapp/app/entities/message/list/message.component.html index 5243d6944..72497a6b0 100644 --- a/simulator-ui/src/main/webapp/app/entities/message/list/message.component.html +++ b/simulator-ui/src/main/webapp/app/entities/message/list/message.component.html @@ -10,11 +10,11 @@

- + - + - +
No Messages found @@ -119,7 +119,7 @@

- +
diff --git a/simulator-ui/src/main/webapp/app/entities/message/list/message.component.ts b/simulator-ui/src/main/webapp/app/entities/message/list/message.component.ts index ae894db73..baf042763 100644 --- a/simulator-ui/src/main/webapp/app/entities/message/list/message.component.ts +++ b/simulator-ui/src/main/webapp/app/entities/message/list/message.component.ts @@ -17,7 +17,7 @@ import { IMessage } from '../message.model'; @Component({ standalone: true, - selector: 'jhi-message', + selector: 'app-message', templateUrl: './message.component.html', imports: [ RouterModule, diff --git a/simulator-ui/src/main/webapp/app/entities/scenario-action/detail/scenario-action-detail.component.html b/simulator-ui/src/main/webapp/app/entities/scenario-action/detail/scenario-action-detail.component.html index e99b980ce..d99cdfa78 100644 --- a/simulator-ui/src/main/webapp/app/entities/scenario-action/detail/scenario-action-detail.component.html +++ b/simulator-ui/src/main/webapp/app/entities/scenario-action/detail/scenario-action-detail.component.html @@ -7,9 +7,9 @@


- + - +
ID
diff --git a/simulator-ui/src/main/webapp/app/entities/scenario-action/detail/scenario-action-detail.component.ts b/simulator-ui/src/main/webapp/app/entities/scenario-action/detail/scenario-action-detail.component.ts index c78f90a89..67b4044f2 100644 --- a/simulator-ui/src/main/webapp/app/entities/scenario-action/detail/scenario-action-detail.component.ts +++ b/simulator-ui/src/main/webapp/app/entities/scenario-action/detail/scenario-action-detail.component.ts @@ -7,7 +7,7 @@ import { IScenarioAction } from '../scenario-action.model'; @Component({ standalone: true, - selector: 'jhi-scenario-action-detail', + selector: 'app-scenario-action-detail', templateUrl: './scenario-action-detail.component.html', imports: [SharedModule, RouterModule, DurationPipe, FormatMediumDatetimePipe, FormatMediumDatePipe], }) diff --git a/simulator-ui/src/main/webapp/app/entities/scenario-action/list/scenario-action.component.html b/simulator-ui/src/main/webapp/app/entities/scenario-action/list/scenario-action.component.html index 6a3d2cfb8..5ad100271 100644 --- a/simulator-ui/src/main/webapp/app/entities/scenario-action/list/scenario-action.component.html +++ b/simulator-ui/src/main/webapp/app/entities/scenario-action/list/scenario-action.component.html @@ -10,11 +10,11 @@

- + - + - +
No Scenario Actions found @@ -92,7 +92,7 @@

- +
diff --git a/simulator-ui/src/main/webapp/app/entities/scenario-action/list/scenario-action.component.ts b/simulator-ui/src/main/webapp/app/entities/scenario-action/list/scenario-action.component.ts index b929f408d..1563a7dfa 100644 --- a/simulator-ui/src/main/webapp/app/entities/scenario-action/list/scenario-action.component.ts +++ b/simulator-ui/src/main/webapp/app/entities/scenario-action/list/scenario-action.component.ts @@ -17,7 +17,7 @@ import { IScenarioAction } from '../scenario-action.model'; @Component({ standalone: true, - selector: 'jhi-scenario-action', + selector: 'app-scenario-action', templateUrl: './scenario-action.component.html', imports: [ RouterModule, diff --git a/simulator-ui/src/main/webapp/app/entities/scenario-execution/detail/scenario-execution-detail.component.html b/simulator-ui/src/main/webapp/app/entities/scenario-execution/detail/scenario-execution-detail.component.html index 2abb4044b..a27d83a97 100644 --- a/simulator-ui/src/main/webapp/app/entities/scenario-execution/detail/scenario-execution-detail.component.html +++ b/simulator-ui/src/main/webapp/app/entities/scenario-execution/detail/scenario-execution-detail.component.html @@ -7,9 +7,9 @@


- + - +
ID
diff --git a/simulator-ui/src/main/webapp/app/entities/scenario-execution/detail/scenario-execution-detail.component.ts b/simulator-ui/src/main/webapp/app/entities/scenario-execution/detail/scenario-execution-detail.component.ts index c21b382de..1d4559e28 100644 --- a/simulator-ui/src/main/webapp/app/entities/scenario-execution/detail/scenario-execution-detail.component.ts +++ b/simulator-ui/src/main/webapp/app/entities/scenario-execution/detail/scenario-execution-detail.component.ts @@ -7,7 +7,7 @@ import { IScenarioExecution } from '../scenario-execution.model'; @Component({ standalone: true, - selector: 'jhi-scenario-execution-detail', + selector: 'app-scenario-execution-detail', templateUrl: './scenario-execution-detail.component.html', imports: [SharedModule, RouterModule, DurationPipe, FormatMediumDatetimePipe, FormatMediumDatePipe], }) diff --git a/simulator-ui/src/main/webapp/app/entities/scenario-execution/list/scenario-execution.component.html b/simulator-ui/src/main/webapp/app/entities/scenario-execution/list/scenario-execution.component.html index 59a5bae6d..b92dc2634 100644 --- a/simulator-ui/src/main/webapp/app/entities/scenario-execution/list/scenario-execution.component.html +++ b/simulator-ui/src/main/webapp/app/entities/scenario-execution/list/scenario-execution.component.html @@ -10,11 +10,11 @@

- + - + - +
No Scenario Executions found @@ -138,7 +138,7 @@

- +
diff --git a/simulator-ui/src/main/webapp/app/entities/scenario-execution/list/scenario-execution.component.ts b/simulator-ui/src/main/webapp/app/entities/scenario-execution/list/scenario-execution.component.ts index 4c25f2163..b29084340 100644 --- a/simulator-ui/src/main/webapp/app/entities/scenario-execution/list/scenario-execution.component.ts +++ b/simulator-ui/src/main/webapp/app/entities/scenario-execution/list/scenario-execution.component.ts @@ -17,7 +17,7 @@ import { IScenarioExecution } from '../scenario-execution.model'; @Component({ standalone: true, - selector: 'jhi-scenario-execution', + selector: 'app-scenario-execution', templateUrl: './scenario-execution.component.html', imports: [ RouterModule, diff --git a/simulator-ui/src/main/webapp/app/entities/scenario-execution/scenario-execution.model.ts b/simulator-ui/src/main/webapp/app/entities/scenario-execution/scenario-execution.model.ts index 7dc9b62c6..ccf52d517 100644 --- a/simulator-ui/src/main/webapp/app/entities/scenario-execution/scenario-execution.model.ts +++ b/simulator-ui/src/main/webapp/app/entities/scenario-execution/scenario-execution.model.ts @@ -10,3 +10,13 @@ export interface IScenarioExecution { } export type NewScenarioExecution = Omit & { executionId: null }; + +export interface IScenarioExecutionStatus { + id: number; + name: 'UNKNOWN' | 'RUNNING' | 'SUCCESS' | 'FAILED'; +} + +export const STATUS_UNKNOWN: IScenarioExecutionStatus = { id: 0, name: 'UNKNOWN' }; +export const STATUS_RUNNING: IScenarioExecutionStatus = { id: 1, name: 'RUNNING' }; +export const STATUS_SUCCESS: IScenarioExecutionStatus = { id: 2, name: 'SUCCESS' }; +export const STATUS_FAILED: IScenarioExecutionStatus = { id: 3, name: 'FAILED' }; diff --git a/simulator-ui/src/main/webapp/app/entities/scenario-parameter/detail/scenario-parameter-detail.component.html b/simulator-ui/src/main/webapp/app/entities/scenario-parameter/detail/scenario-parameter-detail.component.html index 6f97984eb..eb8267bc6 100644 --- a/simulator-ui/src/main/webapp/app/entities/scenario-parameter/detail/scenario-parameter-detail.component.html +++ b/simulator-ui/src/main/webapp/app/entities/scenario-parameter/detail/scenario-parameter-detail.component.html @@ -7,9 +7,9 @@


- + - +
ID
diff --git a/simulator-ui/src/main/webapp/app/entities/scenario-parameter/detail/scenario-parameter-detail.component.ts b/simulator-ui/src/main/webapp/app/entities/scenario-parameter/detail/scenario-parameter-detail.component.ts index 4dd03cf2b..9eb191ced 100644 --- a/simulator-ui/src/main/webapp/app/entities/scenario-parameter/detail/scenario-parameter-detail.component.ts +++ b/simulator-ui/src/main/webapp/app/entities/scenario-parameter/detail/scenario-parameter-detail.component.ts @@ -7,7 +7,7 @@ import { IScenarioParameter } from '../scenario-parameter.model'; @Component({ standalone: true, - selector: 'jhi-scenario-parameter-detail', + selector: 'app-scenario-parameter-detail', templateUrl: './scenario-parameter-detail.component.html', imports: [SharedModule, RouterModule, DurationPipe, FormatMediumDatetimePipe, FormatMediumDatePipe], }) diff --git a/simulator-ui/src/main/webapp/app/entities/scenario-parameter/list/scenario-parameter.component.html b/simulator-ui/src/main/webapp/app/entities/scenario-parameter/list/scenario-parameter.component.html index e34a3bd40..94c2437a2 100644 --- a/simulator-ui/src/main/webapp/app/entities/scenario-parameter/list/scenario-parameter.component.html +++ b/simulator-ui/src/main/webapp/app/entities/scenario-parameter/list/scenario-parameter.component.html @@ -10,11 +10,11 @@

- + - + - +
No Scenario Parameters found @@ -106,7 +106,7 @@

- +
diff --git a/simulator-ui/src/main/webapp/app/entities/scenario-parameter/list/scenario-parameter.component.ts b/simulator-ui/src/main/webapp/app/entities/scenario-parameter/list/scenario-parameter.component.ts index 2cd5027f4..22745d909 100644 --- a/simulator-ui/src/main/webapp/app/entities/scenario-parameter/list/scenario-parameter.component.ts +++ b/simulator-ui/src/main/webapp/app/entities/scenario-parameter/list/scenario-parameter.component.ts @@ -17,7 +17,7 @@ import { IScenarioParameter } from '../scenario-parameter.model'; @Component({ standalone: true, - selector: 'jhi-scenario-parameter', + selector: 'app-scenario-parameter', templateUrl: './scenario-parameter.component.html', imports: [ RouterModule, diff --git a/simulator-ui/src/main/webapp/app/entities/test-parameter/detail/test-parameter-detail.component.html b/simulator-ui/src/main/webapp/app/entities/test-parameter/detail/test-parameter-detail.component.html index a91a38d47..5e69bf900 100644 --- a/simulator-ui/src/main/webapp/app/entities/test-parameter/detail/test-parameter-detail.component.html +++ b/simulator-ui/src/main/webapp/app/entities/test-parameter/detail/test-parameter-detail.component.html @@ -7,9 +7,9 @@


- + - +
Key
diff --git a/simulator-ui/src/main/webapp/app/entities/test-parameter/detail/test-parameter-detail.component.ts b/simulator-ui/src/main/webapp/app/entities/test-parameter/detail/test-parameter-detail.component.ts index 20f86d5bb..dfa7d9c04 100644 --- a/simulator-ui/src/main/webapp/app/entities/test-parameter/detail/test-parameter-detail.component.ts +++ b/simulator-ui/src/main/webapp/app/entities/test-parameter/detail/test-parameter-detail.component.ts @@ -7,7 +7,7 @@ import { ITestParameter } from '../test-parameter.model'; @Component({ standalone: true, - selector: 'jhi-test-parameter-detail', + selector: 'app-test-parameter-detail', templateUrl: './test-parameter-detail.component.html', imports: [SharedModule, RouterModule, DurationPipe, FormatMediumDatetimePipe, FormatMediumDatePipe], }) diff --git a/simulator-ui/src/main/webapp/app/entities/test-parameter/list/test-parameter.component.html b/simulator-ui/src/main/webapp/app/entities/test-parameter/list/test-parameter.component.html index 53c0aea97..0b13fcf27 100644 --- a/simulator-ui/src/main/webapp/app/entities/test-parameter/list/test-parameter.component.html +++ b/simulator-ui/src/main/webapp/app/entities/test-parameter/list/test-parameter.component.html @@ -10,11 +10,11 @@

- + - + - +
No Test Parameters found @@ -86,7 +86,7 @@

- +
diff --git a/simulator-ui/src/main/webapp/app/entities/test-parameter/list/test-parameter.component.ts b/simulator-ui/src/main/webapp/app/entities/test-parameter/list/test-parameter.component.ts index 06dc18098..fac1e024f 100644 --- a/simulator-ui/src/main/webapp/app/entities/test-parameter/list/test-parameter.component.ts +++ b/simulator-ui/src/main/webapp/app/entities/test-parameter/list/test-parameter.component.ts @@ -17,7 +17,7 @@ import { ITestParameter } from '../test-parameter.model'; @Component({ standalone: true, - selector: 'jhi-test-parameter', + selector: 'app-test-parameter', templateUrl: './test-parameter.component.html', imports: [ RouterModule, diff --git a/simulator-ui/src/main/webapp/app/entities/test-result/detail/test-result-detail.component.html b/simulator-ui/src/main/webapp/app/entities/test-result/detail/test-result-detail.component.html index d8218a1fe..853aa2217 100644 --- a/simulator-ui/src/main/webapp/app/entities/test-result/detail/test-result-detail.component.html +++ b/simulator-ui/src/main/webapp/app/entities/test-result/detail/test-result-detail.component.html @@ -5,9 +5,9 @@

ID
diff --git a/simulator-ui/src/main/webapp/app/entities/test-result/detail/test-result-detail.component.ts b/simulator-ui/src/main/webapp/app/entities/test-result/detail/test-result-detail.component.ts index 34019db86..f354306f6 100644 --- a/simulator-ui/src/main/webapp/app/entities/test-result/detail/test-result-detail.component.ts +++ b/simulator-ui/src/main/webapp/app/entities/test-result/detail/test-result-detail.component.ts @@ -7,7 +7,7 @@ import { ITestResult } from '../test-result.model'; @Component({ standalone: true, - selector: 'jhi-test-result-detail', + selector: 'app-test-result-detail', templateUrl: './test-result-detail.component.html', imports: [SharedModule, RouterModule, DurationPipe, FormatMediumDatetimePipe, FormatMediumDatePipe], }) diff --git a/simulator-ui/src/main/webapp/app/entities/test-result/list/test-result.component.html b/simulator-ui/src/main/webapp/app/entities/test-result/list/test-result.component.html index 775b02f64..b3fd67a28 100644 --- a/simulator-ui/src/main/webapp/app/entities/test-result/list/test-result.component.html +++ b/simulator-ui/src/main/webapp/app/entities/test-result/list/test-result.component.html @@ -10,11 +10,11 @@

- + - + - +
No Test Results found @@ -129,7 +129,7 @@

- +
diff --git a/simulator-ui/src/main/webapp/app/entities/test-result/list/test-result.component.ts b/simulator-ui/src/main/webapp/app/entities/test-result/list/test-result.component.ts index f458307c9..0b01930ce 100644 --- a/simulator-ui/src/main/webapp/app/entities/test-result/list/test-result.component.ts +++ b/simulator-ui/src/main/webapp/app/entities/test-result/list/test-result.component.ts @@ -17,7 +17,7 @@ import { ITestResult } from '../test-result.model'; @Component({ standalone: true, - selector: 'jhi-test-result', + selector: 'app-test-result', templateUrl: './test-result.component.html', imports: [ RouterModule, diff --git a/simulator-ui/src/main/webapp/app/home/home.component.ts b/simulator-ui/src/main/webapp/app/home/home.component.ts index 946d1a4a0..4a06e5ed4 100644 --- a/simulator-ui/src/main/webapp/app/home/home.component.ts +++ b/simulator-ui/src/main/webapp/app/home/home.component.ts @@ -10,7 +10,7 @@ import TestResultSummaryComponent from './test-result-summary.component'; @Component({ standalone: true, - selector: 'jhi-home', + selector: 'app-home', templateUrl: './home.component.html', styleUrls: ['./home.component.scss'], imports: [RouterModule, SharedModule, TestResultSummaryComponent], diff --git a/simulator-ui/src/main/webapp/app/home/test-result-summary.component.html b/simulator-ui/src/main/webapp/app/home/test-result-summary.component.html index e9987901b..b0a20685c 100644 --- a/simulator-ui/src/main/webapp/app/home/test-result-summary.component.html +++ b/simulator-ui/src/main/webapp/app/home/test-result-summary.component.html @@ -7,26 +7,74 @@

-

Total:

-
{{ testResults?.total ?? 0 }} (100 %)
+
+
+

Total:

+
{{ testResults?.total ?? 0 }} (100 %)
+
+
+ +
+
-

Successful:

-
- {{ testResults?.successful ?? 0 }} ({{ successfulPercentage }} %) -
+
+
+

Successful:

+
+ {{ testResults?.successful ?? 0 }} ({{ successfulPercentage }} %) +
+
+
+ +
+
-

Failed:

-
- {{ testResults?.failed ?? 0 }} ({{ failedPercentage }} %) -
+
+
+

Failed:

+
+ {{ testResults?.failed ?? 0 }} ({{ failedPercentage }} %) +
+
+
+ +
+
diff --git a/simulator-ui/src/main/webapp/app/home/test-result-summary.component.spec.ts b/simulator-ui/src/main/webapp/app/home/test-result-summary.component.spec.ts index e0f7de1dc..2afdda7ae 100644 --- a/simulator-ui/src/main/webapp/app/home/test-result-summary.component.spec.ts +++ b/simulator-ui/src/main/webapp/app/home/test-result-summary.component.spec.ts @@ -38,7 +38,26 @@ describe('TestResultSummaryComponent', () => { }); describe('ngOnInit', () => { - it('should correctly calculate percentages', fakeAsync(() => { + it('should correctly calculate fixed percentages', fakeAsync(() => { + const mockData = new HttpResponse({ + body: { + total: 3, + successful: 2, + failed: 1, + }, + }); + + testResultService.countByStatus.mockReturnValue(of(mockData)); + + component.ngOnInit(); + tick(); + + expect(component.testResults).toEqual(mockData.body); + expect(component.successfulPercentage).toEqual('66.67'); + expect(component.failedPercentage).toEqual('33.33'); + })); + + it('should return even numbers with even results', fakeAsync(() => { const mockData = new HttpResponse({ body: { total: 2, @@ -53,8 +72,8 @@ describe('TestResultSummaryComponent', () => { tick(); expect(component.testResults).toEqual(mockData.body); - expect(component.successfulPercentage).toEqual(50); - expect(component.failedPercentage).toEqual(50); + expect(component.successfulPercentage).toEqual('50'); + expect(component.failedPercentage).toEqual('50'); })); it('default to a zero-result', fakeAsync(() => { @@ -70,8 +89,9 @@ describe('TestResultSummaryComponent', () => { successful: 0, failed: 0, }); - expect(component.successfulPercentage).toEqual(0); - expect(component.failedPercentage).toEqual(0); + + expect(component.successfulPercentage).toEqual('0'); + expect(component.failedPercentage).toEqual('0'); })); }); }); diff --git a/simulator-ui/src/main/webapp/app/home/test-result-summary.component.ts b/simulator-ui/src/main/webapp/app/home/test-result-summary.component.ts index a9cf52556..e8e0b9c61 100644 --- a/simulator-ui/src/main/webapp/app/home/test-result-summary.component.ts +++ b/simulator-ui/src/main/webapp/app/home/test-result-summary.component.ts @@ -1,7 +1,9 @@ import { Component, OnInit } from '@angular/core'; +import { RouterModule } from '@angular/router'; import { map } from 'rxjs/operators'; +import { STATUS_FAILED, STATUS_SUCCESS } from 'app/entities/scenario-execution/scenario-execution.model'; import { TestResultsByStatus, TestResultService } from 'app/entities/test-result/service/test-result.service'; import SharedModule from 'app/shared/shared.module'; @@ -9,13 +11,16 @@ import SharedModule from 'app/shared/shared.module'; standalone: true, selector: 'app-test-result-summary', templateUrl: './test-result-summary.component.html', - imports: [SharedModule], + imports: [RouterModule, SharedModule], }) export default class TestResultSummaryComponent implements OnInit { testResults: TestResultsByStatus | null = null; - successfulPercentage = 0; - failedPercentage = 0; + successfulPercentage = '0'; + failedPercentage = '0'; + + statusSuccess = STATUS_SUCCESS; + statusFailed = STATUS_FAILED; constructor(private testResultService: TestResultService) {} @@ -31,9 +36,14 @@ export default class TestResultSummaryComponent implements OnInit { this.testResults = testResults; if (testResults.total > 0) { - this.successfulPercentage = (testResults.successful / testResults.total) * 100; - this.failedPercentage = (testResults.failed / testResults.total) * 100; + this.successfulPercentage = this.toFixedDecimalIfNotMatching((testResults.successful / testResults.total) * 100); + this.failedPercentage = this.toFixedDecimalIfNotMatching((testResults.failed / testResults.total) * 100); } }); } + + private toFixedDecimalIfNotMatching(percentage: number): string { + const fixed = percentage.toFixed(2); + return fixed.endsWith('.00') ? fixed.slice(0, fixed.length - 3) : fixed; + } } diff --git a/simulator-ui/src/main/webapp/app/layouts/error/error.component.ts b/simulator-ui/src/main/webapp/app/layouts/error/error.component.ts index 9767ef62a..41af1ba0e 100644 --- a/simulator-ui/src/main/webapp/app/layouts/error/error.component.ts +++ b/simulator-ui/src/main/webapp/app/layouts/error/error.component.ts @@ -6,7 +6,7 @@ import SharedModule from 'app/shared/shared.module'; @Component({ standalone: true, - selector: 'jhi-error', + selector: 'app-error', templateUrl: './error.component.html', imports: [SharedModule], }) diff --git a/simulator-ui/src/main/webapp/app/layouts/footer/footer.component.ts b/simulator-ui/src/main/webapp/app/layouts/footer/footer.component.ts index 94221e6b7..121e327df 100644 --- a/simulator-ui/src/main/webapp/app/layouts/footer/footer.component.ts +++ b/simulator-ui/src/main/webapp/app/layouts/footer/footer.component.ts @@ -6,7 +6,7 @@ import SharedModule from 'app/shared/shared.module'; @Component({ standalone: true, - selector: 'jhi-footer', + selector: 'app-footer', templateUrl: './footer.component.html', styleUrls: ['./footer.component.scss'], imports: [SharedModule], diff --git a/simulator-ui/src/main/webapp/app/layouts/main/main.component.html b/simulator-ui/src/main/webapp/app/layouts/main/main.component.html index 3ac9be942..62dcdb9cc 100644 --- a/simulator-ui/src/main/webapp/app/layouts/main/main.component.html +++ b/simulator-ui/src/main/webapp/app/layouts/main/main.component.html @@ -1,4 +1,4 @@ - +
@@ -9,5 +9,5 @@
- +

diff --git a/simulator-ui/src/main/webapp/app/layouts/main/main.component.ts b/simulator-ui/src/main/webapp/app/layouts/main/main.component.ts index c18b667b1..f47dcc94c 100644 --- a/simulator-ui/src/main/webapp/app/layouts/main/main.component.ts +++ b/simulator-ui/src/main/webapp/app/layouts/main/main.component.ts @@ -6,7 +6,7 @@ import { AppPageTitleStrategy } from 'app/app-page-title-strategy'; import { Router } from '@angular/router'; @Component({ - selector: 'jhi-main', + selector: 'app-main', templateUrl: './main.component.html', providers: [AppPageTitleStrategy], }) diff --git a/simulator-ui/src/main/webapp/app/layouts/navbar/navbar.component.html b/simulator-ui/src/main/webapp/app/layouts/navbar/navbar.component.html index f0c35892b..6727758fd 100644 --- a/simulator-ui/src/main/webapp/app/layouts/navbar/navbar.component.html +++ b/simulator-ui/src/main/webapp/app/layouts/navbar/navbar.component.html @@ -35,6 +35,14 @@ +
  • +

    - + - +
    No Scenarios found @@ -49,6 +49,21 @@

    Launch +