diff --git a/web/src/components/alerts/ImportAlert.vue b/web/src/components/alerts/ImportAlert.vue index 6bae0eebb2..7b93b63511 100644 --- a/web/src/components/alerts/ImportAlert.vue +++ b/web/src/components/alerts/ImportAlert.vue @@ -397,6 +397,39 @@ along with this program. If not, see . /> + + {{ errorMessage.message }} +
+ + +
+
{{ errorMessage }} @@ -525,6 +558,17 @@ export default defineComponent({ const activeFolderId = ref(router.currentRoute.value.query.folder || router.currentRoute.value.query?.folderId); const activeFolderAlerts = ref([]); const isAlertImporting = ref(false); + const userSelectedOrgId = ref([]); + const organizationDataList = computed(() => { + return store.state.organizations.map((org: any) => { + return { + label: org.identifier, + value: org.identifier, + disable: !org.identifier || org.identifier !== store.state.selectedOrganization.identifier + }; + }); + }); + const getFormattedDestinations: any = computed(() => { return props.destinations.map((destination: any) => { return destination.name; @@ -768,7 +812,10 @@ export default defineComponent({ input.org_id != store.state.selectedOrganization.identifier ) { alertErrors.push( - `Alert - ${index}: Organization Id is mandatory, should exist in organization list and should be equal to ${store.state.selectedOrganization.identifier}.`, + { + message: `Alert - ${index}: Organization Id is mandatory, should exist in organization list and should be equal to ${store.state.selectedOrganization.identifier}.`, + field: "org_id", + } ); } @@ -1174,6 +1221,10 @@ export default defineComponent({ activeFolderAlerts.value = store.state.organizationData.allAlertsListByNames[folderId]; } + const updateOrgId = (orgId: string, index: number) => { + jsonArrayOfObj.value[index].org_id = orgId; + jsonStr.value = JSON.stringify(jsonArrayOfObj.value, null, 2); + } return { t, @@ -1222,6 +1273,9 @@ export default defineComponent({ activeFolderAlerts, store, isAlertImporting, + organizationDataList, + userSelectedOrgId, + updateOrgId, }; }, components: { diff --git a/web/src/components/alerts/ImportDestination.vue b/web/src/components/alerts/ImportDestination.vue index bf392255a1..cb42d00b8e 100644 --- a/web/src/components/alerts/ImportDestination.vue +++ b/web/src/components/alerts/ImportDestination.vue @@ -1007,9 +1007,10 @@ export default defineComponent({ // Check if 'name' is required for both webhook and email if (!input.name || typeof input.name !== "string") { - destinationErrors.push( - `Destination - ${index} 'name' is required and should be a string`, - ); + destinationErrors.push({ + message: `Destination - ${index} 'name' is required and should be a string`, + field: "destination_name", + }); } if (input.type === "action" && !isActionsEnabled.value) {