@truedat/dd 4.44.4 → 4.44.5

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/dd",
3
- "version": "4.44.4",
3
+ "version": "4.44.5",
4
4
  "description": "Truedat Web Data Dictionary",
5
5
  "sideEffects": false,
6
6
  "jsnext:main": "src/index.js",
@@ -22,20 +22,20 @@
22
22
  "eslint:fix": "eslint --fix src/**"
23
23
  },
24
24
  "devDependencies": {
25
- "@babel/cli": "^7.14.8",
26
- "@babel/core": "^7.15.0",
27
- "@babel/plugin-proposal-class-properties": "^7.14.5",
28
- "@babel/plugin-proposal-object-rest-spread": "^7.14.7",
29
- "@babel/plugin-proposal-optional-chaining": "^7.14.5",
25
+ "@babel/cli": "^7.17.10",
26
+ "@babel/core": "^7.18.0",
27
+ "@babel/plugin-proposal-class-properties": "^7.17.12",
28
+ "@babel/plugin-proposal-object-rest-spread": "^7.18.0",
29
+ "@babel/plugin-proposal-optional-chaining": "^7.17.12",
30
30
  "@babel/plugin-syntax-dynamic-import": "^7.8.3",
31
- "@babel/plugin-transform-modules-commonjs": "^7.15.0",
32
- "@babel/preset-env": "^7.15.0",
33
- "@babel/preset-react": "^7.14.5",
34
- "@testing-library/jest-dom": "^5.14.1",
31
+ "@babel/plugin-transform-modules-commonjs": "^7.18.0",
32
+ "@babel/preset-env": "^7.18.0",
33
+ "@babel/preset-react": "^7.17.12",
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.44.4",
38
- "babel-jest": "^27.0.6",
37
+ "@truedat/test": "4.44.5",
38
+ "babel-jest": "^28.1.0",
39
39
  "babel-plugin-dynamic-import-node": "^2.3.3",
40
40
  "babel-plugin-lodash": "^3.3.4",
41
41
  "babel-plugin-react-intl": "^5.1.18",
@@ -44,7 +44,8 @@
44
44
  "enzyme-adapter-react-16": "^1.15.6",
45
45
  "enzyme-to-json": "^3.6.2",
46
46
  "identity-obj-proxy": "^3.0.0",
47
- "jest": "^27.0.6",
47
+ "jest": "^28.1.0",
48
+ "jest-environment-jsdom": "^28.1.0",
48
49
  "react": "^16.14.0",
49
50
  "react-dom": "^16.14.0",
50
51
  "redux-saga-test-plan": "^4.0.4",
@@ -52,6 +53,8 @@
52
53
  "semantic-ui-react": "^2.0.3"
53
54
  },
54
55
  "jest": {
56
+ "maxWorkers": "50%",
57
+ "testTimeout": 10000,
55
58
  "moduleDirectories": [
56
59
  "<rootDir>/src",
57
60
  "../../node_modules"
@@ -84,15 +87,16 @@
84
87
  ]
85
88
  },
86
89
  "dependencies": {
87
- "@truedat/auth": "4.44.4",
88
- "@truedat/core": "4.44.4",
89
- "@truedat/df": "4.44.4",
90
+ "@apollo/client": "^3.6.4",
91
+ "@truedat/auth": "4.44.5",
92
+ "@truedat/core": "4.44.5",
93
+ "@truedat/df": "4.44.5",
90
94
  "lodash": "^4.17.21",
91
95
  "path-to-regexp": "^1.7.0",
92
- "prop-types": "^15.7.2",
96
+ "prop-types": "^15.8.1",
93
97
  "react-hook-form": "^7.30.0",
94
98
  "react-intl": "^5.20.10",
95
- "react-moment": "^0.9.7",
99
+ "react-moment": "^1.1.2",
96
100
  "react-redux": "^7.2.4",
97
101
  "react-router-dom": "^5.2.0",
98
102
  "react-vis": "^1.11.7",
@@ -107,5 +111,5 @@
107
111
  "react-dom": ">= 16.8.6 < 17",
108
112
  "semantic-ui-react": ">= 0.88.2 < 2.1"
109
113
  },
110
- "gitHead": "36fb183e1d22181e6a15b3bac2c01b39214eacdb"
114
+ "gitHead": "5a339468198c803592b285eddd0dd0c0b0eced93"
111
115
  }
@@ -15,7 +15,7 @@ export const EditDomainPopup = ({ userPermissions, saving, text }) => {
15
15
  }
16
16
  }, [saving]);
17
17
 
18
- return userPermissions.update && userPermissions.update_domain ? (
18
+ return userPermissions?.update && userPermissions?.update_domain ? (
19
19
  <Popup
20
20
  on="click"
21
21
  basic
@@ -1,13 +1,9 @@
1
- import React from "react";
2
1
  import { connect } from "react-redux";
3
2
  import { bindActionCreators } from "redux";
3
+ import { AvailableFilters } from "@truedat/core/components";
4
4
  import { addGrantFilter, resetGrantFilters } from "../routines";
5
5
  import { getGrantAvailableFilters } from "../selectors";
6
6
 
7
- const AvailableFilters = React.lazy(() =>
8
- import("@truedat/core/components/AvailableFilters")
9
- );
10
-
11
7
  const mapStateToProps = (state) => {
12
8
  return {
13
9
  filters: getGrantAvailableFilters(state),
@@ -45,7 +45,7 @@ export const PendingStructureNotes = ({ systems }) => {
45
45
  });
46
46
  const { loading, error, data } = useQuery(STRUCTURE_NOTES, {
47
47
  variables: { filter },
48
- fetchPolicy: "network-only",
48
+ fetchPolicy: "cache-and-network",
49
49
  });
50
50
  const items = loading || error ? [] : data?.structure_notes;
51
51
  const { control } = useForm({
@@ -34,7 +34,7 @@ export class StructureConfidentialButton extends React.Component {
34
34
  userPermissions,
35
35
  } = this.props;
36
36
 
37
- if (!userPermissions.confidential || !userPermissions.update) return null;
37
+ if (!userPermissions?.confidential || !userPermissions?.update) return null;
38
38
 
39
39
  const buttonText = structure.confidential
40
40
  ? formatMessage({ id: "structure.mark_as_public" })
@@ -1,13 +1,9 @@
1
- import React from "react";
2
1
  import { bindActionCreators } from "redux";
3
2
  import { connect } from "react-redux";
3
+ import { AvailableFilters } from "@truedat/core/components";
4
4
  import { addStructureFilter, resetStructureFilters } from "../routines";
5
5
  import { getStructureAvailableFilters } from "../selectors";
6
6
 
7
- const AvailableFilters = React.lazy(() =>
8
- import("@truedat/core/components/AvailableFilters")
9
- );
10
-
11
7
  const mapStateToProps = (state) => ({
12
8
  filters: getStructureAvailableFilters(state),
13
9
  disabled: state.structureFiltersLoading,
@@ -5,7 +5,7 @@ import { connect } from "react-redux";
5
5
  import { Button, Form, Segment } from "semantic-ui-react";
6
6
  import { useIntl } from "react-intl";
7
7
  import { HistoryBackButton } from "@truedat/core/components";
8
- import { selectTemplate, selectDomain } from "@truedat/df/routines";
8
+ import { selectTemplate, selectDomains } from "@truedat/df/routines";
9
9
  import { applyTemplate, validateContent } from "@truedat/df/utils";
10
10
  import { doStructureNoteAction } from "../routines";
11
11
  import { getLatestDfContent } from "../selectors/getSortedStructureNotes";
@@ -24,16 +24,16 @@ export const StructureNotesEdit = ({
24
24
  template,
25
25
  doStructureNoteAction,
26
26
  selectTemplate,
27
- selectDomain,
27
+ selectDomains,
28
28
  structureNotes,
29
29
  latestDfContent,
30
30
  }) => {
31
31
  const [content, setContent] = useState(latestDfContent);
32
32
 
33
33
  useEffect(() => {
34
- selectDomain({ id: structure.domain_id });
34
+ selectDomains(structure.domain_ids);
35
35
  if (template) selectTemplate(template);
36
- }, [template, structure, selectTemplate, selectDomain]);
36
+ }, [template, structure, selectTemplate, selectDomains]);
37
37
 
38
38
  useEffect(() => {
39
39
  if (template && latestDfContent) {
@@ -90,7 +90,7 @@ StructureNotesEdit.propTypes = {
90
90
  template: PropTypes.object,
91
91
  doStructureNoteAction: PropTypes.func,
92
92
  selectTemplate: PropTypes.func,
93
- selectDomain: PropTypes.func,
93
+ selectDomains: PropTypes.func,
94
94
  structureNotes: PropTypes.object,
95
95
  latestDfContent: PropTypes.object,
96
96
  };
@@ -118,6 +118,6 @@ const mapStateToProps = (state) => {
118
118
 
119
119
  export default connect(mapStateToProps, {
120
120
  selectTemplate,
121
- selectDomain,
121
+ selectDomains,
122
122
  doStructureNoteAction,
123
123
  })(StructureNotesEdit);
@@ -21,7 +21,10 @@ export const StructureProperties = ({ properties, structure }) => {
21
21
  <Item>
22
22
  <Item.Content>
23
23
  <Item.Header as="h5">
24
- <FormattedMessage id={`structure.${property.name}`} />
24
+ <FormattedMessage
25
+ id={`structure.${property.name}`}
26
+ defaultMessage={property.name}
27
+ />
25
28
  </Item.Header>
26
29
  <Item.Description>
27
30
  {columnDecorator(property)(structure)}
@@ -6,7 +6,7 @@ import { List } from "semantic-ui-react";
6
6
  import Moment from "react-moment";
7
7
  import { linkTo } from "@truedat/core/routes";
8
8
 
9
- const dateDecorator = date => (
9
+ const dateDecorator = (date) => (
10
10
  <Moment locale="es" date={date} format="YYYY-MM-DD HH:mm" />
11
11
  );
12
12
 
@@ -30,7 +30,7 @@ export const StructureVersionListItem = ({ id, version, inserted_at }) => (
30
30
  StructureVersionListItem.propTypes = {
31
31
  id: PropTypes.number,
32
32
  version: PropTypes.number,
33
- inserted_at: PropTypes.string
33
+ inserted_at: PropTypes.string,
34
34
  };
35
35
 
36
36
  export default StructureVersionListItem;
@@ -1,14 +1,14 @@
1
1
  import React from "react";
2
- import { shallowWithIntl } from "@truedat/test/intl-stub";
2
+ import { render } from "@truedat/test/render";
3
3
  import { LineageRoutes } from "../LineageRoutes";
4
4
 
5
5
  jest.mock("@truedat/core/hooks", () => ({
6
- useAuthorized: jest.fn(() => true)
6
+ useAuthorized: jest.fn(() => true),
7
7
  }));
8
8
 
9
9
  describe("<LineageRoutes />", () => {
10
10
  it("matches the latest snapshot", () => {
11
- const wrapper = shallowWithIntl(<LineageRoutes />);
12
- expect(wrapper).toMatchSnapshot();
11
+ const { container } = render(<LineageRoutes />);
12
+ expect(container).toMatchSnapshot();
13
13
  });
14
14
  });
@@ -1,45 +1,41 @@
1
1
  import React from "react";
2
- import { shallowWithIntl } from "@truedat/test/intl-stub";
3
- import { StructureConfidentialButton } from "../StructureConfidentialButton";
2
+ import { render } from "@truedat/test/render";
3
+ import StructureConfidentialButton from "../StructureConfidentialButton";
4
4
 
5
5
  describe("<StructureConfidentialButton />", () => {
6
- const updateStructure = jest.fn();
7
- const props = {
6
+ const state = {
8
7
  structure: { id: 1, confidential: false },
9
8
  structureUpdating: false,
10
- updateStructure: updateStructure,
11
9
  userPermissions: {
12
10
  update: true,
13
- confidential: true
14
- }
11
+ confidential: true,
12
+ },
15
13
  };
14
+
16
15
  it("matches the latest snapshot", () => {
17
- const wrapper = shallowWithIntl(<StructureConfidentialButton {...props} />);
18
- expect(wrapper).toMatchSnapshot();
16
+ const { container } = render(<StructureConfidentialButton />, { state });
17
+ expect(container).toMatchSnapshot();
19
18
  });
20
- it("matches snapshot without permission", () => {
21
- const props_no_update = {
22
- ...props,
23
- userPermissions: {
24
- update: false,
25
- confidential: true
26
- }
19
+
20
+ it("matches snapshot without update permission", () => {
21
+ const userPermissions = {
22
+ update: false,
23
+ confidential: true,
27
24
  };
28
- const wrapper_update = shallowWithIntl(
29
- <StructureConfidentialButton {...props_no_update} />
30
- );
31
- expect(wrapper_update).toMatchSnapshot();
25
+ const { container } = render(<StructureConfidentialButton />, {
26
+ state: { ...state, userPermissions },
27
+ });
28
+ expect(container).toMatchSnapshot();
29
+ });
32
30
 
33
- const props_no_confidential = {
34
- ...props,
35
- userPermissions: {
36
- update: true,
37
- confidential: false
38
- }
31
+ it("matches snapshot without confidential permission", () => {
32
+ const userPermissions = {
33
+ update: true,
34
+ confidential: false,
39
35
  };
40
- const wrapper_confidential = shallowWithIntl(
41
- <StructureConfidentialButton {...props_no_confidential} />
42
- );
43
- expect(wrapper_confidential).toMatchSnapshot();
36
+ const { container } = render(<StructureConfidentialButton />, {
37
+ state: { ...state, userPermissions },
38
+ });
39
+ expect(container).toMatchSnapshot();
44
40
  });
45
41
  });
@@ -5,15 +5,6 @@ import { render } from "@truedat/test/render";
5
5
  import { applyTemplate } from "@truedat/df/utils";
6
6
  import { StructureNotesEdit } from "../StructureNotesEdit";
7
7
 
8
- const DynamicForm = () => <div>DynamicForm</div>;
9
- const TemplateLoader = () => <div>TemplateLoader</div>;
10
-
11
- jest.mock("@truedat/df/components/DynamicForm", () => DynamicForm);
12
- jest.mock(
13
- "@truedat/df/templates/components/TemplateLoader",
14
- () => TemplateLoader
15
- );
16
-
17
8
  describe("<StructureNotesEdit />", () => {
18
9
  it("matches the latest snapshot", () => {
19
10
  const props = {
@@ -27,6 +18,7 @@ describe("<StructureNotesEdit />", () => {
27
18
  },
28
19
  latestDfContent: { foo: "bar" },
29
20
  applyTemplate: applyTemplate({ id: 2 }),
21
+ selectDomains: jest.fn(),
30
22
  };
31
23
  const { container } = render(
32
24
  <Suspense fallback={null}>
@@ -65,6 +57,7 @@ describe("<StructureNotesEdit />", () => {
65
57
  },
66
58
  latestDfContent: { foo: "bar" },
67
59
  applyTemplate: applyTemplate(template),
60
+ selectDomains: jest.fn(),
68
61
  };
69
62
 
70
63
  const { findByText } = render(
@@ -1,22 +1,20 @@
1
1
  import React from "react";
2
- import { shallowWithIntl } from "@truedat/test/intl-stub";
3
- import { StructureProperties, mapStateToProps } from "../StructureProperties";
2
+ import { render } from "@truedat/test/render";
3
+ import StructureProperties from "../StructureProperties";
4
4
 
5
5
  describe("<StructureProperties />", () => {
6
6
  it("matches the latest snapshot", () => {
7
7
  const structure = { description: "dd", group: "gp" };
8
8
  const state = { structure };
9
- const props = mapStateToProps(state);
10
- const wrapper = shallowWithIntl(<StructureProperties {...props} />);
11
- expect(wrapper).toMatchSnapshot();
9
+ const { container } = render(<StructureProperties />, { state });
10
+ expect(container).toMatchSnapshot();
12
11
  });
13
12
 
14
13
  it("matches the latest snapshot (custom structureProperties)", () => {
15
14
  const structure = { metadata: { foo: "bar" } };
16
15
  const structureProperties = [{ name: "metadata.foo" }];
17
16
  const state = { structure, structureProperties };
18
- const props = mapStateToProps(state);
19
- const wrapper = shallowWithIntl(<StructureProperties {...props} />);
20
- expect(wrapper).toMatchSnapshot();
17
+ const { container } = render(<StructureProperties />, { state });
18
+ expect(container).toMatchSnapshot();
21
19
  });
22
20
  });
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
- import { shallowWithIntl } from "@truedat/test/intl-stub";
3
- import { StructureVersionListItem } from "../StructureVersionListItem";
2
+ import { render } from "@truedat/test/render";
3
+ import StructureVersionListItem from "../StructureVersionListItem";
4
4
 
5
5
  describe("<StructureVersionListItem />", () => {
6
6
  it("matches the latest snapshot", () => {
@@ -11,7 +11,7 @@ describe("<StructureVersionListItem />", () => {
11
11
  const inserted_at = "2018-01-01T01:01:01.123456Z";
12
12
  const props = { id, version, inserted_at, history };
13
13
 
14
- const wrapper = shallowWithIntl(<StructureVersionListItem {...props} />);
15
- expect(wrapper).toMatchSnapshot();
14
+ const { container } = render(<StructureVersionListItem {...props} />);
15
+ expect(container).toMatchSnapshot();
16
16
  });
17
17
  });
@@ -1,22 +1,3 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`<LineageRoutes /> matches the latest snapshot 1`] = `
4
- <Fragment>
5
- <Route
6
- path="/graphs"
7
- render={[Function]}
8
- />
9
- <Route
10
- path="/graphs/:id"
11
- render={[Function]}
12
- />
13
- <Route
14
- path="/lineage_events"
15
- render={[Function]}
16
- />
17
- <Route
18
- path="/sample"
19
- render={[Function]}
20
- />
21
- </Fragment>
22
- `;
3
+ exports[`<LineageRoutes /> matches the latest snapshot 1`] = `<div />`;
@@ -12,7 +12,7 @@ exports[`<Event /> matches the latest snapshot 1`] = `
12
12
  />
13
13
  <FeedContent
14
14
  date={
15
- <t
15
+ <n
16
16
  ago={false}
17
17
  calendar={false}
18
18
  date="2019-09-20 17:01:00"
@@ -27,6 +27,7 @@ exports[`<Event /> matches the latest snapshot 1`] = `
27
27
  onChange={[Function]}
28
28
  titleFormat=""
29
29
  toNow={false}
30
+ trim={false}
30
31
  unit={null}
31
32
  unix={false}
32
33
  utc={false}
@@ -1,40 +1,20 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`<StructureConfidentialButton /> matches snapshot without permission 1`] = `""`;
3
+ exports[`<StructureConfidentialButton /> matches snapshot without confidential permission 1`] = `<div />`;
4
4
 
5
- exports[`<StructureConfidentialButton /> matches snapshot without permission 2`] = `""`;
5
+ exports[`<StructureConfidentialButton /> matches snapshot without update permission 1`] = `<div />`;
6
6
 
7
7
  exports[`<StructureConfidentialButton /> matches the latest snapshot 1`] = `
8
- <Popup
9
- content="structure.mark_as_confidential"
10
- disabled={false}
11
- eventsEnabled={true}
12
- on={
13
- Array [
14
- "click",
15
- "hover",
16
- ]
17
- }
18
- pinned={false}
19
- popperModifiers={Array []}
20
- position="top center"
21
- trigger={
22
- <span>
23
- <Button
24
- as="button"
25
- basic={true}
26
- className="structureButton"
27
- icon={
28
- <Icon
29
- as="i"
30
- className=""
31
- name="lock open"
32
- />
33
- }
34
- loading={false}
35
- onClick={[Function]}
8
+ <div>
9
+ <span>
10
+ <button
11
+ class="ui basic icon button structureButton"
12
+ >
13
+ <i
14
+ aria-hidden="true"
15
+ class="lock open icon"
36
16
  />
37
- </span>
38
- }
39
- />
17
+ </button>
18
+ </span>
19
+ </div>
40
20
  `;
@@ -1,96 +1,101 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
3
  exports[`<StructureProperties /> matches the latest snapshot (custom structureProperties) 1`] = `
4
- <Fragment>
4
+ <div>
5
5
  <p
6
- className="item-description"
6
+ class="item-description"
7
7
  />
8
- <Grid
9
- className="structure-properties"
10
- columns={5}
11
- divided={true}
8
+ <div
9
+ class="ui divided five column grid structure-properties"
12
10
  >
13
- <GridRow
14
- key="0"
11
+ <div
12
+ class="row"
15
13
  >
16
- <GridColumn
17
- key="0"
18
- width={3}
14
+ <div
15
+ class="three wide column"
19
16
  >
20
- <Item>
21
- <ItemContent>
22
- <ItemHeader
23
- as="h5"
17
+ <div
18
+ class="item"
19
+ >
20
+ <div
21
+ class="content"
22
+ >
23
+ <h5
24
+ class="header"
25
+ >
26
+ metadata.foo
27
+ </h5>
28
+ <div
29
+ class="description"
24
30
  >
25
- <MemoizedFormattedMessage
26
- id="structure.metadata.foo"
27
- />
28
- </ItemHeader>
29
- <ItemDescription>
30
31
  bar
31
- </ItemDescription>
32
- </ItemContent>
33
- </Item>
34
- </GridColumn>
35
- </GridRow>
36
- </Grid>
37
- </Fragment>
32
+ </div>
33
+ </div>
34
+ </div>
35
+ </div>
36
+ </div>
37
+ </div>
38
+ </div>
38
39
  `;
39
40
 
40
41
  exports[`<StructureProperties /> matches the latest snapshot 1`] = `
41
- <Fragment>
42
+ <div>
42
43
  <p
43
- className="item-description"
44
+ class="item-description"
44
45
  >
45
46
  dd
46
47
  </p>
47
- <Grid
48
- className="structure-properties"
49
- columns={5}
50
- divided={true}
48
+ <div
49
+ class="ui divided five column grid structure-properties"
51
50
  >
52
- <GridRow
53
- key="0"
51
+ <div
52
+ class="row"
54
53
  >
55
- <GridColumn
56
- key="0"
57
- width={3}
54
+ <div
55
+ class="three wide column"
58
56
  >
59
- <Item>
60
- <ItemContent>
61
- <ItemHeader
62
- as="h5"
57
+ <div
58
+ class="item"
59
+ >
60
+ <div
61
+ class="content"
62
+ >
63
+ <h5
64
+ class="header"
65
+ >
66
+ Domain
67
+ </h5>
68
+ <div
69
+ class="description"
63
70
  >
64
- <MemoizedFormattedMessage
65
- id="structure.domain"
66
- />
67
- </ItemHeader>
68
- <ItemDescription>
69
- <Connect(EditDomainPopup) />
70
- </ItemDescription>
71
- </ItemContent>
72
- </Item>
73
- </GridColumn>
74
- <GridColumn
75
- key="1"
76
- width={3}
71
+
72
+ </div>
73
+ </div>
74
+ </div>
75
+ </div>
76
+ <div
77
+ class="three wide column"
77
78
  >
78
- <Item>
79
- <ItemContent>
80
- <ItemHeader
81
- as="h5"
79
+ <div
80
+ class="item"
81
+ >
82
+ <div
83
+ class="content"
84
+ >
85
+ <h5
86
+ class="header"
87
+ >
88
+ Group
89
+ </h5>
90
+ <div
91
+ class="description"
82
92
  >
83
- <MemoizedFormattedMessage
84
- id="structure.group"
85
- />
86
- </ItemHeader>
87
- <ItemDescription>
88
93
  gp
89
- </ItemDescription>
90
- </ItemContent>
91
- </Item>
92
- </GridColumn>
93
- </GridRow>
94
- </Grid>
95
- </Fragment>
94
+ </div>
95
+ </div>
96
+ </div>
97
+ </div>
98
+ </div>
99
+ </div>
100
+ </div>
96
101
  `;
@@ -1,68 +1,35 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
3
  exports[`<StructureVersionListItem /> matches the latest snapshot 1`] = `
4
- <ListItem
5
- as={
6
- Object {
7
- "$$typeof": Symbol(react.forward_ref),
8
- "displayName": "Link",
9
- "propTypes": Object {
10
- "innerRef": [Function],
11
- "onClick": [Function],
12
- "replace": [Function],
13
- "target": [Function],
14
- "to": [Function],
15
- },
16
- "render": [Function],
17
- }
18
- }
19
- to="/structures/123/versions/42"
20
- >
21
- <ListIcon
22
- name="history"
23
- size="large"
24
- verticalAlign="middle"
25
- />
26
- <ListContent>
27
- <ListHeader>
28
- <MemoizedFormattedMessage
29
- id="structure.version.version"
30
- values={
31
- Object {
32
- "version": 42,
33
- }
34
- }
35
- />
36
- </ListHeader>
37
- <ListDescription>
38
- <MemoizedFormattedMessage
39
- id="structure.version.inserted_at"
40
- values={
41
- Object {
42
- "when": <t
43
- ago={false}
44
- calendar={false}
45
- date="2018-01-01T01:01:01.123456Z"
46
- decimal={false}
47
- element={null}
48
- filter={[Function]}
49
- format="YYYY-MM-DD HH:mm"
50
- fromNow={false}
51
- interval={60000}
52
- local={false}
53
- locale="es"
54
- onChange={[Function]}
55
- titleFormat=""
56
- toNow={false}
57
- unit={null}
58
- unix={false}
59
- utc={false}
60
- withTitle={false}
61
- />,
62
- }
63
- }
64
- />
65
- </ListDescription>
66
- </ListContent>
67
- </ListItem>
4
+ <div>
5
+ <a
6
+ class="item"
7
+ href="/structures/123/versions/42"
8
+ role="listitem"
9
+ >
10
+ <i
11
+ aria-hidden="true"
12
+ class="history large icon middle aligned"
13
+ />
14
+ <div
15
+ class="content"
16
+ >
17
+ <div
18
+ class="header"
19
+ >
20
+ Version 42
21
+ </div>
22
+ <div
23
+ class="description"
24
+ >
25
+ Imported
26
+ <time
27
+ datetime="1514768461123"
28
+ >
29
+ 2018-01-01 01:01
30
+ </time>
31
+ </div>
32
+ </div>
33
+ </a>
34
+ </div>
68
35
  `;
@@ -42,10 +42,7 @@ const impactTabVisible = _.anyPass([_.path("structure.degree.out")]);
42
42
  const parentsTabVisible = _.conformsTo({ parentRelations: notEmpty });
43
43
  const childrenTabVisible = _.conformsTo({ childrenRelations: notEmpty });
44
44
  const eventsTabVisible = _.flow(_.prop("structureVersion"), _.isEmpty);
45
- const grantsTabVisible = _.flow(
46
- _.path("structure.grants"),
47
- _.negate(_.isEmpty)
48
- );
45
+ const grantsTabVisible = _.flow(_.path("structure.grants"), notEmpty);
49
46
 
50
47
  export const getTabVisibility = (state) => ({
51
48
  fields: fieldsTabVisible(state),