-
Notifications
You must be signed in to change notification settings - Fork 693
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Added UI changes for enable and disable cron feature (#4286)
* chore: Added UI changes for enable and disable cron feature Signed-off-by: Amit Kumar Das <[email protected]> * added util function to validate cron and minor fixes Signed-off-by: Amit Kumar Das <[email protected]> * minor fix Signed-off-by: Amit Kumar Das <[email protected]> * fixed import order Signed-off-by: Amit Kumar Das <[email protected]> * fixed linting issues Signed-off-by: Amit Kumar Das <[email protected]> * fixed linting issues Signed-off-by: Amit Kumar Das <[email protected]> --------- Signed-off-by: Amit Kumar Das <[email protected]> Co-authored-by: Saranya Jena <[email protected]>
- Loading branch information
1 parent
2c5557a
commit 0390cdf
Showing
11 changed files
with
202 additions
and
10 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
30 changes: 30 additions & 0 deletions
30
chaoscenter/web/src/api/core/experiments/updateCronExperimentState.ts
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,30 @@ | ||
import { gql, useMutation } from '@apollo/client'; | ||
import type { GqlAPIMutationRequest, GqlAPIMutationResponse } from '@api/types'; | ||
|
||
export interface UpdateCronExperimentStateRequest { | ||
disable: boolean; | ||
projectID: string; | ||
experimentID?: string; | ||
} | ||
|
||
export interface UpdateCronExperimentStateResponse { | ||
updateCronExperimentState: boolean; | ||
} | ||
|
||
export function useUpdateCronExperimentStateMutation( | ||
options?: GqlAPIMutationRequest<UpdateCronExperimentStateResponse, UpdateCronExperimentStateRequest> | ||
): GqlAPIMutationResponse<UpdateCronExperimentStateResponse, UpdateCronExperimentStateRequest> { | ||
const [updateCronExperimentStateMutation, result] = useMutation< | ||
UpdateCronExperimentStateResponse, | ||
UpdateCronExperimentStateRequest | ||
>( | ||
gql` | ||
mutation updateCronExperimentState($experimentID: String!, $disable: Boolean!, $projectID: ID!) { | ||
updateCronExperimentState(experimentID: $experimentID, disable: $disable, projectID: $projectID) | ||
} | ||
`, | ||
options | ||
); | ||
|
||
return [updateCronExperimentStateMutation, result]; | ||
} |
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
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
Oops, something went wrong.