@truedat/bg 4.46.10 → 4.46.13

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,17 @@
1
1
  # Changelog
2
2
 
3
+ ## [4.46.13] 2022-06-21
4
+
5
+ ### Fixed
6
+
7
+ - [TD-4958] Missing concept actions in state
8
+
9
+ ## [4.46.11] 2022-06-20
10
+
11
+ ### Fixed
12
+
13
+ - [TD-4720] The button to create concepts does not appear
14
+
3
15
  ## [4.46.10] 2022-06-20
4
16
 
5
17
  ### Fixed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@truedat/bg",
3
- "version": "4.46.10",
3
+ "version": "4.46.13",
4
4
  "description": "Truedat Web Business Glossary",
5
5
  "sideEffects": false,
6
6
  "jsnext:main": "src/index.js",
@@ -34,7 +34,7 @@
34
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.46.10",
37
+ "@truedat/test": "4.46.12",
38
38
  "babel-jest": "^28.1.0",
39
39
  "babel-plugin-dynamic-import-node": "^2.3.3",
40
40
  "babel-plugin-lodash": "^3.3.4",
@@ -86,8 +86,8 @@
86
86
  ]
87
87
  },
88
88
  "dependencies": {
89
- "@truedat/core": "4.46.10",
90
- "@truedat/df": "4.46.10",
89
+ "@truedat/core": "4.46.13",
90
+ "@truedat/df": "4.46.13",
91
91
  "file-saver": "^2.0.5",
92
92
  "moment": "^2.24.0",
93
93
  "path-to-regexp": "^1.7.0",
@@ -107,5 +107,5 @@
107
107
  "react-dom": ">= 16.8.6 < 17",
108
108
  "semantic-ui-react": ">= 0.88.2 < 2.1"
109
109
  },
110
- "gitHead": "2bfaf01b4ff0cbd9166456e0cfff7028015d220f"
110
+ "gitHead": "89cd539e47e64a3e4a6f8bc30ea4d3b66fb0b666"
111
111
  }
@@ -76,6 +76,16 @@ export const ConceptRoutes = ({ concept, conceptLoaded, templatesLoaded }) => {
76
76
  )
77
77
  }
78
78
  />
79
+ <Route
80
+ path={CONCEPTS}
81
+ render={() => (
82
+ <ConceptsLoader
83
+ defaultFilters={{
84
+ status: ["published"],
85
+ }}
86
+ />
87
+ )}
88
+ />
79
89
  <Route
80
90
  path={CONCEPTS}
81
91
  render={() =>
@@ -91,11 +101,6 @@ export const ConceptRoutes = ({ concept, conceptLoaded, templatesLoaded }) => {
91
101
  status: ["published"],
92
102
  }}
93
103
  />
94
- <ConceptsLoader
95
- defaultFilters={{
96
- status: ["published"],
97
- }}
98
- />
99
104
  <ConceptUserFiltersLoader />
100
105
  <Concepts
101
106
  header="concepts.header"
@@ -20,7 +20,6 @@ const staticLabels = [
20
20
  ];
21
21
 
22
22
  export const ConceptsActions = ({
23
- create,
24
23
  createUrl,
25
24
  conceptsDownloading,
26
25
  downloadConcepts,
@@ -34,7 +33,7 @@ export const ConceptsActions = ({
34
33
  )(staticLabels);
35
34
  return hidden ? null : (
36
35
  <div>
37
- {create && createUrl && (
36
+ {createUrl ? (
38
37
  <Button
39
38
  floated="right"
40
39
  primary
@@ -42,7 +41,7 @@ export const ConceptsActions = ({
42
41
  to={createUrl}
43
42
  content={formatMessage({ id: "concepts.actions.create" })}
44
43
  />
45
- )}
44
+ ) : null}
46
45
  <Button
47
46
  floated="right"
48
47
  secondary
@@ -62,7 +61,6 @@ export const ConceptsActions = ({
62
61
  ConceptsActions.propTypes = {
63
62
  conceptsDownloading: PropTypes.bool,
64
63
  hidden: PropTypes.bool,
65
- create: PropTypes.bool,
66
64
  createUrl: PropTypes.string,
67
65
  downloadConcepts: PropTypes.func,
68
66
  upload: PropTypes.bool,
@@ -1,11 +1,12 @@
1
1
  import { initialState } from "../conceptActiveFilters";
2
+ import { fetchDomain } from "../../../taxonomy/routines";
2
3
  import {
3
4
  addConceptFilter,
4
5
  applyConceptUserFilter,
5
6
  closeConceptFilter,
6
7
  removeConceptFilter,
7
8
  resetConceptFilters,
8
- toggleConceptFilterValue
9
+ toggleConceptFilterValue,
9
10
  } from "../../routines";
10
11
  import { conceptActiveFilters } from "..";
11
12
 
@@ -19,22 +20,17 @@ describe("reducers: conceptActiveFilters", () => {
19
20
  it("should handle the addConceptFilter.TRIGGER action", () => {
20
21
  const filter = "baz";
21
22
  const payload = { filter };
22
- expect(
23
- conceptActiveFilters(fooState, {
24
- type: addConceptFilter.TRIGGER,
25
- payload
26
- })
27
- ).toEqual({ ...fooState, baz: [] });
23
+ expect(conceptActiveFilters(fooState, addConceptFilter(payload))).toEqual({
24
+ ...fooState,
25
+ baz: [],
26
+ });
28
27
  });
29
28
 
30
29
  it("should handle the applyConceptUserFilter.TRIGGER action", () => {
31
30
  const filters = { country: ["Sp"] };
32
31
  const payload = { userFilter: { filters } };
33
32
  expect(
34
- conceptActiveFilters(fooState, {
35
- type: applyConceptUserFilter.TRIGGER,
36
- payload
37
- })
33
+ conceptActiveFilters(fooState, applyConceptUserFilter(payload))
38
34
  ).toEqual({ ...filters });
39
35
  });
40
36
 
@@ -43,12 +39,9 @@ describe("reducers: conceptActiveFilters", () => {
43
39
  const bar = [];
44
40
  const state = { foo, bar };
45
41
  const payload = { filter: "bar" };
46
- expect(
47
- conceptActiveFilters(state, {
48
- type: closeConceptFilter.TRIGGER,
49
- payload
50
- })
51
- ).toEqual({ foo });
42
+ expect(conceptActiveFilters(state, closeConceptFilter(payload))).toEqual({
43
+ foo,
44
+ });
52
45
  });
53
46
 
54
47
  it("should handle the removeConceptFilter.TRIGGER action", () => {
@@ -56,20 +49,15 @@ describe("reducers: conceptActiveFilters", () => {
56
49
  const bar = [];
57
50
  const state = { foo, bar };
58
51
  const payload = { filter: "foo" };
59
- expect(
60
- conceptActiveFilters(state, {
61
- type: removeConceptFilter.TRIGGER,
62
- payload
63
- })
64
- ).toEqual({ bar });
52
+ expect(conceptActiveFilters(state, removeConceptFilter(payload))).toEqual({
53
+ bar,
54
+ });
65
55
  });
66
56
 
67
57
  it("should handle the resetConceptFilters.TRIGGER action", () => {
68
- expect(
69
- conceptActiveFilters(fooState, {
70
- type: resetConceptFilters.TRIGGER
71
- })
72
- ).toEqual(initialState);
58
+ expect(conceptActiveFilters(fooState, resetConceptFilters())).toEqual(
59
+ initialState
60
+ );
73
61
  });
74
62
 
75
63
  it("should handle the toggleConceptFilterValue.TRIGGER action", () => {
@@ -78,13 +66,17 @@ describe("reducers: conceptActiveFilters", () => {
78
66
  const state = { foo, bar };
79
67
  const payload = { filter: "foo", value: "foo2" };
80
68
  expect(
81
- conceptActiveFilters(state, {
82
- type: toggleConceptFilterValue.TRIGGER,
83
- payload
84
- })
69
+ conceptActiveFilters(state, toggleConceptFilterValue(payload))
85
70
  ).toEqual({ foo: ["foo1", "foo3"], bar });
86
71
  });
87
72
 
73
+ it("should omit the taxonomy filter on fetchDomain.TRIGGER", () => {
74
+ const state = { taxonomy: ["foo"], foo: ["bar"] };
75
+ expect(conceptActiveFilters(state, fetchDomain())).toEqual({
76
+ foo: ["bar"],
77
+ });
78
+ });
79
+
88
80
  it("should ignore unknown actions", () => {
89
81
  expect(conceptActiveFilters(fooState, { type: "FOO" })).toBe(fooState);
90
82
  });
@@ -1,4 +1,5 @@
1
1
  import _ from "lodash/fp";
2
+ import { fetchDomain } from "../../taxonomy/routines";
2
3
  import {
3
4
  addConceptFilter,
4
5
  applyConceptUserFilter,
@@ -48,6 +49,9 @@ export const conceptActiveFilters = (
48
49
  : _.union([value])(values);
49
50
  return { ...state, [filter]: nextValues };
50
51
  }
52
+ case fetchDomain.TRIGGER: {
53
+ return _.omit("taxonomy")(state);
54
+ }
51
55
  default:
52
56
  return state;
53
57
  }