@truedat/dd 4.53.9 → 4.53.11

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.53.11] 2022-10-20
4
+
5
+ ### Changed
6
+
7
+ - [TD-5234] Structure rules tab visibility is now determined by the structure's
8
+ `implementation_count` prop
9
+
3
10
  ## [4.53.9] 2022-10-17
4
11
 
5
12
  ### [Fixed]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@truedat/dd",
3
- "version": "4.53.9",
3
+ "version": "4.53.11",
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.53.9",
37
+ "@truedat/test": "4.53.11",
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",
@@ -87,10 +87,10 @@
87
87
  ]
88
88
  },
89
89
  "dependencies": {
90
- "@apollo/client": "^3.6.4",
91
- "@truedat/auth": "4.53.9",
92
- "@truedat/core": "4.53.9",
93
- "@truedat/df": "4.53.9",
90
+ "@apollo/client": "^3.7.0",
91
+ "@truedat/auth": "4.53.11",
92
+ "@truedat/core": "4.53.11",
93
+ "@truedat/df": "4.53.11",
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": "cfb29ec044aeb972df15ad73f30cf7fb06e2a54b"
115
+ "gitHead": "f0bff07f7491edcbe2195f2ff9d0ef74736edef9"
116
116
  }
@@ -34,7 +34,7 @@ export const EditDomainPopup = ({ userPermissions, saving, text }) => {
34
34
  trigger={
35
35
  <Button
36
36
  basic
37
- icon={<Icon name={"pencil alternate"} />}
37
+ icon={<Icon name="pencil alternate" />}
38
38
  style={{ boxShadow: "none" }}
39
39
  />
40
40
  }
@@ -55,7 +55,7 @@ export const GrantRequest = ({ grantRequest, template }) => {
55
55
  </List.Description>
56
56
  </List.Content>
57
57
  {rows && (
58
- <List size={"small"}>
58
+ <List size="small">
59
59
  <List.Item>
60
60
  <ConditionSummary
61
61
  rows={rows}
@@ -19,7 +19,8 @@ import {
19
19
  const translations = (formatMessage) => ({
20
20
  "active.raw": (v) =>
21
21
  formatMessage({ id: `filters.active.raw.${v}`, defaultMessage: v }),
22
- "execution_result_info.result_text": (v) => formatMessage({ id: v }),
22
+ "execution_result_info.result_text": (v) =>
23
+ formatMessage({ id: v, defaultMessage: v }),
23
24
  });
24
25
 
25
26
  export const mapStateToProps = (state, ownProps) => {
@@ -176,12 +176,12 @@ export const LineageForm = ({
176
176
  <Form.Field>
177
177
  <Form.Radio
178
178
  disabled={disabled}
179
- name={"allLevels"}
179
+ name="allLevels"
180
180
  label={formatMessage({
181
181
  id: "lineage.form.levels.all.label",
182
182
  defaultMessage: "All",
183
183
  })}
184
- value={"all"}
184
+ value="all"
185
185
  checked={selectLevels === "all"}
186
186
  onChange={(e, { value }) => setSelectLevels(value)}
187
187
  />
@@ -189,9 +189,9 @@ export const LineageForm = ({
189
189
  <Form.Field>
190
190
  <Form.Radio
191
191
  disabled={disabled}
192
- name={"selectLevels"}
192
+ name="selectLevels"
193
193
  checked={selectLevels === "select"}
194
- value={"select"}
194
+ value="select"
195
195
  onChange={(e, { value }) => setSelectLevels(value)}
196
196
  label={formatMessage({
197
197
  id: "lineage.form.levels.select.label",
@@ -212,7 +212,7 @@ export const LineageForm = ({
212
212
  value={levels || ""}
213
213
  autoComplete="off"
214
214
  onChange={(e) => changeLevels(e)}
215
- min={"1"}
215
+ min="1"
216
216
  />
217
217
  </Form.Field>
218
218
  <Button
@@ -109,7 +109,7 @@ export const LineageGraph = ({
109
109
  <Loader size="large">
110
110
  <FormattedMessage
111
111
  id="lineage.graph.loading"
112
- defaultMessage={"Analyzing..."}
112
+ defaultMessage="Analyzing..."
113
113
  />
114
114
  {loadingInfo?.data?.graph_hash && loadingInfo?.data?.status && (
115
115
  <p>
@@ -12,7 +12,7 @@ import {
12
12
  STRUCTURE_NOTES,
13
13
  STRUCTURE_PARENTS,
14
14
  STRUCTURE_PROFILE,
15
- STRUCTURE_RULES_IMPLEMENTATIONS,
15
+ STRUCTURE_RULES,
16
16
  STRUCTURE_VERSION,
17
17
  STRUCTURE_VERSIONS,
18
18
  STRUCTURE_VERSION_VERSIONS,
@@ -30,10 +30,7 @@ export const StructureTabPaneRoutes = ({}) => (
30
30
  <Route path={STRUCTURE_NOTES} component={StructureTabPane} />
31
31
  <Route path={STRUCTURE_GRANTS} component={StructureTabPane} />
32
32
  <Route path={STRUCTURE_METADATA} component={StructureTabPane} />
33
- <Route
34
- path={STRUCTURE_RULES_IMPLEMENTATIONS}
35
- component={StructureTabPane}
36
- />
33
+ <Route path={STRUCTURE_RULES} component={StructureTabPane} />
37
34
  <Route path={STRUCTURE_CHILDREN} component={StructureTabPane} />
38
35
  <Route path={STRUCTURE_PARENTS} component={StructureTabPane} />
39
36
  <Route path={STRUCTURE_LINEAGE} component={StructureTabPane} />
@@ -11,7 +11,7 @@ import {
11
11
  STRUCTURE_NOTES,
12
12
  STRUCTURE_PARENTS,
13
13
  STRUCTURE_PROFILE,
14
- STRUCTURE_RULES_IMPLEMENTATIONS,
14
+ STRUCTURE_RULES,
15
15
  STRUCTURE_VERSION,
16
16
  STRUCTURE_VERSIONS,
17
17
  STRUCTURE_VERSION_VERSIONS,
@@ -29,7 +29,7 @@ export const StructureTabRoutes = () => (
29
29
  <Route path={STRUCTURE_EVENTS} component={StructureTabs} />
30
30
  <Route path={STRUCTURE_METADATA} component={StructureTabs} />
31
31
  <Route path={STRUCTURE_NOTES} component={StructureTabs} />
32
- <Route path={STRUCTURE_RULES_IMPLEMENTATIONS} component={StructureTabs} />
32
+ <Route path={STRUCTURE_RULES} component={StructureTabs} />
33
33
  <Route path={STRUCTURE_LINEAGE} component={StructureTabs} />
34
34
  <Route path={STRUCTURE_CHILDREN} component={StructureTabs} />
35
35
  <Route path={STRUCTURE_PARENTS} component={StructureTabs} />
@@ -94,7 +94,7 @@ export const StructureTabs = ({
94
94
  {
95
95
  active: activeTab === "rules",
96
96
  as: Link,
97
- to: linkTo.STRUCTURE_RULES_IMPLEMENTATIONS(structure),
97
+ to: linkTo.STRUCTURE_RULES(structure),
98
98
  content: rules ? formatMessage({ id: "tabs.dd.rules" }) : false,
99
99
  key: "rules",
100
100
  },
@@ -30,7 +30,7 @@ export const StructuresDomainsUploadOption = ({
30
30
  content={formatMessage({
31
31
  id: "structures.actions.uploadDomains.confirmation.content",
32
32
  })}
33
- param={"structures_domains"}
33
+ param="structures_domains"
34
34
  handleSubmit={(data) =>
35
35
  uploadStructuresDomains({
36
36
  data,
@@ -39,7 +39,7 @@ export const StructuresUploadOption = ({
39
39
  content={formatMessage({
40
40
  id: "structures.actions.upload.confirmation.content",
41
41
  })}
42
- param={"structures"}
42
+ param="structures"
43
43
  handleSubmit={(data) =>
44
44
  uploadStructures({
45
45
  data,
@@ -29,7 +29,7 @@ describe("<StructureTabPane />", () => {
29
29
  it("does not render profile when active tab is profile and we have any profile: ", () => {
30
30
  const wrapper = shallow(
31
31
  <StructureTabPane
32
- activeTab={"profile"}
32
+ activeTab="profile"
33
33
  tabVisibility={{ profile: false }}
34
34
  />
35
35
  );
@@ -40,10 +40,7 @@ describe("<StructureTabPane />", () => {
40
40
 
41
41
  it("does not render grants when active tab is grants and we haven't any grant: ", () => {
42
42
  const wrapper = shallow(
43
- <StructureTabPane
44
- activeTab={"grants"}
45
- tabVisibility={{ grants: false }}
46
- />
43
+ <StructureTabPane activeTab="grants" tabVisibility={{ grants: false }} />
47
44
  );
48
45
  expect(wrapper.find("Connect(StructureGrants)").length).toBe(0);
49
46
  });
@@ -51,7 +48,7 @@ describe("<StructureTabPane />", () => {
51
48
  it("does render metadata component ", () => {
52
49
  const wrapper = shallow(
53
50
  <StructureTabPane
54
- activeTab={"metadata"}
51
+ activeTab="metadata"
55
52
  tabVisibility={{ metadata: true }}
56
53
  />
57
54
  );
@@ -36,7 +36,7 @@ exports[`<StructureTabRoutes /> matches the latest snapshot 1`] = `
36
36
  />
37
37
  <Route
38
38
  component={[Function]}
39
- path="/structures/:id/rules_implementations"
39
+ path="/structures/:id/rules"
40
40
  />
41
41
  <Route
42
42
  component={[Function]}
@@ -37,7 +37,7 @@ exports[`<StructureTabs /> matches the latest snapshot: metadata 1`] = `
37
37
  </a>
38
38
  <a
39
39
  class="item"
40
- href="/structures/123/rules_implementations"
40
+ href="/structures/123/rules"
41
41
  >
42
42
  Rules
43
43
  </a>
@@ -28,7 +28,7 @@ const structureVersionFields = _.pick([
28
28
  "grant",
29
29
  "grants",
30
30
  "group",
31
- "implementations",
31
+ "implementation_count",
32
32
  "metadata",
33
33
  "name",
34
34
  "note",
@@ -10,7 +10,7 @@ import {
10
10
  STRUCTURE_NOTES_EDIT,
11
11
  STRUCTURE_PARENTS,
12
12
  STRUCTURE_PROFILE,
13
- STRUCTURE_RULES_IMPLEMENTATIONS,
13
+ STRUCTURE_RULES,
14
14
  STRUCTURE_VERSION,
15
15
  STRUCTURE_VERSIONS,
16
16
  STRUCTURE_VERSION_VERSIONS,
@@ -55,9 +55,7 @@ describe("selectors: getActiveTab", () => {
55
55
  expect(getActiveTab(tabVisibility, STRUCTURE_NOTES_EDIT)).toBe("notes");
56
56
  expect(getActiveTab(tabVisibility, STRUCTURE_PARENTS)).toBe("parents");
57
57
  expect(getActiveTab(tabVisibility, STRUCTURE_PROFILE)).toBe("profile");
58
- expect(getActiveTab(tabVisibility, STRUCTURE_RULES_IMPLEMENTATIONS)).toBe(
59
- "rules"
60
- );
58
+ expect(getActiveTab(tabVisibility, STRUCTURE_RULES)).toBe("rules");
61
59
  expect(getActiveTab(tabVisibility, STRUCTURE_LINKS)).toBe("links");
62
60
  expect(getActiveTab(tabVisibility, STRUCTURE_LINKS_NEW)).toBe("links");
63
61
  expect(getActiveTab(tabVisibility, STRUCTURE_VERSIONS)).toBe("versions");
@@ -138,15 +138,15 @@ describe("selectors: getTabVisibility", () => {
138
138
  });
139
139
  });
140
140
 
141
- it("should include rules iff structure.implementations is not empty", () => {
141
+ it("should include rules iff structure.implementation_count is greater than 0", () => {
142
142
  expect(getTabVisibility({})).toMatchObject({ rules: false });
143
143
  expect(
144
- getTabVisibility({ structure: { implementations: [] } })
144
+ getTabVisibility({ structure: { implementation_count: 0 } })
145
145
  ).toMatchObject({
146
146
  rules: false,
147
147
  });
148
148
  expect(
149
- getTabVisibility({ structure: { implementations: [{}] } })
149
+ getTabVisibility({ structure: { implementation_count: 123 } })
150
150
  ).toMatchObject({
151
151
  rules: true,
152
152
  });
@@ -8,7 +8,7 @@ import {
8
8
  STRUCTURE_NOTES_EDIT,
9
9
  STRUCTURE_PARENTS,
10
10
  STRUCTURE_PROFILE,
11
- STRUCTURE_RULES_IMPLEMENTATIONS,
11
+ STRUCTURE_RULES,
12
12
  STRUCTURE_LINKS,
13
13
  STRUCTURE_LINKS_NEW,
14
14
  STRUCTURE_VERSIONS,
@@ -43,7 +43,7 @@ export const getActiveTab = (tabVisibility, path) => {
43
43
  [_.eq(STRUCTURE_METADATA), _.constant("metadata")],
44
44
  [_.eq(STRUCTURE_PARENTS), _.constant("parents")],
45
45
  [_.eq(STRUCTURE_PROFILE), _.constant("profile")],
46
- [_.eq(STRUCTURE_RULES_IMPLEMENTATIONS), _.constant("rules")],
46
+ [_.eq(STRUCTURE_RULES), _.constant("rules")],
47
47
  [_.eq(STRUCTURE_LINKS), _.constant("links")],
48
48
  [_.eq(STRUCTURE_LINKS_NEW), _.constant("links")],
49
49
  [_.eq(STRUCTURE_VERSIONS), _.constant("versions")],
@@ -17,7 +17,7 @@ export const GrantUserDecorator = ({ authentication, user }) => {
17
17
  <Header.Content>
18
18
  {user.full_name}{" "}
19
19
  {sameUser && (
20
- <Label color="teal" size={"small"}>
20
+ <Label color="teal" size="small">
21
21
  {formatMessage({ id: "grant.cell.end_date.same_user" })}
22
22
  </Label>
23
23
  )}
@@ -36,7 +36,7 @@ const notesTabVisible = ({ templatesLoading, templates, structure }) =>
36
36
  )(templates);
37
37
 
38
38
  const versionsTabVisible = notEmptyPath("structureVersions");
39
- const rulesTabVisible = notEmptyPath("structure.implementations");
39
+ const rulesTabVisible = (state) => state?.structure?.implementation_count > 0;
40
40
  const lineageTabVisible = _.anyPass([_.path("structure.degree.in")]);
41
41
  const impactTabVisible = _.anyPass([_.path("structure.degree.out")]);
42
42
  const parentsTabVisible = _.conformsTo({ parentRelations: notEmpty });