From 78f08e54a485cc7159c27c0bf86d484e8f8c6e0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20G=C3=B6tz?= Date: Mon, 16 Apr 2018 23:54:55 +0200 Subject: [PATCH] Fix clear bug --- basta/src/App.vue | 11 +- .../bugReport/BugReportFormular.vue | 141 ++++++++++++++++++ .../bugReport/BugReportOverview.vue | 41 +++++ basta/src/config.js | 1 + basta/src/router/index.js | 4 +- basta/src/store.js | 21 ++- 6 files changed, 215 insertions(+), 4 deletions(-) create mode 100644 basta/src/components/bugReport/BugReportFormular.vue create mode 100644 basta/src/components/bugReport/BugReportOverview.vue diff --git a/basta/src/App.vue b/basta/src/App.vue index c958742..690078a 100644 --- a/basta/src/App.vue +++ b/basta/src/App.vue @@ -39,9 +39,14 @@ - + Version 0.1.1 + + + Bug Report + + © Copyright 2018, Michael Götz @@ -65,6 +70,10 @@ + + diff --git a/basta/src/components/bugReport/BugReportOverview.vue b/basta/src/components/bugReport/BugReportOverview.vue new file mode 100644 index 0000000..eafb3ad --- /dev/null +++ b/basta/src/components/bugReport/BugReportOverview.vue @@ -0,0 +1,41 @@ + + + + + diff --git a/basta/src/config.js b/basta/src/config.js index 24aca09..67db929 100644 --- a/basta/src/config.js +++ b/basta/src/config.js @@ -1,3 +1,4 @@ export const API_ROOT_FOOD = 'http://localhost:8080/api/v1.2/food'; export const API_ROOT_ACCOUNT = 'http://localhost:8080/api/v1.2/account'; +export const API_ROOT_BUGREPORT = 'http://localhost:8080/api/v1.2/bug-report'; export const API_ROOT = 'http://localhost:8080/api'; diff --git a/basta/src/router/index.js b/basta/src/router/index.js index 503f015..59b79a4 100644 --- a/basta/src/router/index.js +++ b/basta/src/router/index.js @@ -8,6 +8,7 @@ import Activation from '@/components/account/Activation' import Registration from '@/components/account/Registration' import PasswordResetMail from '@/components/account/PasswordResetMail' import PasswordResetConfirmation from '@/components/account/PasswordResetConfirmation' +import BugReportOverview from '@/components/bugReport/BugReportOverview' import FoodOverview from '@/components/food/FoodOverview' @@ -18,7 +19,7 @@ Vue.use(Router); export default new Router({ routes: [ {path: '/', name: 'home', component: Home}, - {path: '/login', name: 'login', component: Login }, + {path: '/login', name: 'login', component: Login}, {path: '/logout', name: 'logout', component: Logout, meta: {auth: false}}, {path: '/registration', name: 'registration', component: Registration}, {path: '/activation/:uuid/:token', name: 'activation', component: Activation}, @@ -33,5 +34,6 @@ export default new Router({ {path: '/food', name: 'food', component: FoodOverview}, {path: '/food/:id', name: 'food-detail', component: FoodDetail}, + {path: '/bug-report', name: 'bug-report', component: BugReportOverview}, ] }) diff --git a/basta/src/store.js b/basta/src/store.js index 0ee572f..6de69b0 100644 --- a/basta/src/store.js +++ b/basta/src/store.js @@ -16,6 +16,7 @@ export const store = new Vuex.Store({ currentFoodComments: [], currentFoodUserImage: '', }, + bugReports: [], }, getters: { isAuthenticated: state => { @@ -55,6 +56,9 @@ export const store = new Vuex.Store({ getDetailedFoodComments: state => { return state.foodAppStudWue.currentFoodComments }, + getBugReports: state => { + return state.bugReports + } }, mutations: { logout(state) { @@ -128,13 +132,23 @@ export const store = new Vuex.Store({ }, setUserImage(state, {image}) { state.foodAppStudWue.currentFoodUserImage = image; - } + }, + loadBugReports(state) { + let url = CONFIG.API_ROOT_BUGREPORT + '/reports/'; + window.axios + .get(url) + .then(response => { + state.bugReports = response.data; + }) + .catch(e => { + console.error(e) + }) + }, }, actions: { login(context) { context.commit('login') }, - logout(context) { context.commit('logout') }, @@ -153,5 +167,8 @@ export const store = new Vuex.Store({ setUserImage(context, image) { context.commit('setUserImage', image) }, + loadBugReports(context) { + context.commit('loadBugReports') + }, }, });