@truedat/bg 4.43.2 → 4.43.3

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.43.3] 2022-05-04
4
+
5
+ ### Changed
6
+
7
+ - [TD-3936] Updated `react-hook-form`
8
+
3
9
  ## [4.41.1] 2022-03-25
4
10
 
5
11
  ### Changed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@truedat/bg",
3
- "version": "4.43.2",
3
+ "version": "4.43.3",
4
4
  "description": "Truedat Web Business Glossary",
5
5
  "sideEffects": false,
6
6
  "jsnext:main": "src/index.js",
@@ -34,7 +34,7 @@
34
34
  "@testing-library/jest-dom": "^5.14.1",
35
35
  "@testing-library/react": "^12.0.0",
36
36
  "@testing-library/user-event": "^13.2.1",
37
- "@truedat/test": "4.43.2",
37
+ "@truedat/test": "4.43.3",
38
38
  "babel-jest": "^27.0.6",
39
39
  "babel-plugin-dynamic-import-node": "^2.3.3",
40
40
  "babel-plugin-lodash": "^3.3.4",
@@ -83,13 +83,13 @@
83
83
  ]
84
84
  },
85
85
  "dependencies": {
86
- "@truedat/core": "4.43.2",
87
- "@truedat/df": "4.43.2",
86
+ "@truedat/core": "4.43.3",
87
+ "@truedat/df": "4.43.3",
88
88
  "file-saver": "^2.0.5",
89
89
  "moment": "^2.24.0",
90
90
  "path-to-regexp": "^1.7.0",
91
91
  "prop-types": "^15.7.2",
92
- "react-hook-form": "^6.15.8",
92
+ "react-hook-form": "^7.30.0",
93
93
  "react-intl": "^5.20.10",
94
94
  "react-moment": "^0.9.7",
95
95
  "react-redux": "^7.2.4",
@@ -104,5 +104,5 @@
104
104
  "react-dom": ">= 16.8.6 < 17",
105
105
  "semantic-ui-react": ">= 0.88.2 < 2.1"
106
106
  },
107
- "gitHead": "26f59c4d36ab1ecfae705bbce4320ff443cce304"
107
+ "gitHead": "072eb5d04ec38033c17e030c365502484815a96b"
108
108
  }
@@ -45,12 +45,15 @@ export const ConceptManageDomain = ({
45
45
  <Controller
46
46
  control={control}
47
47
  name="setToDomain"
48
- render={({ onBlur, onChange, value }, { invalid }) => (
48
+ render={({
49
+ field: { onBlur, onChange, value },
50
+ fieldState: { error },
51
+ }) => (
49
52
  <DomainDropdownSelector
50
53
  domainOptions={domainOptions}
51
54
  name="setToDomain"
52
55
  clearable={false}
53
- error={invalid}
56
+ error={!!error}
54
57
  label={formatMessage({ id: "concept.changeDomain.label" })}
55
58
  onBlur={onBlur}
56
59
  required
@@ -39,11 +39,14 @@ export const SharedToForm = ({
39
39
  control={control}
40
40
  name="sharedTo"
41
41
  rules={{ validate: (v) => !_.isEmpty(v) }}
42
- render={({ onBlur, onChange, value }, { invalid }) => (
42
+ render={({
43
+ field: { onBlur, onChange, value },
44
+ fieldState: { error },
45
+ }) => (
43
46
  <DomainMenuSelector
44
47
  domainOptions={domainOptions}
45
48
  name="sharedTo"
46
- error={invalid}
49
+ error={!!error}
47
50
  label={formatMessage({ id: "concept.sharedTo.dropdown.label" })}
48
51
  onBlur={onBlur}
49
52
  onChange={(_e, { value }) => onChange(value)}
@@ -1,4 +1,5 @@
1
1
  import React from "react";
2
+ import { waitFor } from "@testing-library/react";
2
3
  import { render } from "@truedat/test/render";
3
4
  import { ConceptManageDomain } from "../ConceptManageDomain";
4
5
 
@@ -31,11 +32,13 @@ describe("<ConceptManageDomain />", () => {
31
32
  },
32
33
  };
33
34
 
34
- it("matches the latest snapshot", () => {
35
+ it("matches the latest snapshot", async () => {
35
36
  const { container } = render(
36
37
  <ConceptManageDomain {...props} />,
37
38
  renderOpts
38
39
  );
39
- expect(container).toMatchSnapshot();
40
+ await waitFor(() => {
41
+ expect(container).toMatchSnapshot();
42
+ });
40
43
  });
41
44
  });
@@ -32,9 +32,11 @@ describe("<SharedToForm />", () => {
32
32
  },
33
33
  };
34
34
 
35
- it("matches the latest snapshot", () => {
35
+ it("matches the latest snapshot", async () => {
36
36
  const { container } = render(<SharedToForm {...props} />, renderOpts);
37
- expect(container).toMatchSnapshot();
37
+ await waitFor(() => {
38
+ expect(container).toMatchSnapshot();
39
+ });
38
40
  });
39
41
 
40
42
  it("enables share button when we select a domain", async () => {
@@ -7,7 +7,7 @@ import { useIntl } from "react-intl";
7
7
  import { connect } from "react-redux";
8
8
  import {
9
9
  accentInsensitivePathOrder,
10
- lowerDeburr
10
+ lowerDeburr,
11
11
  } from "@truedat/core/services/sort";
12
12
  import { HistoryBackButton } from "@truedat/core/components";
13
13
  import { getRecipients } from "@truedat/audit/selectors";
@@ -26,7 +26,7 @@ const MIN_SEARCH_CHARACTERS = 2;
26
26
 
27
27
  const roleOption = ({ id, name }) => ({ key: id, text: name, value: name });
28
28
 
29
- const roleOptions = roles =>
29
+ const roleOptions = (roles) =>
30
30
  _.flow(
31
31
  _.uniqBy("name"),
32
32
  _.sortBy(accentInsensitivePathOrder("name")),
@@ -38,13 +38,13 @@ export const AddMemberForm = ({
38
38
  isSubmitting,
39
39
  roles,
40
40
  options,
41
- addDomainMember
41
+ addDomainMember,
42
42
  }) => {
43
43
  const { formatMessage } = useIntl();
44
44
  const [usersGroupsQuery, setUsersGroupsQuery] = useState("");
45
45
  const { handleSubmit, control, formState } = useForm({
46
46
  mode: "all",
47
- defaultValues: { id: null, role: null, description: "" }
47
+ defaultValues: { id: null, role: null, description: "" },
48
48
  });
49
49
  const onSubmit = ({ id, role, description }) => {
50
50
  const [principal_type, principal_id] = _.split("_")(id);
@@ -53,7 +53,7 @@ export const AddMemberForm = ({
53
53
  resource_type: "domain",
54
54
  principal_type,
55
55
  principal_id: _.toNumber(principal_id),
56
- description
56
+ description,
57
57
  };
58
58
  addDomainMember({ resource_id: domain.id, acl_entry });
59
59
  };
@@ -74,10 +74,13 @@ export const AddMemberForm = ({
74
74
  control={control}
75
75
  name="id"
76
76
  rules={{ required: true }}
77
- render={({ onBlur, onChange, value }, { invalid }) => (
77
+ render={({
78
+ field: { onBlur, onChange, value },
79
+ fieldState: { error },
80
+ }) => (
78
81
  <Form.Dropdown
79
82
  placeholder={formatMessage({
80
- id: "domain.member"
83
+ id: "domain.member",
81
84
  })}
82
85
  clearable
83
86
  onChange={(_e, { value }) => onChange(value)}
@@ -90,9 +93,9 @@ export const AddMemberForm = ({
90
93
  required
91
94
  label={{
92
95
  children: formatMessage({ id: "domain.member" }),
93
- htmlFor: "principal"
96
+ htmlFor: "principal",
94
97
  }}
95
- error={invalid}
98
+ error={!!error}
96
99
  onBlur={onBlur}
97
100
  value={value}
98
101
  />
@@ -102,14 +105,17 @@ export const AddMemberForm = ({
102
105
  control={control}
103
106
  name="role"
104
107
  rules={{ required: true }}
105
- render={({ onBlur, onChange, value }, { invalid }) => (
108
+ render={({
109
+ field: { onBlur, onChange, value },
110
+ fieldState: { error },
111
+ }) => (
106
112
  <Form.Select
107
113
  basic
108
114
  clearable
109
- error={invalid}
115
+ error={!!error}
110
116
  label={{
111
117
  children: formatMessage({ id: "domain.role" }),
112
- htmlFor: "role"
118
+ htmlFor: "role",
113
119
  }}
114
120
  onBlur={onBlur}
115
121
  onChange={(_e, { value }) => onChange(value)}
@@ -125,17 +131,20 @@ export const AddMemberForm = ({
125
131
  <Controller
126
132
  control={control}
127
133
  name="description"
128
- render={({ onBlur, onChange, value }, { invalid }) => (
134
+ render={({
135
+ field: { onBlur, onChange, value },
136
+ fieldState: { error },
137
+ }) => (
129
138
  <Form.Input
130
139
  autoComplete="off"
131
- error={invalid}
140
+ error={!!error}
132
141
  id="description"
133
142
  label={formatMessage({ id: "domain.role.member.description" })}
134
143
  maxLength="120"
135
144
  onBlur={onBlur}
136
145
  onChange={(_e, { value }) => onChange(value)}
137
146
  placeholder={formatMessage({
138
- id: "domain.role.member.description"
147
+ id: "domain.role.member.description",
139
148
  })}
140
149
  value={value}
141
150
  />
@@ -165,14 +174,14 @@ AddMemberForm.propTypes = {
165
174
  isSubmitting: PropTypes.bool,
166
175
  roles: PropTypes.array,
167
176
  options: PropTypes.array,
168
- addDomainMember: PropTypes.func.isRequired
177
+ addDomainMember: PropTypes.func.isRequired,
169
178
  };
170
179
 
171
- const mapStateToProps = state => ({
180
+ const mapStateToProps = (state) => ({
172
181
  domain: state.domain,
173
182
  roles: roleOptions(state.roles),
174
183
  options: getRecipients(state),
175
- isSubmitting: state.domainMemberSaving
184
+ isSubmitting: state.domainMemberSaving,
176
185
  });
177
186
 
178
187
  const mapDispatchToProps = { addDomainMember };