From ceb6d08c4a56be2df2f9800a0496569be0ea441d Mon Sep 17 00:00:00 2001 From: Nathan Cannon Date: Fri, 19 Oct 2018 14:31:26 +0100 Subject: [PATCH] Frontend can now submit and view persons. --- frontend/src/views/Observation.vue | 33 +++++++++++++++++++++++-- frontend/src/views/StartNew.vue | 3 +++ frontend/src/views/ViewObservations.vue | 17 ++++++++++++- 3 files changed, 50 insertions(+), 3 deletions(-) diff --git a/frontend/src/views/Observation.vue b/frontend/src/views/Observation.vue index 693194c..bd37ab3 100644 --- a/frontend/src/views/Observation.vue +++ b/frontend/src/views/Observation.vue @@ -5,6 +5,7 @@ {{type}} / {{description}} +
@@ -55,6 +56,23 @@ + + + + + + + + + + + + + Enter your name(s)! + {{ item }}  + + + +
@@ -143,6 +161,7 @@ import "bootstrap/dist/css/bootstrap.css"; import "bootstrap-vue/dist/bootstrap-vue.css"; import "vue-awesome/icons/tag"; +import "vue-awesome/icons/times-circle" import { mapState } from "vuex"; import Vue from "vue"; @@ -160,7 +179,9 @@ export default { } ], totals: [0, 0, 0, 0, 0, 0, 0, 0], - submitPassword: null + submitPassword: null, + persons: [], + personInput: null }; }, computed: { @@ -286,6 +307,7 @@ export default { observed: this.description, whom: this.whom, type: this.type, + persons: this.persons, entries: JSON.parse(JSON.stringify(this.observations)) }, axiosConfig @@ -300,7 +322,14 @@ export default { } this.clearPassword(); form.classList.add("was-validated"); - } + }, + addPerson() { + this.persons.push(this.personInput); + this.personInput = null; + }, + deletePerson: function(index) { + this.persons.splice(index, 1); + }, } }; diff --git a/frontend/src/views/StartNew.vue b/frontend/src/views/StartNew.vue index ce71ed6..5ed99b9 100644 --- a/frontend/src/views/StartNew.vue +++ b/frontend/src/views/StartNew.vue @@ -114,6 +114,9 @@ export default { this.errorMessage = error.response.data; this.$refs.errorModal.show(); }); + if(this.site != null){ + this.getTutors(); + } }, computed: { ...mapState(["site", "description", "type", "tutors", "whom"]) diff --git a/frontend/src/views/ViewObservations.vue b/frontend/src/views/ViewObservations.vue index c5ca098..4049fa9 100644 --- a/frontend/src/views/ViewObservations.vue +++ b/frontend/src/views/ViewObservations.vue @@ -53,11 +53,18 @@

{{ observation.date }}
{{ observation.whom }} {{ observation.type }}
{{ observation.observed }}

{{ observation.date }}, {{ observation.whom }}
{{ observation.type }}, {{ observation.observed }}

+
    +
  • {{ person.name }}
  • +
{{ observation.monitoring }}
+ + +
{{ observation.controlProcedural }}
+
{{ observation.control }}
@@ -68,7 +75,15 @@
-
{{ observation.teamwork }}
+
{{ observation.teamworkCommunications }}
+
+ + +
{{ observation.teamworkLeadership }}
+
+ + +
{{ observation.teamworkWorkload }}