Add the ability to select a template when adding an incident.

This commit is contained in:
Data-Kiss
2019-10-09 19:56:14 +01:00
parent 212d807653
commit 4b5ee6668f
11 changed files with 154 additions and 108 deletions
+2 -2
View File
@@ -186,7 +186,7 @@ $(function () {
});
// Incident management
/*$('select[name=template]').on('change', function () {
$('select[name=template]').on('change', function () {
var $this = $(this).find('option:selected'),
slug = $this.val();
@@ -208,7 +208,7 @@ $(function () {
}
});
}
});*/
});
// Banner removal JS
$('#remove-banner').on('click', function (){
@@ -2,6 +2,7 @@
const Vue = require('vue');
Vue.component('report-incident', require('./ReportIncident'));
Vue.component('update-incident', require('./UpdateIncident'));
Vue.component('report-schedule', require('./ReportSchedule'));
Vue.component('invite-team', require('./InviteTeam'));
@@ -0,0 +1,30 @@
<script>
module.exports = {
data () {
return {
template: null,
status: null,
message: '',
}
},
methods: {
getTemplate (template) {
axios.get('/dashboard/api/incidents/templates', {
params: {
slug: template
}
}).then(response => {
this.name = response.data.name
this.message = response.data.template
}).catch(response => {
(new Cachet.Notifier()).notify('There was an error finding that template.');
})
}
},
watch: {
'template' (template) {
this.getTemplate(template)
}
}
}
</script>