diff --git a/libs/cases/frontend/domain/src/lib/application/facades/browse.facades.spec.ts b/libs/cases/frontend/domain/src/lib/application/facades/cases.facade.spec.ts
similarity index 76%
rename from libs/cases/frontend/domain/src/lib/application/facades/browse.facades.spec.ts
rename to libs/cases/frontend/domain/src/lib/application/facades/cases.facade.spec.ts
index 25f9d0aa..dee34471 100644
--- a/libs/cases/frontend/domain/src/lib/application/facades/browse.facades.spec.ts
+++ b/libs/cases/frontend/domain/src/lib/application/facades/cases.facade.spec.ts
@@ -3,10 +3,10 @@ import { ICaseParams } from '@frontend/cases/shared/models';
import { firstValueFrom, of } from 'rxjs';
import { XdCasesRequestService } from '../../infrastructure/cases-request.service';
-import { XdBrowseFacadesService } from './browse.facades';
+import { XdCasesFacade } from './cases.facade';
-describe('XdBrowseFacadesService', () => {
- let service: XdBrowseFacadesService;
+describe('XdCasesFacade', () => {
+ let facade: XdCasesFacade;
let casesRequestService: XdCasesRequestService;
beforeEach(() => {
@@ -17,22 +17,22 @@ describe('XdBrowseFacadesService', () => {
TestBed.configureTestingModule({
providers: [
- XdBrowseFacadesService,
+ XdCasesFacade,
{ provide: XdCasesRequestService, useValue: timeseriesRequestServiceMock },
],
});
- service = TestBed.inject(XdBrowseFacadesService);
+ facade = TestBed.inject(XdCasesFacade);
casesRequestService = TestBed.inject(XdCasesRequestService);
});
it('should be created', () => {
- expect(service).toBeTruthy();
+ expect(facade).toBeTruthy();
});
describe('getAllTimeseries', () => {
it('should call getAllTimeseries of TimeseriesRequestService', async () => {
- const response = await firstValueFrom(service.getAllCases());
+ const response = await firstValueFrom(facade.getAllCases());
expect(casesRequestService.getAllCases).toHaveBeenCalledTimes(1);
expect(response).toEqual([]);
@@ -43,7 +43,7 @@ describe('XdBrowseFacadesService', () => {
it('should call getTimeSeries of TimeseriesRequestService with correct parameters', async () => {
const params: ICaseParams = { id: 1 } as ICaseParams;
- const response = await firstValueFrom(service.getTimeSeries(params));
+ const response = await firstValueFrom(facade.getTimeSeries(params));
expect(casesRequestService.getTimeSeries).toHaveBeenCalledWith(params);
expect(response).toEqual({});
diff --git a/libs/cases/frontend/domain/src/lib/application/facades/browse.facades.ts b/libs/cases/frontend/domain/src/lib/application/facades/cases.facade.ts
similarity index 96%
rename from libs/cases/frontend/domain/src/lib/application/facades/browse.facades.ts
rename to libs/cases/frontend/domain/src/lib/application/facades/cases.facade.ts
index 4e11ade1..89d8a9c5 100644
--- a/libs/cases/frontend/domain/src/lib/application/facades/browse.facades.ts
+++ b/libs/cases/frontend/domain/src/lib/application/facades/cases.facade.ts
@@ -8,7 +8,7 @@ import { XdCasesRequestService } from '../../infrastructure/cases-request.servic
* Browse facades service.
*/
@Injectable({ providedIn: 'root' })
-export class XdBrowseFacadesService {
+export class XdCasesFacade {
private readonly _scanService = inject(XdCasesRequestService);
/**
diff --git a/libs/cases/frontend/domain/src/lib/application/facades/index.ts b/libs/cases/frontend/domain/src/lib/application/facades/index.ts
index 069f0a8a..5ce2c239 100644
--- a/libs/cases/frontend/domain/src/lib/application/facades/index.ts
+++ b/libs/cases/frontend/domain/src/lib/application/facades/index.ts
@@ -1 +1 @@
-export * from './browse.facades';
+export * from './cases.facade';
diff --git a/libs/cases/frontend/shell/src/lib/shell.routes.ts b/libs/cases/frontend/shell/src/lib/shell.routes.ts
index be449522..aecaa33e 100644
--- a/libs/cases/frontend/shell/src/lib/shell.routes.ts
+++ b/libs/cases/frontend/shell/src/lib/shell.routes.ts
@@ -25,12 +25,7 @@ export const CASES_SHELL_ROUTES: Route[] = [
// Route to create a case
path: 'create',
data: {
- breadcrumbs: {
- label: 'Create',
- url: 'cases/create',
- },
- title: 'Create a Case',
- subtitle: '',
+ breadcrumb: 'Create',
},
loadComponent: () =>
import('cases-frontend-view').then((m) => m.CreateCaseComponent),
@@ -39,12 +34,7 @@ export const CASES_SHELL_ROUTES: Route[] = [
// Route to detail case
path: ':id',
data: {
- breadcrumbs: {
- label: 'Details',
- url: 'cases/:id',
- },
- title: 'Detail of case',
- subtitle: '',
+ breadcrumb: 'Details',
},
loadComponent: () =>
import('cases-frontend-view').then((m) => m.DetailCaseComponent),
diff --git a/libs/cases/frontend/view/src/lib/components/case-browse/case-browse.component.html b/libs/cases/frontend/view/src/lib/components/case-browse/case-browse.component.html
index 10463b87..6f576582 100644
--- a/libs/cases/frontend/view/src/lib/components/case-browse/case-browse.component.html
+++ b/libs/cases/frontend/view/src/lib/components/case-browse/case-browse.component.html
@@ -1,30 +1,37 @@
- Create Case
+ Create Case
+
+
-
-
-
+
+
open
-
- in progress
+ in progress
-
- on hold
-
-
+
- done
+ done
cancelled
archived
-
+
emergencies
@@ -58,8 +62,7 @@
high
medium
@@ -82,42 +85,41 @@
incident
annotation
-
+
-
-
-
- # |
- Title |
- Status |
- Priority |
- Type |
- Due to |
- Description |
-
-
-
- @for (_case of _sortedCases(); track _case.id) {
-
- {{ _case.handle }} |
- {{ _case.title }} |
+
+
+
+ # |
+ Title |
+ Status |
+ Priority |
+ Type |
+ Due to |
+ Description |
+
+
+
+ @for (_case of _sortedCases(); track _case.id) {
+
+ {{ _case.handle }} |
+ {{ _case.title }} |
{{ _case.status }} |
- {{ _case.priority }} |
+ {{ _case.priority }} |
{{ _case.type }} |
- {{ _case.dueDate }} |
- {{ _case.description }} |
-
- }
-
-
+ {{ _case.dueDate }} |
+ {{ _case.description }} |
+
+ }
+
+
diff --git a/libs/cases/frontend/view/src/lib/components/case-browse/case-browse.component.scss b/libs/cases/frontend/view/src/lib/components/case-browse/case-browse.component.scss
index 13514df1..b2b2f685 100644
--- a/libs/cases/frontend/view/src/lib/components/case-browse/case-browse.component.scss
+++ b/libs/cases/frontend/view/src/lib/components/case-browse/case-browse.component.scss
@@ -1,7 +1,27 @@
-@import 'libs/cases/shared/models/src/lib/styles/case.scss';
+.table {
+ cursor: pointer;
+ & .emergency {
+ background-color: #ff26401a;
+ }
-.table .clickable-row {
- cursor: pointer; /* Changes the cursor to a hand */
+ & .status-open {
+ }
+
+ & .status-inprogress {
+ color: #ff9000;
+ }
+
+ & .status-overdue {
+ color: #ff2640;
+ }
+
+ & .status-onhold {
+ color: #00b5d1;
+ }
+
+ & .status-done {
+ color: #01c151;
+ }
}
.toggle-pill {
diff --git a/libs/cases/frontend/view/src/lib/components/case-browse/case-browse.component.ts b/libs/cases/frontend/view/src/lib/components/case-browse/case-browse.component.ts
index 2e1f05b0..1d773a2d 100644
--- a/libs/cases/frontend/view/src/lib/components/case-browse/case-browse.component.ts
+++ b/libs/cases/frontend/view/src/lib/components/case-browse/case-browse.component.ts
@@ -8,8 +8,8 @@ import {
ViewEncapsulation,
} from '@angular/core';
import { toSignal } from '@angular/core/rxjs-interop';
-import { RouterLink } from '@angular/router';
-import { XdBrowseFacadesService } from '@frontend/cases/frontend/domain';
+import { ActivatedRoute, Router, RouterLink } from '@angular/router';
+import { XdCasesFacade } from '@frontend/cases/frontend/domain';
import { ICaseResponse } from '@frontend/cases/shared/models';
import { IxModule } from '@siemens/ix-angular';
@@ -40,8 +40,8 @@ export class CaseBrowseComponent {
protected readonly showStatusCancelled = signal(false);
protected readonly showStatusArchived = signal(false);
- protected readonly _browseFacade = inject(XdBrowseFacadesService);
- protected readonly _cases = toSignal(this._browseFacade.getAllCases());
+ protected readonly _casesFacade = inject(XdCasesFacade);
+ protected readonly _cases = toSignal(this._casesFacade.getAllCases());
protected readonly _sortedCases = computed(() => {
let cases = this._cases();
if (cases === undefined) {
@@ -131,6 +131,11 @@ export class CaseBrowseComponent {
return cases;
});
+ constructor(
+ protected router: Router,
+ protected route: ActivatedRoute
+ ) {}
+
getStatusClasses(_case: ICaseResponse) {
return {
emergency: _case.priority === 'EMERGENCY',
diff --git a/libs/cases/frontend/view/src/lib/components/cases-browse/index.ts b/libs/cases/frontend/view/src/lib/components/cases-browse/index.ts
deleted file mode 100644
index a9133b58..00000000
--- a/libs/cases/frontend/view/src/lib/components/cases-browse/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from './case-browse.component';
diff --git a/libs/cases/frontend/view/src/lib/components/create-case/create-case.component.html b/libs/cases/frontend/view/src/lib/components/create-case/create-case.component.html
index a2e5899a..9eb9dd1a 100644
--- a/libs/cases/frontend/view/src/lib/components/create-case/create-case.component.html
+++ b/libs/cases/frontend/view/src/lib/components/create-case/create-case.component.html
@@ -1,3 +1,11 @@
+
+
- }
+}
diff --git a/libs/cases/frontend/view/src/lib/components/detail-case/detail-case.component.ts b/libs/cases/frontend/view/src/lib/components/detail-case/detail-case.component.ts
index 768107b4..65423b4d 100644
--- a/libs/cases/frontend/view/src/lib/components/detail-case/detail-case.component.ts
+++ b/libs/cases/frontend/view/src/lib/components/detail-case/detail-case.component.ts
@@ -2,8 +2,8 @@ import { CommonModule } from '@angular/common';
import { ChangeDetectionStrategy, Component, computed, inject, ViewEncapsulation } from '@angular/core';
import { toSignal } from '@angular/core/rxjs-interop';
import { FormsModule } from '@angular/forms';
-import { ActivatedRoute, RouterLink } from '@angular/router';
-import { XdBrowseFacadesService } from '@frontend/cases/frontend/domain';
+import { ActivatedRoute, Router, RouterLink } from '@angular/router';
+import { XdCasesFacade } from '@frontend/cases/frontend/domain';
import { ECasePriority, ECaseStatus, ECaseType, ICaseResponse } from '@frontend/cases/shared/models';
import { IxModule, ModalService, ToastService } from '@siemens/ix-angular';
@@ -13,15 +13,15 @@ import DeleteModalComponent from './delete-modal/deleteModal.component';
@Component({
selector: 'lib-detail-case',
standalone: true,
- imports: [ CommonModule, FormsModule, IxModule, RouterLink ],
+ imports: [CommonModule, FormsModule, IxModule, RouterLink],
templateUrl: './detail-case.component.html',
- styleUrls: [ './detail-case.component.scss' ],
+ styleUrls: ['./detail-case.component.scss'],
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class DetailCaseComponent {
- private readonly _browseFacade = inject(XdBrowseFacadesService);
- protected readonly _cases = toSignal(this._browseFacade.getAllCases());
+ private readonly _casesFacade = inject(XdCasesFacade);
+ protected readonly _cases = toSignal(this._casesFacade.getAllCases());
protected readonly casedetail = computed(() => {
const _case = this._cases();
if (_case === undefined) {
@@ -33,15 +33,18 @@ export class DetailCaseComponent {
isEditing = false;
datePattern = /^\d{4}-\d{2}-\d{2}T00:00:00\.000Z$/;
-
- constructor(private route: ActivatedRoute, private readonly _modalService: ModalService, private readonly toastService: ToastService) {
- }
+ constructor(
+ protected router: Router,
+ protected route: ActivatedRoute,
+ private readonly _modalService: ModalService,
+ private readonly toastService: ToastService
+ ) {}
deleteCase() {
const caseId = this.mapCaseId(this.casedetail());
if (caseId !== undefined) {
// The subscribe is necessary, otherwise the request is not sent
- this._browseFacade.deleteCase(caseId).subscribe();
+ this._casesFacade.deleteCase(caseId).subscribe();
}
}
@@ -81,7 +84,7 @@ export class DetailCaseComponent {
onSubmit(): void {
const casedetail = this.casedetail();
- if(casedetail !== undefined) {
+ if (casedetail !== undefined) {
const validationString = this.validateForm(casedetail);
if (validationString === 'valid') {
const caseId = this.mapCaseId(this.casedetail());
@@ -89,7 +92,7 @@ export class DetailCaseComponent {
if (caseId !== undefined && caseData !== undefined) {
// The subscribe is necessary, otherwise the request is not sent
- this._browseFacade.updateCase(caseId, caseData).subscribe({});
+ this._casesFacade.updateCase(caseId, caseData).subscribe({});
}
this.isEditing = false;
} else {
@@ -98,7 +101,7 @@ export class DetailCaseComponent {
}
}
- validateForm(casedetail: ICaseResponse ) {
+ validateForm(casedetail: ICaseResponse) {
if (casedetail !== undefined) {
diff --git a/libs/cases/shared/models/src/lib/styles/case.scss b/libs/cases/shared/models/src/lib/styles/case.scss
deleted file mode 100644
index 3669394a..00000000
--- a/libs/cases/shared/models/src/lib/styles/case.scss
+++ /dev/null
@@ -1,28 +0,0 @@
-.table {
- color: #777784;
-
- & .emergency {
- background-color: #ff26401a;
- color: #ffffffbf;
- }
-
- & .status-open {
- color: #ffffffbf;
- }
-
- & .status-inprogress {
- color: #ff9000;
- }
-
- & .status-overdue {
- color: #ff2640;
- }
-
- & .status-onhold {
- color: #00b5d1;
- }
-
- & .status-done {
- color: #01c151;
- }
-}
diff --git a/libs/facilities/frontend/shell/src/lib/shell.routes.ts b/libs/facilities/frontend/shell/src/lib/shell.routes.ts
index 9e666571..8234a557 100644
--- a/libs/facilities/frontend/shell/src/lib/shell.routes.ts
+++ b/libs/facilities/frontend/shell/src/lib/shell.routes.ts
@@ -24,12 +24,7 @@ export const FACILITIES_SHELL_ROUTES: Route[] = [
// Route to detail page
path: ':id',
data: {
- breadcrumbs: {
- label: 'Details',
- url: 'facilities/:id',
- },
- title: 'Details of Facility',
- subtitle: '',
+ breadcrumb: 'Details',
},
loadComponent: () => import('facilities-frontend-view').then((m) => m.XdDetailPage),
},
diff --git a/libs/facilities/frontend/view/src/lib/components/browse/browse.page.html b/libs/facilities/frontend/view/src/lib/components/browse/browse.page.html
index 58bf2216..70f718dd 100644
--- a/libs/facilities/frontend/view/src/lib/components/browse/browse.page.html
+++ b/libs/facilities/frontend/view/src/lib/components/browse/browse.page.html
@@ -6,6 +6,15 @@
{{ filter() ? 'Remove Filter for Issues' : 'Filter Facilities with Issues' }}
+
+