@truedat/dd 4.33.7 → 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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## [4.33.8] 2021-11-29
4
+
5
+ ### Fixed
6
+
7
+ - [TD-4353] Fix Bulk update
8
+
3
9
  ## [4.33.5] 2021-11-28
4
10
 
5
11
  ### Added
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@truedat/dd",
3
- "version": "4.33.7",
3
+ "version": "4.33.8",
4
4
  "description": "Truedat Web Data Dictionary",
5
5
  "sideEffects": false,
6
6
  "jsnext:main": "src/index.js",
@@ -34,7 +34,7 @@
34
34
  "@testing-library/jest-dom": "^5.14.1",
35
35
  "@testing-library/react": "^12.0.0",
36
36
  "@testing-library/user-event": "^13.2.1",
37
- "@truedat/test": "4.33.7",
37
+ "@truedat/test": "4.33.8",
38
38
  "babel-jest": "^27.0.6",
39
39
  "babel-plugin-dynamic-import-node": "^2.3.3",
40
40
  "babel-plugin-lodash": "^3.3.4",
@@ -84,9 +84,9 @@
84
84
  ]
85
85
  },
86
86
  "dependencies": {
87
- "@truedat/auth": "4.33.7",
88
- "@truedat/core": "4.33.7",
89
- "@truedat/df": "4.33.7",
87
+ "@truedat/auth": "4.33.8",
88
+ "@truedat/core": "4.33.8",
89
+ "@truedat/df": "4.33.8",
90
90
  "lodash": "^4.17.21",
91
91
  "path-to-regexp": "^1.7.0",
92
92
  "prop-types": "^15.7.2",
@@ -107,5 +107,5 @@
107
107
  "react-dom": ">= 16.8.6 < 17",
108
108
  "semantic-ui-react": ">= 0.88.2 < 2.1"
109
109
  },
110
- "gitHead": "417ace837309731f004f2d56371df420e82a4380"
110
+ "gitHead": "14e8164b15d17c5d25ebd0296b6a9899b32dff1d"
111
111
  }
@@ -9,7 +9,7 @@ import { fetchGraph, clearGraph, cancelPoll } from "../routines";
9
9
  export const GraphLoader = ({ clearGraph, fetchGraph, graph, cancelPoll }) => {
10
10
  const match = useRouteMatch(GRAPH);
11
11
  const id = _.path("params.id")(match);
12
-
12
+
13
13
  const history = useHistory();
14
14
 
15
15
  useEffect(() => {
@@ -26,7 +26,7 @@ export const GraphLoader = ({ clearGraph, fetchGraph, graph, cancelPoll }) => {
26
26
  fetchGraph({ id });
27
27
  }
28
28
  }
29
- }, [/*graph, *//*fetchGraph,*/ id]);
29
+ }, [/*graph, */ /*fetchGraph,*/ id]);
30
30
 
31
31
  useEffect(() => {
32
32
  return () => {
@@ -52,4 +52,3 @@ const mapStateToProps = ({ graph }) => ({ graph });
52
52
  export default connect(mapStateToProps, { clearGraph, fetchGraph, cancelPoll })(
53
53
  GraphLoader
54
54
  );
55
-
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  import { Header, Icon, Segment, Dimmer, Loader } from "semantic-ui-react";
3
3
  import { FormattedMessage } from "react-intl";
4
- import LineageEventsTable from "./LineageEventsTable"
4
+ import LineageEventsTable from "./LineageEventsTable";
5
5
 
6
6
  export const LineageEvents = () => (
7
7
  <Segment>
@@ -3,7 +3,7 @@ import React, { useEffect } from "react";
3
3
  import PropTypes from "prop-types";
4
4
  import { FormattedMessage } from "react-intl";
5
5
  import { Header, Icon, Table } from "semantic-ui-react";
6
- import { useHistory, } from "react-router-dom";
6
+ import { useHistory } from "react-router-dom";
7
7
  import { connect } from "react-redux";
8
8
  import { useIntl } from "react-intl";
9
9
  import { columnDecorator } from "@truedat/core/services";
@@ -11,8 +11,11 @@ import { linkTo } from "@truedat/core/routes";
11
11
  import { lineageEventColumns as columns } from "../selectors/getLineageEventColumns";
12
12
  import { fetchLineageEvents } from "../routines";
13
13
 
14
-
15
- export const LineageEventsTable = ({ fetchLineageEvents, lineageEvents, lineageEventsLoading }) => {
14
+ export const LineageEventsTable = ({
15
+ fetchLineageEvents,
16
+ lineageEvents,
17
+ lineageEventsLoading,
18
+ }) => {
16
19
  const { formatMessage } = useIntl();
17
20
  const history = useHistory();
18
21
 
@@ -58,7 +58,7 @@ export const LineageForm = ({
58
58
  _.isNil(levels)
59
59
  ? createGraph({ ids: selectedResources, type })
60
60
  : createGraph({ ids: selectedResources, type, levels });
61
- }
61
+ };
62
62
  const disabled = _.isEmpty(selectedResources);
63
63
  useEffect(() => {
64
64
  setOpen(!graphLoading && _.isEmpty(graph));
@@ -98,7 +98,8 @@ export const LineageGraph = ({
98
98
  id:
99
99
  _.toLower(loadingInfo?.data?.status) === "already_started"
100
100
  ? "lineage.graph.loading.background.existing"
101
- : _.toLower(loadingInfo?.data?.status) === "just_started" &&
101
+ : _.toLower(loadingInfo?.data?.status) ===
102
+ "just_started" &&
102
103
  "lineage.graph.loading.background.launched",
103
104
  })}
104
105
  </p>
@@ -182,4 +183,6 @@ const mapStateToProps = (
182
183
  };
183
184
  };
184
185
 
185
- export default connect(mapStateToProps, { clearNode, cancelPoll })(LineageGraph);
186
+ export default connect(mapStateToProps, { clearNode, cancelPoll })(
187
+ LineageGraph
188
+ );
@@ -3,7 +3,7 @@ import { Route } from "react-router-dom";
3
3
  import { Unauthorized } from "@truedat/core/components";
4
4
  import { useAuthorized } from "@truedat/core/hooks";
5
5
  import { GRAPH, GRAPHS, LINEAGE_EVENTS, SAMPLE } from "@truedat/core/routes";
6
- import LineageEvents from "./LineageEvents"
6
+ import LineageEvents from "./LineageEvents";
7
7
  import LineageGraph from "./LineageGraph";
8
8
  import LineageSample from "./LineageSample";
9
9
  import LineageForm from "./LineageForm";
@@ -15,7 +15,6 @@ import { FormattedMessage } from "react-intl";
15
15
  import { ConfirmModal, HistoryBackButton } from "@truedat/core/components";
16
16
  import { selectTemplate } from "@truedat/df/routines";
17
17
  import { applyTemplateWithoutDefaults } from "@truedat/df/utils";
18
- import { composeProviders } from "redux-saga-test-plan/providers";
19
18
  import { compose } from "redux";
20
19
  import { withRouter } from "react-router-dom";
21
20
  import { bulkUpdateStructures } from "../routines";
@@ -82,7 +81,7 @@ export class StructuresBulkUpdate extends React.Component {
82
81
  template: PropTypes.object,
83
82
  templateId: PropTypes.number,
84
83
  templatesLoaded: PropTypes.bool,
85
- location: PropTypes.object,
84
+ canAutoPublish: PropTypes.bool,
86
85
  };
87
86
 
88
87
  state = initialState;
@@ -123,15 +122,24 @@ export class StructuresBulkUpdate extends React.Component {
123
122
  };
124
123
 
125
124
  render() {
126
- const { loading, template, templateId, structureCount, templatesLoaded } =
127
- this.props;
125
+ const {
126
+ loading,
127
+ template,
128
+ templateId,
129
+ structureCount,
130
+ templatesLoaded,
131
+ canAutoPublish,
132
+ structureActiveFilters,
133
+ } = this.props;
128
134
  const { content } = this.state;
129
135
  const disableAction = !template || _.isEmpty(template);
130
136
 
131
137
  return templatesLoaded ? (
132
138
  <Container as={Segment} text>
133
139
  <TemplateLoader />
134
- {!_.isEmpty(template) && structureCount != 0 ? (
140
+ {!_.isEmpty(template) &&
141
+ structureCount != 0 &&
142
+ _.has("type.raw")(structureActiveFilters) ? (
135
143
  <>
136
144
  <Header as="h2">
137
145
  <Icon name="book" />
@@ -161,10 +169,7 @@ export class StructuresBulkUpdate extends React.Component {
161
169
  />
162
170
  )}
163
171
  <ConfirmModal
164
- actions={actions(
165
- this.handleSubmit,
166
- this.props.location?.state.canAutoPublish
167
- )}
172
+ actions={actions(this.handleSubmit, canAutoPublish)}
168
173
  trigger={
169
174
  <Button
170
175
  primary
@@ -231,6 +236,8 @@ const mapStateToProps = ({
231
236
  structures,
232
237
  structureTypes,
233
238
  structureTypesLoading,
239
+ userDomains,
240
+ structureActiveFilters,
234
241
  }) => {
235
242
  const structure = _.head(structures);
236
243
  const templateId = findTemplate(structureTypes, templates, structure);
@@ -242,6 +249,13 @@ const mapStateToProps = ({
242
249
  structureCount,
243
250
  structureTypesLoaded: !structureTypesLoading,
244
251
  templatesLoaded: !templatesLoading && !_.isEmpty(templates),
252
+ userDomains,
253
+ canAutoPublish: _.any(
254
+ ({ domains, permission }) =>
255
+ !_.isEmpty(domains) &&
256
+ ["publish_structure_note_from_draft"].includes(permission)
257
+ )(userDomains),
258
+ structureActiveFilters,
245
259
  };
246
260
  };
247
261
 
@@ -88,6 +88,13 @@ const AuthorizedRoutes = () => {
88
88
  path={STRUCTURES_BULK_UPDATE}
89
89
  render={() => (
90
90
  <>
91
+ <UserDomainsLoader
92
+ permissions={[
93
+ "publish_structure_note_from_draft",
94
+ "edit_structure_note",
95
+ "create_structure_note",
96
+ ]}
97
+ />
91
98
  <StructureCrumbs
92
99
  name={formatMessage({ id: "structures.bulkUpdate.crumbs.top" })}
93
100
  />
@@ -3,7 +3,6 @@ import { render } from "@truedat/test/render";
3
3
  import { LineageEventsTable } from "../LineageEventsTable";
4
4
  import en from "../../messages/en";
5
5
 
6
-
7
6
  describe("<LineageEventsTable />", () => {
8
7
  const lineageEvents = [
9
8
  {
@@ -17,6 +17,7 @@ describe("<StructuresBulkUpdate />", () => {
17
17
  templatesLoaded: true,
18
18
  structureTypes: [{ name: "doc", template_id: 1 }],
19
19
  structureTypesLoaded: true,
20
+ structureActiveFilters: { "type.raw": "booo" },
20
21
  };
21
22
 
22
23
  it("matches the latest snapshot", () => {
@@ -136,6 +137,7 @@ describe("<StructuresBulkUpdate />", () => {
136
137
  selectedDomain: { id: 1 },
137
138
  templatesLoaded: true,
138
139
  bulkUpdateStructures: jest.fn(),
140
+ structureActiveFilters: { "type.raw": "booo" },
139
141
  };
140
142
  const wrapper = shallow(<StructuresBulkUpdate {...props} />);
141
143
  wrapper.setState({
@@ -9,13 +9,15 @@ describe("reducers: lineageEventsLoading", () => {
9
9
  });
10
10
 
11
11
  it("returns to initial state on fetchLineageEvents.FULFILL action", () => {
12
- expect(lineageEventsLoading(fooState, { type: fetchLineageEvents.FULFILL })).toBe(
13
- false
14
- );
12
+ expect(
13
+ lineageEventsLoading(fooState, { type: fetchLineageEvents.FULFILL })
14
+ ).toBe(false);
15
15
  });
16
16
 
17
17
  it("returns true on fetchLineageEvents.REQUEST action", () => {
18
- expect(lineageEventsLoading(fooState, { type: fetchLineageEvents.REQUEST })).toBe(true);
18
+ expect(
19
+ lineageEventsLoading(fooState, { type: fetchLineageEvents.REQUEST })
20
+ ).toBe(true);
19
21
  });
20
22
 
21
23
  it("should ignore unhandled actions", () => {
@@ -4,7 +4,7 @@ import {
4
4
  clearStructure,
5
5
  fetchGraph,
6
6
  fetchStructure,
7
- createGraph
7
+ createGraph,
8
8
  } from "../routines";
9
9
 
10
10
  export const initialState = {};
@@ -51,7 +51,7 @@ describe("sagas: createGraphRequestSaga", () => {
51
51
  .next()
52
52
  .all([
53
53
  takeLatest(createGraph.TRIGGER, createGraphSaga),
54
- takeLatest(excludeNode.TRIGGER, createGraphSaga)
54
+ takeLatest(excludeNode.TRIGGER, createGraphSaga),
55
55
  ])
56
56
  .finish()
57
57
  .isDone();
@@ -103,7 +103,6 @@ describe("sagas: createGraphSaga", () => {
103
103
  });
104
104
 
105
105
  it("should fork a polling task when uuids are requested and a 202 (accepted) graph hash response is returned. Then, wait for task cancellation.", () => {
106
-
107
106
  expect(() => {
108
107
  testSaga(createGraphSaga)
109
108
  .next()
@@ -221,7 +220,7 @@ describe("generator: polling", () => {
221
220
  .next()
222
221
  .cancelled()
223
222
  .next(true)
224
- .put(createGraph.failure(POLLING_CANCELLED))
223
+ .put(createGraph.failure(POLLING_CANCELLED));
225
224
  }).not.toThrow();
226
225
  });
227
226
  });
@@ -120,6 +120,6 @@ export function* polling(graphAccepted) {
120
120
  export function* createGraphRequestSaga() {
121
121
  yield all([
122
122
  takeLatest(createGraph.TRIGGER, createGraphSaga),
123
- takeLatest(excludeNode.TRIGGER, createGraphSaga)
123
+ takeLatest(excludeNode.TRIGGER, createGraphSaga),
124
124
  ]);
125
125
  }
@@ -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);