Skip to content

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

Merged
bhousel merged 5 commits into
masterfrom
mandatory_names
Aug 1, 2017
Merged

bhousel merged 5 commits into
masterfrom
mandatory_names

Conversation

@JamesKingdom

Copy link
Copy Markdown
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
Comment thread modules/ui/preset.js Outdated

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
Copy Markdown
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

bhousel commented Aug 1, 2017 •

Copy link
Copy Markdown
Member

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

bhousel commented Aug 1, 2017

Copy link
Copy Markdown
Member

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