From b328720c11811d45da9d0594c5c28a18dd8fa2d0 Mon Sep 17 00:00:00 2001 From: Mahima Arora <40266973+Mahima081@users.noreply.github.com> Date: Sat, 29 Jun 2024 02:08:50 +0530 Subject: [PATCH] [BUG-Fixed] #1466 - create observability dashboard after creating with Invalid name (#1730) ### Fix for [BUG] Cannot create observability dashboard after creating with invalid name #1466 - https://github.com/opensearch-project/dashboards-observability/issues/1466 ### Description Cannot create Observability Dashboards after creating with an Invalid Name ### Issues Resolved Dialog asking user to input Dashboard Name even if invalid Dashboard name is entered ### Check List - [x] New functionality includes testing. - [x] All tests pass, including unit test, integration test and doctest - [ ] New functionality has been documented. - [ ] New functionality has javadoc added - [ ] New functionality has user manual doc added - [x] Commits are signed per the DCO using --signoff By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. For more information on following Developer Certificate of Origin and signing off your commits, please check [here](https://github.com/opensearch-project/OpenSearch/blob/main/CONTRIBUTING.md#developer-certificate-of-origin). Signed-off-by: Mahima Arora <40266973+Mahima081@users.noreply.github.com> --- public/components/custom_panels/custom_panel_table.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/public/components/custom_panels/custom_panel_table.tsx b/public/components/custom_panels/custom_panel_table.tsx index 76dd46d9e0..8c4a3a2a5e 100644 --- a/public/components/custom_panels/custom_panel_table.tsx +++ b/public/components/custom_panels/custom_panel_table.tsx @@ -122,7 +122,8 @@ export const CustomPanelTable = ({ const onCreate = async (newCustomPanelName: string) => { if (!isNameValid(newCustomPanelName)) { - setToast('Invalid Dashboard name', 'danger'); + setToast('Invalid Dashboard Name', 'danger'); + history.goBack(); } else { const newPanel = newPanelTemplate(newCustomPanelName); dispatch(createPanel(newPanel)); @@ -132,7 +133,7 @@ export const CustomPanelTable = ({ const onRename = async (newCustomPanelName: string) => { if (!isNameValid(newCustomPanelName)) { - setToast('Invalid Dashboard name', 'danger'); + setToast('Invalid Dashboard Name', 'danger'); } else { dispatch(renameCustomPanel(newCustomPanelName, selectedCustomPanels[0].id)); } @@ -141,7 +142,7 @@ export const CustomPanelTable = ({ const onClone = async (newName: string) => { if (!isNameValid(newName)) { - setToast('Invalid Operational Panel name', 'danger'); + setToast('Invalid Operational Panel Name', 'danger'); } else { let sourcePanel = selectedCustomPanels[0]; try {