@truedat/audit 4.52.5 → 4.52.6

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.52.6] 2022-10-03
4
+
5
+ ### Added
6
+
7
+ - [TD-4214] Grant request workflow events
8
+
3
9
  ## [4.51.3] 2022-09-16
4
10
 
5
11
  ### Changed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@truedat/audit",
3
- "version": "4.52.5",
3
+ "version": "4.52.6",
4
4
  "description": "Truedat Web Audit 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.52.0",
37
+ "@truedat/test": "4.52.6",
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",
@@ -85,8 +85,8 @@
85
85
  ]
86
86
  },
87
87
  "dependencies": {
88
- "@truedat/auth": "4.52.5",
89
- "@truedat/core": "4.52.5",
88
+ "@truedat/auth": "4.52.6",
89
+ "@truedat/core": "4.52.6",
90
90
  "path-to-regexp": "^1.7.0",
91
91
  "prop-types": "^15.8.1",
92
92
  "react-color": "^2.17.3",
@@ -106,5 +106,5 @@
106
106
  "react-dom": ">= 16.8.6 < 17",
107
107
  "semantic-ui-react": ">= 0.88.2 < 2.1"
108
108
  },
109
- "gitHead": "6dd96a3f576251beb2a3a9d6259b1bf187635f1b"
109
+ "gitHead": "14204211010d6329f9f22071c95e7d9d6ce6b0f7"
110
110
  }
@@ -1,3 +1,4 @@
1
+ import _ from "lodash/fp";
1
2
  import React, { useEffect, useRef, useState } from "react";
2
3
  import PropTypes from "prop-types";
3
4
  import { FormattedMessage, useIntl } from "react-intl";
@@ -70,6 +71,15 @@ export const NotificationEvent = ({
70
71
  )}
71
72
  </h4>
72
73
  <p>{event.name}</p>
74
+ {event.event === "grant_request_group_creation" ? (
75
+ <ul>
76
+ {_.map((request) => (
77
+ <li key={request.id}>
78
+ {request?.data_structure?.current_version?.name}
79
+ </li>
80
+ ))(event.payload?.requests)}
81
+ </ul>
82
+ ) : null}
73
83
  <Label>
74
84
  {eventsWithStatus.includes(template) ? (
75
85
  <FormattedMessage
@@ -57,20 +57,12 @@ export const NotificationsMenu = ({
57
57
  <Dropdown.Item
58
58
  className="item"
59
59
  key={`${i}x${j}`}
60
- href={
61
- event.event === "external_notification"
62
- ? event.path
63
- : undefined
64
- }
60
+ href={event?.path || undefined}
65
61
  target={
66
62
  event.event === "external_notification"
67
63
  ? "_blank"
68
64
  : undefined
69
65
  }
70
- as={
71
- event.event !== "external_notification" ? Link : undefined
72
- }
73
- to={event.path || "/search"}
74
66
  >
75
67
  <NotificationEvent
76
68
  readMark={read_mark}
@@ -125,6 +125,7 @@ export const SubscriptionForm = ({
125
125
  const exclusiveEvents = [
126
126
  "rule_result_created",
127
127
  "implementation_status_updated",
128
+ "grant_request_group_creation",
128
129
  ];
129
130
  const eventsbytype = _.getOr([], resourceType)(EVENTS_BY_TYPE);
130
131
  setEventsForType(
@@ -25,7 +25,7 @@ exports[`<NotificationsMenu /> matches the latest snapshot 1`] = `
25
25
  />
26
26
  <a
27
27
  class="item item"
28
- href="/foo/1/bar"
28
+ href="foo/1/bar"
29
29
  role="option"
30
30
  >
31
31
  <div
@@ -87,7 +87,6 @@ exports[`<NotificationsMenu /> matches the latest snapshot with external notific
87
87
  href="http://foo.bar"
88
88
  role="option"
89
89
  target="_blank"
90
- to="http://foo.bar"
91
90
  >
92
91
  <div
93
92
  class="notification-item unread"
@@ -90,6 +90,21 @@ export default {
90
90
  "subscriptions.events.grant_approval.rejected": "Rejected",
91
91
  "subscriptions.events.grant_created": "Access has been granted",
92
92
  "subscriptions.events.grant_deleted": "Access has been revoked",
93
+ "subscriptions.events.grant_request_approval_addition":
94
+ "Grant request approval addition",
95
+ "subscriptions.events.grant_request_approval_consensus":
96
+ "Grant request approval consensus",
97
+ "subscriptions.events.grant_request_group_creation":
98
+ "Grant request group creation",
99
+ "subscriptions.events.grant_request_rejection": "Grant request rejection",
100
+ "subscriptions.events.grant_request_status_cancellation":
101
+ "Grant request status cancellation",
102
+ "subscriptions.events.grant_request_status_failure":
103
+ "Grant request process failure",
104
+ "subscriptions.events.grant_request_status_process_end":
105
+ "Grant request status process start (processed)",
106
+ "subscriptions.events.grant_request_status_process_start":
107
+ "Grant request status process start (processing)",
93
108
  "subscriptions.events.implementation_created": "Implementation created",
94
109
  "subscriptions.events.implementation_status_updated":
95
110
  "Implementation status updated",
@@ -100,6 +100,21 @@ export default {
100
100
  "Se ha creado un nuevo acceso a estructuras",
101
101
  "subscriptions.events.grant_deleted":
102
102
  "Se ha eliminado el acceso a estructuras",
103
+ "subscriptions.events.grant_request_approval_addition":
104
+ "Petición de acceso: nueva aprobación",
105
+ "subscriptions.events.grant_request_approval_consensus":
106
+ "Petición de acceso: consenso de aprobación",
107
+ "subscriptions.events.grant_request_group_creation":
108
+ "Petición de acceso: creación de petición",
109
+ "subscriptions.events.grant_request_rejection": "Petición de acceso: rechazo",
110
+ "subscriptions.events.grant_request_status_cancellation":
111
+ "Petición de acceso: cancelación",
112
+ "subscriptions.events.grant_request_status_failure":
113
+ "Petición de acceso: fallo de procesamiento",
114
+ "subscriptions.events.grant_request_status_process_end":
115
+ "Petición de acceso: inicio de proceso (procesando)",
116
+ "subscriptions.events.grant_request_status_process_start":
117
+ "Petición de acceso: fin de proceso (procesado)",
103
118
  "subscriptions.events.implementation_created": "Implementación creada",
104
119
  "subscriptions.events.implementation_status_updated":
105
120
  "Estado de implementación actualizada",
@@ -63,6 +63,14 @@ export const DOMAIN_EVENTS = [
63
63
  ...STRUCTURE_EVENTS,
64
64
  "grant_created",
65
65
  "grant_deleted",
66
+ "grant_request_approval_addition",
67
+ "grant_request_approval_consensus",
68
+ "grant_request_rejection",
69
+ "grant_request_group_creation",
70
+ "grant_request_status_process_start",
71
+ "grant_request_status_process_end",
72
+ "grant_request_status_cancellation",
73
+ "grant_request_status_failure",
66
74
  "ingest_sent_for_approval",
67
75
  ];
68
76