@truedat/bg 4.36.7 → 4.37.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@truedat/bg",
3
- "version": "4.36.7",
3
+ "version": "4.37.1",
4
4
  "description": "Truedat Web Business Glossary",
5
5
  "sideEffects": false,
6
6
  "jsnext:main": "src/index.js",
@@ -45,7 +45,7 @@
45
45
  "jest": "^27.0.6",
46
46
  "react": "^16.14.0",
47
47
  "react-dom": "^16.14.0",
48
- "redux-saga-test-plan": "^4.0.1",
48
+ "redux-saga-test-plan": "^4.0.4",
49
49
  "rimraf": "^3.0.2",
50
50
  "semantic-ui-react": "^2.0.3"
51
51
  },
@@ -81,8 +81,8 @@
81
81
  ]
82
82
  },
83
83
  "dependencies": {
84
- "@truedat/core": "4.36.7",
85
- "@truedat/df": "4.36.7",
84
+ "@truedat/core": "4.37.1",
85
+ "@truedat/df": "4.37.1",
86
86
  "file-saver": "^2.0.5",
87
87
  "moment": "^2.24.0",
88
88
  "path-to-regexp": "^1.7.0",
@@ -102,5 +102,5 @@
102
102
  "react-dom": ">= 16.8.6 < 17",
103
103
  "semantic-ui-react": ">= 0.88.2 < 2.1"
104
104
  },
105
- "gitHead": "f5b0b7da7d61e1e8fff39337fe411f4174055b73"
105
+ "gitHead": "36ffd7e86efe27f38c3ae1bb616eb9eb4d444d12"
106
106
  }
@@ -75,7 +75,7 @@ const ModalDelete = ({
75
75
  )}
76
76
  </>
77
77
  }
78
- handleSubmit={() => conceptAction({ action: "delete", ...deleteAction })}
78
+ onConfirm={() => conceptAction({ action: "delete", ...deleteAction })}
79
79
  />
80
80
  );
81
81
 
@@ -107,9 +107,7 @@ const ModalDeprecate = ({ conceptAction, deprecateAction, concept }) => (
107
107
  conceptVersion={_.prop("version")(concept)}
108
108
  />
109
109
  }
110
- handleSubmit={() =>
111
- conceptAction({ action: "deprecate", ...deprecateAction })
112
- }
110
+ onConfirm={() => conceptAction({ action: "deprecate", ...deprecateAction })}
113
111
  />
114
112
  );
115
113
 
@@ -178,7 +178,7 @@ export class ConceptsBulkUpdate extends React.Component {
178
178
  values={{ concepts_count: conceptCount }}
179
179
  />
180
180
  }
181
- handleSubmit={this.handleSubmit}
181
+ onConfirm={this.handleSubmit}
182
182
  />
183
183
  <HistoryBackButton
184
184
  content={<FormattedMessage id="actions.cancel" />}
@@ -80,12 +80,12 @@ exports[`<ConceptsBulkUpdate /> matches the latest snapshot 1`] = `
80
80
  }
81
81
  />
82
82
  }
83
- handleSubmit={[Function]}
84
83
  header={
85
84
  <Memo(MemoizedFormattedMessage)
86
85
  id="concepts.edit.bulk.confirmation.header"
87
86
  />
88
87
  }
88
+ onConfirm={[Function]}
89
89
  trigger={
90
90
  <Button
91
91
  as="button"
@@ -19,7 +19,7 @@ export const DeleteLink = ({ conceptLinkAction, action, loading }) =>
19
19
  content={
20
20
  <FormattedMessage id="relations.actions.data_field.delete.confirmation.content" />
21
21
  }
22
- handleSubmit={() => conceptLinkAction(action)}
22
+ onConfirm={() => conceptLinkAction(action)}
23
23
  onOpen={(e) => e.stopPropagation()}
24
24
  onClose={(e) => e.stopPropagation()}
25
25
  />
@@ -2,24 +2,27 @@ import _ from "lodash/fp";
2
2
  import React from "react";
3
3
  import PropTypes from "prop-types";
4
4
  import { Link } from "react-router-dom";
5
- import { Dropdown, Button, Modal, Grid } from "semantic-ui-react";
5
+ import { Dropdown, Button } from "semantic-ui-react";
6
6
  import { bindActionCreators } from "redux";
7
7
  import { connect } from "react-redux";
8
- import { FormattedMessage } from "react-intl";
8
+ import { FormattedMessage, useIntl } from "react-intl";
9
9
  import { ConfirmModal, GroupActions } from "@truedat/core/components";
10
10
  import { deleteDomain } from "../routines";
11
11
  import { filterDomains } from "../routines";
12
12
  import { getPrimaryActions, getSecondaryActions } from "../selectors";
13
13
 
14
- const DomainAction = ({ action, icon, messageId, id, ...rest }) => (
15
- <Dropdown.Item
16
- text={<FormattedMessage id={messageId} />}
17
- icon={icon}
18
- as={Link}
19
- to={action(id)}
20
- {...rest}
21
- />
22
- );
14
+ const DomainAction = ({ action, icon, messageId, id, ...rest }) => {
15
+ const { formatMessage } = useIntl();
16
+ return (
17
+ <Dropdown.Item
18
+ text={formatMessage({ id: messageId })}
19
+ icon={icon}
20
+ as={Link}
21
+ to={action(id)}
22
+ {...rest}
23
+ />
24
+ );
25
+ };
23
26
 
24
27
  DomainAction.propTypes = {
25
28
  action: PropTypes.func,
@@ -28,17 +31,20 @@ DomainAction.propTypes = {
28
31
  id: PropTypes.number,
29
32
  };
30
33
 
31
- const DomainActionButton = ({ action, icon, messageId, id, ...rest }) => (
32
- <Button
33
- floated="right"
34
- primary
35
- content={<FormattedMessage id={messageId} />}
36
- icon={icon}
37
- as={Link}
38
- to={action(id)}
39
- {...rest}
40
- />
41
- );
34
+ const DomainActionButton = ({ action, icon, messageId, id, ...rest }) => {
35
+ const { formatMessage } = useIntl();
36
+ return (
37
+ <Button
38
+ floated="right"
39
+ primary
40
+ content={formatMessage({ id: messageId })}
41
+ icon={icon}
42
+ as={Link}
43
+ to={action(id)}
44
+ {...rest}
45
+ />
46
+ );
47
+ };
42
48
 
43
49
  DomainActionButton.propTypes = {
44
50
  action: PropTypes.func,
@@ -47,73 +53,37 @@ DomainActionButton.propTypes = {
47
53
  id: PropTypes.number,
48
54
  };
49
55
 
50
- const ModalConfirm = ({
51
- open,
52
- header,
53
- subHeader,
54
- content,
55
- onCancel,
56
- onConfirm,
57
- }) => (
58
- <Modal open={open} onClose={onCancel} closeIcon size="small">
59
- {header && (
60
- <Modal.Header>
61
- {header}
62
- {subHeader && <div className="subheader">{subHeader}</div>}
63
- </Modal.Header>
64
- )}
65
- <Modal.Content>{content}</Modal.Content>
66
- <Modal.Actions>
67
- <Grid columns="equal">
68
- <Grid.Column>
69
- <Button fluid secondary onClick={onCancel}>
70
- <FormattedMessage id="actions.cancel" />
71
- </Button>
72
- </Grid.Column>
73
- <Grid.Column>
74
- <Button fluid negative onClick={onConfirm}>
75
- <FormattedMessage id="actions.delete" />
76
- </Button>
77
- </Grid.Column>
78
- </Grid>
79
- </Modal.Actions>
80
- </Modal>
81
- );
82
-
83
- ModalConfirm.propTypes = {
84
- open: PropTypes.bool,
85
- content: PropTypes.string,
86
- onCancel: PropTypes.func,
87
- onConfirm: PropTypes.func,
88
- header: PropTypes.string,
89
- subHeader: PropTypes.string,
56
+ const ModalDelete = ({ onConfirm }) => {
57
+ const { formatMessage } = useIntl();
58
+ return (
59
+ <ConfirmModal
60
+ header={formatMessage({ id: "domain" })}
61
+ content={formatMessage({ id: "actions.confirm" })}
62
+ onConfirm={onConfirm}
63
+ trigger={
64
+ <Button
65
+ floated="right"
66
+ negative
67
+ content={formatMessage({ id: "actions.delete" })}
68
+ icon="trash"
69
+ />
70
+ }
71
+ />
72
+ );
90
73
  };
91
74
 
92
- const ModalDelete = ({ handleConfirm }) => (
93
- <ConfirmModal
94
- className="confirm-modal"
95
- header={<FormattedMessage id="domain" />}
96
- content={<FormattedMessage id="actions.confirm" />}
97
- handleSubmit={handleConfirm}
98
- trigger={
99
- <Button
100
- floated="right"
101
- negative
102
- content={<FormattedMessage id="actions.delete" />}
103
- icon="trash"
104
- />
105
- }
106
- />
107
- );
75
+ ModalDelete.propTypes = {
76
+ onConfirm: PropTypes.func.isRequired,
77
+ };
108
78
 
109
- const withDelete = (actions, handleConfirm) => [
79
+ const withDelete = (actions, onConfirm) => [
110
80
  ...actions,
111
81
  {
112
82
  key: "delete",
113
83
  icon: "trash",
114
84
  value: "delete",
115
85
  as: ModalDelete,
116
- handleConfirm,
86
+ onConfirm,
117
87
  },
118
88
  ];
119
89
 
@@ -130,12 +100,12 @@ const ActionButtons = ({
130
100
  secondaryActions,
131
101
  deleteAction,
132
102
  id,
133
- handleConfirm,
103
+ onConfirm,
134
104
  }) => {
135
105
  const availableActions = _.flow(
136
106
  composeAvailableActions,
137
107
  _.map(({ action, ...rest }) => ({ ...rest, to: action(id) })),
138
- (actions) => (deleteAction ? withDelete(actions, handleConfirm) : actions)
108
+ (actions) => (deleteAction ? withDelete(actions, onConfirm) : actions)
139
109
  )(secondaryActions);
140
110
 
141
111
  return (
@@ -152,7 +122,7 @@ const ActionButtons = ({
152
122
 
153
123
  ActionButtons.propTypes = {
154
124
  id: PropTypes.number,
155
- handleConfirm: PropTypes.func,
125
+ onConfirm: PropTypes.func,
156
126
  };
157
127
 
158
128
  export class DomainActions extends React.Component {
@@ -184,7 +154,7 @@ export class DomainActions extends React.Component {
184
154
  deleteAction={deleteAction}
185
155
  show={this.show}
186
156
  id={id}
187
- handleConfirm={this.handleConfirm}
157
+ onConfirm={this.handleConfirm}
188
158
  />
189
159
  );
190
160
  };
@@ -53,7 +53,7 @@ export const ModalOnRoleDeletion = ({
53
53
  id: "domain.members.delete.question",
54
54
  })
55
55
  }
56
- handleSubmit={handleSubmit}
56
+ onConfirm={handleSubmit}
57
57
  trigger={trigger}
58
58
  />
59
59
  );
@@ -8,7 +8,7 @@ exports[`<DomainActions /> matches the latest snapshot 1`] = `
8
8
  "delete": [MockFunction],
9
9
  }
10
10
  }
11
- handleConfirm={[Function]}
12
11
  id={3}
12
+ onConfirm={[Function]}
13
13
  />
14
14
  `;