Add the ability to select a template when adding an incident.
This commit is contained in:
@@ -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>
|
||||
Reference in New Issue
Block a user