Add the ability to select a template when adding an incident.
This commit is contained in:
@@ -17,6 +17,7 @@ use CachetHQ\Cachet\Bus\Commands\IncidentUpdate\UpdateIncidentUpdateCommand;
|
|||||||
use CachetHQ\Cachet\Integrations\Contracts\System;
|
use CachetHQ\Cachet\Integrations\Contracts\System;
|
||||||
use CachetHQ\Cachet\Models\Incident;
|
use CachetHQ\Cachet\Models\Incident;
|
||||||
use CachetHQ\Cachet\Models\IncidentUpdate;
|
use CachetHQ\Cachet\Models\IncidentUpdate;
|
||||||
|
use CachetHQ\Cachet\Models\IncidentTemplate;
|
||||||
use GrahamCampbell\Binput\Facades\Binput;
|
use GrahamCampbell\Binput\Facades\Binput;
|
||||||
use Illuminate\Contracts\Auth\Guard;
|
use Illuminate\Contracts\Auth\Guard;
|
||||||
use Illuminate\Routing\Controller;
|
use Illuminate\Routing\Controller;
|
||||||
@@ -88,6 +89,7 @@ class IncidentUpdateController extends Controller
|
|||||||
{
|
{
|
||||||
return View::make('dashboard.incidents.updates.add')
|
return View::make('dashboard.incidents.updates.add')
|
||||||
->withIncident($incident)
|
->withIncident($incident)
|
||||||
|
->withIncidentTemplates(IncidentTemplate::all())
|
||||||
->withNotificationsEnabled($this->system->canNotifySubscribers());
|
->withNotificationsEnabled($this->system->canNotifySubscribers());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+28
-28
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
@@ -1,8 +1,8 @@
|
|||||||
{
|
{
|
||||||
"/dist/js/vendor.js": "/dist/js/vendor.js?id=313e4cd2cf600307cb5c",
|
"/dist/js/vendor.js": "/dist/js/vendor.js?id=313e4cd2cf600307cb5c",
|
||||||
"/dist/js/app.js": "/dist/js/app.js?id=be35dd18d92eef9dee9f",
|
"/dist/js/app.js": "/dist/js/app.js?id=04c40dcd7fc0f91a2cc1",
|
||||||
"/dist/css/dashboard/dashboard.css": "/dist/css/dashboard/dashboard.css?id=654823be1de9b1245f17",
|
"/dist/css/dashboard/dashboard.css": "/dist/css/dashboard/dashboard.css?id=2e8a315f9f8f01a60080",
|
||||||
"/dist/css/app.css": "/dist/css/app.css?id=1b9032e972af93e2c869",
|
"/dist/css/app.css": "/dist/css/app.css?id=bb04d4c61e5b5d02a938",
|
||||||
"/dist/js/manifest.js": "/dist/js/manifest.js?id=40dcfff9d09d402daf38",
|
"/dist/js/manifest.js": "/dist/js/manifest.js?id=40dcfff9d09d402daf38",
|
||||||
"/dist/js/all.js": "/dist/js/all.js?id=c77bbe3fb26a84b5347d"
|
"/dist/js/all.js": "/dist/js/all.js?id=eb6400680943aee8df85"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -186,7 +186,7 @@ $(function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Incident management
|
// Incident management
|
||||||
/*$('select[name=template]').on('change', function () {
|
$('select[name=template]').on('change', function () {
|
||||||
var $this = $(this).find('option:selected'),
|
var $this = $(this).find('option:selected'),
|
||||||
slug = $this.val();
|
slug = $this.val();
|
||||||
|
|
||||||
@@ -208,7 +208,7 @@ $(function () {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});*/
|
});
|
||||||
|
|
||||||
// Banner removal JS
|
// Banner removal JS
|
||||||
$('#remove-banner').on('click', function (){
|
$('#remove-banner').on('click', function (){
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
const Vue = require('vue');
|
const Vue = require('vue');
|
||||||
|
|
||||||
Vue.component('report-incident', require('./ReportIncident'));
|
Vue.component('report-incident', require('./ReportIncident'));
|
||||||
|
Vue.component('update-incident', require('./UpdateIncident'));
|
||||||
Vue.component('report-schedule', require('./ReportSchedule'));
|
Vue.component('report-schedule', require('./ReportSchedule'));
|
||||||
Vue.component('invite-team', require('./InviteTeam'));
|
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>
|
||||||
@@ -19,9 +19,21 @@
|
|||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
@include('partials.errors')
|
@include('partials.errors')
|
||||||
|
<update-incident inline-template>
|
||||||
<form class="form-vertical" name="IncidentUpdateForm" role="form" method="POST" autocomplete="off">
|
<form class="form-vertical" name="IncidentUpdateForm" role="form" method="POST" autocomplete="off">
|
||||||
<input type="hidden" name="_token" value="{{ csrf_token() }}">
|
<input type="hidden" name="_token" value="{{ csrf_token() }}">
|
||||||
<fieldset>
|
<fieldset>
|
||||||
|
@if($incidentTemplates->count() > 0)
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="incident-template">{{ trans('forms.incidents.templates.template') }}</label>
|
||||||
|
<select class="form-control" name="template" v-model="template">
|
||||||
|
<option selected></option>
|
||||||
|
@foreach($incidentTemplates as $tpl)
|
||||||
|
<option value="{{ $tpl->slug }}">{{ $tpl->name }}</option>
|
||||||
|
@endforeach
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="incident-name">{{ trans('forms.incidents.status') }}</label><br>
|
<label for="incident-name">{{ trans('forms.incidents.status') }}</label><br>
|
||||||
<label class="radio-inline">
|
<label class="radio-inline">
|
||||||
@@ -100,6 +112,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
</update-incident>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user