@truedat/dd 4.44.2 → 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/CHANGELOG.md +10 -0
- package/package.json +23 -19
- package/src/api/mutations.js +27 -0
- package/src/api/queries.js +24 -0
- package/src/api.js +2 -0
- package/src/components/DictionaryRoutes.js +7 -5
- package/src/components/EditDomainPopup.js +1 -1
- package/src/components/FilteredNav.js +9 -9
- package/src/components/GrantFilters.js +1 -5
- package/src/components/GrantRequestApprovalPopup.js +0 -1
- package/src/components/ImplementationStructuresLoader.js +14 -11
- package/src/components/PendingStructureNotes.js +11 -5
- package/src/components/ReferenceDataset.js +23 -0
- package/src/components/ReferenceDatasetActions.js +88 -0
- package/src/components/ReferenceDatasetBreadcrumbs.js +22 -0
- package/src/components/ReferenceDatasetCreate.js +36 -0
- package/src/components/ReferenceDatasetDetail.js +42 -0
- package/src/components/ReferenceDatasetForm.js +109 -0
- package/src/components/ReferenceDatasetHeader.js +32 -0
- package/src/components/ReferenceDatasetRoutes.js +56 -0
- package/src/components/ReferenceDatasetTable.js +42 -0
- package/src/components/ReferenceDatasets.js +61 -0
- package/src/components/ReferenceDatasetsTable.js +105 -0
- package/src/components/StructureConfidentialButton.js +1 -1
- package/src/components/StructureFilters.js +1 -5
- package/src/components/StructureNotesEdit.js +6 -6
- package/src/components/StructureProperties.js +4 -1
- package/src/components/StructureTagsRoutes.js +0 -1
- package/src/components/StructureTypesCrumbs.js +0 -1
- package/src/components/StructureVersionListItem.js +2 -2
- package/src/components/StructureView.js +1 -3
- package/src/components/SystemForm.js +1 -1
- package/src/components/__tests__/ImplementationStructuresLoader.spec.js +12 -54
- package/src/components/__tests__/LineageEventsTable.spec.js +2 -7
- package/src/components/__tests__/LineageRoutes.spec.js +4 -4
- package/src/components/__tests__/PendingStructureNoteRow.spec.js +1 -17
- package/src/components/__tests__/PendingStructureNotes.spec.js +5 -33
- package/src/components/__tests__/ReferenceDataset.spec.js +64 -0
- package/src/components/__tests__/ReferenceDatasetActions.spec.js +17 -0
- package/src/components/__tests__/ReferenceDatasetBreadcrumbs.spec.js +12 -0
- package/src/components/__tests__/ReferenceDatasetCreate.spec.js +12 -0
- package/src/components/__tests__/ReferenceDatasetDetail.spec.js +37 -0
- package/src/components/__tests__/ReferenceDatasetForm.spec.js +51 -0
- package/src/components/__tests__/ReferenceDatasetHeader.spec.js +17 -0
- package/src/components/__tests__/ReferenceDatasetRoutes.spec.js +74 -0
- package/src/components/__tests__/ReferenceDatasetTable.spec.js +18 -0
- package/src/components/__tests__/ReferenceDatasets.spec.js +32 -0
- package/src/components/__tests__/ReferenceDatasetsTable.spec.js +22 -0
- package/src/components/__tests__/StructureConfidentialButton.spec.js +26 -30
- package/src/components/__tests__/StructureGrantRequestButton.spec.js +4 -23
- package/src/components/__tests__/StructureNoteActions.spec.js +2 -19
- package/src/components/__tests__/StructureNotes.spec.js +3 -15
- package/src/components/__tests__/StructureNotesEdit.spec.js +5 -25
- package/src/components/__tests__/StructureProperties.spec.js +6 -8
- package/src/components/__tests__/StructureTagForm.spec.js +1 -3
- package/src/components/__tests__/StructureVersionListItem.spec.js +4 -4
- package/src/components/__tests__/StructuresOptions.spec.js +1 -7
- package/src/components/__tests__/StructuresUploadEventsTable.spec.js +3 -4
- package/src/components/__tests__/__snapshots__/DictionaryRoutes.spec.js.snap +4 -0
- package/src/components/__tests__/__snapshots__/LineageRoutes.spec.js.snap +1 -20
- package/src/components/__tests__/__snapshots__/PendingStructureNotes.spec.js.snap +3 -3
- package/src/components/__tests__/__snapshots__/ProfileExecution.spec.js.snap +2 -1
- package/src/components/__tests__/__snapshots__/ReferenceDataset.spec.js.snap +365 -0
- package/src/components/__tests__/__snapshots__/ReferenceDatasetActions.spec.js.snap +65 -0
- package/src/components/__tests__/__snapshots__/ReferenceDatasetBreadcrumbs.spec.js.snap +25 -0
- package/src/components/__tests__/__snapshots__/ReferenceDatasetCreate.spec.js.snap +98 -0
- package/src/components/__tests__/__snapshots__/ReferenceDatasetDetail.spec.js.snap +135 -0
- package/src/components/__tests__/__snapshots__/ReferenceDatasetForm.spec.js.snap +61 -0
- package/src/components/__tests__/__snapshots__/ReferenceDatasetHeader.spec.js.snap +95 -0
- package/src/components/__tests__/__snapshots__/ReferenceDatasetRoutes.spec.js.snap +414 -0
- package/src/components/__tests__/__snapshots__/ReferenceDatasetTable.spec.js.snap +75 -0
- package/src/components/__tests__/__snapshots__/ReferenceDatasets.spec.js.snap +128 -0
- package/src/components/__tests__/__snapshots__/ReferenceDatasetsTable.spec.js.snap +86 -0
- package/src/components/__tests__/__snapshots__/StructureConfidentialButton.spec.js.snap +13 -33
- package/src/components/__tests__/__snapshots__/StructureNavClassified.spec.js.snap +2 -2
- package/src/components/__tests__/__snapshots__/StructureNotes.spec.js.snap +9 -9
- package/src/components/__tests__/__snapshots__/StructureNotesEdit.spec.js.snap +2 -2
- package/src/components/__tests__/__snapshots__/StructureProperties.spec.js.snap +76 -71
- package/src/components/__tests__/__snapshots__/StructureVersionListItem.spec.js.snap +31 -64
- package/src/messages/en.js +18 -0
- package/src/messages/es.js +20 -0
- package/src/reducers/__tests__/ddMessage.spec.js +26 -5
- package/src/reducers/__tests__/graph.spec.js +1 -6
- package/src/reducers/__tests__/referenceDatasetSaving.spec.js +44 -0
- package/src/reducers/__tests__/structureRedirect.spec.js +37 -13
- package/src/reducers/ddMessage.js +26 -1
- package/src/reducers/index.js +2 -0
- package/src/reducers/referenceDatasetSaving.js +16 -0
- package/src/reducers/structureRedirect.js +36 -15
- package/src/reducers/structuresUploadEvents.js +0 -1
- package/src/routines.js +35 -74
- package/src/sagas/__tests__/createReferenceDataset.spec.js +90 -0
- package/src/sagas/__tests__/deleteReferenceDataset.spec.js +81 -0
- package/src/sagas/__tests__/updateReferenceDataset.spec.js +116 -0
- package/src/sagas/createReferenceDataset.js +34 -0
- package/src/sagas/deleteReferenceDataset.js +29 -0
- package/src/sagas/downloadReferenceDataset.js +44 -0
- package/src/sagas/index.js +31 -22
- package/src/sagas/updateReferenceDataset.js +35 -0
- package/src/selectors/getRelationSortingCriteria.js +3 -5
- package/src/selectors/getTabVisibility.js +1 -4
- package/src/components/__tests__/__snapshots__/ImplementationStructuresLoader.spec.js.snap +0 -30
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@truedat/dd",
|
|
3
|
-
"version": "4.44.
|
|
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.
|
|
26
|
-
"@babel/core": "^7.
|
|
27
|
-
"@babel/plugin-proposal-class-properties": "^7.
|
|
28
|
-
"@babel/plugin-proposal-object-rest-spread": "^7.
|
|
29
|
-
"@babel/plugin-proposal-optional-chaining": "^7.
|
|
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.
|
|
32
|
-
"@babel/preset-env": "^7.
|
|
33
|
-
"@babel/preset-react": "^7.
|
|
34
|
-
"@testing-library/jest-dom": "^5.
|
|
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.
|
|
38
|
-
"babel-jest": "^
|
|
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": "^
|
|
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
|
-
"@
|
|
88
|
-
"@truedat/
|
|
89
|
-
"@truedat/
|
|
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.
|
|
96
|
+
"prop-types": "^15.8.1",
|
|
93
97
|
"react-hook-form": "^7.30.0",
|
|
94
98
|
"react-intl": "^5.20.10",
|
|
95
|
-
"react-moment": "^
|
|
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": "
|
|
114
|
+
"gitHead": "5a339468198c803592b285eddd0dd0c0b0eced93"
|
|
111
115
|
}
|
package/src/api/mutations.js
CHANGED
|
@@ -1,6 +1,33 @@
|
|
|
1
1
|
import { gql } from "@apollo/client";
|
|
2
2
|
import { STRUCTURE_TAG_DETAIL } from "./fragments";
|
|
3
3
|
|
|
4
|
+
export const CREATE_REFERENCE_DATASET = gql`
|
|
5
|
+
mutation CreateReferenceDataset($dataset: CreateReferenceDatasetInput!) {
|
|
6
|
+
createReferenceDataset(dataset: $dataset) {
|
|
7
|
+
id
|
|
8
|
+
name
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
`;
|
|
12
|
+
|
|
13
|
+
export const UPDATE_REFERENCE_DATASET = gql`
|
|
14
|
+
mutation UpdateReferenceDataset($dataset: UpdateReferenceDatasetInput!) {
|
|
15
|
+
updateReferenceDataset(dataset: $dataset) {
|
|
16
|
+
id
|
|
17
|
+
name
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
`;
|
|
21
|
+
|
|
22
|
+
export const DELETE_REFERENCE_DATASET = gql`
|
|
23
|
+
mutation DeleteReferenceDataset($id: ID!) {
|
|
24
|
+
deleteReferenceDataset(id: $id) {
|
|
25
|
+
id
|
|
26
|
+
name
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
`;
|
|
30
|
+
|
|
4
31
|
export const CREATE_STRUCTURE_TAG = gql`
|
|
5
32
|
mutation CreateStructureTag($structureTag: StructureTagInput!) {
|
|
6
33
|
createStructureTag(structureTag: $structureTag) {
|
package/src/api/queries.js
CHANGED
|
@@ -18,3 +18,27 @@ export const STRUCTURE_TAGS_QUERY = gql`
|
|
|
18
18
|
}
|
|
19
19
|
${STRUCTURE_TAG_DETAIL}
|
|
20
20
|
`;
|
|
21
|
+
|
|
22
|
+
export const REFERENCE_DATASETS_QUERY = gql`
|
|
23
|
+
query ReferenceDatasets {
|
|
24
|
+
referenceDatasets {
|
|
25
|
+
id
|
|
26
|
+
name
|
|
27
|
+
headers
|
|
28
|
+
rowCount
|
|
29
|
+
updatedAt
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
`;
|
|
33
|
+
|
|
34
|
+
export const REFERENCE_DATASET_QUERY = gql`
|
|
35
|
+
query ReferenceDataset($id: ID!) {
|
|
36
|
+
referenceDataset(id: $id) {
|
|
37
|
+
id
|
|
38
|
+
name
|
|
39
|
+
headers
|
|
40
|
+
rows
|
|
41
|
+
updatedAt
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
`;
|
package/src/api.js
CHANGED
|
@@ -7,6 +7,7 @@ const API_DATA_STRUCTURE_FILTERS_SEARCH = "/api/data_structure_filters/search";
|
|
|
7
7
|
const API_DATA_STRUCTURE_VERSION = "/api/data_structures/:id/versions/:version";
|
|
8
8
|
const API_GRANT_FILTERS_SEARCH = "/api/grant_filters/search";
|
|
9
9
|
const API_PROFILE_EXECUTION = "/api/profile_executions/:id";
|
|
10
|
+
const API_REFERENCE_DATA_DOWNLOAD = "/api/reference_data/:id/csv";
|
|
10
11
|
const API_GRANT_REQUEST = "/api/grant_requests/:id";
|
|
11
12
|
const API_GRANT_REQUEST_APPROVALS = "/api/grant_requests/:id/approvals";
|
|
12
13
|
const API_GRANT_REQUEST_GROUP = "/api/grant_request_groups";
|
|
@@ -71,6 +72,7 @@ export {
|
|
|
71
72
|
API_NODES,
|
|
72
73
|
API_PROFILE_GROUP,
|
|
73
74
|
API_PROFILE_GROUPS,
|
|
75
|
+
API_REFERENCE_DATA_DOWNLOAD,
|
|
74
76
|
API_SYSTEM,
|
|
75
77
|
API_SYSTEMS,
|
|
76
78
|
API_SYSTEM_STRUCTURES,
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
PENDING_STRUCTURE_NOTES,
|
|
6
6
|
PROFILE_EXECUTION,
|
|
7
7
|
PROFILE_GROUP,
|
|
8
|
+
REFERENCE_DATASETS,
|
|
8
9
|
STRUCTURE_TAGS,
|
|
9
10
|
STRUCTURE_TYPES,
|
|
10
11
|
STRUCTURES,
|
|
@@ -17,6 +18,7 @@ import ProfileExecutionBreadcrumbs from "./ProfileExecutionBreadcrumbs";
|
|
|
17
18
|
import ProfileExecutionLoader from "./ProfileExecutionLoader";
|
|
18
19
|
import ProfileGroupLoader from "./ProfileGroupLoader";
|
|
19
20
|
import ProfileGroup from "./ProfileGroup";
|
|
21
|
+
import ReferenceDatasetRoutes from "./ReferenceDatasetRoutes";
|
|
20
22
|
import StructureFiltersLoader from "./StructureFiltersLoader";
|
|
21
23
|
import StructuresLoader from "./StructuresLoader";
|
|
22
24
|
import StructuresRoutes from "./StructuresRoutes";
|
|
@@ -84,11 +86,7 @@ export const DictionaryRoutes = () => {
|
|
|
84
86
|
/>
|
|
85
87
|
<Route
|
|
86
88
|
path={STRUCTURES_UPLOAD_EVENTS}
|
|
87
|
-
render={() =>
|
|
88
|
-
<>
|
|
89
|
-
<StructuresUploadEvents />
|
|
90
|
-
</>
|
|
91
|
-
)}
|
|
89
|
+
render={() => <StructuresUploadEvents />}
|
|
92
90
|
/>
|
|
93
91
|
<Route
|
|
94
92
|
path={PENDING_STRUCTURE_NOTES}
|
|
@@ -100,6 +98,10 @@ export const DictionaryRoutes = () => {
|
|
|
100
98
|
</>
|
|
101
99
|
)}
|
|
102
100
|
/>
|
|
101
|
+
<Route
|
|
102
|
+
path={REFERENCE_DATASETS}
|
|
103
|
+
render={() => <ReferenceDatasetRoutes />}
|
|
104
|
+
/>
|
|
103
105
|
<Route
|
|
104
106
|
path={PROFILE_GROUP}
|
|
105
107
|
render={() => (
|
|
@@ -15,7 +15,7 @@ export const EditDomainPopup = ({ userPermissions, saving, text }) => {
|
|
|
15
15
|
}
|
|
16
16
|
}, [saving]);
|
|
17
17
|
|
|
18
|
-
return userPermissions
|
|
18
|
+
return userPermissions?.update && userPermissions?.update_domain ? (
|
|
19
19
|
<Popup
|
|
20
20
|
on="click"
|
|
21
21
|
basic
|
|
@@ -2,19 +2,19 @@ import _ from "lodash/fp";
|
|
|
2
2
|
import React, { useState } from "react";
|
|
3
3
|
import PropTypes from "prop-types";
|
|
4
4
|
import { connect } from "react-redux";
|
|
5
|
-
import {
|
|
5
|
+
import { lowerDeburrTrim } from "@truedat/core/services/sort";
|
|
6
6
|
import { getSortedStructureChildren, getStructureParent } from "../selectors";
|
|
7
7
|
import StructureNav from "./StructureNav";
|
|
8
8
|
import StructureSearch from "./StructureSearch";
|
|
9
9
|
|
|
10
10
|
export const FilteredNav = ({ childStructures, parentStructure }) => {
|
|
11
11
|
const [searchValue, setSearchValue] = useState("");
|
|
12
|
-
const onChange = searchValue => setSearchValue(searchValue);
|
|
12
|
+
const onChange = (searchValue) => setSearchValue(searchValue);
|
|
13
13
|
|
|
14
|
-
const filteredStructures = collection => {
|
|
15
|
-
const normalizedSearchValue =
|
|
16
|
-
return _.filter(structure =>
|
|
17
|
-
_.contains(normalizedSearchValue)(
|
|
14
|
+
const filteredStructures = (collection) => {
|
|
15
|
+
const normalizedSearchValue = lowerDeburrTrim(searchValue);
|
|
16
|
+
return _.filter((structure) =>
|
|
17
|
+
_.contains(normalizedSearchValue)(lowerDeburrTrim(structure.name))
|
|
18
18
|
)(collection);
|
|
19
19
|
};
|
|
20
20
|
|
|
@@ -31,12 +31,12 @@ export const FilteredNav = ({ childStructures, parentStructure }) => {
|
|
|
31
31
|
|
|
32
32
|
FilteredNav.propTypes = {
|
|
33
33
|
childStructures: PropTypes.array,
|
|
34
|
-
parentStructure: PropTypes.object
|
|
34
|
+
parentStructure: PropTypes.object,
|
|
35
35
|
};
|
|
36
36
|
|
|
37
|
-
const mapStateToProps = state => ({
|
|
37
|
+
const mapStateToProps = (state) => ({
|
|
38
38
|
parentStructure: getStructureParent(state),
|
|
39
|
-
childStructures: getSortedStructureChildren(state)
|
|
39
|
+
childStructures: getSortedStructureChildren(state),
|
|
40
40
|
});
|
|
41
41
|
|
|
42
42
|
export default connect(mapStateToProps)(FilteredNav);
|
|
@@ -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),
|
|
@@ -1,20 +1,16 @@
|
|
|
1
1
|
import _ from "lodash/fp";
|
|
2
2
|
import { useEffect, useState } from "react";
|
|
3
3
|
import PropTypes from "prop-types";
|
|
4
|
-
import { connect
|
|
4
|
+
import { connect } from "react-redux";
|
|
5
5
|
import { fetchStructure, clearStructure } from "../routines";
|
|
6
6
|
|
|
7
7
|
export const ImplementationStructuresLoader = ({
|
|
8
|
-
structureIds,
|
|
9
|
-
fetchStructure,
|
|
10
8
|
clearStructure,
|
|
9
|
+
fetchStructure,
|
|
10
|
+
structureIds,
|
|
11
|
+
structuresFields,
|
|
12
|
+
structuresSiblings,
|
|
11
13
|
}) => {
|
|
12
|
-
const structuresFields = useSelector((state) =>
|
|
13
|
-
_.keys(state.structuresFields)
|
|
14
|
-
);
|
|
15
|
-
const structuresSiblings = useSelector((state) =>
|
|
16
|
-
_.keys(state.structuresSiblings)
|
|
17
|
-
);
|
|
18
14
|
const structures = _.flow(
|
|
19
15
|
_.concat(structuresFields),
|
|
20
16
|
_.map(_.toInteger),
|
|
@@ -48,10 +44,17 @@ export const ImplementationStructuresLoader = ({
|
|
|
48
44
|
};
|
|
49
45
|
|
|
50
46
|
ImplementationStructuresLoader.propTypes = {
|
|
51
|
-
fetchStructure: PropTypes.func,
|
|
52
47
|
clearStructure: PropTypes.func,
|
|
48
|
+
fetchStructure: PropTypes.func,
|
|
49
|
+
structuresFields: PropTypes.array,
|
|
50
|
+
structuresSiblings: PropTypes.array,
|
|
53
51
|
};
|
|
54
52
|
|
|
55
|
-
export
|
|
53
|
+
export const mapStateToProps = ({ structuresFields, structuresSiblings }) => ({
|
|
54
|
+
structuresFields: _.keys(structuresFields),
|
|
55
|
+
structuresSiblings: _.keys(structuresSiblings),
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
export default connect(mapStateToProps, { fetchStructure, clearStructure })(
|
|
56
59
|
ImplementationStructuresLoader
|
|
57
60
|
);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _ from "lodash/fp";
|
|
2
2
|
import React, { useState } from "react";
|
|
3
|
-
import
|
|
3
|
+
import PropTypes from "prop-types";
|
|
4
|
+
import { connect } from "react-redux";
|
|
4
5
|
import { FormattedMessage, useIntl } from "react-intl";
|
|
5
6
|
import { gql, useQuery } from "@apollo/client";
|
|
6
7
|
import { Checkbox, Form, Header, Icon, Segment } from "semantic-ui-react";
|
|
@@ -37,15 +38,14 @@ export const STRUCTURE_NOTES = gql`
|
|
|
37
38
|
|
|
38
39
|
const STATUS = ["pending_approval", "draft", "rejected"];
|
|
39
40
|
|
|
40
|
-
export const PendingStructureNotes = () => {
|
|
41
|
+
export const PendingStructureNotes = ({ systems }) => {
|
|
41
42
|
const { formatMessage } = useIntl();
|
|
42
|
-
const { systems } = useSelector(_.pick(["systems"]));
|
|
43
43
|
const [filter, setFilter] = useState({
|
|
44
44
|
statuses: STATUS,
|
|
45
45
|
});
|
|
46
46
|
const { loading, error, data } = useQuery(STRUCTURE_NOTES, {
|
|
47
47
|
variables: { filter },
|
|
48
|
-
fetchPolicy: "network
|
|
48
|
+
fetchPolicy: "cache-and-network",
|
|
49
49
|
});
|
|
50
50
|
const items = loading || error ? [] : data?.structure_notes;
|
|
51
51
|
const { control } = useForm({
|
|
@@ -146,4 +146,10 @@ export const PendingStructureNotes = () => {
|
|
|
146
146
|
);
|
|
147
147
|
};
|
|
148
148
|
|
|
149
|
-
|
|
149
|
+
PendingStructureNotes.propTypes = {
|
|
150
|
+
systems: PropTypes.array,
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
export const mapStateToProps = ({ systems }) => ({ systems });
|
|
154
|
+
|
|
155
|
+
export default connect(mapStateToProps)(PendingStructureNotes);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
import { Divider, Segment } from "semantic-ui-react";
|
|
4
|
+
import ReferenceDatasetBreadcrumbs from "./ReferenceDatasetBreadcrumbs";
|
|
5
|
+
import ReferenceDatasetDetail from "./ReferenceDatasetDetail";
|
|
6
|
+
import ReferenceDatasetHeader from "./ReferenceDatasetHeader";
|
|
7
|
+
|
|
8
|
+
export const ReferenceDataset = ({ dataset }) => (
|
|
9
|
+
<>
|
|
10
|
+
<ReferenceDatasetBreadcrumbs text={dataset.name} />
|
|
11
|
+
<Segment>
|
|
12
|
+
<ReferenceDatasetHeader dataset={dataset} />
|
|
13
|
+
<Divider hidden />
|
|
14
|
+
<ReferenceDatasetDetail dataset={dataset} />
|
|
15
|
+
</Segment>
|
|
16
|
+
</>
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
ReferenceDataset.propTypes = {
|
|
20
|
+
dataset: PropTypes.object,
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export default ReferenceDataset;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
import { Link } from "react-router-dom";
|
|
4
|
+
import { connect } from "react-redux";
|
|
5
|
+
import { useIntl } from "react-intl";
|
|
6
|
+
import { Button } from "semantic-ui-react";
|
|
7
|
+
import { ConfirmModal, GroupActions } from "@truedat/core/components";
|
|
8
|
+
import { linkTo } from "@truedat/core/routes";
|
|
9
|
+
import { deleteReferenceDataset, downloadReferenceDataset } from "../routines";
|
|
10
|
+
|
|
11
|
+
export const ConfirmDeleteModal = ({ onConfirm, name, id }) => {
|
|
12
|
+
const { formatMessage } = useIntl();
|
|
13
|
+
return (
|
|
14
|
+
<ConfirmModal
|
|
15
|
+
icon="trash"
|
|
16
|
+
trigger={
|
|
17
|
+
<Button
|
|
18
|
+
icon="trash"
|
|
19
|
+
content={formatMessage({ id: "actions.delete" })}
|
|
20
|
+
/>
|
|
21
|
+
}
|
|
22
|
+
header={formatMessage({
|
|
23
|
+
id: "referenceDataset.actions.delete.confirmation.header",
|
|
24
|
+
})}
|
|
25
|
+
size="small"
|
|
26
|
+
content={formatMessage(
|
|
27
|
+
{ id: "referenceDataset.actions.delete.confirmation.content" },
|
|
28
|
+
{ name: <i>{name}</i> }
|
|
29
|
+
)}
|
|
30
|
+
onConfirm={() => onConfirm({ id })}
|
|
31
|
+
/>
|
|
32
|
+
);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
ConfirmDeleteModal.propTypes = {
|
|
36
|
+
onConfirm: PropTypes.func,
|
|
37
|
+
name: PropTypes.string,
|
|
38
|
+
id: PropTypes.string,
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export const ReferenceDatasetActions = ({
|
|
42
|
+
deleteReferenceDataset,
|
|
43
|
+
downloadReferenceDataset,
|
|
44
|
+
dataset,
|
|
45
|
+
}) => {
|
|
46
|
+
const { formatMessage } = useIntl();
|
|
47
|
+
const { id, name } = dataset || {};
|
|
48
|
+
const actions = [
|
|
49
|
+
{
|
|
50
|
+
key: "edit",
|
|
51
|
+
icon: "edit",
|
|
52
|
+
text: formatMessage({ id: "actions.edit" }),
|
|
53
|
+
value: "edit",
|
|
54
|
+
as: Link,
|
|
55
|
+
to: linkTo.REFERENCE_DATASET_EDIT({ id }),
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
key: "download",
|
|
59
|
+
icon: "download",
|
|
60
|
+
text: formatMessage({ id: "actions.download" }),
|
|
61
|
+
value: "download",
|
|
62
|
+
as: "a",
|
|
63
|
+
onClick: () => downloadReferenceDataset({ id, name }),
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
key: "delete",
|
|
67
|
+
icon: "trash",
|
|
68
|
+
value: "delete",
|
|
69
|
+
as: ConfirmDeleteModal,
|
|
70
|
+
onConfirm: deleteReferenceDataset,
|
|
71
|
+
name,
|
|
72
|
+
id,
|
|
73
|
+
},
|
|
74
|
+
];
|
|
75
|
+
|
|
76
|
+
return <GroupActions availableActions={actions} />;
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
ReferenceDatasetActions.propTypes = {
|
|
80
|
+
deleteReferenceDataset: PropTypes.func,
|
|
81
|
+
downloadReferenceDataset: PropTypes.func,
|
|
82
|
+
dataset: PropTypes.object.isRequired,
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
export default connect(null, {
|
|
86
|
+
deleteReferenceDataset,
|
|
87
|
+
downloadReferenceDataset,
|
|
88
|
+
})(ReferenceDatasetActions);
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
import { Breadcrumb } from "semantic-ui-react";
|
|
4
|
+
import { Link } from "react-router-dom";
|
|
5
|
+
import { FormattedMessage } from "react-intl";
|
|
6
|
+
import { REFERENCE_DATASETS } from "@truedat/core/routes";
|
|
7
|
+
|
|
8
|
+
export const ReferenceDatasetBreadcrumbs = ({ text }) => (
|
|
9
|
+
<Breadcrumb>
|
|
10
|
+
<Breadcrumb.Section as={Link} to={REFERENCE_DATASETS} active={false}>
|
|
11
|
+
<FormattedMessage id="sidemenu.referenceData" />
|
|
12
|
+
</Breadcrumb.Section>
|
|
13
|
+
<Breadcrumb.Divider icon="right angle" />
|
|
14
|
+
<Breadcrumb.Section active>{text}</Breadcrumb.Section>
|
|
15
|
+
</Breadcrumb>
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
ReferenceDatasetBreadcrumbs.propTypes = {
|
|
19
|
+
text: PropTypes.string,
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export default ReferenceDatasetBreadcrumbs;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
import { connect } from "react-redux";
|
|
4
|
+
import { Container, Header, Icon, Segment } from "semantic-ui-react";
|
|
5
|
+
import { FormattedMessage, useIntl } from "react-intl";
|
|
6
|
+
import { createReferenceDataset } from "../routines";
|
|
7
|
+
import ReferenceDatasetBreadcrumbs from "./ReferenceDatasetBreadcrumbs";
|
|
8
|
+
import ReferenceDatasetForm from "./ReferenceDatasetForm";
|
|
9
|
+
|
|
10
|
+
export const ReferenceDatasetCreate = ({ createReferenceDataset }) => {
|
|
11
|
+
const { formatMessage } = useIntl();
|
|
12
|
+
return (
|
|
13
|
+
<>
|
|
14
|
+
<ReferenceDatasetBreadcrumbs
|
|
15
|
+
text={formatMessage({ id: "referenceDatasets.actions.create" })}
|
|
16
|
+
/>
|
|
17
|
+
<Container as={Segment} text>
|
|
18
|
+
<Header as="h2">
|
|
19
|
+
<Icon name="list ol" />
|
|
20
|
+
<Header.Content>
|
|
21
|
+
<FormattedMessage id="referenceDatasets.actions.create" />
|
|
22
|
+
</Header.Content>
|
|
23
|
+
</Header>
|
|
24
|
+
<ReferenceDatasetForm onSubmit={createReferenceDataset} />
|
|
25
|
+
</Container>
|
|
26
|
+
</>
|
|
27
|
+
);
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
ReferenceDatasetCreate.propTypes = {
|
|
31
|
+
createReferenceDataset: PropTypes.func.isRequired,
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export default connect(null, { createReferenceDataset })(
|
|
35
|
+
ReferenceDatasetCreate
|
|
36
|
+
);
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
import { connect } from "react-redux";
|
|
4
|
+
import { Switch, Route } from "react-router-dom";
|
|
5
|
+
import {
|
|
6
|
+
REFERENCE_DATASET_EDIT,
|
|
7
|
+
REFERENCE_DATASET,
|
|
8
|
+
} from "@truedat/core/routes";
|
|
9
|
+
import { updateReferenceDataset } from "../routines";
|
|
10
|
+
import ReferenceDatasetTable from "./ReferenceDatasetTable";
|
|
11
|
+
import ReferenceDatasetForm from "./ReferenceDatasetForm";
|
|
12
|
+
|
|
13
|
+
export const ReferenceDatasetDetail = ({ dataset, updateReferenceDataset }) => (
|
|
14
|
+
<Switch>
|
|
15
|
+
<Route
|
|
16
|
+
path={REFERENCE_DATASET_EDIT}
|
|
17
|
+
exact
|
|
18
|
+
render={() => (
|
|
19
|
+
<ReferenceDatasetForm
|
|
20
|
+
dataset={dataset}
|
|
21
|
+
onSubmit={(data) =>
|
|
22
|
+
updateReferenceDataset({ ...data, id: dataset.id })
|
|
23
|
+
}
|
|
24
|
+
/>
|
|
25
|
+
)}
|
|
26
|
+
/>
|
|
27
|
+
<Route
|
|
28
|
+
path={REFERENCE_DATASET}
|
|
29
|
+
exact
|
|
30
|
+
render={() => <ReferenceDatasetTable {...dataset} />}
|
|
31
|
+
/>
|
|
32
|
+
</Switch>
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
ReferenceDatasetDetail.propTypes = {
|
|
36
|
+
dataset: PropTypes.object.isRequired,
|
|
37
|
+
updateReferenceDataset: PropTypes.func,
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export default connect(null, { updateReferenceDataset })(
|
|
41
|
+
ReferenceDatasetDetail
|
|
42
|
+
);
|