Skip to content

Commit bfa690c

Browse files
[Markdown] Replace custom css styles and native html with OUI. (#4390) (#4607)
* replace custom styling Signed-off-by: Sirazh Gabdullin <sirazh.gabdullin@nu.edu.kz> * update CHANGELOG Signed-off-by: Sirazh Gabdullin <sirazh.gabdullin@nu.edu.kz> * Update CHANGELOG.md Co-authored-by: Miki <amoo_miki@yahoo.com> Signed-off-by: Josh Romero <rmerqg@amazon.com> --------- Signed-off-by: Sirazh Gabdullin <sirazh.gabdullin@nu.edu.kz> Signed-off-by: Josh Romero <rmerqg@amazon.com> Co-authored-by: Josh Romero <rmerqg@amazon.com> Co-authored-by: Miki <amoo_miki@yahoo.com> (cherry picked from commit adb538e) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> # Conflicts: # CHANGELOG.md Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent bbe0d83 commit bfa690c

File tree

3 files changed

+11
-15
lines changed

3 files changed

+11
-15
lines changed

src/plugins/vis_type_markdown/public/markdown_options.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ function MarkdownOptions({ stateParams, setValue }: VisOptionsProps<MarkdownVisP
5252

5353
return (
5454
<EuiPanel paddingSize="s">
55-
<EuiFlexGroup direction="column" gutterSize="m" className="mkdEditor">
55+
<EuiFlexGroup direction="column" gutterSize="m" className="eui-fullHeight">
5656
<EuiFlexItem grow={false}>
5757
<EuiFlexGroup gutterSize="none" justifyContent="spaceBetween" alignItems="baseline">
5858
<EuiFlexItem grow={false}>
@@ -83,7 +83,7 @@ function MarkdownOptions({ stateParams, setValue }: VisOptionsProps<MarkdownVisP
8383
<EuiFlexItem>
8484
<EuiTextArea
8585
id="markdownVisInput"
86-
className="visEditor--markdown__textarea"
86+
className="eui-fullHeight"
8787
value={stateParams.markdown}
8888
onChange={({ target: { value } }) => onMarkdownUpdate(value)}
8989
fullWidth={true}

src/plugins/vis_type_markdown/public/markdown_vis.scss

+1-11
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,8 @@
55
// mkdChart__legend--small
66
// mkdChart__legend-isLoading
77

8-
.mkdVis {
9-
padding: $euiSizeS;
10-
width: 100%;
11-
}
12-
138
.visEditor--markdown {
14-
.visEditorSidebar__config > *,
15-
.visEditor--markdown__textarea {
9+
.visEditorSidebar__config > * {
1610
flex-grow: 1;
1711
}
18-
19-
.mkdEditor {
20-
height: 100%;
21-
}
2212
}

src/plugins/vis_type_markdown/public/markdown_vis_controller.tsx

+8-2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
*/
3030

3131
import React, { useEffect } from 'react';
32+
import { EuiPanel } from '@elastic/eui';
3233
import { Markdown } from '../../opensearch_dashboards_react/public';
3334
import { MarkdownVisParams } from './types';
3435

@@ -47,13 +48,18 @@ const MarkdownVisComponent = ({
4748
useEffect(renderComplete); // renderComplete will be called after each render to signal, that we are done with rendering.
4849

4950
return (
50-
<div className="mkdVis" style={{ fontSize: `${fontSize}pt` }}>
51+
<EuiPanel
52+
style={{ fontSize: `${fontSize}pt` }}
53+
hasBorder={false}
54+
hasShadow={false}
55+
paddingSize="s"
56+
>
5157
<Markdown
5258
data-test-subj="markdownBody"
5359
markdown={markdown}
5460
openLinksInNewTab={openLinksInNewTab}
5561
/>
56-
</div>
62+
</EuiPanel>
5763
);
5864
};
5965

0 commit comments

Comments
 (0)