@truedat/dd 7.5.3 → 7.5.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": "7.5.3",
3
+ "version": "7.5.5",
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": "7.5.3",
37
+ "@truedat/test": "7.5.5",
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": "7.5.3",
92
- "@truedat/core": "7.5.3",
93
- "@truedat/df": "7.5.3",
91
+ "@truedat/auth": "7.5.5",
92
+ "@truedat/core": "7.5.5",
93
+ "@truedat/df": "7.5.5",
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": "0493d9170268bd7cae7874b0f6d3b251f730e7a0"
118
+ "gitHead": "2a4343b3b2837540358b57d3d647408ab292aa21"
119
119
  }
@@ -86,8 +86,9 @@ export const CatalogViewConfigs = ({
86
86
  <Button
87
87
  aria-label="delete"
88
88
  basic
89
- icon="trash"
89
+ icon="trash alternate outline"
90
90
  color="red"
91
+ size="mini"
91
92
  />
92
93
  }
93
94
  header={
@@ -107,16 +107,21 @@ export default function GrantApprovalRuleConditions({
107
107
  </Grid.Column>
108
108
  <Grid.Column width={1}>
109
109
  {_.size(value) !== 1 ? (
110
- <Icon
111
- name="trash"
112
- className="selectable"
110
+ <Button
111
+ basic
112
+ icon
113
+ color="red"
114
+ size="mini"
115
+ className="selectable "
113
116
  onClick={() =>
114
117
  onChange([
115
118
  ..._.slice(0, key)(value),
116
119
  ..._.slice(key + 1, _.size(value))(value),
117
120
  ])
118
121
  }
119
- />
122
+ >
123
+ <Icon name="trash alternate outline" color="red" />
124
+ </Button>
120
125
  ) : null}
121
126
  </Grid.Column>
122
127
  </Grid.Row>
@@ -2,8 +2,8 @@ import React from "react";
2
2
  import PropTypes from "prop-types";
3
3
  import { Link } from "react-router-dom";
4
4
  import { connect } from "react-redux";
5
- import { useIntl } from "react-intl";
6
- import { Button } from "semantic-ui-react";
5
+ import { FormattedMessage, useIntl } from "react-intl";
6
+ import { Button, Icon } from "semantic-ui-react";
7
7
  import { useAuthorized } from "@truedat/core/hooks";
8
8
  import { ConfirmModal, GroupActions } from "@truedat/core/components";
9
9
  import { linkTo } from "@truedat/core/routes";
@@ -15,10 +15,13 @@ export const ConfirmDeleteModal = ({ onConfirm, name, id }) => {
15
15
  <ConfirmModal
16
16
  icon="trash"
17
17
  trigger={
18
- <Button
19
- icon="trash"
20
- content={formatMessage({ id: "actions.delete" })}
21
- />
18
+ <Button>
19
+ <Icon name="trash alternate outline" color="red" />
20
+ <FormattedMessage
21
+ id={"actions.delete"}
22
+ defaultMessage={"actions.delete"}
23
+ />
24
+ </Button>
22
25
  }
23
26
  header={formatMessage({
24
27
  id: "referenceDataset.actions.delete.confirmation.header",
@@ -13,7 +13,7 @@ export const StructureDeleteButton = ({ structure, deleteStructure }) => {
13
13
  <ConfirmModal
14
14
  trigger={
15
15
  <Button
16
- icon={<Icon name="trash alternate" color="red" />}
16
+ icon={<Icon name="trash alternate outline" color="red" />}
17
17
  className="basic"
18
18
  />
19
19
  }
@@ -3,7 +3,7 @@ import React from "react";
3
3
  import { Link } from "react-router-dom";
4
4
  import { connect } from "react-redux";
5
5
  import PropTypes from "prop-types";
6
- import { Button } from "semantic-ui-react";
6
+ import { Button, Icon } from "semantic-ui-react";
7
7
  import { FormattedMessage } from "react-intl";
8
8
  import { ConfirmModal, GroupActions } from "@truedat/core/components";
9
9
  import { linkTo } from "@truedat/core/routes";
@@ -13,15 +13,13 @@ export const ModalDelete = ({ modalOnConfirm, modalAction, modalIcon }) => (
13
13
  <ConfirmModal
14
14
  icon="trash"
15
15
  trigger={
16
- <Button
17
- icon={modalIcon}
18
- content={
19
- <FormattedMessage
20
- id={`structure.notes.actions.${modalAction}`}
21
- defaultMessage={modalAction}
22
- />
23
- }
24
- />
16
+ <Button icon={modalIcon}>
17
+ <Icon name={modalIcon} color={"red"} />
18
+ <FormattedMessage
19
+ id={`structure.notes.actions.${modalAction}`}
20
+ defaultMessage={modalAction}
21
+ />
22
+ </Button>
25
23
  }
26
24
  header={
27
25
  <FormattedMessage
@@ -50,7 +48,7 @@ export const StructureNoteActions = ({
50
48
  structure,
51
49
  }) => {
52
50
  const actionToIcon = {
53
- deleted: "trash",
51
+ deleted: "trash alternate outline",
54
52
  edited: "edit",
55
53
  rejected: "thumbs down outline",
56
54
  published: "paper plane",
@@ -100,7 +98,8 @@ export const StructureNoteActions = ({
100
98
  modalAction: action,
101
99
  }
102
100
  : baseAction;
103
- })
101
+ }),
102
+ _.sortBy((action) => (action.value === "deleted" ? 1 : 0))
104
103
  )(actions);
105
104
 
106
105
  return _.isEmpty(parsedActions) ? null : (
@@ -2,7 +2,7 @@ import _ from "lodash/fp";
2
2
  import React from "react";
3
3
  import PropTypes from "prop-types";
4
4
  import { useIntl } from "react-intl";
5
- import { Dropdown, Grid, Icon, Popup } from "semantic-ui-react";
5
+ import { Button, Dropdown, Grid, Icon, Popup } from "semantic-ui-react";
6
6
  import { getStructureFieldOptionValue } from "../selectors/getStructureFieldOptionValue";
7
7
  import StructureFieldsDropdown from "./StructureFieldsDropdown";
8
8
 
@@ -91,11 +91,16 @@ const JoinClause = ({
91
91
  </Grid.Column>
92
92
  <Grid.Column width={1}>
93
93
  {idx > 0 && (
94
- <Icon
95
- name="trash"
94
+ <Button
95
+ icon
96
+ color="red"
97
+ basic
98
+ size="mini"
96
99
  className="selectable"
97
100
  onClick={() => deleteClause(idx)}
98
- />
101
+ >
102
+ <Icon name="trash alternate outline" color="red" />
103
+ </Button>
99
104
  )}
100
105
  </Grid.Column>
101
106
  </Grid>
@@ -44,8 +44,8 @@ export const Edge = ({ structureId, structureLink }) => (
44
44
  structureId === structureLink?.source.id
45
45
  ? "M 0,10 h 90"
46
46
  : structureId === structureLink?.target.id
47
- ? "M 95,10 h -90"
48
- : ""
47
+ ? "M 95,10 h -90"
48
+ : ""
49
49
  }
50
50
  strokeWidth="1"
51
51
  stroke="#871f1f"
@@ -76,12 +76,13 @@ Edge.propTypes = {
76
76
  export const DeleteLink = ({ deleteStructureStructureLink, structureLink }) => {
77
77
  return !structureLink._actions.delete_struct_to_struct_link ? null : (
78
78
  <ConfirmModal
79
- icon="trash"
80
79
  trigger={
81
80
  <Button
82
81
  id={`delete-link-${structureLink.source.id}-${structureLink.target.id}`}
83
- icon="trash alternate"
82
+ basic
83
+ icon="trash alternate outline"
84
84
  color="red"
85
+ size="mini"
85
86
  />
86
87
  }
87
88
  header={
@@ -96,7 +97,11 @@ export const DeleteLink = ({ deleteStructureStructureLink, structureLink }) => {
96
97
  source: { id: sourceStructureId },
97
98
  target: { id: targetStructureId },
98
99
  id: dataStructureLinkId,
99
- }) => ({ dataStructureLinkId, sourceStructureId, targetStructureId }),
100
+ }) => ({
101
+ dataStructureLinkId,
102
+ sourceStructureId,
103
+ targetStructureId,
104
+ }),
100
105
  (destructuredLink) => deleteStructureStructureLink(destructuredLink)
101
106
  )(structureLink)
102
107
  }
@@ -134,8 +139,8 @@ export const StructureStructureLinks = ({
134
139
  structureId !== structureLink?.source.id
135
140
  ? structureLink.source
136
141
  : structureId !== structureLink?.target.id
137
- ? structureLink.target
138
- : null,
142
+ ? structureLink.target
143
+ : null,
139
144
  (relatedStructure) => (
140
145
  <StructureCrumbs
141
146
  {...{
@@ -40,7 +40,9 @@ export const TagCards = ({ deleteTag, tags }) =>
40
40
  <div className="ui actions">
41
41
  <ConfirmModal
42
42
  icon="trash"
43
- trigger={<Button icon="trash" basic color="red" />}
43
+ trigger={
44
+ <Button icon="trash alternate outline" basic color="red" />
45
+ }
44
46
  header={
45
47
  <FormattedMessage id="tags.actions.delete.confirmation.header" />
46
48
  }
@@ -12,7 +12,7 @@ describe("<StructureSelectorInputFieldJoin />", () => {
12
12
  const props = {
13
13
  structures: [{ id: "123" }, { id: "456" }],
14
14
  selectedStructure: { id: "456" },
15
- handleSelectField: jest.fn()
15
+ handleSelectField: jest.fn(),
16
16
  };
17
17
  const wrapper = shallow(<StructureSelectorInputFieldJoin {...props} />);
18
18
  expect(wrapper).toMatchSnapshot();
@@ -25,10 +25,10 @@ describe("<StructureSelectorInputFieldJoin />", () => {
25
25
  id: "456",
26
26
  clauses: [
27
27
  { left: { id: "5" }, right: { id: "6" } },
28
- { left: { id: "7" }, right: { id: "8" } }
29
- ]
28
+ { left: { id: "7" }, right: { id: "8" } },
29
+ ],
30
30
  },
31
- handleSelectField: jest.fn()
31
+ handleSelectField: jest.fn(),
32
32
  };
33
33
  const wrapper = shallow(<StructureSelectorInputFieldJoin {...props} />);
34
34
  expect(wrapper).toMatchSnapshot();
@@ -42,25 +42,19 @@ describe("<StructureSelectorInputFieldJoin />", () => {
42
42
  id: "456",
43
43
  clauses: [
44
44
  { left: { id: "5" }, right: { id: "6" } },
45
- { left: { id: "7" }, right: { id: "8" } }
46
- ]
45
+ { left: { id: "7" }, right: { id: "8" } },
46
+ ],
47
47
  },
48
- handleSelectField
48
+ handleSelectField,
49
49
  };
50
50
  const wrapper = shallow(<StructureSelectorInputFieldJoin {...props} />);
51
51
 
52
- wrapper
53
- .find("JoinClause")
54
- .at(0)
55
- .invoke("handleChange")(
56
- "left",
57
- 1
58
- )({
59
- data_structure_id: "999"
52
+ wrapper.find("JoinClause").at(0).invoke("handleChange")("left", 1)({
53
+ data_structure_id: "999",
60
54
  });
61
55
  expect(handleSelectField.mock.calls[0][0]).toEqual([
62
56
  { left: { id: "5" }, right: { id: "6" } },
63
- { left: { id: "999" }, right: { id: "8" } }
57
+ { left: { id: "999" }, right: { id: "8" } },
64
58
  ]);
65
59
  });
66
60
 
@@ -71,24 +65,19 @@ describe("<StructureSelectorInputFieldJoin />", () => {
71
65
  { id: "5" },
72
66
  { id: "7" },
73
67
  { id: "5" },
74
- { id: "8" }
68
+ { id: "8" },
75
69
  ],
76
70
  selectedStructure: {
77
71
  id: "456",
78
72
  clauses: [
79
73
  { left: { id: "5" }, right: { id: "6" } },
80
- { left: { id: "7" }, right: { id: "8" } }
81
- ]
74
+ { left: { id: "7" }, right: { id: "8" } },
75
+ ],
82
76
  },
83
- handleSelectField: jest.fn()
77
+ handleSelectField: jest.fn(),
84
78
  };
85
79
  const wrapper = shallow(<StructureSelectorInputFieldJoin {...props} />);
86
- expect(
87
- wrapper
88
- .find("JoinClause")
89
- .at(1)
90
- .dive()
91
- ).toMatchSnapshot();
80
+ expect(wrapper.find("JoinClause").at(1).dive()).toMatchSnapshot();
92
81
  });
93
82
 
94
83
  it("calls handleSelectedField when delete is clicked", () => {
@@ -99,27 +88,22 @@ describe("<StructureSelectorInputFieldJoin />", () => {
99
88
  { id: "5" },
100
89
  { id: "7" },
101
90
  { id: "5" },
102
- { id: "8" }
91
+ { id: "8" },
103
92
  ],
104
93
  selectedStructure: {
105
94
  id: "456",
106
95
  clauses: [
107
96
  { left: { id: "5" }, right: { id: "6" } },
108
- { left: { id: "7" }, right: { id: "8" } }
109
- ]
97
+ { left: { id: "7" }, right: { id: "8" } },
98
+ ],
110
99
  },
111
- handleSelectField
100
+ handleSelectField,
112
101
  };
113
102
  const wrapper = shallow(<StructureSelectorInputFieldJoin {...props} />);
114
103
 
115
- wrapper
116
- .find("JoinClause")
117
- .at(1)
118
- .dive()
119
- .find("Icon")
120
- .invoke("onClick")();
104
+ wrapper.find("JoinClause").at(1).dive().find("Button").invoke("onClick")();
121
105
  expect(handleSelectField.mock.calls[0][0]).toEqual([
122
- { left: { id: "5" }, right: { id: "6" } }
106
+ { left: { id: "5" }, right: { id: "6" } },
123
107
  ]);
124
108
  });
125
109
  });
@@ -731,10 +731,14 @@ exports[`<GrantApprovalRuleConditions /> matches the last snapshot with values 1
731
731
  <div
732
732
  class="one wide column"
733
733
  >
734
- <i
735
- aria-hidden="true"
736
- class="trash icon selectable"
737
- />
734
+ <button
735
+ class="ui red mini basic icon button selectable "
736
+ >
737
+ <i
738
+ aria-hidden="true"
739
+ class="red trash alternate outline icon"
740
+ />
741
+ </button>
738
742
  </div>
739
743
  </div>
740
744
  <div
@@ -963,10 +967,14 @@ exports[`<GrantApprovalRuleConditions /> matches the last snapshot with values 1
963
967
  <div
964
968
  class="one wide column"
965
969
  >
966
- <i
967
- aria-hidden="true"
968
- class="trash icon selectable"
969
- />
970
+ <button
971
+ class="ui red mini basic icon button selectable "
972
+ >
973
+ <i
974
+ aria-hidden="true"
975
+ class="red trash alternate outline icon"
976
+ />
977
+ </button>
970
978
  </div>
971
979
  </div>
972
980
  <div
@@ -381,10 +381,14 @@ exports[`<GrantApprovalRuleForm /> matches the last snapshot 1`] = `
381
381
  <div
382
382
  class="one wide column"
383
383
  >
384
- <i
385
- aria-hidden="true"
386
- class="trash icon selectable"
387
- />
384
+ <button
385
+ class="ui red mini basic icon button selectable "
386
+ >
387
+ <i
388
+ aria-hidden="true"
389
+ class="red trash alternate outline icon"
390
+ />
391
+ </button>
388
392
  </div>
389
393
  </div>
390
394
  <div
@@ -618,10 +622,14 @@ exports[`<GrantApprovalRuleForm /> matches the last snapshot 1`] = `
618
622
  <div
619
623
  class="one wide column"
620
624
  >
621
- <i
622
- aria-hidden="true"
623
- class="trash icon selectable"
624
- />
625
+ <button
626
+ class="ui red mini basic icon button selectable "
627
+ >
628
+ <i
629
+ aria-hidden="true"
630
+ class="red trash alternate outline icon"
631
+ />
632
+ </button>
625
633
  </div>
626
634
  </div>
627
635
  <div
@@ -115,7 +115,7 @@ exports[`<ReferenceDataset /> edit dataset view matches the latest snapshot 1`]
115
115
  >
116
116
  <i
117
117
  aria-hidden="true"
118
- class="trash icon"
118
+ class="red trash alternate outline icon"
119
119
  />
120
120
  Delete
121
121
  </button>
@@ -404,7 +404,7 @@ exports[`<ReferenceDataset /> show dataset view matches the latest snapshot 1`]
404
404
  >
405
405
  <i
406
406
  aria-hidden="true"
407
- class="trash icon"
407
+ class="red trash alternate outline icon"
408
408
  />
409
409
  Delete
410
410
  </button>
@@ -56,7 +56,7 @@ exports[`<ReferenceDatasetActions /> matches the latest snapshot 1`] = `
56
56
  >
57
57
  <i
58
58
  aria-hidden="true"
59
- class="trash icon"
59
+ class="red trash alternate outline icon"
60
60
  />
61
61
  Delete
62
62
  </button>
@@ -93,7 +93,7 @@ exports[`<ReferenceDatasetHeader /> matches the latest snapshot 1`] = `
93
93
  >
94
94
  <i
95
95
  aria-hidden="true"
96
- class="trash icon"
96
+ class="red trash alternate outline icon"
97
97
  />
98
98
  Delete
99
99
  </button>
@@ -436,7 +436,7 @@ exports[`<ReferenceDatasetRoutes /> matches the latest snapshot (view route) 1`]
436
436
  >
437
437
  <i
438
438
  aria-hidden="true"
439
- class="trash icon"
439
+ class="red trash alternate outline icon"
440
440
  />
441
441
  Delete
442
442
  </button>
@@ -7,7 +7,7 @@ exports[`<StructureDeleteButton /> matches the latest snapshot 1`] = `
7
7
  >
8
8
  <i
9
9
  aria-hidden="true"
10
- class="red trash alternate icon"
10
+ class="red trash alternate outline icon"
11
11
  />
12
12
  </button>
13
13
  </div>
@@ -76,12 +76,21 @@ exports[`<StructureSelectorInputFieldJoin /> matches the latest JoinClause snaps
76
76
  <GridColumn
77
77
  width={1}
78
78
  >
79
- <Icon
80
- as="i"
79
+ <Button
80
+ as="button"
81
+ basic={true}
81
82
  className="selectable"
82
- name="trash"
83
+ color="red"
84
+ icon={true}
83
85
  onClick={[Function]}
84
- />
86
+ size="mini"
87
+ >
88
+ <Icon
89
+ as="i"
90
+ color="red"
91
+ name="trash alternate outline"
92
+ />
93
+ </Button>
85
94
  </GridColumn>
86
95
  </Grid>
87
96
  `;
@@ -57,7 +57,7 @@ exports[`<StructureSummary /> matches the latest snapshot 1`] = `
57
57
  >
58
58
  <i
59
59
  aria-hidden="true"
60
- class="red trash alternate icon"
60
+ class="red trash alternate outline icon"
61
61
  />
62
62
  </button>
63
63
  </div>
@@ -208,7 +208,7 @@ exports[`<StructureSummary /> matches the latest snapshot with alias 1`] = `
208
208
  >
209
209
  <i
210
210
  aria-hidden="true"
211
- class="red trash alternate icon"
211
+ class="red trash alternate outline icon"
212
212
  />
213
213
  </button>
214
214
  </div>
@@ -34,7 +34,7 @@ exports[`<TagCards /> matches the latest snapshot, renders a link for each tag 1
34
34
  >
35
35
  <i
36
36
  aria-hidden="true"
37
- class="trash icon"
37
+ class="trash alternate outline icon"
38
38
  />
39
39
  </button>
40
40
  </div>
@@ -69,7 +69,7 @@ exports[`<TagCards /> matches the latest snapshot, renders a link for each tag 1
69
69
  >
70
70
  <i
71
71
  aria-hidden="true"
72
- class="trash icon"
72
+ class="trash alternate outline icon"
73
73
  />
74
74
  </button>
75
75
  </div>