diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f19b430 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/letsco-common/letsco-common.iml +/letsco-core.iml diff --git a/README.md b/README.md index 59a3116..acbce1a 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,7 @@ # Let's Coordinate - Getting started +
## 1. Prerequisites @@ -30,12 +31,14 @@ git clone https://github.com/opfab/letscoordinate.git #### 2.2. Run Operator Fabric +> /!\ The minimal required version of OperatorFabric is: **1.7.0.RELEASE** + Clone the *operatorfabric-getting-started* git project: ``` git clone https://github.com/opfab/operatorfabric-getting-started.git ``` -Copy files "*web-ui.json*", "*docker-compose.yml*" and "*favicon.ico*" from "*letscoordinate/test/prepare-opfab-env/opfab-config*" directory and past them into "*operatorfabric-getting-started/server*". Overwrite the existing files when asked! +Copy files "*docker-compose.yml*", "*favicon.ico*", "*ngnix.conf*" and "*web-ui.json*" from "*letscoordinate/test/prepare-opfab-env/opfab-config*" directory and past them into "*operatorfabric-getting-started/server*". Overwrite the existing files when asked! In the directory "*operatorfabric-getting-started/server*" launch the following command: ``` diff --git a/bin/docker-compose.yml b/bin/docker-compose.yml index d143af1..aa67a0d 100644 --- a/bin/docker-compose.yml +++ b/bin/docker-compose.yml @@ -7,7 +7,7 @@ # SPDX-License-Identifier: MPL-2.0 # This file is part of the Let’s Coordinate project. -version: '3.7' +version: '3.3' services: zookeeper: diff --git a/dockerfiles/front/Dockerfile b/dockerfiles/front/Dockerfile new file mode 100644 index 0000000..8f06f32 --- /dev/null +++ b/dockerfiles/front/Dockerfile @@ -0,0 +1,22 @@ +# Copyright (c) 2020, RTE (https://www.rte-france.com) +# Copyright (c) 2020 RTE international (https://www.rte-international.com) +# See AUTHORS.txt +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# SPDX-License-Identifier: MPL-2.0 +# This file is part of the Let’s Coordinate project. + +FROM nginx + +RUN rm /etc/nginx/nginx.conf +RUN mkdir /var/www +RUN mkdir /var/www/letsco + +COPY ./nginx.conf /etc/nginx +COPY ./letsco-front /var/www/letsco + +RUN rm /var/www/letsco/letsco-env/env.js + +EXPOSE 80 +EXPOSE 8080 diff --git a/dockerfiles/front/Dockerfile-with-envjs b/dockerfiles/front/Dockerfile-with-envjs new file mode 100644 index 0000000..6f191ec --- /dev/null +++ b/dockerfiles/front/Dockerfile-with-envjs @@ -0,0 +1,20 @@ +# Copyright (c) 2020, RTE (https://www.rte-france.com) +# Copyright (c) 2020 RTE international (https://www.rte-international.com) +# See AUTHORS.txt +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# SPDX-License-Identifier: MPL-2.0 +# This file is part of the Let’s Coordinate project. + +FROM nginx + +RUN rm /etc/nginx/nginx.conf +RUN mkdir /var/www +RUN mkdir /var/www/letsco + +COPY ./nginx.conf /etc/nginx +COPY ./letsco-front /var/www/letsco + +EXPOSE 80 +EXPOSE 8080 diff --git a/dockerfiles/front/nginx.conf b/dockerfiles/front/nginx.conf new file mode 100644 index 0000000..ef5518d --- /dev/null +++ b/dockerfiles/front/nginx.conf @@ -0,0 +1,50 @@ +# Copyright (c) 2020, RTE (https://www.rte-france.com) +# Copyright (c) 2020 RTE international (https://www.rte-international.com) +# See AUTHORS.txt +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# SPDX-License-Identifier: MPL-2.0 +# This file is part of the Let’s Coordinate project. + +user nginx; +worker_processes 1; + +error_log /var/log/nginx/error.log warn; +pid /var/run/nginx.pid; + + +events { + worker_connections 1024; +} + + +http { + include /etc/nginx/mime.types; + default_type application/octet-stream; + + log_format main '$remote_addr - $remote_user [$time_local] "$request" ' + '$status $body_bytes_sent "$http_referer" ' + '"$http_user_agent" "$http_x_forwarded_for"'; + + access_log /var/log/nginx/access.log main; + + sendfile on; + #tcp_nopush on; + + keepalive_timeout 65; + + #gzip on; + + include /etc/nginx/conf.d/*.conf; + + server { + listen 8080; + server_name localhost; + location / { + root /var/www/letsco; + index index.html index.htm; + try_files $uri $uri/ /index.html; + } + } +} diff --git a/dockerfiles/front/run_locally.sh b/dockerfiles/front/run_locally.sh new file mode 100755 index 0000000..12a25ad --- /dev/null +++ b/dockerfiles/front/run_locally.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +# Copyright (c) 2020, RTE (https://www.rte-france.com) +# Copyright (c) 2020 RTE international (https://www.rte-international.com) +# See AUTHORS.txt +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# SPDX-License-Identifier: MPL-2.0 +# This file is part of the Let’s Coordinate project. + +if [ ! -z $1 ]; then + tag=$1 + echo "Tag: $tag" +else + echo "You must specify a tag" + exit 1 +fi + +cd ../../letsco-front +ng build --prod --base-href /letsco --deploy-url /letsco/ +cd - +rm -rf ./letsco-front +cp -r ../../letsco-front/dist/letsco-front . +JS_FILES=$(ls letsco-front/ | grep -E '(\.js|\.css|assets)' | xargs echo) +cd letsco-front/ && mv $JS_FILES letsco && cd - + +docker build --tag=nginx-letsco-front -f ./Dockerfile-with-envjs . && \ +docker stop nginx-letsco ; docker rm nginx-letsco ; \ +docker run -d -p 4200:8080 --name nginx-letsco nginx-letsco-front diff --git a/dockerfiles/front/todo.sh b/dockerfiles/front/todo.sh new file mode 100755 index 0000000..c476faa --- /dev/null +++ b/dockerfiles/front/todo.sh @@ -0,0 +1,37 @@ +#!/bin/bash + +# Copyright (c) 2020, RTE (https://www.rte-france.com) +# Copyright (c) 2020 RTE international (https://www.rte-international.com) +# See AUTHORS.txt +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# SPDX-License-Identifier: MPL-2.0 +# This file is part of the Let’s Coordinate project. + +if [ ! -z $1 ]; then + tag=$1 + echo "Tag: $tag" +else + echo "You must specify a tag" + exit 1 +fi + +cd ../../letsco-front +ng build --prod --base-href /letsco --deploy-url /letsco/ +cd - +rm -rf ./letsco-front +cp -r ../../letsco-front/dist/letsco-front . +JS_FILES=$(ls letsco-front/ | grep -E '(\.js|\.css|assets)' | xargs echo) +cd letsco-front/ && mv $JS_FILES letsco && cd - +docker build --tag=letscoordinate/frontend:latest . +docker build --tag=letscoordinate/frontend:${tag} . +docker push letscoordinate/frontend:latest +docker push letscoordinate/frontend:${tag} + +if [ ! -z $runLocally ]; then + docker build --tag=nginx-letsco-front -f ./Dockerfile-with-env.js . && \ + docker stop nginx-letsco ; sudo docker rm nginx-letsco ; \ + docker run -d -p 4200:8080 --name nginx-letsco nginx-letsco-front +fi + diff --git a/letsco-api/src/main/java/org/lfenergy/letscoordinate/backend/component/OpfabPublisherComponent.java b/letsco-api/src/main/java/org/lfenergy/letscoordinate/backend/component/OpfabPublisherComponent.java index 5d6a605..56d7c23 100644 --- a/letsco-api/src/main/java/org/lfenergy/letscoordinate/backend/component/OpfabPublisherComponent.java +++ b/letsco-api/src/main/java/org/lfenergy/letscoordinate/backend/component/OpfabPublisherComponent.java @@ -18,6 +18,7 @@ import org.lfenergy.letscoordinate.backend.config.OpfabConfig; import org.lfenergy.letscoordinate.backend.dto.eventmessage.EventMessageDto; import org.lfenergy.letscoordinate.backend.dto.eventmessage.header.BusinessDataIdentifierDto; +import org.lfenergy.letscoordinate.backend.dto.eventmessage.payload.ValidationDto; import org.lfenergy.letscoordinate.backend.dto.eventmessage.payload.ValidationMessageDto; import org.lfenergy.letscoordinate.backend.enums.ValidationSeverityEnum; import org.lfenergy.letscoordinate.backend.model.opfab.ValidationData; @@ -70,6 +71,21 @@ public Card generateOpfabCard(EventMessageDto eventMessageDto, Long id) { return card; } + String getValidationName(EventMessageDto eventMessageDto) { + ValidationSeverityEnum result = eventMessageDto.getPayload().getValidation().getResult(); + + switch (result) { + case OK: + return POSITIVE_ACK; + case WARNING: + return POSITIVE_ACK_WITH_WARNINGS; + case ERROR: + return NEGATIVE_ACK; + default: + return ""; + } + } + void setCardHeadersAndTags(Card card, EventMessageDto eventMessageDto, Long id) { String source = eventMessageDto.getHeader().getSource(); @@ -93,7 +109,21 @@ public void setOpfabCardDates(Card card, EventMessageDto eventMessageDto) { Instant businessDayTo = businessDataIdentifierDto.getBusinessDayTo() .orElse(businessDayFrom.plus(Duration.ofHours(24))); - card.setTimeSpans(Collections.singletonList(new TimeSpan().start(businessDayFrom).end(businessDayTo))); + List timeSpans = new ArrayList<>(); + ValidationDto validation = eventMessageDto.getPayload().getValidation(); + if (validation != null && validation.getValidationMessages().isPresent() && !validation.getValidationMessages().get().isEmpty()) { + // LC-208 MR-1: If the card contains validation errors and/or warnings, we display a bubble in the timeline + // for each error and/or warning found. No bubble to display for the card’s arrival time in this case. + timeSpans = validation.getValidationMessages().get().stream() + .map(validationMessage -> new TimeSpan().start(validationMessage.getTimestamp())) + .collect(Collectors.toList()); + } else { + // LC-207 MR-1 & LC-208 MR-2: If the card does not contain any validation error or warning, we display only + // one bubble for the card’s arrival time in feed + timeSpans.add(new TimeSpan().start(timestamp)); + } + + card.setTimeSpans(timeSpans); card.setPublishDate(timestamp); card.setStartDate(businessDayFrom); card.setEndDate(businessDayTo); @@ -111,21 +141,28 @@ void setCardRecipients(Card card, EventMessageDto eventMessageDto) { card.setRecipient(new Recipient().type(RecipientEnum.GROUP).identity(source)); - Set entityRecipients = new HashSet<>(); - tso.ifPresent(entityRecipients::add); - if (opfabConfig.getEntityRecipientsNotAllowed().containsKey(processKey)) { - List recipientsNotAllowed = opfabConfig.getEntityRecipientsNotAllowed().get(processKey); - if (!recipientsNotAllowed.contains("sendingUser")) { - sendingUser.ifPresent(entityRecipients::add); + Set entityRecipientList = new HashSet<>(); + tso.ifPresent(entityRecipientList::add); + if (opfabConfig.getEntityRecipients().containsKey(processKey)) { + OpfabConfig.OpfabEntityRecipients entityRecipients = opfabConfig.getEntityRecipients().get(processKey); + if (!entityRecipients.getNotAllowed().equals("sendingUser")) { + sendingUser.ifPresent(entityRecipientList::add); } - if (!recipientsNotAllowed.contains("recipient")) { - recipient.ifPresent(entityRecipients::addAll); + if (!entityRecipients.getNotAllowed().equals("recipient")) { + recipient.ifPresent(entityRecipientList::addAll); } - } else { - sendingUser.ifPresent(entityRecipients::add); - recipient.ifPresent(entityRecipients::addAll); + if (entityRecipients.isAddRscs()) { + entityRecipientList.addAll(tsos.entrySet().stream() + .filter(t -> entityRecipientList.contains(t.getKey())) + .map(Map.Entry::getValue) + .map(CoordinationConfig.Tso::getRsc).collect(Collectors.toList())); + } + }else { + sendingUser.ifPresent(entityRecipientList::add); + recipient.ifPresent(entityRecipientList::addAll); } - card.setEntityRecipients(new ArrayList<>(entityRecipients)); + card.setEntityRecipients(new ArrayList<>(entityRecipientList)); + } void specificCardTreatment(Card opfabCard, EventMessageDto eventMessageDto, Long cardId) { @@ -184,7 +221,7 @@ void specificCardTreatment(Card opfabCard, EventMessageDto eventMessageDto, Long } private String generateFeedTitle(String source, String messageTypeName, String titleProcessType, - Optional processStep, EventMessageDto eventMessageDto) { + Optional processStep, EventMessageDto eventMessageDto) { String key = source + "_" + messageTypeName; if (opfabConfig.getFeed().containsKey(key)) { @@ -232,7 +269,7 @@ String replacePlaceholders(String title, EventMessageDto eventMessageDto) { while (m.find()) { allMatches.put(m.group(), null); } - allMatches = allMatches.entrySet().stream().map(e -> generatePlaceholderValue(e, bdiMap)) + allMatches = allMatches.entrySet().stream().map(e -> generatePlaceholderValue(e, bdiMap,eventMessageDto)) .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); for (Map.Entry entry : allMatches.entrySet()) @@ -242,7 +279,7 @@ String replacePlaceholders(String title, EventMessageDto eventMessageDto) { } } - Map.Entry generatePlaceholderValue(Map.Entry entry, Map bdiMap) { + Map.Entry generatePlaceholderValue(Map.Entry entry, Map bdiMap, EventMessageDto eventMessageDto) { String placeholder = entry.getKey(); String placeholderValue = null; @@ -266,7 +303,10 @@ Map.Entry generatePlaceholderValue(Map.Entry ent } if ("eicToName".equals(formatMethod)) { placeholderValue = tsos.get(bdiMap.get(placeholderNoDelimiters)).getName(); return new AbstractMap.SimpleEntry(placeholder, placeholderValue); - } else { + } else if ("notificationTitle".equals(formatMethod)) { + placeholderValue = getValidationName(eventMessageDto); + return new AbstractMap.SimpleEntry(placeholder, placeholderValue); + }else{ log.error("The placeholder method " + formatMethod + "is not valid!"); placeholderValue = bdiMap.get(placeholderNoDelimiters) != null ? bdiMap.get(placeholderNoDelimiters).toString() : ""; @@ -304,6 +344,13 @@ private void messageValidatedTreatment(Card card, EventMessageDto eventMessageDt data.setWarnings(warnings); data.setErrors(errors); }); + if (eventMessageDto != null && eventMessageDto.getHeader() != null && eventMessageDto.getHeader().getProperties() != null + && eventMessageDto.getHeader().getProperties().getBusinessDataIdentifier() != null + && eventMessageDto.getHeader().getProperties().getBusinessDataIdentifier().getSendingUser().isPresent()) { + String sendingUserEicCode = eventMessageDto.getHeader().getProperties().getBusinessDataIdentifier().getSendingUser().get(); + if (tsos.get(sendingUserEicCode) != null) + data.setSendingUser(tsos.get(sendingUserEicCode).getName()); + } card.setData(data); } diff --git a/letsco-api/src/main/java/org/lfenergy/letscoordinate/backend/config/OpfabConfig.java b/letsco-api/src/main/java/org/lfenergy/letscoordinate/backend/config/OpfabConfig.java index a09253e..b8d4faa 100644 --- a/letsco-api/src/main/java/org/lfenergy/letscoordinate/backend/config/OpfabConfig.java +++ b/letsco-api/src/main/java/org/lfenergy/letscoordinate/backend/config/OpfabConfig.java @@ -29,7 +29,7 @@ public class OpfabConfig { private String publisher; private OpfabUrls url; private Map feed = new HashMap<>(); - private Map> entityRecipientsNotAllowed = new HashMap<>(); + private Map entityRecipients = new HashMap<>(); @Getter @Setter @@ -37,6 +37,13 @@ public static class OpfabUrls { private String cardsPub; } + @Getter + @Setter + public static class OpfabEntityRecipients { + private boolean addRscs; + private String notAllowed; + } + @Getter @Setter @NoArgsConstructor diff --git a/letsco-api/src/main/java/org/lfenergy/letscoordinate/backend/model/opfab/ValidationData.java b/letsco-api/src/main/java/org/lfenergy/letscoordinate/backend/model/opfab/ValidationData.java index 16de142..64d54e4 100644 --- a/letsco-api/src/main/java/org/lfenergy/letscoordinate/backend/model/opfab/ValidationData.java +++ b/letsco-api/src/main/java/org/lfenergy/letscoordinate/backend/model/opfab/ValidationData.java @@ -23,6 +23,7 @@ public class ValidationData extends EventMessageDto { List warnings; List errors; + String sendingUser; public ValidationData(EventMessageDto eventMessageDto) { super(eventMessageDto.getXmlns(), eventMessageDto.getHeader(), eventMessageDto.getPayload()); diff --git a/letsco-api/src/main/java/org/lfenergy/letscoordinate/backend/util/StringUtil.java b/letsco-api/src/main/java/org/lfenergy/letscoordinate/backend/util/StringUtil.java index 9c8ac3e..0ae3a42 100644 --- a/letsco-api/src/main/java/org/lfenergy/letscoordinate/backend/util/StringUtil.java +++ b/letsco-api/src/main/java/org/lfenergy/letscoordinate/backend/util/StringUtil.java @@ -33,6 +33,10 @@ public final class StringUtil { public static final String PROCESS_INFORMATION = "ProcessInformation"; public static final String MESSAGE_VALIDATED = "DfgMessageValidated"; + public static final String POSITIVE_ACK = "Positive ACK"; + public static final String POSITIVE_ACK_WITH_WARNINGS = "Positive ACK with warnings"; + public static final String NEGATIVE_ACK = "Negative ACK"; + /** *

This function allows to split an input string according to a separator after removing all spaces from it * if and only if the input string contains the separator

diff --git a/letsco-api/src/main/resources/application.yml b/letsco-api/src/main/resources/application.yml index ed2ce40..5656a42 100644 --- a/letsco-api/src/main/resources/application.yml +++ b/letsco-api/src/main/resources/application.yml @@ -57,11 +57,19 @@ opfab: cardsPub: http://localhost:2102/cards feed: sourceA_messageTypeNameA: - title: "SOURCE A - custom title" - summary: "Source A - custom summary - {{businessDayFrom::dateFormat(dd/MM/yyyy HH:mm)}} - {{sendingUser::eicToName()}}" - entityRecipientsNotAllowed: + title: " STA - Generation Tripping Validation - {{result::notificationTitle()}}" + summary: "{{businessDayFrom::dateFormat(dd/MM/yyyy HH:mm)}} - {{businessDayTo::dateFormat(dd/MM/yyyy HH:mm)}} (CET/CEST) - {{sendingUser::eicToName()}}" + sourceA_messageTypeNameB: + title: " STA - HVDC Tripping information Validation - {{result::notificationTitle()}}" + summary: "{{businessDayFrom::dateFormat(dd/MM/yyyy HH:mm)}} - {{businessDayTo::dateFormat(dd/MM/yyyy HH:mm)}} (CET/CEST) - {{sendingUser::eicToName()}}" + + entityRecipients: sourceA_messageTypeNameA: - - sendingUser + notAllowed: sendingUser + addRscs: true + sourceA_messageTypeNameB: + notAllowed: sendingUser + addRscs: true third-app: url: http://localhost:8081 \ No newline at end of file diff --git a/letsco-front/angular.json b/letsco-front/angular.json index d88c1bf..3a8fcac 100644 --- a/letsco-front/angular.json +++ b/letsco-front/angular.json @@ -43,8 +43,8 @@ "tsConfig": "tsconfig.app.json", "aot": false, "assets": [ - "src/assets", - "src/assets/favicon.ico", + "src/letsco/assets", + "src/letsco/assets/favicon.ico", "src/letsco-env/env.js" ], "styles": [ diff --git a/letsco-front/src/app/app.component.ts b/letsco-front/src/app/app.component.ts index 2a1c26e..1d3684f 100644 --- a/letsco-front/src/app/app.component.ts +++ b/letsco-front/src/app/app.component.ts @@ -9,13 +9,33 @@ * This file is part of the Let’s Coordinate project. */ -import { Component } from '@angular/core'; +import {AfterViewChecked, Component, OnInit} from '@angular/core'; +import {ActivatedRoute} from "@angular/router"; +import {ThemeService} from "./core/services/theme.service"; @Component({ selector: 'app-root', template: ``, styles: [] }) -export class AppComponent { - title = 'letsco-front'; -} +export class AppComponent implements AfterViewChecked { + + constructor(private route: ActivatedRoute, + private themeService: ThemeService) { + } + + ngAfterViewChecked() { + const opfabTheme = localStorage.getItem('opfab_theme'); + if (opfabTheme && !location.pathname.includes('login')) { + localStorage.removeItem('opfab_theme'); + } else { + this.route.queryParams.subscribe(params => { + const opfabTheme = params.opfab_theme; + if (opfabTheme) { + this.themeService.initWithTheme(opfabTheme); + } + }); + } + } + +} \ No newline at end of file diff --git a/letsco-front/src/app/core/models/theme.model.ts b/letsco-front/src/app/core/models/theme.model.ts new file mode 100644 index 0000000..e46736a --- /dev/null +++ b/letsco-front/src/app/core/models/theme.model.ts @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2020, RTE (https://www.rte-france.com) + * Copyright (c) 2020 RTE international (https://www.rte-international.com) + * See AUTHORS.txt + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * SPDX-License-Identifier: MPL-2.0 + * This file is part of the Let’s Coordinate project. + */ + +export class Theme { + constructor(public color: string, + public bgColor: string, + public gridLinesColor: string, + public textComponentColor: string, + public textComponentBgColor: string) { + } +} \ No newline at end of file diff --git a/letsco-front/src/app/core/services/theme.service.ts b/letsco-front/src/app/core/services/theme.service.ts new file mode 100644 index 0000000..cd8e789 --- /dev/null +++ b/letsco-front/src/app/core/services/theme.service.ts @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2020, RTE (https://www.rte-france.com) + * Copyright (c) 2020 RTE international (https://www.rte-international.com) + * See AUTHORS.txt + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * SPDX-License-Identifier: MPL-2.0 + * This file is part of the Let’s Coordinate project. + */ + +import {Injectable} from '@angular/core'; +import {ChartOptions} from 'chart.js'; +import {Theme} from "../models/theme.model"; + +@Injectable({ + providedIn: 'root' +}) +export class ThemeService { + + themeMap: Map = new Map([ + ['DAY', {color: 'black', bgColor:'white', gridLinesColor: 'rgba(0, 0, 0, 0.1)', textComponentColor: '#343940', textComponentBgColor: 'white'}], + ['NIGHT', {color: '#e0e0e0', bgColor:'#343940', gridLinesColor: 'rgba(255,255,255,0.1)', textComponentColor: '#343940', textComponentBgColor: '#e0e0e0'}] + ]); + currentThemeCode : string = 'NIGHT'; + + get currentTheme() : Theme { + return this.themeMap.get(this.currentThemeCode); + } + + initWithTheme(themeCode: string) { + if (['DAY', 'NIGHT'].includes(themeCode)) { + this.currentThemeCode = themeCode; + document.body.style.backgroundColor = this.currentTheme.bgColor; + document.body.style.color = this.currentTheme.color; + Array.from(document.getElementsByClassName('popover-header')).forEach(e => (e as HTMLTitleElement).style.color = this.currentTheme.bgColor); + Array.from(document.getElementsByTagName('hr')).forEach(e => e.style.backgroundColor = this.currentTheme.color); + } else { + console.warn('Unable to init page with theme: unknown theme \'' + themeCode + '\'!') + } + } + + updateChartColors(options: ChartOptions) { + if (options) { + options.legend = { + labels: { + fontColor: this.currentTheme.color + } + }; + + options.scales.xAxes = [{ + ticks: {fontColor: this.currentTheme.color}, + gridLines: { + color: this.currentTheme.gridLinesColor, + zeroLineColor: this.currentTheme.gridLinesColor + } + }]; + + options.scales.yAxes[0].ticks = { + ...options.scales.yAxes[0].ticks, + ...{fontColor: this.currentTheme.color} + }; + options.scales.yAxes[0].gridLines = { + color: this.currentTheme.gridLinesColor, + zeroLineColor: this.currentTheme.gridLinesColor + }; + } + } + +} diff --git a/letsco-front/src/app/kpi-report/bar-chart/bar-chart.component.ts b/letsco-front/src/app/kpi-report/bar-chart/bar-chart.component.ts index 3a589dd..8794f99 100644 --- a/letsco-front/src/app/kpi-report/bar-chart/bar-chart.component.ts +++ b/letsco-front/src/app/kpi-report/bar-chart/bar-chart.component.ts @@ -9,15 +9,23 @@ * This file is part of the Let’s Coordinate project. */ -import {Component, Input} from '@angular/core'; +import {AfterViewChecked, Component, Input} from '@angular/core'; import {KpiChartOptions} from "../../core/models/kpi-chart-options.model"; +import {ThemeService} from "../../core/services/theme.service"; @Component({ selector: 'app-bar-chart', templateUrl: './bar-chart.component.html', styleUrls: ['./bar-chart.component.scss'], }) -export class BarChartComponent { +export class BarChartComponent implements AfterViewChecked{ @Input() public kpiChartId: string; @Input() public kpiChartOptions: KpiChartOptions; + + constructor(private themeService: ThemeService) { + } + + ngAfterViewChecked() { + this.themeService.updateChartColors(this.kpiChartOptions.chartOptions) + } } diff --git a/letsco-front/src/app/kpi-report/kpi-report-config/kpi-report-config.component.html b/letsco-front/src/app/kpi-report/kpi-report-config/kpi-report-config.component.html index 1bca070..d3107ba 100644 --- a/letsco-front/src/app/kpi-report/kpi-report-config/kpi-report-config.component.html +++ b/letsco-front/src/app/kpi-report/kpi-report-config/kpi-report-config.component.html @@ -116,7 +116,12 @@

RSC KPI report configuratio - +
+ +
+ +
diff --git a/letsco-front/src/app/kpi-report/kpi-report/kpi-report.component.html b/letsco-front/src/app/kpi-report/kpi-report/kpi-report.component.html index b041573..194abd1 100644 --- a/letsco-front/src/app/kpi-report/kpi-report/kpi-report.component.html +++ b/letsco-front/src/app/kpi-report/kpi-report/kpi-report.component.html @@ -13,7 +13,7 @@ RSC KPI report configuration - @@ -29,7 +29,7 @@

-

{{(i + 1) | romanNumeral}}. {{ rscKpiTypedDatum.type | kpiDataTypeFullName}}

+

{{(i + 1) | romanNumeral}}. {{ rscKpiTypedDatum.type | kpiDataTypeFullName}}

@@ -59,7 +59,9 @@
[id]="'comment-'+rscKpi.code+'-'+k" maxlength="255" rows="4" - [(ngModel)]="rscKpiDatum.comment"> + [(ngModel)]="rscKpiDatum.comment" + [style.background-color]='textareaBgColor' + [style.color]='textareaColor'>
@@ -80,8 +82,8 @@

-       - +       +
diff --git a/letsco-front/src/app/kpi-report/kpi-report/kpi-report.component.ts b/letsco-front/src/app/kpi-report/kpi-report/kpi-report.component.ts index 7fbe3cb..009490e 100644 --- a/letsco-front/src/app/kpi-report/kpi-report/kpi-report.component.ts +++ b/letsco-front/src/app/kpi-report/kpi-report/kpi-report.component.ts @@ -21,6 +21,7 @@ import {RomanNumeralPipe} from "../../core/pipes/roman-numeral.pipe"; import {KpiDataTypeFullNamePipe} from "../../core/pipes/kpi-data-type-full-name.pipe"; import {KpiSubmittedForm} from "../../core/models/kpi-submitted-form.model"; import * as jsPDF from 'jspdf'; +import {ThemeService} from "../../core/services/theme.service"; const pdfConstants = { logoLetsco: { @@ -63,14 +64,24 @@ export class KpiReportComponent implements OnInit { private datePipe: DatePipe, private romanNumeral: RomanNumeralPipe, private kpiDataTypeFullName: KpiDataTypeFullNamePipe, - private router: Router) {} + private router: Router, + private themeService: ThemeService) {} ngOnInit() { + this.themeService.initWithTheme(this.themeService.currentThemeCode); this.rscKpiReportData = this.kpiReportService.rscKpiReportData; if (!this.rscKpiReportData) this.router.navigate(['/kpi-report-config']); } + get textareaBgColor() { + return this.themeService.currentTheme.textComponentBgColor; + } + + get textareaColor() { + return this.themeService.currentTheme.textComponentColor; + } + generateExcel() { this.generateReport(ReportTypeEnum.EXCEL); } @@ -157,8 +168,13 @@ export class KpiReportComponent implements OnInit { for (let [k,rscKpiDatum] of rscKpi.data.entries()) { // drawing graph let kpiGraphId = rscKpi.code + '-graph' + k; + _y += pdfConstants.layout.textLineHeight; let dataUrl = (document.getElementById(kpiGraphId) as HTMLCanvasElement).toDataURL(); - pdf.addImage(dataUrl, 'PNG', pdfConstants.graph._x, _y += pdfConstants.layout.textLineHeight, pdfConstants.graph.width, pdfConstants.graph.height, '', 'FAST'); + if (this.themeService.currentThemeCode === 'NIGHT') { + pdf.setFillColor(52, 57, 64); + pdf.rect(pdfConstants.graph._x, _y, pdfConstants.graph.width, pdfConstants.graph.height, 'F'); + } + pdf.addImage(dataUrl, 'PNG', pdfConstants.graph._x, _y, pdfConstants.graph.width, pdfConstants.graph.height, '', 'FAST'); // drawing comment _y += pdfConstants.graph.height; diff --git a/letsco-front/src/assets/.gitkeep b/letsco-front/src/assets/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/letsco-front/src/assets/favicon.ico b/letsco-front/src/letsco/assets/favicon.ico similarity index 100% rename from letsco-front/src/assets/favicon.ico rename to letsco-front/src/letsco/assets/favicon.ico diff --git a/letsco-front/src/assets/images/excel-icon.png b/letsco-front/src/letsco/assets/images/excel-icon.png similarity index 100% rename from letsco-front/src/assets/images/excel-icon.png rename to letsco-front/src/letsco/assets/images/excel-icon.png diff --git a/letsco-front/src/assets/images/excel-icon.png.license b/letsco-front/src/letsco/assets/images/excel-icon.png.license similarity index 100% rename from letsco-front/src/assets/images/excel-icon.png.license rename to letsco-front/src/letsco/assets/images/excel-icon.png.license diff --git a/letsco-front/src/assets/images/keycloak-logo.png b/letsco-front/src/letsco/assets/images/keycloak-logo.png similarity index 100% rename from letsco-front/src/assets/images/keycloak-logo.png rename to letsco-front/src/letsco/assets/images/keycloak-logo.png diff --git a/letsco-front/src/assets/images/keycloak-logo.png.license b/letsco-front/src/letsco/assets/images/keycloak-logo.png.license similarity index 100% rename from letsco-front/src/assets/images/keycloak-logo.png.license rename to letsco-front/src/letsco/assets/images/keycloak-logo.png.license diff --git a/letsco-front/src/assets/images/logo_lfe_lc_2.png b/letsco-front/src/letsco/assets/images/logo_lfe_lc_2.png similarity index 100% rename from letsco-front/src/assets/images/logo_lfe_lc_2.png rename to letsco-front/src/letsco/assets/images/logo_lfe_lc_2.png diff --git a/letsco-front/src/assets/images/logo_lfe_lc_2.png.license b/letsco-front/src/letsco/assets/images/logo_lfe_lc_2.png.license similarity index 100% rename from letsco-front/src/assets/images/logo_lfe_lc_2.png.license rename to letsco-front/src/letsco/assets/images/logo_lfe_lc_2.png.license diff --git a/letsco-front/src/assets/images/pdf-icon.png b/letsco-front/src/letsco/assets/images/pdf-icon.png similarity index 100% rename from letsco-front/src/assets/images/pdf-icon.png rename to letsco-front/src/letsco/assets/images/pdf-icon.png diff --git a/letsco-front/src/assets/images/pdf-icon.png.license b/letsco-front/src/letsco/assets/images/pdf-icon.png.license similarity index 100% rename from letsco-front/src/assets/images/pdf-icon.png.license rename to letsco-front/src/letsco/assets/images/pdf-icon.png.license diff --git a/message_models/json/card_feed/MessageValidated_NEGATIVE_ACK.json b/message_models/json/card_feed/MessageValidated_NEGATIVE_ACK.json index 4d4bea3..78c2885 100644 --- a/message_models/json/card_feed/MessageValidated_NEGATIVE_ACK.json +++ b/message_models/json/card_feed/MessageValidated_NEGATIVE_ACK.json @@ -30,7 +30,7 @@ "severity": "ERROR", "title": "Rule_A_Violated", "message": "Application check: Error 01 detected in input file", - "timestamp": "2020-07-22T14:24:38.825Z", + "timestamp": "2020-01-22T14:24:38.825Z", "sourceDataRef": { "relatedElement": "timeseries", "relatedTimeseriesId": "Timeseries_12345", @@ -43,7 +43,7 @@ "severity": "ERROR", "title": "Rule_B_Violated", "message": "Application check: Error 02 detected in input file", - "timestamp": "2020-07-22T14:24:46.885Z", + "timestamp": "2020-03-11T14:24:46.885Z", "sourceDataRef": { "relatedElement": "header" } @@ -53,7 +53,7 @@ "severity": "WARNING", "title": "Rule_C_Violated", "message": "Application check: Warning 01 detected in input file", - "timestamp": "2020-07-22T14:24:47.792Z", + "timestamp": "2020-03-02T14:24:47.792Z", "sourceDataRef": { "relatedElement": "header" } @@ -63,7 +63,7 @@ "severity": "WARNING", "title": "Rule_D_Violated", "message": "Application check: Warning 02 detected in input file", - "timestamp": "2020-07-22T14:25:23.591Z", + "timestamp": "2020-05-17T14:25:23.591Z", "sourceDataRef": { "relatedPeriodStartId": 897, "relatedElement": "timeseries", diff --git a/message_models/json/card_feed/MessageValidated_POSITIVE_ACK.json b/message_models/json/card_feed/MessageValidated_POSITIVE_ACK.json index d6307a1..6343c51 100644 --- a/message_models/json/card_feed/MessageValidated_POSITIVE_ACK.json +++ b/message_models/json/card_feed/MessageValidated_POSITIVE_ACK.json @@ -13,8 +13,8 @@ "messageType": "101", "messageTypeName": "MessageValidated", "businessDayFrom": "2020-09-19T00:00:00Z", - "businessDayTo": "2020-12-31T23:59:00Z", - "sendingUser": "10X1001A1001A345", + "businessDayTo": "2020-12-29T23:59:00Z", + "sendingUser": "10XCZ-CEPS-GRIDE", "filename": "20200318_0950_ServiceA_0_CZ.xlsx", "tso": "10X1001A1001A345" } diff --git a/message_models/json/card_feed/MessageValidated_POSITIVE_ACK_WITH_WARNING.json b/message_models/json/card_feed/MessageValidated_POSITIVE_ACK_WITH_WARNING.json index ab45dbe..73b2cf9 100644 --- a/message_models/json/card_feed/MessageValidated_POSITIVE_ACK_WITH_WARNING.json +++ b/message_models/json/card_feed/MessageValidated_POSITIVE_ACK_WITH_WARNING.json @@ -12,11 +12,11 @@ "businessDataIdentifier": { "messageType": "101", "messageTypeName": "MessageValidated", - "businessDayFrom": "2020-08-29T00:00:00Z", - "businessDayTo": "2020-12-31T23:59:00Z", - "sendingUser": "10X1001A1001A345", + "businessDayFrom": "2020-08-29T00:00:00Z", + "businessDayTo": "2020-12-28T23:59:00Z", + "sendingUser": "10XPT-REN------9", "filename": "20200317_1230_ServiceA_2_PT.xlsx", - "tso": "10X1001A1001A345" + "tso": "10X1001A1001A345" } } }, @@ -31,7 +31,7 @@ "severity": "WARNING", "title": "Rule_A_Violated", "message": "Application check: Warning 01 detected in input file", - "timestamp": "2020-08-26T14:24:38.825Z", + "timestamp": "2020-05-26T14:24:38.825Z", "sourceDataRef": { "relatedElement": "timeseries", "relatedTimeseriesId": "Timeseries_12345", @@ -44,7 +44,7 @@ "severity": "WARNING", "title": "Rule_B_Violated", "message": "Application check: Warning 02 detected in input file", - "timestamp": "2020-08-26T14:24:46.885Z", + "timestamp": "2020-07-26T14:24:46.885Z", "sourceDataRef": { "relatedElement": "header" } @@ -56,7 +56,7 @@ "name": "file3_link", "value": "https://www.lfenergy.org/wp-content/uploads/sites/67/2019/11/2-10-Alexandra-LFE_Summit_2019_OperatorFabric_v1.2.pdf" }, - { + { "name": "file 4_link", "value": "https://www.lfenergy.org/wp-content/uploads/sites/67/2019/11/2-10-Alexandra-LFE_Summit_2019_OperatorFabric_v1.2.pdf" } diff --git a/message_models/json/card_feed/ProcessFailed.json b/message_models/json/card_feed/ProcessFailed.json index 84826f5..90296cf 100644 --- a/message_models/json/card_feed/ProcessFailed.json +++ b/message_models/json/card_feed/ProcessFailed.json @@ -4,15 +4,15 @@ "header": { "verb": "created", "noun": "ProcessFailed", - "timestamp": "2020-03-18T09:30:00Z", + "timestamp": "2020-08-20T09:30:00Z", "source": "ServiceA", "messageId": "6576f548eb9f4079a56f231fcdd8b560", "properties": { "format": "JSON", "businessDataIdentifier": { "messageTypeName": "NotificationTypeB", - "businessDayFrom": "2020-03-18T23:00:00Z", - "businessDayTo": "2020-03-25T23:00:00Z", + "businessDayFrom": "2020-07-18T00:00:00Z", + "businessDayTo": "2020-09-17T00:00:00Z", "processStep": "Final calculation" } } @@ -20,16 +20,20 @@ "payload": { "text": [ { - "name": "failureReason", - "value": "Process delayed because of the calculation input data preparation" - }, - { - "name": "delayReason", - "value": "Delay of 6 min" + "name": "Reason of failure", + "value": "Computation failed" }, { "name": "Comment", "value": "Some issues during the process" + }, + { + "name": "Delay", + "value": "6 min" + }, + { + "name": "Reason of delay", + "value": "Calculation delayed" } ], "rscKpi": [ @@ -37,7 +41,7 @@ "name": "gp2", "data": [ { - "timestamp": "2020-05-04T01:00:00Z", + "timestamp": "2020-08-04T01:00:00Z", "label": "ProcessFailedCount", "detail": [ { @@ -46,7 +50,7 @@ ] }, { - "timestamp": "2020-05-04T01:00:00Z", + "timestamp": "2020-08-04T01:00:00Z", "label": "ProcessDelayedCount", "detail": [ { diff --git a/message_models/json/card_feed/ProcessSuccess.json b/message_models/json/card_feed/ProcessSuccess.json index ffc577d..cecd7ae 100644 --- a/message_models/json/card_feed/ProcessSuccess.json +++ b/message_models/json/card_feed/ProcessSuccess.json @@ -4,15 +4,15 @@ "header": { "verb": "created", "noun": "ProcessSuccess", - "timestamp": "2020-09-22T08:13:15Z", + "timestamp": "2020-06-16T08:13:15Z", "source": "ServiceA", "messageId": "134654a095714812ba74323b021f23b5", "properties": { "format": "JSON", "businessDataIdentifier": { "messageTypeName": "NotificationTypeA", - "businessDayFrom": "2020-09-22T23:00:00Z", - "businessDayTo": "2020-09-23T23:00:00Z", + "businessDayFrom": "2020-09-22T00:00:00Z", + "businessDayTo": "2020-09-29T00:00:00Z", "processStep": "Initial Calculation" } } @@ -20,11 +20,11 @@ "payload": { "text": [ { - "name": "comment", + "name": "Comment", "value": "The process calculation was performed on time" }, { - "name": "conclusion", + "name": "Conclusion", "value": "Results are ok" } ], diff --git a/test/prepare-opfab-env/bundles/messageValidated/css/main.css b/test/prepare-opfab-env/bundles/messageValidated/css/main.css index d8c231e..29a2a9b 100644 --- a/test/prepare-opfab-env/bundles/messageValidated/css/main.css +++ b/test/prepare-opfab-env/bundles/messageValidated/css/main.css @@ -25,6 +25,18 @@ display: block; } -tr { - color: white; +.card-table { + width: 100%; + margin-bottom: 1rem; +} + +.card-table td, .card-table th { + padding: .75rem; + vertical-align: top; + border-bottom: 1px solid #dee2e6; +} + +.card-table thead { + color: #fff; + background-color: #52585487; } \ No newline at end of file diff --git a/test/prepare-opfab-env/bundles/messageValidated/template/en/messageValidated.handlebars b/test/prepare-opfab-env/bundles/messageValidated/template/en/messageValidated.handlebars index d10781f..d5b2504 100644 --- a/test/prepare-opfab-env/bundles/messageValidated/template/en/messageValidated.handlebars +++ b/test/prepare-opfab-env/bundles/messageValidated/template/en/messageValidated.handlebars @@ -41,6 +41,12 @@ {{/if}} {{/if}} + {{#if sendingUser}} +
+ Sent by {{sendingUser}} +
+ {{/if}} +
{{#if (bool errors.length '>' 0)}}

@@ -49,8 +55,8 @@

- - +
+ @@ -81,12 +87,12 @@ {{#if (bool warnings.length '>' 0)}}

Detected warnings ({{warnings.length}})  - +

-
# Date
- +
+ @@ -116,4 +122,39 @@ -{{/with}} \ No newline at end of file +{{/with}} + + diff --git a/test/prepare-opfab-env/bundles/processFailed/css/main.css b/test/prepare-opfab-env/bundles/processFailed/css/main.css index d8c231e..70ccee2 100644 --- a/test/prepare-opfab-env/bundles/processFailed/css/main.css +++ b/test/prepare-opfab-env/bundles/processFailed/css/main.css @@ -23,8 +23,4 @@ .visible { display: block; -} - -tr { - color: white; } \ No newline at end of file diff --git a/test/prepare-opfab-env/bundles/processFailed/template/en/process.handlebars b/test/prepare-opfab-env/bundles/processFailed/template/en/process.handlebars index bca34fc..647ee6e 100644 --- a/test/prepare-opfab-env/bundles/processFailed/template/en/process.handlebars +++ b/test/prepare-opfab-env/bundles/processFailed/template/en/process.handlebars @@ -33,7 +33,7 @@ {{#each payload.text}} -

+

{{this.name}}: {{this.value}}

{{/each}} diff --git a/test/prepare-opfab-env/bundles/processSuccess/css/main.css b/test/prepare-opfab-env/bundles/processSuccess/css/main.css index d8c231e..70ccee2 100644 --- a/test/prepare-opfab-env/bundles/processSuccess/css/main.css +++ b/test/prepare-opfab-env/bundles/processSuccess/css/main.css @@ -23,8 +23,4 @@ .visible { display: block; -} - -tr { - color: white; } \ No newline at end of file diff --git a/test/prepare-opfab-env/bundles/processSuccess/template/en/process.handlebars b/test/prepare-opfab-env/bundles/processSuccess/template/en/process.handlebars index bca34fc..647ee6e 100644 --- a/test/prepare-opfab-env/bundles/processSuccess/template/en/process.handlebars +++ b/test/prepare-opfab-env/bundles/processSuccess/template/en/process.handlebars @@ -33,7 +33,7 @@ {{#each payload.text}} -

+

{{this.name}}: {{this.value}}

{{/each}} diff --git a/test/prepare-opfab-env/opfab-config/docker-compose.yml b/test/prepare-opfab-env/opfab-config/docker-compose.yml index 20ad306..7a96bf9 100644 --- a/test/prepare-opfab-env/opfab-config/docker-compose.yml +++ b/test/prepare-opfab-env/opfab-config/docker-compose.yml @@ -37,7 +37,7 @@ services: - "90:9990" users: container_name: users - image: "lfeoperatorfabric/of-users-business-service:1.5.0.RELEASE" + image: "lfeoperatorfabric/of-users-business-service:1.7.0.RELEASE" user: ${USER_ID}:${USER_GID} ports: - "2103:8080" @@ -52,7 +52,7 @@ services: - "./docker-configurations/common.yml:/config/common-docker.yml" businessconfig: container_name: businessconfig - image: "lfeoperatorfabric/of-businessconfig-business-service:1.5.0.RELEASE" + image: "lfeoperatorfabric/of-businessconfig-business-service:1.7.0.RELEASE" depends_on: - mongodb user: ${USER_ID}:${USER_GID} @@ -70,7 +70,7 @@ services: - "./docker-configurations/businessconfig.yml:/config/application-docker.yml" cards-publication: container_name: cards-publication - image: "lfeoperatorfabric/of-cards-publication-business-service:1.5.0.RELEASE" + image: "lfeoperatorfabric/of-cards-publication-business-service:1.7.0.RELEASE" depends_on: - mongodb user: ${USER_ID}:${USER_GID} @@ -87,7 +87,7 @@ services: - "./docker-configurations/cards-publication.yml:/config/application-docker.yml" cards-consultation: container_name: cards-consultation - image: "lfeoperatorfabric/of-cards-consultation-business-service:1.5.0.RELEASE" + image: "lfeoperatorfabric/of-cards-consultation-business-service:1.7.0.RELEASE" user: ${USER_ID}:${USER_GID} ports: - "2104:8080" @@ -101,7 +101,7 @@ services: - "./docker-configurations/common.yml:/config/common-docker.yml" - "./docker-configurations/cards-consultation.yml:/config/application-docker.yml" web-ui: - image: "lfeoperatorfabric/of-web-ui:1.5.0.RELEASE" + image: "lfeoperatorfabric/of-web-ui:1.7.0.RELEASE" ports: - "2002:80" depends_on: diff --git a/test/prepare-opfab-env/opfab-config/ngnix.conf b/test/prepare-opfab-env/opfab-config/ngnix.conf new file mode 100644 index 0000000..0fb2650 --- /dev/null +++ b/test/prepare-opfab-env/opfab-config/ngnix.conf @@ -0,0 +1,97 @@ +# Copyright (c) 2020, RTE (https://www.rte-france.com) +# Copyright (c) 2020 RTE international (https://www.rte-international.com) +# See AUTHORS.txt +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# SPDX-License-Identifier: MPL-2.0 +# This file is part of the Let’s Coordinate project. + +# docker-compose DNS used to resolved users service +resolver 127.0.0.11 ipv6=off; +server { + listen 80; + server_name localhost; + ### CUSTOMIZATION - BEGIN + # Url of the Authentication provider + set $KeycloakBaseUrl "http://keycloak:8080"; + # Realm associated to OperatorFabric within the Authentication provider + set $OperatorFabricRealm "dev"; + # base64 encoded pair of authentication in the form of 'client-id:secret-id' + set $ClientPairOFAuthentication "b3BmYWItY2xpZW50Om9wZmFiLWtleWNsb2FrLXNlY3JldA==" ; + ### CUSTOMIZATION - END + set $BasicValue "Basic $ClientPairOFAuthentication"; + set $KeycloakOpenIdConnect $KeycloakBaseUrl/auth/realms/$OperatorFabricRealm/protocol/openid-connect; + # access_log /var/log/nginx/host.access.log main; + location /ui/ { + alias /usr/share/nginx/html/; + index index.html index.htm; + } + location /auth/check_token { + proxy_set_header Host $http_host; + proxy_set_header Authorization $BasicValue ; + proxy_pass $KeycloakOpenIdConnect/token/introspect; + } + location /auth/token { + proxy_set_header Host $http_host; + proxy_set_header Authorization $BasicValue ; + proxy_pass $KeycloakOpenIdConnect/token; + } + location /auth/code/ { + proxy_set_header Host $http_host; + proxy_set_header Authorization $BasicValue ; + proxy_pass $KeycloakOpenIdConnect/auth?response_type=code&client_id=opfab-client&$args; + } + location /config/web-ui.json { + alias /usr/share/nginx/html/opfab/web-ui.json; + } + location /businessconfig { + proxy_set_header Host $http_host; + proxy_pass http://businessconfig:8080; + } + location /users { + proxy_set_header Host $http_host; + proxy_pass http://users:8080/users; + } + location ~ "^/users/(.*)" { + proxy_set_header Host $http_host; + proxy_pass http://users:8080/$1; + } + location ~ "^/entities/(.*)" { + proxy_set_header Host $http_host; + proxy_pass http://users:8080/$1; + } + location /entities { + proxy_set_header Host $http_host; + proxy_pass http://users:8080/entities; + } + + location ~ "^/groups/(.*)" { + proxy_set_header Host $http_host; + proxy_pass http://users:8080/$1; + } + location /groups { + proxy_set_header Host $http_host; + proxy_pass http://users:8080/groups; + } + location /cards/ { + proxy_set_header Host $http_host; + proxy_pass http://cards-consultation:8080/; + } + location /cardspub/cards/userCard { + proxy_set_header Host $http_host; + proxy_pass http://cards-publication:8080/cards/userCard; + } + location /cardspub/cards/userAcknowledgement { + proxy_set_header Host $http_host; + proxy_pass http://cards-publication:8080/cards/userAcknowledgement; + } + location /archives { + proxy_set_header Host $http_host; + proxy_pass http://cards-consultation:8080; + } + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /usr/share/nginx/html; + } +} diff --git a/test/prepare-opfab-env/opfab-config/web-ui.json b/test/prepare-opfab-env/opfab-config/web-ui.json index bd52297..cf259be 100644 --- a/test/prepare-opfab-env/opfab-config/web-ui.json +++ b/test/prepare-opfab-env/opfab-config/web-ui.json @@ -54,7 +54,7 @@ "time": { "display": "PUBLICATION" }, - "hideAckFilter": true + "hideAckFilter": false }, "notify": false, "subscription": { @@ -129,11 +129,11 @@ "operatorfabric": { "name": "OperatorFabric", "rank": 0, - "version": "1.5.0.RELEASE" + "version": "1.7.0.RELEASE" }, "letscoordinate": { "name": "Let's Coordinate OS", - "version": "1.0.0-RELEASE" + "version": "1.1.0.RELEASE" } }, "infos": { @@ -144,10 +144,10 @@ "language": true, "tags": true, "timeformat": true, - "sounds": true + "sounds": false }, "locale": "en", - "nightDayMode": false, + "nightDayMode": true, "styleWhenNightDayModeDesactivated" : "NIGHT", "timeFormat": "HH:mm", "dateFormat": "DD/MM/YYYY",
# Date