Add confirm dialog to group Remove button#1208
Merged
jtsternberg merged 10 commits intodevelopfrom Dec 31, 2018
Merged
Conversation
jtsternberg
requested changes
Dec 31, 2018
Member
jtsternberg
left a comment
There was a problem hiding this comment.
A few things I would like to see:
- Use the
remove_confirmfield default as a string (just like the'remove_button'above it, and then set that string in thedata-confirmattribute, and use THAT for the confirmation dialog text. That allows users to define the confirmation text via field configuration instead of filtering the text via thecmb2_localized_datafilter. - Use an empty string for the
data-confirmattribute to indicate it should not be used. (instead of "no") - Follow the JS convention -- one var per line, per variable assignment.
jtsternberg
reviewed
Dec 31, 2018
1) make confirmation ON by default 2) confirmation text is now configurable when defining the group field 3) remove newly added string from l10n JS object (not used anymore) 4) support a case when group field renderer was redefined and doesn't have `data-confirm` attribute at all 5) fix tests
Member
Author
|
@jtsternberg Those changes were implemented. I'm not sure what is a procedure in this project in this case (should I dismiss your initial review, or wait till you check your GH notifications for new commits etc) - so I'm just pinging you, just in case. |
…ault empty (to not break back-compat)
jtsternberg
added a commit
that referenced
this pull request
Dec 31, 2018
Member
|
I just updated the docs. |
lipemat
added a commit
to lipemat/CMB2
that referenced
this pull request
Jan 4, 2019
* upstream/develop: make use of phpunit 6.5 for PHP 5.6. fix failing test for group removal confirmation message. Add props for CMB2#1208 Move the remove_confirm option to the example functions and leave default empty (to not break back-compat) Oops, fix typeof yoda check Fix removal confirmation in tests Simplify removal confirmation check Update typeof checks to use yoda make remove confirmation a bit more succinct Cannot use empty on an operation on older versions of php see CMB2#529 - improvements as per PR review: see CMB2#529 - fix tests with a default confirm value in DOM equal to no. fix CMB2#529 - Add confirm dialog to group Remove button. Add props for CMB2#1206 Add php tests npm script Add grunt watch npm script Add props for CMB2#1204 Ignore composer vendor dir fix CMB2#1205 - Package.json: fix the need of global (old) grunt. fix 1023 - Update PHPUnit version in composer.json. Add props for CMB2#1200 Remove superfluous method definitions Add develop class suffix to init.php class Bump version for hotfix release Fix issue when wp.data does not have core/editor. Check it first. Fixes CMB2#1197 Update version to 2.5.0 Update changelog Make install-wp-tests.sh executable Update tests to pass Add cmb_init_pickers and cmb_init_code_editors events for allowing just-in-time configuration for pickers/editors Make CMB2.getFields/CMB2.getFields more robust, allowing a filter callback, and specifying by field id
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #529.
Changes proposed in this pull request
added new option
remove_confirmto the custom options list forgroupfield type;falseby default - so all the current installations will not see any difference, should be enabled to be usedadded
group_remove_confirm- new translatable string to JS-based l10n list to display the test using JSdisplay a default browser
confirm()modal window and a custom (filterable) text from above when a user tries to delete a group of fields. If the user agrees - process further with the old logic, if denied - nothing happens.Documentation should be updated here.