-
Notifications
You must be signed in to change notification settings - Fork 292
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
Experimental UI form separation #7777
Draft
VakarisZ
wants to merge
51
commits into
inverse-inc:devel
Choose a base branch
from
VakarisZ:experimental-ui-form-separation
base: devel
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Experimental UI form separation #7777
VakarisZ
wants to merge
51
commits into
inverse-inc:devel
from
VakarisZ:experimental-ui-form-separation
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
VakarisZ
commented
Jul 24, 2023
Comment on lines
+55
to
+58
uiForm.value['record_dns_in_sql'] = (props.form['record_dns_in_sql'] === "enabled") | ||
props.form['record_dns_in_sql'] = computed(() => { | ||
return uiForm['record_dns_in_sql'] ? "enabled" : "disabled" | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This binding could be extracted into a composable, it doesn't need to be part of the form
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This branch is a concept to solving the problem of component explosion.
SEE LAST COMMIT ONLY
The problem
The data that the back-end API's use are not consistent.
Example data that the back-end gives and expects:
This means that in the UI we need at least 4 components to display the data. ("enabled"/"disabled", true/false, int, int as string).
Instead, there should be only 2 components int the UI: bool and int.
The proposed solution is to create a UI version of the form:
The idea is to clone the form data and link the back-end form data with the front-end form data.
To be more specific:
Benefits
The main benefits of this change is code design. After this change the codebase should have a lot less components and instead have a collection of "computed" properties that can be used for translating UI component state to what the various API's expect.
It would also allow us to v-bind form properties to the components, further simplifying the components and separating component logic from domain logic