-
Notifications
You must be signed in to change notification settings - Fork 47
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
UX: Rewrite param-input using FormKit #307
Conversation
What does this PR do? ===================== This PR refactors param-input to use FormKit. FormKit is a structured form tool in the core. After the rewrite, we will be able to gradually abandon custom validators, get semantic parameter error prompts, etc. meta link: https://meta.discourse.org/t/wishlist-param-dropdown-for-data-explorer-query/253883/28?u=lhc_fl
@@ -24,9 +24,17 @@ export default class Query extends RestModel { | |||
return getURL(`/admin/plugins/explorer/queries/${this.id}.json?export=1`); | |||
} | |||
|
|||
@computed("param_info") | |||
@computed("param_info", "updateing") |
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.
👀
Is this a pre-existing bug? It seems to be a backend behavior, I have not changed this part. upd: I can reproduce it in main branch, I think we should fix this in another PR should fix by #308 |
We used `with_deleted` incorrectly in the code. This method does not exist on `User`, `Badge`, and `Group`. This will cause an error when entering a numeric id in these three parameter input, forcing the user to enter the name/username of these inputs. See #307 (comment)
We used `with_deleted` incorrectly in the code. This method does not exist on `User`, `Badge`, and `Group`. This will cause an error when entering a numeric id in these three parameter input, forcing the user to enter the name/username of these inputs. See #307 (comment)
…plorer into ux-param-input-formkit-rewrite
<Form | ||
@data={{this.data}} | ||
@onRegisterApi={{this.onRegisterApi}} | ||
@onSubmit={{this.onSubmit}} | ||
class="params-form" | ||
as |form| | ||
> | ||
{{#each this.paramInfo as |info|}} | ||
<div class="param"> | ||
<form.Field | ||
@name={{info.identifier}} | ||
@title={{info.identifier}} | ||
@validation={{info.validation}} | ||
@validate={{info.validate}} | ||
as |field| | ||
> | ||
<info.component @field={{field}} @info={{info}} /> | ||
</form.Field> | ||
</div> | ||
{{/each}} | ||
</Form> |
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.
Im impressed, you have greatly managed to integrate form kit into something which is not "standard" at all 👏
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.
😽 wonderful work here.
What does this PR do?
This PR refactors param-input to use FormKit. FormKit is a structured form tool in the core. After the rewrite, we will be able to gradually abandon custom validators, get semantic parameter error prompts, etc.
meta link: https://meta.discourse.org/t/wishlist-param-dropdown-for-data-explorer-query/253883/28?u=lhc_fl
Screenshot