From 255b4f41e7b102ab02e93214ebed6de0a768150d Mon Sep 17 00:00:00 2001 From: Nagendra Date: Thu, 1 Feb 2024 17:18:41 +0530 Subject: [PATCH] fix:Event loader moved to create page --- .../application-create-panel/application-create-panel.tsx | 6 +++++- .../components/applications-list/applications-list.tsx | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ui/src/app/applications/components/application-create-panel/application-create-panel.tsx b/ui/src/app/applications/components/application-create-panel/application-create-panel.tsx index 9f4a8e19eff31..b17238481c46e 100644 --- a/ui/src/app/applications/components/application-create-panel/application-create-panel.tsx +++ b/ui/src/app/applications/components/application-create-panel/application-create-panel.tsx @@ -101,12 +101,13 @@ export const ApplicationCreatePanel = (props: { onAppChanged: (app: models.Application) => any; createApp: (app: models.Application) => any; getFormApi: (api: FormApi) => any; + externalPath?: boolean; }) => { const [yamlMode, setYamlMode] = React.useState(false); const [explicitPathType, setExplicitPathType] = React.useState<{path: string; type: models.AppSourceType}>(null); const [destFormat, setDestFormat] = React.useState('URL'); const [retry, setRetry] = React.useState(false); - + const pathHasOpsmx = props.externalPath; function normalizeTypeFields(formApi: FormApi, type: models.AppSourceType) { const app = formApi.getFormState().values; for (const item of appTypes) { @@ -129,6 +130,9 @@ export const ApplicationCreatePanel = (props: { ]).then(([projects, clusters, reposInfo]) => ({projects, clusters, reposInfo})) }> {({projects, clusters, reposInfo}) => { + if (pathHasOpsmx) { + window.parent.postMessage({msg:'loadEvent'},'*'); + } const repos = reposInfo.map(info => info.repo).sort(); const app = deepMerge(DEFAULT_APP, props.app || {}); const repoInfo = reposInfo.find(info => info.repo === app.spec.source.repoURL); diff --git a/ui/src/app/applications/components/applications-list/applications-list.tsx b/ui/src/app/applications/components/applications-list/applications-list.tsx index a57422d3bef35..fc4bdb602e817 100644 --- a/ui/src/app/applications/components/applications-list/applications-list.tsx +++ b/ui/src/app/applications/components/applications-list/applications-list.tsx @@ -300,7 +300,6 @@ const FlexTopBar = (props: {toolbar: Toolbar | Observable}) => { const checkUrlIncludesOpsmx = (param: string) => { let urlSplit = param?.split('/') if(urlSplit && urlSplit[urlSplit.length-2] == 'opsmx' && urlSplit[urlSplit.length-1] == 'creation'){ - window.parent.postMessage({msg:'loadEvent'},'*'); return true; } return false; @@ -636,6 +635,7 @@ export const ApplicationsList = (props: RouteComponentProps<{}>) => { } }} app={appInput} + externalPath = {pathHasOpsmx} onAppChanged={app => ctx.navigation.goto('.', {new: JSON.stringify(app)}, {replace: true})} /> )}