@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.
- package/dist/canvas-controller-ccb05f9f.js +2 -0
- package/dist/canvas-controller-ccb05f9f.js.map +1 -0
- package/dist/canvas-controller-feabad26.js +2 -0
- package/dist/canvas-controller-feabad26.js.map +1 -0
- package/dist/{common-canvas-51ed78a5.js → common-canvas-bcfe04ef.js} +2 -2
- package/dist/common-canvas-bcfe04ef.js.map +1 -0
- package/dist/{common-canvas-d0230688.js → common-canvas-c4f77878.js} +2 -2
- package/dist/common-canvas-c4f77878.js.map +1 -0
- package/dist/common-canvas.es.js +1 -1
- package/dist/common-canvas.js +1 -1
- package/dist/common-properties-267a9a6c.js +2 -0
- package/dist/common-properties-267a9a6c.js.map +1 -0
- package/dist/common-properties-6520f90b.js +2 -0
- package/dist/common-properties-6520f90b.js.map +1 -0
- package/dist/{extends-8d17c85c.js → extends-12382a72.js} +2 -2
- package/dist/extends-12382a72.js.map +1 -0
- package/dist/extends-195c6b49.js +7 -0
- package/dist/extends-195c6b49.js.map +1 -0
- package/dist/flexible-table-056c538e.js +2 -0
- package/dist/{flexible-table-60c73b88.js.map → flexible-table-056c538e.js.map} +1 -1
- package/dist/flexible-table-7fb8a62e.js +2 -0
- package/dist/{flexible-table-0c7ae548.js.map → flexible-table-7fb8a62e.js.map} +1 -1
- package/dist/{icon-918d2dd3.js → icon-162ec1ee.js} +2 -2
- package/dist/{icon-918d2dd3.js.map → icon-162ec1ee.js.map} +1 -1
- package/dist/{icon-4882a57f.js → icon-1ef0f3b9.js} +2 -2
- package/dist/{icon-4882a57f.js.map → icon-1ef0f3b9.js.map} +1 -1
- package/dist/{index-390d8148.js → index-61be3509.js} +2 -2
- package/dist/index-61be3509.js.map +1 -0
- package/dist/index-8076376e.js +2 -0
- package/dist/index-8076376e.js.map +1 -0
- package/dist/lib/canvas-controller.es.js +1 -1
- package/dist/lib/canvas-controller.js +1 -1
- package/dist/lib/canvas.es.js +1 -1
- package/dist/lib/canvas.js +1 -1
- package/dist/lib/context-menu.es.js +1 -1
- package/dist/lib/context-menu.js +1 -1
- package/dist/lib/properties/field-picker.es.js +1 -1
- package/dist/lib/properties/field-picker.js +1 -1
- package/dist/lib/properties/flexible-table.es.js +1 -1
- package/dist/lib/properties/flexible-table.js +1 -1
- package/dist/lib/properties.es.js +1 -1
- package/dist/lib/properties.js +1 -1
- package/dist/styles/common-canvas.min.css +1 -1
- package/dist/styles/common-canvas.min.css.map +1 -1
- package/dist/{toolbar-3f4b173f.js → toolbar-59ce5251.js} +2 -2
- package/dist/{toolbar-3f4b173f.js.map → toolbar-59ce5251.js.map} +1 -1
- package/dist/{toolbar-29ec7983.js → toolbar-bb5bee87.js} +2 -2
- package/dist/{toolbar-29ec7983.js.map → toolbar-bb5bee87.js.map} +1 -1
- package/locales/command-actions/locales/de.json +8 -8
- package/locales/command-actions/locales/es.json +8 -8
- package/locales/command-actions/locales/fr.json +9 -9
- package/locales/command-actions/locales/it.json +13 -13
- package/locales/command-actions/locales/ja.json +8 -8
- package/locales/command-actions/locales/ko.json +8 -8
- package/locales/command-actions/locales/pt-br.json +10 -10
- package/locales/command-actions/locales/sv.json +1 -1
- package/locales/command-actions/locales/zh-CN.json +8 -8
- package/locales/command-actions/locales/zh-TW.json +10 -10
- package/locales/common-canvas/locales/de.json +18 -4
- package/locales/common-canvas/locales/es.json +16 -2
- package/locales/common-canvas/locales/fr.json +16 -2
- package/locales/common-canvas/locales/it.json +17 -3
- package/locales/common-canvas/locales/ja.json +19 -5
- package/locales/common-canvas/locales/ko.json +25 -11
- package/locales/common-canvas/locales/pt-br.json +18 -4
- package/locales/common-canvas/locales/sv.json +18 -4
- package/locales/common-canvas/locales/zh-CN.json +15 -1
- package/locales/common-canvas/locales/zh-TW.json +15 -1
- package/locales/common-properties/locales/de.json +22 -22
- package/locales/common-properties/locales/en.json +7 -1
- package/locales/common-properties/locales/eo.json +6 -0
- package/locales/common-properties/locales/es.json +12 -12
- package/locales/common-properties/locales/fr.json +22 -22
- package/locales/common-properties/locales/it.json +13 -13
- package/locales/common-properties/locales/ja.json +28 -28
- package/locales/common-properties/locales/ko.json +10 -10
- package/locales/common-properties/locales/pt-br.json +16 -16
- package/locales/common-properties/locales/sv.json +8 -8
- package/locales/common-properties/locales/zh-CN.json +28 -28
- package/locales/common-properties/locales/zh-TW.json +26 -26
- package/locales/palette/locales/it.json +1 -1
- package/locales/palette/locales/ja.json +1 -1
- package/locales/palette/locales/pt-br.json +1 -1
- package/locales/palette/locales/sv.json +1 -1
- package/locales/palette/locales/zh-CN.json +4 -4
- package/locales/palette/locales/zh-TW.json +2 -2
- package/locales/toolbar/locales/es.json +1 -1
- package/locales/toolbar/locales/it.json +2 -2
- package/locales/toolbar/locales/pt-br.json +1 -1
- package/package.json +3 -3
- package/src/command-actions/createCommentAction.js +5 -9
- package/src/common-canvas/canvas-controller.js +13 -2
- package/src/common-canvas/svg-canvas-d3.js +2 -2
- package/src/common-canvas/svg-canvas-renderer.js +11 -5
- package/src/common-properties/actions.js +10 -0
- package/src/common-properties/components/components.scss +1 -1
- package/src/common-properties/components/editor-form/editor-form.jsx +23 -3
- package/src/common-properties/components/wide-flyout/wide-flyout.jsx +5 -2
- package/src/common-properties/constants/constants.js +10 -1
- package/src/common-properties/constants/form-constants.js +6 -2
- package/src/common-properties/controls/abstract-table.jsx +2 -2
- package/src/common-properties/controls/checkboxset/checkboxset.scss +7 -4
- package/src/common-properties/controls/control-factory.js +5 -0
- package/src/common-properties/controls/controls.scss +1 -0
- package/src/common-properties/controls/dropdown/dropdown.jsx +7 -5
- package/src/common-properties/controls/expression/expression-builder/expression-select-field-function.jsx +14 -2
- package/src/common-properties/controls/expression/expression-toggle/expression-toggle.jsx +74 -0
- package/src/common-properties/controls/expression/expression-toggle/expression-toggle.scss +12 -0
- package/src/common-properties/controls/expression/expression.jsx +15 -1
- package/src/common-properties/controls/expression/expression.scss +61 -33
- package/src/common-properties/controls/expression/expressionInfo-parser.js +11 -1
- package/src/common-properties/controls/passwordfield/passwordfield.jsx +16 -14
- package/src/common-properties/controls/radioset/radioset.jsx +4 -4
- package/src/common-properties/controls/selectcolumns/selectcolumns.jsx +3 -3
- package/src/common-properties/controls/someofselect/someofselect.jsx +4 -4
- package/src/common-properties/controls/toggle/index.jsx +18 -0
- package/src/common-properties/controls/toggle/toggle.jsx +89 -0
- package/src/common-properties/controls/toggle/toggle.scss +23 -0
- package/src/common-properties/form/ControlInfo.js +3 -0
- package/src/common-properties/form/EditorForm.js +12 -1
- package/src/common-properties/form/ParameterInfo.js +5 -0
- package/src/common-properties/form/UIItem.js +10 -0
- package/src/common-properties/panels/panels.scss +1 -0
- package/src/common-properties/panels/summary/summary.jsx +5 -2
- package/src/common-properties/panels/tearsheet/index.js +18 -0
- package/src/common-properties/panels/tearsheet/tearsheet.jsx +54 -0
- package/src/common-properties/panels/tearsheet/tearsheet.scss +31 -0
- package/src/common-properties/properties-controller.js +40 -13
- package/src/common-properties/properties-main/properties-main.jsx +1 -0
- package/src/common-properties/properties-store.js +35 -3
- package/src/common-properties/reducers/tearsheet-states.js +29 -0
- package/src/common-properties/reducers/wide-flyout-primary-button-disable.jsx +31 -0
- package/src/common-properties/ui-conditions/condition-ops/colDoesExists.js +9 -3
- package/src/common-properties/ui-conditions/conditions-utils.js +10 -16
- package/src/object-model/api-pipeline.js +11 -4
- package/src/palette/palette-content-list-item.jsx +3 -1
- package/stats.html +1 -1
- package/dist/canvas-controller-c420f377.js +0 -2
- package/dist/canvas-controller-c420f377.js.map +0 -1
- package/dist/canvas-controller-e02a5de5.js +0 -2
- package/dist/canvas-controller-e02a5de5.js.map +0 -1
- package/dist/common-canvas-51ed78a5.js.map +0 -1
- package/dist/common-canvas-d0230688.js.map +0 -1
- package/dist/common-properties-0a697e6a.js +0 -2
- package/dist/common-properties-0a697e6a.js.map +0 -1
- package/dist/common-properties-233593d2.js +0 -2
- package/dist/common-properties-233593d2.js.map +0 -1
- package/dist/extends-1139e06f.js +0 -7
- package/dist/extends-1139e06f.js.map +0 -1
- package/dist/extends-8d17c85c.js.map +0 -1
- package/dist/flexible-table-0c7ae548.js +0 -2
- package/dist/flexible-table-60c73b88.js +0 -2
- package/dist/index-390d8148.js.map +0 -1
- package/dist/index-e6d8ea9c.js +0 -2
- package/dist/index-e6d8ea9c.js.map +0 -1
|
@@ -1520,6 +1520,11 @@ export default class SVGCanvasRenderer {
|
|
|
1520
1520
|
d3.select(this).select("rect")
|
|
1521
1521
|
.attr("data-pointer-hover", "no");
|
|
1522
1522
|
})
|
|
1523
|
+
.on("mousedown mouseup", (d3Event) => {
|
|
1524
|
+
// Prevent mouse events going through to the canvas. This prevents
|
|
1525
|
+
// a drag gesture on the button activating the canvas drag action.
|
|
1526
|
+
CanvasUtils.stopPropagationAndPreventDefault(d3Event);
|
|
1527
|
+
})
|
|
1523
1528
|
.on("click", (d3Event) => {
|
|
1524
1529
|
CanvasUtils.stopPropagationAndPreventDefault(d3Event);
|
|
1525
1530
|
this.canvasController.displayPreviousPipeline();
|
|
@@ -6697,7 +6702,7 @@ export default class SVGCanvasRenderer {
|
|
|
6697
6702
|
// Return the x,y coordinates of the svg group relative to the window's viewport
|
|
6698
6703
|
// This is used when a new comment is created from the toolbar to make sure the
|
|
6699
6704
|
// new comment always appears in the view port.
|
|
6700
|
-
|
|
6705
|
+
getDefaultCommentOffset() {
|
|
6701
6706
|
let xPos = this.canvasLayout.addCommentOffsetX;
|
|
6702
6707
|
let yPos = this.canvasLayout.addCommentOffsetY;
|
|
6703
6708
|
|
|
@@ -6710,10 +6715,11 @@ export default class SVGCanvasRenderer {
|
|
|
6710
6715
|
yPos = -yPos + this.canvasLayout.addCommentOffsetY;
|
|
6711
6716
|
}
|
|
6712
6717
|
|
|
6713
|
-
|
|
6714
|
-
|
|
6715
|
-
|
|
6716
|
-
}
|
|
6718
|
+
if (this.config.enableSnapToGridType === SNAP_TO_GRID_DURING ||
|
|
6719
|
+
this.config.enableSnapToGridType === SNAP_TO_GRID_AFTER) {
|
|
6720
|
+
return this.snapToGridPosition({ x: xPos, y: yPos });
|
|
6721
|
+
}
|
|
6722
|
+
return { x: xPos, y: yPos };
|
|
6717
6723
|
}
|
|
6718
6724
|
|
|
6719
6725
|
// Returns a string that explains which flags are set to true.
|
|
@@ -37,11 +37,13 @@ export const SET_TITLE = "SET_TITLE";
|
|
|
37
37
|
export const SET_ACTIVE_TAB = "SET_ACTIVE_TAB";
|
|
38
38
|
export const DISABLE_ROW_MOVE_BUTTONS = "DISABLE_ROW_MOVE_BUTTONS";
|
|
39
39
|
export const SET_SAVE_BUTTON_DISABLE = "SET_SAVE_BUTTON_DISABLE";
|
|
40
|
+
export const SET_WIDE_FLYOUT_PRIMARY_BUTTON_DISABLED = "SET_WIDE_FLYOUT_PRIMARY_BUTTON_DISABLED";
|
|
40
41
|
export const SET_ADD_REMOVE_ROWS = "SET_ADD_REMOVE_ROWS";
|
|
41
42
|
export const UPDATE_STATIC_ROWS = "UPDATE_STATIC_ROWS";
|
|
42
43
|
export const CLEAR_STATIC_ROWS = "CLEAR_STATIC_ROWS";
|
|
43
44
|
export const SET_TABLE_BUTTON_ENABLED = "SET_TABLE_BUTTON_ENABLED";
|
|
44
45
|
export const SET_HIDE_EDIT_BUTTON = "SET_HIDE_EDIT_BUTTON";
|
|
46
|
+
export const SET_ACTIVE_TEARSHEET = "SET_ACTIVE_TEARSHEET";
|
|
45
47
|
|
|
46
48
|
|
|
47
49
|
/*
|
|
@@ -129,6 +131,10 @@ export function setSaveButtonDisable(disableState) {
|
|
|
129
131
|
return { type: SET_SAVE_BUTTON_DISABLE, disableState };
|
|
130
132
|
}
|
|
131
133
|
|
|
134
|
+
export function setWideFlyoutPrimaryButtonDisabled(info) {
|
|
135
|
+
return { type: SET_WIDE_FLYOUT_PRIMARY_BUTTON_DISABLED, info };
|
|
136
|
+
}
|
|
137
|
+
|
|
132
138
|
export function setAddRemoveRows(info) {
|
|
133
139
|
return { type: SET_ADD_REMOVE_ROWS, info };
|
|
134
140
|
}
|
|
@@ -144,3 +150,7 @@ export function clearStaticRows(info) {
|
|
|
144
150
|
export function setTableButtonEnabled(info) {
|
|
145
151
|
return { type: SET_TABLE_BUTTON_ENABLED, info };
|
|
146
152
|
}
|
|
153
|
+
|
|
154
|
+
export function setTearsheetState(tearsheetId) {
|
|
155
|
+
return { type: SET_ACTIVE_TEARSHEET, tearsheetId };
|
|
156
|
+
}
|
|
@@ -20,7 +20,7 @@ import { connect } from "react-redux";
|
|
|
20
20
|
import { setActiveTab } from "./../../actions";
|
|
21
21
|
import { Tab, Tabs } from "carbon-components-react";
|
|
22
22
|
import * as PropertyUtil from "./../../util/property-utils";
|
|
23
|
-
import { MESSAGE_KEYS, CARBON_ICONS, CONDITION_MESSAGE_TYPE } from "./../../constants/constants";
|
|
23
|
+
import { MESSAGE_KEYS, CARBON_ICONS, CONDITION_MESSAGE_TYPE, STATES } from "./../../constants/constants";
|
|
24
24
|
import { cloneDeep, isEmpty, sortBy, get } from "lodash";
|
|
25
25
|
import logger from "./../../../../utils/logger";
|
|
26
26
|
import classNames from "classnames";
|
|
@@ -34,12 +34,13 @@ import ControlPanel from "./../../panels/control";
|
|
|
34
34
|
import Subtabs from "./../../panels/subtabs";
|
|
35
35
|
|
|
36
36
|
import WideFlyout from "./../wide-flyout";
|
|
37
|
+
import TearSheet from "../../panels/tearsheet";
|
|
37
38
|
import FieldPicker from "./../field-picker";
|
|
38
39
|
import TextPanel from "./../../panels/text-panel";
|
|
39
40
|
import ActionPanel from "./../../panels/action-panel";
|
|
40
41
|
|
|
41
42
|
import ActionFactory from "./../../actions/action-factory";
|
|
42
|
-
import Icon from "./../../../icons/icon
|
|
43
|
+
import Icon from "./../../../icons/icon";
|
|
43
44
|
|
|
44
45
|
const ALERT_TAB_GROUP = "alertMsgs";
|
|
45
46
|
|
|
@@ -128,8 +129,13 @@ class EditorForm extends React.Component {
|
|
|
128
129
|
const tabContent = [];
|
|
129
130
|
let hasAlertsTab = false;
|
|
130
131
|
let modalSelected = 0;
|
|
131
|
-
|
|
132
|
+
|
|
133
|
+
for (let i = 0; i < tabs.length; i++) {
|
|
132
134
|
const tab = tabs[i];
|
|
135
|
+
const tabState = this.props.controller.getPanelState({ name: tab.group });
|
|
136
|
+
if (tabState === STATES.HIDDEN) {
|
|
137
|
+
continue;
|
|
138
|
+
}
|
|
133
139
|
if (i === 0 && tab.group === ALERT_TAB_GROUP) {
|
|
134
140
|
hasAlertsTab = true;
|
|
135
141
|
}
|
|
@@ -313,6 +319,7 @@ class EditorForm extends React.Component {
|
|
|
313
319
|
case ("hSeparator"):
|
|
314
320
|
return <hr key={"h-separator." + key} className="properties-h-separator" />;
|
|
315
321
|
case ("panel"):
|
|
322
|
+
case ("tearsheet"):
|
|
316
323
|
return this.genPanel(key, uiItem.panel, inPropertyId, indexof);
|
|
317
324
|
case ("subTabs"):
|
|
318
325
|
return (<Subtabs key={"subtabs." + key}
|
|
@@ -426,6 +433,19 @@ class EditorForm extends React.Component {
|
|
|
426
433
|
>
|
|
427
434
|
{content}
|
|
428
435
|
</TwistyPanel>);
|
|
436
|
+
case ("tearsheet"):
|
|
437
|
+
if (this.props.controller.getActiveTearsheet() === panel.id) {
|
|
438
|
+
return (
|
|
439
|
+
<TearSheet
|
|
440
|
+
key={panel.id}
|
|
441
|
+
controller={this.props.controller}
|
|
442
|
+
panel={panel}
|
|
443
|
+
>
|
|
444
|
+
{content}
|
|
445
|
+
</TearSheet>
|
|
446
|
+
);
|
|
447
|
+
}
|
|
448
|
+
return null;
|
|
429
449
|
case ("column"):
|
|
430
450
|
return (
|
|
431
451
|
<ColumnPanel
|
|
@@ -82,6 +82,7 @@ export default class WideFlyout extends Component {
|
|
|
82
82
|
showPropertiesButtons={this.props.showPropertiesButtons}
|
|
83
83
|
applyLabel={this.props.applyLabel}
|
|
84
84
|
rejectLabel={this.props.rejectLabel}
|
|
85
|
+
applyButtonEnabled={this.props.okButtonEnabled}
|
|
85
86
|
/>);
|
|
86
87
|
children = (<div className="properties-wf-children"> {this.props.children} </div>);
|
|
87
88
|
}
|
|
@@ -109,9 +110,11 @@ WideFlyout.propTypes = {
|
|
|
109
110
|
applyLabel: PropTypes.string,
|
|
110
111
|
rejectLabel: PropTypes.string,
|
|
111
112
|
title: PropTypes.string,
|
|
112
|
-
light: PropTypes.bool
|
|
113
|
+
light: PropTypes.bool,
|
|
114
|
+
okButtonEnabled: PropTypes.bool
|
|
113
115
|
};
|
|
114
116
|
|
|
115
117
|
WideFlyout.defaultProps = {
|
|
116
|
-
show: false
|
|
118
|
+
show: false,
|
|
119
|
+
okButtonEnabled: true
|
|
117
120
|
};
|
|
@@ -64,7 +64,9 @@ export const MESSAGE_KEYS = {
|
|
|
64
64
|
EXPRESSION_BUILDER_ICON_DESCRIPTION: "expression.builder.icon.description",
|
|
65
65
|
EXPRESSION_BUILDER_LABEL: "expression.builder.label",
|
|
66
66
|
EXPRESSION_FIELDS_TABLE_LABEL: "expression.fields.table.label",
|
|
67
|
+
EXPRESSION_FIELDS_EMPTY_TABLE_LABEL: "expression.fields.empty.table.label",
|
|
67
68
|
EXPRESSION_VALUES_TABLE_LABEL: "expression.values.table.label",
|
|
69
|
+
EXPRESSION_VALUES_EMPTY_TABLE_LABEL: "expression.values.empty.table.label",
|
|
68
70
|
EXPRESSION_FUNCTIONS_TABLE_LABEL: "expression.functions.table.label",
|
|
69
71
|
EXPRESSION_FIELDS_DROPDOWN_TITLE: "expression.fields.dropdown",
|
|
70
72
|
EXPRESSION_FIELDS_TITLE: "expression.fields.title",
|
|
@@ -100,7 +102,9 @@ export const MESSAGE_KEYS = {
|
|
|
100
102
|
TOGGLETEXT_ICON_DESCRIPTION: "toggletext.icon.description",
|
|
101
103
|
MULTISELECT_DROPDOWN_EMPTY_LABEL: "multiselect.dropdown.empty.label",
|
|
102
104
|
MULTISELECT_DROPDOWN_OPTIONS_SELECTED_LABEL: "multiselect.dropdown.options.selected.label",
|
|
103
|
-
PROPERTIES_EMPTY_TABLE_TEXT: "properties.empty.table.text"
|
|
105
|
+
PROPERTIES_EMPTY_TABLE_TEXT: "properties.empty.table.text",
|
|
106
|
+
TOGGLE_ON_LABEL: "toggle.on.label",
|
|
107
|
+
TOGGLE_OFF_LABEL: "toggle.off.label"
|
|
104
108
|
};
|
|
105
109
|
|
|
106
110
|
export const TRUNCATE_LIMIT = 10000;
|
|
@@ -124,6 +128,11 @@ export const CONDITION_MESSAGE_TYPE = {
|
|
|
124
128
|
|
|
125
129
|
export const SPINNER = "spinner";
|
|
126
130
|
|
|
131
|
+
|
|
132
|
+
export const UPDATE_TYPE = {
|
|
133
|
+
INITIAL_LOAD: "initial_load"
|
|
134
|
+
};
|
|
135
|
+
|
|
127
136
|
export const DATA_TYPE = {
|
|
128
137
|
INTEGER: "integer",
|
|
129
138
|
DOUBLE: "double",
|
|
@@ -20,6 +20,7 @@ const ItemType = {
|
|
|
20
20
|
STATIC_TEXT: "staticText",
|
|
21
21
|
HORIZONTAL_SEPARATOR: "hSeparator",
|
|
22
22
|
PANEL: "panel",
|
|
23
|
+
TEARSHEET: "tearsheet",
|
|
23
24
|
SUB_TABS: "subTabs",
|
|
24
25
|
PRIMARY_TABS: "primaryTabs",
|
|
25
26
|
PANEL_SELECTOR: "panelSelector",
|
|
@@ -53,7 +54,8 @@ const GroupType = {
|
|
|
53
54
|
ACTION_PANEL: "actionPanel",
|
|
54
55
|
TEXT_PANEL: "textPanel",
|
|
55
56
|
TWISTY_PANEL: "twistyPanel",
|
|
56
|
-
COLUMN_PANEL: "columnPanel"
|
|
57
|
+
COLUMN_PANEL: "columnPanel",
|
|
58
|
+
TEARSHEET_PANEL: "tearsheetPanel"
|
|
57
59
|
};
|
|
58
60
|
|
|
59
61
|
const PanelType = {
|
|
@@ -63,7 +65,8 @@ const PanelType = {
|
|
|
63
65
|
SUMMARY: "summary",
|
|
64
66
|
ACTION_PANEL: "actionPanel",
|
|
65
67
|
TWISTY_PANEL: "twisty",
|
|
66
|
-
COLUMN_PANEL: "column"
|
|
68
|
+
COLUMN_PANEL: "column",
|
|
69
|
+
TEARSHEET: "tearsheet"
|
|
67
70
|
};
|
|
68
71
|
|
|
69
72
|
const ControlType = {
|
|
@@ -78,6 +81,7 @@ const ControlType = {
|
|
|
78
81
|
TIMEFIELD: "timefield",
|
|
79
82
|
TIMESTAMP: "timestampfield",
|
|
80
83
|
CHECKBOX: "checkbox",
|
|
84
|
+
TOGGLE: "toggle",
|
|
81
85
|
RADIOSET: "radioset",
|
|
82
86
|
CHECKBOXSET: "checkboxset",
|
|
83
87
|
ONEOFSELECT: "oneofselect",
|
|
@@ -27,7 +27,7 @@ import classNames from "classnames";
|
|
|
27
27
|
import { Add16, TrashCan16, Edit16 } from "@carbon/icons-react";
|
|
28
28
|
import { ControlType, EditStyle } from "./../constants/form-constants";
|
|
29
29
|
|
|
30
|
-
import { MESSAGE_KEYS, STATES, TABLE_SUBPANEL_BUTTON_WIDTH, SORT_DIRECTION, ROW_SELECTION } from "./../constants/constants";
|
|
30
|
+
import { MESSAGE_KEYS, STATES, TABLE_SUBPANEL_BUTTON_WIDTH, SORT_DIRECTION, ROW_SELECTION, UPDATE_TYPE } from "./../constants/constants";
|
|
31
31
|
|
|
32
32
|
import { isEqual, findIndex, sortBy, cloneDeep } from "lodash";
|
|
33
33
|
|
|
@@ -85,7 +85,7 @@ export default class AbstractTable extends React.Component {
|
|
|
85
85
|
componentDidMount() {
|
|
86
86
|
if (this.props.control.subControls) {
|
|
87
87
|
const updatedControlValues = this.setReadOnlyColumnValue();
|
|
88
|
-
this.props.controller.updatePropertyValue(this.props.propertyId, updatedControlValues, true);
|
|
88
|
+
this.props.controller.updatePropertyValue(this.props.propertyId, updatedControlValues, true, UPDATE_TYPE.INITIAL_LOAD);
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
|
|
@@ -18,15 +18,18 @@
|
|
|
18
18
|
&.hide {
|
|
19
19
|
display: none;
|
|
20
20
|
}
|
|
21
|
-
.bx--checkbox-wrapper { //override carbon checkbox styling
|
|
21
|
+
.bx--form-item.bx--checkbox-wrapper:first-of-type { //override carbon checkbox styling
|
|
22
22
|
margin-bottom: $spacing-03;
|
|
23
|
+
flex: 0 1 auto; // Do not allow value to take up entire width
|
|
23
24
|
}
|
|
24
25
|
.properties-checkboxset-container {
|
|
25
26
|
.properties-checkbox-tooltip-container{
|
|
26
|
-
display:
|
|
27
|
+
display: flex;
|
|
27
28
|
align-items: center;
|
|
28
|
-
|
|
29
|
-
|
|
29
|
+
|
|
30
|
+
.tooltip-container {
|
|
31
|
+
margin-bottom: $spacing-02;
|
|
32
|
+
}
|
|
30
33
|
}
|
|
31
34
|
&.error:not([disabled]) {
|
|
32
35
|
padding-bottom: $spacing-02;
|
|
@@ -35,6 +35,7 @@ import NumberfieldControl from "./numberfield";
|
|
|
35
35
|
import DatefieldControl from "./datefield";
|
|
36
36
|
import TimefieldControl from "./timefield";
|
|
37
37
|
import CheckboxControl from "./checkbox";
|
|
38
|
+
import ToggleControl from "./toggle";
|
|
38
39
|
import CheckboxsetControl from "./checkboxset";
|
|
39
40
|
import RadiosetControl from "./radioset";
|
|
40
41
|
import Dropdown from "./dropdown";
|
|
@@ -66,6 +67,7 @@ const accessibleControls = [
|
|
|
66
67
|
ControlType.TIMEFIELD,
|
|
67
68
|
ControlType.TOGGLETEXT,
|
|
68
69
|
ControlType.LIST,
|
|
70
|
+
ControlType.TOGGLE,
|
|
69
71
|
ControlType.SOMEOFSELECT,
|
|
70
72
|
ControlType.SELECTCOLUMNS,
|
|
71
73
|
ControlType.READONLY,
|
|
@@ -183,6 +185,9 @@ export default class ControlFactory {
|
|
|
183
185
|
case (ControlType.TEXTAREA):
|
|
184
186
|
createdControl = (<TextareaControl {...props} />);
|
|
185
187
|
break;
|
|
188
|
+
case (ControlType.TOGGLE):
|
|
189
|
+
createdControl = (<ToggleControl {...props} />);
|
|
190
|
+
break;
|
|
186
191
|
case (ControlType.LIST):
|
|
187
192
|
createdControl = (<ListControl {...props} />);
|
|
188
193
|
break;
|
|
@@ -24,7 +24,7 @@ import ValidationMessage from "./../../components/validation-message";
|
|
|
24
24
|
import classNames from "classnames";
|
|
25
25
|
import * as PropertyUtils from "./../../util/property-utils.js";
|
|
26
26
|
import { ControlType } from "./../../constants/form-constants";
|
|
27
|
-
import { MESSAGE_KEYS, STATES } from "./../../constants/constants.js";
|
|
27
|
+
import { MESSAGE_KEYS, STATES, UPDATE_TYPE } from "./../../constants/constants.js";
|
|
28
28
|
import { formatMessage } from "./../../util/property-utils";
|
|
29
29
|
|
|
30
30
|
class DropDown extends React.Component {
|
|
@@ -46,7 +46,7 @@ class DropDown extends React.Component {
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
componentDidMount() {
|
|
49
|
-
this.updateValueFromFilterEnum(true);
|
|
49
|
+
this.updateValueFromFilterEnum(true, UPDATE_TYPE.INITIAL_LOAD);
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
componentDidUpdate(prevProps) {
|
|
@@ -63,8 +63,10 @@ class DropDown extends React.Component {
|
|
|
63
63
|
});
|
|
64
64
|
selectedOption = typeof selectedOption === "undefined" ? null : selectedOption;
|
|
65
65
|
|
|
66
|
+
// Show the existing value but with a warning instead of filtering it out.
|
|
67
|
+
const showExistingValue = (selectedOption === null && value);
|
|
66
68
|
// user defined value
|
|
67
|
-
if (
|
|
69
|
+
if (showExistingValue || this.props.control.customValueAllowed) {
|
|
68
70
|
selectedOption = {
|
|
69
71
|
value: value,
|
|
70
72
|
label: value
|
|
@@ -132,7 +134,7 @@ class DropDown extends React.Component {
|
|
|
132
134
|
};
|
|
133
135
|
}
|
|
134
136
|
// this is needed in order to reset the property value when a value is filtered out.
|
|
135
|
-
updateValueFromFilterEnum(skipValidateInput) {
|
|
137
|
+
updateValueFromFilterEnum(skipValidateInput, updateType) {
|
|
136
138
|
// update property value if value isn't in current enum value. Should only be used for oneofselect
|
|
137
139
|
if (this.props.control.controlType === ControlType.ONEOFSELECT && this.props.value !== null && typeof this.props.value !== "undefined" &&
|
|
138
140
|
!this.props.controlOpts.values.includes(this.props.value)) {
|
|
@@ -143,7 +145,7 @@ class DropDown extends React.Component {
|
|
|
143
145
|
} else if (this.props.control.customValueAllowed && this.props.value) {
|
|
144
146
|
defaultValue = this.props.value;
|
|
145
147
|
}
|
|
146
|
-
this.props.controller.updatePropertyValue(this.props.propertyId, defaultValue, skipValidateInput);
|
|
148
|
+
this.props.controller.updatePropertyValue(this.props.propertyId, defaultValue, skipValidateInput, updateType);
|
|
147
149
|
}
|
|
148
150
|
}
|
|
149
151
|
|
|
@@ -21,7 +21,7 @@ import FlexibleTable from "./../../../components/flexible-table/flexible-table";
|
|
|
21
21
|
import TruncatedContentTooltip from "./../../../components/truncated-content-tooltip";
|
|
22
22
|
import { MESSAGE_KEYS, EXPRESSION_TABLE_ROWS, SORT_DIRECTION, ROW_SELECTION } from "./../../../constants/constants";
|
|
23
23
|
import { formatMessage } from "./../../../util/property-utils";
|
|
24
|
-
import { sortBy } from "lodash";
|
|
24
|
+
import { sortBy, get } from "lodash";
|
|
25
25
|
import { v4 as uuid4 } from "uuid";
|
|
26
26
|
|
|
27
27
|
export default class ExpressionSelectFieldOrFunction extends React.Component {
|
|
@@ -47,6 +47,7 @@ export default class ExpressionSelectFieldOrFunction extends React.Component {
|
|
|
47
47
|
};
|
|
48
48
|
this.inCategories = Object.keys(props.functionList);
|
|
49
49
|
this.fields = this._makeDatasetFields(props.controller.getDatasetMetadataFields(), props.controller.getExpressionInfo().fields);
|
|
50
|
+
this.resources = get(props.controller.getExpressionInfo(), "resources", {});
|
|
50
51
|
this.state = {
|
|
51
52
|
fieldSelected: 0,
|
|
52
53
|
valueSelected: 0,
|
|
@@ -412,8 +413,13 @@ export default class ExpressionSelectFieldOrFunction extends React.Component {
|
|
|
412
413
|
valuesTableData = this.sortTableRows(valuesTableData, this.state.valuesTableSortSpec);
|
|
413
414
|
selectedValue = valuesTableData.findIndex((row) => row.rowKey === this.state.valueSelected);
|
|
414
415
|
}
|
|
416
|
+
|
|
415
417
|
const fieldsTableLabel = formatMessage(this.reactIntl, MESSAGE_KEYS.EXPRESSION_FIELDS_TABLE_LABEL);
|
|
416
418
|
const valuesTableLabel = formatMessage(this.reactIntl, MESSAGE_KEYS.EXPRESSION_VALUES_TABLE_LABEL);
|
|
419
|
+
const emptyFieldsLabel = get(this.resources, MESSAGE_KEYS.EXPRESSION_FIELDS_EMPTY_TABLE_LABEL,
|
|
420
|
+
formatMessage(this.reactIntl, MESSAGE_KEYS.EXPRESSION_FIELDS_EMPTY_TABLE_LABEL));
|
|
421
|
+
const emptyValuesLabel = get(this.resources, MESSAGE_KEYS.EXPRESSION_VALUES_EMPTY_TABLE_LABEL,
|
|
422
|
+
formatMessage(this.reactIntl, MESSAGE_KEYS.EXPRESSION_VALUES_EMPTY_TABLE_LABEL));
|
|
417
423
|
|
|
418
424
|
return (
|
|
419
425
|
<div className="properties-field-and-values-table-container" >
|
|
@@ -433,6 +439,7 @@ export default class ExpressionSelectFieldOrFunction extends React.Component {
|
|
|
433
439
|
onRowDoubleClick={this.onFieldTableDblClick}
|
|
434
440
|
onSort={this.setSortColumn.bind(this, "fieldTable")}
|
|
435
441
|
light={this.props.controller.getLight()}
|
|
442
|
+
emptyTablePlaceholder={emptyFieldsLabel}
|
|
436
443
|
/>
|
|
437
444
|
</div>
|
|
438
445
|
<div className="properties-value-table-container" >
|
|
@@ -450,6 +457,7 @@ export default class ExpressionSelectFieldOrFunction extends React.Component {
|
|
|
450
457
|
onRowDoubleClick={this.onValueTableDblClick}
|
|
451
458
|
onSort={this.setSortColumn.bind(this, "valuesTable")}
|
|
452
459
|
light={this.props.controller.getLight()}
|
|
460
|
+
emptyTablePlaceholder={emptyValuesLabel}
|
|
453
461
|
/>
|
|
454
462
|
</div>
|
|
455
463
|
</div>
|
|
@@ -585,6 +593,8 @@ export default class ExpressionSelectFieldOrFunction extends React.Component {
|
|
|
585
593
|
selectedFunction = data.findIndex((row) => row.rowKey === this.state.functionSelected);
|
|
586
594
|
}
|
|
587
595
|
const functionsTableLabel = formatMessage(this.reactIntl, MESSAGE_KEYS.EXPRESSION_FUNCTIONS_TABLE_LABEL);
|
|
596
|
+
const functionsEmptyLabel = get(this.resources, MESSAGE_KEYS.EXPRESSION_NO_FUNCTIONS,
|
|
597
|
+
formatMessage(this.reactIntl, MESSAGE_KEYS.EXPRESSION_NO_FUNCTIONS));
|
|
588
598
|
|
|
589
599
|
return (
|
|
590
600
|
<div className="properties-functions-table-container" >
|
|
@@ -603,6 +613,7 @@ export default class ExpressionSelectFieldOrFunction extends React.Component {
|
|
|
603
613
|
onRowDoubleClick={this.onFunctionTableDblClick}
|
|
604
614
|
onSort={this.setSortColumn.bind(this, "functionTable")}
|
|
605
615
|
light={this.props.controller.getLight()}
|
|
616
|
+
emptyTablePlaceholder={functionsEmptyLabel}
|
|
606
617
|
/>
|
|
607
618
|
</div>
|
|
608
619
|
<div className="properties-help-table-container" >
|
|
@@ -621,8 +632,9 @@ export default class ExpressionSelectFieldOrFunction extends React.Component {
|
|
|
621
632
|
const columns = [];
|
|
622
633
|
if (!this.state.functionFilterText || this.state.functionFilterText.length === 0 ||
|
|
623
634
|
(catFunction.locLabel.toLowerCase().indexOf(this.state.functionFilterText.toLowerCase()) > -1)) {
|
|
635
|
+
const returnType = catFunction.locReturnType ? catFunction.locReturnType : catFunction.return_type;
|
|
624
636
|
columns.push({ column: "function", content: this.createContentObject(catFunction.locLabel), value: catFunction.locLabel });
|
|
625
|
-
columns.push({ column: "return", content: this.createContentObject(
|
|
637
|
+
columns.push({ column: "return", content: this.createContentObject(returnType), value: returnType });
|
|
626
638
|
table.rows.push({ columns: columns, rowKey: index });
|
|
627
639
|
if (index === this.state.functionSelected) {
|
|
628
640
|
table.helpContainer = (
|
|
@@ -0,0 +1,74 @@
|
|
|
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
|
+
// Base class for table controls
|
|
17
|
+
|
|
18
|
+
import React from "react";
|
|
19
|
+
import PropTypes from "prop-types";
|
|
20
|
+
import { injectIntl } from "react-intl";
|
|
21
|
+
import { Button } from "carbon-components-react";
|
|
22
|
+
import { Maximize16, Minimize16 } from "@carbon/icons-react";
|
|
23
|
+
|
|
24
|
+
const maximizeId = "expression.maximize.label";
|
|
25
|
+
const minimizeId = "expression.minimize.label";
|
|
26
|
+
|
|
27
|
+
class ExpressionToggle extends React.Component {
|
|
28
|
+
constructor(props) {
|
|
29
|
+
super(props);
|
|
30
|
+
this.buttonHandler = props.controller.getHandlers().buttonHandler || (() => null);
|
|
31
|
+
}
|
|
32
|
+
render() {
|
|
33
|
+
return (
|
|
34
|
+
<div className="properties-expression-toggle">
|
|
35
|
+
<div className="properties-expression-toggle-absolute">
|
|
36
|
+
{this.props.enableMaximize ? (<Button
|
|
37
|
+
className="maximize"
|
|
38
|
+
type="button"
|
|
39
|
+
size="small"
|
|
40
|
+
kind="ghost"
|
|
41
|
+
renderIcon={Maximize16}
|
|
42
|
+
hasIconOnly
|
|
43
|
+
iconDescription={this.props.intl.formatMessage({ id: maximizeId })}
|
|
44
|
+
onClick={() => {
|
|
45
|
+
const handlerStatus = this.buttonHandler({
|
|
46
|
+
type: "maximize_tearsheet",
|
|
47
|
+
propertyId: this.props.control.data || {}
|
|
48
|
+
});
|
|
49
|
+
if (!handlerStatus && this.props.control.data && this.props.control.data.tearsheet_ref) {
|
|
50
|
+
this.props.controller.setActiveTearsheet(this.props.control.data.tearsheet_ref);
|
|
51
|
+
}
|
|
52
|
+
}}
|
|
53
|
+
/>) : (<Button
|
|
54
|
+
type="button"
|
|
55
|
+
className="minimize"
|
|
56
|
+
size="small"
|
|
57
|
+
kind="ghost"
|
|
58
|
+
hasIconOnly
|
|
59
|
+
renderIcon={Minimize16}
|
|
60
|
+
iconDescription={this.props.intl.formatMessage({ id: minimizeId })}
|
|
61
|
+
onClick={() => this.props.controller.clearActiveTearsheet()}
|
|
62
|
+
/>)
|
|
63
|
+
}
|
|
64
|
+
</div>
|
|
65
|
+
</div>);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
ExpressionToggle.propTypes = {
|
|
69
|
+
intl: PropTypes.object.isRequired,
|
|
70
|
+
control: PropTypes.object.isRequired,
|
|
71
|
+
controller: PropTypes.object.isRequired,
|
|
72
|
+
enableMaximize: PropTypes.bool
|
|
73
|
+
};
|
|
74
|
+
export default injectIntl(ExpressionToggle);
|
|
@@ -32,6 +32,8 @@ import { MESSAGE_KEYS, CONDITION_MESSAGE_TYPE, DEFAULT_VALIDATION_MESSAGE } from
|
|
|
32
32
|
import { Calculator24 } from "@carbon/icons-react";
|
|
33
33
|
import * as ControlUtils from "./../../util/control-utils";
|
|
34
34
|
import { STATES } from "./../../constants/constants";
|
|
35
|
+
import { get } from "lodash";
|
|
36
|
+
import ExpressionToggle from "./expression-toggle/expression-toggle";
|
|
35
37
|
|
|
36
38
|
import { register as registerPython } from "./languages/python-hint";
|
|
37
39
|
import { register as registerR } from "./languages/r-hint";
|
|
@@ -312,7 +314,8 @@ class ExpressionControl extends React.Component {
|
|
|
312
314
|
theme: theme + " custom",
|
|
313
315
|
readOnly: (this.props.state === STATES.DISABLED) ? "nocursor" : false,
|
|
314
316
|
extraKeys: { "Ctrl-Space": "autocomplete" },
|
|
315
|
-
autoRefresh: true
|
|
317
|
+
autoRefresh: true,
|
|
318
|
+
lineNumbers: true
|
|
316
319
|
};
|
|
317
320
|
const applyLabel = formatMessage(reactIntl, MESSAGE_KEYS.APPLYBUTTON_LABEL);
|
|
318
321
|
const rejectLabel = formatMessage(reactIntl, MESSAGE_KEYS.REJECTBUTTON_LABEL);
|
|
@@ -352,12 +355,23 @@ class ExpressionControl extends React.Component {
|
|
|
352
355
|
</div>);
|
|
353
356
|
}
|
|
354
357
|
|
|
358
|
+
let toggleMaxMin = null;
|
|
359
|
+
if (this.props.control.enableMaximize) {
|
|
360
|
+
const isTearsheetOpen = this.props.controller.getActiveTearsheet() === get(this, "props.control.data.tearsheet_ref");
|
|
361
|
+
toggleMaxMin = (<ExpressionToggle
|
|
362
|
+
control={this.props.control}
|
|
363
|
+
controller={this.props.controller}
|
|
364
|
+
enableMaximize={!isTearsheetOpen}
|
|
365
|
+
/>);
|
|
366
|
+
}
|
|
367
|
+
|
|
355
368
|
return (
|
|
356
369
|
<div className="properties-expression-editor-wrapper" >
|
|
357
370
|
{this.props.controlItem}
|
|
358
371
|
{flyout}
|
|
359
372
|
<div className="properties-editor-container">
|
|
360
373
|
{header}
|
|
374
|
+
{toggleMaxMin}
|
|
361
375
|
<div ref={ (ref) => (this.expressionEditorDiv = ref) } data-id={ControlUtils.getDataId(this.props.propertyId)}
|
|
362
376
|
className={className}
|
|
363
377
|
>
|