@truedat/bg 7.3.4 → 7.4.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@truedat/bg",
3
- "version": "7.3.4",
3
+ "version": "7.4.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.5",
35
35
  "@testing-library/react": "^12.0.0",
36
36
  "@testing-library/user-event": "^13.2.1",
37
- "@truedat/test": "7.3.4",
37
+ "@truedat/test": "7.4.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,9 +86,9 @@
86
86
  ]
87
87
  },
88
88
  "dependencies": {
89
- "@truedat/core": "7.3.4",
90
- "@truedat/df": "7.3.4",
91
- "@truedat/lm": "7.3.4",
89
+ "@truedat/core": "7.4.1",
90
+ "@truedat/df": "7.4.1",
91
+ "@truedat/lm": "7.4.1",
92
92
  "decode-uri-component": "^0.2.2",
93
93
  "file-saver": "^2.0.5",
94
94
  "moment": "^2.29.4",
@@ -111,5 +111,5 @@
111
111
  "react-dom": ">= 16.8.6 < 17",
112
112
  "semantic-ui-react": ">= 2.0.3 < 2.2"
113
113
  },
114
- "gitHead": "681c0d026b5477fadf9b53fe5242cfb0ed11d973"
114
+ "gitHead": "3f0fb3cef1d8e517ab71b741d8e4617319960f58"
115
115
  }
@@ -13,6 +13,7 @@ import ConceptsUploadButton from "./ConceptsUploadButton";
13
13
 
14
14
  export const ConceptsActions = ({
15
15
  create,
16
+ download,
16
17
  conceptsDownloading,
17
18
  downloadConcepts,
18
19
  upload,
@@ -24,7 +25,6 @@ export const ConceptsActions = ({
24
25
  const createUrl = conceptsActions?.create ? CONCEPTS_NEW : null;
25
26
  const canAutoPublish = conceptsActions?.autoPublish && true;
26
27
  const { formatMessage, locale } = useIntl();
27
-
28
28
  return hidden ? null : (
29
29
  <div>
30
30
  {create && createUrl ? (
@@ -36,16 +36,19 @@ export const ConceptsActions = ({
36
36
  content={formatMessage({ id: "concepts.actions.create" })}
37
37
  />
38
38
  ) : null}
39
- <Button
40
- floated="right"
41
- secondary
42
- icon="download"
43
- onClick={() => downloadConcepts({ lang: locale, searchParams })}
44
- loading={conceptsDownloading}
45
- data-tooltip={formatMessage({
46
- id: "concepts.actions.download.tooltip",
47
- })}
48
- />
39
+ {create || download ? (
40
+ <Button
41
+ floated="right"
42
+ secondary
43
+ icon="download"
44
+ onClick={() => downloadConcepts({ lang: locale, searchParams })}
45
+ loading={conceptsDownloading}
46
+ data-tooltip={formatMessage({
47
+ id: "concepts.actions.download.tooltip",
48
+ })}
49
+ />
50
+ ) : null}
51
+
49
52
  {upload ? <ConceptsUploadButton canAutoPublish={canAutoPublish} /> : null}
50
53
  {update ? <ConceptsUpdateButton /> : null}
51
54
  </div>
@@ -55,6 +58,7 @@ export const ConceptsActions = ({
55
58
  ConceptsActions.propTypes = {
56
59
  conceptsDownloading: PropTypes.bool,
57
60
  create: PropTypes.bool,
61
+ download: PropTypes.bool,
58
62
  downloadConcepts: PropTypes.func,
59
63
  upload: PropTypes.bool,
60
64
  update: PropTypes.bool,
@@ -18,12 +18,17 @@ import ConceptsLabelResults from "./ConceptsLabelResults";
18
18
  import ConceptsPagination from "./ConceptsPagination";
19
19
  import ConceptsTable from "./ConceptsTable";
20
20
 
21
- export function ConceptsPanelContent({ actions, subscope }) {
22
- const { loading } = useSearchContext();
21
+ export function ConceptsPanelContent({ subscope }) {
22
+ const { loading, searchData } = useSearchContext();
23
+ const actions = _.propOr({}, "_actions")(searchData);
24
+ const download = (actions) =>
25
+ "downloadPublishedConcepts" in actions ||
26
+ "downloadDeprecatedConcepts" in actions ||
27
+ "downloadDraftConcepts" in actions;
23
28
 
24
29
  return (
25
30
  <>
26
- <ConceptsActions {...actions} />
31
+ <ConceptsActions {...actions} download={download(actions)} />
27
32
  <SearchWidget />
28
33
  <Dimmer.Dimmable dimmed={loading}>
29
34
  <Dimmer active={loading} inverted>