@truedat/dq 4.54.8 → 4.54.9

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.54.9] 2022-10-28
4
+
5
+ ### Changed
6
+
7
+ - [TD-4977] `ImplementationSearchResults` can now be embedded
8
+
3
9
  ## [4.54.7] 2022-10-26
4
10
 
5
11
  ### Fixed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@truedat/dq",
3
- "version": "4.54.8",
3
+ "version": "4.54.9",
4
4
  "description": "Truedat Web Data Quality Module",
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.54.8",
37
+ "@truedat/test": "4.54.9",
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",
@@ -93,8 +93,8 @@
93
93
  },
94
94
  "dependencies": {
95
95
  "@apollo/client": "^3.7.0",
96
- "@truedat/core": "4.54.8",
97
- "@truedat/df": "4.54.8",
96
+ "@truedat/core": "4.54.9",
97
+ "@truedat/df": "4.54.9",
98
98
  "graphql": "^15.5.3",
99
99
  "path-to-regexp": "^1.7.0",
100
100
  "prop-types": "^15.8.1",
@@ -114,5 +114,5 @@
114
114
  "react-dom": ">= 16.8.6 < 17",
115
115
  "semantic-ui-react": ">= 0.88.2 < 2.1"
116
116
  },
117
- "gitHead": "f2274cf8a260efe11653e9e9132962cf0162c4c2"
117
+ "gitHead": "27f711249723050708a6f6f4de3ab5029069c4d7"
118
118
  }
@@ -2,13 +2,9 @@ import _ from "lodash/fp";
2
2
  import React, { useEffect, useRef, useState } from "react";
3
3
  import PropTypes from "prop-types";
4
4
  import { connect } from "react-redux";
5
- import { Dimmer, Header, Icon, Loader, Segment } from "semantic-ui-react";
6
- import { FormattedMessage } from "react-intl";
5
+ import { Dimmer, Loader, Segment } from "semantic-ui-react";
7
6
  import { useActiveRoute } from "@truedat/core/hooks";
8
- import {
9
- IMPLEMENTATIONS_PENDING,
10
- IMPLEMENTATIONS_DEPRECATED,
11
- } from "@truedat/core/routes";
7
+ import { IMPLEMENTATIONS_PENDING } from "@truedat/core/routes";
12
8
  import { getExecutionQuery } from "../selectors";
13
9
  import RuleImplementationsActions from "./RuleImplementationsActions";
14
10
  import RuleImplementationsLabelResults from "./RuleImplementationsLabelResults";
@@ -25,33 +21,8 @@ const usePrevious = (value) => {
25
21
  return ref.current;
26
22
  };
27
23
 
28
- export const ImplementationSearchResultsHeader = () => {
29
- const pending = useActiveRoute(IMPLEMENTATIONS_PENDING);
30
- const deprecated = useActiveRoute(IMPLEMENTATIONS_DEPRECATED);
31
- const header = pending
32
- ? "implementations.header.manage"
33
- : deprecated
34
- ? "implementations.header.deprecated"
35
- : "implementations.header";
36
- const subheader = pending
37
- ? "implementations.subheader.manage"
38
- : deprecated
39
- ? "implementations.subheader.deprecated"
40
- : "implementations.subheader";
41
- return (
42
- <Header as="h2">
43
- <Icon circular name="tags" />
44
- <Header.Content>
45
- <FormattedMessage id={header} />
46
- <Header.Subheader>
47
- <FormattedMessage id={subheader} />
48
- </Header.Subheader>
49
- </Header.Content>
50
- </Header>
51
- );
52
- };
53
-
54
24
  export const ImplementationSearchResults = ({
25
+ embedded,
55
26
  implementationQuery,
56
27
  role,
57
28
  loading,
@@ -112,10 +83,10 @@ export const ImplementationSearchResults = ({
112
83
  const withoutColumns = useActiveRoute(IMPLEMENTATIONS_PENDING)
113
84
  ? []
114
85
  : ["status"];
86
+
115
87
  return (
116
- <Segment>
117
- <ImplementationSearchResultsHeader />
118
- <Segment attached="bottom">
88
+ <Segment attached="bottom">
89
+ {embedded ? null : (
119
90
  <RuleImplementationsActions
120
91
  executeImplementationsOn={executeImplementationsOn}
121
92
  implementationQuery={implementationQuery}
@@ -123,28 +94,28 @@ export const ImplementationSearchResults = ({
123
94
  setMode={setMode}
124
95
  selectedImplementations={selectedImplementations}
125
96
  />
126
- <RuleImplementationsSearch />
127
- <RuleImplementationSelectedFilters />
128
- <Dimmer.Dimmable dimmed={loading}>
129
- <Dimmer active={loading} inverted>
130
- <Loader />
131
- </Dimmer>
132
- <RuleImplementationsLabelResults
133
- executeImplementationsOn={executeImplementationsOn}
134
- implementationsToExecute={_.size(selectedImplementations)}
135
- />
136
- <RuleImplementationsTable
137
- addAll={addAll}
138
- checkedAll={allChecked()}
139
- checkRow={checkRow}
140
- executeImplementationsOn={executeImplementationsOn}
141
- isRowChecked={isRowChecked}
142
- selectedImplementations={selectedImplementations}
143
- withoutColumns={withoutColumns}
144
- />
145
- <RuleImplementationsPagination />
146
- </Dimmer.Dimmable>
147
- </Segment>
97
+ )}
98
+ <RuleImplementationsSearch />
99
+ <RuleImplementationSelectedFilters />
100
+ <Dimmer.Dimmable dimmed={loading}>
101
+ <Dimmer active={loading} inverted>
102
+ <Loader />
103
+ </Dimmer>
104
+ <RuleImplementationsLabelResults
105
+ executeImplementationsOn={executeImplementationsOn}
106
+ implementationsToExecute={_.size(selectedImplementations)}
107
+ />
108
+ <RuleImplementationsTable
109
+ addAll={addAll}
110
+ checkedAll={allChecked()}
111
+ checkRow={checkRow}
112
+ executeImplementationsOn={executeImplementationsOn}
113
+ isRowChecked={isRowChecked}
114
+ selectedImplementations={selectedImplementations}
115
+ withoutColumns={withoutColumns}
116
+ />
117
+ <RuleImplementationsPagination />
118
+ </Dimmer.Dimmable>
148
119
  </Segment>
149
120
  );
150
121
  };
@@ -1,5 +1,7 @@
1
1
  import React from "react";
2
2
  import PropTypes from "prop-types";
3
+ import { Segment } from "semantic-ui-react";
4
+ import ImplementationsHeader from "./ImplementationsHeader";
3
5
  import ImplementationFiltersLoader from "./ImplementationFiltersLoader";
4
6
  import ImplementationSearchResults from "./ImplementationSearchResults";
5
7
  import RuleImplementationsLoader from "./RuleImplementationsLoader";
@@ -13,7 +15,12 @@ export const Implementations = ({ defaultFilters }) => (
13
15
  <ImplementationFiltersLoader defaultFilters={defaultFilters} />
14
16
  <UserSearchFiltersLoader scope="rule_implementation" />
15
17
  <RuleImplementationsLoader defaultFilters={defaultFilters} />
16
- <ImplementationSearchResults />
18
+ <Segment>
19
+ <ImplementationsHeader />
20
+ <Segment attached="bottom">
21
+ <ImplementationSearchResults />
22
+ </Segment>
23
+ </Segment>
17
24
  </>
18
25
  );
19
26
 
@@ -0,0 +1,36 @@
1
+ import React from "react";
2
+ import { Header, Icon } from "semantic-ui-react";
3
+ import { FormattedMessage } from "react-intl";
4
+ import { useActiveRoute } from "@truedat/core/hooks";
5
+ import {
6
+ IMPLEMENTATIONS_PENDING,
7
+ IMPLEMENTATIONS_DEPRECATED,
8
+ } from "@truedat/core/routes";
9
+
10
+ export const ImplementationSearchResultsHeader = () => {
11
+ const pending = useActiveRoute(IMPLEMENTATIONS_PENDING);
12
+ const deprecated = useActiveRoute(IMPLEMENTATIONS_DEPRECATED);
13
+ const header = pending
14
+ ? "implementations.header.manage"
15
+ : deprecated
16
+ ? "implementations.header.deprecated"
17
+ : "implementations.header";
18
+ const subheader = pending
19
+ ? "implementations.subheader.manage"
20
+ : deprecated
21
+ ? "implementations.subheader.deprecated"
22
+ : "implementations.subheader";
23
+ return (
24
+ <Header as="h2">
25
+ <Icon circular name="tags" />
26
+ <Header.Content>
27
+ <FormattedMessage id={header} />
28
+ <Header.Subheader>
29
+ <FormattedMessage id={subheader} />
30
+ </Header.Subheader>
31
+ </Header.Content>
32
+ </Header>
33
+ );
34
+ };
35
+
36
+ export default ImplementationSearchResultsHeader;
@@ -1,92 +1,86 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
3
  exports[`<ImplementationSearchResults /> matches the latest snapshot 1`] = `
4
- <Segment>
5
- <ImplementationSearchResultsHeader />
6
- <Segment
7
- attached="bottom"
4
+ <Segment
5
+ attached="bottom"
6
+ >
7
+ <Connect(RuleImplementationsActions)
8
+ executeImplementationsOn={false}
9
+ selectedImplementations={Array []}
10
+ setMode={[Function]}
11
+ />
12
+ <Connect(RuleImplementationsSearch) />
13
+ <injectIntl(Connect(SelectedFilters)) />
14
+ <DimmerDimmable
15
+ dimmed={false}
8
16
  >
9
- <Connect(RuleImplementationsActions)
17
+ <Dimmer
18
+ active={false}
19
+ inverted={true}
20
+ >
21
+ <Loader />
22
+ </Dimmer>
23
+ <Connect(RuleImplementationsLabelResults)
24
+ executeImplementationsOn={false}
25
+ implementationsToExecute={0}
26
+ />
27
+ <Connect(RuleImplementationsTable)
28
+ addAll={[Function]}
29
+ checkRow={[Function]}
30
+ checkedAll={false}
10
31
  executeImplementationsOn={false}
32
+ isRowChecked={[Function]}
11
33
  selectedImplementations={Array []}
12
- setMode={[Function]}
34
+ withoutColumns={Array []}
13
35
  />
14
- <Connect(RuleImplementationsSearch) />
15
- <injectIntl(Connect(SelectedFilters)) />
16
- <DimmerDimmable
17
- dimmed={false}
18
- >
19
- <Dimmer
20
- active={false}
21
- inverted={true}
22
- >
23
- <Loader />
24
- </Dimmer>
25
- <Connect(RuleImplementationsLabelResults)
26
- executeImplementationsOn={false}
27
- implementationsToExecute={0}
28
- />
29
- <Connect(RuleImplementationsTable)
30
- addAll={[Function]}
31
- checkRow={[Function]}
32
- checkedAll={false}
33
- executeImplementationsOn={false}
34
- isRowChecked={[Function]}
35
- selectedImplementations={Array []}
36
- withoutColumns={Array []}
37
- />
38
- <Connect(Pagination) />
39
- </DimmerDimmable>
40
- </Segment>
36
+ <Connect(Pagination) />
37
+ </DimmerDimmable>
41
38
  </Segment>
42
39
  `;
43
40
 
44
41
  exports[`<ImplementationSearchResults /> renders executions on when executionEnabled is true 1`] = `
45
- <Segment>
46
- <ImplementationSearchResultsHeader />
47
- <Segment
48
- attached="bottom"
42
+ <Segment
43
+ attached="bottom"
44
+ >
45
+ <Connect(RuleImplementationsActions)
46
+ executeImplementationsOn={true}
47
+ implementationQuery={
48
+ Object {
49
+ "filters": Object {
50
+ "executable": Array [
51
+ true,
52
+ ],
53
+ },
54
+ }
55
+ }
56
+ selectedImplementations={Array []}
57
+ setMode={[Function]}
58
+ />
59
+ <Connect(RuleImplementationsSearch) />
60
+ <injectIntl(Connect(SelectedFilters)) />
61
+ <DimmerDimmable
62
+ dimmed={false}
49
63
  >
50
- <Connect(RuleImplementationsActions)
64
+ <Dimmer
65
+ active={false}
66
+ inverted={true}
67
+ >
68
+ <Loader />
69
+ </Dimmer>
70
+ <Connect(RuleImplementationsLabelResults)
51
71
  executeImplementationsOn={true}
52
- implementationQuery={
53
- Object {
54
- "filters": Object {
55
- "executable": Array [
56
- true,
57
- ],
58
- },
59
- }
60
- }
72
+ implementationsToExecute={0}
73
+ />
74
+ <Connect(RuleImplementationsTable)
75
+ addAll={[Function]}
76
+ checkRow={[Function]}
77
+ checkedAll={false}
78
+ executeImplementationsOn={true}
79
+ isRowChecked={[Function]}
61
80
  selectedImplementations={Array []}
62
- setMode={[Function]}
81
+ withoutColumns={Array []}
63
82
  />
64
- <Connect(RuleImplementationsSearch) />
65
- <injectIntl(Connect(SelectedFilters)) />
66
- <DimmerDimmable
67
- dimmed={false}
68
- >
69
- <Dimmer
70
- active={false}
71
- inverted={true}
72
- >
73
- <Loader />
74
- </Dimmer>
75
- <Connect(RuleImplementationsLabelResults)
76
- executeImplementationsOn={true}
77
- implementationsToExecute={0}
78
- />
79
- <Connect(RuleImplementationsTable)
80
- addAll={[Function]}
81
- checkRow={[Function]}
82
- checkedAll={false}
83
- executeImplementationsOn={true}
84
- isRowChecked={[Function]}
85
- selectedImplementations={Array []}
86
- withoutColumns={Array []}
87
- />
88
- <Connect(Pagination) />
89
- </DimmerDimmable>
90
- </Segment>
83
+ <Connect(Pagination) />
84
+ </DimmerDimmable>
91
85
  </Segment>
92
86
  `;
@@ -28,135 +28,139 @@ exports[`<Implementations /> matches the latest snapshot 1`] = `
28
28
  class="ui bottom attached segment"
29
29
  >
30
30
  <div
31
- style="float: right;"
31
+ class="ui bottom attached segment"
32
32
  >
33
33
  <div
34
- aria-expanded="false"
35
- class="ui floating dropdown button icon group-actions button-update"
36
- role="listbox"
37
- tabindex="0"
34
+ style="float: right;"
38
35
  >
39
- <i
40
- aria-hidden="true"
41
- class="ellipsis vertical icon"
42
- />
43
36
  <div
44
- class="menu transition left"
37
+ aria-expanded="false"
38
+ class="ui floating dropdown button icon group-actions button-update"
39
+ role="listbox"
40
+ tabindex="0"
45
41
  >
42
+ <i
43
+ aria-hidden="true"
44
+ class="ellipsis vertical icon"
45
+ />
46
46
  <div
47
- aria-disabled="true"
48
- class="disabled item"
49
- role="option"
47
+ class="menu transition left"
50
48
  >
51
- <i
52
- aria-hidden="true"
53
- class="download icon"
54
- />
55
- <span>
56
- Download with csv format
57
- </span>
58
- <p
59
- class="menu-item-description"
49
+ <div
50
+ aria-disabled="true"
51
+ class="disabled item"
52
+ role="option"
60
53
  >
61
- There are no Implementations to be downloaded
62
- </p>
63
- </div>
64
- <div
65
- class="item"
66
- role="option"
67
- >
68
- <i
69
- aria-hidden="true"
70
- class="upload icon"
71
- />
72
- <span
73
- class="text"
54
+ <i
55
+ aria-hidden="true"
56
+ class="download icon"
57
+ />
58
+ <span>
59
+ Download with csv format
60
+ </span>
61
+ <p
62
+ class="menu-item-description"
63
+ >
64
+ There are no Implementations to be downloaded
65
+ </p>
66
+ </div>
67
+ <div
68
+ class="item"
69
+ role="option"
74
70
  >
75
- Upload Implementations
76
- </span>
71
+ <i
72
+ aria-hidden="true"
73
+ class="upload icon"
74
+ />
75
+ <span
76
+ class="text"
77
+ >
78
+ Upload Implementations
79
+ </span>
80
+ </div>
77
81
  </div>
78
82
  </div>
79
83
  </div>
80
- </div>
81
- <div
82
- class="ui action left icon input"
83
- >
84
- <input
85
- placeholder="Search implementations..."
86
- type="text"
87
- value="foo"
88
- />
89
- <i
90
- aria-hidden="true"
91
- class="search link icon"
92
- />
93
84
  <div
94
- aria-expanded="false"
95
- class="ui button floating labeled scrolling dropdown icon"
96
- role="listbox"
97
- tabindex="0"
85
+ class="ui action left icon input"
98
86
  >
99
- <div
100
- aria-atomic="true"
101
- aria-live="polite"
102
- class="divider text"
103
- role="alert"
104
- >
105
- Filters
106
- </div>
87
+ <input
88
+ placeholder="Search implementations..."
89
+ type="text"
90
+ value="foo"
91
+ />
107
92
  <i
108
93
  aria-hidden="true"
109
- class="filter icon"
94
+ class="search link icon"
110
95
  />
111
96
  <div
112
- class="menu transition"
97
+ aria-expanded="false"
98
+ class="ui button floating labeled scrolling dropdown icon"
99
+ role="listbox"
100
+ tabindex="0"
113
101
  >
114
102
  <div
115
- class="item"
116
- role="option"
103
+ aria-atomic="true"
104
+ aria-live="polite"
105
+ class="divider text"
106
+ role="alert"
117
107
  >
118
- <em>
119
- (reset all filters)
120
- </em>
108
+ Filters
109
+ </div>
110
+ <i
111
+ aria-hidden="true"
112
+ class="filter icon"
113
+ />
114
+ <div
115
+ class="menu transition"
116
+ >
117
+ <div
118
+ class="item"
119
+ role="option"
120
+ >
121
+ <em>
122
+ (reset all filters)
123
+ </em>
124
+ </div>
121
125
  </div>
122
126
  </div>
123
127
  </div>
124
- </div>
125
- <div
126
- class="selectedFilters"
127
- />
128
- <div
129
- class="dimmable"
130
- >
131
128
  <div
132
- class="ui inverted dimmer"
129
+ class="selectedFilters"
130
+ />
131
+ <div
132
+ class="dimmable"
133
133
  >
134
134
  <div
135
- class="content"
135
+ class="ui inverted dimmer"
136
136
  >
137
137
  <div
138
- class="ui loader"
139
- />
138
+ class="content"
139
+ >
140
+ <div
141
+ class="ui loader"
142
+ />
143
+ </div>
140
144
  </div>
141
- </div>
142
- <div
143
- class="ui label rules-label-results"
144
- >
145
- implementations found
146
- </div>
147
- <h4
148
- class="ui header"
149
- >
150
- <i
151
- aria-hidden="true"
152
- class="search icon"
153
- />
154
145
  <div
155
- class="content"
146
+ class="ui label rules-label-results"
156
147
  >
157
- No implementations found
148
+ implementations found
158
149
  </div>
159
- </h4>
150
+ <h4
151
+ class="ui header"
152
+ >
153
+ <i
154
+ aria-hidden="true"
155
+ class="search icon"
156
+ />
157
+ <div
158
+ class="content"
159
+ >
160
+ No implementations found
161
+ </div>
162
+ </h4>
163
+ </div>
160
164
  </div>
161
165
  </div>
162
166
  </div>