@truedat/core 7.0.8 → 7.1.0
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 +3 -3
- package/src/components/GroupActions.js +6 -3
- package/src/components/QxMenu.js +3 -3
- package/src/components/__tests__/GroupActions.spec.js +14 -5
- package/src/components/__tests__/__snapshots__/GroupActions.spec.js.snap +45 -34
- package/src/components/__tests__/__snapshots__/SideMenu.spec.js.snap +2 -2
- package/src/routes.js +14 -6
- package/src/search/SearchContext.js +5 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@truedat/core",
|
|
3
|
-
"version": "7.0
|
|
3
|
+
"version": "7.1.0",
|
|
4
4
|
"description": "Truedat Web Core",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"jsnext:main": "src/index.js",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"@testing-library/react": "^12.0.0",
|
|
37
37
|
"@testing-library/react-hooks": "^8.0.1",
|
|
38
38
|
"@testing-library/user-event": "^13.2.1",
|
|
39
|
-
"@truedat/test": "7.0
|
|
39
|
+
"@truedat/test": "7.1.0",
|
|
40
40
|
"babel-jest": "^28.1.0",
|
|
41
41
|
"babel-plugin-dynamic-import-node": "^2.3.3",
|
|
42
42
|
"babel-plugin-lodash": "^3.3.4",
|
|
@@ -118,5 +118,5 @@
|
|
|
118
118
|
"react-dom": ">= 16.8.6 < 17",
|
|
119
119
|
"semantic-ui-react": ">= 2.0.3 < 2.2"
|
|
120
120
|
},
|
|
121
|
-
"gitHead": "
|
|
121
|
+
"gitHead": "cb08380da04c7286e694540bc24d32f01a728dfc"
|
|
122
122
|
}
|
|
@@ -2,23 +2,26 @@ import React from "react";
|
|
|
2
2
|
import PropTypes from "prop-types";
|
|
3
3
|
import { Dropdown } from "semantic-ui-react";
|
|
4
4
|
|
|
5
|
-
export const GroupActions = ({ availableActions, direction }) => (
|
|
5
|
+
export const GroupActions = ({ availableActions, direction, disabled }) => (
|
|
6
6
|
<Dropdown
|
|
7
7
|
icon="ellipsis vertical"
|
|
8
8
|
className="button icon group-actions"
|
|
9
9
|
floating
|
|
10
|
+
disabled={disabled}
|
|
10
11
|
options={availableActions}
|
|
11
12
|
direction={direction}
|
|
12
13
|
/>
|
|
13
14
|
);
|
|
14
15
|
|
|
15
16
|
GroupActions.defaultProps = {
|
|
16
|
-
direction: "left"
|
|
17
|
+
direction: "left",
|
|
18
|
+
disabled: false,
|
|
17
19
|
};
|
|
18
20
|
|
|
19
21
|
GroupActions.propTypes = {
|
|
20
22
|
availableActions: PropTypes.array,
|
|
21
|
-
direction: PropTypes.string
|
|
23
|
+
direction: PropTypes.string,
|
|
24
|
+
disabled: PropTypes.bool,
|
|
22
25
|
};
|
|
23
26
|
|
|
24
27
|
export default GroupActions;
|
package/src/components/QxMenu.js
CHANGED
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
QUALITY_CONTROLS_PUBLISHED,
|
|
8
8
|
QUALITY_CONTROLS_DEPRECATED,
|
|
9
9
|
QUALITY_CONTROLS_DRAFTS,
|
|
10
|
-
|
|
10
|
+
MY_SCORE_GROUPS,
|
|
11
11
|
} from "../routes";
|
|
12
12
|
import Submenu from "./Submenu";
|
|
13
13
|
|
|
@@ -21,8 +21,8 @@ export const ITEMS = [
|
|
|
21
21
|
},
|
|
22
22
|
{ name: "quality_controls_drafts", routes: [QUALITY_CONTROLS_DRAFTS] },
|
|
23
23
|
{
|
|
24
|
-
name: "
|
|
25
|
-
routes: [
|
|
24
|
+
name: "my_score_groups",
|
|
25
|
+
routes: [MY_SCORE_GROUPS],
|
|
26
26
|
},
|
|
27
27
|
];
|
|
28
28
|
|
|
@@ -1,15 +1,24 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { render } from "@truedat/test/render";
|
|
3
3
|
import { GroupActions } from "..";
|
|
4
4
|
|
|
5
5
|
const actions = [
|
|
6
6
|
{ key: 1, text: "First Item", value: 1 },
|
|
7
|
-
{ key: 2, text: "Second Item", value: 2 }
|
|
7
|
+
{ key: 2, text: "Second Item", value: 2 },
|
|
8
8
|
];
|
|
9
9
|
|
|
10
|
-
describe("<
|
|
10
|
+
describe("<GroupActions />", () => {
|
|
11
11
|
it("matches the latest snapshot", () => {
|
|
12
|
-
const
|
|
13
|
-
expect(
|
|
12
|
+
const { container } = render(<GroupActions availableActions={actions} />);
|
|
13
|
+
expect(container).toMatchSnapshot();
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
it("disable dropdown", () => {
|
|
17
|
+
const { getByRole } = render(
|
|
18
|
+
<GroupActions availableActions={actions} disabled={true} />
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
const dropdown = getByRole("listbox");
|
|
22
|
+
expect(dropdown).toHaveAttribute("aria-disabled", "true");
|
|
14
23
|
});
|
|
15
24
|
});
|
|
@@ -1,37 +1,48 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`<
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
3
|
+
exports[`<GroupActions /> matches the latest snapshot 1`] = `
|
|
4
|
+
<div>
|
|
5
|
+
<div
|
|
6
|
+
aria-disabled="false"
|
|
7
|
+
aria-expanded="false"
|
|
8
|
+
class="ui floating dropdown button icon group-actions"
|
|
9
|
+
role="listbox"
|
|
10
|
+
tabindex="0"
|
|
11
|
+
>
|
|
12
|
+
<i
|
|
13
|
+
aria-hidden="true"
|
|
14
|
+
class="ellipsis vertical icon"
|
|
15
|
+
/>
|
|
16
|
+
<div
|
|
17
|
+
class="left menu transition"
|
|
18
|
+
>
|
|
19
|
+
<div
|
|
20
|
+
aria-checked="false"
|
|
21
|
+
aria-selected="true"
|
|
22
|
+
class="selected item"
|
|
23
|
+
role="option"
|
|
24
|
+
style="pointer-events: all;"
|
|
25
|
+
>
|
|
26
|
+
<span
|
|
27
|
+
class="text"
|
|
28
|
+
>
|
|
29
|
+
First Item
|
|
30
|
+
</span>
|
|
31
|
+
</div>
|
|
32
|
+
<div
|
|
33
|
+
aria-checked="false"
|
|
34
|
+
aria-selected="false"
|
|
35
|
+
class="item"
|
|
36
|
+
role="option"
|
|
37
|
+
style="pointer-events: all;"
|
|
38
|
+
>
|
|
39
|
+
<span
|
|
40
|
+
class="text"
|
|
41
|
+
>
|
|
42
|
+
Second Item
|
|
43
|
+
</span>
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
37
48
|
`;
|
|
@@ -286,9 +286,9 @@ exports[`<SideMenu /> matches the latest snapshot 1`] = `
|
|
|
286
286
|
</a>
|
|
287
287
|
<a
|
|
288
288
|
class="link item"
|
|
289
|
-
href="/
|
|
289
|
+
href="/myScoreGroups"
|
|
290
290
|
>
|
|
291
|
-
|
|
291
|
+
my_score_groups
|
|
292
292
|
</a>
|
|
293
293
|
</div>
|
|
294
294
|
</div>
|
package/src/routes.js
CHANGED
|
@@ -158,15 +158,12 @@ export const QUALITY_CONTROLS = "/qualityControls";
|
|
|
158
158
|
export const QUALITY_CONTROLS_DEPRECATED = "/qualityControls/deprecated";
|
|
159
159
|
export const QUALITY_CONTROLS_DRAFTS = "/qualityControls/drafts";
|
|
160
160
|
export const QUALITY_CONTROLS_PUBLISHED = "/qualityControls";
|
|
161
|
-
export const QUALITY_CONTROLS_EXECUTION_GROUPS =
|
|
162
|
-
"/qualityControls/executionGroups";
|
|
163
|
-
export const QUALITY_CONTROLS_EXECUTION_GROUP =
|
|
164
|
-
"/qualityControls/executionGroups/:id";
|
|
165
161
|
export const QUALITY_CONTROL_NEW = "/qualityControls/new";
|
|
166
162
|
export const QUALITY_CONTROL_EDIT = "/qualityControls/:id/edit";
|
|
167
163
|
export const QUALITY_CONTROL_NEW_DRAFT = "/qualityControls/:id/new_draft";
|
|
168
164
|
export const QUALITY_CONTROL = "/qualityControls/:id";
|
|
169
165
|
export const QUALITY_CONTROL_HISTORY = "/qualityControls/:id/history";
|
|
166
|
+
export const QUALITY_CONTROL_SCORES = "/qualityControls/:id/scores";
|
|
170
167
|
|
|
171
168
|
export const QUALITY_DASHBOARD = "/quality_dashboard";
|
|
172
169
|
export const REFERENCE_DATASET = "/referenceDatasets/:id";
|
|
@@ -193,6 +190,12 @@ export const RULE_IMPLEMENTATION_NEW = "/rules/:id/implementations/new";
|
|
|
193
190
|
export const RULE_IMPLEMENTATION_NEW_RAW = "/rules/:id/implementations/new_raw";
|
|
194
191
|
export const RULE_NEW = "/rules/new";
|
|
195
192
|
export const SAMPLE = "/sample";
|
|
193
|
+
export const MY_SCORE_GROUPS = "/myScoreGroups";
|
|
194
|
+
export const SCORE_GROUPS = "/scoreGroups";
|
|
195
|
+
export const SCORE_GROUP = "/scoreGroups/:id";
|
|
196
|
+
export const SCORES = "/scores";
|
|
197
|
+
export const SCORE = "/scores/:id";
|
|
198
|
+
export const SCORE_EVENTS = "/scores/:id/events";
|
|
196
199
|
export const SEARCH = "/search";
|
|
197
200
|
export const SEARCH_CONCEPTS = "/search/concepts";
|
|
198
201
|
export const SEARCH_INGESTS = "/search/ingests";
|
|
@@ -386,13 +389,12 @@ const routes = {
|
|
|
386
389
|
QUALITY_CONTROLS_DEPRECATED,
|
|
387
390
|
QUALITY_CONTROLS_DRAFTS,
|
|
388
391
|
QUALITY_CONTROLS_PUBLISHED,
|
|
389
|
-
QUALITY_CONTROLS_EXECUTION_GROUPS,
|
|
390
|
-
QUALITY_CONTROLS_EXECUTION_GROUP,
|
|
391
392
|
QUALITY_CONTROL_NEW,
|
|
392
393
|
QUALITY_CONTROL_EDIT,
|
|
393
394
|
QUALITY_CONTROL_NEW_DRAFT,
|
|
394
395
|
QUALITY_CONTROL,
|
|
395
396
|
QUALITY_CONTROL_HISTORY,
|
|
397
|
+
QUALITY_CONTROL_SCORES,
|
|
396
398
|
QUALITY_DASHBOARD,
|
|
397
399
|
REFERENCE_DATASET,
|
|
398
400
|
REFERENCE_DATASETS,
|
|
@@ -416,6 +418,12 @@ const routes = {
|
|
|
416
418
|
RULE_IMPLEMENTATION_NEW_RAW,
|
|
417
419
|
RULE_NEW,
|
|
418
420
|
SAMPLE,
|
|
421
|
+
MY_SCORE_GROUPS,
|
|
422
|
+
SCORE_GROUPS,
|
|
423
|
+
SCORE_GROUP,
|
|
424
|
+
SCORES,
|
|
425
|
+
SCORE,
|
|
426
|
+
SCORE_EVENTS,
|
|
419
427
|
SEARCH,
|
|
420
428
|
SEARCH_CONCEPTS,
|
|
421
429
|
SEARCH_INGESTS,
|
|
@@ -107,6 +107,10 @@ export const SearchContextProvider = (props) => {
|
|
|
107
107
|
onSearchChange && onSearchChange();
|
|
108
108
|
};
|
|
109
109
|
|
|
110
|
+
const removeHiddenFilter = ({ filter }) => {
|
|
111
|
+
setHiddenFilters(_.omit(filter)(hiddenFilters));
|
|
112
|
+
};
|
|
113
|
+
|
|
110
114
|
const toggleFilterValue = ({ filter, value }) => {
|
|
111
115
|
const values = _.propOr([], filter)(allActiveFilters);
|
|
112
116
|
const newValue = _.isArray(value)
|
|
@@ -317,6 +321,7 @@ export const SearchContextProvider = (props) => {
|
|
|
317
321
|
openFilter,
|
|
318
322
|
closeFilter,
|
|
319
323
|
removeFilter,
|
|
324
|
+
removeHiddenFilter,
|
|
320
325
|
toggleFilterValue,
|
|
321
326
|
toggleHiddenFilterValue,
|
|
322
327
|
setHiddenFilters,
|