diff --git a/VERSION b/VERSION index 001b3d36b4..664bae753b 100755 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.10.0.RELEASE +2.11.0.RELEASE diff --git a/config/dev/docker-compose.yml b/config/dev/docker-compose.yml index c0f7a9cf31..8aa3b8e5d4 100755 --- a/config/dev/docker-compose.yml +++ b/config/dev/docker-compose.yml @@ -26,7 +26,7 @@ services: - "89:8080" - "90:9990" web-ui: - image: "lfeoperatorfabric/of-web-ui:2.10.0.RELEASE" + image: "lfeoperatorfabric/of-web-ui:2.11.0.RELEASE" #user: ${USER_ID}:${USER_GID} ports: - "2002:80" @@ -36,6 +36,6 @@ services: - "./nginx.conf:/etc/nginx/conf.d/default.conf" - "./loggingResults:/etc/nginx/html/logging" ext-app: - image: "lfeoperatorfabric/of-external-app:2.10.0.RELEASE" + image: "lfeoperatorfabric/of-external-app:2.11.0.RELEASE" ports: - "8090:8090" diff --git a/config/docker/docker-compose.yml b/config/docker/docker-compose.yml index e4f9a77385..f100fb5175 100755 --- a/config/docker/docker-compose.yml +++ b/config/docker/docker-compose.yml @@ -28,7 +28,7 @@ services: # - "90:9990" users: container_name: users - image: "lfeoperatorfabric/of-users-business-service:2.10.0.RELEASE" + image: "lfeoperatorfabric/of-users-business-service:2.11.0.RELEASE" depends_on: - mongodb - rabbitmq @@ -46,7 +46,7 @@ services: - ${CONFIG_PATH}:/external-config businessconfig: container_name: businessconfig - image: "lfeoperatorfabric/of-businessconfig-business-service:2.10.0.RELEASE" + image: "lfeoperatorfabric/of-businessconfig-business-service:2.11.0.RELEASE" depends_on: - mongodb user: ${USER_ID}:${USER_GID} @@ -64,7 +64,7 @@ services: - ${CONFIG_PATH}:/external-config cards-publication: container_name: cards-publication - image: "lfeoperatorfabric/of-cards-publication-business-service:2.10.0.RELEASE" + image: "lfeoperatorfabric/of-cards-publication-business-service:2.11.0.RELEASE" depends_on: - mongodb - rabbitmq @@ -82,7 +82,7 @@ services: - ${CONFIG_PATH}:/external-config cards-consultation: container_name: cards-consultation - image: "lfeoperatorfabric/of-cards-consultation-business-service:2.10.0.RELEASE" + image: "lfeoperatorfabric/of-cards-consultation-business-service:2.11.0.RELEASE" depends_on: - mongodb - rabbitmq @@ -99,7 +99,7 @@ services: - "./cards-consultation-docker.yml:/config/application-docker.yml" - ${CONFIG_PATH}:/external-config web-ui: - image: "lfeoperatorfabric/of-web-ui:2.10.0.RELEASE" + image: "lfeoperatorfabric/of-web-ui:2.11.0.RELEASE" ports: - "2002:80" depends_on: @@ -111,6 +111,6 @@ services: - "./nginx.conf:/etc/nginx/conf.d/default.conf" ext-app: # External application example, must not be activated in production mode - image: "lfeoperatorfabric/of-external-app:2.10.0.RELEASE" + image: "lfeoperatorfabric/of-external-app:2.11.0.RELEASE" ports: - "8090:8090" diff --git a/config/docker/ui-config/web-ui.json b/config/docker/ui-config/web-ui.json index 92cf57786b..bf2c7b5d29 100644 --- a/config/docker/ui-config/web-ui.json +++ b/config/docker/ui-config/web-ui.json @@ -4,6 +4,8 @@ "checkPerimeterForResponseCard": true, "checkPerimeterForSearchFields": false, "showUserEntitiesOnTopRightOfTheScreen": true, + "settings.replayInterval": 10, + "settings.replayEnabled": true, "archive": { "filters": { "page": { @@ -25,6 +27,18 @@ } } }, + "logging": { + "filters": { + "tags": { + "list": [ + { + "label": "Label for tag 1", + "value": "tag1" + } + ] + } + } + }, "feed": { "card": { "hideTimeFilter": false, @@ -121,7 +135,7 @@ "operatorfabric": { "name": "OperatorFabric", "rank": 0, - "version": "2.10.0.RELEASE" + "version": "2.11.0.RELEASE" } }, "infos": { diff --git a/services/core/businessconfig/src/main/modeling/swagger.yaml b/services/core/businessconfig/src/main/modeling/swagger.yaml index eb36f66953..fd0b855aa2 100755 --- a/services/core/businessconfig/src/main/modeling/swagger.yaml +++ b/services/core/businessconfig/src/main/modeling/swagger.yaml @@ -1,7 +1,7 @@ swagger: '2.0' info: description: IMPORTANT - The Try it Out button will generate curl requests for examples, but executing them through the UI will not work as authentication has not been set up. This page is for documentation only. - version: 2.10.0.RELEASE + version: 2.11.0.RELEASE title: BusinessConfig Management termsOfService: '' contact: diff --git a/services/core/cards-publication/src/main/modeling/swagger.yaml b/services/core/cards-publication/src/main/modeling/swagger.yaml index 6244ae86c9..b6feffb13d 100755 --- a/services/core/cards-publication/src/main/modeling/swagger.yaml +++ b/services/core/cards-publication/src/main/modeling/swagger.yaml @@ -1,7 +1,7 @@ swagger: '2.0' info: description: IMPORTANT - The Try it Out button will generate curl requests for examples, but executing them through the UI will not work as authentication has not been set up. This page is for documentation only. - version: 2.10.0.RELEASE + version: 2.11.0.RELEASE title: Card Management API termsOfService: '' contact: diff --git a/services/core/users/src/main/java/org/opfab/users/model/UserSettingsData.java b/services/core/users/src/main/java/org/opfab/users/model/UserSettingsData.java index 9e153cd609..0775355275 100644 --- a/services/core/users/src/main/java/org/opfab/users/model/UserSettingsData.java +++ b/services/core/users/src/main/java/org/opfab/users/model/UserSettingsData.java @@ -36,6 +36,8 @@ public class UserSettingsData implements UserSettings { private Boolean playSoundForAction; private Boolean playSoundForCompliant; private Boolean playSoundForInformation; + private Boolean replayEnabled; + private Integer replayInterval; @Singular("processStatesNotNotified") private Map> processesStatesNotNotified; @@ -54,6 +56,8 @@ public UserSettingsData(UserSettings settings) { this.playSoundForAction = settings.getPlaySoundForAction(); this.playSoundForCompliant = settings.getPlaySoundForCompliant(); this.playSoundForInformation = settings.getPlaySoundForInformation(); + this.replayEnabled = settings.getReplayEnabled(); + this.replayInterval = settings.getReplayInterval(); if (settings.getProcessesStatesNotNotified() != null) this.processesStatesNotNotified = new HashMap<>(settings.getProcessesStatesNotNotified()); @@ -118,6 +122,8 @@ else if (this.getDefaultTags() != null) result.playSoundForAction = other.getPlaySoundForAction() != null ? other.getPlaySoundForAction() : this.getPlaySoundForAction(); result.playSoundForCompliant = other.getPlaySoundForCompliant() != null ? other.getPlaySoundForCompliant() : this.getPlaySoundForCompliant(); result.playSoundForInformation = other.getPlaySoundForInformation() != null ? other.getPlaySoundForInformation() : this.getPlaySoundForInformation(); + result.replayEnabled = other.getReplayEnabled() != null ? other.getReplayEnabled() : this.getReplayEnabled(); + result.replayInterval = other.getReplayInterval() != null ? other.getReplayInterval() : this.getReplayInterval(); if (other.getProcessesStatesNotNotified() != null) result.processesStatesNotNotified = new HashMap<>(other.getProcessesStatesNotNotified()); diff --git a/services/core/users/src/main/modeling/swagger.yaml b/services/core/users/src/main/modeling/swagger.yaml index a1a02c5e86..d1b0939021 100755 --- a/services/core/users/src/main/modeling/swagger.yaml +++ b/services/core/users/src/main/modeling/swagger.yaml @@ -1,7 +1,7 @@ swagger: '2.0' info: description: IMPORTANT - The Try it Out button will generate curl requests for examples, but executing them through the UI will not work as authentication has not been set up. This page is for documentation only. - version: 2.10.0.RELEASE + version: 2.11.0.RELEASE title: User Management termsOfService: '' contact: @@ -194,6 +194,15 @@ definitions: playSoundForInformation: type: boolean description: If this is set to true, a sound will be played for incoming cards with INFORMATION severity. + replayEnabled: + type: boolean + description: |- + If this is set to true, sounds for incoming cards or reminders will be replayed until the user clicks + anywhere on the screen. + replayInterval: + type: integer + description: |- + Interval (in seconds) between sound replays. processesStatesNotNotified: type: object description: Filters on processes and states for user feed (exclusion filter) diff --git a/services/core/users/src/test/java/org/opfab/users/model/UserSettingsDataShould.java b/services/core/users/src/test/java/org/opfab/users/model/UserSettingsDataShould.java index cf8054bc91..8dd9db43de 100644 --- a/services/core/users/src/test/java/org/opfab/users/model/UserSettingsDataShould.java +++ b/services/core/users/src/test/java/org/opfab/users/model/UserSettingsDataShould.java @@ -46,6 +46,8 @@ public void patch(){ .playSoundForAlarm(true) .playSoundForAction(false) //Not setting Compliant and Information to test patch on empty + .replayEnabled(true) + .replayInterval(123) .processStatesNotNotified("processA", Arrays.asList("state1", "state2")) .processStatesNotNotified("processB", Arrays.asList("state3", "state4")) .build(); @@ -83,6 +85,14 @@ public void patch(){ assertThat(patched).isEqualToIgnoringGivenFields(userData,"playSoundForInformation"); assertThat(patched.getPlaySoundForInformation()).isEqualTo(true); + patched = userData.patch(UserSettingsData.builder().replayEnabled(false).build().clearTags().clearProcessesStatesNotNotified()); + assertThat(patched).isEqualToIgnoringGivenFields(userData,"replayEnabled"); + assertThat(patched.getReplayEnabled()).isEqualTo(false); + + patched = userData.patch(UserSettingsData.builder().replayInterval(456).build().clearTags().clearProcessesStatesNotNotified()); + assertThat(patched).isEqualToIgnoringGivenFields(userData,"replayInterval"); + assertThat(patched.getReplayInterval()).isEqualTo(456); + Map> newProcessesStatesNotNotified = new HashMap>(); newProcessesStatesNotNotified.put("processC", Arrays.asList("state5", "state6")); patched = userData.patch(UserSettingsData.builder().processesStatesNotNotified(newProcessesStatesNotNotified).build().clearTags()); diff --git a/src/docs/asciidoc/deployment/configuration/web-ui_configuration.adoc b/src/docs/asciidoc/deployment/configuration/web-ui_configuration.adoc index 4aebb1965c..8dc0d2746a 100644 --- a/src/docs/asciidoc/deployment/configuration/web-ui_configuration.adoc +++ b/src/docs/asciidoc/deployment/configuration/web-ui_configuration.adoc @@ -81,17 +81,14 @@ a|card time display mode in the feed. Values : |feed.card.maxNbOfCardsToDisplay|100|no| Max number of card visible in feed (This limit is used for performance reasons, setting the value too high can have consequences on browser response times) |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". -|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 -|playSoundForCompliant|false|no|If set to true, a sound is played when Compliant cards are added or updated in the feed -|playSoundForInformation|false|no|If set to true, a sound is played when Information cards are added or updated in the feed |i18n.supported.locales||no|List of supported locales (Only fr and en so far) |i10n.supported.time-zones||no|List of supported time zones, for instance 'Europe/Paris'. Values should be taken from the link:https://en.wikipedia.org/wiki/List_of_tz_database_time_zones[TZ database]. |archive.filters.page.size|10|no|The page size of archive filters |archive.history.size|100|no|The maximum size of card history visible -|archive.filters.tags.list||no|List of tags to choose from in the corresponding filter in archives +|archive.filters.tags.list||no|List of tags to choose from in the corresponding filter in archives page +|logging.filters.tags.list||no|List of tags to choose from in the corresponding filter in logging page |settings.tags.hide||no|Control if you want to show or hide the tags filter in feed page |settings.styleWhenNightDayModeDesactivated||no|style to apply if not using day night mode, possible value are DAY or NIGHT |settings.dateFormat|Value from the browser configuration|no|Format for date rendering (example : DD/MM/YYYY ) @@ -102,6 +99,12 @@ Values should be taken from the link:https://en.wikipedia.org/wiki/List_of_tz_da |settings.infos.timezone|false|no|Control if we want to hide(true) or display(false or not specified) the timezone in the settings page |settings.infos.tags|false|no|Control if we want to hide(true) or display(false or not specified) the tags in the settings page |settings.infos.sounds|false|no|Control if we want to hide(true) or display(false or not specified) the checkboxes for sound notifications in the settings page +|settings.playSoundForAlarm|false|no|If set to true, a sound is played when Alarm cards are added or updated in the feed +|settings.playSoundForAction|false|no|If set to true, a sound is played when Action cards are added or updated in the feed +|settings.playSoundForCompliant|false|no|If set to true, a sound is played when Compliant cards are added or updated in the feed +|settings.playSoundForInformation|false|no|If set to true, a sound is played when Information cards are added or updated in the feed +|settings.replayEnabled|false|no|If set to true, sounds are replayed every `settings.replayInterval` seconds until the user interacts with the application +|settings.replayInterval|5|no|Interval between sound replays (see `settings.replayEnabled`) |settings.about a|none a|no diff --git a/src/docs/asciidoc/dev_env/requirements.adoc b/src/docs/asciidoc/dev_env/requirements.adoc index 7571ce9331..9cbadc4d9b 100644 --- a/src/docs/asciidoc/dev_env/requirements.adoc +++ b/src/docs/asciidoc/dev_env/requirements.adoc @@ -9,7 +9,7 @@ = Requirements This section describes the projects requirements regardless of installation options. -Please see AGU +Please see ifdef::single-page-doc[<>] ifndef::single-page-doc[<>] below for details on: diff --git a/src/docs/asciidoc/resources/index.adoc b/src/docs/asciidoc/resources/index.adoc index 0af5935c96..145cec7def 100644 --- a/src/docs/asciidoc/resources/index.adoc +++ b/src/docs/asciidoc/resources/index.adoc @@ -32,3 +32,5 @@ include::migration_guide_to_2.7.adoc[leveloffset=+1] include::migration_guide_to_2.8.adoc[leveloffset=+1] +include::migration_guide_to_2.11.adoc[leveloffset=+1] + diff --git a/src/docs/asciidoc/resources/migration_guide_to_2.11.adoc b/src/docs/asciidoc/resources/migration_guide_to_2.11.adoc new file mode 100644 index 0000000000..4cbaebef07 --- /dev/null +++ b/src/docs/asciidoc/resources/migration_guide_to_2.11.adoc @@ -0,0 +1,37 @@ +// Copyright (c) 2021 RTE (http://www.rte-france.com) +// See AUTHORS.txt +// This document is subject to the terms of the Creative Commons Attribution 4.0 International license. +// If a copy of the license was not distributed with this +// file, You can obtain one at https://creativecommons.org/licenses/by/4.0/. +// SPDX-License-Identifier: CC-BY-4.0 + += Migration Guide from release 2.10.0 to release 2.11.0 + +== Logging screen : Filter with tags list + +As for archives screen, now you have to specify the list of tags you want to see in the filter of logging screen. +You have to set this list in the `web-ui.json` file, with the parameter `logging.filters.tags.list`. For example : + +[source,json] +---- +"logging": { + "filters": { + "tags": { + "list": [ + { + "label": "Label for tag 1", + "value": "tag1" + } + ] + } + } +} +---- + + + + + + + + diff --git a/ui/main/src/app/app.component.ts b/ui/main/src/app/app.component.ts index 8f74a180d6..7525014edb 100644 --- a/ui/main/src/app/app.component.ts +++ b/ui/main/src/app/app.component.ts @@ -8,7 +8,7 @@ */ -import {Component, OnInit} from '@angular/core'; +import {Component, HostListener, OnInit} from '@angular/core'; import {Title} from '@angular/platform-browser'; import {Store} from '@ngrx/store'; import {AppState} from '@ofStore/index'; @@ -30,6 +30,7 @@ import {Actions, ofType} from '@ngrx/effects'; import {AlertActions, AlertActionTypes} from '@ofStore/actions/alert.actions'; import {Message, MessageLevel} from '@ofModel/message.model'; import {GroupsService} from '@ofServices/groups.service'; +import {SoundNotificationService} from "@ofServices/sound-notification.service"; class Alert { alert: Message; @@ -67,6 +68,7 @@ export class AppComponent implements OnInit { , private groupsService: GroupsService , private processesService: ProcessesService , private reminderService: ReminderService + , private soundNotificationService: SoundNotificationService , private actions$: Actions) { } @@ -77,6 +79,11 @@ export class AppComponent implements OnInit { this.subscribeToAlerts(); } + @HostListener('document:click', ['$event.target']) + public onPageClick() { + this.soundNotificationService.clearOutstandingNotifications(); + } + private loadConfiguration() { diff --git a/ui/main/src/app/modules/archives/archives.component.html b/ui/main/src/app/modules/archives/archives.component.html index b47ad5e880..8778b40671 100644 --- a/ui/main/src/app/modules/archives/archives.component.html +++ b/ui/main/src/app/modules/archives/archives.component.html @@ -13,7 +13,7 @@
+ [hideChildStates]=true [tags]="tags" #filters>
diff --git a/ui/main/src/app/modules/archives/archives.component.ts b/ui/main/src/app/modules/archives/archives.component.ts index ee4af1f38e..5464a18722 100644 --- a/ui/main/src/app/modules/archives/archives.component.ts +++ b/ui/main/src/app/modules/archives/archives.component.ts @@ -111,6 +111,7 @@ export class ArchivesComponent implements OnDestroy, OnInit { this.size = this.configService.getConfigValue('archive.filters.page.size', 10); this.historySize = parseInt(this.configService.getConfigValue('archive.history.size', 100)); + this.tags = this.configService.getConfigValue('archive.filters.tags.list'); this.results = []; this.updatesByCardId = []; this.dateTimeFilterChange.pipe( diff --git a/ui/main/src/app/modules/calendar/calendar.component.ts b/ui/main/src/app/modules/calendar/calendar.component.ts index fc44d2422b..e89b0ab6df 100644 --- a/ui/main/src/app/modules/calendar/calendar.component.ts +++ b/ui/main/src/app/modules/calendar/calendar.component.ts @@ -9,11 +9,10 @@ import {AppState} from '@ofStore/index'; -import {select, Store} from '@ngrx/store'; +import {Store} from '@ngrx/store'; import {debounceTime, distinctUntilChanged, takeUntil} from 'rxjs/operators'; import {Subject} from 'rxjs'; -import * as feedSelectors from '@ofSelectors/feed.selectors'; -import {AfterViewInit, Component, ElementRef, HostListener, OnDestroy, OnInit, ViewChild} from '@angular/core'; +import {AfterViewInit, Component, ElementRef,OnDestroy, OnInit, ViewChild} from '@angular/core'; import {FullCalendarComponent} from '@fullcalendar/angular'; import {EventInput} from '@fullcalendar/core'; import allLocales from '@fullcalendar/core/locales-all'; @@ -27,6 +26,7 @@ import {FilterType} from '@ofServices/filter.service'; import {HourAndMinutes} from '@ofModel/card.model'; import {ProcessesService} from '@ofServices/processes.service'; import {DisplayContext} from '@ofModel/templateGateway.model'; +import {LightCardsStoreService} from '@ofServices/lightcards-store.service'; @Component({ selector: 'of-calendar', @@ -38,7 +38,8 @@ export class CalendarComponent implements OnInit, OnDestroy, AfterViewInit { constructor(private store: Store, private translate: TranslateService, private modalService: NgbModal, - private processesService: ProcessesService) { + private processesService: ProcessesService, + private lightCardsStoreService: LightCardsStoreService) { processesService.getAllProcesses().forEach(process => { if (!!process.uiVisibility && !!process.uiVisibility.calendar) this.mapOfProcesses.set(process.id, 1); @@ -106,7 +107,7 @@ export class CalendarComponent implements OnInit, OnDestroy, AfterViewInit { } private initDataPipe(): void { - this.store.pipe(select((feedSelectors.selectFeed))) + this.lightCardsStoreService.getLightCards() .pipe(takeUntil(this.unsubscribe$), debounceTime(200), distinctUntilChanged()) .subscribe(cards => this.processCards(cards)); } diff --git a/ui/main/src/app/modules/cards/components/detail/detail.component.ts b/ui/main/src/app/modules/cards/components/detail/detail.component.ts index 8694920de6..fd162e68a9 100644 --- a/ui/main/src/app/modules/cards/components/detail/detail.component.ts +++ b/ui/main/src/app/modules/cards/components/detail/detail.component.ts @@ -32,13 +32,12 @@ import {selectAuthenticationState} from '@ofSelectors/authentication.selectors'; import {selectGlobalStyleState} from '@ofSelectors/global-style.selectors'; import {UserContext} from '@ofModel/user-context.model'; import {map, skip, takeUntil} from 'rxjs/operators'; -import {selectLastCardLoaded} from '@ofStore/selectors/feed.selectors'; import {CardService} from '@ofServices/card.service'; import {Subject} from 'rxjs'; import {Severity} from '@ofModel/light-card.model'; import {AppService, PageType} from '@ofServices/app.service'; import {User} from '@ofModel/user.model'; -import {ClearLightCardSelection, UpdateLightCardRead} from '@ofStore/actions/light-card.actions'; +import {ClearLightCardSelection} from '@ofStore/actions/light-card.actions'; import {UserService} from '@ofServices/user.service'; import {EntitiesService} from '@ofServices/entities.service'; import {NgbModal, NgbModalOptions, NgbModalRef} from '@ng-bootstrap/ng-bootstrap'; @@ -48,6 +47,7 @@ import {MessageLevel} from '@ofModel/message.model'; import {AcknowledgeService} from '@ofServices/acknowledge.service'; import {UserPermissionsService} from '@ofServices/user-permissions-.service'; import {DisplayContext} from '@ofModel/templateGateway.model'; +import {LightCardsStoreService} from '@ofServices/lightcards-store.service'; declare const templateGateway: any; @@ -142,7 +142,8 @@ export class DetailComponent implements OnChanges, OnInit, OnDestroy, AfterViewC private modalService: NgbModal, private time: TimeService, private acknowledgeService: AcknowledgeService, - private userPermissionsService: UserPermissionsService) { + private userPermissionsService: UserPermissionsService, + private lightCardsStoreService: LightCardsStoreService) { const userWithPerimeters = this.userService.getCurrentUserWithPerimeters(); if (!!userWithPerimeters) this.user = userWithPerimeters.userData; @@ -283,7 +284,7 @@ export class DetailComponent implements OnChanges, OnInit, OnDestroy, AfterViewC } private integrateChildCardsInRealTime() { - this.store.select(selectLastCardLoaded) + this.lightCardsStoreService.getNewLightChildCards() .pipe( takeUntil(this.unsubscribe$), map(lastCardLoaded => { @@ -510,7 +511,7 @@ export class DetailComponent implements OnChanges, OnInit, OnDestroy, AfterViewC private updateLastReadCardStatusOnFeedIfNeeded() { if (this.lastCardSetToReadButNotYetOnFeed) { - this.store.dispatch(new UpdateLightCardRead({cardId: this.lastCardSetToReadButNotYetOnFeed.id, hasBeenRead: true})); + this.lightCardsStoreService.setLightCardRead(this.lastCardSetToReadButNotYetOnFeed.id,true); this.lastCardSetToReadButNotYetOnFeed = null; } } diff --git a/ui/main/src/app/modules/feed/components/card-list/filters/filters.component.ts b/ui/main/src/app/modules/feed/components/card-list/filters/filters.component.ts index 98fd404aaa..eeb0c756d2 100644 --- a/ui/main/src/app/modules/feed/components/card-list/filters/filters.component.ts +++ b/ui/main/src/app/modules/feed/components/card-list/filters/filters.component.ts @@ -13,7 +13,7 @@ import {Component, OnInit} from '@angular/core'; import { Store } from '@ngrx/store'; import { AppState } from '@ofStore/index'; import { ConfigService} from "@ofServices/config.service"; -import {LightCardsService} from '@ofServices/lightcards.service'; +import {LightCardsStoreService} from '@ofServices/lightcards-store.service'; @Component({ selector: 'of-filters', @@ -31,7 +31,7 @@ export class FiltersComponent implements OnInit { loadingInProgress = false; - constructor(private store: Store, private configService: ConfigService, private lightCardsService: LightCardsService) { } + constructor(private store: Store, private configService: ConfigService, private lightCardsStoreService: LightCardsStoreService) { } ngOnInit() { this.hideTags = this.configService.getConfigValue('settings.tags.hide',false); @@ -40,7 +40,7 @@ export class FiltersComponent implements OnInit { this.hideResponseFilter = this.configService.getConfigValue('feed.card.hideResponseFilter',false); this.hideReadSort = this.configService.getConfigValue('feed.card.hideReadSort',false); this.hideSeveritySort = this.configService.getConfigValue('feed.card.hideSeveritySort',false); - this.lightCardsService.getLoadingInProgress().subscribe( (inProgress: boolean ) => this.loadingInProgress = inProgress) + this.lightCardsStoreService.getLoadingInProgress().subscribe( (inProgress: boolean ) => this .loadingInProgress = inProgress) } diff --git a/ui/main/src/app/modules/feed/components/time-line/custom-timeline-chart/custom-timeline-chart.component.spec.ts b/ui/main/src/app/modules/feed/components/time-line/custom-timeline-chart/custom-timeline-chart.component.spec.ts index 74bae2ddf8..424bf176f7 100644 --- a/ui/main/src/app/modules/feed/components/time-line/custom-timeline-chart/custom-timeline-chart.component.spec.ts +++ b/ui/main/src/app/modules/feed/components/time-line/custom-timeline-chart/custom-timeline-chart.component.spec.ts @@ -25,7 +25,7 @@ import {appReducer, storeConfig} from '@ofStore/index'; import {RouterTestingModule} from '@angular/router/testing'; import {HttpClientTestingModule} from '@angular/common/http/testing'; import {NgbModule} from '@ng-bootstrap/ng-bootstrap'; -import {LightCardsService} from '@ofServices/lightcards.service'; +import {LightCardsFeedFilterService} from '@ofServices/lightcards-feed-filter.service'; import {LightCardsServiceMock} from '@tests/mocks/lightcards.service.mock'; describe('CustomTimelineChartComponent', () => { @@ -52,7 +52,7 @@ describe('CustomTimelineChartComponent', () => { {provide: Store, useClass: Store}, {provide: RouterStateSerializer, useClass: CustomRouterStateSerializer}, {provide: TimeService, useClass: TimeService}, - {provide: LightCardsService, useClass: LightCardsServiceMock}], + {provide: LightCardsFeedFilterService, useClass: LightCardsServiceMock}], schemas: [ NO_ERRORS_SCHEMA ] }) .compileComponents(); diff --git a/ui/main/src/app/modules/feed/components/time-line/custom-timeline-chart/custom-timeline-chart.component.ts b/ui/main/src/app/modules/feed/components/time-line/custom-timeline-chart/custom-timeline-chart.component.ts index ba1a1bf131..4062aae35f 100644 --- a/ui/main/src/app/modules/feed/components/time-line/custom-timeline-chart/custom-timeline-chart.component.ts +++ b/ui/main/src/app/modules/feed/components/time-line/custom-timeline-chart/custom-timeline-chart.component.ts @@ -40,7 +40,7 @@ import {Subject} from 'rxjs'; import {takeUntil} from 'rxjs/operators'; import {getNextTimeForRepeating} from '@ofServices/reminder/reminderUtils'; import {NgbPopover} from '@ng-bootstrap/ng-bootstrap'; -import {LightCardsService} from '@ofServices/lightcards.service'; +import {LightCardsFeedFilterService} from '@ofServices/lightcards-feed-filter.service'; @Component({ @@ -152,7 +152,7 @@ export class CustomTimelineChartComponent extends BaseChartComponent implements private store: Store, private router: Router, @Inject(PLATFORM_ID) platformId: any, - private lightCardsService: LightCardsService) { + private lightCardsFeedFilterService: LightCardsFeedFilterService) { super(chartElement, zone, cd, platformId); } @@ -317,7 +317,7 @@ export class CustomTimelineChartComponent extends BaseChartComponent implements initDataPipe(): void { - this.lightCardsService.getFilteredLightCards() + this.lightCardsFeedFilterService.getFilteredLightCards() .pipe(takeUntil(this.ngUnsubscribe$)) .subscribe(value => this.getAllCardsToDrawOnTheTimeLine(value)); } diff --git a/ui/main/src/app/modules/feed/components/time-line/init-chart/init-chart.component.spec.ts b/ui/main/src/app/modules/feed/components/time-line/init-chart/init-chart.component.spec.ts index ffc0e71e8f..7ee5b36a50 100644 --- a/ui/main/src/app/modules/feed/components/time-line/init-chart/init-chart.component.spec.ts +++ b/ui/main/src/app/modules/feed/components/time-line/init-chart/init-chart.component.spec.ts @@ -30,7 +30,7 @@ import {ConfigService} from "@ofServices/config.service"; import {HttpClient, HttpHandler} from "@angular/common/http"; import {AppService} from "@ofServices/app.service"; import {LightCardsServiceMock} from '@tests/mocks/lightcards.service.mock'; -import {LightCardsService} from '@ofServices/lightcards.service'; +import {LightCardsFeedFilterService} from '@ofServices/lightcards-feed-filter.service'; describe('InitChartComponent', () => { @@ -59,7 +59,7 @@ describe('InitChartComponent', () => { {provide: HttpHandler, useClass: HttpHandler}, {provide: AppService, useClass: AppService}, {provide: GlobalStyleService, useClass: GlobalStyleService}, - {provide: LightCardsService, useClass: LightCardsServiceMock}], + {provide: LightCardsFeedFilterService, useClass: LightCardsServiceMock}], schemas: [ NO_ERRORS_SCHEMA ], }) .compileComponents(); diff --git a/ui/main/src/app/modules/feed/feed.component.ts b/ui/main/src/app/modules/feed/feed.component.ts index 619aafa489..165ffe9767 100644 --- a/ui/main/src/app/modules/feed/feed.component.ts +++ b/ui/main/src/app/modules/feed/feed.component.ts @@ -16,7 +16,7 @@ import {LightCard} from '@ofModel/light-card.model'; import * as feedSelectors from '@ofSelectors/feed.selectors'; import {delay, map} from 'rxjs/operators'; import * as moment from 'moment'; -import {LightCardsService} from '@ofServices/lightcards.service'; +import {LightCardsFeedFilterService} from '@ofServices/lightcards-feed-filter.service'; import {ConfigService} from '@ofServices/config.service'; @Component({ @@ -32,7 +32,7 @@ export class FeedComponent implements OnInit { maxNbOfCardsToDisplay: number = 100; - constructor(private store: Store,private lightCardsService: LightCardsService,private configService: ConfigService ) { + constructor(private store: Store,private lightCardsFeedFilterService: LightCardsFeedFilterService,private configService: ConfigService ) { this.maxNbOfCardsToDisplay = this.configService.getConfigValue('feed.card.maxNbOfCardsToDisplay',100); } @@ -47,7 +47,7 @@ export class FeedComponent implements OnInit { }}); - this.lightCards$ = this.lightCardsService.getFilteredAndSortedLightCards().pipe( + this.lightCards$ = this.lightCardsFeedFilterService.getFilteredAndSortedLightCards().pipe( delay(0), // Solve error: 'Expression has changed after it was checked' --> See https://blog.angular-university.io/angular-debugging/ map(cards => { this.totalNumberOfLightsCards = cards.length; diff --git a/ui/main/src/app/modules/feedconfiguration/feedconfiguration.component.ts b/ui/main/src/app/modules/feedconfiguration/feedconfiguration.component.ts index 877450d8bc..fc9020ec01 100644 --- a/ui/main/src/app/modules/feedconfiguration/feedconfiguration.component.ts +++ b/ui/main/src/app/modules/feedconfiguration/feedconfiguration.component.ts @@ -8,8 +8,6 @@ */ import {Component, OnInit} from '@angular/core'; -import {Store} from '@ngrx/store'; -import {AppState} from '@ofStore/index'; import {UserService} from '@ofServices/user.service'; import {Process} from '@ofModel/processes.model'; import {NgbModal} from '@ng-bootstrap/ng-bootstrap'; @@ -19,7 +17,6 @@ import {ProcessesService} from '@ofServices/processes.service'; import {FormArray, FormBuilder, FormControl, FormGroup} from '@angular/forms'; import {SettingsService} from '@ofServices/settings.service'; import {CardService} from '@ofServices/card.service'; -import {EmptyLightCards} from '@ofActions/light-card.actions'; import {TranslateService} from '@ngx-translate/core'; import {Utilities} from '../../common/utilities'; import {ConfigService} from '@ofServices/config.service'; @@ -68,7 +65,6 @@ export class FeedconfigurationComponent implements OnInit { messageAfterSavingSettings: string; constructor(private formBuilder: FormBuilder, - private store: Store, private userService: UserService, private processesService: ProcessesService, private modalService: NgbModal, @@ -301,8 +297,7 @@ export class FeedconfigurationComponent implements OnInit { this.messageAfterSavingSettings = 'feedConfiguration.error.impossibleToSaveSettings'; this.displaySendResultError = true; } else { - this.cardService.resetStartOfAlreadyLoadedPeriod(); - this.store.dispatch(new EmptyLightCards()); + this.cardService.removeAllLightCardFromMemory(); } this.modalRef.close(); }, diff --git a/ui/main/src/app/modules/logging/logging.component.html b/ui/main/src/app/modules/logging/logging.component.html index 5bb9cda146..f8e0bb46c6 100644 --- a/ui/main/src/app/modules/logging/logging.component.html +++ b/ui/main/src/app/modules/logging/logging.component.html @@ -12,7 +12,8 @@
- +
diff --git a/ui/main/src/app/modules/logging/logging.component.ts b/ui/main/src/app/modules/logging/logging.component.ts index 1e1868117e..9cdc65c544 100644 --- a/ui/main/src/app/modules/logging/logging.component.ts +++ b/ui/main/src/app/modules/logging/logging.component.ts @@ -112,6 +112,7 @@ export class LoggingComponent implements OnDestroy, OnInit { ngOnInit() { this.size = this.configService.getConfigValue('logging.filters.page.size', 10); + this.tags = this.configService.getConfigValue('logging.filters.tags.list'); this.results = []; this.dateTimeFilterChange.pipe( takeUntil(this.unsubscribe$), diff --git a/ui/main/src/app/modules/monitoring/monitoring.component.ts b/ui/main/src/app/modules/monitoring/monitoring.component.ts index 4eb5962d99..6215392637 100644 --- a/ui/main/src/app/modules/monitoring/monitoring.component.ts +++ b/ui/main/src/app/modules/monitoring/monitoring.component.ts @@ -10,15 +10,16 @@ import {Component, OnDestroy, OnInit, ViewChild} from '@angular/core'; import {combineLatest, Observable, of, Subject} from 'rxjs'; import {LineOfMonitoringResult} from '@ofModel/line-of-monitoring-result.model'; -import {catchError, map, takeUntil} from 'rxjs/operators'; +import {catchError, filter, map, takeUntil} from 'rxjs/operators'; import {LightCard} from '@ofModel/light-card.model'; import * as moment from 'moment'; import {I18n} from '@ofModel/i18n.model'; import {MonitoringFiltersComponent} from './components/monitoring-filters/monitoring-filters.component'; import {Process, TypeOfStateEnum} from '@ofModel/processes.model'; import {ProcessesService} from '@ofServices/processes.service'; -import {LightCardsService} from '@ofServices/lightcards.service'; +import {LightCardsFeedFilterService} from '@ofServices/lightcards-feed-filter.service'; import {Filter} from '@ofModel/feed-filter.model'; +import {LightCardsStoreService} from '@ofServices/lightcards-store.service'; @Component({ selector: 'of-monitoring', @@ -44,7 +45,8 @@ export class MonitoringComponent implements OnInit, OnDestroy { loadingInProgress = false; constructor(private processesService: ProcessesService - , private lightCardsService: LightCardsService + , private lightCardsService: LightCardsFeedFilterService + , private lightCardsStoreService: LightCardsStoreService ) { processesService.getAllProcesses().forEach(process => { @@ -63,11 +65,14 @@ export class MonitoringComponent implements OnInit, OnDestroy { ngOnInit() { this.monitoringResult$ = combineLatest([ - this.monitoringFilters$.asObservable(), - this.lightCardsService.getLightCards() + this.monitoringFilters$.asObservable(), + this.lightCardsStoreService.getLightCards() ] ).pipe( takeUntil(this.unsubscribe$), + // the filters are set by the monitoring filter and by the time line + // so it generates two events , we need to wait until every filter is set + filter( results => this.areFiltersCorrectlySet(results[0])), map(results => { const cards = this.lightCardsService.filterLightCards(results[1], results[0]); if (!!cards && cards.length <= 0) { @@ -83,10 +88,16 @@ export class MonitoringComponent implements OnInit, OnDestroy { catchError(err => of([])) ); this.monitoringResult$.subscribe(lines => this.result = lines); - this.lightCardsService.getLoadingInProgress().subscribe( (inProgress: boolean ) => this.loadingInProgress = inProgress) - + this.lightCardsStoreService.getLoadingInProgress().pipe( + takeUntil(this.unsubscribe$)).subscribe( (inProgress: boolean ) => this.loadingInProgress = inProgress); } + private areFiltersCorrectlySet(filters:Array): boolean + { + let correctlySet:boolean = true; + filters.forEach( filter => {if (!filter) correctlySet =false;}); + return correctlySet; + } ngOnDestroy() { this.unsubscribe$.next(); diff --git a/ui/main/src/app/modules/settings/components/settings/checkbox-setting/checkbox-setting.component.html b/ui/main/src/app/modules/settings/components/settings/checkbox-setting/checkbox-setting.component.html index e480c4e7c8..ef0db20ffd 100644 --- a/ui/main/src/app/modules/settings/components/settings/checkbox-setting/checkbox-setting.component.html +++ b/ui/main/src/app/modules/settings/components/settings/checkbox-setting/checkbox-setting.component.html @@ -7,7 +7,7 @@ -
+