|
28 | 28 | import SelectProjectModal from "../../portfolio/projects/SelectProjectModal"; |
29 | 29 | import permissionsMixin from "../../../mixins/permissionsMixin"; |
30 | 30 | import BToggleableDisplayButton from "../../components/BToggleableDisplayButton"; |
31 | | - import BValidatedInputGroupFormInput from "../../../forms/BValidatedInputGroupFormInput"; |
32 | 31 | import BInputGroupFormInput from "../../../forms/BInputGroupFormInput"; |
| 32 | + import { Switch as cSwitch } from '@coreui/vue'; |
33 | 33 |
|
34 | 34 | export default { |
35 | 35 | props: { |
|
87 | 87 | return xssFilters.inHTMLData(common.valueWithDefault(value, "")); |
88 | 88 | } |
89 | 89 | }, |
| 90 | + { |
| 91 | + title: this.$t('admin.enabled'), |
| 92 | + field: 'enabled', |
| 93 | + sortable: false, |
| 94 | + align: 'center', |
| 95 | + formatter: function (value, row, index) { |
| 96 | + return value === true ? '<i class="fa fa-check-square-o" />' : ""; |
| 97 | + }, |
| 98 | + }, |
90 | 99 | ], |
91 | 100 | data: [], |
92 | 101 | options: { |
|
114 | 123 | <b-input-group-form-input id="input-name" :label="$t('message.name')" input-group-size="mb-3" |
115 | 124 | required="true" type="text" v-model="name" lazy="true" |
116 | 125 | v-debounce:750ms="updateNotificationRule" :debounce-events="'keyup'" /> |
| 126 | + <b-form-group> |
| 127 | + <c-switch id="notificationEnabled" color="primary" v-model="enabled" label v-bind="labelIcon"/> |
| 128 | + {{ $t('admin.enabled') }} |
| 129 | + </b-form-group> |
117 | 130 | <b-form-group id="fieldset-2" :label="this.$t('admin.publisher_class')" label-for="input-2"> |
118 | 131 | <b-form-input id="input-2" v-model="publisherClass" disabled class="form-control disabled" readonly trim /> |
119 | 132 | </b-form-group> |
|
174 | 187 | ActionableListGroupItem, |
175 | 188 | SelectProjectModal, |
176 | 189 | BToggleableDisplayButton, |
177 | | - BInputGroupFormInput |
| 190 | + BInputGroupFormInput, |
| 191 | + cSwitch |
178 | 192 | }, |
179 | 193 | data() { |
180 | 194 | return { |
181 | 195 | alert: row, |
182 | 196 | uuid: row.uuid, |
183 | 197 | name: row.name, |
| 198 | + enabled: row.enabled, |
184 | 199 | publisherClass: row.publisher.publisherClass, |
185 | 200 | notificationLevel: row.notificationLevel, |
186 | 201 | destination: this.parseDestination(row), |
187 | 202 | scope: row.scope, |
188 | 203 | notifyOn: row.notifyOn, |
189 | 204 | projects: row.projects, |
190 | | - limitToVisible: false |
| 205 | + limitToVisible: false, |
| 206 | + labelIcon: { |
| 207 | + dataOn: '\u2713', |
| 208 | + dataOff: '\u2715' |
| 209 | + }, |
191 | 210 | } |
192 | 211 | }, |
193 | 212 | created() { |
194 | 213 | this.parseDestination(this.alert); |
195 | 214 | }, |
196 | 215 | watch: { |
| 216 | + enabled() { |
| 217 | + this.updateNotificationRule(); |
| 218 | + }, |
197 | 219 | notifyOn() { |
198 | 220 | this.updateNotificationRule(); |
199 | 221 | } |
|
220 | 242 | this.axios.post(url, { |
221 | 243 | uuid: this.uuid, |
222 | 244 | name: this.name, |
| 245 | + enabled: this.enabled, |
223 | 246 | notificationLevel: this.notificationLevel, |
224 | 247 | publisherConfig: JSON.stringify({ destination: this.destination }), |
225 | 248 | notifyOn: this.notifyOn |
|
0 commit comments