-
Notifications
You must be signed in to change notification settings - Fork 164
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Mayursinh Sarvaiya <[email protected]>
- Loading branch information
Showing
22 changed files
with
78 additions
and
735 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { Stage } from '@ui/gen/v1alpha1/generated_pb'; | ||
import { decodeRawData } from '@ui/utils/decode-raw-data'; | ||
|
||
// context to bridge directives and pipelines UI | ||
|
||
export const willStagePromotionOpenPR = (stage: Stage) => | ||
(stage?.spec?.promotionTemplate?.spec?.steps || []).some((g) => | ||
// TODO(Marvin9): find better way than to hardcode | ||
g?.uses?.includes('git-open-pr') | ||
); | ||
|
||
export const getPromotionArgoCDApps = (stage: Stage): string[] => { | ||
let apps: string[] = []; | ||
const config = stage?.spec?.promotionTemplate?.spec?.steps?.find((step) => | ||
step?.uses?.includes('argocd-update') | ||
)?.config?.raw; /* now type is detached with dynamic config */ | ||
|
||
if (config) { | ||
try { | ||
const data = JSON.parse( | ||
decodeRawData({ result: { case: 'raw', value: config } }) | ||
) as /* from docs */ { | ||
apps?: Array<{ | ||
name?: string; | ||
}>; | ||
}; | ||
apps = data?.apps?.map((app) => app?.name || '').filter(Boolean) || []; | ||
} catch { | ||
// explicitly ignore, no need to crash or anything, this is UI addon | ||
} | ||
} | ||
|
||
return apps; | ||
}; |
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
15 changes: 0 additions & 15 deletions
15
ui/src/features/stage/git-update-editor/git-update-editor.module.less
This file was deleted.
Oops, something went wrong.
129 changes: 0 additions & 129 deletions
129
ui/src/features/stage/git-update-editor/helm-charts.tsx
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.