Skip to content

Commit

Permalink
Version bump to 1.8.8
Browse files Browse the repository at this point in the history
Squashed with the following commits:
commit ca13637
Author: Lekhnath Pandey <[email protected]>
Date:   Mon Oct 12 13:50:32 2020 +0545

    Tweak - Design changes in file upload of setting page  (#278)

    * File upload UI consistency

    * show file name on file selection

    Co-authored-by: Nilan Bhasima <[email protected]>

commit c6083f9
Author: Krishna Suwal <[email protected]>
Date:   Mon Oct 12 13:49:07 2020 +0545

    Fix - Number fields step option not working (#274)

    * Fix - Number field options not working (min, max and step)

    * Tweak - Replace empty with isset

    * checks for 0 value

commit 6f03144
Author: Bence Fodor <[email protected]>
Date:   Mon Oct 12 10:01:59 2020 +0200

    Enhance - Hide signup link on login if users_can_register option is not enabled (#175)

    If user registration is disabled in Wordpress Settings / General, the sign up link should be hidden on the User Registration login form. This commit adds a check
using get_option for users_can_register and only displays the sign up link if registration is open.

commit 3eb8399
Author: Lekhnath Pandey <[email protected]>
Date:   Mon Oct 12 13:43:26 2020 +0545

    Fix - Send an email after payment validation (#273)

commit 348ed1c (fix/bottom-trash-button)
Author: Lekhnath Pandey <[email protected]>
Date:   Mon Oct 12 08:15:09 2020 +0545

    Fix - Form List table bottom transh filter buttom not work

commit 0b6d738 (fix/unexpected-json-error)
Author: Lekhnath Pandey <[email protected]>
Date:   Wed Sep 23 13:19:26 2020 +0545

    Fix - Unexpected json > 0 error
  • Loading branch information
lekhnathpandey committed Oct 13, 2020
1 parent b3afb19 commit 073ddb8
Show file tree
Hide file tree
Showing 25 changed files with 216 additions and 91 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
= 1.8.8 - 13/10/2020
* Enhance - Hide signup link on login if users_can_register option is not enabled.
* Fix - Number fields step option not working.
* Fix - Send an email after payment validation.
* Fix - Form List table bottom trash filter button not work.
* Fix - Unexpected json > 0 error.
* Tweak - Design changes in file upload of setting page.

= 1.8.7.1 - 14/09/2020
* Fix - Conditional logic compatibility with WordPress 5.5

Expand Down
51 changes: 51 additions & 0 deletions assets/css/_forms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@
margin-bottom: 16px;
}

.ur-label {
display: block;
width: 100%;
margin-bottom: 8px;
color: $color_gray_one;
font-size: 13px;
font-weight: 500;
line-height: 1.25;
}

/**
* Form Field
* Set the class name for all input field
Expand All @@ -13,6 +23,47 @@
border-radius: 4px;
}

// Upload file
.user-registration-custom-file {
color: $input_color;
font-size: 14px;
display: flex;
align-items: center;
position: relative;

input {
position: absolute;
z-index: 2;
width: 100%;
margin: 0;
opacity: 0;
}

&__label {
display: flex;
align-items: center;
width: 100%;
padding: 2px 2px 2px 8px;
background-color: $white;
border: 1px solid $border-color;
border-radius: 4px;
z-index: 1;
}

&__button {
margin-left: auto;
display: inline-block;
background: $color_gray_two;
color: $white;
padding: 6px 15px;
border-radius: 4px;
}

& + .help {
margin-top: 4px;
}
}

.ur-form-field--sm {
width: 80px;
flex: 0 0 80px;
Expand Down
2 changes: 1 addition & 1 deletion assets/css/admin-rtl.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/css/admin.css

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions assets/css/admin.scss
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@
.hndle {
border-bottom: 1px solid #ccd0d4;
}

.ur-input {
max-width: inherit;
}
}
}

Expand Down
1 change: 1 addition & 0 deletions assets/css/variables/_colors.scss
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ $border_color: $color_gray_four;
$label_color: $color_gray_two;
$border_color_input: darken($border_color, 10%);
$input_background_color: $color_gray_five;
$input_color: $color_gray_two;
$flat_background: $color_gray_five;
$rounded-color: darken($border_color, 10%);

Expand Down
12 changes: 12 additions & 0 deletions assets/js/admin/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@
*/
jQuery(function ($) {

// Sync Number field's options with hidden corresponding elements.
$( document.body ).on( 'input', '.ur_advance_setting.ur-settings-min', function() {
$( '.ur-selected-item.ur-item-active .ur_advance_setting.ur-settings-min' ).val( $(this).val() );
});
$( document.body ).on( 'input', '.ur_advance_setting.ur-settings-max', function() {
$( '.ur-selected-item.ur-item-active .ur_advance_setting.ur-settings-max' ).val( $(this).val() );
});
$( document.body ).on( 'input', '.ur_advance_setting.ur-settings-step', function() {
$( '.ur-selected-item.ur-item-active .ur_advance_setting.ur-settings-step' ).val( $(this).val() );
});

// Bind UI Action handlers for searching fields.
$( document.body ).on( 'input', '#ur-search-fields', function() {
var search_string = $( this ).val().toLowerCase();
Expand Down Expand Up @@ -962,6 +973,7 @@ jQuery(function ($) {

$('.ur-export-users-page').prepend(message_string);
$('#jsonfile').val("");
$( '.user-registration-custom-selected-file' ).html( user_registration_admin_data.no_file_selected );
}
});
});
Expand Down
2 changes: 1 addition & 1 deletion assets/js/admin/admin.min.js

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions assets/js/admin/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,11 @@
return ( 'checked' === $url.attr( 'checked' ) ) ? 'required' : false;
});
});

// Change span with file name when user selects a file.
$( '.user-registration-custom-file__input' ).change( function(e) {
var file = $( '.user-registration-custom-file__input' ).prop( 'files' )[0];

$( '.user-registration-custom-selected-file' ).html( file.name );
});
})(jQuery);
2 changes: 1 addition & 1 deletion assets/js/admin/settings.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions includes/abstracts/abstract-ur-form-field.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,10 @@ public function frontend_includes( $data = array(), $form_id, $field_type, $fiel
$form_data['max'] = $data['advance_setting']->max;
}

if ( isset( $data['advance_setting']->step ) ) {
$form_data['step'] = $data['advance_setting']->step;
}

if ( isset( $data['advance_setting']->default_value ) ) {
$form_data['default'] = $data['advance_setting']->default_value;
}
Expand Down
1 change: 1 addition & 0 deletions includes/admin/class-ur-admin-assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ public function admin_scripts() {
'form_one_time_draggable_fields' => ur_get_one_time_draggable_fields(),
'i18n_admin' => self::get_i18n_admin_data(),
'add_new' => esc_html( 'Add New', 'user-registratoin' ),
'no_file_selected' => esc_html( 'No file selected.', 'user-registration' )
);

wp_localize_script( 'user-registration-admin', 'user_registration_admin_data', $params );
Expand Down
7 changes: 6 additions & 1 deletion includes/admin/class-ur-admin-menus.php
Original file line number Diff line number Diff line change
Expand Up @@ -488,8 +488,13 @@ private function bulk_actions() {
}

$registrations = array_map( 'absint', (array) $_REQUEST['registration'] );
$action = $_REQUEST['action'];

switch ( $_REQUEST['action'] ) {
if( -1 == $_REQUEST['action'] ) {
$action = $_REQUEST['action2'];
}

switch ( $action ) {
case 'trash':
$this->bulk_trash( $registrations );
break;
Expand Down
2 changes: 1 addition & 1 deletion includes/admin/views/html-admin-page-export-users.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</p>

<p>
<select name="export_users" class="forms-list">
<select name="export_users" class="ur-input forms-list">
<?php
foreach ( $all_forms as $form_id => $form ) {
echo '<option value ="' . esc_attr( $form_id ) . '">' . esc_html( $form ) . '</option>';
Expand Down
16 changes: 11 additions & 5 deletions includes/admin/views/html-admin-page-import-export-forms.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
</p>

<p>
<select name="formid" class="forms-list">
<select name="formid" class="ur-input forms-list">
<?php
foreach ( $all_forms as $form_id => $form ) {
echo '<option value ="' . esc_attr( $form_id ) . '">' . esc_html( $form ) . '</option>';
Expand All @@ -43,10 +43,16 @@
<p class="help">
<?php _e( 'Import your forms along with their settings from <strong>JSON</strong> file.', 'user-registration' ); ?>
</p>
<p>
<input type="file" name="jsonfile" id="jsonfile" accept=".json"/>
<span class="description">Only JSON file format allowed.</span>
</p>
<div class="ur-form-group">
<div class="user-registration-custom-file">
<input type="file" class="user-registration-custom-file__input" name="jsonfile" id="jsonfile" accept=".json"/>
<label class="user-registration-custom-file__label" for="csvfile">
<span class="user-registration-custom-selected-file"><?php esc_html_e( 'No file selected.', 'user_registration_import_users' ); ?></span>
<span class="user-registration-custom-file__button">Browse File</span>
</label>
</div>
<p class="help">Only JSON file format allowed.</p>
</div>
<div class="publishing-action">
<input type="button" class="button button-primary ur_import_form_action_button" name="user_registration_import_form" value="<?php _e( 'Import Forms', 'user-registration' ); ?>">
</div>
Expand Down
8 changes: 6 additions & 2 deletions includes/class-ur-user-approval.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,16 @@ public function set_user_status( $form_data, $form_id, $user_id ) {
/**
* Check the status of an user on login.
*
* @param WP_User $user Users.
* @param mixed $user Users.
* @param string $password Password.
*
* @return \WP_Error
*/
public function check_status_on_login( WP_User $user, $password ) {
public function check_status_on_login( $user, $password ) {

if( ! $user instanceof WP_User ) {
return $user;
}

$form_id = ur_get_form_id_by_userid( $user->ID );

Expand Down
2 changes: 1 addition & 1 deletion includes/frontend/class-ur-frontend-form-handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ public static function handle_form( $form_data, $form_id ) {
$user_id = wp_insert_user( $userdata ); // Insert user data in users table.

self::ur_update_user_meta( $user_id, self::$valid_form_data, $form_id ); // Insert user data in usermeta table.
do_action( 'user_registration_after_register_user_action', self::$valid_form_data, $form_id, $user_id );

if ( $user_id > 0 ) {
$login_option = ur_get_single_post_meta( $form_id, 'user_registration_form_setting_login_options', get_option( 'user_registration_general_setting_login_options', 'default' ) );
Expand All @@ -116,6 +115,7 @@ public static function handle_form( $form_data, $form_id ) {
$success_params['form_login_option'] = $login_option;
$success_params = apply_filters( 'user_registration_success_params', $success_params, self::$valid_form_data, $form_id, $user_id );

do_action( 'user_registration_after_register_user_action', self::$valid_form_data, $form_id, $user_id );
wp_send_json_success( $success_params );
}
wp_send_json_error(
Expand Down
12 changes: 8 additions & 4 deletions includes/functions-ur-template.php
Original file line number Diff line number Diff line change
Expand Up @@ -209,12 +209,16 @@ function user_registration_form_field( $key, $args, $value = null ) {
$args['custom_attributes']['maxlength'] = absint( $args['size'] );
}

if ( $args['min'] ) {
$args['custom_attributes']['min'] = absint( $args['min'] );
if ( ! empty( $args['min'] ) || '0' === $args['min'] ) {
$args['custom_attributes']['min'] = $args['min'];
}

if ( $args['max'] ) {
$args['custom_attributes']['max'] = absint( $args['max'] );
if ( ! empty( $args['max'] ) || '0' === $args['max'] ) {
$args['custom_attributes']['max'] = $args['max'];
}

if ( ! empty( $args['step'] ) ) {
$args['custom_attributes']['step'] = $args['step'];
}

if ( ! empty( $args['autocomplete'] ) ) {
Expand Down
Loading

0 comments on commit 073ddb8

Please sign in to comment.