-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[backend] feat: added new bulk update, delete and test functions for …
…injects [backend] deprecate: marked existing bulk functions as deprecated [frontend] feat: plugged the new bulk function in the injects tables for scenarios and simulations [frontend] feat: select all now select all elements from all the pages in data tables [frontend] feat: select all + any filter or text search set means that only the filterred element will count as selected
- Loading branch information
1 parent
673123e
commit 9bab530
Showing
38 changed files
with
1,488 additions
and
484 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
openbas-api/src/main/java/io/openbas/rest/inject/form/InjectBulkProcessingInput.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package io.openbas.rest.inject.form; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import io.openbas.utils.pagination.SearchPaginationInput; | ||
import java.util.List; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
/** Represent the input of a bulk processing (delete and tests) calls for injects */ | ||
@Setter | ||
@Getter | ||
public class InjectBulkProcessingInput { | ||
|
||
/** | ||
* The search input, used to select the injects to update. Must be provided if injectIDsToDelete | ||
* is not provided | ||
*/ | ||
@JsonProperty("search_pagination_input") | ||
private SearchPaginationInput searchPaginationInput; | ||
|
||
/** The list of injects to process. Must be provided if searchPaginationInput is not provided */ | ||
@JsonProperty("inject_ids_to_process") | ||
private List<String> injectIDsToProcess; | ||
|
||
/** The list of injects to ignore from the search input */ | ||
@JsonProperty("inject_ids_to_ignore") | ||
private List<String> injectIDsToIgnore; | ||
|
||
/** The simulation or scenario ID to which the injects belong. */ | ||
@JsonProperty("exercise_or_scenario_id") | ||
private String exerciseOrScenarioId; | ||
} |
16 changes: 16 additions & 0 deletions
16
openbas-api/src/main/java/io/openbas/rest/inject/form/InjectBulkUpdateInputs.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package io.openbas.rest.inject.form; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import java.util.List; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
/** Represent the input of a bulk update call for injects */ | ||
@Setter | ||
@Getter | ||
public class InjectBulkUpdateInputs extends InjectBulkProcessingInput { | ||
|
||
/** The operations to perform to update injects */ | ||
@JsonProperty("update_operations") | ||
private List<InjectBulkUpdateOperation> updateOperations; | ||
} |
24 changes: 24 additions & 0 deletions
24
openbas-api/src/main/java/io/openbas/rest/inject/form/InjectBulkUpdateOperation.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package io.openbas.rest.inject.form; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import java.util.List; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
/** Represent an operation to perform on a list of injects to update them */ | ||
@Setter | ||
@Getter | ||
public class InjectBulkUpdateOperation { | ||
|
||
/** The operations to perform to update injects */ | ||
@JsonProperty("operation") | ||
private InjectBulkUpdateSupportedOperations operation; | ||
|
||
/** The field to update in the injects */ | ||
@JsonProperty("field") | ||
private InjectBulkUpdateSupportedFields field; | ||
|
||
/** The values involved in the update operation for given field */ | ||
@JsonProperty("values") | ||
private List<String> values; | ||
} |
21 changes: 21 additions & 0 deletions
21
openbas-api/src/main/java/io/openbas/rest/inject/form/InjectBulkUpdateSupportedFields.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package io.openbas.rest.inject.form; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import lombok.Getter; | ||
|
||
/** Represent the supported fields that can be bulk updated in injects */ | ||
@Getter | ||
public enum InjectBulkUpdateSupportedFields { | ||
@JsonProperty("assets") | ||
ASSETS("assets"), | ||
@JsonProperty("asset_groups") | ||
ASSET_GROUPS("assetGroups"), | ||
@JsonProperty("teams") | ||
TEAMS("teams"); | ||
|
||
private final String value; | ||
|
||
InjectBulkUpdateSupportedFields(final String value) { | ||
this.value = value; | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
...as-api/src/main/java/io/openbas/rest/inject/form/InjectBulkUpdateSupportedOperations.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package io.openbas.rest.inject.form; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import lombok.Getter; | ||
|
||
/** Represent the supported operations that can be performed in a bulk update of injects */ | ||
@Getter | ||
public enum InjectBulkUpdateSupportedOperations { | ||
@JsonProperty("add") | ||
ADD("ADD"), | ||
@JsonProperty("remove") | ||
REMOVE("REMOVE"), | ||
@JsonProperty("replace") | ||
REPLACE("REPLACE"); | ||
|
||
private final String value; | ||
|
||
InjectBulkUpdateSupportedOperations(final String value) { | ||
this.value = value; | ||
} | ||
} |
Oops, something went wrong.