@truedat/core 4.36.7 → 4.36.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.36.8] 2022-01-24
4
+
5
+ ### Changed
6
+
7
+ - [TD-4125] Renamed `ConfirmModal` prop `handleSubmit` to `onConfirm`
8
+
3
9
  ## [4.36.6] 2022-01-07
4
10
 
5
11
  ### Fixed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@truedat/core",
3
- "version": "4.36.7",
3
+ "version": "4.36.8",
4
4
  "description": "Truedat Web Core",
5
5
  "sideEffects": false,
6
6
  "jsnext:main": "src/index.js",
@@ -44,7 +44,7 @@
44
44
  "jest-localstorage-mock": "^2.4.14",
45
45
  "react": "^16.14.0",
46
46
  "react-dom": "^16.14.0",
47
- "redux-saga-test-plan": "^4.0.1",
47
+ "redux-saga-test-plan": "^4.0.4",
48
48
  "rimraf": "^3.0.2",
49
49
  "semantic-ui-react": "^2.0.3"
50
50
  },
@@ -104,5 +104,5 @@
104
104
  "react-dom": ">= 16.8.6 < 17",
105
105
  "semantic-ui-react": ">= 0.88.2 < 2.1"
106
106
  },
107
- "gitHead": "f5b0b7da7d61e1e8fff39337fe411f4174055b73"
107
+ "gitHead": "b9b8ee80998b230697593b5d207d187971bc0724"
108
108
  }
@@ -70,4 +70,4 @@ const generateCsvHeaders = _.flow(
70
70
  label: key.toUpperCase(),
71
71
  key,
72
72
  }))
73
- );
73
+ );
@@ -3,18 +3,18 @@ import PropTypes from "prop-types";
3
3
  import { Modal } from "semantic-ui-react";
4
4
  import { FormattedMessage } from "react-intl";
5
5
 
6
- const predefined_actions = handleSubmit => [
6
+ const defaultActions = (onConfirm) => [
7
7
  {
8
8
  key: "no",
9
9
  secondary: true,
10
- content: <FormattedMessage id="confirmation.no" />
10
+ content: <FormattedMessage id="confirmation.no" />,
11
11
  },
12
12
  {
13
13
  key: "yes",
14
14
  negative: true,
15
15
  content: <FormattedMessage id="confirmation.yes" />,
16
- onClick: handleSubmit
17
- }
16
+ onClick: onConfirm,
17
+ },
18
18
  ];
19
19
 
20
20
  const CoolHeader = ({ header, subHeader }) => (
@@ -25,7 +25,7 @@ const CoolHeader = ({ header, subHeader }) => (
25
25
  );
26
26
  CoolHeader.propTypes = {
27
27
  header: PropTypes.any,
28
- subHeader: PropTypes.any
28
+ subHeader: PropTypes.any,
29
29
  };
30
30
 
31
31
  export const ConfirmModal = ({
@@ -37,22 +37,22 @@ export const ConfirmModal = ({
37
37
  subHeader,
38
38
  content,
39
39
  onClose,
40
- handleSubmit,
40
+ onConfirm,
41
41
  trigger,
42
- size
42
+ size,
43
43
  }) => (
44
44
  <Modal
45
45
  icon={icon}
46
46
  open={open}
47
47
  onOpen={onOpen}
48
48
  onClose={onClose}
49
- actions={actions || predefined_actions(handleSubmit)}
49
+ actions={actions || defaultActions(onConfirm)}
50
50
  trigger={trigger}
51
51
  closeIcon
52
52
  size={size || "small"}
53
53
  header={<CoolHeader header={header} subHeader={subHeader} />}
54
54
  content={
55
- content.type === "string" ? (
55
+ content?.type === "string" ? (
56
56
  content
57
57
  ) : (
58
58
  <Modal.Content>{content}</Modal.Content>
@@ -69,10 +69,10 @@ ConfirmModal.propTypes = {
69
69
  header: PropTypes.any,
70
70
  subHeader: PropTypes.any,
71
71
  content: PropTypes.any,
72
- handleSubmit: PropTypes.func,
72
+ onConfirm: PropTypes.func,
73
73
  onClose: PropTypes.func,
74
74
  trigger: PropTypes.element,
75
- size: PropTypes.string
75
+ size: PropTypes.string,
76
76
  };
77
77
 
78
78
  export default ConfirmModal;
@@ -6,7 +6,7 @@ import { FormattedMessage } from "react-intl";
6
6
  import { ConfirmModal } from "./ConfirmModal";
7
7
 
8
8
  export const SaveFilterForm = ({ setFilterName }) => {
9
- const onChange = value => {
9
+ const onChange = (value) => {
10
10
  setFilterName(value);
11
11
  };
12
12
 
@@ -26,32 +26,32 @@ export const SaveFilterForm = ({ setFilterName }) => {
26
26
  };
27
27
 
28
28
  SaveFilterForm.propTypes = {
29
- setFilterName: PropTypes.func
29
+ setFilterName: PropTypes.func,
30
30
  };
31
31
 
32
32
  export const ModalSaveFilter = ({ saveFilters, activeFilters }) => {
33
33
  const [filterName, setFilterName] = useState("");
34
34
 
35
- const actions = handleSubmit => [
35
+ const actions = (handleSubmit) => [
36
36
  {
37
37
  key: "no",
38
38
  secondary: true,
39
- content: <FormattedMessage id="search.save_filter.cancel" />
39
+ content: <FormattedMessage id="search.save_filter.cancel" />,
40
40
  },
41
41
  {
42
42
  key: "yes",
43
43
  primary: true,
44
44
  disabled: _.isEmpty(filterName),
45
45
  content: <FormattedMessage id="search.save_filter.save" />,
46
- onClick: handleSubmit
47
- }
46
+ onClick: handleSubmit,
47
+ },
48
48
  ];
49
49
 
50
- const handleSubmit = e => {
50
+ const handleSubmit = (e) => {
51
51
  e.preventDefault();
52
52
  saveFilters({
53
53
  filters: activeFilters,
54
- filterName: filterName
54
+ filterName: filterName,
55
55
  });
56
56
  };
57
57
 
@@ -70,14 +70,14 @@ export const ModalSaveFilter = ({ saveFilters, activeFilters }) => {
70
70
  content={
71
71
  <SaveFilterForm setFilterName={setFilterName} filterName={filterName} />
72
72
  }
73
- handleSubmit={handleSubmit}
73
+ onConfirm={handleSubmit}
74
74
  />
75
75
  );
76
76
  };
77
77
 
78
78
  ModalSaveFilter.propTypes = {
79
79
  saveFilters: PropTypes.func,
80
- activeFilters: PropTypes.object
80
+ activeFilters: PropTypes.object,
81
81
  };
82
82
 
83
83
  export default ModalSaveFilter;
@@ -10,7 +10,7 @@ export const UserFilters = ({
10
10
  deleteUserFilter,
11
11
  resetFilters,
12
12
  selectedUserFilter,
13
- userFilters
13
+ userFilters,
14
14
  }) => {
15
15
  return (
16
16
  <>
@@ -23,7 +23,7 @@ export const UserFilters = ({
23
23
  key={`label${userFilter.id}.${i}`}
24
24
  >
25
25
  <span
26
- onClick={e => {
26
+ onClick={(e) => {
27
27
  e.preventDefault();
28
28
  e.stopPropagation();
29
29
  if (selectedUserFilter == userFilter.name) {
@@ -58,13 +58,11 @@ export const UserFilters = ({
58
58
  <b>
59
59
  <i>{userFilter.name}</i>
60
60
  </b>
61
- )
61
+ ),
62
62
  }}
63
63
  />
64
64
  }
65
- handleSubmit={() => {
66
- deleteUserFilter({ id: userFilter.id });
67
- }}
65
+ onConfirm={() => deleteUserFilter({ id: userFilter.id })}
68
66
  />
69
67
  </Label>
70
68
  ))}
@@ -79,7 +77,7 @@ UserFilters.propTypes = {
79
77
  deleteUserFilter: PropTypes.func,
80
78
  resetFilters: PropTypes.func,
81
79
  selectedUserFilter: PropTypes.string,
82
- userFilters: PropTypes.array
80
+ userFilters: PropTypes.array,
83
81
  };
84
82
 
85
83
  export default UserFilters;
@@ -14,7 +14,7 @@ describe("<Alert />", () => {
14
14
  content: "content.message.id",
15
15
  header: "header.message.id",
16
16
  text: "some text",
17
- icon: "warning"
17
+ icon: "warning",
18
18
  };
19
19
  const props = { message, dismissAlert };
20
20
 
@@ -40,13 +40,13 @@ describe("<Alert />", () => {
40
40
  text: "",
41
41
  messages: [
42
42
  {
43
- id: "message.0.id"
43
+ id: "message.0.id",
44
44
  },
45
45
  {
46
46
  id: "message.1.id",
47
- fields: { count: 1 }
48
- }
49
- ]
47
+ fields: { count: 1 },
48
+ },
49
+ ],
50
50
  };
51
51
  const props = { message, dismissAlert };
52
52
  const wrapper = shallow(<Alert {...props} />);
@@ -28,13 +28,13 @@ exports[`<ModalSaveFilter /> matches the latest snapshot 1`] = `
28
28
  setFilterName={[Function]}
29
29
  />
30
30
  }
31
- handleSubmit={[Function]}
32
31
  header={
33
32
  <Memo(MemoizedFormattedMessage)
34
33
  id="search.filters.actions.save.confirmation.header"
35
34
  />
36
35
  }
37
36
  icon="save"
37
+ onConfirm={[Function]}
38
38
  trigger={
39
39
  <a
40
40
  className="resetFilters"
@@ -31,13 +31,13 @@ exports[`<UserFilters /> matches the latest snapshot 1`] = `
31
31
  }
32
32
  />
33
33
  }
34
- handleSubmit={[Function]}
35
34
  header={
36
35
  <Memo(MemoizedFormattedMessage)
37
36
  id="search.filters.actions.delete.confirmation.header"
38
37
  />
39
38
  }
40
39
  icon="trash"
40
+ onConfirm={[Function]}
41
41
  trigger={
42
42
  <Icon
43
43
  as="i"
@@ -75,13 +75,13 @@ exports[`<UserFilters /> matches the latest snapshot 1`] = `
75
75
  }
76
76
  />
77
77
  }
78
- handleSubmit={[Function]}
79
78
  header={
80
79
  <Memo(MemoizedFormattedMessage)
81
80
  id="search.filters.actions.delete.confirmation.header"
82
81
  />
83
82
  }
84
83
  icon="trash"
84
+ onConfirm={[Function]}
85
85
  trigger={
86
86
  <Icon
87
87
  as="i"
package/src/routes.js CHANGED
@@ -112,7 +112,7 @@ export const SEARCH_RESULTS = "/search/results";
112
112
  export const SEARCH_STRUCTURES = "/search/structures";
113
113
  export const SOURCE = "/sources/:external_id";
114
114
  export const SOURCES = "/sources";
115
- export const SOURCE_CREATE = "/sources/new";
115
+ export const SOURCES_NEW = "/sources/new";
116
116
  export const SOURCE_EDIT = "/sources/:external_id/edit";
117
117
  export const SOURCE_JOBS = "/sources/:external_id/jobs";
118
118
  export const SOURCE_JOBS_NEW = "/sources/:external_id/jobs/new";
@@ -252,7 +252,7 @@ const routes = {
252
252
  SEARCH_RESULTS,
253
253
  SEARCH_STRUCTURES,
254
254
  SEARCH,
255
- SOURCE_CREATE,
255
+ SOURCES_NEW,
256
256
  SOURCE_EDIT,
257
257
  SOURCE_JOBS_NEW,
258
258
  SOURCE_JOBS,