@truedat/audit 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/audit",
3
- "version": "7.5.10",
3
+ "version": "7.5.11",
4
4
  "description": "Truedat Web Audit Module",
5
5
  "sideEffects": false,
6
6
  "module": "src/index.js",
@@ -48,7 +48,7 @@
48
48
  "@testing-library/jest-dom": "^6.6.3",
49
49
  "@testing-library/react": "^16.2.0",
50
50
  "@testing-library/user-event": "^14.6.1",
51
- "@truedat/test": "7.5.10",
51
+ "@truedat/test": "7.5.11",
52
52
  "identity-obj-proxy": "^3.0.0",
53
53
  "jest": "^29.7.0",
54
54
  "redux-saga-test-plan": "^4.0.6"
@@ -81,5 +81,5 @@
81
81
  "semantic-ui-react": "^3.0.0-beta.2",
82
82
  "swr": "^2.3.3"
83
83
  },
84
- "gitHead": "8a8c49e9d5d6bb4e5f2b503b063bfd6dd20a503d"
84
+ "gitHead": "cbb92d5206752fe2add4195432b0401da17a0f23"
85
85
  }
@@ -1,5 +1,5 @@
1
1
  import PropTypes from "prop-types";
2
- import { Link } from "react-router";
2
+ import { Link, useNavigate } from "react-router";
3
3
  import { connect } from "react-redux";
4
4
  import { Button, Icon } from "semantic-ui-react";
5
5
  import { useIntl } from "react-intl";
@@ -7,7 +7,7 @@ import { ConfirmModal, GroupActions } from "@truedat/core/components";
7
7
  import { SUBSCRIPTIONS, linkTo } from "@truedat/core/routes";
8
8
  import { deleteSubscription } from "@truedat/core/routines";
9
9
 
10
- export const ModalDelete = ({ deleteSubscription, id }) => {
10
+ export const ModalDelete = ({ handleDelete, id }) => {
11
11
  const { formatMessage } = useIntl();
12
12
  return (
13
13
  <ConfirmModal
@@ -25,9 +25,7 @@ export const ModalDelete = ({ deleteSubscription, id }) => {
25
25
  content={formatMessage({
26
26
  id: "subscription.actions.delete.confirmation.content",
27
27
  })}
28
- onConfirm={() =>
29
- deleteSubscription({ subscription: { id }, redirect: SUBSCRIPTIONS })
30
- }
28
+ onConfirm={() => handleDelete({ id })}
31
29
  />
32
30
  );
33
31
  };
@@ -39,7 +37,14 @@ ModalDelete.propTypes = {
39
37
 
40
38
  export const SubscriptionActions = ({ deleteSubscription, subscription }) => {
41
39
  const { formatMessage } = useIntl();
40
+ const navigate = useNavigate();
42
41
  const id = subscription?.id;
42
+
43
+ const onConfirmDelete = async ({ id }) => {
44
+ await deleteSubscription({ subscription: { id } });
45
+ navigate(SUBSCRIPTIONS);
46
+ };
47
+
43
48
  const actions = id
44
49
  ? [
45
50
  {
@@ -55,7 +60,7 @@ export const SubscriptionActions = ({ deleteSubscription, subscription }) => {
55
60
  icon: "trash",
56
61
  value: "delete",
57
62
  as: ModalDelete,
58
- deleteSubscription,
63
+ handleDelete: onConfirmDelete,
59
64
  id,
60
65
  },
61
66
  ]