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

- 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:
2026-02-17 17:18:03 -05:00
parent 5e22e5e0ee
commit 31ea76f013
29 changed files with 1000 additions and 164 deletions

View File

@@ -137,6 +137,11 @@ const submit = async () => {
}
}
function handlePinInput(event: Event) {
const target = event.target as HTMLInputElement
pin.value = target.value.replace(/\D/g, '').slice(0, 6)
}
const handleLogout = () => {
logoutParent()
router.push('/child')
@@ -357,6 +362,7 @@ onUnmounted(() => {
<input
ref="pinInput"
v-model="pin"
@input="handlePinInput"
inputmode="numeric"
pattern="\d*"
maxlength="6"
@@ -365,7 +371,7 @@ onUnmounted(() => {
/>
<div class="actions modal-actions">
<button type="button" class="btn btn-secondary" @click="close">Cancel</button>
<button type="submit" class="btn btn-primary">OK</button>
<button type="submit" class="btn btn-primary" :disabled="pin.length < 4">OK</button>
</div>
</form>
<div v-if="error" class="error modal-message">{{ error }}</div>