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

docs: MessageBoxOptions.icon should allow type string #19782

Merged
merged 1 commit into from Aug 16, 2019

Conversation

jpmn
Copy link
Contributor

@jpmn jpmn commented Aug 15, 2019

Description of Change

In the dialog documentation (and the generated typings in electron.d.ts), it is mentionned that the icon property only supports NativeImage, but the nativeImage documentation says that:

In Electron, for the APIs that take images, you can pass either file paths or NativeImage

This PR adds support for the type string through a change in the documentation to match BrowserWindowConstructorOptions.icon?: (NativeImage) | (string); from electron.d.ts. This change should result in MessageBoxOptions.icon?: NativeImage; becoming MessageBoxOptions.icon?: (NativeImage) | (string);

Related documentation:
https://electronjs.org/docs/api/dialog#dialogshowmessageboxbrowserwindow-options
https://electronjs.org/docs/api/browser-window#new-browserwindowoptions
https://electronjs.org/docs/api/native-image#nativeimage

Checklist

Release Notes

Notes: Allowed string as type on MessageBoxOptions.icon to support file paths as mentioned in NativeImage documentation

@electron-cation electron-cation bot added the new-pr 🌱 PR opened in the last 24 hours label Aug 15, 2019
@welcome
Copy link

welcome bot commented Aug 15, 2019

💖 Thanks for opening this pull request! 💖

We use semantic commit messages to streamline the release process. Before your pull request can be merged, you should update your pull request title to start with a semantic prefix.

Examples of commit messages with semantic prefixes:

  • fix: don't overwrite prevent_default if default wasn't prevented
  • feat: add app.isPackaged() method
  • docs: app.isDefaultProtocolClient is now available on Linux

Things that will help get your PR across the finish line:

  • Follow the JavaScript, C++, and Python coding style.
  • Run npm run lint locally to catch formatting errors earlier.
  • Document any user-facing changes you've made following the documentation styleguide.
  • Include tests when adding/changing behavior.
  • Include screenshots and animated GIFs whenever possible.

We get a lot of pull requests on this repo, so please be patient and we will get back to you as soon as we can.

@jpmn jpmn changed the title docs: MessageBoxOptions.icon should allow type String as per NativeImage documentation docs: MessageBoxOptions.icon should allow type string as per NativeImage documentation Aug 15, 2019
@codebytere codebytere self-requested a review August 15, 2019 17:29
Copy link
Contributor

@deermichel deermichel left a comment

Choose a reason for hiding this comment

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

I guess that's not the only occurrence that should be changed in our docs - but let's start somewhere. Thank you for your contribution 🎉

@codebytere codebytere changed the title docs: MessageBoxOptions.icon should allow type string as per NativeImage documentation docs: MessageBoxOptions.icon should allow type string Aug 16, 2019
@jpmn
Copy link
Contributor Author

jpmn commented Aug 16, 2019

Thank you! Is there any chance that it can be backported to 5.0.x?

@codebytere
Copy link
Member

@jpmn yes!

@alexeykuzmin alexeykuzmin merged commit 42ac642 into electron:master Aug 16, 2019
@welcome
Copy link

welcome bot commented Aug 16, 2019

Congrats on merging your first pull request! 🎉🎉🎉

@release-clerk
Copy link

release-clerk bot commented Aug 16, 2019

Release Notes Persisted

Allowed string as type on MessageBoxOptions.icon to support file paths as mentioned in NativeImage documentation

@trop
Copy link
Contributor

trop bot commented Aug 16, 2019

I have automatically backported this PR to "5-0-x", please check out #19796

@trop
Copy link
Contributor

trop bot commented Aug 16, 2019

I have automatically backported this PR to "7-0-x", please check out #19797

@trop
Copy link
Contributor

trop bot commented Aug 16, 2019

I have automatically backported this PR to "6-0-x", please check out #19798

@electron-cation electron-cation bot removed the new-pr 🌱 PR opened in the last 24 hours label Aug 16, 2019
@sofianguy sofianguy added this to 6.0.3 in 6.1.x Aug 20, 2019
@sofianguy sofianguy added this to Fixed in 5.0.10 in 5.0.x Aug 20, 2019
@sofianguy sofianguy added this to Fixed in 7.0.0-beta.4 in 7.2.x Sep 3, 2019
ckerr added a commit that referenced this pull request Jan 11, 2022
zcbenz pushed a commit that referenced this pull request Jan 13, 2022
trop bot pushed a commit that referenced this pull request Jan 13, 2022
zcbenz pushed a commit that referenced this pull request Jan 13, 2022
Fixes #32390. See #19782 for context.

Co-authored-by: Charles Kerr <charles@charleskerr.com>
t57ser pushed a commit to t57ser/electron that referenced this pull request Jan 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
5.0.x
Fixed in 5.0.10
6.1.x
6.0.3
7.2.x
Fixed in 7.0.0-beta.4
Development

Successfully merging this pull request may close these issues.

None yet

6 participants