-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modification can now be disabled #528
Conversation
…r now Signed-off-by: LE SAULNIER Kevin <[email protected]>
Signed-off-by: LE SAULNIER Kevin <[email protected]>
Signed-off-by: LE SAULNIER Kevin <[email protected]>
Signed-off-by: LE SAULNIER Kevin <[email protected]>
Signed-off-by: LE SAULNIER Kevin <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some first comments, I will further test with the study-server PR
src/main/java/org/gridsuite/modification/server/NetworkModificationController.java
Outdated
Show resolved
Hide resolved
src/main/java/org/gridsuite/modification/server/NetworkModificationController.java
Outdated
Show resolved
Hide resolved
src/main/java/org/gridsuite/modification/server/NetworkModificationController.java
Outdated
Show resolved
Hide resolved
...n/server/entities/equipment/modification/attribute/EquipmentAttributeModificationEntity.java
Outdated
Show resolved
Hide resolved
src/test/java/org/gridsuite/modification/server/ModificationControllerTest.java
Outdated
Show resolved
Hide resolved
...st/java/org/gridsuite/modification/server/modifications/LineCreationInMixedTypologyTest.java
Outdated
Show resolved
Hide resolved
src/main/java/org/gridsuite/modification/server/dto/ModificationInfos.java
Outdated
Show resolved
Hide resolved
src/main/java/org/gridsuite/modification/server/repositories/NetworkModificationRepository.java
Outdated
Show resolved
Hide resolved
Signed-off-by: LE SAULNIER Kevin <[email protected]>
This reverts commit 150d603.
Signed-off-by: LE SAULNIER Kevin <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
set active status for all modifications, example ModificationCreation.java
@@ -242,6 +242,16 @@ public ResponseEntity<Void> stashNetworkModifications( | |||
return ResponseEntity.ok().build(); | |||
} | |||
|
|||
@PutMapping(value = "/network-modifications", produces = MediaType.APPLICATION_JSON_VALUE, params = "active") | |||
@Operation(summary = "enable or disable network modifications") | |||
@ApiResponse(responseCode = "200", description = "The network modifications were updated successfully") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To clarify that only the activation status was updated and not the modification itself, you could rephrase the description:
Suggestion:
"The activation status related to the network modification was successfully updated"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
public ResponseEntity<Void> updateNetworkModificationsActivation( | ||
@Parameter(description = "Network modification UUIDs") @RequestParam("uuids") List<UUID> networkModificationUuids, | ||
@Parameter(description = "enable or disable network modifications") @RequestParam(name = "active") Boolean active) { | ||
networkModificationService.updateNetworkModificationActivation(networkModificationUuids, active); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updateNetworkModificationActivationStatus?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
@@ -155,6 +155,32 @@ public void testCreate() throws Exception { | |||
testCreationModificationMessage(createdModificationWithOnlyMetadata); | |||
} | |||
|
|||
@Test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in my opinion :
When creating a modification, it is set to active by default, so there’s no need to explicitly approve the opposite.
Signed-off-by: LE SAULNIER Kevin <[email protected]>
…te/network-modification-server into desactivate_modification
public ResponseEntity<Void> updateNetworkModificationsActivationStatus( | ||
@Parameter(description = "Network modification UUIDs") @RequestParam("uuids") List<UUID> networkModificationUuids, | ||
@Parameter(description = "enable or disable network modifications") @RequestParam(name = "active") Boolean active) { | ||
networkModificationService.updateNetworkModificationActivation(networkModificationUuids, active); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
activated
?
@@ -100,12 +100,17 @@ public class ModificationInfos { | |||
@Schema(description = "Message values") | |||
private String messageValues; | |||
|
|||
@Schema(description = "Modification enabled") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
activated
?
@@ -242,6 +242,16 @@ public ResponseEntity<Void> stashNetworkModifications( | |||
return ResponseEntity.ok().build(); | |||
} | |||
|
|||
@PutMapping(value = "/network-modifications", produces = MediaType.APPLICATION_JSON_VALUE, params = "active") | |||
@Operation(summary = "enable or disable network modifications") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change network modification activation status ?
@ApiResponse(responseCode = "200", description = "The activation status related to the network modification was successfully updated") | ||
public ResponseEntity<Void> updateNetworkModificationsActivationStatus( | ||
@Parameter(description = "Network modification UUIDs") @RequestParam("uuids") List<UUID> networkModificationUuids, | ||
@Parameter(description = "enable or disable network modifications") @RequestParam(name = "active") Boolean active) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Network modification activation status ?
@@ -242,6 +242,16 @@ public ResponseEntity<Void> stashNetworkModifications( | |||
return ResponseEntity.ok().build(); | |||
} | |||
|
|||
@PutMapping(value = "/network-modifications", produces = MediaType.APPLICATION_JSON_VALUE, params = "active") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
activated
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed all renamining only for comments, changing all variable names would impact changesets, other services and frontend
after discussion, we've decided not to change them
.findById(modificationUuid) | ||
.orElseThrow(() -> new NetworkModificationException(MODIFICATION_NOT_FOUND, String.format(MODIFICATION_NOT_FOUND_MESSAGE, modificationUuid))); | ||
modificationEntity.setActive(active); | ||
this.modificationRepository.save(modificationEntity); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove save
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
Change requested just for only |
Signed-off-by: LE SAULNIER Kevin <[email protected]>
Signed-off-by: LE SAULNIER Kevin <[email protected]>
Signed-off-by: LE SAULNIER Kevin <[email protected]>
|
No description provided.