diff --git a/backend/src/main/kotlin/uk/co/neviyn/observationdatabase/Api.kt b/backend/src/main/kotlin/uk/co/neviyn/observationdatabase/Api.kt index c5662e9..d7fad27 100644 --- a/backend/src/main/kotlin/uk/co/neviyn/observationdatabase/Api.kt +++ b/backend/src/main/kotlin/uk/co/neviyn/observationdatabase/Api.kt @@ -53,7 +53,8 @@ data class ChartDataset( val label: String, val backgroundColor: String, val borderColor: String, - val data: List + val data: List, + val fill: Boolean = false ){ constructor(label: String, color: String, data: List): this(label, color, color, data) } \ No newline at end of file diff --git a/backend/src/main/kotlin/uk/co/neviyn/observationdatabase/Security.kt b/backend/src/main/kotlin/uk/co/neviyn/observationdatabase/Security.kt index f431308..6e1aceb 100644 --- a/backend/src/main/kotlin/uk/co/neviyn/observationdatabase/Security.kt +++ b/backend/src/main/kotlin/uk/co/neviyn/observationdatabase/Security.kt @@ -10,9 +10,9 @@ import org.springframework.security.config.annotation.web.configuration.EnableWe import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter import org.springframework.security.config.http.SessionCreationPolicy import org.springframework.security.core.AuthenticationException -import org.springframework.security.web.authentication.www.BasicAuthenticationEntryPoint import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder import org.springframework.security.crypto.password.PasswordEncoder +import org.springframework.security.web.authentication.www.BasicAuthenticationEntryPoint import org.springframework.stereotype.Component import java.io.IOException import javax.servlet.ServletException diff --git a/frontend/src/App.vue b/frontend/src/App.vue index adfbb5e..2d0219f 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -6,6 +6,8 @@ New Observation + View Observations + Graphs @@ -31,12 +33,4 @@ text-align: center; color: #2c3e50; } - - #nav { - padding: 10px; - } - - #nav a.router-link-exact-active { - color: #42b983; - } diff --git a/frontend/src/router.js b/frontend/src/router.js index 41a8af2..8447efe 100644 --- a/frontend/src/router.js +++ b/frontend/src/router.js @@ -6,40 +6,46 @@ import Stats from "./views/Stats.vue"; import NewSite from "./views/NewSite.vue"; import NewTutor from "./views/NewTutor.vue"; import ViewObservations from "./views/ViewObservations.vue"; +import ObservationComplete from "./views/ObservationComplete.vue"; Vue.use(Router); export default new Router({ - routes: [ - { - path: "/", - name: "home", - component: Home - }, - { - path: "/observation", - name: "observation", - component: Observation - }, - { - path: "/stats", - name: "stats", - component: Stats - }, - { - path: "/newsite", - name: "newSite", - component: NewSite - }, - { - path: "/newtutor", - name: "newTutor", - component: NewTutor - }, - { - path: "/observations", - name: "observations", - component: ViewObservations - } - ] + routes: [ + { + path: "/", + name: "home", + component: Home + }, + { + path: "/observation", + name: "observation", + component: Observation + }, + { + path: "/stats", + name: "stats", + component: Stats + }, + { + path: "/newsite", + name: "newSite", + component: NewSite + }, + { + path: "/newtutor", + name: "newTutor", + component: NewTutor + }, + { + path: "/observations", + name: "observations", + component: ViewObservations + }, + { + path: "/complete", + name: "complete", + component: ObservationComplete + } + ] }); diff --git a/frontend/src/views/Observation.vue b/frontend/src/views/Observation.vue index b89f503..9ded340 100644 --- a/frontend/src/views/Observation.vue +++ b/frontend/src/views/Observation.vue @@ -91,14 +91,14 @@
+ v-model="submitPassword">
@@ -209,23 +209,26 @@ showModal() { this.$refs.submissionModal.show(); }, - hideModal() { - this.$refs.submissionModal.hide(); - this.submitPassword = null; - }, clearPassword() { this.submitPassword = null }, handleOk(evt) { // Prevent modal from closing evt.preventDefault(); - if (this.password) { + if (this.submitPassword !== null) { this.handleSubmit() } }, handleSubmit() { var form = document.getElementById("submission-form"); if (form.checkValidity()) { + let axiosConfig = { + auth: { + username: "admin", + password: this.submitPassword + } + }; + var self = this; Vue.axios .post("/observation", { site: this.site, @@ -234,9 +237,9 @@ whom: this.whom, type: this.type, entries: JSON.parse(JSON.stringify(this.observations)) - }) + }, axiosConfig) .then(function (response) { - this.hideModal(); + self.$router.push("/complete"); console.log(response); }) .catch(function (error) { diff --git a/frontend/src/views/ObservationComplete.vue b/frontend/src/views/ObservationComplete.vue new file mode 100644 index 0000000..94d6d7a --- /dev/null +++ b/frontend/src/views/ObservationComplete.vue @@ -0,0 +1,23 @@ + + + + + \ No newline at end of file diff --git a/frontend/src/views/Stats.vue b/frontend/src/views/Stats.vue index 2b8bfb5..00af6c9 100644 --- a/frontend/src/views/Stats.vue +++ b/frontend/src/views/Stats.vue @@ -1,164 +1,170 @@