Skip to content

feature(ios/core/dialog): set destructive style from options #8676

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

Conversation

danielorihuela
Copy link
Contributor

PR Checklist

What is the current behavior?

User can create default actions in iOS.

What is the new behavior?

User can now create destructive actions in iOS as well.

Implements #6749. Related to #3830, #5553.

Daniel Orihuela and others added 4 commits June 26, 2020 18:47
We added a property called destructiveActionsIndexes in order
to support ios destructive style for
action buttons.

See: https://developer.apple.com/documentation/uikit/uialertaction/style/destructive

Co-authored-by: Marc Bisquert <[email protected]>
Set the ios destructive style for the action buttons given the
indexes included in the optional destructiveActionsIndexes property.

The action buttons not included in the stated property remain with
 the default style.

Co-authored-by: Marc Bisquert <[email protected]>
1. Substitute let for const.
2. Create thisActionIsDestructive variable for readability.

Co-authored-by: Marc Bisquert <[email protected]>
Co-authored-by: Diego Rodriguez <[email protected]>
Co-authored-by: Sergio Sanchez <[email protected]>
Co-authored-by: Marc Bisquert <[email protected]>
Co-authored-by: Diego Rodriguez <[email protected]>
Co-authored-by: Sergio Sanchez <[email protected]>
@asciidiego
Copy link

Closes #6749

@NathanWalker
Copy link
Contributor

@diegovincent Thank you for this - possible to do a quick format on the files to use tabs [2]? I know, I'm not a fan of tabs either (shhhh) - that's way core modules has been formatted historically so stick with that for now - we will most likely add an auto format on commit hook in so you don't have to worry about this hassle in the future. That will make the changeset a bit easier to see.

@asciidiego
Copy link

@diegovincent Thank you for this - possible to do a quick format on the files to use tabs [2]? I know, I'm not a fan of tabs either (shhhh) - that's way core modules has been formatted historically so stick with that for now - we will most likely add an auto format on commit hook in so you don't have to worry about this hassle in the future. That will make the changeset a bit easier to see.

Gotta say, I am more of a tabs than spaces guy! But there is a reason for it. Tabs can be configured however you want, but spaces cannot (in terms of width). Thus, for accesibility reasons (visual impairment) tabs > spaces. When I realized that, the discussion was over for me.

Having said that, I'll see how to format it as you want, I guess you can do it with Prettier prettier easily.

@cla-bot
Copy link

cla-bot bot commented Jul 6, 2020

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Diego Rodriguez.
This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email [email protected]
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails

@cla-bot cla-bot bot removed the cla: yes label Jul 6, 2020
Tab-width = 2 spaces
@asciidiego asciidiego force-pushed the Polaroo/feature/add-destructiveActionsIndexes-property-to-Actions branch from 984f0e8 to e6c0aa2 Compare July 6, 2020 09:57
@cla-bot
Copy link

cla-bot bot commented Jul 6, 2020

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign the CLA at https://www.nativescript.org/cla.
CLA has not been signed by users: @diegovincent.
After signing the CLA, you can ask me to recheck this PR by posting @cla-bot check as a comment to the PR.

@asciidiego
Copy link

@cla-bot check

@cla-bot cla-bot bot added the cla: yes label Jul 6, 2020
@cla-bot
Copy link

cla-bot bot commented Jul 6, 2020

The cla-bot has been summoned, and re-checked this pull request!

@asciidiego
Copy link

@NathanWalker as seen in 06dd083 and on this Travis CI build I had to use 4 spaces because that is what the Travis CI asked for.

Unless you want us to explicitly disobey the CI, this should be merged as it is. If instead you want double tabs, simply revert the last commit (06dd083).

@NathanWalker
Copy link
Contributor

Thank you @diegovincent

@NathanWalker NathanWalker merged commit bb531ce into NativeScript:master Jul 6, 2020
@NathanWalker
Copy link
Contributor

Released with https://github.com/NativeScript/NativeScript/releases/tag/6.5.9 now

@asciidiego asciidiego deleted the Polaroo/feature/add-destructiveActionsIndexes-property-to-Actions branch July 8, 2020 08:04
tarunama pushed a commit to tarunama/NativeScript that referenced this pull request Sep 9, 2020
@jarrodwhitley
Copy link

jarrodwhitley commented Jan 24, 2022

@NathanWalker I can't find any instructions on how to use this new option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants