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

Don't force the name field onto every object #4201

Merged
merged 5 commits into from
Aug 1, 2017
Merged

Conversation

JamesKingdom
Copy link
Collaborator

This fixes #4200

How?

Currently all presets force a name field onto them.

  • Each preset will need field=name added onto it, only a few will not.
  • The ones like buffer stop, don't normally have names, so it will be removed. This helps to resolve some confusion, as new mappers might put something in there that is not relevant.

But what if that object really has a name?

  • The option will be available in the "Add field" box at the bottom, and work just like the other options, so that a name can be added if needed.
    sc1

  • This will then add back a name field:
    sc2

@JamesKingdom JamesKingdom added bluesky Bluesky issues are extra challenging - this might take a while or be impossible wip Work in progress and removed bluesky Bluesky issues are extra challenging - this might take a while or be impossible labels Aug 1, 2017
@@ -40,7 +40,7 @@ export function uiPreset(context) {
field.show = show;

field.shown = function() {
return field.id === 'name' || field.show || _.some(field.keys, function(key) { return !!tags[key]; });
return field.id === '' || field.show || _.some(field.keys, function(key) { return !!tags[key]; });
Copy link
Member

Choose a reason for hiding this comment

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

You can just remove the field.id === '' clause. No field will be like this.

@bhousel
Copy link
Member

bhousel commented Aug 1, 2017

This looks pretty good. I like the idea of not giving the name field any special treatment.

I fixed a small thing: now it is possible for there to be no fields in the "all fields" section, and that was causing this empty div to look weird:

screenshot 2017-08-01 13 03 30

Added a rule so that div will not appear if empty:

screenshot 2017-08-01 13 06 34

@bhousel
Copy link
Member

bhousel commented Aug 1, 2017

Merging now, so I can get a start on #3914 today.. Per chat, @JamesKingdom will add most of the name fields back and open a new PR.

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.

Name field should not be mandatory for presets
2 participants