@truedat/dd 6.13.7 → 6.14.1

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 (30) hide show
  1. package/package.json +6 -6
  2. package/src/components/Grant.js +7 -1
  3. package/src/components/GrantApprovalRule.js +9 -2
  4. package/src/components/GrantApprovalRules.js +7 -1
  5. package/src/components/GrantRequestHeader.js +7 -1
  6. package/src/components/GrantRequestsSearchResults.js +9 -2
  7. package/src/components/Grants.js +37 -28
  8. package/src/components/LineageEvents.js +26 -18
  9. package/src/components/MyGrantRequests.js +7 -1
  10. package/src/components/PendingStructureNotes.js +9 -2
  11. package/src/components/ReferenceDatasetCreate.js +7 -1
  12. package/src/components/ReferenceDatasetHeader.js +12 -4
  13. package/src/components/ReferenceDatasets.js +7 -1
  14. package/src/components/StructureItem.js +14 -8
  15. package/src/components/StructureType.js +27 -18
  16. package/src/components/StructureTypes.js +24 -15
  17. package/src/components/StructuresGrantRequestView.js +9 -2
  18. package/src/components/StructuresUploadEvents.js +31 -22
  19. package/src/components/StructuresView.js +9 -2
  20. package/src/components/Tag.js +8 -2
  21. package/src/components/Tags.js +8 -2
  22. package/src/components/Task.js +9 -3
  23. package/src/components/Tasks.js +9 -3
  24. package/src/components/__tests__/StructureType.spec.js +19 -4
  25. package/src/components/__tests__/Tag.spec.js +4 -4
  26. package/src/components/__tests__/__snapshots__/ReferenceDatasetCreate.spec.js.snap +1 -1
  27. package/src/components/__tests__/__snapshots__/ReferenceDatasetRoutes.spec.js.snap +1 -1
  28. package/src/components/__tests__/__snapshots__/StructureType.spec.js.snap +85 -21
  29. package/src/components/__tests__/__snapshots__/Tag.spec.js.snap +99 -29
  30. package/src/selectors/utils/decorators.js +6 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@truedat/dd",
3
- "version": "6.13.7",
3
+ "version": "6.14.1",
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.16.5",
35
35
  "@testing-library/react": "^12.0.0",
36
36
  "@testing-library/user-event": "^13.2.1",
37
- "@truedat/test": "6.8.6",
37
+ "@truedat/test": "6.14.1",
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",
@@ -88,9 +88,9 @@
88
88
  },
89
89
  "dependencies": {
90
90
  "@apollo/client": "^3.7.1",
91
- "@truedat/auth": "6.13.7",
92
- "@truedat/core": "6.13.7",
93
- "@truedat/df": "6.13.7",
91
+ "@truedat/auth": "6.14.1",
92
+ "@truedat/core": "6.14.1",
93
+ "@truedat/df": "6.14.1",
94
94
  "lodash": "^4.17.21",
95
95
  "moment": "^2.29.4",
96
96
  "path-to-regexp": "^1.7.0",
@@ -115,5 +115,5 @@
115
115
  "react-dom": ">= 16.8.6 < 17",
116
116
  "semantic-ui-react": ">= 2.0.3 < 2.2"
117
117
  },
118
- "gitHead": "9137d2a416d46886163ac2de4875761d52e6a2e8"
118
+ "gitHead": "13f8e92c333acf539f9978ea94db03174130cfb0"
119
119
  }
@@ -60,7 +60,13 @@ export const GrantHeader = ({ grant, title, actions, onStatusChange }) => {
60
60
  <Grid.Row>
61
61
  <Grid.Column width={12}>
62
62
  <Header as="h2">
63
- <Icon circular name="key" />
63
+ <Icon
64
+ circular
65
+ name={formatMessage({
66
+ id: "grant.header.icon",
67
+ defaultMessage: "key",
68
+ })}
69
+ />
64
70
  <Header.Content>
65
71
  {`${formatMessage({
66
72
  id: "grant.header",
@@ -1,6 +1,6 @@
1
1
  import _ from "lodash/fp";
2
2
  import React from "react";
3
- import { FormattedMessage } from "react-intl";
3
+ import { FormattedMessage, useIntl } from "react-intl";
4
4
  import { useParams } from "react-router-dom";
5
5
  import { useQuery } from "@apollo/client";
6
6
  import {
@@ -20,6 +20,7 @@ import GrantApprovalRuleDeleteButton from "./GrantApprovalRuleDeleteButton";
20
20
 
21
21
  export const GrantApprovalRule = () => {
22
22
  const { id } = useParams();
23
+ const { formatMessage } = useIntl();
23
24
 
24
25
  const { data } = useQuery(GRANT_APPROVAL_RULE_QUERY, {
25
26
  variables: { id },
@@ -37,7 +38,13 @@ export const GrantApprovalRule = () => {
37
38
  <Grid>
38
39
  <Grid.Column width={8}>
39
40
  <Header as="h2">
40
- <Icon circular name="key" />
41
+ <Icon
42
+ circular
43
+ name={formatMessage({
44
+ id: "grant.header.icon",
45
+ defaultMessage: "key",
46
+ })}
47
+ />
41
48
  <Header.Content>
42
49
  <FormattedMessage id="grantApprovalRule.subheader" />
43
50
  </Header.Content>
@@ -37,7 +37,13 @@ export default function GrantApprovalRules() {
37
37
  return (
38
38
  <Segment>
39
39
  <Header as="h2">
40
- <Icon circular name="key" />
40
+ <Icon
41
+ circular
42
+ name={formatMessage({
43
+ id: "grant.header.icon",
44
+ defaultMessage: "key",
45
+ })}
46
+ />
41
47
  <Header.Content>
42
48
  {formatMessage({ id: "grantApprovalRules.header" })}
43
49
  <Header.Subheader>
@@ -27,7 +27,13 @@ export const GrantRequestHeader = ({ grantRequest }) => {
27
27
  <Grid>
28
28
  <Grid.Column width={12}>
29
29
  <Header as="h2">
30
- <Icon circular name="key" />
30
+ <Icon
31
+ circular
32
+ name={formatMessage({
33
+ id: "grant.header.icon",
34
+ defaultMessage: "key",
35
+ })}
36
+ />
31
37
  <Header.Content>
32
38
  {formatMessage({
33
39
  id: grantTypeTranslationId,
@@ -10,7 +10,7 @@ import {
10
10
  GridColumn,
11
11
  GridRow,
12
12
  } from "semantic-ui-react";
13
- import { FormattedMessage } from "react-intl";
13
+ import { FormattedMessage, useIntl } from "react-intl";
14
14
  import SearchWidget from "@truedat/core/search/SearchWidget";
15
15
  import { useSearchContext } from "@truedat/core/search/SearchContext";
16
16
  import Pagination from "@truedat/core/search/Pagination";
@@ -22,6 +22,7 @@ export const GrantRequestsSearchResults = () => {
22
22
  const { searchData, loading, setOnSearchChange, setHiddenFilters } =
23
23
  useSearchContext();
24
24
 
25
+ const { formatMessage } = useIntl();
25
26
  const rolesPermission = _.propOr([], "_permissions")(searchData);
26
27
  const grantRequests = _.propOr([], "data")(searchData);
27
28
  const hasApproveRoles = !_.isEmpty(rolesPermission);
@@ -92,7 +93,13 @@ export const GrantRequestsSearchResults = () => {
92
93
  return (
93
94
  <Segment>
94
95
  <Header as="h2">
95
- <Icon circular name="key" />
96
+ <Icon
97
+ circular
98
+ name={formatMessage({
99
+ id: "grant.header.icon",
100
+ defaultMessage: "key",
101
+ })}
102
+ />
96
103
  <Header.Content>
97
104
  <FormattedMessage id={"grantRequests.header.approve"} />
98
105
  <Header.Subheader>
@@ -2,7 +2,7 @@ import React from "react";
2
2
  import PropTypes from "prop-types";
3
3
  import { connect } from "react-redux";
4
4
  import { Header, Icon, Segment, Dimmer, Loader } from "semantic-ui-react";
5
- import { FormattedMessage } from "react-intl";
5
+ import { FormattedMessage, useIntl } from "react-intl";
6
6
 
7
7
  import GrantDateFilter from "./GrantDateFilter";
8
8
  import GrantsSearch from "./GrantsSearch";
@@ -13,38 +13,47 @@ import GrantsDownloadButton from "./GrantsDownloadButton";
13
13
  import GrantSelectedFilters from "./GrantSelectedFilters";
14
14
  import GrantsPagination from "./GrantsPagination";
15
15
 
16
- export const Grants = ({ grantsLoading, onlyMyGrants }) => (
17
- <Segment>
18
- <Header as="h2">
19
- <Icon circular name="key" />
20
- <Header.Content>
21
- <FormattedMessage
22
- id={onlyMyGrants ? "grants.mine.header" : "grants.header"}
16
+ export const Grants = ({ grantsLoading, onlyMyGrants }) => {
17
+ const { formatMessage } = useIntl();
18
+ return (
19
+ <Segment>
20
+ <Header as="h2">
21
+ <Icon
22
+ circular
23
+ name={formatMessage({
24
+ id: "grant.header.icon",
25
+ defaultMessage: "key",
26
+ })}
23
27
  />
24
- <Header.Subheader>
28
+ <Header.Content>
25
29
  <FormattedMessage
26
- id={onlyMyGrants ? "grants.mine.subheader" : "grants.subheader"}
30
+ id={onlyMyGrants ? "grants.mine.header" : "grants.header"}
27
31
  />
28
- </Header.Subheader>
29
- </Header.Content>
30
- </Header>
32
+ <Header.Subheader>
33
+ <FormattedMessage
34
+ id={onlyMyGrants ? "grants.mine.subheader" : "grants.subheader"}
35
+ />
36
+ </Header.Subheader>
37
+ </Header.Content>
38
+ </Header>
31
39
 
32
- <Segment attached="bottom">
33
- <GrantsDownloadButton onlyMyGrants={onlyMyGrants} hasFilterApplied />
34
- <GrantsSearch />
35
- <GrantSelectedFilters />
36
- <GrantDateFilter />
37
- <Dimmer.Dimmable dimmed={grantsLoading}>
38
- <Dimmer active={grantsLoading} inverted>
39
- <Loader />
40
- </Dimmer>
41
- </Dimmer.Dimmable>
42
- <GrantsLabelResults />
43
- <GrantsTable onlyMyGrants={onlyMyGrants} />
44
- <GrantsPagination />
40
+ <Segment attached="bottom">
41
+ <GrantsDownloadButton onlyMyGrants={onlyMyGrants} hasFilterApplied />
42
+ <GrantsSearch />
43
+ <GrantSelectedFilters />
44
+ <GrantDateFilter />
45
+ <Dimmer.Dimmable dimmed={grantsLoading}>
46
+ <Dimmer active={grantsLoading} inverted>
47
+ <Loader />
48
+ </Dimmer>
49
+ </Dimmer.Dimmable>
50
+ <GrantsLabelResults />
51
+ <GrantsTable onlyMyGrants={onlyMyGrants} />
52
+ <GrantsPagination />
53
+ </Segment>
45
54
  </Segment>
46
- </Segment>
47
- );
55
+ );
56
+ };
48
57
 
49
58
  Grants.propTypes = {
50
59
  grantsLoading: PropTypes.bool,
@@ -1,23 +1,31 @@
1
1
  import React from "react";
2
- import { Header, Icon, Segment, Dimmer, Loader } from "semantic-ui-react";
3
- import { FormattedMessage } from "react-intl";
2
+ import { Header, Icon, Segment } from "semantic-ui-react";
3
+ import { FormattedMessage, useIntl } from "react-intl";
4
4
  import LineageEventsTable from "./LineageEventsTable";
5
5
 
6
- export const LineageEvents = () => (
7
- <Segment>
8
- <Header as="h2">
9
- <Icon circular name="cogs" />
10
- <Header.Content>
11
- <FormattedMessage id="lineage.events.header" />
12
- <Header.Subheader>
13
- <FormattedMessage id="lineage.events.subheader" />
14
- </Header.Subheader>
15
- </Header.Content>
16
- </Header>
17
- <Segment attached="bottom">
18
- <LineageEventsTable />
6
+ export const LineageEvents = () => {
7
+ const { formatMessage } = useIntl();
8
+ return (
9
+ <Segment>
10
+ <Header as="h2">
11
+ <Icon
12
+ circular
13
+ name={formatMessage({
14
+ id: "lineage.events.header.icon",
15
+ defaultMessage: "cogs",
16
+ })}
17
+ />
18
+ <Header.Content>
19
+ <FormattedMessage id="lineage.events.header" />
20
+ <Header.Subheader>
21
+ <FormattedMessage id="lineage.events.subheader" />
22
+ </Header.Subheader>
23
+ </Header.Content>
24
+ </Header>
25
+ <Segment attached="bottom">
26
+ <LineageEventsTable />
27
+ </Segment>
19
28
  </Segment>
20
- </Segment>
21
- );
22
-
29
+ );
30
+ };
23
31
  export default LineageEvents;
@@ -35,7 +35,13 @@ export const MyGrantRequests = ({
35
35
  return (
36
36
  <Segment>
37
37
  <Header as="h2">
38
- <Icon circular name="key" />
38
+ <Icon
39
+ circular
40
+ name={formatMessage({
41
+ id: "grant.header.icon",
42
+ defaultMessage: "key",
43
+ })}
44
+ />
39
45
  <Header.Content>
40
46
  {formatMessage({ id: "grantRequests.header.me" })}
41
47
  <Header.Subheader>
@@ -2,7 +2,7 @@ import _ from "lodash/fp";
2
2
  import React from "react";
3
3
  import PropTypes from "prop-types";
4
4
  import { connect } from "react-redux";
5
- import { FormattedMessage } from "react-intl";
5
+ import { FormattedMessage, useIntl } from "react-intl";
6
6
  import { Dimmer, Loader, Header, Icon, Segment } from "semantic-ui-react";
7
7
  import {
8
8
  SearchContextProvider,
@@ -19,12 +19,19 @@ import PendingStructureNotesLabelResults from "./PendingStructureNotesLabelResul
19
19
  import PendingStructureNotesTable from "./PendingStructureNotesTable";
20
20
 
21
21
  export const PendingStructureNotesContent = () => {
22
+ const { formatMessage } = useIntl();
22
23
  const { loading } = useSearchContext();
23
24
 
24
25
  return (
25
26
  <Segment>
26
27
  <Header as="h2">
27
- <Icon name="sticky note outline" circular />
28
+ <Icon
29
+ circular
30
+ name={formatMessage({
31
+ id: "pendingStructureNotes.header.icon",
32
+ defaultMessage: "sticky note outline",
33
+ })}
34
+ />
28
35
  <Header.Content>
29
36
  <FormattedMessage id="pendingStructureNotes.header" />
30
37
  <Header.Subheader>
@@ -16,7 +16,13 @@ export const ReferenceDatasetCreate = ({ createReferenceDataset }) => {
16
16
  />
17
17
  <Container as={Segment} text>
18
18
  <Header as="h2">
19
- <Icon name="list ol" />
19
+ <Icon
20
+ circular
21
+ name={formatMessage({
22
+ id: "referenceDatasets.header.icon",
23
+ defaultMessage: "list ol",
24
+ })}
25
+ />
20
26
  <Header.Content>
21
27
  <FormattedMessage id="referenceDatasets.actions.create" />
22
28
  </Header.Content>
@@ -1,17 +1,24 @@
1
1
  import _ from "lodash/fp";
2
2
  import React from "react";
3
3
  import PropTypes from "prop-types";
4
- import { FormattedMessage } from "react-intl";
4
+ import { FormattedMessage, useIntl } from "react-intl";
5
5
  import { Header, Icon, Grid, Label } from "semantic-ui-react";
6
6
  import ReferenceDatasetActions from "./ReferenceDatasetActions";
7
7
 
8
- export const ReferenceDatasetHeader = ({ dataset }) =>
9
- _.isEmpty(dataset) ? null : (
8
+ export const ReferenceDatasetHeader = ({ dataset }) => {
9
+ const { formatMessage } = useIntl();
10
+ return _.isEmpty(dataset) ? null : (
10
11
  <Grid>
11
12
  <Grid.Row>
12
13
  <Grid.Column width={8}>
13
14
  <Header as="h2">
14
- <Icon circular name="list ol" />
15
+ <Icon
16
+ circular
17
+ name={formatMessage({
18
+ id: "referenceDatasets.header.icon",
19
+ defaultMessage: "list ol",
20
+ })}
21
+ />
15
22
  <Header.Content>
16
23
  {dataset.name}
17
24
  <Header.Subheader>
@@ -33,6 +40,7 @@ export const ReferenceDatasetHeader = ({ dataset }) =>
33
40
  </Grid.Row>
34
41
  </Grid>
35
42
  );
43
+ };
36
44
 
37
45
  ReferenceDatasetHeader.propTypes = {
38
46
  dataset: PropTypes.object.isRequired,
@@ -41,7 +41,13 @@ export const ReferenceDatasets = () => {
41
41
  content={formatMessage({ id: "referenceDatasets.actions.create" })}
42
42
  />
43
43
  ) : null}
44
- <Icon name="list ol" circular />
44
+ <Icon
45
+ circular
46
+ name={formatMessage({
47
+ id: "referenceDatasets.header.icon",
48
+ defaultMessage: "list ol",
49
+ })}
50
+ />
45
51
  <Header.Content>
46
52
  <FormattedMessage id="referenceDatasets.header" />
47
53
  <Header.Subheader>
@@ -7,11 +7,16 @@ import { List } from "semantic-ui-react";
7
7
  import { useIntl } from "react-intl";
8
8
  import { STRUCTURES, linkTo } from "@truedat/core/routes";
9
9
 
10
- const getIcon = (formatMessage, type) =>
11
- formatMessage({
12
- id: `structure.type.${type}.icon`,
10
+ const getIcon = (formatMessage, type, field_type) => {
11
+ const id = field_type
12
+ ? `structure.type.${field_type}.icon`
13
+ : `structure.type.${type}.icon`;
14
+
15
+ return formatMessage({
16
+ id,
13
17
  defaultMessage: "question circle outline",
14
18
  });
19
+ };
15
20
 
16
21
  const filterQueryParams = _.flow(
17
22
  Object.entries,
@@ -40,10 +45,7 @@ export const StructureItem = ({
40
45
  navFilter,
41
46
  original_name,
42
47
  type,
43
- /* hasCatalogViewProp can be:
44
- * - true/false in bucket view (catalog view)
45
- * - undefined in regular structure view
46
- */
48
+ field_type,
47
49
  hasCatalogViewProp,
48
50
  }) => {
49
51
  const { formatMessage } = useIntl();
@@ -96,7 +98,10 @@ export const StructureItem = ({
96
98
  className={toClassNames({ deleted_at, hasCatalogViewProp })}
97
99
  active={active}
98
100
  >
99
- <List.Icon name={getIcon(formatMessage, type)} verticalAlign="middle" />
101
+ <List.Icon
102
+ name={getIcon(formatMessage, type, field_type)}
103
+ verticalAlign="middle"
104
+ />
100
105
  <List.Content>
101
106
  <List.Description>
102
107
  {type == "bucket"
@@ -117,6 +122,7 @@ StructureItem.propTypes = {
117
122
  original_name: PropTypes.string,
118
123
  structuresAliasNameMode: PropTypes.bool,
119
124
  type: PropTypes.string,
125
+ field_type: PropTypes.string,
120
126
  hasCatalogViewProp: PropTypes.bool,
121
127
  };
122
128
 
@@ -1,27 +1,36 @@
1
1
  import React from "react";
2
2
  import PropTypes from "prop-types";
3
3
  import { Header, Icon, Container, Segment } from "semantic-ui-react";
4
- import { FormattedMessage } from "react-intl";
4
+ import { FormattedMessage, useIntl } from "react-intl";
5
5
  import { connect } from "react-redux";
6
6
  import StructureTypeForm from "./StructureTypeForm";
7
7
 
8
- export const StructureType = ({ name }) => (
9
- <Container text as={Segment}>
10
- <Header as="h2">
11
- <Icon name="object group" />
12
- <Header.Content>
13
- {name}
14
- <Header.Subheader>
15
- <FormattedMessage
16
- id="structureType"
17
- defaultMessage="Structure Type"
18
- />
19
- </Header.Subheader>
20
- </Header.Content>
21
- </Header>
22
- <StructureTypeForm />
23
- </Container>
24
- );
8
+ export const StructureType = ({ name }) => {
9
+ const { formatMessage } = useIntl();
10
+ return (
11
+ <Container text as={Segment}>
12
+ <Header as="h2">
13
+ <Icon
14
+ circular
15
+ name={formatMessage({
16
+ id: "structureType.header.icon",
17
+ defaultMessage: "object group",
18
+ })}
19
+ />
20
+ <Header.Content>
21
+ {name}
22
+ <Header.Subheader>
23
+ <FormattedMessage
24
+ id="structureType"
25
+ defaultMessage="Structure Type"
26
+ />
27
+ </Header.Subheader>
28
+ </Header.Content>
29
+ </Header>
30
+ <StructureTypeForm />
31
+ </Container>
32
+ );
33
+ };
25
34
 
26
35
  StructureType.propTypes = {
27
36
  name: PropTypes.string,
@@ -1,21 +1,30 @@
1
1
  import React from "react";
2
2
  import { Header, Icon, Segment } from "semantic-ui-react";
3
- import { FormattedMessage } from "react-intl";
3
+ import { FormattedMessage, useIntl } from "react-intl";
4
4
  import StructureTypesTable from "./StructureTypesTable";
5
5
 
6
- export const StructureTypes = () => (
7
- <Segment>
8
- <Header as="h2">
9
- <Icon name="object group" circular />
10
- <Header.Content>
11
- <FormattedMessage id="structureTypes.header" />
12
- <Header.Subheader>
13
- <FormattedMessage id="structureTypes.subheader" />
14
- </Header.Subheader>
15
- </Header.Content>
16
- </Header>
17
- <StructureTypesTable />
18
- </Segment>
19
- );
6
+ export const StructureTypes = () => {
7
+ const { formatMessage } = useIntl();
8
+ return (
9
+ <Segment>
10
+ <Header as="h2">
11
+ <Icon
12
+ circular
13
+ name={formatMessage({
14
+ id: "structureTypes.header.icon",
15
+ defaultMessage: "object group",
16
+ })}
17
+ />
18
+ <Header.Content>
19
+ <FormattedMessage id="structureTypes.header" />
20
+ <Header.Subheader>
21
+ <FormattedMessage id="structureTypes.subheader" />
22
+ </Header.Subheader>
23
+ </Header.Content>
24
+ </Header>
25
+ <StructureTypesTable />
26
+ </Segment>
27
+ );
28
+ };
20
29
 
21
30
  export default StructureTypes;
@@ -4,7 +4,7 @@ import PropTypes from "prop-types";
4
4
  import { connect } from "react-redux";
5
5
  import { useHistory } from "react-router-dom";
6
6
  import { Header, Icon, Divider } from "semantic-ui-react";
7
- import { FormattedMessage } from "react-intl";
7
+ import { FormattedMessage, useIntl } from "react-intl";
8
8
  import { linkTo } from "@truedat/core/routes";
9
9
  import {
10
10
  SearchContextProvider,
@@ -22,6 +22,7 @@ import StructuresSearchResults from "./StructuresSearchResults";
22
22
  import StructureGrantCart from "./StructureGrantCart";
23
23
 
24
24
  export function StructuresGrantRequestViewContent() {
25
+ const { formatMessage } = useIntl();
25
26
  const history = useHistory();
26
27
  const segment = useRef(null);
27
28
  const [isOverflown, setIsOverflown] = useState(null);
@@ -75,7 +76,13 @@ export function StructuresGrantRequestViewContent() {
75
76
  ref={segment}
76
77
  >
77
78
  <Header as="h2">
78
- <Icon circular name="block layout" />
79
+ <Icon
80
+ circular
81
+ name={formatMessage({
82
+ id: "structuresGrant.header.icon",
83
+ defaultMessage: "block layout",
84
+ })}
85
+ />
79
86
  <Header.Content>
80
87
  <FormattedMessage id="structuresGrantRequest.header" />
81
88
  <Header.Subheader>
@@ -2,30 +2,39 @@ import React from "react";
2
2
  import PropTypes from "prop-types";
3
3
  import { connect } from "react-redux";
4
4
  import { Header, Icon, Segment, Dimmer, Loader } from "semantic-ui-react";
5
- import { FormattedMessage } from "react-intl";
5
+ import { FormattedMessage, useIntl } from "react-intl";
6
6
  import StructuresUploadEventsTable from "./StructuresUploadEventsTable";
7
7
 
8
- export const StructuresUploadEvents = ({ structuresUploadEventsLoading }) => (
9
- <Segment>
10
- <Header as="h2">
11
- <Icon circular name="cogs" />
12
- <Header.Content>
13
- <FormattedMessage id="structures.bulkUploadEvents.header" />
14
- <Header.Subheader>
15
- <FormattedMessage id="structures.bulkUploadEvents.subheader" />
16
- </Header.Subheader>
17
- </Header.Content>
18
- </Header>
19
- <Dimmer.Dimmable dimmed={structuresUploadEventsLoading}>
20
- <Segment attached="bottom">
21
- <StructuresUploadEventsTable />
22
- <Dimmer inverted active={structuresUploadEventsLoading}>
23
- <Loader />
24
- </Dimmer>
25
- </Segment>
26
- </Dimmer.Dimmable>
27
- </Segment>
28
- );
8
+ export const StructuresUploadEvents = ({ structuresUploadEventsLoading }) => {
9
+ const { formatMessage } = useIntl();
10
+ return (
11
+ <Segment>
12
+ <Header as="h2">
13
+ <Icon
14
+ circular
15
+ name={formatMessage({
16
+ id: "bulkUploadEvents.header.icon",
17
+ defaultMessage: "cogs",
18
+ })}
19
+ />
20
+ <Header.Content>
21
+ <FormattedMessage id="structures.bulkUploadEvents.header" />
22
+ <Header.Subheader>
23
+ <FormattedMessage id="structures.bulkUploadEvents.subheader" />
24
+ </Header.Subheader>
25
+ </Header.Content>
26
+ </Header>
27
+ <Dimmer.Dimmable dimmed={structuresUploadEventsLoading}>
28
+ <Segment attached="bottom">
29
+ <StructuresUploadEventsTable />
30
+ <Dimmer inverted active={structuresUploadEventsLoading}>
31
+ <Loader />
32
+ </Dimmer>
33
+ </Segment>
34
+ </Dimmer.Dimmable>
35
+ </Segment>
36
+ );
37
+ };
29
38
 
30
39
  StructuresUploadEvents.propTypes = {
31
40
  structuresUploadEventsLoading: PropTypes.bool,
@@ -4,7 +4,7 @@ import PropTypes from "prop-types";
4
4
  import { connect } from "react-redux";
5
5
  import { useHistory, useRouteMatch } from "react-router-dom";
6
6
  import { Header, Icon, Segment, Divider } from "semantic-ui-react";
7
- import { FormattedMessage } from "react-intl";
7
+ import { FormattedMessage, useIntl } from "react-intl";
8
8
  import { linkTo } from "@truedat/core/routes";
9
9
  import { BUCKETS_VIEW } from "@truedat/core/routes";
10
10
  import SearchWidget from "@truedat/core/search/SearchWidget";
@@ -23,6 +23,7 @@ import SystemCards from "./SystemCards";
23
23
  import CatalogCustomViewCards from "./CatalogCustomViewCards";
24
24
 
25
25
  const StructuresHeader = () => {
26
+ const { formatMessage } = useIntl();
26
27
  const match = useRouteMatch(BUCKETS_VIEW);
27
28
  const propertyPathMessage = !match?.params?.propertyPath
28
29
  ? "structures.subheader"
@@ -30,7 +31,13 @@ const StructuresHeader = () => {
30
31
 
31
32
  return (
32
33
  <Header as="h2">
33
- <Icon circular name="block layout" />
34
+ <Icon
35
+ circular
36
+ name={formatMessage({
37
+ id: "structuresGrant.header.icon",
38
+ defaultMessage: "block layout",
39
+ })}
40
+ />
34
41
  <Header.Content>
35
42
  <FormattedMessage
36
43
  id={
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  import PropTypes from "prop-types";
3
3
  import { Header, Icon, Container, Segment } from "semantic-ui-react";
4
- import { FormattedMessage } from "react-intl";
4
+ import { FormattedMessage, useIntl } from "react-intl";
5
5
  import { connect } from "react-redux";
6
6
  import { Loading } from "@truedat/core/components";
7
7
  import { createTag, updateTag } from "../routines";
@@ -21,6 +21,7 @@ export const Tag = ({
21
21
  saving,
22
22
  id,
23
23
  }) => {
24
+ const { formatMessage } = useIntl();
24
25
  const action = id ? "tags.actions.edit" : "tags.actions.create";
25
26
  const onSubmit = id ? (data) => updateTag({ ...data, id }) : createTag;
26
27
  return (
@@ -28,7 +29,12 @@ export const Tag = ({
28
29
  <TagCrumbs action={action} />
29
30
  <Container text as={Segment}>
30
31
  <Header as="h2">
31
- <Icon name="tag" />
32
+ <Icon
33
+ name={formatMessage({
34
+ id: "tag.header.icon",
35
+ defaultMessage: "tag",
36
+ })}
37
+ />
32
38
  <Header.Content>
33
39
  <FormattedMessage id={action} />
34
40
  </Header.Content>
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  import { Link } from "react-router-dom";
3
3
  import { Button, Header, Icon, Segment } from "semantic-ui-react";
4
- import { useIntl, FormattedMessage } from "react-intl";
4
+ import { FormattedMessage, useIntl } from "react-intl";
5
5
  import { STRUCTURE_TAGS_NEW } from "@truedat/core/routes";
6
6
  import TagCards from "./TagCards";
7
7
 
@@ -17,7 +17,13 @@ export const Tags = () => {
17
17
  to={STRUCTURE_TAGS_NEW}
18
18
  content={formatMessage({ id: "tags.actions.create" })}
19
19
  />
20
- <Icon name="tags" circular />
20
+ <Icon
21
+ circular
22
+ name={formatMessage({
23
+ id: "tags.header.icon",
24
+ defaultMessage: "tags",
25
+ })}
26
+ />
21
27
  <Header.Content>
22
28
  <FormattedMessage id="tags.header" />
23
29
  <Header.Subheader>
@@ -2,7 +2,7 @@ import _ from "lodash/fp";
2
2
  import React from "react";
3
3
  import { useParams, Link } from "react-router-dom";
4
4
  import { useQuery } from "@apollo/client";
5
- import { FormattedMessage } from "react-intl";
5
+ import { FormattedMessage, useIntl } from "react-intl";
6
6
  import {
7
7
  Breadcrumb,
8
8
  Button,
@@ -57,7 +57,7 @@ function Task() {
57
57
  },
58
58
  { name: "task.elapsed", content: `${task?.elapsed / 1000}s` },
59
59
  ];
60
-
60
+ const { formatMessage } = useIntl();
61
61
  const propertyElement = (name, content) => (
62
62
  <Grid.Column key={name} width={3}>
63
63
  <Item>
@@ -84,7 +84,13 @@ function Task() {
84
84
  </Breadcrumb>
85
85
  <Segment>
86
86
  <Header as="h2">
87
- <Icon circular name="check" />
87
+ <Icon
88
+ circular
89
+ name={formatMessage({
90
+ id: "task.header.icon",
91
+ defaultMessage: "check",
92
+ })}
93
+ />
88
94
  <Header.Content>
89
95
  <FormattedMessage id="task.header" />
90
96
  <Header.Subheader>
@@ -4,7 +4,7 @@ import PropTypes from "prop-types";
4
4
  import { useHistory } from "react-router-dom";
5
5
  import { useQuery } from "@apollo/client";
6
6
  import { connect } from "react-redux";
7
- import { FormattedMessage } from "react-intl";
7
+ import { FormattedMessage, useIntl } from "react-intl";
8
8
  import { Button, Header, Icon, Table, Segment } from "semantic-ui-react";
9
9
  import { Dimmer, Loader } from "semantic-ui-react";
10
10
  import Moment from "react-moment";
@@ -17,7 +17,7 @@ export const Tasks = ({ reindexAllGrants, reindexAllStructures }) => {
17
17
  fetchPolicy: "cache-and-network",
18
18
  });
19
19
  const history = useHistory();
20
-
20
+ const { formatMessage } = useIntl();
21
21
  const tasks = _.flow(
22
22
  _.get("tasks"),
23
23
  _.orderBy(["started_at"], ["desc"])
@@ -26,7 +26,13 @@ export const Tasks = ({ reindexAllGrants, reindexAllStructures }) => {
26
26
  return (
27
27
  <Segment>
28
28
  <Header as="h2">
29
- <Icon circular name="check" />
29
+ <Icon
30
+ circular
31
+ name={formatMessage({
32
+ id: "task.header.icon",
33
+ defaultMessage: "check",
34
+ })}
35
+ />
30
36
  <Header.Content>
31
37
  <FormattedMessage id="tasks.header" />
32
38
  <Header.Subheader>
@@ -1,10 +1,25 @@
1
1
  import React from "react";
2
- import { shallow } from "enzyme";
3
- import { StructureType } from "../StructureType";
2
+ import { render } from "@truedat/test/render";
3
+ import StructureType from "../StructureType";
4
+
5
+ const renderOpts = {
6
+ state: { structureType: { name: "foo" } },
7
+ messages: {
8
+ en: {
9
+ "structure.type.foo.text": "foo",
10
+ "structureType.template": "template",
11
+ "structureType.translation": " translation",
12
+ "actions.cancel": "Cancel",
13
+ "actions.create": "Create",
14
+ "actions.update": "Update",
15
+ "actions.save": "Save",
16
+ },
17
+ },
18
+ };
4
19
 
5
20
  describe("<StructureType />", () => {
6
21
  it("matches the latest snapshot", () => {
7
- const wrapper = shallow(<StructureType />);
8
- expect(wrapper).toMatchSnapshot();
22
+ const { container } = render(<StructureType />, renderOpts);
23
+ expect(container).toMatchSnapshot();
9
24
  });
10
25
  });
@@ -1,11 +1,11 @@
1
1
  import React from "react";
2
- import { shallow } from "enzyme";
3
- import { Tag } from "../Tag";
2
+ import { render } from "@truedat/test/render";
3
+ import Tag from "../Tag";
4
4
 
5
5
  describe("<Tag />", () => {
6
6
  it("matches the latest snapshot", () => {
7
7
  const createTag = jest.fn();
8
- const wrapper = shallow(<Tag createTag={createTag} />);
9
- expect(wrapper).toMatchSnapshot();
8
+ const { container } = render(<Tag createTag={createTag} />);
9
+ expect(container).toMatchSnapshot();
10
10
  });
11
11
  });
@@ -29,7 +29,7 @@ exports[`<ReferenceDatasetCreate /> matches the latest snapshot 1`] = `
29
29
  >
30
30
  <i
31
31
  aria-hidden="true"
32
- class="list ol icon"
32
+ class="list ol circular icon"
33
33
  />
34
34
  <div
35
35
  class="content"
@@ -29,7 +29,7 @@ exports[`<ReferenceDatasetRoutes /> matches the latest snapshot (create route) 1
29
29
  >
30
30
  <i
31
31
  aria-hidden="true"
32
- class="list ol icon"
32
+ class="list ol circular icon"
33
33
  />
34
34
  <div
35
35
  class="content"
@@ -1,26 +1,90 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
3
  exports[`<StructureType /> matches the latest snapshot 1`] = `
4
- <Container
5
- as={[Function]}
6
- text={true}
7
- >
8
- <Header
9
- as="h2"
4
+ <div>
5
+ <div
6
+ class="ui segment ui text container"
10
7
  >
11
- <Icon
12
- as="i"
13
- name="object group"
14
- />
15
- <HeaderContent>
16
- <HeaderSubheader>
17
- <MemoizedFormattedMessage
18
- defaultMessage="Structure Type"
19
- id="structureType"
20
- />
21
- </HeaderSubheader>
22
- </HeaderContent>
23
- </Header>
24
- <Connect(StructureTypeForm) />
25
- </Container>
8
+ <h2
9
+ class="ui header"
10
+ >
11
+ <i
12
+ aria-hidden="true"
13
+ class="object group circular icon"
14
+ />
15
+ <div
16
+ class="content"
17
+ >
18
+ foo
19
+ <div
20
+ class="sub header"
21
+ >
22
+ Structure Type
23
+ </div>
24
+ </div>
25
+ </h2>
26
+ <form
27
+ class="ui form"
28
+ >
29
+ <div
30
+ class="field"
31
+ >
32
+ <label>
33
+ translation
34
+ </label>
35
+ <div
36
+ class="ui input"
37
+ >
38
+ <input
39
+ autocomplete="off"
40
+ placeholder="foo"
41
+ type="text"
42
+ value=""
43
+ />
44
+ </div>
45
+ </div>
46
+ <div
47
+ class="field"
48
+ >
49
+ <label>
50
+ template
51
+ </label>
52
+ <div
53
+ aria-expanded="false"
54
+ class="ui selection dropdown"
55
+ name="template_id"
56
+ role="listbox"
57
+ tabindex="0"
58
+ >
59
+ <i
60
+ aria-hidden="true"
61
+ class="dropdown icon"
62
+ />
63
+ <div
64
+ class="menu transition"
65
+ />
66
+ </div>
67
+ </div>
68
+ <div
69
+ class="actions"
70
+ >
71
+ <button
72
+ class="ui primary disabled button"
73
+ disabled=""
74
+ tabindex="-1"
75
+ type="submit"
76
+ >
77
+ Save
78
+ </button>
79
+ <a
80
+ class="ui secondary button"
81
+ href="/"
82
+ role="button"
83
+ >
84
+ Cancel
85
+ </a>
86
+ </div>
87
+ </form>
88
+ </div>
89
+ </div>
26
90
  `;
@@ -1,36 +1,106 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
3
  exports[`<Tag /> matches the latest snapshot 1`] = `
4
- <Fragment>
5
- <TagCrumbs
6
- action="tags.actions.create"
7
- />
8
- <Container
9
- as={[Function]}
10
- text={true}
4
+ <div>
5
+ <div
6
+ class="ui breadcrumb"
11
7
  >
12
- <Header
13
- as="h2"
8
+ <a
9
+ class="section"
10
+ href="/structureTags"
14
11
  >
15
- <Icon
16
- as="i"
17
- name="tag"
18
- />
19
- <HeaderContent>
20
- <MemoizedFormattedMessage
21
- id="tags.actions.create"
22
- />
23
- </HeaderContent>
24
- </Header>
25
- <TagForm
26
- onSubmit={[MockFunction]}
27
- tag={
28
- {
29
- "domainIds": [],
30
- "name": "",
31
- }
32
- }
12
+ Structure Tags
13
+ </a>
14
+ <i
15
+ aria-hidden="true"
16
+ class="right angle icon divider"
33
17
  />
34
- </Container>
35
- </Fragment>
18
+ <div
19
+ class="active section"
20
+ >
21
+ Create Structure Tag
22
+ </div>
23
+ </div>
24
+ <div
25
+ class="ui segment ui text container"
26
+ >
27
+ <h2
28
+ class="ui header"
29
+ >
30
+ <i
31
+ aria-hidden="true"
32
+ class="tag icon"
33
+ />
34
+ <div
35
+ class="content"
36
+ >
37
+ Create Structure Tag
38
+ </div>
39
+ </h2>
40
+ <form
41
+ class="ui loading form"
42
+ >
43
+ <div
44
+ class="required field"
45
+ >
46
+ <label
47
+ for="name"
48
+ >
49
+ Name
50
+ </label>
51
+ <div
52
+ class="ui input"
53
+ >
54
+ <input
55
+ autocomplete="off"
56
+ id="name"
57
+ placeholder="Name"
58
+ required=""
59
+ type="text"
60
+ value=""
61
+ />
62
+ </div>
63
+ </div>
64
+ <div
65
+ class="field"
66
+ >
67
+ <label
68
+ for="description"
69
+ >
70
+ Description
71
+ </label>
72
+ <div
73
+ class="ui input"
74
+ >
75
+ <input
76
+ autocomplete="off"
77
+ id="description"
78
+ placeholder="Description"
79
+ type="text"
80
+ value=""
81
+ />
82
+ </div>
83
+ </div>
84
+ <div
85
+ class="actions"
86
+ >
87
+ <button
88
+ class="ui primary disabled right floated button"
89
+ disabled=""
90
+ tabindex="-1"
91
+ type="submit"
92
+ >
93
+ Save
94
+ </button>
95
+ <a
96
+ class="ui secondary button"
97
+ href="/"
98
+ role="button"
99
+ >
100
+ Cancel
101
+ </a>
102
+ </div>
103
+ </form>
104
+ </div>
105
+ </div>
36
106
  `;
@@ -34,7 +34,12 @@ export const GrantRequestStructureDecorator = (grantRequest) => {
34
34
  content={formatMessage({ id: "grantRequest.isModification" })}
35
35
  trigger={
36
36
  <Link to={linkTo.GRANT({ id: grantRequest?.grant?.id || 0 })}>
37
- <Icon name="key" />
37
+ <Icon
38
+ name={formatMessage({
39
+ id: "grant.header.icon",
40
+ defaultMessage: "key",
41
+ })}
42
+ />
38
43
  </Link>
39
44
  }
40
45
  />