@truedat/dd 7.0.7 → 7.1.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@truedat/dd",
3
- "version": "7.0.7",
3
+ "version": "7.1.0",
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.5",
35
35
  "@testing-library/react": "^12.0.0",
36
36
  "@testing-library/user-event": "^13.2.1",
37
- "@truedat/test": "7.0.7",
37
+ "@truedat/test": "7.1.0",
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.7.1",
91
- "@truedat/auth": "7.0.7",
92
- "@truedat/core": "7.0.7",
93
- "@truedat/df": "7.0.7",
91
+ "@truedat/auth": "7.1.0",
92
+ "@truedat/core": "7.1.0",
93
+ "@truedat/df": "7.1.0",
94
94
  "lodash": "^4.17.21",
95
95
  "moment": "^2.29.4",
96
96
  "path-to-regexp": "^1.7.0",
@@ -115,5 +115,5 @@
115
115
  "react-dom": ">= 16.8.6 < 17",
116
116
  "semantic-ui-react": ">= 2.0.3 < 2.2"
117
117
  },
118
- "gitHead": "f780d02b3356b69c61023b14b61400ffb779e33d"
118
+ "gitHead": "cb08380da04c7286e694540bc24d32f01a728dfc"
119
119
  }
@@ -93,6 +93,8 @@ export const StructureSummary = ({
93
93
  title={shareTitle}
94
94
  name={name}
95
95
  description={description}
96
+ icon="structures"
97
+ popupType="structures"
96
98
  />
97
99
  {userPermissions.profile_permission &&
98
100
  structureClass === "field" ? (
@@ -64,7 +64,7 @@ export const StructuresBulkUpdate = ({
64
64
  const { data, loading } = useTemplate({ name: templateName, domainIds });
65
65
  const template = _.prop("template")(data);
66
66
 
67
- if (!template)
67
+ if (!template && !loading)
68
68
  return (
69
69
  <Message>
70
70
  <Message.Header>
@@ -21,9 +21,11 @@ export const StructuresSearchResults = ({
21
21
  selectable,
22
22
  }) => (
23
23
  <Dimmer.Dimmable dimmed={loading} className="structure-table-overflow">
24
- <Dimmer active={loading} inverted>
25
- <Loader size="large" />
26
- </Dimmer>
24
+ {loading ? (
25
+ <Dimmer active={loading} inverted>
26
+ <Loader size="large" />
27
+ </Dimmer>
28
+ ) : null}
27
29
  {!_.isEmpty(structures) || !_.isEmpty(selectedStructure) ? (
28
30
  <>
29
31
  <StructuresLabelResults />
@@ -39,7 +39,7 @@ export const StructuresTable = ({
39
39
  structureColumnsSelector(state, defaultFilters, overwriteColumns)
40
40
  );
41
41
 
42
- const structures = searchData?.data;
42
+ const structures = searchData?.data || [];
43
43
 
44
44
  if (_.isEmpty(columns)) {
45
45
  return null;
@@ -57,10 +57,11 @@ describe("<GrantApprovalRules />", () => {
57
57
  <GrantApprovalRules />,
58
58
  renderOpts(grantApprovalRules)
59
59
  );
60
- await waitFor(() => expect(queryByText(/lazy/i)).not.toBeInTheDocument());
61
- await waitFor(() =>
62
- expect(queryByText(/loading/i)).not.toBeInTheDocument()
63
- );
60
+
61
+ await waitFor(() => {
62
+ expect(queryByText(/lazy/i)).not.toBeInTheDocument();
63
+ expect(container.querySelector(".loader")).not.toBeInTheDocument();
64
+ });
64
65
  expect(container).toMatchSnapshot();
65
66
  });
66
67
 
@@ -69,22 +70,24 @@ describe("<GrantApprovalRules />", () => {
69
70
  <GrantApprovalRules />,
70
71
  renderOpts(emptyGrantApprovalRules)
71
72
  );
72
- await waitFor(() => expect(queryByText(/lazy/i)).not.toBeInTheDocument());
73
- await waitFor(() =>
74
- expect(queryByText(/loading/i)).not.toBeInTheDocument()
75
- );
73
+
74
+ await waitFor(() => {
75
+ expect(queryByText(/lazy/i)).not.toBeInTheDocument();
76
+ expect(container.querySelector(".loader")).not.toBeInTheDocument();
77
+ });
76
78
  expect(container).toMatchSnapshot();
77
79
  });
78
80
 
79
81
  it("renders ApprovalRule name as Link", async () => {
80
- const { queryByText, getByText } = render(
82
+ const { container, queryByText, getByText } = render(
81
83
  <GrantApprovalRules />,
82
84
  renderOpts(grantApprovalRules)
83
85
  );
84
- await waitFor(() => expect(queryByText(/lazy/i)).not.toBeInTheDocument());
85
- await waitFor(() =>
86
- expect(queryByText(/loading/i)).not.toBeInTheDocument()
87
- );
86
+
87
+ await waitFor(() => {
88
+ expect(queryByText(/lazy/i)).not.toBeInTheDocument();
89
+ expect(container.querySelector(".loader")).not.toBeInTheDocument();
90
+ });
88
91
 
89
92
  const link = getByText("rule_name");
90
93
  expect(link).toHaveAttribute("href", "/grantApproveRules/123");
@@ -51,10 +51,10 @@ describe("<StructureGrantSummaryButton />", () => {
51
51
  renderOpts
52
52
  );
53
53
 
54
- await waitFor(() => expect(queryByText(/lazy/i)).not.toBeInTheDocument());
55
- await waitFor(() =>
56
- expect(queryByText(/loading/i)).not.toBeInTheDocument()
57
- );
54
+ await waitFor(() => {
55
+ expect(queryByText(/lazy/i)).not.toBeInTheDocument();
56
+ expect(container.querySelector(".loader")).not.toBeInTheDocument();
57
+ });
58
58
 
59
59
  expectToRenderDropdownComponent(container);
60
60
  expect(container).toMatchSnapshot();
@@ -67,10 +67,10 @@ describe("<StructureGrantSummaryButton />", () => {
67
67
  <StructureGrantSummaryButton />,
68
68
  renderOpts
69
69
  );
70
- await waitFor(() => expect(queryByText(/lazy/i)).not.toBeInTheDocument());
71
- await waitFor(() =>
72
- expect(queryByText(/loading/i)).not.toBeInTheDocument()
73
- );
70
+ await waitFor(() => {
71
+ expect(queryByText(/lazy/i)).not.toBeInTheDocument();
72
+ expect(container.querySelector(".loader")).not.toBeInTheDocument();
73
+ });
74
74
 
75
75
  expectToRenderDropdownComponent(container);
76
76
  expect(container).toMatchSnapshot();
@@ -83,10 +83,10 @@ describe("<StructureGrantSummaryButton />", () => {
83
83
  <StructureGrantSummaryButton />,
84
84
  renderOpts
85
85
  );
86
- await waitFor(() => expect(queryByText(/lazy/i)).not.toBeInTheDocument());
87
- await waitFor(() =>
88
- expect(queryByText(/loading/i)).not.toBeInTheDocument()
89
- );
86
+ await waitFor(() => {
87
+ expect(queryByText(/lazy/i)).not.toBeInTheDocument();
88
+ expect(container.querySelector(".loader")).not.toBeInTheDocument();
89
+ });
90
90
 
91
91
  expectToRenderDropdownComponent(container);
92
92
  expect(container).toMatchSnapshot();
@@ -99,10 +99,10 @@ describe("<StructureGrantSummaryButton />", () => {
99
99
  <StructureGrantSummaryButton />,
100
100
  renderOpts
101
101
  );
102
- await waitFor(() => expect(queryByText(/lazy/i)).not.toBeInTheDocument());
103
- await waitFor(() =>
104
- expect(queryByText(/loading/i)).not.toBeInTheDocument()
105
- );
102
+ await waitFor(() => {
103
+ expect(queryByText(/lazy/i)).not.toBeInTheDocument();
104
+ expect(container.querySelector(".loader")).not.toBeInTheDocument();
105
+ });
106
106
 
107
107
  await expectToRenderRequestButton(container, getByRole);
108
108
  expect(container).toMatchSnapshot();
@@ -115,10 +115,10 @@ describe("<StructureGrantSummaryButton />", () => {
115
115
  <StructureGrantSummaryButton />,
116
116
  renderOpts
117
117
  );
118
- await waitFor(() => expect(queryByText(/lazy/i)).not.toBeInTheDocument());
119
- await waitFor(() =>
120
- expect(queryByText(/loading/i)).not.toBeInTheDocument()
121
- );
118
+ await waitFor(() => {
119
+ expect(queryByText(/lazy/i)).not.toBeInTheDocument();
120
+ expect(container.querySelector(".loader")).not.toBeInTheDocument();
121
+ });
122
122
 
123
123
  await expectToRenderRequestButton(container, getByRole);
124
124
  expect(container).toMatchSnapshot();
@@ -81,6 +81,9 @@ describe("<StructureSelector />", () => {
81
81
  renderOpts
82
82
  );
83
83
 
84
+ await waitFor(() =>
85
+ expect(container.querySelector(".loader")).not.toBeInTheDocument()
86
+ );
84
87
  await waitFor(() => {
85
88
  expect(container.querySelector(".loading")).toBeNull();
86
89
  });
@@ -2,14 +2,20 @@ import _ from "lodash/fp";
2
2
  import React from "react";
3
3
  import { waitFor } from "@testing-library/react";
4
4
  import userEvent from "@testing-library/user-event";
5
- import { templateByNameMock } from "@truedat/test/mocks";
5
+ import {
6
+ templateByNameMock,
7
+ emptyTemplateByNameMock,
8
+ } from "@truedat/test/mocks";
6
9
  import { render } from "@truedat/test/render";
7
10
  import StructuresBulkUpdate from "../StructuresBulkUpdate";
8
11
  import { bulkUpdateStructures } from "../../routines";
9
12
 
10
13
  describe("<StructuresBulkUpdate />", () => {
11
14
  const renderOpts = {
12
- mocks: [templateByNameMock({ name: "template1", domainIds: [1] })],
15
+ mocks: [
16
+ templateByNameMock({ name: "template1", domainIds: [1] }),
17
+ emptyTemplateByNameMock(),
18
+ ],
13
19
  state: {
14
20
  previousStructureQuery: {
15
21
  structureCount: 10,
@@ -31,10 +37,10 @@ describe("<StructuresBulkUpdate />", () => {
31
37
  renderOpts
32
38
  );
33
39
 
34
- await waitFor(() => expect(queryByText(/lazy/i)).not.toBeInTheDocument());
35
- await waitFor(() =>
36
- expect(queryByText(/loading/i)).not.toBeInTheDocument()
37
- );
40
+ await waitFor(() => {
41
+ expect(queryByText(/lazy/i)).not.toBeInTheDocument();
42
+ expect(container.querySelector(".loader")).not.toBeInTheDocument();
43
+ });
38
44
  expect(container).toMatchSnapshot();
39
45
  });
40
46
 
@@ -43,10 +49,14 @@ describe("<StructuresBulkUpdate />", () => {
43
49
  "state.previousStructureQuery.allFilters",
44
50
  () => ({})
45
51
  )(renderOpts);
46
- const { container, getByText } = render(
52
+ const { container, queryByText, getByText } = render(
47
53
  <StructuresBulkUpdate />,
48
54
  thisRenderOpts
49
55
  );
56
+ await waitFor(() => {
57
+ expect(queryByText(/lazy/i)).not.toBeInTheDocument();
58
+ expect(container.querySelector(".loader")).not.toBeInTheDocument();
59
+ });
50
60
  const emptySearchText = getByText("Empty Search");
51
61
  expect(emptySearchText).toBeInTheDocument();
52
62
  expect(container).toMatchSnapshot();
@@ -66,10 +76,11 @@ describe("<StructuresBulkUpdate />", () => {
66
76
  { ...thisRenderOpts, dispatch }
67
77
  );
68
78
 
69
- await waitFor(() => expect(queryByText(/lazy/i)).not.toBeInTheDocument());
70
- await waitFor(() =>
71
- expect(queryByText(/loading/i)).not.toBeInTheDocument()
72
- );
79
+ await waitFor(() => {
80
+ expect(queryByText(/lazy/i)).not.toBeInTheDocument();
81
+ expect(queryByText(/loading/i)).not.toBeInTheDocument();
82
+ expect(container.querySelector(".loader")).not.toBeInTheDocument();
83
+ });
73
84
 
74
85
  userEvent.type(await findByRole("textbox"), "bar");
75
86
 
@@ -81,6 +81,9 @@ describe("<StructuresGrantRequestView />", () => {
81
81
  await waitFor(() => {
82
82
  expect(container.querySelector(".loading")).toBeNull();
83
83
  });
84
+ await waitFor(() =>
85
+ expect(container.querySelector(".loader")).not.toBeInTheDocument()
86
+ );
84
87
  await waitFor(() => expect(container).toMatchSnapshot());
85
88
 
86
89
  const structure1Row = await queryByText(/structure_1/).closest("tr");
@@ -36,7 +36,7 @@ const searchProps = {
36
36
  describe("<StructuresSearchResults />", () => {
37
37
  const columns = [{ name: "foo", sort: { name: "name.raw" } }];
38
38
 
39
- it("matches the latest snapshot", () => {
39
+ it("matches the latest snapshot", async () => {
40
40
  const props = { structures, columns };
41
41
  const { container } = render(
42
42
  <SearchContextWrapper props={searchProps}>
@@ -44,6 +44,10 @@ describe("<StructuresSearchResults />", () => {
44
44
  </SearchContextWrapper>,
45
45
  renderOpts
46
46
  );
47
+
48
+ await waitFor(() =>
49
+ expect(container.querySelector(".loader")).not.toBeInTheDocument()
50
+ );
47
51
  expect(container).toMatchSnapshot();
48
52
  });
49
53
 
@@ -62,6 +62,7 @@ exports[`<ReferenceDataset /> edit dataset view matches the latest snapshot 1`]
62
62
  class="right aligned eight wide column"
63
63
  >
64
64
  <div
65
+ aria-disabled="false"
65
66
  aria-expanded="false"
66
67
  class="ui floating dropdown button icon group-actions"
67
68
  role="listbox"
@@ -352,6 +353,7 @@ exports[`<ReferenceDataset /> show dataset view matches the latest snapshot 1`]
352
353
  class="right aligned eight wide column"
353
354
  >
354
355
  <div
356
+ aria-disabled="false"
355
357
  aria-expanded="false"
356
358
  class="ui floating dropdown button icon group-actions"
357
359
  role="listbox"
@@ -3,6 +3,7 @@
3
3
  exports[`<ReferenceDatasetActions /> matches the latest snapshot 1`] = `
4
4
  <div>
5
5
  <div
6
+ aria-disabled="false"
6
7
  aria-expanded="false"
7
8
  class="ui floating dropdown button icon group-actions"
8
9
  role="listbox"
@@ -40,6 +40,7 @@ exports[`<ReferenceDatasetHeader /> matches the latest snapshot 1`] = `
40
40
  class="right aligned eight wide column"
41
41
  >
42
42
  <div
43
+ aria-disabled="false"
43
44
  aria-expanded="false"
44
45
  class="ui floating dropdown button icon group-actions"
45
46
  role="listbox"
@@ -385,6 +385,7 @@ exports[`<ReferenceDatasetRoutes /> matches the latest snapshot (view route) 1`]
385
385
  class="right aligned eight wide column"
386
386
  >
387
387
  <div
388
+ aria-disabled="false"
388
389
  aria-expanded="false"
389
390
  class="ui floating dropdown button icon group-actions"
390
391
  role="listbox"
@@ -19,5 +19,6 @@ exports[`<StructureNoteActions /> matches the latest snapshot 1`] = `
19
19
  ]
20
20
  }
21
21
  direction="left"
22
+ disabled={false}
22
23
  />
23
24
  `;
@@ -75,18 +75,6 @@ exports[`<StructureSelector /> matches the latest snapshot 1`] = `
75
75
  <div
76
76
  class="dimmable structure-table-overflow"
77
77
  >
78
- <div
79
- class="ui inverted dimmer"
80
- style=""
81
- >
82
- <div
83
- class="content"
84
- >
85
- <div
86
- class="ui large loader"
87
- />
88
- </div>
89
- </div>
90
78
  <div
91
79
  class="ui label structures-label-results"
92
80
  >
@@ -45,6 +45,7 @@ exports[`<StructureSummary /> matches the latest snapshot 1`] = `
45
45
  />
46
46
  <button
47
47
  class="ui basic icon button button icon group-actions"
48
+ data-tooltip="Sharing"
48
49
  >
49
50
  <i
50
51
  aria-hidden="true"
@@ -195,6 +196,7 @@ exports[`<StructureSummary /> matches the latest snapshot with alias 1`] = `
195
196
  />
196
197
  <button
197
198
  class="ui basic icon button button icon group-actions"
199
+ data-tooltip="Sharing"
198
200
  >
199
201
  <i
200
202
  aria-hidden="true"
@@ -108,18 +108,6 @@ exports[`<StructuresGrantRequestView /> Clicking a grant request button triggers
108
108
  <div
109
109
  class="dimmable structure-table-overflow"
110
110
  >
111
- <div
112
- class="ui inverted dimmer"
113
- style=""
114
- >
115
- <div
116
- class="content"
117
- >
118
- <div
119
- class="ui large loader"
120
- />
121
- </div>
122
- </div>
123
111
  <div
124
112
  class="ui label structures-label-results"
125
113
  >
@@ -5,17 +5,6 @@ exports[`<StructuresSearchResults /> matches the latest snapshot 1`] = `
5
5
  <div
6
6
  class="dimmable structure-table-overflow"
7
7
  >
8
- <div
9
- class="ui inverted dimmer"
10
- >
11
- <div
12
- class="content"
13
- >
14
- <div
15
- class="ui large loader"
16
- />
17
- </div>
18
- </div>
19
8
  <div
20
9
  class="ui label structures-label-results"
21
10
  >