Skip to content

Commit

Permalink
Version bump to 2.0.3
Browse files Browse the repository at this point in the history
Squashed commit of the following :

commit 6a1608b
Author: deepench <[email protected]>
Date:   Wed Sep 22 11:07:51 2021 +0545

    Fix - Multiple Choice shown in edit profile

commit e1ef88e
Author: Deependra Chaudhary <[email protected]>
Date:   Wed Sep 22 08:58:54 2021 +0545

    Feature - Multiple choice Field  (#365)

    * Added - Multiple Choice Field in from builder

    * Removed - Unwanted Options Code

    * Options -  Data modified send as object

    * Dev - Multiple choice compability

    * Added - choice limit in multiple choice field

    * Code Cleanup

    * icon design for multichoice and total field

    * Code Cleanup

    * Code Cleanup

    * Payments field are removed from edit user

    * code Cleanup

    * code Cleanup

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

commit 7104bed
Author: Deependra Chaudhary <[email protected]>
Date:   Tue Sep 21 15:47:02 2021 +0545

    Enhancement - Time Picker Field (#364)

    * Enhance - Timepicker field

    * Removed - Current time button

    * Fix - Time Range issue

    * Code Cleanup

    * Code Cleanup

    * TImepicker - Enhancement in edit profile

    * TImepicker - Enhancement in edit profile

    * Code Cleanup

commit acd63ff
Author: Prajjwal Poudel <[email protected]>
Date:   Tue Sep 21 11:15:51 2021 +0545

    Enhance - User creation capability check while registering users (#366)

commit 50eb2e2
Author: dipuchaudhary <[email protected]>
Date:   Mon Sep 13 08:44:26 2021 +0545

    Fix - wp-editor script enqueued incorrectly in widgets

commit ba4717b
Author: deepench <[email protected]>
Date:   Mon Sep 6 12:49:43 2021 +0545

    Fix - Gutenberg block css issue
  • Loading branch information
iamprazol committed Sep 22, 2021
1 parent 1031308 commit a09c276
Show file tree
Hide file tree
Showing 31 changed files with 556 additions and 172 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@

= 2.0.3 - 22/09/2021
* Enhance - User creation capability check while registering users.
* Dev - Multiple choice field compatibility.
* Dev - Time Picker field compatibility.
* Fix - Gutenberg block css issue.
* Fix - wp editor script enqueued incorrectly in widgets.

= 2.0.2 - 01/09/2021
* Fix - Missing sanitization on profile picture url
* Fix - Choice field issue in edit profile.
Expand Down
15 changes: 14 additions & 1 deletion assets/css/_fonts.scss
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,17 @@
font-style: normal;
font-display: block;
}

@font-face {
font-family: 'UserRegistration';
src: url('../fonts/UserRegistration.eot?v5p6f');
src: url('../fonts/UserRegistration.eot?v5p6f#iefix') format('embedded-opentype'),
url('../fonts/UserRegistration.ttf?v5p6f') format('truetype'),
url('../fonts/UserRegistration.woff?v5p6f') format('woff'),
url('../fonts/UserRegistration.svg?v5p6f#UserRegistration') format('svg');
font-weight: normal;
font-style: normal;
font-display: block;
}
[class^="ur-icon-"],
[class*=" ur-icon-"] {
/* use !important to prevent issues with browser extensions that change fonts */
Expand Down Expand Up @@ -104,6 +114,9 @@ $field-icons: (
range: "\e029",
course: "\e02a",
mailerlite: "\e02b",
stripe: "\e02d",
multichoice: "\e02e",
total: "\e02f"
);

/* For each key in the map, creating own class */
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.

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.

19 changes: 11 additions & 8 deletions assets/css/user-registration.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,17 @@
// Components
@import "components/button", "components/modal";

.components-radio-control__option {
padding-left: 14px;
margin-bottom: 20px !important;
}
.ur-gutenberg-form-selector-wrap {

.components-radio-control__option {
padding-left: 14px;
margin-bottom: 20px !important;
}

.components-base-control__field {
display: flex;
justify-content: center;
.components-base-control__field {
display: flex;
justify-content: center;
}
}

.wp-core-ui select {
Expand Down Expand Up @@ -167,7 +170,7 @@

.ur-field-item {
margin-bottom: 20px;

&.field-multiple_choice,
&.field-checkbox,
&.field-radio {
ul {
Expand Down
Binary file modified assets/fonts/UserRegistration.eot
Binary file not shown.
17 changes: 10 additions & 7 deletions assets/fonts/UserRegistration.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/fonts/UserRegistration.ttf
Binary file not shown.
Binary file modified assets/fonts/UserRegistration.woff
Binary file not shown.
197 changes: 185 additions & 12 deletions assets/js/admin/form-builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -515,9 +515,39 @@
.hasClass("ur-setting-checkbox");

if ("options" === $(this).attr("data-field")) {
var choice_value = URFormBuilder.get_ur_data(
$(this)
).trim();
if (
"multiple_choice" ===
$(this).attr("data-field-name")
) {
var li_elements = $(this).closest("ul").find("li");
var array_value = [];

li_elements.each(function (index, element) {
var label = $(element)
.find("input.ur-type-checkbox-label")
.val();

var value = $(element)
.find("input.ur-type-checkbox-money-input")
.val();
if (
array_value.every(function (each_value) {
return each_value.label !== label;
})
) {
general_setting_data["options"] =
array_value.push({
label: label,
value: value,
});
}
general_setting_data["options"] = array_value;
});
} else {
var choice_value = URFormBuilder.get_ur_data(
$(this)
).trim();
}
if (
option_values.every(function (each_value) {
return each_value !== choice_value;
Expand Down Expand Up @@ -2154,6 +2184,18 @@
)
) {
URFormBuilder.render_check_box($(this));
} else if (
$this_obj
.closest(
".ur-general-setting-block"
)
.hasClass(
"ur-general-setting-multiple_choice"
)
) {
URFormBuilder.render_multiple_choice(
$(this)
);
}
}
});
Expand Down Expand Up @@ -2185,6 +2227,16 @@
.hasClass("ur-general-setting-checkbox")
) {
URFormBuilder.render_check_box($(this));
} else if (
$this_obj
.closest(".ur-general-setting-block")
.hasClass(
"ur-general-setting-multiple_choice"
)
) {
URFormBuilder.render_multiple_choice(
$(this)
);
}

URFormBuilder.trigger_general_setting_options(
Expand Down Expand Up @@ -2547,6 +2599,9 @@
case "radio":
URFormBuilder.render_radio(value);
break;
case "multiple_choice":
URFormBuilder.render_multiple_choice(value);
break;
}
},
/**
Expand Down Expand Up @@ -2712,6 +2767,91 @@
}
}
},
/**
* Reflects changes in multiple choice field of field settings into selected field in form builder area.
*
* @param object this_node multiple choice field from field settings.
*
* @since 2.0.3
*/
render_multiple_choice: function (this_node) {
var array_value = [];
var li_elements = this_node.closest("ul").find("li");
var checked_index = this_node.closest("li").index();
li_elements.each(function (index, element) {
var label = $(element)
.find("input.ur-type-checkbox-label")
.val();
var value = $(element)
.find("input.ur-type-checkbox-money-input")
.val();
var currency = $(element)
.find("input.ur-type-checkbox-money-input")
.attr("data-currency");

label = label.trim();
value = value.trim();
currency = currency.trim();
checkbox = $(element)
.find("input.ur-type-checkbox-value")
.is(":checked");

if (
array_value.every(function (each_value) {
return each_value.label !== label;
})
) {
array_value.push({
label: label,
value: value,
currency: currency,
checkbox: checkbox,
});
}
});

var wrapper = $(".ur-selected-item.ur-item-active");
var checkbox = wrapper.find(".ur-field");
checkbox.html("");

for (var i = 0; i < array_value.length; i++) {
if (array_value[i] !== "") {
checkbox.append(
'<label><input value="' +
array_value[i].label.trim() +
'" type="checkbox" ' +
(array_value[i].checkbox ? "checked" : "") +
" disabled>" +
array_value[i].label.trim() +
" - " +
array_value[i].currency.trim() +
" " +
array_value[i].value.trim() +
"</label>"
);
}
}

if ("checkbox" === this_node.attr("type")) {
if (this_node.is(":checked")) {
wrapper
.find(
".ur-general-setting-options li:nth(" +
checked_index +
') input[data-field="default_value"]'
)
.prop("checked", true);
} else {
wrapper
.find(
".ur-general-setting-options li:nth(" +
checked_index +
') input[data-field="default_value"]'
)
.prop("checked", false);
}
}
},
/**
* Reflects changes in options of choice fields of field settings into selected field in form builder area.
*
Expand All @@ -2720,22 +2860,37 @@
trigger_general_setting_options: function ($label) {
var wrapper = $(".ur-selected-item.ur-item-active");
var index = $label.closest("li").index();
wrapper
.find(
".ur-general-setting-block li:nth(" +
index +
') input[data-field="' +
$label.attr("data-field") +
'"]'
)
.val($label.val());
var multiple_choice = $label.attr("data-field-name");

if ("multiple_choice" === multiple_choice) {
wrapper
.find(
".ur-general-setting-block li:nth(" +
index +
') input[name="' +
$label.attr("name") +
'"]'
)
.val($label.val());
} else {
wrapper
.find(
".ur-general-setting-block li:nth(" +
index +
') input[data-field="' +
$label.attr("data-field") +
'"]'
)
.val($label.val());
}
wrapper
.find(
".ur-general-setting-block li:nth(" +
index +
') input[data-field="default_value"]'
)
.val($label.val());

$label
.closest("li")
.find('[data-field="default_value"]')
Expand Down Expand Up @@ -2932,6 +3087,12 @@
.hasClass("ur-general-setting-checkbox")
) {
URFormBuilder.render_check_box($this_obj);
} else if (
$this
.closest(".ur-general-setting-block")
.hasClass("ur-general-setting-multiple_choice")
) {
URFormBuilder.render_multiple_choice($this_obj);
}
},
/**
Expand Down Expand Up @@ -2984,6 +3145,12 @@
.hasClass("ur-general-setting-checkbox")
) {
URFormBuilder.render_check_box($this);
} else if (
$this
.closest(".ur-general-setting-block")
.hasClass("ur-general-setting-multiple_choice")
) {
URFormBuilder.render_multiple_choice($this);
}
},
/**
Expand Down Expand Up @@ -3019,6 +3186,12 @@
.hasClass("ur-general-setting-checkbox")
) {
URFormBuilder.render_check_box($any_siblings);
} else if (
$any_siblings
.closest(".ur-general-setting-block")
.hasClass("ur-general-setting-multiple_choice")
) {
URFormBuilder.render_multiple_choice($any_siblings);
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion assets/js/admin/form-builder.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit a09c276

Please sign in to comment.