-
-
+
+
-
-
+
+
@@ -46,6 +56,9 @@
>
+
+
+
@@ -103,7 +116,12 @@
-
@@ -140,6 +158,7 @@ import ChildCard from "../components/Child_Card.vue";
import Services from "../../services/index";
import Loading from "../../shared/components/Loading/Loading.vue";
import ProfileHeader from "../components/ProfileHeader.vue";
+import AddChildModal from "../components/AddChildModal.vue";
import AddConnectionModal from "../components/AddConnectionModal.vue";
import ConfigureNewCallModal from "../components/ConfigureNewCallModal.vue";
import FileSelect from "../../shared/components/FileSelect/FileSelect.vue";
@@ -156,7 +175,8 @@ export default {
AvatarBadge,
AddConnectionModal,
ConfigureNewCallModal,
- ChildCard
+ ChildCard,
+ AddChildModal
},
beforeCreate() {},
async created() {
@@ -171,24 +191,51 @@ export default {
inEditMode: false,
showCoverModal: false,
showCreateCallModal: false,
+ showAddChildModal: false,
showAddConnectionModal: false,
childCoverModalImage: null,
addMenuOpen: false
};
},
methods: {
- onAddClicked(action: string) {
- this.notify({
- message: `Add ${action} button clicked. Still not working`
- });
+ onAddClicked(action: "book" | "slideshow" | "puzzle" | "child") {
+ switch (action) {
+ case "child":
+ this.showAddChildModal = true;
+ break;
+ default:
+ this.notify({
+ message: `Add ${action} button clicked. Still not working`
+ });
+ }
this.addMenuOpen = false;
},
+ onChangeAvatarClicked() {
+ this.notify({
+ message: `Upload avatar clicked. Still not working`
+ });
+ },
onDeleteClicked() {
this.notify({ message: "Delete button clicked. Still not working" });
},
goChildProfile(connection) {
this.$router.push({ path: `/child/${connection.id}` });
},
+ async onChildCreated(child) {
+ this.loading = true;
+ await this.getUser();
+ this.loading = false;
+ this.showAddChildModal = false;
+ this.notify({
+ message: `Woohoo! ${child.name} created!`,
+ level: "success"
+ });
+ this.goChildProfile(child);
+ },
+ onCreateChildFailed(msg) {
+ this.notify({ message: `ERROR: ${msg}`, level: "danger" });
+ this.showAddChildModal = false;
+ },
async makeCall(event) {
try {
const response = await Services.ApiService.createCall(event);
diff --git a/resources/scripts/applications/home/views/settings.vue b/resources/scripts/applications/home/views/settings.vue
index 3a2d1e6..5db0939 100644
--- a/resources/scripts/applications/home/views/settings.vue
+++ b/resources/scripts/applications/home/views/settings.vue
@@ -4,103 +4,8 @@