@truedat/dd 4.47.2 → 4.47.5

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## [4.47.5] 2022-06-30
4
+
5
+ ### Added
6
+
7
+ - [TD-4894] Multiple column operator in implementation creation
8
+
3
9
  ## [4.47.0] 2022-06-22
4
10
 
5
11
  ### Changed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@truedat/dd",
3
- "version": "4.47.2",
3
+ "version": "4.47.5",
4
4
  "description": "Truedat Web Data Dictionary",
5
5
  "sideEffects": false,
6
6
  "jsnext:main": "src/index.js",
@@ -34,7 +34,7 @@
34
34
  "@testing-library/jest-dom": "^5.16.4",
35
35
  "@testing-library/react": "^12.0.0",
36
36
  "@testing-library/user-event": "^13.2.1",
37
- "@truedat/test": "4.47.2",
37
+ "@truedat/test": "4.47.5",
38
38
  "babel-jest": "^28.1.0",
39
39
  "babel-plugin-dynamic-import-node": "^2.3.3",
40
40
  "babel-plugin-lodash": "^3.3.4",
@@ -88,9 +88,9 @@
88
88
  },
89
89
  "dependencies": {
90
90
  "@apollo/client": "^3.6.4",
91
- "@truedat/auth": "4.47.2",
92
- "@truedat/core": "4.47.2",
93
- "@truedat/df": "4.47.2",
91
+ "@truedat/auth": "4.47.5",
92
+ "@truedat/core": "4.47.5",
93
+ "@truedat/df": "4.47.5",
94
94
  "lodash": "^4.17.21",
95
95
  "path-to-regexp": "^1.7.0",
96
96
  "prop-types": "^15.8.1",
@@ -112,5 +112,5 @@
112
112
  "react-dom": ">= 16.8.6 < 17",
113
113
  "semantic-ui-react": ">= 0.88.2 < 2.1"
114
114
  },
115
- "gitHead": "53cb62b57d41745cfcd4c0b90154a6cfcd168534"
115
+ "gitHead": "1265272aa7b8fcb415592916f0e557ae226befe3"
116
116
  }
@@ -11,23 +11,37 @@ export const StructureFieldsDropdown = ({
11
11
  fluid,
12
12
  inline,
13
13
  onSelectField,
14
+ onSelectFields,
14
15
  structureFields,
15
16
  filters,
16
17
  value,
17
18
  typeCastModifiers,
19
+ multiple,
18
20
  }) => {
19
21
  const { formatMessage } = useIntl();
20
22
  const onClick = ({ value, modifier }) => {
23
+ onSelectField(dropdownItemToField(value), modifier);
24
+ };
25
+
26
+ const onChangeStructureFieldsDropdown = (valueOrValues) => {
27
+ return _.flow(
28
+ _.map((value) => {
29
+ return dropdownItemToField(value);
30
+ }),
31
+ multiple ? onSelectFields : onSelectField
32
+ )(Array.isArray(valueOrValues) ? valueOrValues : [valueOrValues]);
33
+ };
34
+
35
+ const dropdownItemToField = (value) => {
21
36
  const [data_structure_id, parent_index] = _.isString(value)
22
37
  ? value.split("/").map(Number)
23
38
  : [value, undefined];
24
- const field = _.isNil(parent_index)
39
+ return _.isNil(parent_index)
25
40
  ? _.find({ data_structure_id: data_structure_id })(structureFields)
26
41
  : _.find({
27
42
  data_structure_id: data_structure_id,
28
43
  parent_index: parent_index,
29
44
  })(structureFields);
30
- onSelectField(field, modifier);
31
45
  };
32
46
 
33
47
  const formatOption = (field) => {
@@ -100,11 +114,13 @@ export const StructureFieldsDropdown = ({
100
114
 
101
115
  return (
102
116
  <OptionGroup
117
+ multiple={multiple}
103
118
  fluid={fluid}
104
119
  inline={inline}
105
120
  label={label}
106
121
  value={value}
107
122
  onClick={onClick}
123
+ onChange={onChangeStructureFieldsDropdown}
108
124
  placeholder={formatMessage({
109
125
  id: "structureFields.dropdown.placeholder",
110
126
  })}
@@ -117,11 +133,14 @@ StructureFieldsDropdown.propTypes = {
117
133
  label: PropTypes.string,
118
134
  fluid: PropTypes.bool,
119
135
  inline: PropTypes.bool,
120
- value: PropTypes.number,
136
+ // value string format: <data_structure_id>/<parent_index>
137
+ value: PropTypes.oneOfType([PropTypes.string, PropTypes.array]),
121
138
  structureFields: PropTypes.array,
122
139
  onSelectField: PropTypes.func,
140
+ onSelectFields: PropTypes.func,
123
141
  filters: PropTypes.object,
124
142
  typeCastModifiers: PropTypes.array,
143
+ multiple: PropTypes.bool,
125
144
  };
126
145
 
127
146
  const mapStateToProps = (state, props) => ({
@@ -36,21 +36,32 @@ exports[`<ValueConditionStructure /> matches the latest snapshot 1`] = `
36
36
  role="listbox"
37
37
  >
38
38
  <div
39
- class="divider"
40
- />
41
- <div
42
- class="header"
39
+ aria-checked="false"
40
+ aria-disabled="true"
41
+ aria-selected="false"
42
+ class="disabled item"
43
+ role="option"
44
+ style="pointer-events: all;"
43
45
  >
44
- <i
45
- aria-hidden="true"
46
- class="table icon"
46
+ <div
47
+ class="divider"
47
48
  />
48
- bar
49
+ <div
50
+ class="header"
51
+ >
52
+ <i
53
+ aria-hidden="true"
54
+ class="table icon"
55
+ />
56
+ bar
57
+ </div>
49
58
  </div>
50
59
  <div
51
- aria-selected="false"
52
- class="item group"
60
+ aria-checked="false"
61
+ aria-selected="true"
62
+ class="selected item group"
53
63
  role="option"
64
+ style="pointer-events: all;"
54
65
  >
55
66
  <i
56
67
  aria-hidden="true"