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

[FEATURE] Add allowDropdown option #134

Merged
merged 6 commits into from
Nov 27, 2019

Conversation

evanlouden
Copy link
Contributor

No description provided.

@evanlouden evanlouden force-pushed the allow-dropdown-option branch from a7119d3 to 10825ef Compare October 11, 2019 21:28
Copy link
Contributor

@dcyriller dcyriller left a comment

Choose a reason for hiding this comment

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

Excellent, thank you! Sorry for taking so long to review.

I added two minor comments. Once they are resolved, it looks good to me.

{{#docs-demo as |demo|}}
{{#demo.example name="phone-input-allow-dropdown-option.hbs"}}

<p>{{phone-input allowDropdown=false initialCountry="fr" update=(action "handleUpdate")}}</p>
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
<p>{{phone-input allowDropdown=false initialCountry="fr" update=(action "handleUpdate")}}</p>
<p>{{phone-input allowDropdown=false number=allowDropdownNumber initialCountry="fr" update=(action "updateAllowDropdown")}}</p>

If we add a number and a dedicated update method, it won't interfere with other phone-input occurences on this page.

Note that we probably want to update the tests/dummy/app/pods/docs/components/phone-input/all-options/component.js to implement the update method. That way, the sandbox UI will be 100% working.

@dcyriller dcyriller added the enhancement New feature or request label Oct 24, 2019
@evanlouden
Copy link
Contributor Author

evanlouden commented Nov 24, 2019

Really sorry I've left this here for so long. I was confident my company was going to need this feature when we added this add on. Turns out we didn't. And around that time I also muted my github notifications. 😝 I've updated the PR and happy to help get it over the finish line. Otherwise, feel free to close it. 😄

@evanlouden evanlouden requested a review from dcyriller November 24, 2019 03:39
test('can prevent the dropdown', async function(assert) {
assert.expect(1);

await this.owner.lookup('service:phone-input').load();
Copy link
Contributor

Choose a reason for hiding this comment

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

The library is loaded in a beforeEach hook: https://github.com/qonto/ember-phone-input/pull/134/files#diff-0e2859b8508db13adaa5918464d0aeecR10

You can safely remove this line.

await this.owner.lookup('service:phone-input').load();

this.set('update', value => {
this.set('allowDropdown', value);
Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry I was not clear enough on the update method. Here you need to update the number, not the allowDropdown option.

Copy link
Contributor

Choose a reason for hiding this comment

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

Or you might be able to remove it at all

@evanlouden evanlouden requested a review from dcyriller November 27, 2019 12:18
Copy link
Contributor

@dcyriller dcyriller left a comment

Choose a reason for hiding this comment

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

Thank you for finishing this!

@dcyriller dcyriller merged commit c83bf5c into qonto:master Nov 27, 2019
@dcyriller
Copy link
Contributor

Released in a v3.1.0

@evanlouden
Copy link
Contributor Author

@dcyriller Thanks for your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants