Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions src/components/dialogs/add/NotificationChannelAdd.vue
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,10 @@
/>
</v-col>
<v-col cols="3" class="pb-0" style="position: relative; top: 11px" align-self="center">
<g-checkbox v-model="editedItem.verify" :label="t('Verify')" />
<g-checkbox v-model="verify" :label="t('Verify')" :true-value="null" false-value="false" />
</v-col>
<v-col cols="12" v-if="verify === null">
<g-text-field v-model="verifyText" show-header :label="t('CAPath')" :hint="t('CAPathInfo')" />
</v-col>
</v-row>
</v-card-text>
Expand Down Expand Up @@ -162,6 +165,16 @@ const labels = {
my_link: {token: t('ClientSecret'), sid: t('ClientID')}
}

const verify = computed<'false' | null>({
get: () => (editedItem.value.verify?.toLowerCase() === 'false' ? 'false' : null),
set: val => (editedItem.value.verify = val)
})

const verifyText = computed({
get: () => (editedItem.value.verify?.toLowerCase() === 'false' ? null : editedItem.value.verify),
set: (val: string) => (editedItem.value.verify = val === '' ? null : val)
})

const edit = ref(false)
const showPlatformId = ref(false)

Expand Down Expand Up @@ -207,10 +220,11 @@ watch(dialog, val => {

async function save() {
if (edit.value) {
const {id, ...update} = editedItem.value
await store.dispatch('notificationChannels/updateNotificationChannel', [
editedItem.value.id,
id,
{
...editedItem.value
...update
}
])
} else {
Expand Down
4 changes: 3 additions & 1 deletion src/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,9 @@ export const en = {
NotificationKeyGenerate: 'Genereates New Encryption Key And Copies It To Clipboard',
NotificationKey: 'Set NOTIFICATION_KEY="{New Key}" In Config To Use Generated Key',
Verify: 'Verify',
VerifyInfo: 'Verify SSL certificates of host. True/False',
CAPath: 'CA Bundle Path',
CAPathInfo: 'Path to a CA bundle on the Alerta server. Leave empty to use the default.',
VerifyInfo: 'Verify SSL certificates of host',
Host: 'Host',
HostInfo: 'Url for sms/email provider',
NotificationChannels: 'Notification Channels',
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/store/types/notificationChannel-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export type NotificationChannel = {
platformId?: string
sender: string
type: NotificationChannelType
verify: boolean | null
verify: string | null
}

export type Filter = {
Expand Down Expand Up @@ -68,7 +68,7 @@ export type Actions = {
createNotificationChannel({dispatch}: AugmentedActionContext, notificationChannel: NotificationChannel): void
updateNotificationChannel(
{dispatch}: AugmentedActionContext,
[notificationChannelId, update]: [string, NotificationChannel]
[notificationChannelId, update]: [string, Omit<NotificationChannel, 'id'>]
): void
deleteNotificationChannel({dispatch}: AugmentedActionContext, notificationChannelId: NotificationChannel['id']): void
setPagination({commit}: AugmentedActionContext, pagination: Pagination): void
Expand Down
Loading