Skip to content
This repository has been archived by the owner on Jan 10, 2020. It is now read-only.

Added ability to switch labels and values in makeSelects #36

Closed
wants to merge 4 commits into from

Conversation

bretto36
Copy link
Contributor

@bretto36 bretto36 commented Jun 9, 2016

Added ability to switch labels and values in makeSelects and automatically in relationships as the value should be unique, the label can be duplicated

Added ability to switch labels and values in makeSelects and automatically in relationships as the value should be unique, the label can be duplicated
@bretto36 bretto36 mentioned this pull request Jun 9, 2016
@mlantz
Copy link
Member

mlantz commented Jun 9, 2016

Why do you force the switch on the relationship? Do you have an example?

@bretto36
Copy link
Contributor Author

I figured the value field would always be unique considering it defaults to id. I like the idea of showing duplicate labels as it shows people that there are duplicates and they can fix the data. I've had issues where people named a page the same thing but it was 2 separate pages. In the list of drop downs it only shows 1 and they can never select it.

@mlantz
Copy link
Member

mlantz commented Jun 10, 2016

I would be ok having the switch option - but I don't want it forced on the relationships. I think there should be control on data, but I could see the ability to switch things being useful. So if you remove the force one on the relationships then I'm cool with it. Especially since with the relationships you can set the fields that are displayed. Maybe it would be even better if you could set the 'label' and 'value' for the selects that would be the best solution probably.

@bretto36
Copy link
Contributor Author

Maybe it would be even better if you could set the 'label' and 'value' for the selects that would be the best solution probably.
Can you explain this more please? I'm not sure what you mean.

@mlantz
Copy link
Member

mlantz commented Jun 10, 2016

Right now with relationships you can tell the config, which column should be the value, and which should be the label in the select menu it generates. I thought the same config could be done in the select maker that way, you can manually set whichever you want but by default it will use id and name :)

Now after reviewing the code that, wont work. So nevermind :)

@mlantz
Copy link
Member

mlantz commented Jun 10, 2016

Upon further review. I don't think this is a real problem. The system works on a key => value. Which means it can be any key, value a person wants. The idea of adding a switch mechanism, means that though they are giving the input maker an array of key value pairs they want the input maker to switch the keys and values. As I see it you can easily do this to your data directly.

In terms of relationships, and making those selects the config allows you to chose which column will act as the label, and which will act as the value for the options. Thanks for the energy, but I think its better to give it the data that will be represented rather than having it intake data and do flips and switches. Thanks.

@mlantz mlantz closed this Jun 10, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants