diff --git a/app/javascript/commons/custom-axios.js b/app/javascript/commons/custom-axios.js new file mode 100644 index 0000000..8a5cfbd --- /dev/null +++ b/app/javascript/commons/custom-axios.js @@ -0,0 +1,49 @@ +import axios from 'axios' + +axios.defaults.headers['X-CSRF-TOKEN'] = $('meta[name=csrf-token]').attr('content') +axios.defaults.headers.common['Accept'] = 'application/json' + +const http = axios; + +export default (Vue, { store }) => { + http.interceptors.request.use((config) => { + store.commit('SET_IS_LOADING', true) + return config; + }, (error) => { + const errorMsg = `${error.response.status} ${error.response.statusText}` + const vm = new Vue() + vm.$bvToast.toast(error.toString(), { + title: errorMsg, + noCloseButton: false, + noAutoHide: true, + variant: 'danger', + }) + + return Promise.reject(error) + }); + + http.interceptors.response.use((response) => { + store.commit('SET_IS_LOADING', false); + return response; + }, (error) => { + const errorMsg = `${error.response.status} ${error.response.statusText}` + const vm = new Vue() + vm.$bvToast.toast(error.toString(), { + title: errorMsg, + noCloseButton: false, + noAutoHide: true, + variant: 'danger', + }) + + return Promise.reject(error) + }); + + Vue.http = http; + Object.defineProperties(Vue.prototype, { + $http: { + get () { + return http; + } + } + }); +}; \ No newline at end of file diff --git a/app/javascript/components/backlogs/StoryModal.vue b/app/javascript/components/backlogs/StoryModal.vue index d0fcd33..e8d549e 100644 --- a/app/javascript/components/backlogs/StoryModal.vue +++ b/app/javascript/components/backlogs/StoryModal.vue @@ -4,13 +4,20 @@ modal-class="rb-modal" size="lg" ref="modal" - :visible='visible' @shown="onShow" @hidden="onHide" hide-header hide-footer no-fade> -
+
+ +
{{ this.message.body }} @@ -162,7 +169,6 @@ \ No newline at end of file diff --git a/app/javascript/components/kanban/TaskModal.vue b/app/javascript/components/kanban/TaskModal.vue index 78251f9..6f079e8 100644 --- a/app/javascript/components/kanban/TaskModal.vue +++ b/app/javascript/components/kanban/TaskModal.vue @@ -10,7 +10,15 @@ hide-header hide-footer no-fade> -
+
+ +
@@ -155,7 +163,6 @@