Skip to content

Commit

Permalink
revert change to shared UX markdown component for dashboard vis (elas…
Browse files Browse the repository at this point in the history
…tic#180906)

## Summary

This PR reverts the change to the shared UX markdown component that
happened here elastic#176478. The
aforementioned PR introduced couple of visual issues that were uncaught
during the migration.

The known issues that have been brought up that informed the decision to
revert this change, are itemised below;

- elastic#180576
- elastic#180452
- elastic/sdh-kibana#4608

### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

### For maintainers

- [x] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: kibanamachine <[email protected]>
(cherry picked from commit 4127163)
  • Loading branch information
eokoneyo committed Apr 18, 2024
1 parent c1513cd commit 9d5d69c
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
1 change: 1 addition & 0 deletions src/plugins/vis_type_markdown/kibana.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
],
"requiredBundles": [
"expressions",
"kibanaReact",
"visDefaultEditor",
"visualizations"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ describe('markdown vis controller', () => {

expect(getByText('markdown')).toMatchInlineSnapshot(`
<a
class="euiLink emotion-euiLink-primary"
href="http://daringfireball.net/projects/markdown"
rel="noreferrer"
>
markdown
</a>
Expand All @@ -55,8 +53,7 @@ describe('markdown vis controller', () => {

expect(getByText(/testing/i)).toMatchInlineSnapshot(`
<p>
Testing
html
Testing &lt;a&gt;html&lt;/a&gt;
</p>
`);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -29,8 +29,7 @@ const MarkdownVisComponent = ({
<Markdown
data-test-subj="markdownBody"
openLinksInNewTab={openLinksInNewTab}
markdownContent={markdown || ` `}
readOnly
markdown={markdown}
/>
</div>
);
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/vis_type_markdown/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@kbn/i18n",
"@kbn/i18n-react",
"@kbn/config-schema",
"@kbn/shared-ux-markdown",
"@kbn/kibana-react-plugin",
],
"exclude": [
"target/**/*",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<h3>Inline HTML that should not be rendered as html</h3>'
);
});

it('should auto apply changes if auto mode is turned on', async function () {
Expand Down

0 comments on commit 9d5d69c

Please sign in to comment.