Skip to content

Commit

Permalink
Merge branch 'develop' into feat/xd-153
Browse files Browse the repository at this point in the history
  • Loading branch information
Sabo2k committed Jul 11, 2024
2 parents 46e2f9b + ee384bd commit 4473325
Show file tree
Hide file tree
Showing 166 changed files with 6,238 additions and 9,062 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ DATABASE_URL=postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:$

# Frontend
XD_API_URL=http://${BACKEND_HOST}:${BACKEND_PORT}
SECRET_KEY=SecretKey

# Swagger
# Just the subpath of the URL where the Swagger UI will be available
Expand Down
6 changes: 5 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,11 @@
},
{
"sourceTag": "domain:facilities",
"onlyDependOnLibsWithTags": ["domain:facilities", "domain:common"]
"onlyDependOnLibsWithTags": [
"domain:facilities",
"domain:common",
"domain:cases"
]
},
{
"sourceTag": "domain:common",
Expand Down
3 changes: 2 additions & 1 deletion .lintstagedrc.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'*.{ts}':
- nx run-many --target lint
'*.{json,md,yml}':
- nx format:write --uncommitted
'*.{scss,css}':
- nx affected --target stylelint --fix
- nx format:write --uncommitted
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
81 changes: 81 additions & 0 deletions Deliverables/sprint-08/feature-board.csv

Large diffs are not rendered by default.

Binary file added Deliverables/sprint-08/feature-board.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Deliverables/sprint-08/planning-documents.pdf
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
92 changes: 92 additions & 0 deletions Deliverables/sprint-09/feature-board.csv

Large diffs are not rendered by default.

Binary file added Deliverables/sprint-09/feature-board.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Deliverables/sprint-09/planning-document.pdf
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
104 changes: 104 additions & 0 deletions Deliverables/sprint-10/feature-board.csv

Large diffs are not rendered by default.

Binary file added Deliverables/sprint-10/feature-board.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Deliverables/sprint-10/planning-documents.pdf
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Deliverables/sprint-11/demo-day-video.mp4
Binary file not shown.
14 changes: 7 additions & 7 deletions apps/backend/src/app/config/classes/environment.class.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IsDefined, IsNumber, IsString, IsUrl, MinLength } from 'class-validator';
import { IsDefined, IsNumber, IsOptional, IsString, MinLength } from 'class-validator';

/* Interfaces */
import { IEnvironmentVariables } from '../interfaces/environment.interface';
Expand Down Expand Up @@ -95,10 +95,10 @@ export class EnvironmentVariables implements IEnvironmentVariables {
@MinLength(1)
INSIGHT_HUB_API_KEY?: string;

/**
* The URL of the Swagger UI
*/
@IsDefined()
@IsString()
SWAGGER_URL_PATH: string;
/**
* The URL of the Swagger UI
*/
@IsOptional()
@IsString()
SWAGGER_URL_PATH?: string;
}
6 changes: 3 additions & 3 deletions apps/backend/src/app/config/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const generateConfig = (config: IEnvironmentVariables): BackendConfig =>
apiUrl: config.INSIGHT_HUB_API_URL,
apiKey: config.INSIGHT_HUB_API_KEY,
},
swagger: {
urlPath: config.SWAGGER_URL_PATH,
}
swagger: {
urlPath: config.SWAGGER_URL_PATH || 'swagger',
},
} as BackendConfig);
2 changes: 2 additions & 0 deletions apps/frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ RUN pnpm install --frozen-lockfile
FROM base as builder

ARG XD_API_URL
ARG XD_SECRET_KEY

ENV NX_DEAMON="false"
ENV XD_API_URL=$XD_API_URL
ENV XD_SECRET_KEY=$XD_SECRET_KEY

COPY --from=installer /usr/src/app/node_modules ./node_modules

Expand Down
25 changes: 13 additions & 12 deletions apps/frontend/src/app/app.routes.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Route } from '@angular/router';
import { AuthenticationGuard } from 'common-frontend-models';

import { HeaderComponent } from './components/header/header.component';

Expand All @@ -7,26 +8,27 @@ export const APP_ROUTES: Route[] = [
path: '',
component: HeaderComponent,
data: {
breadcrumbs: {
label: 'Home',
url: '/',
},
breadcrumb: 'Home',
title: 'Home Page',
subtitle: '',
},
children: [
{
path: '',
canActivate: [AuthenticationGuard],
loadComponent: () =>
import('./pages/home/home.component').then((m) => m.HomeComponent),
},
{
path: 'home',
canActivate: [AuthenticationGuard],
redirectTo: '',
},
{
path: 'facilities',
canActivate: [AuthenticationGuard],
data: {
breadcrumbs: {
label: 'Facilities',
url: 'facilities',
},
breadcrumb: 'Facilities',
title: 'Facilities Dashboard',
subtitle: 'List of all Facilities',
},
Expand All @@ -35,11 +37,9 @@ export const APP_ROUTES: Route[] = [
},
{
path: 'cases',
canActivate: [AuthenticationGuard],
data: {
breadcrumbs: {
label: 'Cases',
url: 'cases',
},
breadcrumb: 'Cases',
title: 'Cases',
subtitle: '',
},
Expand All @@ -50,6 +50,7 @@ export const APP_ROUTES: Route[] = [
},
{
path: 'not-found',
canActivate: [AuthenticationGuard],
loadComponent: () =>
import('./pages/not-found/not-found.component').then((m) => m.NotFoundComponent),
},
Expand Down
77 changes: 41 additions & 36 deletions apps/frontend/src/app/components/header/header.component.html
Original file line number Diff line number Diff line change
@@ -1,43 +1,48 @@
<ix-application class="h-screen !z-0">
<ix-application-header name="Xcelerator Demo App">
<button class="placeholder-logo" slot="logo" [routerLink]="['/']">
<img
src="https://cdn.c2comms.cloud/images/logo-collection/2.1/sie-logo-white-rgb.svg"
class="h-5"
alt="Siemens logo"
/>
</button>
<ix-button class="mt-1" variant="secondary" ghost>
Powered by Siemens Xcelerator
</ix-button>
<ix-avatar username="John Doe" extra="Administrator"> </ix-avatar>
</ix-application-header>
<ix-application-header name="Xcelerator Demo App">
<button class="placeholder-logo" slot="logo" [routerLink]="['/']">
<img
[src]="lightMode() ?
'https://cdn.c2comms.cloud/images/logo-collection/2.1/sie-logo-black-rgb.svg':
'https://cdn.c2comms.cloud/images/logo-collection/2.1/sie-logo-white-rgb.svg'"
class="h-5"
alt="Siemens logo"
/>
</button>
<ix-button class="mt-1" variant="secondary">
Powered by Siemens Xcelerator
</ix-button>
<ix-avatar [username]="userMail" extra="Administrator">
<ix-dropdown-item label="Logout" (click)="logout()"></ix-dropdown-item>
</ix-avatar>
</ix-application-header>

<ix-breadcrumb visibleItemCount="3" class="ml-8">
@for (breadcrumb of breadcrumbs(); track breadcrumb.url) {
<ix-breadcrumb-item
[routerLink]="[breadcrumb.url]"
[label]="breadcrumb.label"
></ix-breadcrumb-item>
}
</ix-breadcrumb>
<ix-breadcrumb visibleItemCount="3" class="ml-8">
@for (breadcrumb of breadcrumbs(); track breadcrumb; let i=$index; let length=$count) {
<ix-breadcrumb-item
[label]="breadcrumb"
[routerLink]="cutUrl(length - i - 1)"
></ix-breadcrumb-item>
}
</ix-breadcrumb>

<ix-content-header
class="pl-4 pt-4"
[hasBackButton]="backButtonPresent()"
[headerTitle]="title()"
[headerSubtitle]="subtitle()"
(backButtonClick)="goBack()"
></ix-content-header>
@if (!isHomePage()){
<div class="absolute top-10 right-4 !z-[50] flex flex-row-reverse gap-x-4">
<ix-button icon="refresh" (click)="refresh()">Refresh</ix-button>
</div>
}

<ix-menu>
<ix-menu-item icon="building1" [routerLink]="['/facilities']">Facilities</ix-menu-item>
<ix-menu-item icon="tasks-open" [routerLink]="['/cases']">Cases</ix-menu-item>
<ix-menu>
<ix-menu-item icon="home" [routerLink]="['/']">Home</ix-menu-item>
<ix-menu-item icon="building1" [routerLink]="['/facilities']">Facilities</ix-menu-item>
<ix-menu-item icon="tasks-open" [routerLink]="['/cases']">Cases</ix-menu-item>
<ix-menu-item [icon]="lightMode() ? 'sun-filled' : 'sun'" slot="bottom" (click)="toggleMode()">toggle theme</ix-menu-item>

<ix-menu-about>
<app-legal-information></app-legal-information>
</ix-menu-about>
</ix-menu>
<ix-menu-about>
<app-legal-information></app-legal-information>
</ix-menu-about>
</ix-menu>

<router-outlet></router-outlet>

<router-outlet></router-outlet>
</ix-application>
20 changes: 13 additions & 7 deletions apps/frontend/src/app/components/header/header.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,26 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
import { ActivatedRoute, NavigationEnd, Router, RouterEvent } from '@angular/router';
import { ReplaySubject } from 'rxjs';

import { HeaderComponent, IBreadcrumbData } from './header.component';
import { HeaderComponent } from './header.component';

const HEADER_ROUTES = {
snapshot: {
firstChild: {
routeConfig: {
path: '',
},
},
},
root: {
snapshot: {
data: {
breadcrumbs: { label: 'Layer 1', url: '/layer1' } as IBreadcrumbData,
breadcrumb: 'Layer 1',
},
},
firstChild: {
snapshot: {
data: {
breadcrumbs: { label: 'Layer 2', url: '/layer2' } as IBreadcrumbData,
breadcrumb: 'Layer 2',
},
},
},
Expand All @@ -30,10 +37,11 @@ describe('HeaderComponent', () => {
beforeEach(async () => {
routerMock = {
events: eventsSubject.asObservable(),
url: '/Layer1/Layer2',
} as unknown as Router;

await TestBed.configureTestingModule({
imports: [ HeaderComponent ],
imports: [HeaderComponent],
providers: [
{
provide: ActivatedRoute,
Expand Down Expand Up @@ -71,8 +79,6 @@ describe('HeaderComponent', () => {
eventsSubject.next(new NavigationEnd(1, '', ''));

const breadcrumbs = component.breadcrumbs();
expect(breadcrumbs.length).toBe(2);
expect(breadcrumbs[0]).toEqual({ label: 'Layer 1', url: '/layer1' });
expect(breadcrumbs[1]).toEqual({ label: 'Layer 2', url: '/layer2' });
expect(breadcrumbs).toEqual(['Layer 1', 'Layer 2']);
});
});
Loading

0 comments on commit 4473325

Please sign in to comment.