From 179a278831a449ed0f556c7e10447250575e0f4b Mon Sep 17 00:00:00 2001 From: HannaKurban <96909212+HannaKurban@users.noreply.github.com> Date: Mon, 4 Nov 2024 23:37:47 +0300 Subject: [PATCH] FIO-9280 fixed value property validation (#5894) --- src/components/selectboxes/SelectBoxes.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/components/selectboxes/SelectBoxes.js b/src/components/selectboxes/SelectBoxes.js index cc8fb07cc8..6919738b63 100644 --- a/src/components/selectboxes/SelectBoxes.js +++ b/src/components/selectboxes/SelectBoxes.js @@ -1,5 +1,5 @@ import _ from 'lodash'; -import { componentValueTypes, getComponentSavedTypes, boolValue } from '../../utils/utils'; +import { componentValueTypes, getComponentSavedTypes, boolValue, getComponent } from '../../utils/utils'; import RadioComponent from '../radio/Radio'; export default class SelectBoxesComponent extends RadioComponent { @@ -299,6 +299,17 @@ export default class SelectBoxesComponent extends RadioComponent { return super.checkComponentValidity(data, dirty, rowData, options, errors); } + setCustomValidity(messages, dirty, external) { + if (this.options.building && _.find(messages, {ruleName: 'invalidValueProperty'})) { + setTimeout(() => { + this.root && getComponent(this.root.components, 'valueProperty').setCustomValidity(messages, dirty); + }, 0); + return super.setCustomValidity(_.filter(messages, (message) => message.ruleName !=='invalidValueProperty'), dirty, external); + } else { + return super.setCustomValidity(messages, dirty, external); + }; + } + validateValueAvailability(setting, value) { if (!boolValue(setting) || !value) { return true;