Skip to content

Commit

Permalink
fixes tile edit regression #209
Browse files Browse the repository at this point in the history
  • Loading branch information
chrabyrd committed Mar 4, 2025
1 parent 1f0b781 commit 50983d1
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,22 +51,21 @@ async function save(e: FormSubmitEvent) {
Object.entries(e.states).map(([key, state]) => [key, state.value]),
);
let updatedTileId;
if (!props.resourceInstanceId) {
const updated = await createScheme({
const updatedScheme = await createScheme({
[props.nodegroupAlias]: [formData],
});
await router.push({
name: props.graphSlug,
params: { id: updated.resourceinstanceid },
params: { id: updatedScheme.resourceinstanceid },
});
openEditor!(
props.componentName,
updated[props.nodegroupAlias][0].tileid,
);
updatedTileId = updatedScheme[props.nodegroupAlias][0].tileid;
} else {
await upsertLingoTile(
const updatedScheme = await upsertLingoTile(
props.graphSlug,
props.nodegroupAlias,
{
Expand All @@ -76,11 +75,15 @@ async function save(e: FormSubmitEvent) {
},
props.tileId,
);
updatedTileId = updatedScheme.tileid;
}
refreshReportSection!(props.componentName);
openEditor!(props.componentName, updatedTileId);
} catch (error) {
console.error(error);
} finally {
refreshReportSection!(props.componentName);
}
}
</script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,22 +64,21 @@ async function save(e: FormSubmitEvent) {
},
};
let updatedTileId;
if (!props.resourceInstanceId) {
const updated = await createScheme({
const updatedScheme = await createScheme({
[props.nodegroupAlias]: expectedTileShape,
});
await router.push({
name: props.graphSlug,
params: { id: updated.resourceinstanceid },
params: { id: updatedScheme.resourceinstanceid },
});
openEditor!(
props.componentName,
updated[props.nodegroupAlias].tileid,
);
updatedTileId = updatedScheme[props.nodegroupAlias][0].tileid;
} else {
await upsertLingoTile(
const updatedScheme = await upsertLingoTile(
props.graphSlug,
props.nodegroupAlias,
{
Expand All @@ -89,11 +88,15 @@ async function save(e: FormSubmitEvent) {
},
props.tileId,
);
updatedTileId = updatedScheme.tileid;
}
refreshReportSection!(props.componentName);
openEditor!(props.componentName, updatedTileId);
} catch (error) {
console.error(error);
} finally {
refreshReportSection!(props.componentName);
}
}
</script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,22 +47,21 @@ async function save(e: FormSubmitEvent) {
Object.entries(e.states).map(([key, state]) => [key, state.value]),
);
let updatedTileId;
if (!props.resourceInstanceId) {
const updated = await createScheme({
const updatedScheme = await createScheme({
[props.nodegroupAlias]: formData,
});
await router.push({
name: props.graphSlug,
params: { id: updated.resourceinstanceid },
params: { id: updatedScheme.resourceinstanceid },
});
openEditor!(
props.componentName,
updated[props.nodegroupAlias].tileid,
);
updatedTileId = updatedScheme[props.nodegroupAlias][0].tileid;
} else {
await upsertLingoTile(
const updatedScheme = await upsertLingoTile(
props.graphSlug,
props.nodegroupAlias,
{
Expand All @@ -72,11 +71,15 @@ async function save(e: FormSubmitEvent) {
},
props.tileId,
);
updatedTileId = updatedScheme.tileid;
}
refreshReportSection!(props.componentName);
openEditor!(props.componentName, updatedTileId);
} catch (error) {
console.error(error);
} finally {
refreshReportSection!(props.componentName);
}
}
</script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,22 +51,21 @@ async function save(e: FormSubmitEvent) {
Object.entries(e.states).map(([key, state]) => [key, state.value]),
);
let updatedTileId;
if (!props.resourceInstanceId) {
const updated = await createScheme({
const updatedScheme = await createScheme({
[props.nodegroupAlias]: [formData],
});
await router.push({
name: props.graphSlug,
params: { id: updated.resourceinstanceid },
params: { id: updatedScheme.resourceinstanceid },
});
openEditor!(
props.componentName,
updated[props.nodegroupAlias][0].tileid,
);
updatedTileId = updatedScheme[props.nodegroupAlias][0].tileid;
} else {
await upsertLingoTile(
const updatedScheme = await upsertLingoTile(
props.graphSlug,
props.nodegroupAlias,
{
Expand All @@ -76,11 +75,15 @@ async function save(e: FormSubmitEvent) {
},
props.tileId,
);
updatedTileId = updatedScheme.tileid;
}
refreshReportSection!(props.componentName);
openEditor!(props.componentName, updatedTileId);
} catch (error) {
console.error(error);
} finally {
refreshReportSection!(props.componentName);
}
}
</script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,22 +46,21 @@ async function save(e: FormSubmitEvent) {
Object.entries(e.states).map(([key, state]) => [key, state.value]),
);
let updatedTileId;
if (!props.resourceInstanceId) {
const updated = await createScheme({
const updatedScheme = await createScheme({
[props.nodegroupAlias]: formData,
});
await router.push({
name: props.graphSlug,
params: { id: updated.resourceinstanceid },
params: { id: updatedScheme.resourceinstanceid },
});
openEditor!(
props.componentName,
updated[props.nodegroupAlias].tileid,
);
updatedTileId = updatedScheme[props.nodegroupAlias][0].tileid;
} else {
await upsertLingoTile(
const updatedScheme = await upsertLingoTile(
props.graphSlug,
props.nodegroupAlias,
{
Expand All @@ -71,11 +70,15 @@ async function save(e: FormSubmitEvent) {
},
props.tileId,
);
updatedTileId = updatedScheme.tileid;
}
refreshReportSection!(props.componentName);
openEditor!(props.componentName, updatedTileId);
} catch (error) {
console.error(error);
} finally {
refreshReportSection!(props.componentName);
}
}
</script>
Expand Down
3 changes: 1 addition & 2 deletions arches_lingo/src/arches_lingo/pages/SchemePage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,6 @@ function closeEditor() {
}
function openEditor(componentName: string, tileId?: string) {
editorPanelKey.value += 1;
selectedComponentDatum.value = componentData.value.find(
(componentDatum) => {
return componentDatum.componentName === componentName;
Expand All @@ -100,6 +98,7 @@ function openEditor(componentName: string, tileId?: string) {
editorTileId.value = tileId;
editorState.value = MINIMIZED;
editorPanelKey.value += 1;
}
function maximizeEditor() {
Expand Down

0 comments on commit 50983d1

Please sign in to comment.