Skip to content

Commit

Permalink
Version 2.19.6 (#1984)
Browse files Browse the repository at this point in the history
= 2.19.6 on February 7, 2024 =

This update introduces the ability to send notifications using Gravity
Forms when an entry is deleted, improves sorting and survey field
ratings, and updates key components for better performance and
compatibility.

#### 🚀 Added
* Ability to send notifications using Gravity Forms when an entry is
deleted by selecting the "GravityView - Entry is deleted" event from the
event dropdown in Gravity Forms notifications settings.

#### 🔧 Updated
* [Foundation](https://www.gravitykit.com/foundation/) and
[TrustedLogin](https://www.trustedlogin.com/) to versions 1.2.8 and
1.7.0, respectively.
- Transients are now set and retrieved correctly when using object cache
plugins.
- Fixed a JavaScript warning that occurred when deactivating license
keys and when viewing products without the necessary permissions.
  - Resolved PHP warning messages on the Plugins page.

#### 🐛 Fixed
* Sorting the View by entry ID in ascending and descending order would
yield the same result.
* Survey fields without a rating would show a 1-star rating.
* Editing Gravity Forms [Custom Post
Fields](https://docs.gravityforms.com/post-custom/#h-general-settings)
with a Field Type set to "File Uploads" inside in Edit Entry.

__Developer Updates:__

* Added: `GravityView_Notifications` class as a wrapper for Gravity
Forms notifications.
* Modified: Added the current `\GV\View` object as a second parameter
for the `gravityview/search-all-split-words` and
`gravityview/search-trim-input` filters.
* Modified: Attach listeners in the View editor to `$( document.body )`
instead of `$('body')` for speed improvements.
  • Loading branch information
zackkatz authored Feb 8, 2024
2 parents 56a338b + 5aa03b2 commit 12dfdfe
Show file tree
Hide file tree
Showing 507 changed files with 16,295 additions and 12,035 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Gruntfile.js export-ignore
package.json export-ignore
package-lock.json export-ignore
phpcs.ruleset.xml export-ignore
phpcs.xml export-ignore
phpcs.xml.dist export-ignore
phpunit.xml export-ignore
phpunit.xml.dist export-ignore
Expand All @@ -29,6 +30,7 @@ translations.pot export-ignore
# Folders
/.circleci export-ignore
/.github export-ignore
/.husky export-ignore
/.idea export-ignore
/.tx export-ignore
/assets/css/scss export-ignore
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ docs/html
docker-compose.yml
docker-unit-tests.sh
phpunit
phpunit.xml
wordpress-51-tests-lib
wordpress-latest-tests-lib

Expand Down
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx lint-staged
38 changes: 19 additions & 19 deletions assets/js/admin-views.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@
// Start by showing/hiding on load
vcfg.toggleInitialVisibility( vcfg );

// Start bind to $('body')
$( 'body' )
// Start bind to $( document.body )
$( document.body )

// Track modifier keys being clicked
.on( 'keydown keyup', vcfg.altKeyListener )
Expand Down Expand Up @@ -205,7 +205,7 @@

$.cookie( 'warning-dismissed-' + warning_name, 1, { path: gvGlobals.admin_cookiepath } );

$( 'body' ).trigger( 'gravityview/tabs-ready' );
$( document.body ).trigger( 'gravityview/tabs-ready' );
})

.on( 'gravityview/loaded gravityview/tabs-ready gravityview/field-added gravityview/field-removed gravityview/all-fields-removed gravityview/show-as-entry gravityview/view-config-updated', vcfg.toggleTabConfigurationWarnings )
Expand Down Expand Up @@ -242,7 +242,7 @@
}
$( this ).parent( '.gv-fields' ).removeClass( 'trigger--active' );
});
// End bind to $('body')
// End bind to $( document.body )

$( window ).resize( function() {

Expand Down Expand Up @@ -588,7 +588,7 @@

parent.find( '.gv-field-controls .dashicons-media-default' ).toggleClass( 'hide-if-js', $( e.target ).not( ':checked' ) );

$( 'body' ).trigger( 'gravityview/show-as-entry', $( e.target ).is( ':checked' ) );
$( document.body ).trigger( 'gravityview/show-as-entry', $( e.target ).is( ':checked' ) );
},

/**
Expand Down Expand Up @@ -914,7 +914,7 @@
vcfg.currentTemplateId = '';
vcfg.currentFormId = vcfg.gvSelectForm.val();
vcfg.setUnsavedChanges( true );
$( 'body' ).trigger( 'gravityview_form_change' ).addClass( 'gv-form-changed' );
$( document.body ).trigger( 'gravityview_form_change' ).addClass( 'gv-form-changed' );
},

showDialog: function ( dialogSelector, buttons ) {
Expand Down Expand Up @@ -1040,7 +1040,7 @@
} );
}

$( 'body' ).trigger( 'gravityview/dialog-closed', thisDialog );
$( document.body ).trigger( 'gravityview/dialog-closed', thisDialog );
},
closeOnEscape: true,
buttons: buttons
Expand Down Expand Up @@ -1116,7 +1116,7 @@
$( '#' + editorId ).autocomplete( 'close' );
};

$( 'body' ).on( 'keyup', function ( e ) {
$( document.body ).on( 'keyup', function ( e ) {
if ( $autocompleteEl.is( ':visible' ) && 27 === e.which ) {
e.preventDefault();
closeAutocompletion();
Expand Down Expand Up @@ -1674,7 +1674,7 @@
* @since 2.10
* @param {object} JSON response with `header` `footer` (widgets) `directory` and `single` (contexts) properties
*/
$( 'body' ).trigger( 'gravityview/view-config-updated', content );
$( document.body ).trigger( 'gravityview/view-config-updated', content );
}

resolve();
Expand Down Expand Up @@ -2002,7 +2002,7 @@
// append the new field to the active drop
$( '[data-tooltip-id="' + areaId + '"]' ).parents( '.gv-droppable-area' ).find( '.active-drop' ).append( newField ).end().attr( 'data-tooltip-id', '' );

$('body').trigger( 'gravityview/field-added', newField );
$( document.body ).trigger( 'gravityview/field-added', newField );

// Show the new field
newField.fadeIn( 100 );
Expand Down Expand Up @@ -2063,7 +2063,7 @@
}

// Only init merge tags if the View has been saved and the form hasn't been changed.
if ( 'undefined' !== typeof( form ) && $( 'body' ).not( '.gv-form-changed' ) && $merge_tag_supported.length >= 0 ) {
if ( 'undefined' !== typeof( form ) && $( document.body ).not( '.gv-form-changed' ) && $merge_tag_supported.length >= 0 ) {

if ( window.gfMergeTags ) {

Expand Down Expand Up @@ -2236,7 +2236,7 @@

$( this ).remove();

$('body').trigger( 'gravityview/field-removed', $( this ) );
$( document.body ).trigger( 'gravityview/field-removed', $( this ) );

vcfg.toggleDropMessage();
} );
Expand Down Expand Up @@ -2271,7 +2271,7 @@

$( area ).find( '.gv-fields' ).remove();

$('body').trigger( 'gravityview/all-fields-removed' );
$( document.body ).trigger( 'gravityview/all-fields-removed' );

viewConfiguration.toggleDropMessage();
},
Expand Down Expand Up @@ -2306,7 +2306,7 @@
vcfg.updateVisibilitySettings( e, true );

// Toggle checkbox when changing field visibility
$( 'body' ).on( 'change', '.gv-fields input[type=checkbox]', vcfg.updateVisibilitySettings );
$( document.body ).on( 'change', '.gv-fields input[type=checkbox]', vcfg.updateVisibilitySettings );

var buttons = [
{
Expand Down Expand Up @@ -2571,7 +2571,7 @@
.on('change', viewGeneralSettings.updateSettingsDisplay )
.trigger('change');

$('body')
$( document.body )
// Enable a setting tab (since 1.8)
.on('gravityview/settings/tab/enable', viewGeneralSettings.enableSettingTab )

Expand Down Expand Up @@ -2730,7 +2730,7 @@
*
* I tried setTimeout; it didn't work.
*
* I tried moving window.gvAdminActions and $( 'body' ).trigger( 'gravityview/loaded' );
* I tried moving window.gvAdminActions and $( document.body ).trigger( 'gravityview/loaded' );
* outside of this function; it didn't work.
*
* This probably needs to stay here until we rewrite this beast.
Expand Down Expand Up @@ -2777,7 +2777,7 @@
viewConfiguration.init_droppables( ui.panel );

/** @since 2.14.1 */
$( 'body' )
$( document.body )
.trigger( 'gravityview/tab-ready', ui.panel )
.trigger( 'gravityview/tabs-ready' );
},
Expand All @@ -2788,7 +2788,7 @@
viewConfiguration.init_droppables( ui.newPanel );

/** @since 2.14.1 */
$( 'body' ).trigger( 'gravityview/tab-ready', ui.newPanel );
$( document.body ).trigger( 'gravityview/tab-ready', ui.newPanel );
}
} );

Expand All @@ -2799,7 +2799,7 @@
showDialog: viewConfiguration.showDialog
};

$( 'body' ).trigger( 'gravityview/loaded' );
$( document.body ).trigger( 'gravityview/loaded' );
} );

}(jQuery));
2 changes: 1 addition & 1 deletion assets/js/admin-views.min.js

Large diffs are not rendered by default.

10 changes: 8 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@
"codeception/module-filesystem": "^1.0",
"codeception/module-cli": "^1.0",
"codeception/util-universalframework": "^1.0",
"yoast/phpunit-polyfills": "^1.0"
"yoast/phpunit-polyfills": "^1.0",
"squizlabs/php_codesniffer": "*",
"wp-coding-standards/wpcs": "^3.0",
"phpcompatibility/phpcompatibility-wp": "^2.1"
},
"extra": {
"strauss": {
Expand Down Expand Up @@ -91,6 +94,9 @@
]
},
"config": {
"platform-check": false
"platform-check": false,
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
}
}
}
Loading

0 comments on commit 12dfdfe

Please sign in to comment.