From dab85fa3d4f83461f0d8d75466f0df96a1665570 Mon Sep 17 00:00:00 2001 From: vlo-rte Date: Fri, 29 Jan 2021 17:28:35 +0100 Subject: [PATCH 01/62] [OC-1361] Remove old notification feature via the browser --- .../configuration/web-ui_configuration.adoc | 1 - .../src/app/modules/feed/feed.component.ts | 8 +--- ui/main/src/app/services/card.service.ts | 3 -- .../src/app/services/notify.service.spec.ts | 39 ------------------- ui/main/src/app/services/notify.service.ts | 37 ------------------ ui/main/src/app/services/services.module.ts | 2 - 6 files changed, 1 insertion(+), 89 deletions(-) delete mode 100644 ui/main/src/app/services/notify.service.spec.ts delete mode 100644 ui/main/src/app/services/notify.service.ts diff --git a/src/docs/asciidoc/deployment/configuration/web-ui_configuration.adoc b/src/docs/asciidoc/deployment/configuration/web-ui_configuration.adoc index cb5edd25e0..faa04cd702 100644 --- a/src/docs/asciidoc/deployment/configuration/web-ui_configuration.adoc +++ b/src/docs/asciidoc/deployment/configuration/web-ui_configuration.adoc @@ -78,7 +78,6 @@ a|card time display mode in the feed. Values : |feed.card.secondsBeforeLttdForClockDisplay|180|no| Number of seconds before lttd when a clock is activated in cards on the feed |feed.timeline.domains|["TR", "J", "7D", "W", "M", "Y"]|no| List of domains to show on the timeline, possible domains are : "TR", "J", "7D", "W", "M", "Y". -|feed.notify|false|no|If set to true, new cards are notified in the OS through web-push notifications |feedConfiguration.hidden|false|no|Control if you want to show or hide the notification configuration screen |playSoundForAlarm|false|no|If set to true, a sound is played when Alarm cards are added or updated in the feed |playSoundForAction|false|no|If set to true, a sound is played when Action cards are added or updated in the feed diff --git a/ui/main/src/app/modules/feed/feed.component.ts b/ui/main/src/app/modules/feed/feed.component.ts index a3430245ef..93fcd6c599 100644 --- a/ui/main/src/app/modules/feed/feed.component.ts +++ b/ui/main/src/app/modules/feed/feed.component.ts @@ -17,7 +17,6 @@ import {LightCard} from '@ofModel/light-card.model'; import * as feedSelectors from '@ofSelectors/feed.selectors'; import {catchError, map, delay} from 'rxjs/operators'; import * as moment from 'moment'; -import { NotifyService } from '@ofServices/notify.service'; import { ConfigService} from '@ofServices/config.service'; import { ApplyFilter } from '@ofStore/actions/feed.actions'; import {BUSINESS_DATE_FILTER_INITIALISATION, FilterType} from '@ofServices/filter.service'; @@ -33,7 +32,7 @@ export class FeedComponent implements OnInit { selection$: Observable; hideTimeLine: boolean; - constructor(private store: Store, private notifyService: NotifyService, private configService: ConfigService) { + constructor(private store: Store, private configService: ConfigService) { } ngOnInit() { @@ -52,11 +51,6 @@ export class FeedComponent implements OnInit { dow: 6, // First day of week is Saturday doy: 12 // First week of year must contain 1 January (7 + 6 - 1) }}); - - if (this.configService.getConfigValue('feed.notify', false)) { - this.notifyService.requestPermission(); - } - } // if timeline is present , the filter is initialize by the timeline diff --git a/ui/main/src/app/services/card.service.ts b/ui/main/src/app/services/card.service.ts index 12f49b739a..7b00bc9e24 100644 --- a/ui/main/src/app/services/card.service.ts +++ b/ui/main/src/app/services/card.service.ts @@ -19,7 +19,6 @@ import {environment} from '@env/environment'; import {GuidService} from '@ofServices/guid.service'; import {LightCard, PublisherType} from '@ofModel/light-card.model'; import {Page} from '@ofModel/page.model'; -import {NotifyService} from '@ofServices/notify.service'; import {AppState} from '@ofStore/index'; import {Store} from '@ngrx/store'; import {CardSubscriptionClosed, CardSubscriptionOpen} from '@ofActions/cards-subscription.actions'; @@ -57,7 +56,6 @@ export class CardService { constructor(private httpClient: HttpClient, - private notifyService: NotifyService, private guidService: GuidService, private store: Store, private authService: AuthenticationService, @@ -119,7 +117,6 @@ export class CardService { return Observable.create(observer => { try { eventSource.onmessage = message => { - this.notifyService.createNotification(`New cards are being pushed`); if (!message) { return observer.error(message); } diff --git a/ui/main/src/app/services/notify.service.spec.ts b/ui/main/src/app/services/notify.service.spec.ts deleted file mode 100644 index 118a5b965e..0000000000 --- a/ui/main/src/app/services/notify.service.spec.ts +++ /dev/null @@ -1,39 +0,0 @@ -/* Copyright (c) 2018-2020, RTE (http://www.rte-france.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 OperatorFabric project. - */ - - -import { NotifyService } from './notify.service'; -import { TestBed } from '@angular/core/testing'; - -describe('NotifyService', () => { - - let mockWindow: any; - let mockNotification: any; - let notifyService: any; - beforeEach(() => { - - mockNotification = function (title, options) { - this.title = title; - this.options = options; - this.requestPermission = jasmine.createSpy(); - }; - TestBed.configureTestingModule({ - providers: [NotifyService] - }); - mockWindow = { - Notification: new mockNotification('test', {}), - document: {hidden: true} - }; - notifyService = TestBed.get(NotifyService); - }); - it('should check if notification are supported', () => { - expect(notifyService.isSupported(mockWindow)).toBeTruthy(); - }); - -}); diff --git a/ui/main/src/app/services/notify.service.ts b/ui/main/src/app/services/notify.service.ts deleted file mode 100644 index eed394b750..0000000000 --- a/ui/main/src/app/services/notify.service.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* Copyright (c) 2018-2020, RTE (http://www.rte-france.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 OperatorFabric project. - */ - - - -import {Injectable} from '@angular/core'; - -@Injectable() -export class NotifyService { - - permission: string; - constructor() { - } - - isSupported(window): boolean { - return 'Notification' in window; - } - requestPermission(): void { - if (this.isSupported(window)) { - Notification.requestPermission(status => { - this.permission = status; - }); - } - } - - createNotification(title: string) { - if (this.isSupported(window) && this.permission === 'granted') { - return new Notification(title); - } - } -} diff --git a/ui/main/src/app/services/services.module.ts b/ui/main/src/app/services/services.module.ts index d48a3559d5..9fa3cc8e72 100644 --- a/ui/main/src/app/services/services.module.ts +++ b/ui/main/src/app/services/services.module.ts @@ -23,7 +23,6 @@ import {ConfigService} from '@ofServices/config.service'; import {I18nService} from '@ofServices/i18n.service'; import {SettingsService} from '@ofServices/settings.service'; import { UserService } from './user.service'; -import { NotifyService } from '@ofServices/notify.service'; import {SoundNotificationService} from '@ofServices/sound-notification.service'; import {GlobalStyleService} from '@ofServices/global-style.service'; import { AppService } from './app.service'; @@ -56,7 +55,6 @@ import { ReminderService} from '@ofServices/reminder/reminder.service'; UserService, GroupsService, EntitiesService, - NotifyService, SoundNotificationService, GlobalStyleService, AppService, From c25e95dadb705267d39db5ce673c1552b26489d4 Mon Sep 17 00:00:00 2001 From: Alexandra Guironnet Date: Mon, 1 Feb 2021 16:10:20 +0100 Subject: [PATCH 02/62] [OC-1427] Minor updates to release process doc --- src/docs/asciidoc/CICD/release_process.adoc | 8 ++++---- src/docs/asciidoc/resources/index.adoc | 2 ++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/docs/asciidoc/CICD/release_process.adoc b/src/docs/asciidoc/CICD/release_process.adoc index ccea79f8c4..057d58fb64 100644 --- a/src/docs/asciidoc/CICD/release_process.adoc +++ b/src/docs/asciidoc/CICD/release_process.adoc @@ -132,7 +132,7 @@ git merge X.X.X.release <3> ---- <1> Check out the `master` branch <2> Make sure your local copy is up to date -<3> Merge the `X.X.X.release` branch into `master` +<3> Merge the `X.X.X.release` branch into `master`, accepting changes from X.X.X.release in case of conflicts. IMPORTANT: If you also want the new docker images to be tagged `latest` (as should be the case for most release versions), you should add the keyword `ci_latest` to the merge commit message. @@ -176,7 +176,7 @@ branch they should rely on the latest RELEASE version available on DockerHub. On previous steps has completed successfully, and you can see X.X.X.RELEASE images for all services on DockerHub, you should: . Remove your locally built X.X.X.RELEASE images if any -. Run the config/demo docker-compose file to make sure it pulls the images from DockerHub and behaves as intended. +. Run the config/docker docker-compose file to make sure it pulls the images from DockerHub and behaves as intended. People who want to experiment with OperatorFabric are pointed to this docker-compose so it's important to make sure that it's working correctly. @@ -214,7 +214,7 @@ avoid confusion with the actual release commit tagged on `master`. ---- git branch -d X.X.X.release <1> -​git push origin --delete X.X.X.release <2> ---- <1> Delete the branch locally -<2> Remove it from GitHub + +NOTE: The branch will automatically be deleted from GitHub after it is merged (new repository policy). diff --git a/src/docs/asciidoc/resources/index.adoc b/src/docs/asciidoc/resources/index.adoc index 9b76de2b5a..041ec9f92f 100644 --- a/src/docs/asciidoc/resources/index.adoc +++ b/src/docs/asciidoc/resources/index.adoc @@ -15,3 +15,5 @@ include::mock_pipeline.adoc[leveloffset=+1] include::migration_guide.adoc[leveloffset=+1] include::migration_guide_to_1.8.adoc[leveloffset=+1] + +include::migration_guide_to_2.0.adoc[leveloffset=+1] From 6099604a3246f1f98a2ab53df7c233d425d8b9d2 Mon Sep 17 00:00:00 2001 From: Giovanni Ferrari Date: Mon, 1 Feb 2021 16:37:48 +0100 Subject: [PATCH 03/62] [OC-1354] Fix error in console when using multi-select component --- .../app/modules/share/multi-filter/multi-filter.component.html | 1 - .../app/modules/share/multi-filter/multi-filter.component.ts | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ui/main/src/app/modules/share/multi-filter/multi-filter.component.html b/ui/main/src/app/modules/share/multi-filter/multi-filter.component.html index 33fa328218..75115e91ad 100644 --- a/ui/main/src/app/modules/share/multi-filter/multi-filter.component.html +++ b/ui/main/src/app/modules/share/multi-filter/multi-filter.component.html @@ -13,7 +13,6 @@ { this.translateService.use(locale); this.translateService.get(['multiFilter.searchPlaceholderText','multiFilter.selectAllText', 'multiFilter.unSelectAllText', 'multiFilter.filterSelectAllText', 'multiFilter.filterUnSelectAllText']) @@ -80,6 +82,7 @@ export class MultiFilterComponent implements OnInit, OnChanges, OnDestroy { onDeSelectAll(items: any) { this.selection = []; + this.parentForm.get(this.filterPath).setValue(this.selection); } ngOnChanges() { From 8961ec79bc880e591e32a01c388885e6f712ec32 Mon Sep 17 00:00:00 2001 From: vlo-rte Date: Fri, 29 Jan 2021 17:54:39 +0100 Subject: [PATCH 04/62] [OC-1407] Remove detailTitle --- .../businessconfig-storage/TEST/1/config.json | 3 --- .../businessconfig-storage/TEST/config.json | 3 --- .../businessconfig-storage/first/config.json | 3 --- .../first/v1/config.json | 3 --- .../model/ProcessStatesData.java | 1 - .../src/main/modeling/swagger.yaml | 11 ---------- .../test/data/bundles/second/2.0/config.json | 3 --- .../test/data/bundles/second/2.1/config.json | 3 --- .../businessconfig-storage/first/config.json | 3 --- src/docs/asciidoc/getting_started/index.adoc | 6 +----- .../reference_doc/process_definition.adoc | 8 +------ .../reference_doc/response_cards.adoc | 3 --- .../asciidoc/reference_doc/user_cards.adoc | 3 --- .../resources/bundle_api_test/config.json | 7 ------- .../resources/bundle_api_test_v2/config.json | 7 ------- .../resources/bundle_test_action/config.json | 15 ------------- .../bundle_defaultProcess/config.json | 21 ------------------- .../bundle_defaultProcess_V0.1/config.json | 3 --- .../bundle_userCardExamples/config.json | 15 ------------- .../bundle_gridCooperation/config.json | 18 ---------------- .../bundles/bundle_message/config.json | 1 - .../bundles/bundle_message_v2/config.json | 1 - ui/main/src/app/model/processes.model.ts | 1 - .../components/detail/detail.component.html | 2 +- ui/main/src/tests/helpers.ts | 2 +- 25 files changed, 4 insertions(+), 142 deletions(-) diff --git a/services/core/businessconfig/src/main/docker/volume/businessconfig-storage/TEST/1/config.json b/services/core/businessconfig/src/main/docker/volume/businessconfig-storage/TEST/1/config.json index 404f2755a9..22269b71e2 100755 --- a/services/core/businessconfig/src/main/docker/volume/businessconfig-storage/TEST/1/config.json +++ b/services/core/businessconfig/src/main/docker/volume/businessconfig-storage/TEST/1/config.json @@ -12,9 +12,6 @@ "firstState": { "name": "state.label", "color": "blue", - "detailTitle": { - "key": "template.title" - }, "templateName": "operation", "acknowledgmentAllowed": "Never" } diff --git a/services/core/businessconfig/src/main/docker/volume/businessconfig-storage/TEST/config.json b/services/core/businessconfig/src/main/docker/volume/businessconfig-storage/TEST/config.json index 404f2755a9..22269b71e2 100755 --- a/services/core/businessconfig/src/main/docker/volume/businessconfig-storage/TEST/config.json +++ b/services/core/businessconfig/src/main/docker/volume/businessconfig-storage/TEST/config.json @@ -12,9 +12,6 @@ "firstState": { "name": "state.label", "color": "blue", - "detailTitle": { - "key": "template.title" - }, "templateName": "operation", "acknowledgmentAllowed": "Never" } diff --git a/services/core/businessconfig/src/main/docker/volume/businessconfig-storage/first/config.json b/services/core/businessconfig/src/main/docker/volume/businessconfig-storage/first/config.json index db1ee3456b..0efc8daddc 100755 --- a/services/core/businessconfig/src/main/docker/volume/businessconfig-storage/first/config.json +++ b/services/core/businessconfig/src/main/docker/volume/businessconfig-storage/first/config.json @@ -15,9 +15,6 @@ "firstState": { "name": "firstState.label", "color": "blue", - "detailTitle": { - "key": "template1.title" - }, "templateName": "template1", "acknowledgmentAllowed": "Never" } diff --git a/services/core/businessconfig/src/main/docker/volume/businessconfig-storage/first/v1/config.json b/services/core/businessconfig/src/main/docker/volume/businessconfig-storage/first/v1/config.json index db1ee3456b..0efc8daddc 100755 --- a/services/core/businessconfig/src/main/docker/volume/businessconfig-storage/first/v1/config.json +++ b/services/core/businessconfig/src/main/docker/volume/businessconfig-storage/first/v1/config.json @@ -15,9 +15,6 @@ "firstState": { "name": "firstState.label", "color": "blue", - "detailTitle": { - "key": "template1.title" - }, "templateName": "template1", "acknowledgmentAllowed": "Never" } diff --git a/services/core/businessconfig/src/main/java/org/lfenergy/operatorfabric/businessconfig/model/ProcessStatesData.java b/services/core/businessconfig/src/main/java/org/lfenergy/operatorfabric/businessconfig/model/ProcessStatesData.java index 40e4bbe7f2..926acd2cee 100644 --- a/services/core/businessconfig/src/main/java/org/lfenergy/operatorfabric/businessconfig/model/ProcessStatesData.java +++ b/services/core/businessconfig/src/main/java/org/lfenergy/operatorfabric/businessconfig/model/ProcessStatesData.java @@ -27,7 +27,6 @@ public class ProcessStatesData implements ProcessStates { private String description; private Boolean showDetailCardHeader; private UserCard userCard; - private I18n detailTitle; private String templateName; @Singular private List styles; diff --git a/services/core/businessconfig/src/main/modeling/swagger.yaml b/services/core/businessconfig/src/main/modeling/swagger.yaml index 6cb9ca9608..b2819f24ff 100755 --- a/services/core/businessconfig/src/main/modeling/swagger.yaml +++ b/services/core/businessconfig/src/main/modeling/swagger.yaml @@ -371,9 +371,6 @@ definitions: userCard: description : User card template and visibility options $ref: '#/definitions/UserCard' - detailTitle: - description: Detail i18n title - $ref: '#/definitions/I18n' templateName: description: >- Name of the template to use @@ -404,16 +401,8 @@ definitions: name: some_business_process.label version: v1.0 initial_state: - detailTitle: - key: template.title - parameters: - param: value templateName: template1 other_state: - detailTitle: - key: template2.title - parameters: - param: value templateName: template2 styles: - my-template.css diff --git a/services/core/businessconfig/src/test/data/bundles/second/2.0/config.json b/services/core/businessconfig/src/test/data/bundles/second/2.0/config.json index 369baa2b08..b64deadb25 100755 --- a/services/core/businessconfig/src/test/data/bundles/second/2.0/config.json +++ b/services/core/businessconfig/src/test/data/bundles/second/2.0/config.json @@ -18,9 +18,6 @@ }, "externalRecipients": ["externalRecipient1", "externalRecipient2"] }, - "detailTitle": { - "key": "template.title" - }, "templateName": "template", "actions": { "action1": { diff --git a/services/core/businessconfig/src/test/data/bundles/second/2.1/config.json b/services/core/businessconfig/src/test/data/bundles/second/2.1/config.json index 68ebe47626..c9ac8343f5 100755 --- a/services/core/businessconfig/src/test/data/bundles/second/2.1/config.json +++ b/services/core/businessconfig/src/test/data/bundles/second/2.1/config.json @@ -20,9 +20,6 @@ }, "externalRecipients": ["externalRecipient1", "externalRecipient2"] }, - "detailTitle": { - "key": "template.title" - }, "templateName": "template", "actions": { "action1": { diff --git a/services/core/businessconfig/src/test/docker/volume/businessconfig-storage/first/config.json b/services/core/businessconfig/src/test/docker/volume/businessconfig-storage/first/config.json index ac5227066d..6267994003 100755 --- a/services/core/businessconfig/src/test/docker/volume/businessconfig-storage/first/config.json +++ b/services/core/businessconfig/src/test/docker/volume/businessconfig-storage/first/config.json @@ -7,9 +7,6 @@ ], "states": { "testState": { - "detailTitle": { - "key": "template.title" - }, "templateName": "template", "actions": { "testAction": { diff --git a/src/docs/asciidoc/getting_started/index.adoc b/src/docs/asciidoc/getting_started/index.adoc index 66d5ff1e1a..f588ae9dac 100644 --- a/src/docs/asciidoc/getting_started/index.adoc +++ b/src/docs/asciidoc/getting_started/index.adoc @@ -192,7 +192,6 @@ The global configuration is defined in config.json : "version":"2", "states":{ "messageState" : { - "detailTitle" : { "key" : "defaultProcess.title"}, "templateName" : "template", "styles" : [ "style" ] } @@ -251,7 +250,7 @@ You should received the following JSON in response, describing your bundle. [source,JSON] ---- -{"id":"defaultProcess","name":null,"version":"2","uiVisibility":null,"states":{"messageState":{"responseData":null,"acknowledgementAllowed":true,"color":null,"name":null,"userCard":null,"detailTitle":{"key":"defaultProcess.title","parameters":null},"templateName":"template","styles":["style"],"acknowledgmentAllowed":true,"response":null}}} +{"id":"defaultProcess","name":null,"version":"2","uiVisibility":null,"states":{"messageState":{"responseData":null,"acknowledgementAllowed":true,"color":null,"name":null,"userCard":null,"templateName":"template","styles":["style"],"acknowledgmentAllowed":true,"response":null}}} ---- ==== Send a card @@ -309,19 +308,16 @@ of the bundle: "version":"1", "states":{ "criticalSituation-begin" : { - "detailTitle" : { "key" : "criticalSituation-begin.title"}, "templateName" : "criticalSituationTemplate", "styles" : [ "style" ], "acknowledgmentAllowed": "Always" }, "criticalSituation-update" : { - "detailTitle" : { "key" : "criticalSituation-update.title"}, "templateName" : "criticalSituationTemplate", "styles" : [ "style" ], "acknowledgmentAllowed": "Always" }, "criticalSituation-end" : { - "detailTitle" : { "key" : "criticalSituation-end.title"}, "templateName" : "endCriticalSituationTemplate", "styles" : [ "style" ], "acknowledgmentAllowed": "Always" diff --git a/src/docs/asciidoc/reference_doc/process_definition.adoc b/src/docs/asciidoc/reference_doc/process_definition.adoc index 388275d13e..c8f4091981 100644 --- a/src/docs/asciidoc/reference_doc/process_definition.adoc +++ b/src/docs/asciidoc/reference_doc/process_definition.adoc @@ -317,15 +317,9 @@ These command line should return a `200 http status` response with the details o "version": "1", "states" : { "start" : { - "detailTitle" : { - "key" : "start.first.title" - }, - "templateName" : "template1" + "templateName" : "template1" }, "end" : { - "detailTitle" : { - "key" : "end.first.title" - }, "templateName" : "template2", "styles" : [ "bundleTest.css" ] } diff --git a/src/docs/asciidoc/reference_doc/response_cards.adoc b/src/docs/asciidoc/reference_doc/response_cards.adoc index df1129b0c7..2b9d3b0b49 100644 --- a/src/docs/asciidoc/reference_doc/response_cards.adoc +++ b/src/docs/asciidoc/reference_doc/response_cards.adoc @@ -65,9 +65,6 @@ A card can have a response only if it's in a process/state that is configured fo "key": "question.button.text" } }, - "detailTitle": { - "key": "question.title" - }, "templateName": "question", "styles": [ "style" diff --git a/src/docs/asciidoc/reference_doc/user_cards.adoc b/src/docs/asciidoc/reference_doc/user_cards.adoc index 6729679826..a4522687ed 100644 --- a/src/docs/asciidoc/reference_doc/user_cards.adoc +++ b/src/docs/asciidoc/reference_doc/user_cards.adoc @@ -31,9 +31,6 @@ For example : "startDateVisible" : true, "endDateVisible" : true }, - "detailTitle": { - "key": "message.title" - }, "templateName": "message", "styles": [], "acknowledgmentAllowed": "Always" diff --git a/src/test/api/karate/businessconfig/resources/bundle_api_test/config.json b/src/test/api/karate/businessconfig/resources/bundle_api_test/config.json index 4a19faeb61..90d7d4c2ca 100644 --- a/src/test/api/karate/businessconfig/resources/bundle_api_test/config.json +++ b/src/test/api/karate/businessconfig/resources/bundle_api_test/config.json @@ -8,7 +8,6 @@ }, "states": { "messageState" : { - "detailTitle" : { "key" : "detail.title"}, "templateName" : "template", "styles" : [ "style" ] }, @@ -24,9 +23,6 @@ "response": { "state": "questionState" }, - "detailTitle": { - "key": "question.title" - }, "templateName": "question", "styles": [], "acknowledgmentAllowed": "Never" @@ -43,9 +39,6 @@ "response": { "state": "incidentInProgressState" }, - "detailTitle": { - "key": "incidentInProgress.name" - }, "templateName": "incidentInProgress", "styles": [], "acknowledgmentAllowed": "Always" diff --git a/src/test/api/karate/businessconfig/resources/bundle_api_test_v2/config.json b/src/test/api/karate/businessconfig/resources/bundle_api_test_v2/config.json index 78813edbe6..bd4e376040 100644 --- a/src/test/api/karate/businessconfig/resources/bundle_api_test_v2/config.json +++ b/src/test/api/karate/businessconfig/resources/bundle_api_test_v2/config.json @@ -8,7 +8,6 @@ }, "states": { "messageState" : { - "detailTitle" : { "key" : "detail.title"}, "templateName" : "template", "styles" : [ "style" ] }, @@ -24,9 +23,6 @@ "response": { "state": "questionState" }, - "detailTitle": { - "key": "question.title" - }, "templateName": "question", "styles": [], "acknowledgmentAllowed": "Never" @@ -43,9 +39,6 @@ "response": { "state": "incidentInProgressState" }, - "detailTitle": { - "key": "incidentInProgress.name" - }, "templateName": "incidentInProgress", "styles": [], "acknowledgmentAllowed": "Always" diff --git a/src/test/api/karate/businessconfig/resources/bundle_test_action/config.json b/src/test/api/karate/businessconfig/resources/bundle_test_action/config.json index 207c2a96b4..181262c7d7 100755 --- a/src/test/api/karate/businessconfig/resources/bundle_test_action/config.json +++ b/src/test/api/karate/businessconfig/resources/bundle_test_action/config.json @@ -14,9 +14,6 @@ "key": "action.text" } }, - "detailTitle": { - "key": "cardDetails.title" - }, "templateName": "long-card", "styles": [ ] @@ -31,9 +28,6 @@ }, "externalRecipients": ["externalRecipient1", "externalRecipient2"] }, - "detailTitle": { - "key": "cardDetails.title" - }, "templateName": "template1", "styles": [ "main" @@ -47,9 +41,6 @@ "key": "action.text" } }, - "detailTitle": { - "key": "cardDetails.title" - }, "templateName": "template1", "styles": [ "main" @@ -61,9 +52,6 @@ "state": "responseState", "btnColor": "RED" }, - "detailTitle": { - "key": "cardDetails.title" - }, "templateName": "template1", "styles": [ "main" @@ -74,9 +62,6 @@ "lock": true, "state": "responseState" }, - "detailTitle": { - "key": "cardDetails.title" - }, "templateName": "template1", "styles": [ "main" diff --git a/src/test/utils/karate/businessconfig/resources/bundle_defaultProcess/config.json b/src/test/utils/karate/businessconfig/resources/bundle_defaultProcess/config.json index 46b4734c27..16c33677dc 100644 --- a/src/test/utils/karate/businessconfig/resources/bundle_defaultProcess/config.json +++ b/src/test/utils/karate/businessconfig/resources/bundle_defaultProcess/config.json @@ -15,9 +15,6 @@ "userCard" : { "template" : "usercard_message" }, - "detailTitle": { - "key": "message.title" - }, "templateName": "template", "styles": [ "style" @@ -28,9 +25,6 @@ "name": "chartDetail.title", "description": "chartState.description", "color": "#DA00DA", - "detailTitle": { - "key": "chartDetail.title" - }, "templateName": "chart", "styles": [ "style" @@ -41,9 +35,6 @@ "name": "chartLine.title", "description": "chartLineState.description", "color": "#6666FF", - "detailTitle": { - "key": "chartLine.title" - }, "templateName": "chart-line", "styles": [ "style" @@ -57,9 +48,6 @@ "userCard" : { "template" : "usercard_process" }, - "detailTitle": { - "key": "process.label" - }, "templateName": "process", "styles": [ "style" @@ -70,9 +58,6 @@ "name": "contingencies.title", "description": "contingenciesState.description", "color": "#0070C0", - "detailTitle": { - "key": "contingencies.title" - }, "templateName": "contingencies", "styles": [ "contingencies" @@ -91,9 +76,6 @@ "key": "question.button.text" } }, - "detailTitle": { - "key": "question.title" - }, "templateName": "question", "styles": [ "style" @@ -104,9 +86,6 @@ "name": "response.title", "description": "responseState.description", "color": "#0070C0", - "detailTitle": { - "key": "response.title" - }, "templateName": "response", "styles": [ "style" diff --git a/src/test/utils/karate/businessconfig/resources/bundle_defaultProcess_V0.1/config.json b/src/test/utils/karate/businessconfig/resources/bundle_defaultProcess_V0.1/config.json index 10f4182681..d3e375b980 100644 --- a/src/test/utils/karate/businessconfig/resources/bundle_defaultProcess_V0.1/config.json +++ b/src/test/utils/karate/businessconfig/resources/bundle_defaultProcess_V0.1/config.json @@ -6,9 +6,6 @@ "messageState": { "name": "defaultProcess.title", "color": "#CC9900", - "detailTitle": { - "key": "defaultProcess.title" - }, "templateName": "template", "styles": [ "style" diff --git a/src/test/utils/karate/businessconfig/resources/bundle_userCardExamples/config.json b/src/test/utils/karate/businessconfig/resources/bundle_userCardExamples/config.json index 1e2d592c5e..cf4ffba761 100644 --- a/src/test/utils/karate/businessconfig/resources/bundle_userCardExamples/config.json +++ b/src/test/utils/karate/businessconfig/resources/bundle_userCardExamples/config.json @@ -14,9 +14,6 @@ "userCard" : { "template" : "usercard_message" }, - "detailTitle": { - "key": "message.title" - }, "templateName": "message", "styles": [], "acknowledgmentAllowed": "Always" @@ -27,9 +24,6 @@ "userCard" : { "template" : "usercard_conference" }, - "detailTitle": { - "key": "conference.title" - }, "templateName": "conference", "styles": [], "acknowledgmentAllowed": "Always" @@ -47,9 +41,6 @@ "response": { "state": "questionState" }, - "detailTitle": { - "key": "question.title" - }, "templateName": "question", "styles": [], "acknowledgmentAllowed": "Never" @@ -60,9 +51,6 @@ "userCard" : { "template" : "usercard_task" }, - "detailTitle": { - "key": "task.title" - }, "templateName": "task", "styles": [ ], @@ -80,9 +68,6 @@ "response": { "state": "incidentInProgressState" }, - "detailTitle": { - "key": "incidentInProgress.name" - }, "templateName": "incidentInProgress", "styles": [], "acknowledgmentAllowed": "OnlyWhenResponseDisabledForUser" diff --git a/src/test/utils/karate/examples/gridCooperation/bundle_gridCooperation/config.json b/src/test/utils/karate/examples/gridCooperation/bundle_gridCooperation/config.json index e3cda5361c..2fb4da9ecf 100644 --- a/src/test/utils/karate/examples/gridCooperation/bundle_gridCooperation/config.json +++ b/src/test/utils/karate/examples/gridCooperation/bundle_gridCooperation/config.json @@ -11,54 +11,36 @@ "name": "timeout-FrEs-IGCC.title", "acknowledgmentAllowed": "Always", "color": "red", - "detailTitle": { - "key": "timeout-FrEs-IGCC.title" - }, "templateName": "timeout-FrEs-IGCC" }, "action-FrEs-IGCC-export-0": { "name": "action-FrEs-IGCC-export-0.title", "acknowledgmentAllowed": "Always", "color": "red", - "detailTitle": { - "key": "action-FrEs-IGCC-export-0.title" - }, "templateName": "action-FrEs-IGCC-export-0" }, "action-FrEs-IGCC-export-300": { "name": "action-FrEs-IGCC-export-300.title", "acknowledgmentAllowed": "Always", "color": "orange", - "detailTitle": { - "key": "action-FrEs-IGCC-export-300.title" - }, "templateName": "action-FrEs-IGCC-export-300" }, "action-FrEs-IGCC-import-0": { "name": "action-FrEs-IGCC-import-0.title", "acknowledgmentAllowed": "Always", "color": "red", - "detailTitle": { - "key": "action-FrEs-IGCC-import-0.title" - }, "templateName": "action-FrEs-IGCC-import-0" }, "action-FrEs-IGCC-import-300": { "name": "action-FrEs-IGCC-import-300.title", "acknowledgmentAllowed": "Always", "color": "orange", - "detailTitle": { - "key": "action-FrEs-IGCC-import-300.title" - }, "templateName": "action-FrEs-IGCC-import-300" }, "compliant-FrEs-IGCC": { "name": "compliant-FrEs-IGCC.title", "acknowledgmentAllowed": "Always", "color": "green", - "detailTitle": { - "key": "compliant-FrEs-IGCC.title" - }, "templateName": "compliant-FrEs-IGCC" } } diff --git a/src/test/utils/karate/operatorfabric-getting-started/resources/bundles/bundle_message/config.json b/src/test/utils/karate/operatorfabric-getting-started/resources/bundles/bundle_message/config.json index 3753bcb2de..9efef08c3e 100755 --- a/src/test/utils/karate/operatorfabric-getting-started/resources/bundles/bundle_message/config.json +++ b/src/test/utils/karate/operatorfabric-getting-started/resources/bundles/bundle_message/config.json @@ -3,7 +3,6 @@ "version":"1", "states":{ "messageState" : { - "detailTitle" : { "key" : "defaultProcess.title"}, "templateName" : "template", "styles" : [ "style" ] } diff --git a/src/test/utils/karate/operatorfabric-getting-started/resources/bundles/bundle_message_v2/config.json b/src/test/utils/karate/operatorfabric-getting-started/resources/bundles/bundle_message_v2/config.json index 887f4982b0..d29176760d 100644 --- a/src/test/utils/karate/operatorfabric-getting-started/resources/bundles/bundle_message_v2/config.json +++ b/src/test/utils/karate/operatorfabric-getting-started/resources/bundles/bundle_message_v2/config.json @@ -3,7 +3,6 @@ "version":"2", "states":{ "messageState" : { - "detailTitle" : { "key" : "defaultProcess.title"}, "templateName" : "template", "styles" : [ "style" ] } diff --git a/ui/main/src/app/model/processes.model.ts b/ui/main/src/app/model/processes.model.ts index f5358fc182..39fbaed59a 100644 --- a/ui/main/src/app/model/processes.model.ts +++ b/ui/main/src/app/model/processes.model.ts @@ -50,7 +50,6 @@ export class UiVisibility { export class State { /* istanbul ignore next */ constructor( - readonly detailTitle?: I18n, readonly templateName?: string, readonly styles?: string[], readonly response?: Response, diff --git a/ui/main/src/app/modules/cards/components/detail/detail.component.html b/ui/main/src/app/modules/cards/components/detail/detail.component.html index ffd6d56662..9e1be2b455 100644 --- a/ui/main/src/app/modules/cards/components/detail/detail.component.html +++ b/ui/main/src/app/modules/cards/components/detail/detail.component.html @@ -10,7 +10,7 @@
diff --git a/ui/main/src/app/modules/admin/admin.component.scss b/ui/main/src/app/modules/admin/admin.component.scss new file mode 100644 index 0000000000..250adb5f48 --- /dev/null +++ b/ui/main/src/app/modules/admin/admin.component.scss @@ -0,0 +1,17 @@ +/* Copyright (c) 2021, RTE (http://www.rte-france.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 OperatorFabric project. + */ + + + +#tabs { + margin-left: 5%; + margin-right: 5%; +} + + diff --git a/ui/main/src/app/modules/admin/admin.component.ts b/ui/main/src/app/modules/admin/admin.component.ts index 2f66947948..e4b806c6b3 100644 --- a/ui/main/src/app/modules/admin/admin.component.ts +++ b/ui/main/src/app/modules/admin/admin.component.ts @@ -1,4 +1,4 @@ -/* Copyright (c) 2018-2020, RTEI (http://www.rte-international.com) +/* Copyright (c) 2020, RTEi (http://www.rte-international.com) * Copyright (c) 2021, RTE (http://www.rte-france.com) * See AUTHORS.txt * This Source Code Form is subject to the terms of the Mozilla Public @@ -8,18 +8,20 @@ * This file is part of the OperatorFabric project. */ -import { Component, OnDestroy, OnInit } from '@angular/core'; -import { ActivatedRoute } from '@angular/router'; -import { Store } from '@ngrx/store'; -import { TranslateService } from '@ngx-translate/core'; -import { AppState } from '@ofStore/index'; -import { buildSettingsOrConfigSelector } from '@ofStore/selectors/settings.x.config.selectors'; -import { Observable, Subject } from 'rxjs'; -import { takeUntil } from 'rxjs/operators'; + +import {Component, OnDestroy, OnInit} from '@angular/core'; +import {ActivatedRoute} from '@angular/router'; +import {Store} from '@ngrx/store'; +import {TranslateService} from '@ngx-translate/core'; +import {AppState} from '@ofStore/index'; +import {buildSettingsOrConfigSelector} from '@ofStore/selectors/settings.x.config.selectors'; +import {Observable, Subject} from 'rxjs'; +import {takeUntil} from 'rxjs/operators'; @Component({ selector: 'of-admin', - templateUrl: './admin.component.html' + templateUrl: './admin.component.html', + styleUrls: ['./admin.component.scss'] }) export class AdminComponent implements OnInit, OnDestroy { @@ -30,6 +32,11 @@ export class AdminComponent implements OnInit, OnDestroy { entitiesLabel: string; groupsLabel: string; + private paginationDefaultPageSize = 10; + private paginationPageSizeOptions = [5, 10, 25, 50, 100]; + public paginationPageSize = this.paginationDefaultPageSize; + + //TODO Why do we need to use translate.get and subscriptions rather than the translate directive like everywhere else? constructor(private route: ActivatedRoute, protected store: Store, protected translate: TranslateService) { this.getLocale().pipe(takeUntil(this.unsubscribe$)).subscribe(locale => { this.translate.use(locale); @@ -60,4 +67,10 @@ export class AdminComponent implements OnInit, OnDestroy { this.unsubscribe$.complete(); } + onPageSizeChanged() { + // Cast to get rid of "Property 'value' does not exist on type 'HTMLElement'." + const value = ( document.getElementById('page-size-select')).value; + this.paginationPageSize = Number(value); + } + } diff --git a/ui/main/src/app/modules/admin/admin.module.ts b/ui/main/src/app/modules/admin/admin.module.ts index ec2faa2967..d808039d83 100644 --- a/ui/main/src/app/modules/admin/admin.module.ts +++ b/ui/main/src/app/modules/admin/admin.module.ts @@ -1,4 +1,5 @@ -/* Copyright (c) 2018-2020, RTEI (http://www.rte-international.com) +/* Copyright (c) 2020, RTEi (http://www.rte-international.com) + * Copyright (c) 2021, RTE (http://www.rte-france.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 @@ -7,41 +8,41 @@ * This file is part of the OperatorFabric project. */ -import { ErrorHandler, NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { AdminComponent } from './admin.component'; -import { PaginationModule } from 'ngx-bootstrap/pagination'; -import { AdminRoutingModule } from './admin-rooting.module'; -import { TranslateModule } from '@ngx-translate/core'; -import { AppErrorHandler } from 'app/common/error/app-error-handler'; -import { OfUsersTableComponent } from './components/ngtable/users/ofuserstable.component'; -import { OfGroupsTableComponent } from './components/ngtable/groups/of-groups-table.component'; -import { OfEntitiesTableComponent } from './components/ngtable/entities/of-entities-table.component'; -import { OfTableComponent } from './components/ngtable/oftable/oftable.component'; -import { Ng2TableModule } from 'ng2-table'; -import { EditUsermodalComponent } from './components/editmodal/users/edit-user-modal.component'; -import { ConfirmationDialogComponent } from './components/confirmation-dialog/confirmation-dialog.component'; -import { MatInputModule, MatSelectModule } from '@angular/material'; -import { EditEntityGroupModalComponent } from './components/editmodal/groups-entities/edit-entity-group-modal.component'; +import {ErrorHandler, NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import {FormsModule, ReactiveFormsModule} from '@angular/forms'; +import {AdminComponent} from './admin.component'; +import {PaginationModule} from 'ngx-bootstrap/pagination'; +import {AdminRoutingModule} from './admin-rooting.module'; +import {TranslateModule} from '@ngx-translate/core'; +import {AppErrorHandler} from 'app/common/error/app-error-handler'; +import {EditUserModalComponent} from './components/editmodal/users/edit-user-modal.component'; +import {ConfirmationDialogComponent} from './components/confirmation-dialog/confirmation-dialog.component'; +import {EditEntityGroupModalComponent} from './components/editmodal/groups-entities/edit-entity-group-modal.component'; +import {AgGridModule} from 'ag-grid-angular'; +import {UsersTableComponent} from './components/table/users-table.component'; +import {ActionCellRendererComponent} from './components/table/action-cell-renderer.component'; +import {MatInputModule, MatSelectModule} from '@angular/material'; +import {EntitiesTableComponent} from './components/table/entities-table.component'; +import {GroupsTableComponent} from './components/table/groups-table.component'; @NgModule({ declarations: [ AdminComponent, - OfUsersTableComponent, - OfGroupsTableComponent, - OfEntitiesTableComponent, - OfTableComponent, - EditUsermodalComponent, + UsersTableComponent, + EntitiesTableComponent, + GroupsTableComponent, + EditUserModalComponent, ConfirmationDialogComponent, - EditEntityGroupModalComponent + EditEntityGroupModalComponent, + ActionCellRendererComponent ], entryComponents: [ - EditUsermodalComponent, + EditUserModalComponent, ConfirmationDialogComponent, EditEntityGroupModalComponent ], @@ -56,9 +57,13 @@ import { EditEntityGroupModalComponent } from './components/editmodal/groups-ent , MatSelectModule , MatInputModule , TranslateModule - , Ng2TableModule + , AgGridModule.withComponents([[ + ActionCellRendererComponent, + ]]), ], - providers: [{ provide: ErrorHandler, useClass: AppErrorHandler }] + providers: [ + { provide: ErrorHandler, useClass: AppErrorHandler }, + ] }) export class AdminModule { } diff --git a/ui/main/src/app/modules/admin/components/confirmation-dialog/confirmation-dialog.component.html b/ui/main/src/app/modules/admin/components/confirmation-dialog/confirmation-dialog.component.html index e95418d949..0e7cec7351 100644 --- a/ui/main/src/app/modules/admin/components/confirmation-dialog/confirmation-dialog.component.html +++ b/ui/main/src/app/modules/admin/components/confirmation-dialog/confirmation-dialog.component.html @@ -1,3 +1,12 @@ + + + + + + + + + diff --git a/ui/main/src/app/modules/admin/components/editmodal/groups-entities/edit-group-modal.component.scss b/ui/main/src/app/modules/admin/components/editmodal/groups-entities/edit-group-modal.component.scss index 50c203405e..8220852f7b 100644 --- a/ui/main/src/app/modules/admin/components/editmodal/groups-entities/edit-group-modal.component.scss +++ b/ui/main/src/app/modules/admin/components/editmodal/groups-entities/edit-group-modal.component.scss @@ -1,3 +1,12 @@ +/* Copyright (c) 2020, RTEi (http://www.rte-international.com) + * Copyright (c) 2021, RTE (http://www.rte-france.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 OperatorFabric project. + */ .ng-valid[required], .ng-valid.required { border-left: 5px solid #42A948; /* green */ @@ -37,4 +46,4 @@ form, input, label, p { ::ng-deep .mat-select-value { color: white; -} \ No newline at end of file +} diff --git a/ui/main/src/app/modules/admin/components/editmodal/users/edit-user-modal.component.html b/ui/main/src/app/modules/admin/components/editmodal/users/edit-user-modal.component.html index aa2cfb3c14..3a50276e68 100644 --- a/ui/main/src/app/modules/admin/components/editmodal/users/edit-user-modal.component.html +++ b/ui/main/src/app/modules/admin/components/editmodal/users/edit-user-modal.component.html @@ -1,4 +1,13 @@ - + + + + + + + + + +