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

refactor(editor): remove old editor #103

Merged
merged 4 commits into from
Sep 5, 2023

Conversation

balzdur
Copy link
Collaborator

@balzdur balzdur commented Sep 4, 2023

Remove the old editor in favour of the new one.

@balzdur balzdur requested a review from a team September 4, 2023 16:35
Comment on lines +269 to +304
function updateValidation({
editorNodeViewModel,
validation,
}: {
editorNodeViewModel: EditorNodeViewModel;
validation: NodeEvaluation;
}): EditorNodeViewModel {
// Ensure validation is consistent with view model (due to children, namedChildren recursion)
if (!validation) {
throw new Error('validation is required');
}

return {
...editorNodeViewModel,
validation: adaptValidation(validation),
children: editorNodeViewModel.children.map((child, i) =>
updateValidation({
editorNodeViewModel: child,
validation: validation.children[i],
})
),
namedChildren: R.mapValues(
editorNodeViewModel.namedChildren,
(child, namedKey) =>
updateValidation({
editorNodeViewModel: child,
validation: validation.namedChildren[namedKey],
})
),
};
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will require some unit tests (wait for @Vivien-marble job on configuring vitest for the app-builder package)

Copy link
Contributor

@Pascal-Delange Pascal-Delange left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👀

@balzdur balzdur merged commit 2391000 into feature/refactor-builder Sep 5, 2023
1 check passed
@balzdur balzdur deleted the thomas/remove-old-editor branch September 5, 2023 10:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants