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

Change builtInButtons to buttons #241

Merged
merged 9 commits into from
Sep 14, 2018
Merged

Change builtInButtons to buttons #241

merged 9 commits into from
Sep 14, 2018

Conversation

chuckcarpenter
Copy link
Contributor

@chuckcarpenter chuckcarpenter commented Sep 10, 2018

This branch obfuscates the binding for buttons in steps to the user and makes setup mirror the docs from Shepherd.js.

Resolves #224

@RobbieTheWagner
Copy link
Owner

@chuckcarpenter I don't think we should call something that's not the same as Shepherd, the same as Shepherd here. builtInButtons have a type and generate a button that is built into ember-shepherd. These include cancel, back, next, etc. If we're trying to align with Shepherd and just be a pass through, this will be confusing to people, I think, right?

@RobbieTheWagner
Copy link
Owner

I'm still in favor of merging builtInButtons output and buttons if you want vanilla Shepherd buttons.

@BrianSipple
Copy link
Contributor

BrianSipple commented Sep 11, 2018

It seems like the primary issue here is that the interface lacks constraint. What if we had two separate options: shepherdButtons and customButtons.

Each is focused, explicit, and unambiguous — for us and for users... unlike builtInButtons and buttons, apparently 😛.

@RobbieTheWagner
Copy link
Owner

@BrianSipple I would keep builtInButtons I think. The buttons are built in and provided. customButtons makes it sound like you want to do something custom.

We could potentially use just buttons I suppose, and add a check for type. If you pass type we use a built in one we provide, if you do not, it's just treated like a vanilla Shepherd button. What do you think @chuckcarpenter?

@BrianSipple
Copy link
Contributor

BrianSipple commented Sep 11, 2018

customButtons makes it sound like you want to do something custom.

Right, isn't that what we're trying to enable? The current confusion is from the fact that builtInButtons allows you to select from one of shepherd's built-in buttons and pass in something different.

Or am I confused about what we're confused about? (#224)

@RobbieTheWagner
Copy link
Owner

RobbieTheWagner commented Sep 12, 2018

@BrianSipple Shepherd does not provide any buttons. Shepherd takes an object to construct buttons, but has no built in or default types. ember-shepherd, however, does provide built in buttons, so you just set type: 'cancel' etc and the button is automatically hooked and bound to the cancel method.

With this in mind, I think perhaps it would make sense to just use buttons to align with Shepherd's docs, but then allow an extra param to the button options of type. Then check if type is defined and call makeButton, otherwise, just pass the vanilla buttons on to Shepherd itself.

Would this work for you @chuckcarpenter?

@BrianSipple
Copy link
Contributor

BrianSipple commented Sep 12, 2018

Ah, got it.

I'm leaning towards using buttons exclusively, then. I don't think it would be confusing if part of the documentation for buttons mentions that a type can be passed in order to bind the click action to either the back, cancel, or next event.

Because that's actually the only difference between ember-shepherd and shepherd when it comes to buttons: Occasionally we can handle the click action for you. Otherwise, you need to pass your own function to the action property.

So I think... a) keeping the interface consistent while... b) documenting the extra sugar... strikes a pretty good mix.

@RobbieTheWagner
Copy link
Owner

Totally agree @BrianSipple! We just need to fix conflicts here and add the type check stuff.

@RobbieTheWagner RobbieTheWagner changed the title Issue/224 - change builtInButtons to buttons Change builtInButtons to buttons Sep 12, 2018
@RobbieTheWagner RobbieTheWagner merged commit dcc1f25 into master Sep 14, 2018
@RobbieTheWagner RobbieTheWagner deleted the issue/224 branch September 14, 2018 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants