-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add config for workflow actions (#805)
* Add actions config * Add workflow actions config * Add workflow actions loading * Add unit tests and change getIsEnabled to getIsRunnable * Fix fixture * Remove default config * fix test
- Loading branch information
1 parent
6befc76
commit 5f0a7f3
Showing
14 changed files
with
257 additions
and
16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { | ||
type WorkflowActionsEnabledConfig, | ||
type WorkflowActionsEnabledResolverParams, | ||
} from './workflow-actions-enabled.types'; | ||
|
||
/** | ||
* If you have authentication enabled for users, override this resolver | ||
* to control whether users can access workflow actions in the UI | ||
*/ | ||
export default async function workflowActionsEnabled( | ||
_: WorkflowActionsEnabledResolverParams | ||
): Promise<WorkflowActionsEnabledConfig> { | ||
return { | ||
terminate: true, | ||
cancel: true, | ||
}; | ||
} |
8 changes: 8 additions & 0 deletions
8
src/config/dynamic/resolvers/workflow-actions-enabled.types.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,8 @@ | ||
import { type WorkflowActionID } from '@/views/workflow-actions/workflow-actions.types'; | ||
|
||
export type WorkflowActionsEnabledResolverParams = { | ||
domain: string; | ||
cluster: string; | ||
}; | ||
|
||
export type WorkflowActionsEnabledConfig = Record<WorkflowActionID, boolean>; |
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
2 changes: 2 additions & 0 deletions
2
src/views/workflow-actions/workflow-actions-menu/workflow-actions-menu.types.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 |
---|---|---|
@@ -1,8 +1,10 @@ | ||
import { type WorkflowActionsEnabledConfig } from '@/config/dynamic/resolvers/workflow-actions-enabled.types'; | ||
import { type DescribeWorkflowResponse } from '@/route-handlers/describe-workflow/describe-workflow.types'; | ||
|
||
import { type WorkflowAction } from '../workflow-actions.types'; | ||
|
||
export type Props = { | ||
workflow: DescribeWorkflowResponse; | ||
actionsEnabledConfig?: WorkflowActionsEnabledConfig; | ||
onActionSelect: (action: WorkflowAction<any>) => void; | ||
}; |
Oops, something went wrong.