From a31b9740463b537ea72cc77b2f1f2de0f3f027b1 Mon Sep 17 00:00:00 2001 From: llaurentiu Date: Thu, 7 Dec 2023 17:01:25 +0100 Subject: [PATCH 1/7] Fix edit grid events in read only mode (#5421) --- src/components/editgrid/EditGrid.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/editgrid/EditGrid.js b/src/components/editgrid/EditGrid.js index 4f5da05fec..4236ff98fa 100644 --- a/src/components/editgrid/EditGrid.js +++ b/src/components/editgrid/EditGrid.js @@ -550,7 +550,7 @@ export default class EditGridComponent extends NestedArrayComponent { }) => { const elements = row.getElementsByClassName(className); Array.prototype.forEach.call(elements, (element) => { - if (this.options.readOnly && _.intersection(element.classList, ['editRow', 'removeRow']).length) { + if (this.options.pdf && _.intersection(element.classList, ['editRow', 'removeRow']).length) { element.style.display = 'none'; } else { From 9975dae39a0ea1a7543bc6ecd5a7a7880e11c348 Mon Sep 17 00:00:00 2001 From: Roman Date: Thu, 7 Dec 2023 19:09:31 +0300 Subject: [PATCH 2/7] fixed tests (#5430) --- package.json | 2 +- .../component-bootstrap-columns-multiple.html | 16 ++----- .../component-bootstrap-columns-readOnly.html | 16 ++----- .../component-bootstrap-columns-required.html | 16 ++----- test/renders/component-bootstrap-columns.html | 16 ++----- ...component-bootstrap-datagrid-readOnly.html | 2 +- .../component-bootstrap-datamap-readOnly.html | 2 +- .../component-bootstrap-file-readOnly.html | 4 +- test/renders/form-bootstrap-columnsForm.html | 16 ++----- test/renders/form-bootstrap-defaults.html | 16 ++----- ...form-bootstrap-formWithCollapsedPanel.html | 2 +- ...-bootstrap-formWithDateTimeComponents.html | 2 +- ...orm-bootstrap-initiallyCollapsedPanel.html | 2 +- test/renders/form-bootstrap-layout.html | 44 +++++-------------- ...pleTextareaInsideConditionalComponent.html | 16 ++----- ...Only-calculateValueWithManualOverride.html | 2 +- .../form-bootstrap-readOnly-columnsForm.html | 16 ++----- .../renders/form-bootstrap-readOnly-data.html | 6 +-- .../form-bootstrap-readOnly-defaults.html | 18 +++----- ...strap-readOnly-formWithCollapsedPanel.html | 2 +- ...rap-readOnly-formWithCustomFormatDate.html | 2 +- ...p-readOnly-formWithDateTimeComponents.html | 2 +- ...trap-readOnly-initiallyCollapsedPanel.html | 2 +- .../form-bootstrap-readOnly-layout.html | 44 +++++-------------- ...pleTextareaInsideConditionalComponent.html | 16 ++----- .../form-bootstrap-readOnly-premium.html | 4 +- ...form-bootstrap-readOnly-settingErrors.html | 16 ++----- .../renders/form-bootstrap-settingErrors.html | 16 ++----- yarn.lock | 8 ++-- 29 files changed, 97 insertions(+), 229 deletions(-) diff --git a/package.json b/package.json index 9de818ead2..25013bfc55 100644 --- a/package.json +++ b/package.json @@ -78,7 +78,7 @@ }, "homepage": "https://github.com/formio/formio.js#readme", "dependencies": { - "@formio/bootstrap": "^3.0.0-rc.13", + "@formio/bootstrap": "^3.0.0-rc.20", "@formio/choices.js": "^10.2.0", "@formio/core": "1.3.0-rc.16", "@formio/text-mask-addons": "^3.8.0-formio.2", diff --git a/test/renders/component-bootstrap-columns-multiple.html b/test/renders/component-bootstrap-columns-multiple.html index 37857bd664..41d74a3f1d 100644 --- a/test/renders/component-bootstrap-columns-multiple.html +++ b/test/renders/component-bootstrap-columns-multiple.html @@ -1,17 +1,9 @@
-
+
-
+
\ No newline at end of file diff --git a/test/renders/component-bootstrap-columns-readOnly.html b/test/renders/component-bootstrap-columns-readOnly.html index ffc36051c6..04b93cc135 100644 --- a/test/renders/component-bootstrap-columns-readOnly.html +++ b/test/renders/component-bootstrap-columns-readOnly.html @@ -1,17 +1,9 @@
-
+
-
+
\ No newline at end of file diff --git a/test/renders/component-bootstrap-columns-required.html b/test/renders/component-bootstrap-columns-required.html index dc26778e24..1250234f3c 100644 --- a/test/renders/component-bootstrap-columns-required.html +++ b/test/renders/component-bootstrap-columns-required.html @@ -1,18 +1,10 @@
-
+
-
+
\ No newline at end of file diff --git a/test/renders/component-bootstrap-columns.html b/test/renders/component-bootstrap-columns.html index ffc36051c6..04b93cc135 100644 --- a/test/renders/component-bootstrap-columns.html +++ b/test/renders/component-bootstrap-columns.html @@ -1,17 +1,9 @@
-
+
-
+
\ No newline at end of file diff --git a/test/renders/component-bootstrap-datagrid-readOnly.html b/test/renders/component-bootstrap-datagrid-readOnly.html index 6a7f7653dc..c441df38be 100644 --- a/test/renders/component-bootstrap-datagrid-readOnly.html +++ b/test/renders/component-bootstrap-datagrid-readOnly.html @@ -3,7 +3,7 @@ Data Grid + " style="table-layout: fixed;"> diff --git a/test/renders/component-bootstrap-datamap-readOnly.html b/test/renders/component-bootstrap-datamap-readOnly.html index 41a3a923d6..86d1e396b1 100644 --- a/test/renders/component-bootstrap-datamap-readOnly.html +++ b/test/renders/component-bootstrap-datamap-readOnly.html @@ -3,7 +3,7 @@ Data Map
+ " style="table-layout: fixed;">
diff --git a/test/renders/component-bootstrap-file-readOnly.html b/test/renders/component-bootstrap-file-readOnly.html index 4454286bad..7073b3787d 100644 --- a/test/renders/component-bootstrap-file-readOnly.html +++ b/test/renders/component-bootstrap-file-readOnly.html @@ -5,8 +5,10 @@
diff --git a/test/renders/form-bootstrap-columnsForm.html b/test/renders/form-bootstrap-columnsForm.html index 3b6d0adb1e..36a55c167f 100644 --- a/test/renders/form-bootstrap-columnsForm.html +++ b/test/renders/form-bootstrap-columnsForm.html @@ -1,19 +1,11 @@
-
+
-
+
diff --git a/test/renders/form-bootstrap-defaults.html b/test/renders/form-bootstrap-defaults.html index 8428cd395e..201abbe9e8 100644 --- a/test/renders/form-bootstrap-defaults.html +++ b/test/renders/form-bootstrap-defaults.html @@ -271,12 +271,8 @@
-
+
-
+
diff --git a/test/renders/form-bootstrap-formWithCollapsedPanel.html b/test/renders/form-bootstrap-formWithCollapsedPanel.html index adc22bb934..39fbc5878e 100644 --- a/test/renders/form-bootstrap-formWithCollapsedPanel.html +++ b/test/renders/form-bootstrap-formWithCollapsedPanel.html @@ -4,7 +4,7 @@
diff --git a/test/renders/form-bootstrap-formWithDateTimeComponents.html b/test/renders/form-bootstrap-formWithDateTimeComponents.html index d9740cf607..adf192482b 100644 --- a/test/renders/form-bootstrap-formWithDateTimeComponents.html +++ b/test/renders/form-bootstrap-formWithDateTimeComponents.html @@ -4,7 +4,7 @@
- + Panel
diff --git a/test/renders/form-bootstrap-initiallyCollapsedPanel.html b/test/renders/form-bootstrap-initiallyCollapsedPanel.html index adc22bb934..39fbc5878e 100644 --- a/test/renders/form-bootstrap-initiallyCollapsedPanel.html +++ b/test/renders/form-bootstrap-initiallyCollapsedPanel.html @@ -4,7 +4,7 @@
diff --git a/test/renders/form-bootstrap-layout.html b/test/renders/form-bootstrap-layout.html index efbca30fbb..b5ea605fc2 100644 --- a/test/renders/form-bootstrap-layout.html +++ b/test/renders/form-bootstrap-layout.html @@ -1,12 +1,8 @@
-
+
-
+
-
+
-
+
-
+
@@ -106,7 +86,7 @@
@@ -116,7 +96,7 @@
- +
diff --git a/test/renders/form-bootstrap-multipleTextareaInsideConditionalComponent.html b/test/renders/form-bootstrap-multipleTextareaInsideConditionalComponent.html index 3d297afc22..fbb6a6b414 100644 --- a/test/renders/form-bootstrap-multipleTextareaInsideConditionalComponent.html +++ b/test/renders/form-bootstrap-multipleTextareaInsideConditionalComponent.html @@ -1,12 +1,8 @@
-
+
@@ -32,12 +28,8 @@
-
+
diff --git a/test/renders/form-bootstrap-readOnly-calculateValueWithManualOverride.html b/test/renders/form-bootstrap-readOnly-calculateValueWithManualOverride.html index 5892e52ae0..d924be2828 100644 --- a/test/renders/form-bootstrap-readOnly-calculateValueWithManualOverride.html +++ b/test/renders/form-bootstrap-readOnly-calculateValueWithManualOverride.html @@ -31,7 +31,7 @@ grid + " style="table-layout: fixed;">
diff --git a/test/renders/form-bootstrap-readOnly-columnsForm.html b/test/renders/form-bootstrap-readOnly-columnsForm.html index 6456ddef39..e51c7902d1 100644 --- a/test/renders/form-bootstrap-readOnly-columnsForm.html +++ b/test/renders/form-bootstrap-readOnly-columnsForm.html @@ -1,19 +1,11 @@
-
+
-
+
diff --git a/test/renders/form-bootstrap-readOnly-data.html b/test/renders/form-bootstrap-readOnly-data.html index a70ce608f3..5b952d9b10 100644 --- a/test/renders/form-bootstrap-readOnly-data.html +++ b/test/renders/form-bootstrap-readOnly-data.html @@ -25,7 +25,7 @@ Data Grid + " style="table-layout: fixed;">
@@ -171,7 +171,7 @@ Data Grid + " style="table-layout: fixed;">
@@ -207,7 +207,7 @@ Conditional Data Grid + " style="table-layout: fixed;">
diff --git a/test/renders/form-bootstrap-readOnly-defaults.html b/test/renders/form-bootstrap-readOnly-defaults.html index e1a2696d7c..01b58b5764 100644 --- a/test/renders/form-bootstrap-readOnly-defaults.html +++ b/test/renders/form-bootstrap-readOnly-defaults.html @@ -275,12 +275,8 @@
-
+
-
+
@@ -413,7 +405,7 @@ Data Grid + " style="table-layout: fixed;">
diff --git a/test/renders/form-bootstrap-readOnly-formWithCollapsedPanel.html b/test/renders/form-bootstrap-readOnly-formWithCollapsedPanel.html index 630affe70f..eb286bceba 100644 --- a/test/renders/form-bootstrap-readOnly-formWithCollapsedPanel.html +++ b/test/renders/form-bootstrap-readOnly-formWithCollapsedPanel.html @@ -4,7 +4,7 @@
diff --git a/test/renders/form-bootstrap-readOnly-formWithCustomFormatDate.html b/test/renders/form-bootstrap-readOnly-formWithCustomFormatDate.html index 3299bcfe08..3f125cb977 100644 --- a/test/renders/form-bootstrap-readOnly-formWithCustomFormatDate.html +++ b/test/renders/form-bootstrap-readOnly-formWithCustomFormatDate.html @@ -5,7 +5,7 @@ Data Grid + " style="table-layout: fixed;">
diff --git a/test/renders/form-bootstrap-readOnly-formWithDateTimeComponents.html b/test/renders/form-bootstrap-readOnly-formWithDateTimeComponents.html index 35f6c5fbec..c396a1c286 100644 --- a/test/renders/form-bootstrap-readOnly-formWithDateTimeComponents.html +++ b/test/renders/form-bootstrap-readOnly-formWithDateTimeComponents.html @@ -4,7 +4,7 @@
- + Panel
diff --git a/test/renders/form-bootstrap-readOnly-initiallyCollapsedPanel.html b/test/renders/form-bootstrap-readOnly-initiallyCollapsedPanel.html index 630affe70f..eb286bceba 100644 --- a/test/renders/form-bootstrap-readOnly-initiallyCollapsedPanel.html +++ b/test/renders/form-bootstrap-readOnly-initiallyCollapsedPanel.html @@ -4,7 +4,7 @@
diff --git a/test/renders/form-bootstrap-readOnly-layout.html b/test/renders/form-bootstrap-readOnly-layout.html index 25ff20f8de..b95b05780c 100644 --- a/test/renders/form-bootstrap-readOnly-layout.html +++ b/test/renders/form-bootstrap-readOnly-layout.html @@ -1,12 +1,8 @@
-
+
-
+
-
+
-
+
-
+
@@ -106,7 +86,7 @@
@@ -116,7 +96,7 @@
- +
diff --git a/test/renders/form-bootstrap-readOnly-multipleTextareaInsideConditionalComponent.html b/test/renders/form-bootstrap-readOnly-multipleTextareaInsideConditionalComponent.html index 1545ad1883..b93924f510 100644 --- a/test/renders/form-bootstrap-readOnly-multipleTextareaInsideConditionalComponent.html +++ b/test/renders/form-bootstrap-readOnly-multipleTextareaInsideConditionalComponent.html @@ -1,12 +1,8 @@
-
+
@@ -32,12 +28,8 @@
-
+
diff --git a/test/renders/form-bootstrap-readOnly-premium.html b/test/renders/form-bootstrap-readOnly-premium.html index 267a50058a..bdc6a3c936 100644 --- a/test/renders/form-bootstrap-readOnly-premium.html +++ b/test/renders/form-bootstrap-readOnly-premium.html @@ -7,8 +7,10 @@
diff --git a/test/renders/form-bootstrap-readOnly-settingErrors.html b/test/renders/form-bootstrap-readOnly-settingErrors.html index 5fa8f8d49f..953f005243 100644 --- a/test/renders/form-bootstrap-readOnly-settingErrors.html +++ b/test/renders/form-bootstrap-readOnly-settingErrors.html @@ -40,12 +40,8 @@
-
+
-
+
diff --git a/test/renders/form-bootstrap-settingErrors.html b/test/renders/form-bootstrap-settingErrors.html index e86179af86..39d901b354 100644 --- a/test/renders/form-bootstrap-settingErrors.html +++ b/test/renders/form-bootstrap-settingErrors.html @@ -40,12 +40,8 @@
-
+
-
+
diff --git a/yarn.lock b/yarn.lock index 5597f5e203..c975dc21a7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -249,10 +249,10 @@ resolved "https://registry.npmjs.org/@eslint/js/-/js-8.46.0.tgz#3f7802972e8b6fe3f88ed1aabc74ec596c456db6" integrity sha512-a8TLtmPi8xzPkCbp/OGFUo5yhRkHM2Ko9kOWP4znJr0WAhWyThaw3PnwX4vOTWOAMsV2uRt32PPDcEz63esSaA== -"@formio/bootstrap@^3.0.0-rc.13": - version "3.0.0-rc.13" - resolved "https://registry.npmjs.org/@formio/bootstrap/-/bootstrap-3.0.0-rc.13.tgz#d4ddedabc4fe9ffc2fa589750cdcc8efb8f9e0ae" - integrity sha512-3UWb1dmNUj9R9ZB0zdvsOoUM5aHkjx8cdv6pIfjF9wTe+1pVwaU9jTxL9elb503IEMhcEmAZ0gmWBVfFxfkxEQ== +"@formio/bootstrap@^3.0.0-rc.20": + version "3.0.0-rc.20" + resolved "https://registry.yarnpkg.com/@formio/bootstrap/-/bootstrap-3.0.0-rc.20.tgz#de3eabd8c8bc81167d67e0ec6d95a4be21f0ce0a" + integrity sha512-R1woezpxiLmHT0ntQulbKzej9OGQujCaGveS8/HFjGWwPOJj8k+ZQFfD+R1A8SuQYdZCSisw6VdGcKJYb9dcJA== "@formio/choices.js@^10.2.0": version "10.2.0" From c9431f38dc219465e7914b66a824627fc63a7a85 Mon Sep 17 00:00:00 2001 From: TanyaGashtold <61136841+TanyaGashtold@users.noreply.github.com> Date: Thu, 7 Dec 2023 19:11:40 +0300 Subject: [PATCH 3/7] FIO-7588: fixed string value for Survey and Select (#5422) * FIO-7588: fixed string value for Survey and Select * fixed render tests --- src/components/select/Select.js | 23 ++++++++++++------- src/components/select/Select.unit.js | 6 +++++ src/components/survey/Survey.js | 11 +++++++++ .../testBasicComponentSettings/values.js | 2 +- ...ponent-bootstrap-survey-string-value1.html | 2 +- ...ponent-bootstrap-survey-string-value2.html | 2 +- test/updateRenders.js | 2 +- 7 files changed, 36 insertions(+), 12 deletions(-) diff --git a/src/components/select/Select.js b/src/components/select/Select.js index d41a252c6d..84c0d86e4d 100644 --- a/src/components/select/Select.js +++ b/src/components/select/Select.js @@ -3,7 +3,7 @@ import { Formio } from '../../Formio'; import ListComponent from '../_classes/list/ListComponent'; import Input from '../_classes/input/Input'; import Form from '../../Form'; -import { getRandomComponentId, boolValue, isPromise, componentValueTypes, getComponentSavedTypes } from '../../utils/utils'; +import { getRandomComponentId, boolValue, isPromise, componentValueTypes, getComponentSavedTypes, unescapeHTML } from '../../utils/utils'; import Choices from '../../utils/ChoicesWrapper'; export default class SelectComponent extends ListComponent { @@ -1221,10 +1221,10 @@ export default class SelectComponent extends ListComponent { return added; } - getValueAsString(data) { + getValueAsString(data, options) { return (this.component.multiple && Array.isArray(data)) - ? data.map(this.asString.bind(this)).join(', ') - : this.asString(data); + ? data.map((v) => this.asString(v, options)).join(', ') + : this.asString(data, options); } getValue() { @@ -1636,7 +1636,7 @@ export default class SelectComponent extends ListComponent { ); } - asString(value) { + asString(value, options = {}) { value = value ?? this.getValue(); //need to convert values to strings to be able to compare values with available options that are strings const convertToString = (data, valueProperty) => { @@ -1697,13 +1697,20 @@ export default class SelectComponent extends ListComponent { return value; } + const getTemplateValue = (v) => { + const itemTemplate = this.itemTemplate(v); + return options.csv && itemTemplate + ? unescapeHTML(itemTemplate) + : itemTemplate; + }; + if (Array.isArray(value)) { const items = []; - value.forEach(item => items.push(this.itemTemplate(item))); + value.forEach(item => items.push(getTemplateValue(item))); if (this.component.dataSrc === 'resource' && items.length > 0 ) { return items.join(', '); } - else if ( items.length > 0) { + else if (items.length > 0) { return items.join('
'); } else { @@ -1716,7 +1723,7 @@ export default class SelectComponent extends ListComponent { } return !_.isNil(value) - ? this.itemTemplate(value) + ? getTemplateValue(value) : '-'; } diff --git a/src/components/select/Select.unit.js b/src/components/select/Select.unit.js index 51bb3f06fa..b3eef6b391 100644 --- a/src/components/select/Select.unit.js +++ b/src/components/select/Select.unit.js @@ -60,6 +60,12 @@ describe('Select Component', () => { }); }); + it('Should return plain text when csv option is provided', () => { + return Harness.testCreate(SelectComponent, comp1).then((component) => { + assert.equal(component.getView('red', { csv:true }), 'Red'); + }); + }); + it('should correctly determine storage type when dataType is auto', function(done) { Harness.testCreate(SelectComponent, comp4).then((component) => { const value = component.normalizeSingleValue('true'); diff --git a/src/components/survey/Survey.js b/src/components/survey/Survey.js index 28c6f1f02e..db2274bcbe 100644 --- a/src/components/survey/Survey.js +++ b/src/components/survey/Survey.js @@ -179,6 +179,17 @@ export default class SurveyComponent extends Field { return result; } + if (_.isPlainObject(value)) { + const { values = [], questions = [] } = this.component; + return _.isEmpty(value) + ? '' + : _.map(value,(v, q) => { + const valueLabel = _.get(_.find(values, val => _.isEqual(val.value, v)), 'label', v); + const questionLabel = _.get(_.find(questions, quest => _.isEqual(quest.value, q)), 'label', q); + return `${questionLabel}: ${valueLabel}`; + }).join('; '); + } + return super.getValueAsString(value, options); } } diff --git a/test/forms/helpers/testBasicComponentSettings/values.js b/test/forms/helpers/testBasicComponentSettings/values.js index 41bbbcfc48..891e4459fd 100644 --- a/test/forms/helpers/testBasicComponentSettings/values.js +++ b/test/forms/helpers/testBasicComponentSettings/values.js @@ -57,7 +57,7 @@ const stringValues = { day: '01/05/2005', time: '04:15', currency: '$30,000.00', - survey: '{"question1":"yes","question2":"no"}', + survey: 'Question 1: yes; Question 2: no', numberColumn: '1111', textFieldColumn: 'value', numberFieldset: '222222', diff --git a/test/renders/component-bootstrap-survey-string-value1.html b/test/renders/component-bootstrap-survey-string-value1.html index 1b682f4633..522b3b37c1 100644 --- a/test/renders/component-bootstrap-survey-string-value1.html +++ b/test/renders/component-bootstrap-survey-string-value1.html @@ -1 +1 @@ -{"one":"a","two":"b"} \ No newline at end of file +one: a; two: b \ No newline at end of file diff --git a/test/renders/component-bootstrap-survey-string-value2.html b/test/renders/component-bootstrap-survey-string-value2.html index d9e914c041..567ab8ebb9 100644 --- a/test/renders/component-bootstrap-survey-string-value2.html +++ b/test/renders/component-bootstrap-survey-string-value2.html @@ -1 +1 @@ -{"one":"b","two":"a"} \ No newline at end of file +one: b; two: a \ No newline at end of file diff --git a/test/updateRenders.js b/test/updateRenders.js index 5e36e50e95..e3e66a6cb3 100644 --- a/test/updateRenders.js +++ b/test/updateRenders.js @@ -14,7 +14,7 @@ const forms = require('./formtest'); Components.setComponents(AllComponents); const dir = './test/renders'; -const componentDir = './lib/components'; +const componentDir = './lib/cjs/components'; if (!fs.existsSync(dir)) { fs.mkdirSync(dir); } From 953050a8dbc499fb4b3fd0beaf11964392301602 Mon Sep 17 00:00:00 2001 From: HannaKurban <96909212+HannaKurban@users.noreply.github.com> Date: Fri, 8 Dec 2023 11:45:52 +0300 Subject: [PATCH 4/7] FIO-7602 fixed submission data for 0s values (#5423) --- src/components/radio/Radio.js | 4 +++- src/components/radio/Radio.unit.js | 20 +++++++++++++++++++- src/components/radio/fixtures/comp10.js | 21 +++++++++++++++++++++ src/components/radio/fixtures/index.js | 3 ++- 4 files changed, 45 insertions(+), 3 deletions(-) create mode 100644 src/components/radio/fixtures/comp10.js diff --git a/src/components/radio/Radio.js b/src/components/radio/Radio.js index 51c37fd6b5..122cd9f629 100644 --- a/src/components/radio/Radio.js +++ b/src/components/radio/Radio.js @@ -407,7 +407,9 @@ export default class RadioComponent extends ListComponent { return value; } - if (!isNaN(parseFloat(value)) && isFinite(value)) { + const isEquivalent = value.toString() === Number(value).toString(); + + if (!isNaN(parseFloat(value)) && isFinite(value) && isEquivalent) { value = +value; } if (value === 'true') { diff --git a/src/components/radio/Radio.unit.js b/src/components/radio/Radio.unit.js index 1562950a26..aa6a77427f 100644 --- a/src/components/radio/Radio.unit.js +++ b/src/components/radio/Radio.unit.js @@ -13,7 +13,8 @@ import { comp6, comp7, comp8, - comp9 + comp9, + comp10 } from './fixtures'; describe('Radio Component', () => { @@ -113,6 +114,23 @@ describe('Radio Component', () => { }); }); + it('Should set correct data for 0s values', (done) => { + Harness.testCreate(RadioComponent, comp10).then((component) => { + component.setValue('01'); + component.redraw(); + + setTimeout(()=>{ + assert.equal(component._data.radio, '01'); + component.setValue(1); + component.redraw(); + setTimeout(()=>{ + assert.equal(component._data.radio, 1); + done(); + }, 200); + }, 200); + }); + }); + it('Span should have correct text label', () => { return Harness.testCreate(RadioComponent, comp1).then((component) => { component.element.querySelectorAll('input').forEach((input) => { diff --git a/src/components/radio/fixtures/comp10.js b/src/components/radio/fixtures/comp10.js new file mode 100644 index 0000000000..8ff3642242 --- /dev/null +++ b/src/components/radio/fixtures/comp10.js @@ -0,0 +1,21 @@ +export default { + 'label': 'Radio', + 'optionsLabelPosition': 'right', + 'inline': false, + 'tableView': false, + 'values': [ + { + 'label': '01', + 'value': '01', + 'shortcut': '' + }, + { + 'label': '1', + 'value': '1', + 'shortcut': '' + } + ], + 'key': 'radio', + 'type': 'radio', + 'input': true +}; diff --git a/src/components/radio/fixtures/index.js b/src/components/radio/fixtures/index.js index 7af2ced9f3..9db3870977 100644 --- a/src/components/radio/fixtures/index.js +++ b/src/components/radio/fixtures/index.js @@ -7,4 +7,5 @@ import comp6 from './comp6'; import comp7 from './comp7'; import comp8 from './comp8'; import comp9 from './comp9'; -export { comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8, comp9 }; +import comp10 from './comp10'; +export { comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8, comp9, comp10 }; From 1f2b9b7ab8f121b40034df1c7b3a3f75030c2400 Mon Sep 17 00:00:00 2001 From: antonSoftensity <61691723+antonSoftensity@users.noreply.github.com> Date: Fri, 8 Dec 2023 09:46:18 +0100 Subject: [PATCH 5/7] =?UTF-8?q?FIO-4235=20Fixed=20confirmation=20dialog=20?= =?UTF-8?q?popping=20up=20when=20the=20data=20is=20empty=20=E2=80=A6=20(#5?= =?UTF-8?q?413)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * FIO-4235 Fixed confirmation dialog popping up when the data is empty in EditGrid * FIO-4235 Fixed more cases when confirmation dialog wasn't showing up for EditGrid --- src/components/editgrid/EditGrid.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/editgrid/EditGrid.js b/src/components/editgrid/EditGrid.js index 4236ff98fa..ab7f464a0e 100644 --- a/src/components/editgrid/EditGrid.js +++ b/src/components/editgrid/EditGrid.js @@ -709,6 +709,10 @@ export default class EditGridComponent extends NestedArrayComponent { const rowIndex = this.editRows.length; const editRow = this.createRow(dataObj, rowIndex); + if (editRow.state === EditRowState.New) { + this.emptyRow = fastCloneDeep(editRow.data); + } + if (this.inlineEditMode) { this.triggerChange(); } @@ -787,7 +791,7 @@ export default class EditGridComponent extends NestedArrayComponent { showDialog(rowIndex) { const editRow = this.editRows[rowIndex]; - if (_.isEqual(editRow.backup, editRow.data)) { + if (editRow.state === EditRowState.New ? _.isEqual(this.emptyRow, editRow.data) : _.isEqual(editRow.backup, editRow.data)) { return Promise.resolve(); } From e6648f218c8de9e9732f5260869f7124d3530c4e Mon Sep 17 00:00:00 2001 From: Brendan Bond Date: Fri, 8 Dec 2023 02:46:38 -0600 Subject: [PATCH 6/7] add skipInEmail comp property to recaptcha (#5427) --- src/components/recaptcha/ReCaptcha.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/recaptcha/ReCaptcha.js b/src/components/recaptcha/ReCaptcha.js index cb515df1fc..90abd3902f 100644 --- a/src/components/recaptcha/ReCaptcha.js +++ b/src/components/recaptcha/ReCaptcha.js @@ -59,6 +59,10 @@ export default class ReCaptchaComponent extends Component { return; } + get skipInEmail() { + return true; + } + verify(actionName) { const siteKey = _get(this.root.form, 'settings.recaptcha.siteKey'); if (!siteKey) { From 66dc1a2307c1e10780fa63674891bf4156214e61 Mon Sep 17 00:00:00 2001 From: TanyaGashtold <61136841+TanyaGashtold@users.noreply.github.com> Date: Fri, 8 Dec 2023 11:48:44 +0300 Subject: [PATCH 7/7] Update Changelog.md --- Changelog.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Changelog.md b/Changelog.md index a7531c25a5..71b7a7e2d7 100644 --- a/Changelog.md +++ b/Changelog.md @@ -43,6 +43,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - FIO-7112: fixed issues with calendar widget display for value components in new simple conditionals ui - FIO-7184 Fixed showing incorrect value for DateTime and Time components with multiple value enabled inside of the DataTable - FIO-7553: Changed tooltip text for the Column Properties setting + - FIO-7602: fixed submission data for Radio with 0s values + - FIO-4235: fixed confirmation dialog popping up when the data is empty in EditGrid + - FIO-7577: add skipInEmail comp property to recaptcha ### Changed - Add capability for adding sanitize profiles through sanitizeConfig in options