Skip to content

[EuiMarkdownEditor] Allow markdown plugins to disable toolbar button#6840

Merged
cee-chen merged 3 commits intoelastic:mainfrom
kqualters-elastic:markdown-toolbar-button-props
Jun 14, 2023
Merged

[EuiMarkdownEditor] Allow markdown plugins to disable toolbar button#6840
cee-chen merged 3 commits intoelastic:mainfrom
kqualters-elastic:markdown-toolbar-button-props

Conversation

@kqualters-elastic
Copy link
Copy Markdown
Contributor

@kqualters-elastic kqualters-elastic commented Jun 13, 2023

Summary

Exposes an additional prop to markdown ui plugin button configurations, isDisabled, to be passed through to the underlying button in the toolbar. Use case being an instance where a markdown plugin is disabled for some reason, in the screenshot below this is due to a license level restriction.
image

QA

Remove or strikethrough items that do not apply to your PR.

General checklist

  • Checked in both light and dark modes
  • Checked in mobile
  • Checked in Chrome, Safari, Edge, and Firefox
  • Props have proper autodocs (using @default if default values are missing) and playground toggles
  • A changelog entry exists and is marked appropriately

@kibanamachine
Copy link
Copy Markdown

Preview documentation changes for this PR: https://eui.elastic.co/pr_6840/

@kqualters-elastic kqualters-elastic marked this pull request as ready for review June 14, 2023 03:19
Copy link
Copy Markdown
Contributor

@cee-chen cee-chen left a comment

Choose a reason for hiding this comment

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

QA'd locally in src-doc's markdown_editor_with_plugins.js and confirmed the disabled toolbar button behavior is working. I chatted with Kevin in Slack about unit tests and we're deliberately skipping them for this PR - the toolbar doesn't have tests and we're looking to move EuiMarkdownEditor away from EUI in any case 😅

@cee-chen cee-chen enabled auto-merge (squash) June 14, 2023 04:00
@kibanamachine
Copy link
Copy Markdown

Preview documentation changes for this PR: https://eui.elastic.co/pr_6840/

@cee-chen cee-chen merged commit 0b320cd into elastic:main Jun 14, 2023
@kqualters-elastic kqualters-elastic deleted the markdown-toolbar-button-props branch June 14, 2023 14:03
breehall added a commit to elastic/kibana that referenced this pull request Jun 14, 2023
eui@81.3.0 ⏩ eui@82.1.0

## [`82.1.0`](https://github.com/elastic/eui/tree/v82.1.0)

- Added ability for `EuiMarkdownEditor` plugins to disable toolbar
buttons ([#6840](elastic/eui#6840))

## [`82.0.0`](https://github.com/elastic/eui/tree/v82.0.0)

**Bug fixes**

- Fixed `EuiPopover`'s types to omit `panelProps.hasBorder` and
`panelProps.hasShadow` - these props are not customizable on popovers
for visual consistency
([#6836](elastic/eui#6836))

**Breaking changes**

- `EuiRange` & `EuiDualRange` no longer have a hard limit of 20
displayed ticks. The component now instead detects the width available,
and throws an error if each tick has less than 5 pixels of width. We
recommend testing your tick usage at smaller screens to ensure they
always display legibly to users.
([#6829](elastic/eui#6829))
kqualters-elastic added a commit to elastic/kibana that referenced this pull request Jun 16, 2023
…le ability, along with new icon (#159718)

## Summary

To be merged after elastic/eui#6840 is included
in an Eui release and said release is merged to kibana.

Makes use of the new isDisabled prop exposed to EuiMarkdownToolbar
components, and disables the button with appropriate hover text if
license level is not appropriate.


![image](https://github.com/elastic/kibana/assets/56408403/57c8d0ec-14a8-43c9-938e-e7de1c81eeac)


### Checklist

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants