From 632095ca2052eab5863f958fba232a6d23cc7c09 Mon Sep 17 00:00:00 2001 From: Eyo Okon Eyo Date: Tue, 16 Apr 2024 12:24:34 +0100 Subject: [PATCH 1/2] revert change to shared UX markdown component for dashboard vis --- src/plugins/vis_type_markdown/kibana.jsonc | 1 + .../public/markdown_vis_controller.test.tsx | 5 +---- .../vis_type_markdown/public/markdown_vis_controller.tsx | 5 ++--- .../apps/dashboard_elements/markdown/_markdown_vis.ts | 7 +++++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/plugins/vis_type_markdown/kibana.jsonc b/src/plugins/vis_type_markdown/kibana.jsonc index d3d1d3bd9f29b..476dcc0605ad4 100644 --- a/src/plugins/vis_type_markdown/kibana.jsonc +++ b/src/plugins/vis_type_markdown/kibana.jsonc @@ -13,6 +13,7 @@ ], "requiredBundles": [ "expressions", + "kibanaReact", "visDefaultEditor", "visualizations" ] diff --git a/src/plugins/vis_type_markdown/public/markdown_vis_controller.test.tsx b/src/plugins/vis_type_markdown/public/markdown_vis_controller.test.tsx index 04f86e815e841..963f3b0ecbbb2 100644 --- a/src/plugins/vis_type_markdown/public/markdown_vis_controller.test.tsx +++ b/src/plugins/vis_type_markdown/public/markdown_vis_controller.test.tsx @@ -29,9 +29,7 @@ describe('markdown vis controller', () => { expect(getByText('markdown')).toMatchInlineSnapshot(` markdown @@ -55,8 +53,7 @@ describe('markdown vis controller', () => { expect(getByText(/testing/i)).toMatchInlineSnapshot(`

- Testing - html + Testing <a>html</a>

`); }); diff --git a/src/plugins/vis_type_markdown/public/markdown_vis_controller.tsx b/src/plugins/vis_type_markdown/public/markdown_vis_controller.tsx index 7c0b44d24860d..d941adf573591 100644 --- a/src/plugins/vis_type_markdown/public/markdown_vis_controller.tsx +++ b/src/plugins/vis_type_markdown/public/markdown_vis_controller.tsx @@ -7,7 +7,7 @@ */ import React, { useEffect } from 'react'; -import { Markdown } from '@kbn/shared-ux-markdown'; +import { Markdown } from '@kbn/kibana-react-plugin/public'; import { MarkdownVisParams } from './types'; import './markdown_vis.scss'; @@ -29,8 +29,7 @@ const MarkdownVisComponent = ({ ); diff --git a/test/functional/apps/dashboard_elements/markdown/_markdown_vis.ts b/test/functional/apps/dashboard_elements/markdown/_markdown_vis.ts index d524fd23e0393..e440cdddc77c7 100644 --- a/test/functional/apps/dashboard_elements/markdown/_markdown_vis.ts +++ b/test/functional/apps/dashboard_elements/markdown/_markdown_vis.ts @@ -39,9 +39,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { expect(h1Txt).to.equal('Heading 1'); }); - it('should not render html in markdown', async function () { + it('should not render html in markdown as html', async function () { const actual = await PageObjects.visChart.getMarkdownText(); - expect(actual).to.equal('Heading 1'); + + expect(actual).to.equal( + 'Heading 1\n

Inline HTML that should not be rendered as html

' + ); }); it('should auto apply changes if auto mode is turned on', async function () { From e4a7c4e8532f711e02615eea2750108b92309773 Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Tue, 16 Apr 2024 16:01:11 +0000 Subject: [PATCH 2/2] [CI] Auto-commit changed files from 'node scripts/lint_ts_projects --fix' --- src/plugins/vis_type_markdown/tsconfig.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/vis_type_markdown/tsconfig.json b/src/plugins/vis_type_markdown/tsconfig.json index 833dc7404cc0f..5b9639787e12c 100644 --- a/src/plugins/vis_type_markdown/tsconfig.json +++ b/src/plugins/vis_type_markdown/tsconfig.json @@ -16,7 +16,7 @@ "@kbn/i18n", "@kbn/i18n-react", "@kbn/config-schema", - "@kbn/shared-ux-markdown", + "@kbn/kibana-react-plugin", ], "exclude": [ "target/**/*",