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

Allow markdown in error embeddable #62427

Merged
merged 3 commits into from
Apr 6, 2020

Conversation

majagrubic
Copy link
Contributor

@majagrubic majagrubic commented Apr 3, 2020

Summary

Fixes: #61590

Now we render markdown in an error embeddable.
Screenshot 2020-04-03 at 12 31 02

Checklist

Delete any items that are not applicable to this PR.

- [] Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n support
- [ ] Documentation was added for features that require explanation or tutorials

For maintainers

@botelastic botelastic bot added the Feature:Embedding Embedding content via iFrame label Apr 3, 2020
@majagrubic majagrubic marked this pull request as ready for review April 3, 2020 13:28
@majagrubic majagrubic requested a review from a team as a code owner April 3, 2020 13:28
@majagrubic majagrubic requested a review from a team April 3, 2020 13:28
ReactDOM.render(
// @ts-ignore
<div className="embPanel__error embPanel__content" data-test-subj="embeddableStackError">
<EuiText color="subdued" size="xs">
<EuiIcon type="alert" color="danger" />
<EuiSpacer size="s" />
{title}
<div /* eslint-disable-next-line react/no-danger */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't pulled this PR down yet, but it seems like the Markdown component is already doing exactly this: https://github.com/elastic/kibana/blob/master/src/plugins/kibana_react/public/markdown/markdown.tsx

Is there anything blocking us from using it here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought it was an overkill, since the message may not even be a markdown. But on second thought, it makes sense.

@majagrubic majagrubic requested a review from flash1293 April 3, 2020 18:35
Copy link
Member

@ppisljar ppisljar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code LGTM

@flash1293
Copy link
Contributor

@elasticmachine merge upstream

Copy link
Contributor

@flash1293 flash1293 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested in Chrome and works as expected, markdown is applied and formatted nicely.=

Just left a small nit about an unused import

import { EmbeddableRoot } from './embeddable_root';
import { mount } from 'enzyme';
// @ts-ignore
import { findTestSubject } from '@elastic/eui/lib/test';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

findTestSubject is unused.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will fix this in the next PR, would like to get this in for 7.7

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@majagrubic majagrubic merged commit 4573f8d into elastic:master Apr 6, 2020
@majagrubic majagrubic deleted the fix-markdown-dashboard branch April 6, 2020 10:47
majagrubic pushed a commit to majagrubic/kibana that referenced this pull request Apr 6, 2020
* Allow markdown in error embeddable

* Replace markdown factory with markdown component

Co-authored-by: Elastic Machine <[email protected]>
majagrubic pushed a commit that referenced this pull request Apr 6, 2020
* Allow markdown in error embeddable

* Replace markdown factory with markdown component

Co-authored-by: Elastic Machine <[email protected]>

Co-authored-by: Elastic Machine <[email protected]>
majagrubic pushed a commit that referenced this pull request Apr 6, 2020
* Allow markdown in error embeddable

* Replace markdown factory with markdown component

Co-authored-by: Elastic Machine <[email protected]>

Co-authored-by: Elastic Machine <[email protected]>
@majagrubic majagrubic mentioned this pull request Apr 8, 2020
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Dashboard] Visualization placeholder (after removing index pattern) doesn't seem right
5 participants