@truedat/bg 4.46.11 → 4.47.1

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.47.1] 2022-06-22
4
+
5
+ ### Fixed
6
+
7
+ - [TD-4720] Missing upload concepts button, remove new concept from /concepts.
8
+
9
+ ## [4.46.13] 2022-06-21
10
+
11
+ ### Fixed
12
+
13
+ - [TD-4958] Missing concept actions in state
14
+
3
15
  ## [4.46.11] 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.11",
3
+ "version": "4.47.1",
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.47.1",
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.47.1",
90
+ "@truedat/df": "4.47.1",
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": "b12ba8595f57dc897ae1d4ed354578a7e23e49aa"
110
+ "gitHead": "dffde75b85272debd04fb2fe17c2f54f9045f112"
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"
@@ -5,7 +5,7 @@ import { FormattedMessage } from "react-intl";
5
5
  import ConceptCrumbs from "./ConceptCrumbs";
6
6
  import ConceptsPanel from "./ConceptsPanel";
7
7
 
8
- export const Concepts = ({ header, subheader, icon }) => (
8
+ export const Concepts = ({ header, subheader, icon, ...actions }) => (
9
9
  <>
10
10
  <ConceptCrumbs />
11
11
  <Segment>
@@ -19,7 +19,7 @@ export const Concepts = ({ header, subheader, icon }) => (
19
19
  </Header.Content>
20
20
  </Header>
21
21
  <Segment attached="bottom">
22
- <ConceptsPanel />
22
+ <ConceptsPanel {...actions} />
23
23
  </Segment>
24
24
  </Segment>
25
25
  </>
@@ -20,6 +20,7 @@ const staticLabels = [
20
20
  ];
21
21
 
22
22
  export const ConceptsActions = ({
23
+ create,
23
24
  createUrl,
24
25
  conceptsDownloading,
25
26
  downloadConcepts,
@@ -33,7 +34,7 @@ export const ConceptsActions = ({
33
34
  )(staticLabels);
34
35
  return hidden ? null : (
35
36
  <div>
36
- {createUrl ? (
37
+ {create && createUrl && (
37
38
  <Button
38
39
  floated="right"
39
40
  primary
@@ -41,7 +42,7 @@ export const ConceptsActions = ({
41
42
  to={createUrl}
42
43
  content={formatMessage({ id: "concepts.actions.create" })}
43
44
  />
44
- ) : null}
45
+ )}
45
46
  <Button
46
47
  floated="right"
47
48
  secondary
@@ -61,6 +62,7 @@ export const ConceptsActions = ({
61
62
  ConceptsActions.propTypes = {
62
63
  conceptsDownloading: PropTypes.bool,
63
64
  hidden: PropTypes.bool,
65
+ create: PropTypes.bool,
64
66
  createUrl: PropTypes.string,
65
67
  downloadConcepts: PropTypes.func,
66
68
  upload: PropTypes.bool,
@@ -26,7 +26,22 @@ exports[`<Concepts /> matches the latest snapshot 1`] = `
26
26
  <Segment
27
27
  attached="bottom"
28
28
  >
29
- <Connect(ConceptsPanel) />
29
+ <Connect(ConceptsPanel)
30
+ concepts={
31
+ Array [
32
+ Object {
33
+ "description": "dd",
34
+ "id": 1,
35
+ "name": "s1",
36
+ "status": "st",
37
+ "version": "vs",
38
+ },
39
+ ]
40
+ }
41
+ create={true}
42
+ loading={false}
43
+ update={true}
44
+ />
30
45
  </Segment>
31
46
  </Segment>
32
47
  </Fragment>
@@ -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
  }