[Remove Vuetify from Studio] 'Create an account' page#5701
[Remove Vuetify from Studio] 'Create an account' page#5701vtushar06 wants to merge 9 commits intolearningequality:unstablefrom
Conversation
…ponents and added emailValidateMessage translation
…mplement toggleUsage method for form handling
…xtbox components, enhancing form handling and user experience
…ndling for agreement acceptance
|
👋 Thanks for contributing! We will assign a reviewer within the next two weeks. In the meantime, please ensure that:
We'll be in touch! 😊 |
There was a problem hiding this comment.
Pull request overview
This pull request migrates the "Create an account" page from Vuetify to the Kolibri Design System (KDS) as part of the ongoing effort to remove Vuetify dependencies from Studio (issue #5060). The migration replaces Vuetify form components with KDS equivalents and implements custom form validation logic to replace Vuetify's built-in validation system.
Changes:
- Replaced Vuetify components (
VForm,VSelect,VSlideYTransition,VLayout,VInput) with KDS components (KSelect,KTransition,KCheckbox,KTextbox,KButton,KRouterLink) - Created two new wrapper components
StudioEmailFieldandStudioPasswordFieldfor consistent email and password input handling - Implemented custom form validation with
validateField()andvalidateForm()methods to replace Vuetify's validation system
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 8 comments.
| File | Description |
|---|---|
| contentcuration/contentcuration/frontend/accounts/pages/Create.vue | Main migration: replaced Vuetify components with KDS, implemented custom validation, updated styling |
| contentcuration/contentcuration/frontend/accounts/components/form/StudioEmailField.vue | New wrapper component for email input using KTextbox with validation and error display |
| contentcuration/contentcuration/frontend/accounts/components/form/StudioPasswordField.vue | New wrapper component for password input using KTextbox with error display |
Comments suppressed due to low confidence (1)
contentcuration/contentcuration/frontend/accounts/components/form/StudioPasswordField.vue:50
- According to the acceptance criteria in issue #5670, if there is no unit test suite, a new one should be created using @testing-library/vue. No unit tests have been added for the Create page or the new StudioEmailField and StudioPasswordField components.
Consider adding unit tests for the new components and the updated Create page to verify the form validation logic, error handling, and user interactions work as expected.
<template>
<KTextbox
:value="value"
type="password"
:label="label || $tr('passwordLabel')"
:invalid="hasError"
:invalidText="errorText"
:showInvalidText="hasError"
@input="$emit('input', $event)"
@blur="$emit('blur')"
/>
</template>
<script>
export default {
name: 'StudioPasswordField',
props: {
value: {
type: String,
default: '',
},
label: {
type: String,
default: null,
},
errorMessages: {
type: Array,
default: () => [],
},
},
computed: {
hasError() {
return this.errorMessages && this.errorMessages.length > 0;
},
errorText() {
return this.hasError ? this.errorMessages[0] : '';
},
},
$trs: {
passwordLabel: 'Password',
},
};
</script>
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
contentcuration/contentcuration/frontend/accounts/components/form/StudioEmailField.vue
Show resolved
Hide resolved
|
Hi @vtushar06, thanks! Before we assign a maintainer, I will invite the community review. |
|
📢 ✨ Community Review guidance for both authors and reviewers. |
|
Yeah sure @MisRob, I would love to get engage with our fellow contributors over this. |
|
Hey @vtushar06 @MisRob , are there existing tests for the Create page that would cover the new StudioEmailField, StudioPasswordField, and validation logic? Or would new tests be needed as mentioned in the issue's acceptance criteria? |
|
Hi @abhiraj75, thanks! The page itself was covered with VTL tests #5633 beforehand which I mentioned to @vtushar06. However still, having few focused tests for the new |
|
thanks @MisRob, I will proceed my upcoming changes including tests for |
LianaHarris360
left a comment
There was a problem hiding this comment.
Thanks for your work on this @vtushar06! The newly created components are clean, focused, and correctly match the use case of the original components used. I had a few questions & notes on the changes within Create.vue that need to be resolved.
| break; | ||
| } | ||
| }, | ||
| validateForm() { |
There was a problem hiding this comment.
I noticed this manual validateField() / validateForm() system is used to replace the Vuetify form validation. Was there any particular reason to not use generateFormMixin for the validation instead?
| // We need to check the "acceptedAgreement" here explicitly because it is not a | ||
| // Vuetify form field and does not trigger the form validation. | ||
| if (this.$refs.form.validate() && this.acceptedAgreement) { | ||
| if (this.validateForm() && this.acceptedAgreement) { |
There was a problem hiding this comment.
Does the previous comment about the acceptedAgreement field not being a Vuetify form field still apply? Is validation triggered if we don't explicitly check "acceptedAgreement" here?
| :style="{ color: $themeTokens.error }" | ||
| class="field-error" | ||
| > | ||
| {{ $tr('fieldRequired') }} |
There was a problem hiding this comment.
Was there an issue with using commonStrings.$tr('fieldRequired') in the template? This file uses two sources for this string, but it would be best to stick to one.
| other_use: '', | ||
| locations: [], | ||
| source: '', | ||
| source: {}, |
There was a problem hiding this comment.
There's an error in the console: [Vue warn]: Invalid prop: custom validator check failed for prop "value" because of how the source field is initialized. Can you update this to be source: { value: '', label: '' }, instead?
|
|
||
| .banner { | ||
| margin-bottom: 32px; | ||
| } |
| > | ||
| <Banner | ||
| :value="!valid" | ||
| <StudioBanner |



Summary
Migrates the Create an account page from Vuetify to Kolibri Design System (KDS) as part of issue #5670.
Changes:
VForm,VSelect,VSlideYTransition,VLayout,VInputwith KDS equivalents (KSelect,KTransition,KCheckbox,KTextbox,KButton,KRouterLink)TextField,EmailField,PasswordField,TextArea,Checkbox,Banner,ImmersiveModalLayout) with KDS components and two new wrapper components:StudioEmailField.vue — wraps KTextbox with email input handling and error display
StudioPasswordField.vue — wraps KTextbox with password type and error display
$refs.form.validate()+ computed rule arrays) with a customvalidateField()/validateForm()approach that:ActionLinkpolicy links withKRouterLinkScreenRecording:
Remove-vuetify-5670-2.mp4
Remove-vuetify-5670.mp4
…
References
Closes #5670
…
Reviewer guidance
Login as a@a.com with password a
Go to Create Page