Skip to content

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

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

cee-chen merged 3 commits into
elastic:mainfrom
kqualters:markdown-toolbar-button-props

Conversation

@kqualters

@kqualters kqualters commented Jun 13, 2023 •

Copy link
Copy Markdown
Contributor

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
Contributor

@kqualters
kqualters marked this pull request as ready for review June 14, 2023 03:19

@cee-chen cee-chen left a comment

Copy link
Copy Markdown
Contributor

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 😅

Comment thread upcoming_changelogs/6840.md Resolved
@cee-chen
cee-chen enabled auto-merge (squash) June 14, 2023 04:00
@kibanamachine

Copy link
Copy Markdown
Contributor

@cee-chen
cee-chen merged commit 0b320cd into elastic:main Jun 14, 2023
@kqualters
kqualters 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
[email protected] ⏩ [email protected]

## [`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 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