@elyra/canvas 12.16.0 → 12.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (155) hide show
  1. package/dist/canvas-controller-ccb05f9f.js +2 -0
  2. package/dist/canvas-controller-ccb05f9f.js.map +1 -0
  3. package/dist/canvas-controller-feabad26.js +2 -0
  4. package/dist/canvas-controller-feabad26.js.map +1 -0
  5. package/dist/{common-canvas-51ed78a5.js → common-canvas-bcfe04ef.js} +2 -2
  6. package/dist/common-canvas-bcfe04ef.js.map +1 -0
  7. package/dist/{common-canvas-d0230688.js → common-canvas-c4f77878.js} +2 -2
  8. package/dist/common-canvas-c4f77878.js.map +1 -0
  9. package/dist/common-canvas.es.js +1 -1
  10. package/dist/common-canvas.js +1 -1
  11. package/dist/common-properties-267a9a6c.js +2 -0
  12. package/dist/common-properties-267a9a6c.js.map +1 -0
  13. package/dist/common-properties-6520f90b.js +2 -0
  14. package/dist/common-properties-6520f90b.js.map +1 -0
  15. package/dist/{extends-8d17c85c.js → extends-12382a72.js} +2 -2
  16. package/dist/extends-12382a72.js.map +1 -0
  17. package/dist/extends-195c6b49.js +7 -0
  18. package/dist/extends-195c6b49.js.map +1 -0
  19. package/dist/flexible-table-056c538e.js +2 -0
  20. package/dist/{flexible-table-60c73b88.js.map → flexible-table-056c538e.js.map} +1 -1
  21. package/dist/flexible-table-7fb8a62e.js +2 -0
  22. package/dist/{flexible-table-0c7ae548.js.map → flexible-table-7fb8a62e.js.map} +1 -1
  23. package/dist/{icon-918d2dd3.js → icon-162ec1ee.js} +2 -2
  24. package/dist/{icon-918d2dd3.js.map → icon-162ec1ee.js.map} +1 -1
  25. package/dist/{icon-4882a57f.js → icon-1ef0f3b9.js} +2 -2
  26. package/dist/{icon-4882a57f.js.map → icon-1ef0f3b9.js.map} +1 -1
  27. package/dist/{index-390d8148.js → index-61be3509.js} +2 -2
  28. package/dist/index-61be3509.js.map +1 -0
  29. package/dist/index-8076376e.js +2 -0
  30. package/dist/index-8076376e.js.map +1 -0
  31. package/dist/lib/canvas-controller.es.js +1 -1
  32. package/dist/lib/canvas-controller.js +1 -1
  33. package/dist/lib/canvas.es.js +1 -1
  34. package/dist/lib/canvas.js +1 -1
  35. package/dist/lib/context-menu.es.js +1 -1
  36. package/dist/lib/context-menu.js +1 -1
  37. package/dist/lib/properties/field-picker.es.js +1 -1
  38. package/dist/lib/properties/field-picker.js +1 -1
  39. package/dist/lib/properties/flexible-table.es.js +1 -1
  40. package/dist/lib/properties/flexible-table.js +1 -1
  41. package/dist/lib/properties.es.js +1 -1
  42. package/dist/lib/properties.js +1 -1
  43. package/dist/styles/common-canvas.min.css +1 -1
  44. package/dist/styles/common-canvas.min.css.map +1 -1
  45. package/dist/{toolbar-3f4b173f.js → toolbar-59ce5251.js} +2 -2
  46. package/dist/{toolbar-3f4b173f.js.map → toolbar-59ce5251.js.map} +1 -1
  47. package/dist/{toolbar-29ec7983.js → toolbar-bb5bee87.js} +2 -2
  48. package/dist/{toolbar-29ec7983.js.map → toolbar-bb5bee87.js.map} +1 -1
  49. package/locales/command-actions/locales/de.json +8 -8
  50. package/locales/command-actions/locales/es.json +8 -8
  51. package/locales/command-actions/locales/fr.json +9 -9
  52. package/locales/command-actions/locales/it.json +13 -13
  53. package/locales/command-actions/locales/ja.json +8 -8
  54. package/locales/command-actions/locales/ko.json +8 -8
  55. package/locales/command-actions/locales/pt-br.json +10 -10
  56. package/locales/command-actions/locales/sv.json +1 -1
  57. package/locales/command-actions/locales/zh-CN.json +8 -8
  58. package/locales/command-actions/locales/zh-TW.json +10 -10
  59. package/locales/common-canvas/locales/de.json +18 -4
  60. package/locales/common-canvas/locales/es.json +16 -2
  61. package/locales/common-canvas/locales/fr.json +16 -2
  62. package/locales/common-canvas/locales/it.json +17 -3
  63. package/locales/common-canvas/locales/ja.json +19 -5
  64. package/locales/common-canvas/locales/ko.json +25 -11
  65. package/locales/common-canvas/locales/pt-br.json +18 -4
  66. package/locales/common-canvas/locales/sv.json +18 -4
  67. package/locales/common-canvas/locales/zh-CN.json +15 -1
  68. package/locales/common-canvas/locales/zh-TW.json +15 -1
  69. package/locales/common-properties/locales/de.json +22 -22
  70. package/locales/common-properties/locales/en.json +7 -1
  71. package/locales/common-properties/locales/eo.json +6 -0
  72. package/locales/common-properties/locales/es.json +12 -12
  73. package/locales/common-properties/locales/fr.json +22 -22
  74. package/locales/common-properties/locales/it.json +13 -13
  75. package/locales/common-properties/locales/ja.json +28 -28
  76. package/locales/common-properties/locales/ko.json +10 -10
  77. package/locales/common-properties/locales/pt-br.json +16 -16
  78. package/locales/common-properties/locales/sv.json +8 -8
  79. package/locales/common-properties/locales/zh-CN.json +28 -28
  80. package/locales/common-properties/locales/zh-TW.json +26 -26
  81. package/locales/palette/locales/it.json +1 -1
  82. package/locales/palette/locales/ja.json +1 -1
  83. package/locales/palette/locales/pt-br.json +1 -1
  84. package/locales/palette/locales/sv.json +1 -1
  85. package/locales/palette/locales/zh-CN.json +4 -4
  86. package/locales/palette/locales/zh-TW.json +2 -2
  87. package/locales/toolbar/locales/es.json +1 -1
  88. package/locales/toolbar/locales/it.json +2 -2
  89. package/locales/toolbar/locales/pt-br.json +1 -1
  90. package/package.json +3 -3
  91. package/src/command-actions/createCommentAction.js +5 -9
  92. package/src/common-canvas/canvas-controller.js +13 -2
  93. package/src/common-canvas/svg-canvas-d3.js +2 -2
  94. package/src/common-canvas/svg-canvas-renderer.js +11 -5
  95. package/src/common-properties/actions.js +10 -0
  96. package/src/common-properties/components/components.scss +1 -1
  97. package/src/common-properties/components/editor-form/editor-form.jsx +23 -3
  98. package/src/common-properties/components/wide-flyout/wide-flyout.jsx +5 -2
  99. package/src/common-properties/constants/constants.js +10 -1
  100. package/src/common-properties/constants/form-constants.js +6 -2
  101. package/src/common-properties/controls/abstract-table.jsx +2 -2
  102. package/src/common-properties/controls/checkboxset/checkboxset.scss +7 -4
  103. package/src/common-properties/controls/control-factory.js +5 -0
  104. package/src/common-properties/controls/controls.scss +1 -0
  105. package/src/common-properties/controls/dropdown/dropdown.jsx +7 -5
  106. package/src/common-properties/controls/expression/expression-builder/expression-select-field-function.jsx +14 -2
  107. package/src/common-properties/controls/expression/expression-toggle/expression-toggle.jsx +74 -0
  108. package/src/common-properties/controls/expression/expression-toggle/expression-toggle.scss +12 -0
  109. package/src/common-properties/controls/expression/expression.jsx +15 -1
  110. package/src/common-properties/controls/expression/expression.scss +61 -33
  111. package/src/common-properties/controls/expression/expressionInfo-parser.js +11 -1
  112. package/src/common-properties/controls/passwordfield/passwordfield.jsx +16 -14
  113. package/src/common-properties/controls/radioset/radioset.jsx +4 -4
  114. package/src/common-properties/controls/selectcolumns/selectcolumns.jsx +3 -3
  115. package/src/common-properties/controls/someofselect/someofselect.jsx +4 -4
  116. package/src/common-properties/controls/toggle/index.jsx +18 -0
  117. package/src/common-properties/controls/toggle/toggle.jsx +89 -0
  118. package/src/common-properties/controls/toggle/toggle.scss +23 -0
  119. package/src/common-properties/form/ControlInfo.js +3 -0
  120. package/src/common-properties/form/EditorForm.js +12 -1
  121. package/src/common-properties/form/ParameterInfo.js +5 -0
  122. package/src/common-properties/form/UIItem.js +10 -0
  123. package/src/common-properties/panels/panels.scss +1 -0
  124. package/src/common-properties/panels/summary/summary.jsx +5 -2
  125. package/src/common-properties/panels/tearsheet/index.js +18 -0
  126. package/src/common-properties/panels/tearsheet/tearsheet.jsx +54 -0
  127. package/src/common-properties/panels/tearsheet/tearsheet.scss +31 -0
  128. package/src/common-properties/properties-controller.js +40 -13
  129. package/src/common-properties/properties-main/properties-main.jsx +1 -0
  130. package/src/common-properties/properties-store.js +35 -3
  131. package/src/common-properties/reducers/tearsheet-states.js +29 -0
  132. package/src/common-properties/reducers/wide-flyout-primary-button-disable.jsx +31 -0
  133. package/src/common-properties/ui-conditions/condition-ops/colDoesExists.js +9 -3
  134. package/src/common-properties/ui-conditions/conditions-utils.js +10 -16
  135. package/src/object-model/api-pipeline.js +11 -4
  136. package/src/palette/palette-content-list-item.jsx +3 -1
  137. package/stats.html +1 -1
  138. package/dist/canvas-controller-c420f377.js +0 -2
  139. package/dist/canvas-controller-c420f377.js.map +0 -1
  140. package/dist/canvas-controller-e02a5de5.js +0 -2
  141. package/dist/canvas-controller-e02a5de5.js.map +0 -1
  142. package/dist/common-canvas-51ed78a5.js.map +0 -1
  143. package/dist/common-canvas-d0230688.js.map +0 -1
  144. package/dist/common-properties-0a697e6a.js +0 -2
  145. package/dist/common-properties-0a697e6a.js.map +0 -1
  146. package/dist/common-properties-233593d2.js +0 -2
  147. package/dist/common-properties-233593d2.js.map +0 -1
  148. package/dist/extends-1139e06f.js +0 -7
  149. package/dist/extends-1139e06f.js.map +0 -1
  150. package/dist/extends-8d17c85c.js.map +0 -1
  151. package/dist/flexible-table-0c7ae548.js +0 -2
  152. package/dist/flexible-table-60c73b88.js +0 -2
  153. package/dist/index-390d8148.js.map +0 -1
  154. package/dist/index-e6d8ea9c.js +0 -2
  155. package/dist/index-e6d8ea9c.js.map +0 -1
@@ -24,7 +24,7 @@ import { parseUiContent } from "./ui-conditions/ui-groups-parser.js";
24
24
  import * as conditionsUtil from "./ui-conditions/conditions-utils";
25
25
  import * as PropertyUtils from "./util/property-utils.js";
26
26
 
27
- import { STATES, ACTIONS, CONDITION_TYPE, PANEL_TREE_ROOT, CONDITION_MESSAGE_TYPE } from "./constants/constants.js";
27
+ import { STATES, ACTIONS, CONDITION_TYPE, PANEL_TREE_ROOT, CONDITION_MESSAGE_TYPE, UPDATE_TYPE } from "./constants/constants.js";
28
28
  import CommandStack from "../command-stack/command-stack.js";
29
29
  import ControlFactory from "./controls/control-factory";
30
30
  import { Type, ParamRole, ControlType } from "./constants/form-constants";
@@ -382,11 +382,11 @@ export default class PropertiesController {
382
382
  if (resolveParameterRefs) {
383
383
  if (typeof controlValue !== "undefined" && controlValue !== null && typeof controlValue.parameterRef !== "undefined") {
384
384
  controlValue = this.getPropertyValue({ name: controlValue.parameterRef });
385
- this.updatePropertyValue(propertyId, controlValue, true);
385
+ this.updatePropertyValue(propertyId, controlValue, true, UPDATE_TYPE.INITIAL_LOAD);
386
386
  }
387
387
  } else if (control.controlType === "structuretable" && control.addRemoveRows === false && control.includeAllFields === true) {
388
388
  controlValue = this._populateFieldData(controlValue, control);
389
- this.updatePropertyValue(propertyId, controlValue, true);
389
+ this.updatePropertyValue(propertyId, controlValue, true, UPDATE_TYPE.INITIAL_LOAD);
390
390
  } else if (typeof control.valueDef !== "undefined" && typeof control.valueDef.defaultValue !== "undefined" &&
391
391
  (typeof controlValue === "undefined")) {
392
392
  controlValue = control.valueDef.defaultValue;
@@ -396,11 +396,11 @@ export default class PropertiesController {
396
396
  controlValue = PropertyUtils.convertObjectStructureToArray(control.valueDef.isList, control.subControls, controlValue);
397
397
  }
398
398
 
399
- this.updatePropertyValue(propertyId, controlValue, true);
399
+ this.updatePropertyValue(propertyId, controlValue, true, UPDATE_TYPE.INITIAL_LOAD);
400
400
  } else if (control.controlType === "structureeditor") {
401
401
  if (!controlValue || (Array.isArray(controlValue) && controlValue.length === 0)) {
402
402
  if (Array.isArray(control.defaultRow)) {
403
- this.updatePropertyValue(propertyId, control.defaultRow, true);
403
+ this.updatePropertyValue(propertyId, control.defaultRow, true, UPDATE_TYPE.INITIAL_LOAD);
404
404
  }
405
405
  }
406
406
  }
@@ -1019,7 +1019,7 @@ export default class PropertiesController {
1019
1019
  /*
1020
1020
  * Property Values Methods
1021
1021
  */
1022
- updatePropertyValue(inPropertyId, value, skipValidateInput) {
1022
+ updatePropertyValue(inPropertyId, value, skipValidateInput, type) {
1023
1023
  const propertyId = this.convertPropertyId(inPropertyId);
1024
1024
  const initialValue = this.getPropertyValue(propertyId);
1025
1025
  if (typeof value === "undefined") {
@@ -1038,13 +1038,15 @@ export default class PropertiesController {
1038
1038
 
1039
1039
  if (this.handlers.propertyListener) {
1040
1040
  const convertedValue = this._convertObjectStructure(propertyId, value);
1041
- this.handlers.propertyListener(
1042
- {
1043
- action: ACTIONS.UPDATE_PROPERTY,
1044
- property: propertyId,
1045
- value: convertedValue
1046
- }
1047
- );
1041
+ const data = {
1042
+ action: ACTIONS.UPDATE_PROPERTY,
1043
+ property: propertyId,
1044
+ value: convertedValue
1045
+ };
1046
+ if (typeof type !== "undefined") {
1047
+ data.type = type;
1048
+ }
1049
+ this.handlers.propertyListener(data);
1048
1050
  }
1049
1051
  }
1050
1052
 
@@ -1300,6 +1302,15 @@ export default class PropertiesController {
1300
1302
  getPanelStates() {
1301
1303
  return this.propertiesStore.getPanelStates();
1302
1304
  }
1305
+ clearActiveTearsheet() {
1306
+ this.propertiesStore.setActiveTearsheetId(null);
1307
+ }
1308
+ setActiveTearsheet(tearsheetId) {
1309
+ this.propertiesStore.setActiveTearsheetId(tearsheetId);
1310
+ }
1311
+ getActiveTearsheet() {
1312
+ return this.propertiesStore.getActiveTearsheetId() || null;
1313
+ }
1303
1314
 
1304
1315
 
1305
1316
  /**
@@ -1628,6 +1639,22 @@ export default class PropertiesController {
1628
1639
  return this.propertiesStore.getSaveButtonDisable();
1629
1640
  }
1630
1641
 
1642
+ /**
1643
+ * Enable/disable OK button for given summary panel
1644
+ * @param panelId {name: panel.id}
1645
+ * @param wideFlyoutPrimaryButtonDisable boolean
1646
+ */
1647
+ setWideFlyoutPrimaryButtonDisabled(panelId, wideFlyoutPrimaryButtonDisable) {
1648
+ this.propertiesStore.setWideFlyoutPrimaryButtonDisabled(panelId, wideFlyoutPrimaryButtonDisable);
1649
+ }
1650
+
1651
+ /**
1652
+ * @param panelId {name: panel.id}
1653
+ */
1654
+ getWideFlyoutPrimaryButtonDisabled(panelId) {
1655
+ return this.propertiesStore.getWideFlyoutPrimaryButtonDisabled(panelId);
1656
+ }
1657
+
1631
1658
  isRequired(propertyId) {
1632
1659
  const control = this.getControl(propertyId);
1633
1660
  if (control) {
@@ -69,6 +69,7 @@ class PropertiesMain extends React.Component {
69
69
  this.setForm(props.propertiesInfo);
70
70
  this.previousErrorMessages = {};
71
71
  // this has to be after setForm because setForm clears all error messages.
72
+ // Validate all validationDefinitions but show warning messages for "colDoesExists" condition only
72
73
  this.propertiesController.validatePropertiesValues(false);
73
74
  if (props.propertiesInfo.messages) {
74
75
  this.propertiesController.validatePropertiesValues(true);
@@ -16,7 +16,7 @@
16
16
 
17
17
  import { createStore, combineReducers } from "redux";
18
18
  import { has, get, isEqual, cloneDeep } from "lodash";
19
-
19
+ import { setTearsheetState } from "./actions";
20
20
  import { setPropertyValues, updatePropertyValue, removePropertyValue } from "./actions";
21
21
  import { setControlStates, updateControlState } from "./actions";
22
22
  import { setPanelStates, updatePanelState } from "./actions";
@@ -25,7 +25,7 @@ import { setActionStates, updateActionState } from "./actions";
25
25
  import { clearSelectedRows, updateSelectedRows, disableRowMoveButtons } from "./actions";
26
26
  import { clearStaticRows, updateStaticRows } from "./actions";
27
27
  import { setErrorMessages, updateErrorMessage, clearErrorMessage } from "./actions";
28
- import { setDatasetMetadata, setSaveButtonDisable, setAddRemoveRows, setTableButtonEnabled, setHideEditButton } from "./actions";
28
+ import { setDatasetMetadata, setSaveButtonDisable, setWideFlyoutPrimaryButtonDisabled, setAddRemoveRows, setTableButtonEnabled, setHideEditButton } from "./actions";
29
29
  import { setTitle, setActiveTab } from "./actions";
30
30
  import propertiesReducer from "./reducers/properties";
31
31
  import controlStatesReducer from "./reducers/control-states";
@@ -38,7 +38,9 @@ import rowFreezeReducer from "./reducers/row-static";
38
38
  import componentMetadataReducer from "./reducers/component-metadata";
39
39
  import disableRowMoveButtonsReducer from "./reducers/disable-row-move-buttons";
40
40
  import saveButtonDisableReducer from "./reducers/save-button-disable";
41
+ import wideFlyoutPrimaryButtonDisableReducer from "./reducers/wide-flyout-primary-button-disable";
41
42
  import propertiesSettingsReducer from "./reducers/properties-settings";
43
+ import tearsheetStatesReducer from "./reducers/tearsheet-states";
42
44
  import * as PropertyUtils from "./util/property-utils.js";
43
45
  import { CONDITION_MESSAGE_TYPE, MESSAGE_KEYS } from "./constants/constants.js";
44
46
 
@@ -48,7 +50,8 @@ export default class PropertiesStore {
48
50
  constructor() {
49
51
  this.combinedReducer = combineReducers({ propertiesReducer, controlStatesReducer, panelStatesReducer,
50
52
  errorMessagesReducer, datasetMetadataReducer, rowSelectionsReducer, componentMetadataReducer,
51
- disableRowMoveButtonsReducer, actionStatesReducer, saveButtonDisableReducer, propertiesSettingsReducer, rowFreezeReducer });
53
+ disableRowMoveButtonsReducer, actionStatesReducer, wideFlyoutPrimaryButtonDisableReducer, tearsheetStatesReducer,
54
+ saveButtonDisableReducer, propertiesSettingsReducer, rowFreezeReducer });
52
55
  let enableDevTools = false;
53
56
  if (typeof window !== "undefined") {
54
57
  enableDevTools = window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__();
@@ -219,6 +222,22 @@ export default class PropertiesStore {
219
222
  return state.saveButtonDisableReducer.disable;
220
223
  }
221
224
 
225
+ setWideFlyoutPrimaryButtonDisabled(panelId, disableState) {
226
+ this.store.dispatch(setWideFlyoutPrimaryButtonDisabled({ panelId: panelId, disableState: disableState }));
227
+ }
228
+
229
+ getWideFlyoutPrimaryButtonDisabled(panelId) {
230
+ if (typeof panelId === "undefined") {
231
+ return null;
232
+ }
233
+ const state = this.store.getState();
234
+ const disablePrimaryButtonForPanel = state.wideFlyoutPrimaryButtonDisableReducer[panelId.name];
235
+ if (typeof disablePrimaryButtonForPanel !== "undefined") {
236
+ return disablePrimaryButtonForPanel;
237
+ }
238
+ return null;
239
+ }
240
+
222
241
  /*
223
242
  * Retrieves filtered enumeration values for the given propertyId.
224
243
  */
@@ -520,6 +539,19 @@ export default class PropertiesStore {
520
539
  }
521
540
  return defaultValue;
522
541
  }
542
+
543
+ setActiveTearsheetId(tearsheetId) {
544
+ this.store.dispatch(setTearsheetState({ tearsheetId: tearsheetId }));
545
+ }
546
+
547
+ getActiveTearsheetId() {
548
+ const state = this.store.getState();
549
+ const tearsheetId = state.tearsheetStatesReducer.tearsheetId;
550
+ if (typeof tearsheetId !== "undefined") {
551
+ return tearsheetId;
552
+ }
553
+ return null;
554
+ }
523
555
  }
524
556
 
525
557
  function getNestedPropertySetting(propertyId, state, setting, defaultValue) {
@@ -0,0 +1,29 @@
1
+ /*
2
+ * Copyright 2022 Elyra Authors
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import { SET_ACTIVE_TEARSHEET } from "../actions";
18
+
19
+ function states(state = [], action) {
20
+ switch (action.type) {
21
+ case SET_ACTIVE_TEARSHEET: {
22
+ return Object.assign({}, state, action.tearsheetId);
23
+ }
24
+ default:
25
+ return state;
26
+ }
27
+ }
28
+
29
+ export default states;
@@ -0,0 +1,31 @@
1
+ /*
2
+ * Copyright 2017-2022 Elyra Authors
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import { SET_WIDE_FLYOUT_PRIMARY_BUTTON_DISABLED } from "../actions";
18
+
19
+ function setWideFlyoutPrimaryButtonDisabled(state = [], action) {
20
+ switch (action.type) {
21
+ case SET_WIDE_FLYOUT_PRIMARY_BUTTON_DISABLED: {
22
+ const newState = state;
23
+ newState[action.info.panelId.name] = action.info.disableState;
24
+ return Object.assign({}, state, newState);
25
+ }
26
+ default:
27
+ return state;
28
+ }
29
+ }
30
+
31
+ export default setWideFlyoutPrimaryButtonDisabled;
@@ -16,6 +16,7 @@
16
16
 
17
17
  import logger from "./../../../../utils/logger";
18
18
  import { fieldValueMatchesProto } from "./../../util/property-utils.js";
19
+ import { isEmpty } from "lodash";
19
20
 
20
21
  function op() {
21
22
  return "colDoesExists";
@@ -51,9 +52,14 @@ function evaluate(paramInfo, param2Info, value, controller) {
51
52
 
52
53
  // Return the field if found in dataset, else undefined
53
54
  function valueInDataset(dataset, field) {
54
- return dataset.find(function(dataModelField) {
55
- return fieldValueMatchesProto(field, dataModelField);
56
- });
55
+ // Don't validate empty, null or undefined value
56
+ return (
57
+ (typeof field === "undefined" || field === null || isEmpty(field))
58
+ ? true
59
+ : dataset.find(function(dataModelField) {
60
+ return fieldValueMatchesProto(field, dataModelField);
61
+ })
62
+ );
57
63
  }
58
64
 
59
65
 
@@ -80,6 +80,7 @@ function validatePropertiesConditions(controller) {
80
80
  *
81
81
  * @param {object} properties controller. required
82
82
  * @param {object} list of control objects or properties. required
83
+ * @param {boolean} showErrors. optional. Set to false to run conditions without displaying errors in the UI
83
84
  */
84
85
  function validatePropertiesListValues(controller, controls, showErrors) {
85
86
  if (Object.keys(controls).length > 0) {
@@ -697,7 +698,8 @@ function _validateInput(propertyId, controller, control, showErrors) {
697
698
 
698
699
  // Determine if this condition is for required parameters
699
700
  errorMessage.required = requiredDefinitionsIds.indexOf(validation.definition.validation.id) > -1;
700
- if (!showErrors) {
701
+ // Only show warning messages for "colDoesExists" condition
702
+ if (!showErrors && !validation.alwaysShow) {
701
703
  errorMessage.displayError = false;
702
704
  }
703
705
 
@@ -1127,6 +1129,7 @@ function _injectInvalidFieldDefinition(control, valDefinitions, keyName, control
1127
1129
  const label = (control.label && control.label.text) ? control.label.text : keyName;
1128
1130
  const errorMsg = formatMessage(intl,
1129
1131
  MESSAGE_KEYS.INVALID_FIELD_ERROR, { label: label });
1132
+ // Note: Please don't update "validField_" in validation id. It is used as identifier in another condition.
1130
1133
  const injectedDefinition = {
1131
1134
  params: keyName,
1132
1135
  definition: {
@@ -1140,23 +1143,14 @@ function _injectInvalidFieldDefinition(control, valDefinitions, keyName, control
1140
1143
  focus_parameter_ref: keyName
1141
1144
  },
1142
1145
  evaluate: {
1143
- or: [
1144
- {
1145
- condition: {
1146
- parameter_ref: keyName,
1147
- op: "colDoesExists"
1148
- }
1149
- },
1150
- {
1151
- condition: {
1152
- parameter_ref: keyName,
1153
- op: "isEmpty"
1154
- }
1155
- }
1156
- ]
1146
+ condition: {
1147
+ parameter_ref: keyName,
1148
+ op: "colDoesExists"
1149
+ }
1157
1150
  }
1158
1151
  }
1159
- }
1152
+ },
1153
+ alwaysShow: true
1160
1154
  };
1161
1155
  // add the new definition to the set of validation definitions for this control.
1162
1156
  if (valDefinitions.controls[keyName]) {
@@ -30,6 +30,7 @@ import { cloneDeep, get, has, set } from "lodash";
30
30
  import { ASSOCIATION_LINK, NODE_LINK, COMMENT_LINK, VERTICAL,
31
31
  DAGRE_HORIZONTAL, DAGRE_VERTICAL,
32
32
  CREATE_NODE, CREATE_COMMENT, CREATE_NODE_LINK, CREATE_COMMENT_LINK,
33
+ SNAP_TO_GRID_AFTER, SNAP_TO_GRID_DURING,
33
34
  BINDING, SUPER_NODE }
34
35
  from "../common-canvas/constants/canvas-constants.js";
35
36
 
@@ -1017,12 +1018,18 @@ export default class APIPipeline {
1017
1018
  // Returns a position for a new comment added by clicking the 'add comment'
1018
1019
  // button on the toolbar. It searches for a position that is not already
1019
1020
  // occupied by an existing comment.
1020
- getNewCommentPosition(svgPos) {
1021
- const pos = { x_pos: svgPos.x_pos, y_pos: svgPos.y_pos };
1021
+ getAdjustedCommentPosition(comPos) {
1022
+ const stgType = this.objectModel.getCanvasConfig().enableSnapToGridType;
1023
+ const pos = { x_pos: comPos.x, y_pos: comPos.y };
1022
1024
 
1023
1025
  while (this.exactlyOverlaps(null, [pos], null)) {
1024
- pos.x_pos += 10;
1025
- pos.y_pos += 10;
1026
+ if (stgType === SNAP_TO_GRID_DURING || stgType === SNAP_TO_GRID_AFTER) {
1027
+ pos.x_pos += this.objectModel.getCanvasLayout().snapToGridXPx;
1028
+ pos.y_pos += this.objectModel.getCanvasLayout().snapToGridYPx;
1029
+ } else {
1030
+ pos.x_pos += 10;
1031
+ pos.y_pos += 10;
1032
+ }
1026
1033
  }
1027
1034
 
1028
1035
  return pos;
@@ -250,7 +250,9 @@ class PaletteContentListItem extends React.Component {
250
250
  let icon = null;
251
251
 
252
252
  if (has(this.props.nodeTypeInfo.nodeType, "app_data.ui_data.image")) {
253
- let image = this.props.nodeTypeInfo.nodeType.app_data.ui_data.image;
253
+ let image = this.props.nodeTypeInfo.nodeType.app_data.ui_data.palette_image
254
+ ? this.props.nodeTypeInfo.nodeType.app_data.ui_data.palette_image
255
+ : this.props.nodeTypeInfo.nodeType.app_data.ui_data.image;
254
256
 
255
257
  if (image === USE_DEFAULT_ICON) {
256
258
  image = SUPERNODE_ICON;