Skip to content

Commit

Permalink
Version bump to 1.8.3
Browse files Browse the repository at this point in the history
Squashed commit following :
commit 2b651f2 (HEAD -> develop, origin/develop)
Author: Lekhnath Pandey <[email protected]>
Date:   Fri Apr 17 14:53:02 2020 +0545

    Dev - Invite code compatibility with the conditional logic addon

commit 5b848d2
Author: Lekhnath Pandey <[email protected]>
Date:   Fri Apr 17 14:42:59 2020 +0545

    version bump to 1.8.3

commit 67003fa
Author: Lekhnath Pandey <[email protected]>
Date:   Fri Apr 17 14:23:55 2020 +0545

    Fix - load country on conditional logic while form live changes

commit 744587d
Author: Lekhnath Pandey <[email protected]>
Date:   Fri Apr 17 09:24:17 2020 +0545

    Grunt Task

commit 5fa07a6
Author: Lekhnath Pandey <[email protected]>
Date:   Fri Apr 17 09:21:19 2020 +0545

    Security - Confirm Passward and Confirm Email deletion from browser inspect

commit 0699f63
Author: Prajjwal Poudel <[email protected]>
Date:   Fri Apr 17 08:49:13 2020 +0545

    Fix - Elementor pro conflict with registration validation errors (#222)

    Co-authored-by: Lekhnath Pandey <[email protected]>

commit 556be5c
Author: Rabin Shrestha <[email protected]>
Date:   Thu Apr 16 15:57:43 2020 +0545

    New addon content added in readme

commit f0d83f4
Author: Prajjwal Poudel <[email protected]>
Date:   Thu Apr 16 10:27:33 2020 +0545

    Code cleanup

commit ccf099e
Author: Prajjwal Poudel <[email protected]>
Date:   Thu Apr 16 06:24:05 2020 +0545

    Fix - Missing confirm email field validation

commit 6e067c1
Author: Nobel Dahal <[email protected]>
Date:   Wed Apr 15 12:08:17 2020 +0545

    Fix - added state attrib for view template

commit 0e034c9
Author: Prajjwal Poudel <[email protected]>
Date:   Wed Apr 15 08:05:13 2020 +0545

    Fix - Missing confirm email and password field validation

commit bbdba5c
Author: Nobel Dahal <[email protected]>
Date:   Fri Apr 10 16:24:58 2020 +0545

    Enhance - Toggle out on clicking out of form name edit box (#216)

commit 796c057
Author: Nobel Dahal <[email protected]>
Date:   Fri Apr 10 16:19:13 2020 +0545

    Enhance - Confirmation message on field deletion (#217)

    * f0e1c1b Add - i18n deletion

commit 516c9e7
Author: Nobel Dahal <[email protected]>
Date:   Fri Apr 10 16:13:34 2020 +0545

    Fix - Section division issue in form builder (#218)

    * 73846d7 Fix - Fix for Section division

    * 97eeddf Refactor - removed commented out code

commit f17280d
Author: Krishna Suwal <[email protected]>
Date:   Fri Apr 10 16:04:28 2020 +0545

    Fix/date picker (#212)

    * Fix - Date flatpicker not showing up for the later fields when there's multiple date fields

    * grunt task

    * Fix - Min-max date being affected by each other

    * Fix - min-max date in wordpress backend

    * Fix - min-max date in backend (date range)

    * Fix - enable date range in backend

    * Fix - min/max always being set even if you disable it later after setting it once

    Co-authored-by: Prajjwal Poudel <[email protected]>
    Co-authored-by: Lekhnath Pandey <[email protected]>

commit 2721c79
Author: Lekhnath Pandey <[email protected]>
Date:   Fri Apr 10 10:27:47 2020 +0545

    Typo - User doesn't exist

commit 01f925b
Author: Prajjwal Poudel <[email protected]>
Date:   Fri Apr 10 10:22:05 2020 +0545

    Fix - User approval status. (#220)

    * Fix - Admin approval status

    * Fix - Email confirmation status

    * Tweak - Removed unwanted comments

    Co-authored-by: Lekhnath Pandey <[email protected]>

commit 1c25107
Author: Prajjwal Poudel <[email protected]>
Date:   Fri Apr 10 10:07:55 2020 +0545

    Enhance - Registered At column to display registered log. (#221)

    * Registration log added in source column

    * Separate column for Registered log

    * Tweak - Make registered at colum sortable

commit 6078473
Author: Prajjwal Poudel <[email protected]>
Date:   Fri Apr 10 08:26:35 2020 +0545

    Fix - Form field validation for missing required fields (#223)

    * Fix - Form field validation for missing required fields

    * Fix - Required message

commit 0cb7a28
Author: Lekhnath Pandey <[email protected]>
Date:   Tue Apr 7 21:19:32 2020 +0545

    Fix-apply_shortcodes backword compatibility

commit 4928f7f (enhance/conditional-logic-field)
Author: Prajjwal Poudel <[email protected]>
Date:   Mon Apr 6 13:38:28 2020 +0545

    Fix - Enable recaptcha and password strength checkbox backward compatibility

commit 1f04c61
Author: Lekhnath Pandey <[email protected]>
Date:   Mon Apr 6 11:53:13 2020 +0545

    Merge branch master

commit 4b3e3c3
Author: Prajjwal Poudel <[email protected]>
Date:   Fri Apr 3 11:09:12 2020 +0545

    Fix - Placeholder conflict with value of select field

commit d860b2c
Author: Prajjwal Poudel <[email protected]>
Date:   Fri Apr 3 09:31:25 2020 +0545

    Enhance - WPML compatibility for Select2 and Multi Select2 fields

commit 0af7f86
Author: Lekhnath Pandey <[email protected]>
Date:   Thu Apr 2 18:39:32 2020 +0545

    Form live changes for conditional logic and wordpress 5.4 compatibility

commit 9e0d23d
Author: Nilan Bhasima <[email protected]>
Date:   Wed Apr 1 15:45:24 2020 +0545

    Fix - User Registration component placeholder design on Gutenblock
  • Loading branch information
lekhnathpandey committed Apr 17, 2020
1 parent b4a5839 commit b8f5a05
Show file tree
Hide file tree
Showing 31 changed files with 816 additions and 449 deletions.
17 changes: 17 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,21 @@

= 1.8.3 - 17/04/2020
* Security - Form field validation for missing required fields.
* Enhance - Toggle out on clicking out of form name edit box.
* Enhance - Confirmation message on field deletion.
* Enhance - Form live changes for conditional logic.
* Enhance - Registered At column to display registered log.
* Dev - WordPress v5.4 Compatibility.
* Dev - WPML compatibility for Select2 and Multi Select2 fields.
* Dev - Invite code compatibility with the conditional logic addon.
* Fix - Section division issue in form builder.
* Fix - Multiple date field.
* Fix - User approval status.
* Fix - Enable Recaptcha and password strength checkbox backward compatibility.
* Fix - Placeholder conflict with the value of the select field.
* Fix - User Registration component placeholder design on Gutenblock.
* Fix - Form event submit conflict in presence of popup creator plugins.

= 1.8.2.1 - 20/03/2020
* Fix - Unable to Login User Due to Pending Status.
* Fix - Recaptcha Backward compatibility
Expand Down
2 changes: 1 addition & 1 deletion assets/css/user-registration-rtl.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/css/user-registration.css

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions assets/css/user-registration.scss
Original file line number Diff line number Diff line change
Expand Up @@ -771,8 +771,18 @@
width: 100%;
margin-bottom: 0.5em;
}

.components-base-control {
width: 100%;
text-align: center;
}

.components-placeholder__fieldset {
text-align: center;

img {
margin: 0 auto;
}
}
}
}
Expand Down
350 changes: 238 additions & 112 deletions assets/js/admin/admin.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/js/admin/admin.min.js

Large diffs are not rendered by default.

57 changes: 33 additions & 24 deletions assets/js/frontend/user-registration.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,14 @@
var single_field = $this.closest('.ur-frontend-form').find('.ur-form-grid').find('.ur-frontend-field[name="' + field_name + '"]');
if (single_field.length < 2) {
var single_data = this_instance.get_fieldwise_data($(this));
form_data.push(single_data);
var invite_code = document.querySelector('.field-invite_code')
if( 'invite_code' === single_data.field_name ) {
if( 'block' === invite_code.style.display ) {
form_data.push(single_data);
}
} else {
form_data.push(single_data);
}
} else {
if ($.inArray(field_name, multi_value_field) < 0) {
multi_value_field.push(field_name);
Expand Down Expand Up @@ -350,6 +357,8 @@
$('form.register').on('submit', function (event) {
var $this = $(this);

event.stopImmediatePropagation();

// Validator messages.
$.extend($.validator.messages, {
required: user_registration_params.message_required_fields,
Expand Down Expand Up @@ -543,32 +552,32 @@
});
};

$(function () {
$( function () {
$('form.register').ur_form_submission();

var flatpickr_loaded = false;
var date_field = $('#load_flatpickr').attr('data-id');
var date_selector = $('.ur-frontend-form #' + date_field);
date_selector.attr('type', 'text');
date_selector.val( $('#formated_date').val() );
$('#load_flatpickr').click( function() {

var date_flatpickr;

if ( ! flatpickr_loaded ) {
$(this).attr('data-date-format', date_selector.data('date-format'));
$(this).attr('data-mode', date_selector.data('mode'));
$(this).attr('data-min-date', date_selector.data('min-date'));
$(this).attr('data-max-date', date_selector.data('max-date'));
$(this).attr('data-default-date', $('#formated_date').val());
date_flatpickr = $(this).flatpickr({
disableMobile: true,
onChange : function(selectedDates, dateStr, instance) {
$('#'+ date_field).val(dateStr);
},
var date_flatpickrs = {};

$( document.body ).on( 'click', '#load_flatpickr', function() {
var field_id = $( this ).data( 'id' );
var date_flatpickr = date_flatpickrs[ field_id ];

// Load a flatpicker for the field, if hasn't been loaded.
if ( ! date_flatpickr ) {
var formated_date = $( this ).closest( '.ur-field-item' ).find( '#formated_date' ).val();
var date_selector = $( '.ur-frontend-form #' + field_id ).attr( 'type', 'text' ).val( formated_date );

$( this ).attr( 'data-date-format', date_selector.data( 'date-format') );
$( this ).attr( 'data-mode', date_selector.data( 'mode') );
$( this ).attr( 'data-min-date', date_selector.data( 'min-date') );
$( this ).attr( 'data-max-date', date_selector.data( 'max-date') );
$( this ).attr( 'data-default-date', formated_date );
date_flatpickr = $( this ).flatpickr({
disableMobile : true,
onChange : function( selectedDates, dateString, instance ) {
$( '#' + field_id ).val( dateString );
}
});

flatpickr_loaded = true;
date_flatpickrs[ field_id ] = date_flatpickr;
}

if ( date_flatpickr ) {
Expand Down
2 changes: 1 addition & 1 deletion assets/js/frontend/user-registration.min.js

Large diffs are not rendered by default.

41 changes: 22 additions & 19 deletions includes/abstracts/abstract-ur-form-field.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
Expand Down Expand Up @@ -164,14 +165,16 @@ public function frontend_includes( $data = array(), $form_id, $field_type, $fiel
$form_data['custom_attributes']['data-date-format'] = $data['advance_setting']->date_format;
}

if ( isset( $data['advance_setting']->min_date ) ) {
$min_date = str_replace( '/', '-', $data['advance_setting']->min_date );
$form_data['custom_attributes']['data-min-date'] = '' !== $min_date ? date( $data['advance_setting']->date_format, strtotime( $min_date ) ) : '';
}
if ( isset( $data['advance_setting']->enable_min_max ) && 'true' === $data['advance_setting']->enable_min_max ) {
if ( isset( $data['advance_setting']->min_date ) ) {
$min_date = str_replace( '/', '-', $data['advance_setting']->min_date );
$form_data['custom_attributes']['data-min-date'] = '' !== $min_date ? date( $data['advance_setting']->date_format, strtotime( $min_date ) ) : '';
}

if ( isset( $data['advance_setting']->max_date ) ) {
$max_date = str_replace( '/', '-', $data['advance_setting']->max_date );
$form_data['custom_attributes']['data-max-date'] = '' !== $max_date ? date( $data['advance_setting']->date_format, strtotime( $max_date ) ) : '';
if ( isset( $data['advance_setting']->max_date ) ) {
$max_date = str_replace( '/', '-', $data['advance_setting']->max_date );
$form_data['custom_attributes']['data-max-date'] = '' !== $max_date ? date( $data['advance_setting']->date_format, strtotime( $max_date ) ) : '';
}
}

if ( isset( $data['advance_setting']->set_current_date ) ) {
Expand All @@ -194,7 +197,7 @@ public function frontend_includes( $data = array(), $form_id, $field_type, $fiel
$form_data['description'] = ur_string_translation( $form_id, 'user_registration_' . $data['general_setting']->field_name . '_description', $form_data['description'] );
}

// Filter only selected countries for `Country` fields
// Filter only selected countries for `Country` fields.
if ( 'country' === $field_key || 'billing_country' === $field_key || 'shipping_country' === $field_key ) {
$form_data['options'] = UR_Form_Field_Country::get_instance()->get_country();
$filtered_options = array();
Expand All @@ -212,42 +215,42 @@ public function frontend_includes( $data = array(), $form_id, $field_type, $fiel
}

/** Redundant codes. */
if ( 'select' === $field_key ) {
$option_data = isset( $data['advance_setting']->options ) ? explode( ',', $data['advance_setting']->options ) : array(); // Backward compatibility. Modified since 1.5.7
if ( 'select' === $field_key || 'select2' === $field_key || 'multi_select2' === $field_key ) {
$option_data = isset( $data['advance_setting']->options ) ? explode( ',', $data['advance_setting']->options ) : array(); // Backward compatibility. Modified since 1.5.7.
$option_data = isset( $data['general_setting']->options ) ? $data['general_setting']->options : $option_data;
$options = array();
$options = array();

if ( is_array( $option_data ) ) {
foreach ( $option_data as $index_data => $option ) {
$options[ $option ] = ur_string_translation( $form_id, 'user_registration_' . $data['general_setting']->field_name . '_option_' . ( ++$index_data ), $option );
$options[ $option ] = ur_string_translation( $form_id, 'user_registration_' . $data['general_setting']->field_name . '_option_' . ( ++$index_data ), $option );
}

$form_data['options'] = $options;
}
}

if ( 'radio' === $field_key ) {
$option_data = isset( $data['advance_setting']->options ) ? explode( ',', $data['advance_setting']->options ) : array(); // Backward compatibility. Modified since 1.5.7
$option_data = isset( $data['advance_setting']->options ) ? explode( ',', $data['advance_setting']->options ) : array(); // Backward compatibility. Modified since 1.5.7.
$option_data = isset( $data['general_setting']->options ) ? $data['general_setting']->options : $option_data;

$options = array();
if ( is_array( $option_data ) ) {
foreach ( $option_data as $index_data => $option ) {
$options[ $option ] = ur_string_translation( $form_id, 'user_registration_' . $data['general_setting']->field_name . '_option_' . ( ++$index_data ), $option );
$options[ $option ] = ur_string_translation( $form_id, 'user_registration_' . $data['general_setting']->field_name . '_option_' . ( ++$index_data ), $option );
}

$form_data['options'] = $options;
}
}

if ( 'checkbox' === $field_key ) {
$choices = isset( $data['advance_setting']->choices ) ? explode( ',', $data['advance_setting']->choices ) : array(); // Backward compatibility. Modified since 1.5.7
$choices = isset( $data['advance_setting']->choices ) ? explode( ',', $data['advance_setting']->choices ) : array(); // Backward compatibility. Modified since 1.5.7.
$option_data = isset( $data['general_setting']->options ) ? $data['general_setting']->options : $choices;

$options = array();
if ( is_array( $option_data ) ) {
foreach ( $option_data as $index_data => $option ) {
$options[ $option ] = ur_string_translation( $form_id, 'user_registration_' . $data['general_setting']->field_name . '_option_' . ( ++$index_data ), $option );
$options[ $option ] = ur_string_translation( $form_id, 'user_registration_' . $data['general_setting']->field_name . '_option_' . ( ++$index_data ), $option );
}

$form_data['options'] = $options;
Expand Down Expand Up @@ -329,14 +332,14 @@ public function get_field_general_settings() {
}
$disabled = '';
// To make invite code field name non editable.
if ( $value === 'invite_code' || $value === 'profile_pic_url' ) {
if ( 'invite_code' === $value || 'profile_pic_url' === $value ) {
$disabled = 'disabled';
}
$general_setting_wrapper .= $extra_attribute . ' ' . $disabled . '/>';
break;

case 'radio':
// Compatibility for older version. Get string value from options in advanced settings. Modified since @1.5.7
// Compatibility for older version. Get string value from options in advanced settings. Modified since @1.5.7.
$default_options = isset( $this->field_defaults['default_options'] ) ? $this->field_defaults['default_options'] : array();
$old_options = isset( $this->admin_data->advance_setting->options ) ? explode( ',', trim( $this->admin_data->advance_setting->options, ',' ) ) : $default_options;
$options = isset( $this->admin_data->general_setting->options ) ? $this->admin_data->general_setting->options : $old_options;
Expand Down Expand Up @@ -372,7 +375,7 @@ public function get_field_general_settings() {
break;

case 'checkbox':
// Compatibility for older version. Get string value from options in advanced settings. Modified since @1.5.7
// Compatibility for older version. Get string value from options in advanced settings. Modified since @1.5.7.
$default_options = isset( $this->field_defaults['default_options'] ) ? $this->field_defaults['default_options'] : array();
$old_options = isset( $this->admin_data->advance_setting->choices ) ? explode( ',', trim( $this->admin_data->advance_setting->choices, ',' ) ) : $default_options;
$options = isset( $this->admin_data->general_setting->options ) ? $this->admin_data->general_setting->options : $old_options;
Expand Down
3 changes: 3 additions & 0 deletions includes/admin/class-ur-admin-assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,8 @@ public static function get_form_required_html() {
public static function get_i18n_admin_data() {

$i18n = array(
'i18n_choice_ok' => esc_html__( 'Ok', 'user-registration' ),
'i18n_choice_cancel' => esc_html__( 'Cancel', 'user-registration' ),
'i18n_user_email' => _x( 'User Email', 'user-registration admin', 'user-registration' ),
'i18n_user_password' => _x( 'User Password', 'user-registration admin', 'user-registration' ),
'i18n_are_you_sure_want_to_delete' => _x( 'Are you sure want to delete?', 'user registration admin', 'user-registration' ),
Expand All @@ -311,6 +313,7 @@ public static function get_i18n_admin_data() {
'i18n_form_successfully_saved' => _x( 'Form successfully saved.', 'user registration admin', 'user-registration' ),
'i18n_success' => _x( 'Success', 'user registration admin', 'user-registration' ),
'i18n_error' => _x( 'Error', 'user registration admin', 'user-registration' ),
'i18n_msg_delete' => esc_html__( 'Confirm Deletion', 'user-registration' ),
'i18n_at_least_one_field_need_to_select' => _x( 'At least one field needs to be selected.', 'user registration admin', 'user-registration' ),
'i18n_empty_form_name' => _x( 'Empty form name.', 'user registration admin', 'user-registration' ),
'i18n_previous_save_action_ongoing' => _x( 'Previous save action on going.', 'user registration admin', 'user-registration' ),
Expand Down
4 changes: 2 additions & 2 deletions includes/admin/class-ur-admin-menus.php
Original file line number Diff line number Diff line change
Expand Up @@ -851,8 +851,8 @@ private function get_edit_form_field( $form_data ) {
<?php
$form_title = isset( $form_data->post_title ) ? trim( $form_data->post_title ) : __( 'Untitled', 'user-registration' );
?>
<input name="ur-form-name" id="ur-form-name" type="text" class="ur-form-name regular-text menu-item-textbox" value="<?php echo esc_html( $form_title ); ?>">
<span class="ur-edit-form-name dashicons dashicons-edit"></span>
<input name="ur-form-name" id="ur-form-name" type="text" class="ur-form-name regular-text menu-item-textbox" value="<?php echo esc_html( $form_title ); ?>" data-editing="false">
<span id="ur-form-name-edit-button" class="ur-edit-form-name dashicons dashicons-edit"></span>
</div>
<div class="ur-builder-header-right">
<?php do_action( 'user_registration_builder_header_extra', $form_data->ID, $form_data_array ); ?>
Expand Down
Loading

0 comments on commit b8f5a05

Please sign in to comment.