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 Nov 30, 2023
1 parent b9813c8 commit 7d5d4b3
Show file tree
Hide file tree
Showing 15 changed files with 69 additions and 169 deletions.
8 changes: 8 additions & 0 deletions config/docker/users.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,16 @@ operatorfabric.users.default:
- id: ENTITY_FR
name: French Control Centers
description: French Control Centers
roles: ["REALTIME_SCREEN_GROUP"]
entityAllowedToSendCard: false
- id: CENTRAL_SUPERVISION_CENTERS
name: Central Supervision Centers
description: Central Supervision Centers
roles: ["REALTIME_SCREEN_GROUP"]
- id: IT_SUPERVISOR_ENTITY
name: IT SUPERVISION CENTER
description: IT SUPERVISION CENTER
parents : ["CENTRAL_SUPERVISION_CENTERS"]
- id: ENTITY1_IT
name: Control Center IT North
description: Control Center IT North
Expand All @@ -129,6 +135,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 +148,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 @@ -15,8 +15,6 @@
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
* EntitiesGroups Model, documented at {@link EntitiesGroups}
*
Expand All @@ -28,6 +26,5 @@
@AllArgsConstructor
@Builder
public class EntitiesGroupsData implements EntitiesGroups {
private String name;
private List<String> entities;
private String id;
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.extern.slf4j.Slf4j;

import java.util.List;

Expand All @@ -28,7 +27,6 @@
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Slf4j
public class RealTimeScreenData implements RealTimeScreen {

private String screenName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Slf4j
public class ScreenColumnData implements ScreenColumn {
private List<EntitiesGroups> entitiesGroups;
}
6 changes: 1 addition & 5 deletions services/businessconfig/src/main/modeling/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -771,12 +771,8 @@ definitions:
$ref: '#/definitions/EntitiesGroups'
EntitiesGroups:
properties:
name:
id:
type: string
entities:
type: array
items:
type: string
UserCard:
properties:
template:
Expand Down
26 changes: 4 additions & 22 deletions services/businessconfig/src/test/data/realtimescreens.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,38 +6,20 @@
{
"entitiesGroups": [
{
"name": "French Control Centers",
"entities": [
"ENTITY1_FR",
"ENTITY2_FR",
"ENTITY3_FR",
"ENTITY4_FR"
]
"id": "ENTITY_FR"
},
{
"name": "Italian Control Centers",
"entities": [
"ENTITY1_IT",
"ENTITY2_IT",
"ENTITY3_IT"
]
"id": "ENTITY_IT"
},
{
"name": "Dutch Control Centers",
"entities": [
"ENTITY1_NL",
"ENTITY2_NL"
]
"id": "ENTITY_NL"
}
]
},
{
"entitiesGroups": [
{
"name": "Central Supervision Centers",
"entities": [
"IT_SUPERVISOR_ENTITY"
]
"id": "CENTRAL_SUPERVISION_CENTERS"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,7 @@ void createRealTimeScreens() throws Exception {
.andExpect(jsonPath("$.realTimeScreens[0].screenName", is("All Control Centers")))
.andExpect(jsonPath("$.realTimeScreens[0].screenColumns", hasSize(2)))
.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)));
.andExpect(jsonPath("$.realTimeScreens[0].screenColumns[0].entitiesGroups[0].id", is("ENTITY_FR")));
}

@Nested
Expand Down
27 changes: 4 additions & 23 deletions src/test/api/karate/businessconfig/resources/realtimescreens1.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,43 +2,24 @@
"realTimeScreens": [
{
"screenName": "All Control Centers",
"onlyDisplayUsersInGroups": ["group1"],
"screenColumns": [
{
"entitiesGroups": [
{
"name": "French Control Centers",
"entities": [
"ENTITY1_FR",
"ENTITY2_FR",
"ENTITY3_FR",
"ENTITY4_FR"
]
"id": "ENTITY_FR"
},
{
"name": "Italian Control Centers",
"entities": [
"ENTITY1_IT",
"ENTITY2_IT",
"ENTITY3_IT"
]
"id": "ENTITY_IT"
},
{
"name": "Dutch Control Centers",
"entities": [
"ENTITY1_NL",
"ENTITY2_NL"
]
"id": "ENTITY_NL"
}
]
},
{
"entitiesGroups": [
{
"name": "Central Supervision Centers",
"entities": [
"IT_SUPERVISOR_ENTITY"
]
"id": "CENTRAL_SUPERVISION_CENTERS"
}
]
}
Expand Down
27 changes: 5 additions & 22 deletions src/test/api/karate/businessconfig/resources/realtimescreens2.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,41 +3,24 @@
{
"screenName": "All Control Centers",
"screenColumns": [

{
"entitiesGroups": [
{
"name": "Central Supervision Centers",
"entities": [
"IT_SUPERVISOR_ENTITY"
]
"id": "CENTRAL_SUPERVISION_CENTERS"
}
]
},
{
"entitiesGroups": [
{
"name": "French Control Centers",
"entities": [
"ENTITY1_FR",
"ENTITY2_FR",
"ENTITY3_FR",
"ENTITY4_FR"
]
"id": "ENTITY_FR"
},
{
"name": "Italian Control Centers",
"entities": [
"ENTITY1_IT",
"ENTITY2_IT",
"ENTITY3_IT"
]
"id": "ENTITY_IT"
},
{
"name": "Dutch Control Centers",
"entities": [
"ENTITY1_NL",
"ENTITY2_NL"
]
"id": "ENTITY_NL"
}
]
}
Expand Down
62 changes: 10 additions & 52 deletions src/test/resources/realTimeScreens/realTimeScreens.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,38 +6,20 @@
{
"entitiesGroups": [
{
"name": "French Control Centers",
"entities": [
"ENTITY1_FR",
"ENTITY2_FR",
"ENTITY3_FR",
"ENTITY4_FR"
]
"id": "ENTITY_FR"
},
{
"name": "Italian Control Centers",
"entities": [
"ENTITY1_IT",
"ENTITY2_IT",
"ENTITY3_IT"
]
"id": "ENTITY_IT"
},
{
"name": "Dutch Control Centers",
"entities": [
"ENTITY1_NL",
"ENTITY2_NL"
]
"id": "ENTITY_NL"
}
]
},
{
"entitiesGroups": [
{
"name": "Central Supervision Centers",
"entities": [
"IT_SUPERVISOR_ENTITY"
]
"id": "CENTRAL_SUPERVISION_CENTERS"
}
]
}
Expand All @@ -49,23 +31,14 @@
{
"entitiesGroups": [
{
"name": "French Control Centers",
"entities": [
"ENTITY1_FR",
"ENTITY2_FR",
"ENTITY3_FR",
"ENTITY4_FR"
]
"id": "ENTITY_FR"
}
]
},
{
"entitiesGroups": [
{
"name": "Central Supervision Centers",
"entities": [
"IT_SUPERVISOR_ENTITY"
]
"id": "CENTRAL_SUPERVISION_CENTERS"
}
]
}
Expand All @@ -77,22 +50,14 @@
{
"entitiesGroups": [
{
"name": "Italian Control Centers",
"entities": [
"ENTITY1_IT",
"ENTITY2_IT",
"ENTITY3_IT"
]
"id": "ENTITY_IT"
}
]
},
{
"entitiesGroups": [
{
"name": "Central Supervision Centers",
"entities": [
"IT_SUPERVISOR_ENTITY"
]
"id": "CENTRAL_SUPERVISION_CENTERS"
}
]
}
Expand All @@ -104,21 +69,14 @@
{
"entitiesGroups": [
{
"name": "Dutch Control Centers",
"entities": [
"ENTITY1_NL",
"ENTITY2_NL"
]
"id": "ENTITY_NL"
}
]
},
{
"entitiesGroups": [
{
"name": "Central Supervision Centers",
"entities": [
"IT_SUPERVISOR_ENTITY"
]
"id": "CENTRAL_SUPERVISION_CENTERS"
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion ui/main/src/app/business/model/real-time-screens.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ export class ScreenColumn {
}

export class EntitiesGroups {
constructor(readonly name: string, readonly entities: Array<string>) {}
constructor(readonly id: string) {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export class RealtimePageScreen {
}

export class RealtimePageScreenColumn {
entitiesGroups: RealtimePageEntityGroup[] = [];
entityPages: RealtimePageEntityGroup[] = [];
}

export class RealtimePageEntityGroup {
Expand Down

0 comments on commit 7d5d4b3

Please sign in to comment.