Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat:Event loader moved to create page #17

Merged
merged 1 commit into from
Feb 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,6 @@ const FlexTopBar = (props: {toolbar: Toolbar | Observable<Toolbar>}) => {
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;
Expand Down Expand Up @@ -636,6 +635,7 @@ export const ApplicationsList = (props: RouteComponentProps<{}>) => {
}
}}
app={appInput}
externalPath = {pathHasOpsmx}
onAppChanged={app => ctx.navigation.goto('.', {new: JSON.stringify(app)}, {replace: true})}
/>
)}
Expand Down
Loading