KEMBAR78
Separate the "add new config-node" option into a new (+) button by GogoVega · Pull Request #4627 · node-red/node-red · GitHub
Skip to content

Conversation

GogoVega
Copy link
Contributor

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

Proposed changes

This PR reduces the number of three steps into one to add a config-node by clicking a new (+) button.

The "edit" button will be disabled if no option is available. The "add" option is removed from the list as soon as it contains at least one option.

Requested by @joepavitt on the forum.

PS: I don't know if I should also adapt the test files? (10-mqtt_page.js and 22-websocket_page.js)

Checklist

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

Copy link
Member

@knolleary knolleary left a comment

Choose a reason for hiding this comment

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

Given the new button takes up horizontal space, making the select box narrower, I don't think we should also change the 'add new' message to push the type further to the right.

Also, by removing the _ADD_ option from the select box if there are existing config nodes, it is no longer possible to leave the property unset. It forces you to pick an existing config node even if that isn't what you want it to do.

It may be an edge case, but being able to unset the value is something we should allow for.

@GogoVega
Copy link
Contributor Author

Do you want me to add a “nothing” option? So there will be 2 basic options (add and nothing) then the different options plus nothing?

Co-authored-by: Nick O'Leary <nick.oleary@gmail.com>
@GogoVega
Copy link
Contributor Author

Something like that?

Enregistrement.de.l.ecran.2024-03-28.a.13.40.25.mov

@knolleary
Copy link
Member

Something like that?

... maybe... I'm not sure. It's one of the reasons this particular bit of UI has not received the update it has needed for so long. Trying to find the right UI that works for the different valid states it can be in.

I do agree having the + button is a good improvement. I'm going to have a play around to see what works.

@joepavitt
Copy link
Contributor

Just having a "None" option would work imo

@GogoVega
Copy link
Contributor Author

I am hesitating between the following for the case without options (no node available):

  • "add new" (1 option) - the current
  • "none" and "add new" (2 options)
  • "add or leave blank" (1 option)

Then available options and "none" option.

@joepavitt
Copy link
Contributor

"None" or "Add new..." make sense to me. Definitely not both together

Copy link
Member

@knolleary knolleary left a comment

Choose a reason for hiding this comment

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

Some minor changes to add a 'none' option, and add tooltips to the buttons

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