Skip to content

Commit

Permalink
Realtime screen uses entity role #5435
Browse files Browse the repository at this point in the history
Signed-off-by: ClementBouvierN <clement.bouvierneveu@rte-france.com>
  • Loading branch information
ClementBouvierN committed Dec 14, 2023
1 parent d0d6e62 commit b8fb658
Show file tree
Hide file tree
Showing 26 changed files with 218 additions and 499 deletions.
9 changes: 9 additions & 0 deletions config/docker/users.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,17 @@ operatorfabric.users.default:
- id: ENTITY_FR
name: French Control Centers
description: French Control Centers
roles: ["REALTIME_SCREEN_GROUP"]
entityAllowedToSendCard: false
- id: EUROPEAN_SUPERVISION_CENTERS
name: European Supervision Centers
description: European Supervision Centers
roles: ["REALTIME_SCREEN_GROUP"]
entityAllowedToSendCard: false
- id: IT_SUPERVISOR_ENTITY
name: IT SUPERVISION CENTER
description: IT SUPERVISION CENTER
parents : ["EUROPEAN_SUPERVISION_CENTERS"]
- id: ENTITY1_IT
name: Control Center IT North
description: Control Center IT North
Expand All @@ -129,6 +136,7 @@ operatorfabric.users.default:
name: Italian Control Centers
description: Italian Control Centers
entityAllowedToSendCard: false
roles: ["REALTIME_SCREEN_GROUP"]
- id: ENTITY1_NL
name: Control Center NL North
description: Control Center NL North
Expand All @@ -141,6 +149,7 @@ operatorfabric.users.default:
name: Dutch Control Centers
description: Dutch Control Centers
entityAllowedToSendCard: false
roles: ["REALTIME_SCREEN_GROUP"]
- id: ENTITY1_EU
name: North Europe Control Center
description: North Europe Control Center
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,5 @@ public BusinessconfigModule() {
addAbstractTypeMapping(RealTimeScreens.class, RealTimeScreensData.class);
addAbstractTypeMapping(RealTimeScreen.class, RealTimeScreenData.class);
addAbstractTypeMapping(ScreenColumn.class, ScreenColumnData.class);
addAbstractTypeMapping(EntitiesGroups.class, EntitiesGroupsData.class);
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@
@AllArgsConstructor
@Builder
public class ScreenColumnData implements ScreenColumn {
private List<EntitiesGroups> entitiesGroups;
private List<String> entitiesGroups;
}
8 changes: 0 additions & 8 deletions services/businessconfig/src/main/modeling/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -766,14 +766,6 @@ definitions:
ScreenColumn:
properties:
entitiesGroups:
type: array
items:
$ref: '#/definitions/EntitiesGroups'
EntitiesGroups:
properties:
name:
type: string
entities:
type: array
items:
type: string
Expand Down
39 changes: 4 additions & 35 deletions services/businessconfig/src/test/data/realtimescreens.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,44 +4,13 @@
"screenName": "All Control Centers",
"screenColumns": [
{
"entitiesGroups": [
{
"name": "French Control Centers",
"entities": [
"ENTITY1_FR",
"ENTITY2_FR",
"ENTITY3_FR",
"ENTITY4_FR"
]
},
{
"name": "Italian Control Centers",
"entities": [
"ENTITY1_IT",
"ENTITY2_IT",
"ENTITY3_IT"
]
},
{
"name": "Dutch Control Centers",
"entities": [
"ENTITY1_NL",
"ENTITY2_NL"
]
}
]
"entitiesGroups": ["ENTITY_FR","ENTITY_IT","ENTITY_NL"]
},
{
"entitiesGroups": [
{
"name": "European Supervision Centers",
"entities": [
"IT_SUPERVISOR_ENTITY"
]
}
]
"entitiesGroups": ["EUROPEAN_SUPERVISION_CENTERS"]
}
]
}
]
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -288,11 +288,8 @@ void createRealTimeScreens() throws Exception {
.andExpect(jsonPath("$.realTimeScreens[0].screenColumns[0].entitiesGroups",
hasSize(3)))
.andExpect(jsonPath(
"$.realTimeScreens[0].screenColumns[0].entitiesGroups[0].name",
is("French Control Centers")))
.andExpect(jsonPath(
"$.realTimeScreens[0].screenColumns[0].entitiesGroups[0].entities",
hasSize(4)));
"$.realTimeScreens[0].screenColumns[0].entitiesGroups[0]",
is("ENTITY_FR")));
}

@Nested
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
100 changes: 10 additions & 90 deletions src/docs/asciidoc/reference_doc/users_management.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -124,135 +124,55 @@ Here is an example of the configuration file :
"screenName": "All Control Centers",
"screenColumns": [
{
"entitiesGroups": [
{
"name": "French Control Centers",
"entities": [
"ENTITY1_FR",
"ENTITY2_FR",
"ENTITY3_FR",
"ENTITY4_FR"
]
},
{
"name": "Italian Control Centers",
"entities": [
"ENTITY1_IT",
"ENTITY2_IT",
"ENTITY3_IT"
]
},
{
"name": "Dutch Control Centers",
"entities": [
"ENTITY1_NL",
"ENTITY2_NL"
]
}
]
"entitiesGroups": ["ENTITY_FR","ENTITY_IT","ENTITY_NL"]
},
{
"entitiesGroups": [
{
"name": "European Supervision Centers",
"entities": [
"IT_SUPERVISOR_ENTITY"
]
}
]
"entitiesGroups": ["EUROPEAN_SUPERVISION_CENTERS"]
}
]
},
{
"screenName": "French Control Centers",
"screenColumns": [
{
"entitiesGroups": [
{
"name": "French Control Centers",
"entities": [
"ENTITY1_FR",
"ENTITY2_FR",
"ENTITY3_FR",
"ENTITY4_FR"
]
}
]
"entitiesGroups": ["ENTITY_FR"]
},
{
"entitiesGroups": [
{
"name": "European Supervision Centers",
"entities": [
"IT_SUPERVISOR_ENTITY"
]
}
]
"entitiesGroups": ["EUROPEAN_SUPERVISION_CENTERS"]
}
]
},
{
"screenName": "Italian Control Centers",
"screenColumns": [
{
"entitiesGroups": [
{
"name": "Italian Control Centers",
"entities": [
"ENTITY1_IT",
"ENTITY2_IT",
"ENTITY3_IT"
]
}
]
"entitiesGroups": ["ENTITY_IT"]
},
{
"entitiesGroups": [
{
"name": "European Supervision Centers",
"entities": [
"IT_SUPERVISOR_ENTITY"
]
}
]
"entitiesGroups": ["EUROPEAN_SUPERVISION_CENTERS"]
}
]
},
{
"screenName": "Dutch Control Centers",
"screenColumns": [
{
"entitiesGroups": [
{
"name": "Dutch Control Centers",
"entities": [
"ENTITY1_NL",
"ENTITY2_NL"
]
}
]
"entitiesGroups": ["ENTITY_NL"]
},
{
"entitiesGroups": [
{
"name": "European Supervision Centers",
"entities": [
"IT_SUPERVISOR_ENTITY"
]
}
]
"entitiesGroups": ["EUROPEAN_SUPERVISION_CENTERS"]
}
]
}
]
}
----

With this configuration file, 4 different screens will be available : "All Control Centers", "French Control Centers", "Italian Control Centers" and "Dutch Control Centers".
With this configuration file, 4 different screens will be available : "All Control Centers", "French Control Centers", "Italian Control Centers" and "Dutch Control Centers". To associate the entities under each entity group, it is required to label the entity group as a parent of the entities.

For example, in the UI, "All Control Centers" will look like :

image::realtimescreens_screenshot.png[Real Time Screens screenshot,align="center"]
image::realtimescreen_screenshot.png[Real Time Screens screenshot,align="center"]

== Activity area

Expand Down
58 changes: 57 additions & 1 deletion src/docs/asciidoc/resources/migration_guide_to_4.2.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,60 @@
The parameter `displayConnectionCirclesInPreview` has been deleted. Now, in the usercard preview, users will see
which recipients entities are connected or not via badges : a blue badge if connected and a gray one if not.
This feature is provided for all users.
So you have to remove this parameter from the configuration file `web-ui.json`.
So you have to remove this parameter from the configuration file `web-ui.json`.

== Configuration files of the realtime users screen

Previously, to configure this screen, the json file had to fit the following structure :

[source,json]
----
{
"realTimeScreens": [
{
"screenName": <Name of the screen>,
"screenColumns": [
{
"entitiesGroups": [
{
"name": <Name of a group of entities>,
"entities": [
<entity1 id>,
<entity2 id>
]
},
{
"name": <Name of another group of entities>,
"entities": [
<entity3 id>,
<entity4 id>
]
}
]
}
]
}
]
}
----

Now entities shouldn't be grouped in the configuration file anymore. Instead entities are grouped by a shared parent entity. The configuration file needs to be changed to the following structure:

[source,json]
----
{
"realTimeScreens": [
{
"screenName": <Name of the screen>,
"screenColumns": [
{
"entitiesGroups": ["<parent entity 1 id>","<parent entity 2 id>"]
}
]
}
]
}
----


With this parent entity 1 and parent entity 2 need to be declared and the name of the parent entities will be the name of the groups.

0 comments on commit b8fb658

Please sign in to comment.