@truedat/dq 7.5.10 → 7.5.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@truedat/dq",
3
- "version": "7.5.10",
3
+ "version": "7.5.11",
4
4
  "description": "Truedat Web Data Quality Module",
5
5
  "sideEffects": false,
6
6
  "module": "src/index.js",
@@ -53,7 +53,7 @@
53
53
  "@testing-library/jest-dom": "^6.6.3",
54
54
  "@testing-library/react": "^16.2.0",
55
55
  "@testing-library/user-event": "^14.6.1",
56
- "@truedat/test": "7.5.10",
56
+ "@truedat/test": "7.5.11",
57
57
  "identity-obj-proxy": "^3.0.0",
58
58
  "jest": "^29.7.0",
59
59
  "redux-saga-test-plan": "^4.0.6"
@@ -88,5 +88,5 @@
88
88
  "semantic-ui-react": "^3.0.0-beta.2",
89
89
  "swr": "^2.3.3"
90
90
  },
91
- "gitHead": "8a8c49e9d5d6bb4e5f2b503b063bfd6dd20a503d"
91
+ "gitHead": "cbb92d5206752fe2add4195432b0401da17a0f23"
92
92
  }
@@ -1,6 +1,6 @@
1
1
  import _ from "lodash/fp";
2
2
  import PropTypes from "prop-types";
3
- import { Link } from "react-router";
3
+ import { Link, useNavigate } from "react-router";
4
4
  import { useIntl } from "react-intl";
5
5
  import { connect } from "react-redux";
6
6
  import { Button } from "semantic-ui-react";
@@ -19,7 +19,7 @@ import ExecutionPopup from "./ExecutionPopup";
19
19
  export const implementationActions = ({
20
20
  actions,
21
21
  id,
22
- deleteImplementation,
22
+ onConfirmDelete,
23
23
  formatMessage,
24
24
  }) =>
25
25
  _.filter(({ key }) => _.flow(Object.keys, _.includes(key))(actions))([
@@ -64,8 +64,7 @@ export const implementationActions = ({
64
64
  iconName: "trash alternate outline",
65
65
  iconColor: "red",
66
66
  option: "ruleImplementation.actions.delete",
67
- onConfirm: () =>
68
- deleteImplementation({ id, redirectUrl: IMPLEMENTATIONS }),
67
+ onConfirm: () => onConfirmDelete({ id }),
69
68
  },
70
69
  ]);
71
70
 
@@ -79,8 +78,15 @@ export const ImplementationActions = ({
79
78
  ruleImplementation,
80
79
  submitImplementation,
81
80
  }) => {
81
+ const navigate = useNavigate();
82
82
  const { formatMessage } = useIntl();
83
83
  const id = ruleImplementation?.id;
84
+
85
+ const onConfirmDelete = async (id) => {
86
+ await deleteImplementation(id);
87
+ navigate(IMPLEMENTATIONS);
88
+ };
89
+
84
90
  const handleExecute = (df_content) => {
85
91
  const query = { filters: { id: [ruleImplementation?.id] } };
86
92
  createExecutionGroup({ ...query, df_content });
@@ -88,7 +94,7 @@ export const ImplementationActions = ({
88
94
  const secondaryActions = implementationActions({
89
95
  actions,
90
96
  id,
91
- deleteImplementation,
97
+ onConfirmDelete,
92
98
  formatMessage,
93
99
  });
94
100
  return (
@@ -1,14 +1,14 @@
1
1
  import _ from "lodash/fp";
2
- import { Link } from "react-router";
2
+ import { Link, useNavigate } from "react-router";
3
3
  import { connect } from "react-redux";
4
4
  import PropTypes from "prop-types";
5
5
  import { Button, Icon } from "semantic-ui-react";
6
6
  import { FormattedMessage } from "react-intl";
7
7
  import { ConfirmModal, GroupActions } from "@truedat/core/components";
8
- import { linkTo } from "@truedat/core/routes";
8
+ import { linkTo, RULES } from "@truedat/core/routes";
9
9
  import { deleteRule } from "../routines";
10
10
 
11
- const ModalDelete = ({ deleteRule, id }) => (
11
+ const ModalDelete = ({ handleDelete, id, name }) => (
12
12
  <ConfirmModal
13
13
  icon="trash"
14
14
  trigger={
@@ -25,11 +25,18 @@ const ModalDelete = ({ deleteRule, id }) => (
25
25
  values={{ name: <i>{name}</i> }}
26
26
  />
27
27
  }
28
- onConfirm={() => deleteRule({ id })}
28
+ onConfirm={() => handleDelete({ id })}
29
29
  />
30
30
  );
31
31
 
32
32
  export const RuleActions = ({ deleteRule, manageRule, rule: { id, name } }) => {
33
+ const navigate = useNavigate();
34
+
35
+ const onConfirmDelete = async ({ id }) => {
36
+ await deleteRule({ id });
37
+ navigate(RULES);
38
+ };
39
+
33
40
  const generateAvailableActions = () => {
34
41
  const actions = {
35
42
  edit: manageRule,
@@ -53,7 +60,7 @@ export const RuleActions = ({ deleteRule, manageRule, rule: { id, name } }) => {
53
60
  icon: "trash",
54
61
  value: "delete",
55
62
  as: ModalDelete,
56
- deleteRule,
63
+ handleDelete: onConfirmDelete,
57
64
  id,
58
65
  name,
59
66
  selected: false,
@@ -28,14 +28,21 @@ export const RuleImplementationTabs = ({
28
28
  canViewDraftConcepts,
29
29
  canViewPendingApprovalConcepts,
30
30
  }) => {
31
- const implementationActive =
32
- useActiveRoute(IMPLEMENTATION) || useActiveRoute(IMPLEMENTATION_MOVE);
31
+ const implActive = useActiveRoute(IMPLEMENTATION);
32
+ const implMove = useActiveRoute(IMPLEMENTATION_MOVE);
33
+ const implementationActive = implActive || implMove;
34
+
35
+ const implConceptLinksActive = useActiveRoute(IMPLEMENTATION_CONCEPT_LINKS);
36
+ const implConceptLinksNewActive = useActiveRoute(
37
+ IMPLEMENTATION_CONCEPT_LINKS_NEW
38
+ );
33
39
  const conceptLinksActive =
34
- useActiveRoute(IMPLEMENTATION_CONCEPT_LINKS) ||
35
- useActiveRoute(IMPLEMENTATION_CONCEPT_LINKS_NEW);
36
- const structuresActive =
37
- useActiveRoute(IMPLEMENTATION_STRUCTURES) ||
38
- useActiveRoute(IMPLEMENTATION_STRUCTURES_NEW);
40
+ implConceptLinksActive || implConceptLinksNewActive;
41
+
42
+ const implStructuresActive = useActiveRoute(IMPLEMENTATION_STRUCTURES);
43
+ const implStructuresNewActive = useActiveRoute(IMPLEMENTATION_STRUCTURES_NEW);
44
+ const structuresActive = implStructuresActive || implStructuresNewActive;
45
+
39
46
  const resultsActive = useActiveRoute(IMPLEMENTATION_RESULTS);
40
47
  const executionsActive = useActiveRoute(IMPLEMENTATION_EXECUTIONS);
41
48
  const resultsDetailsActive = useActiveRoute(IMPLEMENTATION_RESULTS_DETAILS);