@truedat/dd 4.52.0 → 4.52.3
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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@truedat/dd",
|
|
3
|
-
"version": "4.52.
|
|
3
|
+
"version": "4.52.3",
|
|
4
4
|
"description": "Truedat Web Data Dictionary",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"jsnext:main": "src/index.js",
|
|
@@ -112,5 +112,5 @@
|
|
|
112
112
|
"react-dom": ">= 16.8.6 < 17",
|
|
113
113
|
"semantic-ui-react": ">= 0.88.2 < 2.1"
|
|
114
114
|
},
|
|
115
|
-
"gitHead": "
|
|
115
|
+
"gitHead": "64a180a3031aa1e24fdfe1db18b5773e43e20486"
|
|
116
116
|
}
|
|
@@ -9,7 +9,7 @@ import { Button, Segment, Message, Loader, Label } from "semantic-ui-react";
|
|
|
9
9
|
import { linkTo } from "@truedat/core/routes";
|
|
10
10
|
import {
|
|
11
11
|
getActiveStructureNotes,
|
|
12
|
-
getVersionedStructureNotes
|
|
12
|
+
getVersionedStructureNotes,
|
|
13
13
|
} from "../selectors/getSortedStructureNotes";
|
|
14
14
|
|
|
15
15
|
import StructureNoteActions from "./StructureNoteActions";
|
|
@@ -33,7 +33,7 @@ const StructureNote = ({ structureNote, template, structure, notesSize }) => {
|
|
|
33
33
|
style={{
|
|
34
34
|
display: "flex",
|
|
35
35
|
justifyContent: "space-between",
|
|
36
|
-
alignItems: "center"
|
|
36
|
+
alignItems: "center",
|
|
37
37
|
}}
|
|
38
38
|
>
|
|
39
39
|
<div>
|
|
@@ -87,7 +87,7 @@ StructureNote.propTypes = {
|
|
|
87
87
|
structureNote: PropTypes.object,
|
|
88
88
|
template: PropTypes.object,
|
|
89
89
|
structure: PropTypes.object,
|
|
90
|
-
notesSize: PropTypes.number
|
|
90
|
+
notesSize: PropTypes.number,
|
|
91
91
|
};
|
|
92
92
|
|
|
93
93
|
export const StructureNotes = ({
|
|
@@ -95,7 +95,7 @@ export const StructureNotes = ({
|
|
|
95
95
|
structureNotes: { _actions, loading },
|
|
96
96
|
activeStructureNotes,
|
|
97
97
|
versionedStructureNotes,
|
|
98
|
-
template
|
|
98
|
+
template,
|
|
99
99
|
}) => {
|
|
100
100
|
const { formatMessage } = useIntl();
|
|
101
101
|
const [isShowingVersioned, setShowingVersioned] = useState(false);
|
|
@@ -111,7 +111,7 @@ export const StructureNotes = ({
|
|
|
111
111
|
header={formatMessage({ id: "structure.notes.empty" })}
|
|
112
112
|
/>
|
|
113
113
|
)}
|
|
114
|
-
{activeStructureNotes.map(sn => (
|
|
114
|
+
{activeStructureNotes.map((sn) => (
|
|
115
115
|
<StructureNote
|
|
116
116
|
key={sn.id}
|
|
117
117
|
structure={structure}
|
|
@@ -133,12 +133,12 @@ export const StructureNotes = ({
|
|
|
133
133
|
<Button
|
|
134
134
|
onClick={() => setShowingVersioned(!isShowingVersioned)}
|
|
135
135
|
content={formatMessage({
|
|
136
|
-
id: "structure.notes.actions.show_versioned"
|
|
136
|
+
id: "structure.notes.actions.show_versioned",
|
|
137
137
|
})}
|
|
138
138
|
/>
|
|
139
139
|
{isShowingVersioned && (
|
|
140
140
|
<>
|
|
141
|
-
{versionedStructureNotes.map(sn => (
|
|
141
|
+
{versionedStructureNotes.map((sn) => (
|
|
142
142
|
<StructureNote
|
|
143
143
|
key={sn.id}
|
|
144
144
|
structure={structure}
|
|
@@ -159,10 +159,10 @@ StructureNotes.propTypes = {
|
|
|
159
159
|
structureNotes: PropTypes.object,
|
|
160
160
|
activeStructureNotes: PropTypes.array,
|
|
161
161
|
versionedStructureNotes: PropTypes.array,
|
|
162
|
-
template: PropTypes.object
|
|
162
|
+
template: PropTypes.object,
|
|
163
163
|
};
|
|
164
164
|
|
|
165
|
-
const mapStateToProps = state => {
|
|
165
|
+
const mapStateToProps = (state) => {
|
|
166
166
|
const { templates, structure, structureNotes } = state;
|
|
167
167
|
return {
|
|
168
168
|
activeStructureNotes: getActiveStructureNotes(state),
|
|
@@ -171,7 +171,7 @@ const mapStateToProps = state => {
|
|
|
171
171
|
structure,
|
|
172
172
|
template: _.find(
|
|
173
173
|
_.propEq("id", _.path("data_structure_type.template_id")(structure))
|
|
174
|
-
)(templates)
|
|
174
|
+
)(templates),
|
|
175
175
|
};
|
|
176
176
|
};
|
|
177
177
|
|
package/src/reducers/index.js
CHANGED
|
@@ -4,7 +4,6 @@ import { creatingGrantRequestApproval } from "./creatingGrantRequestApproval";
|
|
|
4
4
|
import { csvGraphDownloading } from "./csvGraphDownloading";
|
|
5
5
|
import { ddMessage } from "./ddMessage";
|
|
6
6
|
import { structureTagSaving } from "./structureTagSaving";
|
|
7
|
-
import { availableTags } from "./availableTags";
|
|
8
7
|
import { grantActiveFilters } from "./grantActiveFilters";
|
|
9
8
|
import { grantCount } from "./grantCount";
|
|
10
9
|
import { grantDateFilter } from "./grantDateFilter";
|
|
@@ -98,7 +97,6 @@ export {
|
|
|
98
97
|
csvGraphDownloading,
|
|
99
98
|
ddMessage,
|
|
100
99
|
structureTagSaving,
|
|
101
|
-
availableTags,
|
|
102
100
|
grantActiveFilters,
|
|
103
101
|
grantCount,
|
|
104
102
|
grantDateFilter,
|
|
@@ -4,7 +4,7 @@ import { fetchStructureNotes, clearStructureNotes } from "../routines";
|
|
|
4
4
|
const initialState = {
|
|
5
5
|
structureNotes: [],
|
|
6
6
|
_actions: {},
|
|
7
|
-
loading: false
|
|
7
|
+
loading: false,
|
|
8
8
|
};
|
|
9
9
|
|
|
10
10
|
const structureNotes = (state = initialState, { type, payload }) => {
|
|
@@ -17,7 +17,7 @@ const structureNotes = (state = initialState, { type, payload }) => {
|
|
|
17
17
|
return {
|
|
18
18
|
...state,
|
|
19
19
|
structureNotes: _.propOr([], "data")(payload),
|
|
20
|
-
_actions: _.propOr({}, "_actions")(payload)
|
|
20
|
+
_actions: _.propOr({}, "_actions")(payload),
|
|
21
21
|
};
|
|
22
22
|
case fetchStructureNotes.FULFILL:
|
|
23
23
|
return { ...state, loading: false };
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { clearStructure, fetchStructure } from "../../routines";
|
|
2
|
-
import { availableTags, initialState } from "../availableTags";
|
|
3
|
-
|
|
4
|
-
const fooState = [{ foo: "bar" }];
|
|
5
|
-
|
|
6
|
-
describe("reducers: availableTags", () => {
|
|
7
|
-
it("should provide the initial state", () => {
|
|
8
|
-
expect(availableTags(undefined, {})).toBe(initialState);
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
it("should handle the clearStructure.TRIGGER action", () => {
|
|
12
|
-
expect(availableTags(fooState, clearStructure())).toBe(initialState);
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
it("should handle the fetchStructure.TRIGGER action", () => {
|
|
16
|
-
expect(availableTags(fooState, fetchStructure())).toBe(initialState);
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
it("should handle the fetchStructure.SUCCESS action", () => {
|
|
20
|
-
const data = [
|
|
21
|
-
{ id: 1, name: "TAG 1" },
|
|
22
|
-
{ id: 2, name: "TAG 2" },
|
|
23
|
-
];
|
|
24
|
-
|
|
25
|
-
const payload = { _actions: { manage_tags: { data } } };
|
|
26
|
-
|
|
27
|
-
expect(
|
|
28
|
-
availableTags(fooState, fetchStructure.success(payload))
|
|
29
|
-
).toMatchObject(data);
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
it("should ignore unknown actions", () => {
|
|
33
|
-
expect(availableTags(fooState, { type: "FOO" })).toBe(fooState);
|
|
34
|
-
});
|
|
35
|
-
});
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import _ from "lodash/fp";
|
|
2
|
-
import { clearStructure, fetchStructure } from "../routines";
|
|
3
|
-
|
|
4
|
-
export const initialState = [];
|
|
5
|
-
|
|
6
|
-
const availableTags = (state = initialState, { type, payload }) => {
|
|
7
|
-
switch (type) {
|
|
8
|
-
case clearStructure.TRIGGER:
|
|
9
|
-
return initialState;
|
|
10
|
-
case fetchStructure.TRIGGER:
|
|
11
|
-
return initialState;
|
|
12
|
-
case fetchStructure.SUCCESS:
|
|
13
|
-
return _.pathOr(initialState, "_actions.manage_tags.data")(payload);
|
|
14
|
-
default:
|
|
15
|
-
return state;
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export { availableTags };
|