PluginProbe ʕ •ᴥ•ʔ
JetFormBuilder — Dynamic Blocks Form Builder / 3.1.6
JetFormBuilder — Dynamic Blocks Form Builder v3.1.6
3.6.3.1 3.6.3 3.6.2.2 3.6.2.1 3.6.2 3.6.1.1 3.6.1 3.6.0.1 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.3.0 1.3.1 1.3.2 1.3.3 1.4.0 1.4.1 1.4.2 1.4.3 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.1.0 2.1.1 2.1.10 2.1.11 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 3.0.0 3.0.0.1 3.0.0.2 3.0.0.3 3.0.1 3.0.1.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.0.1 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 3.2.0 3.2.1 3.2.2 3.2.3 3.3.0 3.3.1 3.3.2 3.3.3 3.3.3.1 3.3.4 3.3.4.1 3.3.4.2 3.4.0 3.4.1 3.4.2 3.4.3 3.4.4 3.4.5 3.4.5.1 3.4.5.2 3.4.6 3.4.7 3.4.7.1 3.5.0 3.5.1 3.5.1.1 3.5.1.2 3.5.2 3.5.2.1 3.5.3 3.5.4 3.5.5 3.5.6 3.5.6.1 3.5.6.2 3.5.6.3 3.6.0
jetformbuilder / assets / src / package / block-conditions / components / HumanReadableConditions.js
jetformbuilder / assets / src / package / block-conditions / components Last commit date
BeforeConditionOptions.js 2 years ago ConditionItem.js 2 years ago ConditionOptions.js 2 years ago ConditionsRepeaterContextProvider.js 2 years ago EditCustomRenderStates.js 2 years ago HumanReadableConditions.js 2 years ago RenderStateOptions.js 2 years ago
HumanReadableConditions.js
50 lines
1 import humanReadableCondition from '../helpers/humanReadableCondition';
2
3 const {
4 __,
5 } = wp.i18n;
6 const {
7 Children,
8 cloneElement,
9 } = wp.element;
10
11 function HumanReadableConditions( { conditions, showWarning = false } ) {
12 let conditionsElements = [];
13 let firstReadCondition = '';
14
15 if ( Boolean( conditions?.length ) ) {
16 firstReadCondition = humanReadableCondition( conditions[ 0 ] );
17
18 conditionsElements = conditions.filter(
19 // Exclude first item
20 ( c, index ) => 0 !== index,
21 ).map(
22 condition => <span
23 data-title={ __( 'And', 'jet-form-builder' ) + ':' }
24 dangerouslySetInnerHTML={ {
25 __html: humanReadableCondition( condition ),
26 } }
27 />,
28 );
29 }
30
31 return firstReadCondition ? <>
32 <span
33 data-title={ __(
34 'If', 'jet-form-builder',
35 ) + ':' }
36 dangerouslySetInnerHTML={ {
37 __html: firstReadCondition,
38 } }
39 />
40 { Children.map( conditionsElements, cloneElement ) }
41 </> : showWarning && <span
42 data-title={ __(
43 'The condition is not fully configured.',
44 'jet-form-builder',
45 ) }
46 />;
47
48 }
49
50 export default HumanReadableConditions;