@truedat/dq 4.45.8 → 4.46.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.
Files changed (24) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/package.json +5 -5
  3. package/src/components/ImplementationActions.js +36 -30
  4. package/src/components/ImplementationSearchResults.js +4 -1
  5. package/src/components/QualityRoutes.js +1 -1
  6. package/src/components/RuleForm.js +1 -5
  7. package/src/components/RuleImplementationActions.js +3 -3
  8. package/src/components/RuleImplementationsActions.js +2 -2
  9. package/src/components/RuleProperties.js +1 -4
  10. package/src/components/__tests__/ImplementationActions.spec.js +3 -0
  11. package/src/components/__tests__/ImplementationSearchResults.spec.js +7 -0
  12. package/src/components/__tests__/RuleImplementation.spec.js +6 -0
  13. package/src/components/__tests__/RuleImplementationsActions.spec.js +2 -2
  14. package/src/components/__tests__/__snapshots__/ImplementationSearchResults.spec.js.snap +2 -0
  15. package/src/components/__tests__/__snapshots__/RuleForm.spec.js.snap +6 -6
  16. package/src/components/__tests__/__snapshots__/RuleProperties.spec.js.snap +0 -1
  17. package/src/components/ruleImplementationForm/FiltersFormGroup.js +1 -4
  18. package/src/components/ruleImplementationForm/__tests__/RuleImplementationRawForm.spec.js +2 -0
  19. package/src/components/ruleImplementationForm/__tests__/__snapshots__/FiltersFormGroup.spec.js.snap +36 -1
  20. package/src/components/ruleImplementationForm/__tests__/__snapshots__/FiltersGroup.spec.js.snap +36 -1
  21. package/src/components/ruleImplementationForm/__tests__/__snapshots__/ValueConditions.spec.js.snap +36 -1
  22. package/src/reducers/implementationActions.js +8 -1
  23. package/src/reducers/ruleImplementations.js +1 -0
  24. package/src/selectors/getRuleImplementationColumns.js +7 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## [4.46.2] 2022-06-16
4
+
5
+ ### Changed
6
+
7
+ - [TD-4739] Don't lazily load components from `@truedat/core`
8
+
9
+ ## [4.46.0] 2022-06-13
10
+
11
+ ### Fixed
12
+
13
+ - [TD-4918] Implementations workflow permissions
14
+
3
15
  ## [4.45.7] 2022-06-07
4
16
 
5
17
  ### Fixed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@truedat/dq",
3
- "version": "4.45.8",
3
+ "version": "4.46.2",
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.45.8",
37
+ "@truedat/test": "4.46.2",
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,8 +88,8 @@
88
88
  },
89
89
  "dependencies": {
90
90
  "@apollo/client": "^3.6.4",
91
- "@truedat/core": "4.45.8",
92
- "@truedat/df": "4.45.8",
91
+ "@truedat/core": "4.46.2",
92
+ "@truedat/df": "4.46.2",
93
93
  "axios": "^0.19.2",
94
94
  "graphql": "^15.5.3",
95
95
  "path-to-regexp": "^1.7.0",
@@ -110,5 +110,5 @@
110
110
  "react-dom": ">= 16.8.6 < 17",
111
111
  "semantic-ui-react": ">= 0.88.2 < 2.1"
112
112
  },
113
- "gitHead": "1b5acb1dc1233181e5a47353fd8a5da1424e7a47"
113
+ "gitHead": "161f3fae4428ee4e4e26b62fd2f9764ce389d0e2"
114
114
  }
@@ -17,38 +17,41 @@ import {
17
17
  import ExecutionPopup from "./ExecutionPopup";
18
18
 
19
19
  export const implementationActions = ({
20
+ actions,
20
21
  id,
21
22
  deleteImplementation,
22
23
  formatMessage,
23
- }) => [
24
- {
25
- key: "clone",
26
- icon: "copy outline",
27
- text: formatMessage({ id: "ruleImplementation.actions.clone" }),
28
- value: "clone",
29
- as: Link,
30
- to: linkTo.IMPLEMENTATION_CLONE({ implementation_id: id }),
31
- },
32
- {
33
- key: "move",
34
- icon: "share square",
35
- text: formatMessage({ id: "ruleImplementation.actions.move" }),
36
- value: "move",
37
- as: Link,
38
- to: linkTo.IMPLEMENTATION_MOVE({ implementation_id: id }),
39
- },
40
- {
41
- key: "delete",
42
- value: "delete",
43
- as: OptionModal,
44
- headerMessage: "ruleImplementation.actions.delete.confirmation.header",
45
- contentMessage: "ruleImplementation.actions.delete.confirmation.content",
46
- iconName: "trash alternate outline",
47
- iconColor: "red",
48
- option: "ruleImplementation.actions.delete",
49
- onConfirm: () => deleteImplementation({ id, redirectUrl: IMPLEMENTATIONS }),
50
- },
51
- ];
24
+ }) =>
25
+ _.filter(({ key }) => _.flow(Object.keys, _.includes(key))(actions))([
26
+ {
27
+ key: "clone",
28
+ icon: "copy outline",
29
+ text: formatMessage({ id: "ruleImplementation.actions.clone" }),
30
+ value: "clone",
31
+ as: Link,
32
+ to: linkTo.IMPLEMENTATION_CLONE({ implementation_id: id }),
33
+ },
34
+ {
35
+ key: "move",
36
+ icon: "share square",
37
+ text: formatMessage({ id: "ruleImplementation.actions.move" }),
38
+ value: "move",
39
+ as: Link,
40
+ to: linkTo.IMPLEMENTATION_MOVE({ implementation_id: id }),
41
+ },
42
+ {
43
+ key: "delete",
44
+ value: "delete",
45
+ as: OptionModal,
46
+ headerMessage: "ruleImplementation.actions.delete.confirmation.header",
47
+ contentMessage: "ruleImplementation.actions.delete.confirmation.content",
48
+ iconName: "trash alternate outline",
49
+ iconColor: "red",
50
+ option: "ruleImplementation.actions.delete",
51
+ onConfirm: () =>
52
+ deleteImplementation({ id, redirectUrl: IMPLEMENTATIONS }),
53
+ },
54
+ ]);
52
55
 
53
56
  export const ImplementationActions = ({
54
57
  actions,
@@ -66,6 +69,7 @@ export const ImplementationActions = ({
66
69
  createExecutionGroup({ ...query, df_content });
67
70
  };
68
71
  const secondaryActions = implementationActions({
72
+ actions,
69
73
  id,
70
74
  deleteImplementation,
71
75
  formatMessage,
@@ -116,7 +120,9 @@ export const ImplementationActions = ({
116
120
  />
117
121
  ) : null}
118
122
  {actions?.execute ? <ExecutionPopup onSubmit={handleExecute} /> : null}
119
- <GroupActions availableActions={secondaryActions} />
123
+ {_.isEmpty(secondaryActions) ? null : (
124
+ <GroupActions availableActions={secondaryActions} />
125
+ )}
120
126
  </>
121
127
  );
122
128
  };
@@ -101,7 +101,9 @@ export const ImplementationSearchResults = ({
101
101
  selectedImplementations
102
102
  );
103
103
  };
104
-
104
+ const withoutColumns = useActiveRoute(IMPLEMENTATIONS_PENDING)
105
+ ? []
106
+ : ["status"];
105
107
  return (
106
108
  <Segment>
107
109
  <ImplementationSearchResultsHeader />
@@ -130,6 +132,7 @@ export const ImplementationSearchResults = ({
130
132
  executeImplementationsOn={executeImplementationsOn}
131
133
  isRowChecked={isRowChecked}
132
134
  selectedImplementations={selectedImplementations}
135
+ withoutColumns={withoutColumns}
133
136
  />
134
137
  <RuleImplementationsPagination />
135
138
  </Dimmer.Dimmable>
@@ -14,7 +14,7 @@ import ImplementationsRoutes from "./ImplementationsRoutes";
14
14
  import RulesRoutes from "./RulesRoutes";
15
15
 
16
16
  const QualityRoutes = () => {
17
- const authorized = useAuthorized("data_quality");
17
+ const authorized = useAuthorized("quality");
18
18
 
19
19
  return (
20
20
  <>
@@ -16,17 +16,13 @@ import {
16
16
  Popup,
17
17
  Icon,
18
18
  } from "semantic-ui-react";
19
- import { HistoryBackButton } from "@truedat/core/components";
19
+ import { HistoryBackButton, RichTextEditor } from "@truedat/core/components";
20
20
  import { getDomainSelectorOptions } from "@truedat/bg/selectors";
21
21
 
22
22
  const DomainDropdownSelector = React.lazy(() =>
23
23
  import("@truedat/bg/taxonomy/components/DomainDropdownSelector")
24
24
  );
25
25
 
26
- const RichTextEditor = React.lazy(() =>
27
- import("@truedat/core/components/RichTextEditor")
28
- );
29
-
30
26
  const ConceptSelector = React.lazy(() =>
31
27
  import("@truedat/bg/concepts/relations/components/ConceptSelector")
32
28
  );
@@ -37,9 +37,9 @@ RuleImplementationActions.propTypes = {
37
37
  canCreateRaw: PropTypes.bool,
38
38
  };
39
39
 
40
- const mapStateToProps = ({ userRulePermissions }) => ({
41
- canCreate: !!userRulePermissions?.manage_quality_rule_implementations,
42
- canCreateRaw: !!userRulePermissions?.manage_raw_quality_rule_implementations,
40
+ const mapStateToProps = ({ implementationActions }) => ({
41
+ canCreate: !!implementationActions?.create,
42
+ canCreateRaw: !!implementationActions?.createRaw,
43
43
  });
44
44
 
45
45
  export default connect(mapStateToProps)(RuleImplementationActions);
@@ -82,7 +82,7 @@ export const RuleImplementationsActions = ({
82
82
  />
83
83
  </>
84
84
  ) : null}
85
- {actions?.createRaw ? (
85
+ {actions?.createRawRuleLess ? (
86
86
  <Button
87
87
  as={Link}
88
88
  to={IMPLEMENTATION_NEW_RAW}
@@ -91,7 +91,7 @@ export const RuleImplementationsActions = ({
91
91
  })}
92
92
  />
93
93
  ) : null}
94
- {actions?.create ? (
94
+ {actions?.createRuleLess ? (
95
95
  <Button
96
96
  primary
97
97
  as={Link}
@@ -6,12 +6,9 @@ import { connect } from "react-redux";
6
6
  import { Link } from "react-router-dom";
7
7
  import { List, Label } from "semantic-ui-react";
8
8
  import "rc-slider/assets/index.css";
9
+ import { RichTextEditor } from "@truedat/core/components";
9
10
  import { linkTo } from "@truedat/core/routes";
10
11
 
11
- const RichTextEditor = React.lazy(() =>
12
- import("@truedat/core/components/RichTextEditor")
13
- );
14
-
15
12
  const getStatusColor = (active) =>
16
13
  ({
17
14
  false: "teal",
@@ -9,6 +9,9 @@ const renderOpts = {
9
9
  },
10
10
  implementationActions: {
11
11
  execute: { method: "POST" },
12
+ move: { method: "POST" },
13
+ clone: { method: "POST" },
14
+ delete: { method: "POST" },
12
15
  },
13
16
  },
14
17
  };
@@ -2,6 +2,13 @@ import React from "react";
2
2
  import { shallow } from "enzyme";
3
3
  import { ImplementationSearchResults } from "../ImplementationSearchResults";
4
4
 
5
+ jest.mock("@truedat/core/hooks", () => ({
6
+ useAuthorized: jest.fn(() => true),
7
+ useActiveRoute: jest.fn((param) =>
8
+ param === "/pendingImplementations" ? true : false
9
+ ),
10
+ }));
11
+
5
12
  describe("<ImplementationSearchResults />", () => {
6
13
  it("matches the latest snapshot", () => {
7
14
  const props = {
@@ -19,6 +19,9 @@ const stateExecutePermission = {
19
19
  manage: true,
20
20
  link_concept: true,
21
21
  execute: true,
22
+ move: true,
23
+ clone: true,
24
+ delete: true,
22
25
  },
23
26
  };
24
27
 
@@ -28,6 +31,9 @@ const stateNoExecutePermission = {
28
31
  manage: true,
29
32
  link_concept: true,
30
33
  execute: false,
34
+ move: true,
35
+ clone: true,
36
+ delete: true,
31
37
  },
32
38
  };
33
39
 
@@ -13,8 +13,8 @@ describe("<RuleImplementationsActions />", () => {
13
13
  const props = {
14
14
  actions: {
15
15
  uploadResults: {},
16
- create: {},
17
- createRaw: {},
16
+ createRuleLess: {},
17
+ createRawRuleLess: {},
18
18
  download: {},
19
19
  execute: {},
20
20
  },
@@ -33,6 +33,7 @@ exports[`<ImplementationSearchResults /> matches the latest snapshot 1`] = `
33
33
  executeImplementationsOn={false}
34
34
  isRowChecked={[Function]}
35
35
  selectedImplementations={Array []}
36
+ withoutColumns={Array []}
36
37
  />
37
38
  <Connect(Pagination) />
38
39
  </DimmerDimmable>
@@ -82,6 +83,7 @@ exports[`<ImplementationSearchResults /> renders executions on when executionEna
82
83
  executeImplementationsOn={true}
83
84
  isRowChecked={[Function]}
84
85
  selectedImplementations={Array []}
86
+ withoutColumns={Array []}
85
87
  />
86
88
  <Connect(Pagination) />
87
89
  </DimmerDimmable>
@@ -145,23 +145,23 @@ exports[`<RuleForm /> matches the latest snapshot (edit mode) 1`] = `
145
145
  autocorrect="on"
146
146
  contenteditable="true"
147
147
  data-gramm="false"
148
- data-key="5"
148
+ data-key="4"
149
149
  data-slate-editor="true"
150
150
  role="textbox"
151
151
  spellcheck="true"
152
152
  style="outline: none; white-space: pre-wrap; word-wrap: break-word;"
153
153
  >
154
154
  <div
155
- data-key="6"
155
+ data-key="5"
156
156
  data-slate-object="block"
157
157
  style="position: relative;"
158
158
  >
159
159
  <span
160
- data-key="8"
160
+ data-key="7"
161
161
  data-slate-object="text"
162
162
  >
163
163
  <span
164
- data-offset-key="8:0"
164
+ data-offset-key="7:0"
165
165
  data-slate-leaf="true"
166
166
  >
167
167
  <span>
@@ -602,11 +602,11 @@ exports[`<RuleForm /> matches the latest snapshot 1`] = `
602
602
  style="position: relative;"
603
603
  >
604
604
  <span
605
- data-key="4"
605
+ data-key="3"
606
606
  data-slate-object="text"
607
607
  >
608
608
  <span
609
- data-offset-key="4:0"
609
+ data-offset-key="3:0"
610
610
  data-slate-leaf="true"
611
611
  >
612
612
  <span>
@@ -5,7 +5,6 @@ exports[`<RuleProperties /> matches the latest snapshot 1`] = `
5
5
  <div
6
6
  class="ui big relaxed list"
7
7
  role="list"
8
- style=""
9
8
  >
10
9
  <div
11
10
  class="ui olive label"
@@ -3,15 +3,12 @@ import React from "react";
3
3
  import { Form, Dropdown } from "semantic-ui-react";
4
4
  import PropTypes from "prop-types";
5
5
  import { useIntl } from "react-intl";
6
+ import { OptionGroup } from "@truedat/core/components";
6
7
  import { getStructureFields } from "../../selectors/getStructureFields";
7
8
  import FiltersField from "./FiltersField";
8
9
  import FieldModifier from "./FieldModifier";
9
10
  import operatorFunctions from "./operators";
10
11
 
11
- const OptionGroup = React.lazy(() =>
12
- import("@truedat/core/components/OptionGroup")
13
- );
14
-
15
12
  const StructureFieldsDropdown = React.lazy(() =>
16
13
  import("@truedat/dd/components/StructureFieldsDropdown")
17
14
  );
@@ -6,6 +6,8 @@ import { render } from "@truedat/test/render";
6
6
  import { multipleTemplatesMock } from "@truedat/test/mocks";
7
7
  import RuleImplementationRawForm from "../RuleImplementationRawForm";
8
8
 
9
+ jest.setTimeout(30000);
10
+
9
11
  const renderOpts = {
10
12
  mocks: [multipleTemplatesMock({ scope: "ri", domainIds: [1] })],
11
13
  state: {
@@ -17,7 +17,42 @@ exports[`<FiltersFormGroup /> matches the latest snapshot 1`] = `
17
17
  </div>
18
18
  <div
19
19
  class="field"
20
- />
20
+ >
21
+ <label>
22
+ Operator
23
+ </label>
24
+ <div
25
+ aria-expanded="false"
26
+ class="ui search dropdown selection"
27
+ label="Operator"
28
+ role="combobox"
29
+ >
30
+ <input
31
+ aria-autocomplete="list"
32
+ autocomplete="off"
33
+ class="search"
34
+ tabindex="0"
35
+ type="text"
36
+ value=""
37
+ />
38
+ <div
39
+ aria-atomic="true"
40
+ aria-live="polite"
41
+ class="divider text"
42
+ role="alert"
43
+ >
44
+ Operator Dropdown
45
+ </div>
46
+ <i
47
+ aria-hidden="true"
48
+ class="dropdown icon"
49
+ />
50
+ <div
51
+ class="menu transition"
52
+ role="listbox"
53
+ />
54
+ </div>
55
+ </div>
21
56
  <div
22
57
  class="nine wide field"
23
58
  />
@@ -23,7 +23,42 @@ exports[`<FiltersGroup /> matches the latest snapshot when siblings provided 1`]
23
23
  </div>
24
24
  <div
25
25
  class="field"
26
- />
26
+ >
27
+ <label>
28
+ Operator
29
+ </label>
30
+ <div
31
+ aria-expanded="false"
32
+ class="ui search dropdown selection"
33
+ label="Operator"
34
+ role="combobox"
35
+ >
36
+ <input
37
+ aria-autocomplete="list"
38
+ autocomplete="off"
39
+ class="search"
40
+ tabindex="0"
41
+ type="text"
42
+ value=""
43
+ />
44
+ <div
45
+ aria-atomic="true"
46
+ aria-live="polite"
47
+ class="divider text"
48
+ role="alert"
49
+ >
50
+ Operator Dropdown
51
+ </div>
52
+ <i
53
+ aria-hidden="true"
54
+ class="dropdown icon"
55
+ />
56
+ <div
57
+ class="menu transition"
58
+ role="listbox"
59
+ />
60
+ </div>
61
+ </div>
27
62
  <div
28
63
  class="nine wide field"
29
64
  />
@@ -23,7 +23,42 @@ exports[`<ValueConditions /> matches the latest snapshot when siblings provided
23
23
  </div>
24
24
  <div
25
25
  class="field"
26
- />
26
+ >
27
+ <label>
28
+ Operator
29
+ </label>
30
+ <div
31
+ aria-expanded="false"
32
+ class="ui search dropdown selection"
33
+ label="Operator"
34
+ role="combobox"
35
+ >
36
+ <input
37
+ aria-autocomplete="list"
38
+ autocomplete="off"
39
+ class="search"
40
+ tabindex="0"
41
+ type="text"
42
+ value=""
43
+ />
44
+ <div
45
+ aria-atomic="true"
46
+ aria-live="polite"
47
+ class="divider text"
48
+ role="alert"
49
+ >
50
+ Operator Dropdown
51
+ </div>
52
+ <i
53
+ aria-hidden="true"
54
+ class="dropdown icon"
55
+ />
56
+ <div
57
+ class="menu transition"
58
+ role="listbox"
59
+ />
60
+ </div>
61
+ </div>
27
62
  <div
28
63
  class="nine wide field"
29
64
  />
@@ -1,13 +1,20 @@
1
1
  import _ from "lodash/fp";
2
- import { clearRuleImplementations, fetchRuleImplementation } from "../routines";
2
+ import {
3
+ clearRuleImplementation,
4
+ clearRuleImplementations,
5
+ fetchRuleImplementation,
6
+ fetchRuleImplementations,
7
+ } from "../routines";
3
8
 
4
9
  const initialState = {};
5
10
 
6
11
  const implementationActions = (state = initialState, { type, payload }) => {
7
12
  switch (type) {
8
13
  case fetchRuleImplementation.SUCCESS:
14
+ case fetchRuleImplementations.SUCCESS:
9
15
  return _.pathOr(initialState, "_actions")(payload);
10
16
  case clearRuleImplementations.TRIGGER:
17
+ case clearRuleImplementation.TRIGGER:
11
18
  return initialState;
12
19
  default:
13
20
  return state;
@@ -26,6 +26,7 @@ const pickFields = _.pick([
26
26
  "goal",
27
27
  "dataset",
28
28
  "valdations",
29
+ "status",
29
30
  ]);
30
31
 
31
32
  const ruleImplementations = (state = initialState, { type, payload }) => {
@@ -28,6 +28,13 @@ export const defaultImplementationColumns = [
28
28
  fieldDecorator: RuleLink,
29
29
  width: 2,
30
30
  },
31
+ {
32
+ name: "status",
33
+ fieldDecorator: (value) =>
34
+ translateDecorator(`ruleImplementation.status.${value}`),
35
+ sort: { name: "status" },
36
+ width: 2,
37
+ },
31
38
  {
32
39
  name: "business_concept",
33
40
  fieldSelector: _.path("current_business_concept_version.name"),