Skip to content

Commit e3db451

Browse files
committed
minor fix around workflow editor
1 parent 6f455df commit e3db451

File tree

6 files changed

+18
-4
lines changed

6 files changed

+18
-4
lines changed

src/components/app/details/appConfig/AppComposeRouter.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ export default function AppComposeRouter({
5959
isBaseConfigProtected,
6060
reloadEnvironments,
6161
configProtectionData,
62+
filteredEnvIds
6263
}: AppComposeRouterProps) {
6364
const { path } = useRouteMatch()
6465
const renderJobViewRoutes = (): JSX.Element => {
@@ -190,6 +191,7 @@ export default function AppComposeRouter({
190191
isCDPipeline={isCDPipeline}
191192
respondOnSuccess={respondOnSuccess}
192193
getWorkflows={getWorkflows}
194+
filteredEnvIds={filteredEnvIds}
193195
/>
194196
)}
195197
/>,

src/components/app/details/appConfig/AppConfig.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export default function AppConfig({ appName, isJobView, filteredEnvIds }: AppCon
8989
useEffect(() => {
9090
Promise.all([
9191
getAppConfigStatus(+appId, isJobView),
92-
getWorkflowList(appId),
92+
getWorkflowList(appId, filteredEnvIds),
9393
getAppOtherEnvironmentMin(appId),
9494
typeof getConfigProtections === 'function' && !isJobView
9595
? getConfigProtections(Number(appId))
@@ -421,6 +421,7 @@ export default function AppConfig({ appName, isJobView, filteredEnvIds }: AppCon
421421
isBaseConfigProtected={state.isBaseConfigProtected}
422422
reloadEnvironments={reloadEnvironments}
423423
configProtectionData={state.configProtectionData}
424+
filteredEnvIds={filteredEnvIds}
424425
/>
425426
</div>
426427
</div>

src/components/app/details/appConfig/appConfig.type.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ export interface AppComposeRouterProps {
9595
isBaseConfigProtected?: boolean
9696
reloadEnvironments:()=> void
9797
configProtectionData: any[]
98+
filteredEnvIds?: string
9899
}
99100

100101
export interface EnvironmentOverridesProps {

src/components/app/details/triggerView/workflow.service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ const getInitialWorkflows = (
6666
)
6767
})
6868
} else if (isJobView) {
69-
return Promise.all([getWorkflowList(id, filteredEnvIds), getCIConfig(id)]).then(([workflow, ciConfig]) => {
69+
return Promise.all([getWorkflowList(id), getCIConfig(id)]).then(([workflow, ciConfig]) => {
7070
return processWorkflow(
7171
workflow.result as WorkflowResult,
7272
ciConfig.result as CiPipelineResult,
@@ -77,7 +77,7 @@ const getInitialWorkflows = (
7777
)
7878
})
7979
} else {
80-
return Promise.all([getWorkflowList(id), getCIConfig(id), getCDConfig(id), getExternalCIList(id)]).then(
80+
return Promise.all([getWorkflowList(id, filteredEnvIds), getCIConfig(id), getCDConfig(id), getExternalCIList(id)]).then(
8181
([workflow, ciConfig, cdConfig, externalCIConfig]) => {
8282
return processWorkflow(
8383
workflow.result as WorkflowResult,

src/components/workflowEditor/types.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ export interface WorkflowEditProps
4242
isJobView?: boolean
4343
envList?: any[]
4444
ciPipelines?: any[]
45+
filteredEnvIds?: string
4546
}
4647

4748
export interface AddWorkflowState {
@@ -188,6 +189,6 @@ export interface PipelineContext {
188189
getPrePostStageInEnv?: (isVirtualEnvironment: boolean, isRunPrePostStageInEnv: boolean) => boolean
189190
isVirtualEnvironment?: boolean
190191
globalVariables: {
191-
stageType?: string, label: string; value: string; format: string; description?: string; variableType?: string
192+
stageType?: string, label: string; value: string; format: string; description?: string; variableType?: string
192193
}[]
193194
}

src/components/workflowEditor/workflowEditor.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,14 @@ class WorkflowEdit extends Component<WorkflowEditProps, WorkflowEditState> {
7979
}
8080
}
8181

82+
componentDidUpdate(prevProps) {
83+
if (
84+
prevProps.filteredEnvIds !== this.props.filteredEnvIds
85+
) {
86+
this.getWorkflows()
87+
}
88+
}
89+
8290
removeTakeMeThereClickedItem = () => {
8391
if (typeof Storage !== 'undefined' && localStorage.getItem('takeMeThereClicked')) {
8492
localStorage.removeItem('takeMeThereClicked')
@@ -94,6 +102,7 @@ class WorkflowEdit extends Component<WorkflowEditProps, WorkflowEditState> {
94102
getCreateWorkflows(
95103
this.props.match.params.appId,
96104
this.props.isJobView,
105+
this.props.filteredEnvIds
97106
)
98107
.then((result) => {
99108
const allCINodeMap = new Map()

0 commit comments

Comments
 (0)