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 mode and title to be omitted in options argument for createEditor #3791

Merged

Conversation

Steve-Mcl
Copy link
Contributor

fixes #3774

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Proposed changes

If options.mode and options.title are missing, ensure the suffix argument of RED.editor.generateViewStateId is something.

This permits creating an editor with minimal options.

NOTE: the user should ALWAYS provide an options object with the target element. In not doing so, the monaco editor has no idea where to display the editor. As a level of compatibility to earlier node-red versions (and to prevent an exception), a hidden element will be auto generated in the event of options or options.element being missing (and a warning will be generated in the browser indicating this) but the UI will not see the editor.

Checklist

  • I have read the contribution guidelines
  • For non-bugfix PRs, I have discussed this change on the forum/slack team.
  • I have run grunt to verify the unit tests pass
  • I have added suitable unit tests to cover the new/changed functionality

@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) to 68.225% when pulling f7120b3 on Steve-Mcl:allow-editor-create-no-title-no-mode into 1b94cc3 on node-red:master.

@knolleary knolleary merged commit bfdbeb0 into node-red:master Jul 21, 2022
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.

Mode is now a required option for createEditor in 3.0 or a TypeError is thrown
3 participants