Skip to content

Commit 8b96fef

Browse files
committed
ui: form builder customizefield, add check for the uiSchema
* closes #1942 Signed-off-by: papadopan <[email protected]>
1 parent 18c0d8c commit 8b96fef

File tree

1 file changed

+15
-0
lines changed
  • ui/cap-react/src/components/cms/components/SchemaWizard/PropertyEditor

1 file changed

+15
-0
lines changed

ui/cap-react/src/components/cms/components/SchemaWizard/PropertyEditor/customizeField.js

+15
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,7 @@ class CustomizeField extends React.Component {
239239
onClick={() => this.gridColumnChange(gridColumns)}
240240
style={{
241241
border:
242+
this.props.uiSchema &&
242243
this.props.uiSchema.toJS()["ui:options"] &&
243244
this.props.uiSchema.toJS()["ui:options"].grid &&
244245
gridColumns ===
@@ -247,6 +248,7 @@ class CustomizeField extends React.Component {
247248
? "1px solid black"
248249
: null,
249250
background:
251+
this.props.uiSchema &&
250252
this.props.uiSchema.toJS()["ui:options"] &&
251253
this.props.uiSchema.toJS()["ui:options"].grid &&
252254
gridColumns ===
@@ -255,6 +257,7 @@ class CustomizeField extends React.Component {
255257
? "black"
256258
: null,
257259
color:
260+
this.props.uiSchema &&
258261
this.props.uiSchema.toJS()["ui:options"] &&
259262
this.props.uiSchema.toJS()["ui:options"].grid &&
260263
gridColumns ===
@@ -263,6 +266,7 @@ class CustomizeField extends React.Component {
263266
? "white"
264267
: null,
265268
padding:
269+
this.props.uiSchema &&
266270
this.props.uiSchema.toJS()["ui:options"] &&
267271
this.props.uiSchema.toJS()["ui:options"].grid &&
268272
gridColumns ===
@@ -271,6 +275,7 @@ class CustomizeField extends React.Component {
271275
? "0 2px"
272276
: null,
273277
borderRadius:
278+
this.props.uiSchema &&
274279
this.props.uiSchema.toJS()["ui:options"] &&
275280
this.props.uiSchema.toJS()["ui:options"].grid &&
276281
gridColumns ===
@@ -301,30 +306,35 @@ class CustomizeField extends React.Component {
301306
onClick={() => this.sizeChange(size)}
302307
style={{
303308
border:
309+
this.props.uiSchema &&
304310
this.props.uiSchema.toJS()["ui:options"] &&
305311
this.props.uiSchema.toJS()["ui:options"].size &&
306312
size === this.props.uiSchema.toJS()["ui:options"].size
307313
? "1px solid black"
308314
: null,
309315
background:
316+
this.props.uiSchema &&
310317
this.props.uiSchema.toJS()["ui:options"] &&
311318
this.props.uiSchema.toJS()["ui:options"].size &&
312319
size === this.props.uiSchema.toJS()["ui:options"].size
313320
? "black"
314321
: null,
315322
color:
323+
this.props.uiSchema &&
316324
this.props.uiSchema.toJS()["ui:options"] &&
317325
this.props.uiSchema.toJS()["ui:options"].size &&
318326
size === this.props.uiSchema.toJS()["ui:options"].size
319327
? "white"
320328
: null,
321329
padding:
330+
this.props.uiSchema &&
322331
this.props.uiSchema.toJS()["ui:options"] &&
323332
this.props.uiSchema.toJS()["ui:options"].size &&
324333
size === this.props.uiSchema.toJS()["ui:options"].size
325334
? "0 2px"
326335
: null,
327336
borderRadius:
337+
this.props.uiSchema &&
328338
this.props.uiSchema.toJS()["ui:options"] &&
329339
this.props.uiSchema.toJS()["ui:options"].size &&
330340
size === this.props.uiSchema.toJS()["ui:options"].size
@@ -353,30 +363,35 @@ class CustomizeField extends React.Component {
353363
onClick={() => this.alignChange(align)}
354364
style={{
355365
border:
366+
this.props.uiSchema &&
356367
this.props.uiSchema.toJS()["ui:options"] &&
357368
this.props.uiSchema.toJS()["ui:options"].align &&
358369
align === this.props.uiSchema.toJS()["ui:options"].align
359370
? "1px solid black"
360371
: null,
361372
background:
373+
this.props.uiSchema &&
362374
this.props.uiSchema.toJS()["ui:options"] &&
363375
this.props.uiSchema.toJS()["ui:options"].align &&
364376
align === this.props.uiSchema.toJS()["ui:options"].align
365377
? "black"
366378
: null,
367379
color:
380+
this.props.uiSchema &&
368381
this.props.uiSchema.toJS()["ui:options"] &&
369382
this.props.uiSchema.toJS()["ui:options"].align &&
370383
align === this.props.uiSchema.toJS()["ui:options"].align
371384
? "white"
372385
: null,
373386
padding:
387+
this.props.uiSchema &&
374388
this.props.uiSchema.toJS()["ui:options"] &&
375389
this.props.uiSchema.toJS()["ui:options"].align &&
376390
align === this.props.uiSchema.toJS()["ui:options"].align
377391
? "0 2px"
378392
: null,
379393
borderRadius:
394+
this.props.uiSchema &&
380395
this.props.uiSchema.toJS()["ui:options"] &&
381396
this.props.uiSchema.toJS()["ui:options"].align &&
382397
align === this.props.uiSchema.toJS()["ui:options"].align

0 commit comments

Comments
 (0)