Skip to content

Commit

Permalink
[8.13] revert change to shared UX markdown component for dashboard vis (
Browse files Browse the repository at this point in the history
#180906) (#181517)

# Backport

This will backport the following commits from `main` to `8.13`:
- [revert change to shared UX markdown component for dashboard vis
(#180906)](#180906)

<!--- Backport version: 8.9.8 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Eyo O.
Eyo","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-04-18T12:01:18Z","message":"revert
change to shared UX markdown component for dashboard vis (#180906)\n\n##
Summary\r\n\r\nThis PR reverts the change to the shared UX markdown
component that\r\nhappened here
#176478. The\r\naforementioned PR
introduced couple of visual issues that were uncaught\r\nduring the
migration.\r\n\r\nThe known issues that have been brought up that
informed the decision to\r\nrevert this change, are itemised
below;\r\n\r\n- https://github.com/elastic/kibana/issues/180576\r\n-
https://github.com/elastic/kibana/issues/180452\r\n-
https://github.com/elastic/sdh-kibana/issues/4608\r\n\r\n\r\n###
Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n\r\n\r\n### For
maintainers\r\n\r\n- [x] This was checked for breaking API changes and
was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<[email protected]>","sha":"4127163bd913dccfbd17badbb9ce1a7a5b2afadc","branchLabelMapping":{"^v8.15.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:SharedUX","backport:all-open","v8.14.0","v8.15.0"],"number":180906,"url":"https://github.com/elastic/kibana/pull/180906","mergeCommit":{"message":"revert
change to shared UX markdown component for dashboard vis (#180906)\n\n##
Summary\r\n\r\nThis PR reverts the change to the shared UX markdown
component that\r\nhappened here
#176478. The\r\naforementioned PR
introduced couple of visual issues that were uncaught\r\nduring the
migration.\r\n\r\nThe known issues that have been brought up that
informed the decision to\r\nrevert this change, are itemised
below;\r\n\r\n- https://github.com/elastic/kibana/issues/180576\r\n-
https://github.com/elastic/kibana/issues/180452\r\n-
https://github.com/elastic/sdh-kibana/issues/4608\r\n\r\n\r\n###
Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n\r\n\r\n### For
maintainers\r\n\r\n- [x] This was checked for breaking API changes and
was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<[email protected]>","sha":"4127163bd913dccfbd17badbb9ce1a7a5b2afadc"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"8.14","label":"v8.14.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/181140","number":181140,"state":"MERGED","mergeCommit":{"sha":"f799e4fc253831332008fa7b06dc7c8d9c0d8c2a","message":"[8.14]
revert change to shared UX markdown component for dashboard vis
(#180906) (#181140)\n\n# Backport\n\nThis will backport the following
commits from `main` to `8.14`:\n- [revert change to shared UX markdown
component for dashboard
vis\n(#180906)](https://github.com/elastic/kibana/pull/180906)\n\n<!---
Backport version: 9.4.3 -->\n\n### Questions ?\nPlease refer to the
[Backport
tool\ndocumentation](https://github.com/sqren/backport)\n\n<!--BACKPORT
[{\"author\":{\"name\":\"Eyo
O.\nEyo\",\"email\":\"[email protected]\"},\"sourceCommit\":{\"committedDate\":\"2024-04-18T12:01:18Z\",\"message\":\"revert\nchange
to shared UX markdown component for dashboard vis
(#180906)\\n\\n##\nSummary\\r\\n\\r\\nThis PR reverts the change to the
shared UX markdown\ncomponent that\\r\\nhappened
here\nhttps://github.com//pull/176478.
The\\r\\naforementioned PR\nintroduced couple of visual issues that were
uncaught\\r\\nduring the\nmigration.\\r\\n\\r\\nThe known issues that
have been brought up that\ninformed the decision to\\r\\nrevert this
change, are itemised\nbelow;\\r\\n\\r\\n-
https://github.com/elastic/kibana/issues/180576\\r\\n-\nhttps://github.com/elastic/kibana/issues/180452\\r\\n-\nhttps://github.com/elastic/sdh-kibana/issues/4608\\r\\n\\r\\n\\r\\n###\nChecklist\\r\\n\\r\\n-
[x] [Unit
or\nfunctional\\r\\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\\r\\nwere\nupdated
or added to match the most common scenarios\\r\\n\\r\\n\\r\\n###
For\nmaintainers\\r\\n\\r\\n- [x] This was checked for breaking API
changes
and\nwas\n[labeled\\r\\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\\r\\n\\r\\n---------\\r\\n\\r\\nCo-authored-by:\nkibanamachine\n<[email protected]>\",\"sha\":\"4127163bd913dccfbd17badbb9ce1a7a5b2afadc\",\"branchLabelMapping\":{\"^v8.15.0$\":\"main\",\"^v(\\\\d+).(\\\\d+).\\\\d+$\":\"$1.$2\"}},\"sourcePullRequest\":{\"labels\":[\"release_note:fix\",\"Team:SharedUX\",\"backport:all-open\",\"v8.14.0\",\"v8.15.0\"],\"title\":\"revert\nchange
to shared UX markdown component for
dashboard\nvis\",\"number\":180906,\"url\":\"https://github.com/elastic/kibana/pull/180906\",\"mergeCommit\":{\"message\":\"revert\nchange
to shared UX markdown component for dashboard vis
(#180906)\\n\\n##\nSummary\\r\\n\\r\\nThis PR reverts the change to the
shared UX markdown\ncomponent that\\r\\nhappened
here\nhttps://github.com//pull/176478.
The\\r\\naforementioned PR\nintroduced couple of visual issues that were
uncaught\\r\\nduring the\nmigration.\\r\\n\\r\\nThe known issues that
have been brought up that\ninformed the decision to\\r\\nrevert this
change, are itemised\nbelow;\\r\\n\\r\\n-
https://github.com/elastic/kibana/issues/180576\\r\\n-\nhttps://github.com/elastic/kibana/issues/180452\\r\\n-\nhttps://github.com/elastic/sdh-kibana/issues/4608\\r\\n\\r\\n\\r\\n###\nChecklist\\r\\n\\r\\n-
[x] [Unit
or\nfunctional\\r\\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\\r\\nwere\nupdated
or added to match the most common scenarios\\r\\n\\r\\n\\r\\n###
For\nmaintainers\\r\\n\\r\\n- [x] This was checked for breaking API
changes
and\nwas\n[labeled\\r\\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\\r\\n\\r\\n---------\\r\\n\\r\\nCo-authored-by:\nkibanamachine\n<[email protected]>\",\"sha\":\"4127163bd913dccfbd17badbb9ce1a7a5b2afadc\"}},\"sourceBranch\":\"main\",\"suggestedTargetBranches\":[\"8.14\"],\"targetPullRequestStates\":[{\"branch\":\"8.14\",\"label\":\"v8.14.0\",\"branchLabelMappingKey\":\"^v(\\\\d+).(\\\\d+).\\\\d+$\",\"isSourceBranch\":false,\"state\":\"NOT_CREATED\"},{\"branch\":\"main\",\"label\":\"v8.15.0\",\"branchLabelMappingKey\":\"^v8.15.0$\",\"isSourceBranch\":true,\"state\":\"MERGED\",\"url\":\"https://github.com/elastic/kibana/pull/180906\",\"number\":180906,\"mergeCommit\":{\"message\":\"revert\nchange
to shared UX markdown component for dashboard vis
(#180906)\\n\\n##\nSummary\\r\\n\\r\\nThis PR reverts the change to the
shared UX markdown\ncomponent that\\r\\nhappened
here\nhttps://github.com//pull/176478.
The\\r\\naforementioned PR\nintroduced couple of visual issues that were
uncaught\\r\\nduring the\nmigration.\\r\\n\\r\\nThe known issues that
have been brought up that\ninformed the decision to\\r\\nrevert this
change, are itemised\nbelow;\\r\\n\\r\\n-
https://github.com/elastic/kibana/issues/180576\\r\\n-\nhttps://github.com/elastic/kibana/issues/180452\\r\\n-\nhttps://github.com/elastic/sdh-kibana/issues/4608\\r\\n\\r\\n\\r\\n###\nChecklist\\r\\n\\r\\n-
[x] [Unit
or\nfunctional\\r\\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\\r\\nwere\nupdated
or added to match the most common scenarios\\r\\n\\r\\n\\r\\n###
For\nmaintainers\\r\\n\\r\\n- [x] This was checked for breaking API
changes
and\nwas\n[labeled\\r\\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\\r\\n\\r\\n---------\\r\\n\\r\\nCo-authored-by:\nkibanamachine\n<[email protected]>\",\"sha\":\"4127163bd913dccfbd17badbb9ce1a7a5b2afadc\"}}]}]\nBACKPORT-->\n\nCo-authored-by:
Eyo O. Eyo
<[email protected]>"}},{"branch":"main","label":"v8.15.0","labelRegex":"^v8.15.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/180906","number":180906,"mergeCommit":{"message":"revert
change to shared UX markdown component for dashboard vis (#180906)\n\n##
Summary\r\n\r\nThis PR reverts the change to the shared UX markdown
component that\r\nhappened here
#176478. The\r\naforementioned PR
introduced couple of visual issues that were uncaught\r\nduring the
migration.\r\n\r\nThe known issues that have been brought up that
informed the decision to\r\nrevert this change, are itemised
below;\r\n\r\n- https://github.com/elastic/kibana/issues/180576\r\n-
https://github.com/elastic/kibana/issues/180452\r\n-
https://github.com/elastic/sdh-kibana/issues/4608\r\n\r\n\r\n###
Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n\r\n\r\n### For
maintainers\r\n\r\n- [x] This was checked for breaking API changes and
was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<[email protected]>","sha":"4127163bd913dccfbd17badbb9ce1a7a5b2afadc"}}]}]
BACKPORT-->
  • Loading branch information
eokoneyo authored Apr 24, 2024
1 parent 30470cf commit 7a1f691
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 7a1f691

Please sign in to comment.