@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@truedat/core",
3
- "version": "7.0.8",
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.8",
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": "ff536a41caac4df0cfa13df66dc2805b3bb7637a"
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;
@@ -7,7 +7,7 @@ import {
7
7
  QUALITY_CONTROLS_PUBLISHED,
8
8
  QUALITY_CONTROLS_DEPRECATED,
9
9
  QUALITY_CONTROLS_DRAFTS,
10
- QUALITY_CONTROLS_EXECUTION_GROUPS,
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: "quality_controls_execution_groups",
25
- routes: [QUALITY_CONTROLS_EXECUTION_GROUPS],
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 { shallow } from "enzyme";
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("<DateTime />", () => {
10
+ describe("<GroupActions />", () => {
11
11
  it("matches the latest snapshot", () => {
12
- const wrapper = shallow(<GroupActions availableActions={actions} />);
13
- expect(wrapper).toMatchSnapshot();
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[`<DateTime /> matches the latest snapshot 1`] = `
4
- <Dropdown
5
- additionLabel="Add "
6
- additionPosition="top"
7
- className="button icon group-actions"
8
- closeOnBlur={true}
9
- closeOnEscape={true}
10
- deburr={false}
11
- direction="left"
12
- floating={true}
13
- icon="ellipsis vertical"
14
- minCharacters={1}
15
- noResultsMessage="No results found."
16
- openOnFocus={true}
17
- options={
18
- [
19
- {
20
- "key": 1,
21
- "text": "First Item",
22
- "value": 1,
23
- },
24
- {
25
- "key": 2,
26
- "text": "Second Item",
27
- "value": 2,
28
- },
29
- ]
30
- }
31
- renderLabel={[Function]}
32
- searchInput="text"
33
- selectOnBlur={true}
34
- selectOnNavigation={true}
35
- wrapSelection={true}
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="/qualityControls/executionGroups"
289
+ href="/myScoreGroups"
290
290
  >
291
- quality_controls_execution_groups
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,