@truedat/dd 4.33.3 → 4.33.8

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 (34) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/package.json +6 -6
  3. package/src/api.js +4 -0
  4. package/src/components/GraphLoader.js +21 -6
  5. package/src/components/LineageEvents.js +23 -0
  6. package/src/components/LineageEventsTable.js +94 -0
  7. package/src/components/LineageForm.js +2 -1
  8. package/src/components/LineageGraph.js +62 -11
  9. package/src/components/LineageRoutes.js +9 -7
  10. package/src/components/StructuresBulkUpdate.js +23 -9
  11. package/src/components/StructuresRoutes.js +7 -0
  12. package/src/components/__tests__/LineageEventsTable.spec.js +39 -0
  13. package/src/components/__tests__/StructuresBulkUpdate.spec.js +2 -0
  14. package/src/components/__tests__/__snapshots__/LineageEventsTable.spec.js.snap +90 -0
  15. package/src/components/__tests__/__snapshots__/LineageRoutes.spec.js.snap +4 -0
  16. package/src/messages/en.js +18 -0
  17. package/src/messages/es.js +19 -0
  18. package/src/reducers/__tests__/graphLoading.spec.js +2 -2
  19. package/src/reducers/__tests__/lineageEventsLoading.spec.js +26 -0
  20. package/src/reducers/graph.js +4 -1
  21. package/src/reducers/graphLoading.js +8 -4
  22. package/src/reducers/graphRedirect.js +1 -2
  23. package/src/reducers/index.js +4 -0
  24. package/src/reducers/lineageEvents.js +13 -0
  25. package/src/reducers/lineageEventsLoading.js +14 -0
  26. package/src/routines.js +3 -0
  27. package/src/sagas/__tests__/createGraph.spec.js +162 -13
  28. package/src/sagas/createGraph.js +100 -7
  29. package/src/sagas/fetchGraph.js +1 -0
  30. package/src/sagas/fetchLineageEvents.js +26 -0
  31. package/src/sagas/index.js +6 -0
  32. package/src/selectors/getLineageEventColumns.js +48 -0
  33. package/src/styles/lineageGraph.less +3 -0
  34. package/src/components/StructuresUpdateButton.js +0 -45
@@ -1,4 +1,5 @@
1
1
  import { bulkUpdateStructuresRequestsSaga } from "./bulkUpdateStructures";
2
+ //import { cancelPollRequestSaga } from "./cancelPoll";
2
3
  import { createGrantRequestApprovalRequestSaga } from "./createGrantRequestApproval";
3
4
  import { createGraphRequestSaga } from "./createGraph";
4
5
  import { createProfileGroupRequestSaga } from "./createProfileGroup";
@@ -19,6 +20,7 @@ import { fetchGrantsRequestSaga } from "./fetchGrants";
19
20
  import { fetchGrantRequestRequestSaga } from "./fetchGrantRequest";
20
21
  import { fetchGrantRequestsRequestSaga } from "./fetchGrantRequests";
21
22
  import { fetchGraphRequestSaga } from "./fetchGraph";
23
+ import { fetchLineageEventsRequestSaga } from "./fetchLineageEvents";
22
24
  import { fetchLinksStructureTagsRequestSaga } from "./fetchLinksStructureTags";
23
25
  import { fetchNodesRequestSaga } from "./fetchNodes";
24
26
  import { fetchProfileExecutionRequestSaga } from "./fetchProfileExecution";
@@ -48,6 +50,7 @@ import { operateGrantRequestToCartRequestSaga } from "./operateGrantRequestCart"
48
50
 
49
51
  export {
50
52
  bulkUpdateStructuresRequestsSaga,
53
+ //cancelPollRequestSaga,
51
54
  createGrantRequestApprovalRequestSaga,
52
55
  createGraphRequestSaga,
53
56
  createProfileGroupRequestSaga,
@@ -68,6 +71,7 @@ export {
68
71
  fetchGrantRequestRequestSaga,
69
72
  fetchGrantRequestsRequestSaga,
70
73
  fetchGraphRequestSaga,
74
+ fetchLineageEventsRequestSaga,
71
75
  fetchLinksStructureTagsRequestSaga,
72
76
  fetchNodesRequestSaga,
73
77
  fetchProfileExecutionRequestSaga,
@@ -98,6 +102,7 @@ export {
98
102
 
99
103
  export default [
100
104
  bulkUpdateStructuresRequestsSaga(),
105
+ //cancelPollRequestSaga(),
101
106
  createGrantRequestApprovalRequestSaga(),
102
107
  createGraphRequestSaga(),
103
108
  createProfileGroupRequestSaga(),
@@ -118,6 +123,7 @@ export default [
118
123
  fetchGrantRequestRequestSaga(),
119
124
  fetchGrantRequestsRequestSaga(),
120
125
  fetchGraphRequestSaga(),
126
+ fetchLineageEventsRequestSaga(),
121
127
  fetchLinksStructureTagsRequestSaga(),
122
128
  fetchNodesRequestSaga(),
123
129
  fetchProfileExecutionRequestSaga(),
@@ -0,0 +1,48 @@
1
+ import _ from "lodash/fp";
2
+ import React from "react";
3
+ import { FormattedMessage } from "react-intl";
4
+ import Moment from "react-moment";
5
+
6
+ const dateDecorator = (date) =>
7
+ date && <Moment locale="es" date={date} format="YYYY-MM-DD HH:mm" />;
8
+
9
+ const statusDecorator = (status) => (
10
+ <FormattedMessage id={`lineage.graph.status.${_.toLower(status)}`} />
11
+ );
12
+
13
+ const graphDataDecorator = (graphData) => <span>{graphData}</span>;
14
+
15
+ const customLineageEventColumns = null;
16
+ const defaultLineageEventColumns = [
17
+ {
18
+ name: "graph_data",
19
+ fieldSelector: (event) => {
20
+ const graphData = _.get("graph_data")(event);
21
+ try {
22
+ return JSON.parse(graphData).join("\n");
23
+ } catch (e) {
24
+ return graphData;
25
+ }
26
+ },
27
+ fieldDecorator: graphDataDecorator,
28
+ width: 2,
29
+ },
30
+ {
31
+ name: "status",
32
+ fieldDecorator: statusDecorator,
33
+ width: 2,
34
+ },
35
+ {
36
+ name: "message",
37
+ width: 2,
38
+ },
39
+ {
40
+ name: "inserted_at",
41
+ fieldDecorator: dateDecorator,
42
+ textAlign: "center",
43
+ width: 2,
44
+ },
45
+ ];
46
+
47
+ export const lineageEventColumns =
48
+ customLineageEventColumns || defaultLineageEventColumns;
@@ -0,0 +1,3 @@
1
+ .graph-hash {
2
+ font-family: monospace;
3
+ }
@@ -1,45 +0,0 @@
1
- import React from "react";
2
- import PropTypes from "prop-types";
3
- import { connect } from "react-redux";
4
- import { Button, Popup } from "semantic-ui-react";
5
- import { Link } from "react-router-dom";
6
- import { FormattedMessage } from "react-intl";
7
- import { useAuthorized } from "@truedat/core/hooks";
8
- import { STRUCTURES_BULK_UPDATE } from "@truedat/core/routes";
9
- import { bulkUpdateDisabledSelector } from "../selectors";
10
-
11
- export const StructuresUpdateButton = ({ disabled, canAutoPublish }) => {
12
- const authorized = useAuthorized();
13
-
14
- return authorized ? (
15
- <Popup
16
- content={<FormattedMessage id="structures.actions.bulk_update.popup" />}
17
- position="top right"
18
- trigger={
19
- <span className="button-update">
20
- <Link
21
- className={`ui secondary button ${disabled ? "disabled" : ""}`}
22
- role="button"
23
- to={{
24
- pathname: STRUCTURES_BULK_UPDATE,
25
- state: { canAutoPublish },
26
- }}
27
- >
28
- <FormattedMessage id="actions.update" />
29
- </Link>
30
- </span>
31
- }
32
- />
33
- ) : null;
34
- };
35
-
36
- StructuresUpdateButton.propTypes = {
37
- disabled: PropTypes.bool,
38
- canAutoPublish: PropTypes.bool,
39
- };
40
-
41
- const mapStateToProps = (state) => ({
42
- disabled: bulkUpdateDisabledSelector(state),
43
- });
44
-
45
- export default connect(mapStateToProps)(StructuresUpdateButton);