Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Markdown] Replace custom css styles and native html with OUI. #4390

Merged
merged 8 commits into from
Jul 20, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- [Vis Colors] [Maps] Replace hardcoded color to OUI color in `maps_legacy` plugin ([#4294](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4294))
- [Vis Colors] [TSVB] Update default color in `vis_type_timeseries` to use `ouiPaletteColorBlind()[0]`([#4363](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4363))
- [Vis Colors] [Timeline] Replace `vis_type_timeline` colors with `ouiPaletteColorBlind()` ([#4366](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4366))
- [Markdown] Replace custom css styles and native html with OUI ([#4390](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4390))

### 🔩 Tests

Expand Down
4 changes: 2 additions & 2 deletions src/plugins/vis_type_markdown/public/markdown_options.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function MarkdownOptions({ stateParams, setValue }: VisOptionsProps<MarkdownVisP

return (
<EuiPanel paddingSize="s">
<EuiFlexGroup direction="column" gutterSize="m" className="mkdEditor">
<EuiFlexGroup direction="column" gutterSize="m" className="eui-fullHeight">
<EuiFlexItem grow={false}>
<EuiFlexGroup gutterSize="none" justifyContent="spaceBetween" alignItems="baseline">
<EuiFlexItem grow={false}>
Expand Down Expand Up @@ -83,7 +83,7 @@ function MarkdownOptions({ stateParams, setValue }: VisOptionsProps<MarkdownVisP
<EuiFlexItem>
<EuiTextArea
id="markdownVisInput"
className="visEditor--markdown__textarea"
className="eui-fullHeight"
value={stateParams.markdown}
onChange={({ target: { value } }) => onMarkdownUpdate(value)}
fullWidth={true}
Expand Down
12 changes: 1 addition & 11 deletions src/plugins/vis_type_markdown/public/markdown_vis.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,8 @@
// mkdChart__legend--small
// mkdChart__legend-isLoading

.mkdVis {
padding: $euiSizeS;
width: 100%;
}

.visEditor--markdown {
.visEditorSidebar__config > *,
.visEditor--markdown__textarea {
.visEditorSidebar__config > * {
flex-grow: 1;
}

.mkdEditor {
height: 100%;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
*/

import React, { useEffect } from 'react';
import { EuiPanel } from '@elastic/eui';
import { Markdown } from '../../opensearch_dashboards_react/public';
import { MarkdownVisParams } from './types';

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

return (
<div className="mkdVis" style={{ fontSize: `${fontSize}pt` }}>
<EuiPanel
style={{ fontSize: `${fontSize}pt` }}
hasBorder={false}
hasShadow={false}
paddingSize="s"
>
<Markdown
data-test-subj="markdownBody"
markdown={markdown}
openLinksInNewTab={openLinksInNewTab}
/>
</div>
</EuiPanel>
);
};

Expand Down