Skip to content

Commit

Permalink
[Markdown] Replace custom css styles and native html with OUI. (#4390)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
3 people authored Jul 20, 2023
1 parent f13e4c3 commit adb538e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 15 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Replace the use of `bluebird` in `saved_objects` plugin ([#4026](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4026))
- [Maps Legacy] Removed KUI usage in `maps_legacy` plugin([#3998](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3998))
- Relocate tutorials imagery into `src/plugins/home/public/assets/tutorials/logos` ([#4382](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4382))
- [Markdown] Replace custom CSS styles and HTML markup with OUI components ([#4390](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4390))
- [VisBuilder] Use OUI icon ([#4446](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4446))
- [Vis Colors] [VisLib] Update legend colors to use OUI color palette ([#4365](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4365))
- [Vis Colors] [Region Maps] Replace hardcode color to OUI color in `region_map` plugin ([#4299](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4299))
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%;
}
}
10 changes: 8 additions & 2 deletions src/plugins/vis_type_markdown/public/markdown_vis_controller.tsx
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

0 comments on commit adb538e

Please sign in to comment.