@truedat/dd 4.36.8 → 4.37.2

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,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [4.37.0] 2022-01-25
4
+
5
+ ### Changed
6
+
7
+ - [TD-2564] `StructureSelectorInputField` now accepts `defaultFilters` prop,
8
+ removed `options` prop
9
+
3
10
  ## [4.36.5] 2022-01-20
4
11
 
5
12
  ### Added
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@truedat/dd",
3
- "version": "4.36.8",
3
+ "version": "4.37.2",
4
4
  "description": "Truedat Web Data Dictionary",
5
5
  "sideEffects": false,
6
6
  "jsnext:main": "src/index.js",
@@ -84,9 +84,9 @@
84
84
  ]
85
85
  },
86
86
  "dependencies": {
87
- "@truedat/auth": "4.36.8",
88
- "@truedat/core": "4.36.8",
89
- "@truedat/df": "4.36.8",
87
+ "@truedat/auth": "4.37.2",
88
+ "@truedat/core": "4.37.2",
89
+ "@truedat/df": "4.37.2",
90
90
  "lodash": "^4.17.21",
91
91
  "path-to-regexp": "^1.7.0",
92
92
  "prop-types": "^15.7.2",
@@ -107,5 +107,5 @@
107
107
  "react-dom": ">= 16.8.6 < 17",
108
108
  "semantic-ui-react": ">= 0.88.2 < 2.1"
109
109
  },
110
- "gitHead": "b9b8ee80998b230697593b5d207d187971bc0724"
110
+ "gitHead": "ca6ba01d31ab5ec415b9b21d6ce02b418fc6e0ff"
111
111
  }
@@ -15,7 +15,7 @@ export const StructureSelectorInputField = ({
15
15
  onDelete,
16
16
  onClick,
17
17
  joined,
18
- options: { defaultFilters },
18
+ defaultFilters,
19
19
  structures,
20
20
  selectedStructure,
21
21
  selectedSystem,
@@ -132,7 +132,7 @@ StructureSelectorInputField.propTypes = {
132
132
  onChangeField: PropTypes.func,
133
133
  onClick: PropTypes.func,
134
134
  onDelete: PropTypes.func,
135
- options: PropTypes.object.isRequired,
135
+ defaultFilters: PropTypes.object,
136
136
  structures: PropTypes.array,
137
137
  selectedStructure: PropTypes.object,
138
138
  selectedSystem: PropTypes.string,
@@ -11,12 +11,12 @@ describe("<StructureSelectorInputField />", () => {
11
11
  it("matches the latest snapshot", () => {
12
12
  const props = {
13
13
  selectedStructure: { id: "value" },
14
- options: { defaultFilters: {} },
14
+ defaultFilters: {},
15
15
  active: true,
16
16
  onClick: jest.fn(),
17
17
  onChange: jest.fn(),
18
18
  systems: [],
19
- systemRequired: true
19
+ systemRequired: true,
20
20
  };
21
21
  const wrapper = shallow(<StructureSelectorInputField {...props} />);
22
22
  expect(wrapper).toMatchSnapshot();
@@ -24,9 +24,9 @@ describe("<StructureSelectorInputField />", () => {
24
24
 
25
25
  it("clicking on input will call onClick with the input name", () => {
26
26
  const props = {
27
- options: { defaultFilters: {} },
27
+ defaultFilters: {},
28
28
  active: false,
29
- onClick: jest.fn()
29
+ onClick: jest.fn(),
30
30
  };
31
31
  const wrapper = shallow(<StructureSelectorInputField {...props} />);
32
32
 
@@ -37,9 +37,9 @@ describe("<StructureSelectorInputField />", () => {
37
37
 
38
38
  it("clicking on input will call onClick with empty string wehn active is true", () => {
39
39
  const props = {
40
- options: { defaultFilters: {} },
40
+ defaultFilters: {},
41
41
  active: true,
42
- onClick: jest.fn()
42
+ onClick: jest.fn(),
43
43
  };
44
44
  const wrapper = shallow(<StructureSelectorInputField {...props} />);
45
45
  expect(props.onClick.mock.calls.length).toBe(0);
@@ -52,28 +52,25 @@ describe("<StructureSelectorInputField />", () => {
52
52
  const fetchStructure = jest.fn();
53
53
  const props = {
54
54
  selectedStructure: { id: "value" },
55
- options: { defaultFilters: {} },
55
+ defaultFilters: {},
56
56
  active: true,
57
57
  onChange,
58
- fetchStructure
58
+ fetchStructure,
59
59
  };
60
60
  const wrapper = shallow(<StructureSelectorInputField {...props} />);
61
61
 
62
62
  const structure = { id: "test" };
63
63
 
64
- wrapper
65
- .find("Connect(StructureSelector)")
66
- .props()
67
- .onSelect(structure);
64
+ wrapper.find("Connect(StructureSelector)").props().onSelect(structure);
68
65
  expect(onChange.mock.calls.length).toBe(1);
69
66
  expect(onChange.mock.calls[0][0]).toEqual(structure);
70
67
  });
71
68
 
72
69
  it("if selectedSystem is empty the embedded FormInput is disabled", () => {
73
70
  const props = {
74
- options: { defaultFilters: {} },
71
+ defaultFilters: {},
75
72
  selectedSystem: "",
76
- systemRequired: true
73
+ systemRequired: true,
77
74
  };
78
75
  const wrapper = shallow(<StructureSelectorInputField {...props} />);
79
76
  expect(wrapper.find("FormInput").props().disabled).toBe(true);