@elyra/canvas 12.20.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/{common-canvas-0c35f64f.js → common-canvas-bcfe04ef.js} +2 -2
- package/dist/common-canvas-bcfe04ef.js.map +1 -0
- package/dist/{common-canvas-b60fe77c.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-634d1af7.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-72146c49.js.map → flexible-table-056c538e.js.map} +1 -1
- package/dist/flexible-table-7fb8a62e.js +2 -0
- package/dist/{flexible-table-fa8e4aa4.js.map → flexible-table-7fb8a62e.js.map} +1 -1
- package/dist/{icon-079f1f09.js → icon-162ec1ee.js} +2 -2
- package/dist/{icon-079f1f09.js.map → icon-162ec1ee.js.map} +1 -1
- package/dist/{icon-4ba4a133.js → icon-1ef0f3b9.js} +2 -2
- package/dist/{icon-4ba4a133.js.map → icon-1ef0f3b9.js.map} +1 -1
- package/dist/{index-e0fcee5d.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.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-011cf35e.js → toolbar-59ce5251.js} +2 -2
- package/dist/{toolbar-011cf35e.js.map → toolbar-59ce5251.js.map} +1 -1
- package/dist/{toolbar-91cb4665.js → toolbar-bb5bee87.js} +2 -2
- package/dist/{toolbar-91cb4665.js.map → toolbar-bb5bee87.js.map} +1 -1
- package/locales/common-properties/locales/en.json +4 -0
- package/locales/common-properties/locales/eo.json +4 -0
- package/package.json +3 -3
- package/src/common-canvas/svg-canvas-renderer.js +5 -0
- package/src/common-properties/actions.js +5 -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/constants/constants.js +2 -0
- package/src/common-properties/constants/form-constants.js +5 -2
- package/src/common-properties/controls/checkboxset/checkboxset.scss +7 -4
- 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 +13 -0
- package/src/common-properties/controls/expression/expression.scss +1 -0
- 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/selectcolumns/selectcolumns.jsx +3 -3
- 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/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 +9 -0
- package/src/common-properties/properties-store.js +17 -2
- package/src/common-properties/reducers/tearsheet-states.js +29 -0
- package/stats.html +1 -1
- package/dist/common-canvas-0c35f64f.js.map +0 -1
- package/dist/common-canvas-b60fe77c.js.map +0 -1
- package/dist/common-properties-5d20f9bf.js +0 -2
- package/dist/common-properties-5d20f9bf.js.map +0 -1
- package/dist/common-properties-80b89ad2.js +0 -2
- package/dist/common-properties-80b89ad2.js.map +0 -1
- package/dist/extends-42886b42.js +0 -7
- package/dist/extends-42886b42.js.map +0 -1
- package/dist/extends-634d1af7.js.map +0 -1
- package/dist/flexible-table-72146c49.js +0 -2
- package/dist/flexible-table-fa8e4aa4.js +0 -2
- package/dist/index-ddc2e031.js +0 -2
- package/dist/index-ddc2e031.js.map +0 -1
- package/dist/index-e0fcee5d.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elyra/canvas",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.21.0",
|
|
4
4
|
"description": "Elyra common-canvas",
|
|
5
5
|
"main": "dist/common-canvas.js",
|
|
6
6
|
"module": "dist/common-canvas.es.js",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@babel/runtime": "^7.16.3",
|
|
26
|
-
"@elyra/pipeline-schemas": "^3.0.
|
|
26
|
+
"@elyra/pipeline-schemas": "^3.0.63",
|
|
27
27
|
"codemirror": "^5.58.2",
|
|
28
28
|
"d3": "^7.1.1",
|
|
29
29
|
"dagre": "^0.8.5",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"eslint-config-canvas": "file:../eslint-config-canvas",
|
|
75
75
|
"eslint-plugin-import": "2.25.3",
|
|
76
76
|
"eslint-plugin-react": "7.21.2",
|
|
77
|
-
"grunt": "1.3
|
|
77
|
+
"grunt": "1.5.3",
|
|
78
78
|
"grunt-contrib-clean": "2.0.0",
|
|
79
79
|
"grunt-contrib-sass": "2.0.0",
|
|
80
80
|
"grunt-env": "1.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();
|
|
@@ -43,6 +43,7 @@ export const UPDATE_STATIC_ROWS = "UPDATE_STATIC_ROWS";
|
|
|
43
43
|
export const CLEAR_STATIC_ROWS = "CLEAR_STATIC_ROWS";
|
|
44
44
|
export const SET_TABLE_BUTTON_ENABLED = "SET_TABLE_BUTTON_ENABLED";
|
|
45
45
|
export const SET_HIDE_EDIT_BUTTON = "SET_HIDE_EDIT_BUTTON";
|
|
46
|
+
export const SET_ACTIVE_TEARSHEET = "SET_ACTIVE_TEARSHEET";
|
|
46
47
|
|
|
47
48
|
|
|
48
49
|
/*
|
|
@@ -149,3 +150,7 @@ export function clearStaticRows(info) {
|
|
|
149
150
|
export function setTableButtonEnabled(info) {
|
|
150
151
|
return { type: SET_TABLE_BUTTON_ENABLED, info };
|
|
151
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
|
|
@@ -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",
|
|
@@ -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 = {
|
|
@@ -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;
|
|
@@ -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";
|
|
@@ -353,12 +355,23 @@ class ExpressionControl extends React.Component {
|
|
|
353
355
|
</div>);
|
|
354
356
|
}
|
|
355
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
|
+
|
|
356
368
|
return (
|
|
357
369
|
<div className="properties-expression-editor-wrapper" >
|
|
358
370
|
{this.props.controlItem}
|
|
359
371
|
{flyout}
|
|
360
372
|
<div className="properties-editor-container">
|
|
361
373
|
{header}
|
|
374
|
+
{toggleMaxMin}
|
|
362
375
|
<div ref={ (ref) => (this.expressionEditorDiv = ref) } data-id={ControlUtils.getDataId(this.props.propertyId)}
|
|
363
376
|
className={className}
|
|
364
377
|
>
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import logger from "../../../../utils/logger";
|
|
18
|
-
import { L10nProvider } from "../../util/L10nProvider";
|
|
18
|
+
import { L10nProvider, ResourceDef } from "../../util/L10nProvider";
|
|
19
19
|
import { cloneDeep, propertyOf } from "lodash";
|
|
20
20
|
|
|
21
21
|
function setExpressionInfo(inExpressionInfo) {
|
|
@@ -75,6 +75,11 @@ function setExpressionInfo(inExpressionInfo) {
|
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
|
+
|
|
79
|
+
if (inExpressionInfo && inExpressionInfo.resources) {
|
|
80
|
+
expressionFunctionInfo.resources = inExpressionInfo.resources;
|
|
81
|
+
}
|
|
82
|
+
|
|
78
83
|
return expressionFunctionInfo;
|
|
79
84
|
}
|
|
80
85
|
|
|
@@ -85,6 +90,11 @@ function _genFunctionParameters(functionInfoList, l10nProvider) {
|
|
|
85
90
|
newEntry.locLabel = l10nProvider.l10nLabel(newEntry, newEntry.id);
|
|
86
91
|
newEntry.help = l10nProvider.l10nDesc(newEntry, newEntry.locLabel);
|
|
87
92
|
newEntry.value = newEntry.locLabel;
|
|
93
|
+
// Translatable return type of function
|
|
94
|
+
if (newEntry.return_type_label) {
|
|
95
|
+
const returnTypeLabel = ResourceDef.make(newEntry.return_type_label);
|
|
96
|
+
newEntry.locReturnType = l10nProvider.l10nResource(returnTypeLabel);
|
|
97
|
+
}
|
|
88
98
|
if (Array.isArray(functionInfo.parameters)) {
|
|
89
99
|
// if the function label has any parameter substituion char '?' then replace with parameter label
|
|
90
100
|
if (newEntry.locLabel && newEntry.locLabel.indexOf("?") !== -1) {
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
import React from "react";
|
|
18
18
|
import PropTypes from "prop-types";
|
|
19
19
|
import { connect } from "react-redux";
|
|
20
|
-
import { TextInput } from "carbon-components-react";
|
|
20
|
+
import { TextInput, Form } from "carbon-components-react";
|
|
21
21
|
import ValidationMessage from "./../../components/validation-message";
|
|
22
22
|
import * as ControlUtils from "./../../util/control-utils";
|
|
23
23
|
import { STATES } from "./../../constants/constants.js";
|
|
@@ -40,19 +40,21 @@ class PasswordControl extends React.Component {
|
|
|
40
40
|
const validationProps = ControlUtils.getValidationProps(this.props.messageInfo, this.props.tableControl);
|
|
41
41
|
return (
|
|
42
42
|
<div className={className} data-id={ControlUtils.getDataId(this.props.propertyId)}>
|
|
43
|
-
<
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
43
|
+
<Form>
|
|
44
|
+
<TextInput.PasswordInput
|
|
45
|
+
{...validationProps}
|
|
46
|
+
autoComplete="off"
|
|
47
|
+
id={this.id}
|
|
48
|
+
disabled={this.props.state === STATES.DISABLED}
|
|
49
|
+
placeholder={this.props.control.additionalText}
|
|
50
|
+
onChange={this.handleChange.bind(this)}
|
|
51
|
+
value={value}
|
|
52
|
+
labelText={this.props.controlItem}
|
|
53
|
+
hideLabel={this.props.tableControl}
|
|
54
|
+
light={this.props.controller.getLight()}
|
|
55
|
+
tooltipAlignment="end"
|
|
56
|
+
/>
|
|
57
|
+
</Form>
|
|
56
58
|
<ValidationMessage inTable={this.props.tableControl} tableOnly state={this.props.state} messageInfo={this.props.messageInfo} />
|
|
57
59
|
</div>);
|
|
58
60
|
}
|
|
@@ -31,7 +31,7 @@ import ReadonlyControl from "./../readonly";
|
|
|
31
31
|
|
|
32
32
|
/* eslint max-depth: ["error", 6] */
|
|
33
33
|
|
|
34
|
-
class
|
|
34
|
+
class SelectColumnsControl extends AbstractTable {
|
|
35
35
|
|
|
36
36
|
constructor(props) {
|
|
37
37
|
super(props);
|
|
@@ -170,7 +170,7 @@ class SelectColumns extends AbstractTable {
|
|
|
170
170
|
}
|
|
171
171
|
}
|
|
172
172
|
|
|
173
|
-
|
|
173
|
+
SelectColumnsControl.propTypes = {
|
|
174
174
|
control: PropTypes.object.isRequired,
|
|
175
175
|
propertyId: PropTypes.object.isRequired,
|
|
176
176
|
controller: PropTypes.object.isRequired,
|
|
@@ -194,4 +194,4 @@ const mapStateToProps = (state, ownProps) => ({
|
|
|
194
194
|
tableButtons: ownProps.controller.getTableButtons(ownProps.propertyId)
|
|
195
195
|
});
|
|
196
196
|
|
|
197
|
-
export default connect(mapStateToProps, null)(
|
|
197
|
+
export default connect(mapStateToProps, null)(SelectColumnsControl);
|
|
@@ -238,6 +238,17 @@ function _makeUIItem(parameterMetadata, actionMetadata, group, structureMetadata
|
|
|
238
238
|
}
|
|
239
239
|
return UIItem.makePanel(new ControlPanel(groupName, PanelType.TWISTY_PANEL, groupClassName, nestedPanel, panSubItems, groupLabel, group.open));
|
|
240
240
|
}
|
|
241
|
+
case GroupType.TEARSHEET_PANEL: {
|
|
242
|
+
groupLabel = l10nProvider.l10nLabel(group, group.name);
|
|
243
|
+
const panSubItems = [];
|
|
244
|
+
if (Array.isArray(group.subGroups)) {
|
|
245
|
+
group.subGroups.forEach(function(subGroup) {
|
|
246
|
+
groupItem = _makeUIItem(parameterMetadata, actionMetadata, subGroup, structureMetadata, l10nProvider);
|
|
247
|
+
panSubItems.push(groupItem);
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
return UIItem.makeTearsheetPanel(new ControlPanel(groupName, PanelType.TEARSHEET, groupClassName, nestedPanel, panSubItems, groupLabel, false), group.description);
|
|
251
|
+
}
|
|
241
252
|
default:
|
|
242
253
|
logger.warn("(Unknown group type '" + group.groupType() + "')");
|
|
243
254
|
return null;
|
|
@@ -605,6 +616,7 @@ function _makeControl(parameterMetadata, paramName, group, structureDefinition,
|
|
|
605
616
|
settings.moveableRows = moveableRows;
|
|
606
617
|
settings.required = required;
|
|
607
618
|
settings.language = parameter.language;
|
|
619
|
+
settings.enableMaximize = parameter.enableMaximize;
|
|
608
620
|
settings.summary = parameter.summary;
|
|
609
621
|
settings.increment = parameter.increment;
|
|
610
622
|
settings.rowSelection = rowSelection;
|
|
@@ -625,7 +637,6 @@ function _makeControl(parameterMetadata, paramName, group, structureDefinition,
|
|
|
625
637
|
settings.customValueAllowed = parameter.customValueAllowed;
|
|
626
638
|
settings.className = parameter.className;
|
|
627
639
|
settings.buttons = buttons;
|
|
628
|
-
|
|
629
640
|
if (isSubControl) {
|
|
630
641
|
settings.visible = parameter.visible;
|
|
631
642
|
settings.width = parameter.columns(8);
|
|
@@ -113,6 +113,10 @@ export class ParameterDef {
|
|
|
113
113
|
if (settings.language) {
|
|
114
114
|
this.language = settings.language;
|
|
115
115
|
}
|
|
116
|
+
if (settings.enableMaximize) {
|
|
117
|
+
this.enableMaximize = settings.enableMaximize;
|
|
118
|
+
}
|
|
119
|
+
|
|
116
120
|
if (toType(settings.summary) === "boolean") {
|
|
117
121
|
this.summary = settings.summary;
|
|
118
122
|
}
|
|
@@ -314,6 +318,7 @@ export class ParameterDef {
|
|
|
314
318
|
if (param) {
|
|
315
319
|
return new ParameterDef({
|
|
316
320
|
"id": propertyOf(param)("id"),
|
|
321
|
+
"enableMaximize": propertyOf(uihint)("enable_maximize"),
|
|
317
322
|
"label": propertyOf(uihint)("label"),
|
|
318
323
|
"description": propertyOf(uihint)("description"),
|
|
319
324
|
"type": propertyOf(param)("type"),
|
|
@@ -123,4 +123,14 @@ export class UIItem {
|
|
|
123
123
|
className: className
|
|
124
124
|
});
|
|
125
125
|
}
|
|
126
|
+
|
|
127
|
+
static makeTearsheetPanel(control, description) {
|
|
128
|
+
return new UIItem({
|
|
129
|
+
itemType: ItemType.TEARSHEET,
|
|
130
|
+
panel: {
|
|
131
|
+
...control,
|
|
132
|
+
description
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
}
|
|
126
136
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
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 TearSheet from "./tearsheet.jsx";
|
|
18
|
+
export default TearSheet;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import React, { Component } from "react";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
import { ComposedModal, ModalHeader, ModalBody } from "carbon-components-react";
|
|
4
|
+
import { Portal } from "react-portal";
|
|
5
|
+
|
|
6
|
+
class TearSheet extends Component {
|
|
7
|
+
constructor(props) {
|
|
8
|
+
super(props);
|
|
9
|
+
this.state = {
|
|
10
|
+
open: false
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
componentDidMount() {
|
|
14
|
+
setTimeout(() => {
|
|
15
|
+
this.setState({
|
|
16
|
+
open: true
|
|
17
|
+
});
|
|
18
|
+
}, 0);
|
|
19
|
+
}
|
|
20
|
+
render() {
|
|
21
|
+
const title = this.props.panel.label ? this.props.panel.label : null;
|
|
22
|
+
const description = this.props.panel.description ? this.props.panel.description.default : null;
|
|
23
|
+
return (
|
|
24
|
+
<Portal>
|
|
25
|
+
<ComposedModal
|
|
26
|
+
className="properties-tearsheet-panel"
|
|
27
|
+
open={this.state.open}
|
|
28
|
+
size="lg"
|
|
29
|
+
preventCloseOnClickOutside
|
|
30
|
+
>
|
|
31
|
+
<ModalHeader
|
|
32
|
+
title={title}
|
|
33
|
+
buttonOnClick={() => {
|
|
34
|
+
setTimeout(() => {
|
|
35
|
+
this.props.controller.clearActiveTearsheet();
|
|
36
|
+
}, 500);
|
|
37
|
+
}}
|
|
38
|
+
>
|
|
39
|
+
{description ? (<p>{description}</p>) : null}
|
|
40
|
+
</ModalHeader>
|
|
41
|
+
<ModalBody>
|
|
42
|
+
{this.props.children}
|
|
43
|
+
</ModalBody>
|
|
44
|
+
</ComposedModal>
|
|
45
|
+
</Portal>);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
TearSheet.propTypes = {
|
|
49
|
+
panel: PropTypes.object.isRequired,
|
|
50
|
+
controller: PropTypes.object.isRequired,
|
|
51
|
+
children: PropTypes.array
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export default TearSheet;
|