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 ffdf011
Show file tree
Hide file tree
Showing 29 changed files with 224 additions and 505 deletions.
9 changes: 9 additions & 0 deletions config/docker/users.yml
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
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.

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
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
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"]
}
]
}
]
}
}

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
Expand Up @@ -97,15 +97,15 @@ public void saveUserConfiguration(UserConfiguration userConfiguration) {
}

public List<DeviceConfiguration> getDeviceConfigurations() {
return deviceConfigurationRepository.findAll().stream().collect(Collectors.toList());
return deviceConfigurationRepository.findAll().stream().toList();
}

public List<SignalMapping> getSignalMappings() {
return signalMappingRepository.findAll().stream().collect(Collectors.toList());
return signalMappingRepository.findAll().stream().toList();
}

public List<UserConfiguration> getUserConfigurations() {
return userConfigurationRepository.findAll().stream().collect(Collectors.toList());
return userConfigurationRepository.findAll().stream().toList();
}

public List<ResolvedConfiguration> getResolvedConfigurationList(String opFabSignalKey, String userLogin) throws ExternalDeviceConfigurationException, UnknownExternalDeviceException {
Expand Down
Expand Up @@ -90,7 +90,7 @@ public void setLabels(List<String> labels){
@Override
public List<String> getParents(){
if (parents == null) return Collections.emptyList();
return parents.stream().collect(Collectors.toList());
return parents.stream().toList();
}

@Override
Expand All @@ -105,7 +105,7 @@ public void setParents(List<String> parents){
@Override
public List<RolesEnum> getRoles(){
if (roles == null) return Collections.emptyList();
return roles.stream().collect(Collectors.toList());
return roles.stream().toList();
}

@Override
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
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

0 comments on commit ffdf011

Please sign in to comment.