From 1bd9788ca252d4d174cf83e181374f34e0b53a39 Mon Sep 17 00:00:00 2001 From: Kshitij Tandon Date: Wed, 28 Aug 2024 18:28:17 +0530 Subject: [PATCH] Resolved a failing UT Signed-off-by: Kshitij Tandon --- .../TemplateDetail/TemplateDetail.tsx | 62 ++++++------------- 1 file changed, 20 insertions(+), 42 deletions(-) diff --git a/public/pages/CreateIndexTemplate/containers/TemplateDetail/TemplateDetail.tsx b/public/pages/CreateIndexTemplate/containers/TemplateDetail/TemplateDetail.tsx index d1fa881b7..fae9173bb 100644 --- a/public/pages/CreateIndexTemplate/containers/TemplateDetail/TemplateDetail.tsx +++ b/public/pages/CreateIndexTemplate/containers/TemplateDetail/TemplateDetail.tsx @@ -46,7 +46,6 @@ import UnsavedChangesBottomBar from "../../../../components/UnsavedChangesBottom import { IndexForm } from "../../../../containers/IndexForm"; import { TABS_ENUM, tabs } from "../../constant"; import { getApplication, getNavigationUI, getUISettings } from "../../../../services/Services"; -import { TopNavControlDescriptionData, TopNavControlLinkData } from "src/plugins/navigation/public"; export interface TemplateDetailProps { templateName?: string; @@ -201,17 +200,15 @@ const TemplateDetail = (props: TemplateDetailProps, ref: Ref) => const descriptionData = [ { - description: "Define an automated snapshot schedule and retention period with a snapshot policy.", - links: { - label: "Learn more", - href: coreServices.docLinks.links.opensearch.indexTemplates.base, - iconType: "popout", - iconSide: "right", - controlType: "link", - target: "_blank", - flush: "both", - } as TopNavControlLinkData, - } as TopNavControlDescriptionData, + renderComponent: ( + + Define an automated snapshot schedule and retention period with a snapshot policy.{" "} + + Learn more + + + ), + }, ]; const HeaderRight = [ @@ -237,6 +234,7 @@ const TemplateDetail = (props: TemplateDetailProps, ref: Ref) => renderComponent: ( { const showValue: TemplateItemRemote = { ...values, @@ -250,13 +248,9 @@ const TemplateDetail = (props: TemplateDetailProps, ref: Ref) => width: 800, }, "data-test-subj": "templateJSONDetailModal", - title: ( - -

{values.name}

-
- ), + title: values.name, content: ( - + {JSON.stringify(showValue, null, 2)} ), @@ -312,11 +306,7 @@ const TemplateDetail = (props: TemplateDetailProps, ref: Ref) => width: 800, }, "data-test-subj": "templateJSONDetailModal", - title: ( - -

{values.name}

-
- ), + title: values.name, content: ( {JSON.stringify(showValue, null, 2)} @@ -369,7 +359,7 @@ const TemplateDetail = (props: TemplateDetailProps, ref: Ref) => ) : null} {isEdit ? ( <> - + {tabs.map((item) => ( { @@ -400,19 +390,11 @@ const TemplateDetail = (props: TemplateDetailProps, ref: Ref) => ) : null} -

Preview template

- - ) : values._meta?.flow === FLOW_ENUM.COMPONENTS ? ( - -

Override template definition

-
- ) : ( - -

Template definition

-
- ) + isEdit && selectedTabId === TABS_ENUM.SUMMARY + ? "Preview template" + : values._meta?.flow === FLOW_ENUM.COMPONENTS + ? "Override template definition" + : "Template definition" } subTitleText={ (!isEdit || selectedTabId !== TABS_ENUM.SUMMARY) && values._meta?.flow === FLOW_ENUM.COMPONENTS @@ -442,11 +424,7 @@ const TemplateDetail = (props: TemplateDetailProps, ref: Ref) => }} maxWidth={false} onClose={() => setPreviewFlyoutVisible(false)} - title={ - -

Preview template

-
- } + title="Preview template" content={} /> ) : null}