Skip to content

Commit

Permalink
Remove obsolete workaround
Browse files Browse the repository at this point in the history
This is actually an issue on some nested create forms that still use an
old workaround that we implemented a while back to fix modals not
closing and success toasts not being dispatched, at the expense of
backend validation errors being displayed.
I do not remember how this was solved, however this workaround is
definitely not longer needed, and can just be YEETed on sight.
  • Loading branch information
nas-tabchiche committed Dec 31, 2024
1 parent 8cccab1 commit 1bafaec
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 67 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,29 +53,6 @@
}
}
let { form: deleteForm, message: deleteMessage } = {
form: {},
message: {}
};
let { form: createForm, message: createMessage } = {
form: {},
message: {}
};
// NOTE: This is a workaround for an issue we had with getting the return value from the form actions after switching pages in route /[model=urlmodel]/ without a full page reload.
// invalidateAll() did not work.
$: {
({ form: createForm, message: createMessage } = superForm(data.scenarioCreateForm, {
onUpdated: ({ form }) =>
handleFormUpdated({ form, pageStatus: $page.status, closeModal: true })
}));
({ form: deleteForm, message: deleteMessage } = superForm(data.scenarioDeleteForm, {
onUpdated: ({ form }) =>
handleFormUpdated({ form, pageStatus: $page.status, closeModal: true })
}));
}
function modalCreateForm(): void {
const modalComponent: ModalComponent = {
ref: CreateModal,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,22 +94,6 @@
}
}
let { form: measureCreateForm, message: measureCreateMessage } = {
form: {},
message: {}
};
// NOTE: This is a workaround for an issue we had with getting the return value from the form actions after switching pages in route /[model=urlmodel]/ without a full page reload.
// invalidateAll() did not work.
$: {
({ form: measureCreateForm, message: measureCreateMessage } = superForm(
data.measureCreateForm,
{
onUpdated: ({ form }) =>
handleFormUpdated({ form, pageStatus: $page.status, closeModal: true })
}
));
}
const next = getSecureRedirect($page.url.searchParams.get('next'));
const probabilityColorMap = data.riskMatrix.probability.map(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,34 +162,6 @@
$: if (createAppliedControlsLoading === true && form) createAppliedControlsLoading = false;
let { form: measureCreateForm, message: measureCreateMessage } = {
form: {},
message: {}
};
let { form: evidenceCreateForm, message: evidenceCreateMessage } = {
form: {},
message: {}
};
// NOTE: This is a workaround for an issue we had with getting the return value from the form actions after switching pages in route /[model=urlmodel]/ without a full page reload.
// invalidateAll() did not work.
$: {
({ form: measureCreateForm, message: measureCreateMessage } = superForm(
data.measureCreateForm,
{
onUpdated: ({ form }) =>
handleFormUpdated({ form, pageStatus: $page.status, closeModal: true })
}
));
({ form: evidenceCreateForm, message: evidenceCreateMessage } = superForm(
data.evidenceCreateForm,
{
onUpdated: ({ form }) =>
handleFormUpdated({ form, pageStatus: $page.status, closeModal: true })
}
));
}
$: mappingInference = {
sourceRequirementAssessment:
data.requirementAssessment.mapping_inference.source_requirement_assessment,
Expand Down

0 comments on commit 1bafaec

Please sign in to comment.