diff --git a/frontend/package.json b/frontend/package.json
index d2a55c8..b02b3b0 100644
--- a/frontend/package.json
+++ b/frontend/package.json
@@ -17,6 +17,7 @@
"vue-awesome": "^2.3.4",
"vue-multilanguage": "^3.0.5",
"vue-multiselect": "^2.0.6",
+ "vue-notification": "^1.3.4",
"vue-paginate": "^3.5.1",
"vue-resource": "^1.3.4",
"vue-router": "^3.0.1"
diff --git a/frontend/src/App.vue b/frontend/src/App.vue
index 7426bd7..e6fc6d3 100644
--- a/frontend/src/App.vue
+++ b/frontend/src/App.vue
@@ -20,6 +20,7 @@
+
diff --git a/frontend/src/components/AuthorOverview.vue b/frontend/src/components/AuthorOverview.vue
index fb684fd..5684d04 100644
--- a/frontend/src/components/AuthorOverview.vue
+++ b/frontend/src/components/AuthorOverview.vue
@@ -7,15 +7,7 @@
-
-
- {{ error.message }}
-
- {{ error.response.data.Message }}
-
-
-
-
+
@@ -46,8 +38,6 @@
return {
user: auth.user,
author: {},
- error: '',
- success: '',
authorID: this.$route.params.id
}
},
@@ -69,7 +59,18 @@
})
.catch(e => {
this.loading = false
- this.error = e
+ // Build the notification text from error response
+ let err = e.message
+ if (e.response.data) {
+ err += '
' + e.response.data.Message
+ }
+
+ // Fire a notification
+ this.$notify({
+ type: 'error',
+ title: this.langGeneral.error,
+ text: err
+ })
})
}
}
diff --git a/frontend/src/components/Authors.vue b/frontend/src/components/Authors.vue
index c284aad..8be307f 100644
--- a/frontend/src/components/Authors.vue
+++ b/frontend/src/components/Authors.vue
@@ -7,20 +7,7 @@
-
-
- {{ error.message }}
-
- {{ error.response.data.Message }}
-
-
-
-
-
- {{ success }}
-
-
-
+
@@ -106,8 +93,6 @@ export default {
],
loading: false,
paginate: ['authors'],
- error: '',
- success: '',
allStatus: [],
showModal: false
}
@@ -144,6 +129,20 @@ export default {
}
},
methods: {
+ errorNotification (e) {
+ // Build the notification text from error response
+ let err = e.message
+ if (e.response.data) {
+ err += '
' + e.response.data.Message
+ }
+
+ // Fire a notification
+ this.$notify({
+ type: 'error',
+ title: this.langGeneral.error,
+ text: err
+ })
+ },
loadAuthors () {
this.loading = true
this.authors = []
@@ -162,11 +161,12 @@ export default {
// increment dat shit
i++
}
+
this.loading = false
})
.catch(e => {
this.loading = false
- this.error = e
+ this.errorNotification(e)
})
},
gridBtnClicked (opt, gridObject) {
@@ -180,14 +180,19 @@ export default {
this.$on('delete-submit', function () {
HTTP.delete('authors/' + obj.ID.content)
.then(response => {
- console.log(response)
if (response.status === 200 && response.data.Message === 'success') {
- this.success = this.translate('authors').deleteSuccess
+ // Fire a notification
+ this.$notify({
+ type: 'success',
+ title: this.langGeneral.success,
+ text: this.translate('authors').deleteSuccess
+ })
this.loadAuthors()
}
})
.catch(e => {
- this.error = e
+ this.errorNotification(e)
+ this.loadAuthors()
})
this.showModal = false
})
diff --git a/frontend/src/components/AuthorsAddEdit.vue b/frontend/src/components/AuthorsAddEdit.vue
index 1259ee6..a1ce65e 100644
--- a/frontend/src/components/AuthorsAddEdit.vue
+++ b/frontend/src/components/AuthorsAddEdit.vue
@@ -1,13 +1,5 @@
-
-
- {{ error.message }}
-
-
{{ error.response.data.Message }}
-
-
-
{{ success }}
@@ -31,12 +23,12 @@