Skip to content

Commit d2ac10c

Browse files
committed
feat: add types related to mandatory plugin consequences
1 parent c6eb6c0 commit d2ac10c

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

src/Common/Types.ts

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import { Placement } from 'tippy.js'
1919
import { UserGroupDTO } from '@Pages/GlobalConfigurations'
2020
import { ImageComment, ReleaseTag } from './ImageTags.Types'
2121
import { ACTION_STATE, DEPLOYMENT_WINDOW_TYPE, DockerConfigOverrideType, SortingOrder, TaskErrorObj } from '.'
22-
import { RegistryType, RuntimeParamsListItemType, Severity } from '../Shared'
22+
import { MandatoryPluginNodeType, RegistryType, RuntimeParamsListItemType, Severity } from '../Shared'
2323

2424
/**
2525
* Generic response type object with support for overriding the result type
@@ -552,7 +552,7 @@ export interface DownstreamNodesEnvironmentsType {
552552
environmentName: string
553553
}
554554

555-
export interface CommonNodeAttr {
555+
export interface CommonNodeAttr extends Pick<MandatoryPluginNodeType, 'isTriggerBlocked' | 'pluginBlockState'> {
556556
connectingCiPipelineId?: number
557557
parents: string | number[] | string[]
558558
x: number
@@ -602,15 +602,10 @@ export interface CommonNodeAttr {
602602
approvalUsers?: string[]
603603
userApprovalConfig?: UserApprovalConfigType
604604
requestedUserId?: number
605-
showPluginWarning?: boolean
605+
showPluginWarning: boolean
606606
helmPackageName?: string
607607
isVirtualEnvironment?: boolean
608608
deploymentAppType?: DeploymentAppTypes
609-
isCITriggerBlocked?: boolean
610-
ciBlockState?: {
611-
action: any
612-
metadataField: string
613-
}
614609
appReleaseTagNames?: string[]
615610
tagsEditable?: boolean
616611
isGitOpsRepoNotConfigured?: boolean
@@ -791,7 +786,7 @@ export interface CDStageConfigMapSecretNames {
791786
secrets: any[]
792787
}
793788

794-
export interface PrePostDeployStageType {
789+
export interface PrePostDeployStageType extends MandatoryPluginNodeType {
795790
isValid: boolean
796791
steps: TaskErrorObj[]
797792
triggerType: string
@@ -829,6 +824,8 @@ export interface CdPipeline {
829824
preDeployStage?: PrePostDeployStageType
830825
postDeployStage?: PrePostDeployStageType
831826
isProdEnv?: boolean
827+
isGitOpsRepoNotConfigured?: boolean
828+
isDeploymentBlocked?: boolean
832829
}
833830

834831
export interface ExternalCiConfig {

src/Shared/Components/Plugin/types.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616

1717
import { MutableRefObject } from 'react'
18-
import { VariableType } from '../../../Common'
18+
import { ConsequenceType, VariableType } from '../../../Common'
1919
import { BaseFilterQueryParams } from '../../types'
2020
import { ImageWithFallbackProps } from '../ImageWithFallback'
2121
import { getPluginStoreData } from './service'
@@ -261,3 +261,9 @@ export interface TaskActionModalStateType {
261261
pluginId: PluginDetailType['id']
262262
taskIndex: number
263263
}
264+
265+
export interface MandatoryPluginNodeType {
266+
isOffendingMandatoryPlugin: boolean
267+
isTriggerBlocked: boolean
268+
pluginBlockState: ConsequenceType
269+
}

0 commit comments

Comments
 (0)