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

Separate the results of the checkboxgroup manipulator with a zero. #21

Merged
merged 5 commits into from
Mar 7, 2016

Conversation

keegan-lillo
Copy link
Contributor

Fixes #13

@keegan-lillo
Copy link
Contributor Author

@gregoiresage Does this work for you?

@gregoiresage
Copy link
Contributor

I will try when I'll go back from holidays Saturday.
Thanks for the evolution!
Le 29 févr. 2016 3:16 AM, "keegan-lillo" [email protected] a
écrit :

@gregoiresage https://github.com/gregoiresage Does this work for you?


Reply to this email directly or view it on GitHub
#21 (comment).

@keegan-lillo
Copy link
Contributor Author

Actually I wonder if maybe a \0 character might be a better separator. Colors are represented as numbers and black happens to be 0

@keegan-lillo
Copy link
Contributor Author

@matthewtole what are your thoughts on the separator to use. I'd like to recycle this format for something like this: #4 in the future hence my concern over color values

@matthewtole
Copy link
Contributor

I think that you're putting the solution to the problem in the wrong place. Instead of muddling up the results of the get() method, it would be better if the function that handles serialising the form to send to the watch handles this. That way it becomes a general solution that can be used by any component,

@keegan-lillo
Copy link
Contributor Author

So in here https://github.com/pebble/clay/blob/master/src/scripts/lib/clay-config.js#L161 do something like

switch(typeof _settings[appKey]) {
  case 'array': 
    _settings[appKey] = Utils.addSeparators(item.get(), 0);
    break;
  default: 
    _settings[appKey] = item.get();
    break;
}

@keegan-lillo keegan-lillo force-pushed the #13/fix-checkboxgroups-return-value branch from fa59ea9 to 271a0d1 Compare March 7, 2016 01:59
@keegan-lillo
Copy link
Contributor Author

@matthewtole after discussing with @gregoiresage we have found that only string arrays needed to be split up with zeros. Number arrays will be sent as is. This will pave the way for future changes where we might want to send different types of arrays. Also arrays that have booleans in them will now be converted to ones and zeros.

@matthewtole
Copy link
Contributor

Sounds good to me. 👍

…ups-return-value

# Conflicts:
#	test/spec/lib/manipulators.js
keegan-lillo added a commit that referenced this pull request Mar 7, 2016
Separate the results of the checkboxgroup manipulator with a zero.
@keegan-lillo keegan-lillo merged commit f50f569 into master Mar 7, 2016
@keegan-lillo keegan-lillo deleted the #13/fix-checkboxgroups-return-value branch March 7, 2016 21:47
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