feat: enhance child edit and view components with improved form handling and validation
All checks were successful
Chore App Build and Push Docker Images / build-and-push (push) Successful in 1m4s
All checks were successful
Chore App Build and Push Docker Images / build-and-push (push) Successful in 1m4s
- Added `requireDirty` prop to `EntityEditForm` for dirty state management. - Updated `ChildEditView` to handle initial data loading and image selection more robustly. - Refactored `ChildView` to remove unused reward dialog logic and prevent API calls in child mode. - Improved type definitions for form fields and initial data in `ChildEditView`. - Enhanced error handling in form submissions across components. - Implemented cross-tab logout synchronization on password reset in the auth store. - Added tests for login and entity edit form functionalities to ensure proper behavior. - Introduced global fetch interceptor for handling unauthorized responses. - Documented password reset flow and its implications on session management.
This commit is contained in:
@@ -39,6 +39,7 @@
|
||||
<p>Enter a new 4–6 digit Parent PIN. This will be required for parent access.</p>
|
||||
<input
|
||||
v-model="pin"
|
||||
@input="handlePinInput"
|
||||
maxlength="6"
|
||||
inputmode="numeric"
|
||||
pattern="\d*"
|
||||
@@ -47,6 +48,7 @@
|
||||
/>
|
||||
<input
|
||||
v-model="pin2"
|
||||
@input="handlePin2Input"
|
||||
maxlength="6"
|
||||
inputmode="numeric"
|
||||
pattern="\d*"
|
||||
@@ -92,6 +94,16 @@ const isPinValid = computed(() => {
|
||||
return /^\d{4,6}$/.test(p1) && /^\d{4,6}$/.test(p2) && p1 === p2
|
||||
})
|
||||
|
||||
function handlePinInput(event: Event) {
|
||||
const target = event.target as HTMLInputElement
|
||||
pin.value = target.value.replace(/\D/g, '').slice(0, 6)
|
||||
}
|
||||
|
||||
function handlePin2Input(event: Event) {
|
||||
const target = event.target as HTMLInputElement
|
||||
pin2.value = target.value.replace(/\D/g, '').slice(0, 6)
|
||||
}
|
||||
|
||||
async function requestCode() {
|
||||
error.value = ''
|
||||
info.value = ''
|
||||
|
||||
Reference in New Issue
Block a user