diff --git a/2wr-app/src/components/prepare/family-plans/family-plans-view.vue b/2wr-app/src/components/prepare/family-plans/family-plans-view.vue index a460d0d..9487668 100644 --- a/2wr-app/src/components/prepare/family-plans/family-plans-view.vue +++ b/2wr-app/src/components/prepare/family-plans/family-plans-view.vue @@ -1,70 +1,117 @@ - - + + mdi-delete-forever - + {{ plan.allowAlerts ? 'Alerts Enabled' : 'Alerts Disabled'}} - {{ plan.allowAlerts ? 'mdi-alarm-light' : 'mdi-alarm-light-off'}} + {{ plan.allowAlerts ? 'mdi-alarm-light' : 'mdi-alarm-light-off'}} - + - - - Walkthrough - Manage - - + - + - + + + + + + + + + + + + + + {{ child.name }} + + + + + + + + + + + + + + + + {{ pet.name }} + + + + + + + + + + Add + + mdi-plus + + + + + + + + - + Emergency Contacts @@ -72,12 +119,10 @@ - + Out of Area Contact @@ -85,12 +130,10 @@ - + Reunification @@ -98,35 +141,23 @@ - - - Children - - mdi-chevron-right - - - - - - Pets - - mdi-chevron-right - - - + + + + + + + + + @@ -142,16 +173,23 @@ import FamilyPlan from "@/models/family-plans/FamilyPlan"; import _ from "lodash"; import goBack from "@/functions/goBack"; import { phoneNumber, required, minLength } from "@/rules"; +import PetEditor from "./editors/pet-editor.vue"; +import ChildEditor from "./editors/child-editor.vue"; import AddressView from "./address-view.vue"; import router from "@/router"; export default defineComponent({ name: "family-plan-view", - components: { AddressView }, + components: { AddressView, PetEditor, ChildEditor }, props: { planId: { required: true } }, setup(props, { refs }) { + const plan = ref(null); + const showPetEditor = ref(false); + const editorPet = ref(null); + const showChildEditor = ref(false); + const editorChild = ref(null); onMounted(() => { // Determine which plan to use @@ -162,7 +200,7 @@ export default defineComponent({ props.planId ); if (found) { - plan.value = reactive(_.cloneDeep(found)); + plan.value = found; } else { goBack(); } @@ -221,7 +259,40 @@ export default defineComponent({ } } + function launchPetEditor(pet) { + editorPet.value = pet; + showPetEditor.value = true; + } + + async function savePet(pet) { + await store.dispatch("familyPlansStore/updatePetAsync", { pet, planId: props.planId }); + showPetEditor.value = false; + } + + function launchChildEditor(child) { + editorChild.value = child; + showChildEditor.value = true; + } + + async function saveChild(child) { + await store.dispatch("familyPlansStore/updateChildAsync", { + child, + planId: props.planId, + }); + showChildEditor.value = false; + } + return { + launchPetEditor, + showPetEditor, + editorPet, + savePet, + + launchChildEditor, + showChildEditor, + editorChild, + saveChild, + deletePlan, toggleAlerts, ensureNamed, diff --git a/2wr-app/src/router/familyPlanRoutes.js b/2wr-app/src/router/familyPlanRoutes.js index 52cfc3d..16e41c6 100644 --- a/2wr-app/src/router/familyPlanRoutes.js +++ b/2wr-app/src/router/familyPlanRoutes.js @@ -5,6 +5,7 @@ import FamilyPlanDistantContacts from "../views/prepare/family-plans/distant-con import FamilyPlanRoutes from "../views/prepare/family-plans/routes.vue"; import FamilyPlanChildren from '@/views/prepare/family-plans/children.vue'; import FamilyPlanPets from '@/views/prepare/family-plans/pets.vue'; +import AddFamilyMember from '@/views/prepare/family-plans/add-family-member.vue' export default [ { @@ -68,5 +69,14 @@ export default [ meta: { requiresAuth: true } + }, + { + path: '/prepare/familyplan/:planId/addfamilymember', + name: "familyplan-addfamilymember", + component: AddFamilyMember, + props: true, + meta: { + requiresAuth: true + } } ]; diff --git a/2wr-app/src/views/prepare/family-plans/add-family-member.vue b/2wr-app/src/views/prepare/family-plans/add-family-member.vue new file mode 100644 index 0000000..31d1f77 --- /dev/null +++ b/2wr-app/src/views/prepare/family-plans/add-family-member.vue @@ -0,0 +1,145 @@ + + + + mdi-arrow-left + Make A Plan + + + + Add A Person + + + + + + + Manual Entry + + mdi-plus + + + + + + + + Add A Pet + + + + + + + Manual Entry + + mdi-plus + + + + + + + + + + + + + + + + + + \ No newline at end of file
Add A Person
Add A Pet