@truedat/bg 6.14.1 → 6.15.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": "6.14.1",
3
+ "version": "6.15.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": "6.14.1",
37
+ "@truedat/test": "6.15.0",
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": "6.14.1",
90
- "@truedat/df": "6.14.1",
91
- "@truedat/lm": "6.14.1",
89
+ "@truedat/core": "6.15.1",
90
+ "@truedat/df": "6.15.1",
91
+ "@truedat/lm": "6.15.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": "13f8e92c333acf539f9978ea94db03174130cfb0"
114
+ "gitHead": "88df4d9b1df86fcf8ae20668fe8874dd73f28fde"
115
115
  }
@@ -33,13 +33,18 @@ export const ConceptDetails = ({ concept }) => {
33
33
 
34
34
  const i18nConcept = _.flow(
35
35
  _.filter(({ is_enabled }) => is_enabled),
36
- _.map(({ id, lang, is_default, is_required, local_name }) => {
36
+ _.map((locale) => {
37
+ const { id, lang, is_default, is_required, local_name } = locale;
37
38
  const contentLang = _.get(lang)(i18nContent);
38
- const langContent = is_default
39
- ? content
40
- : _.isEmpty(contentLang?.content)
41
- ? {}
42
- : { ...noTranslatableContent, ...contentLang?.content };
39
+ const publishedWithoutLang =
40
+ _.isNil(contentLang) && concept.status == "published";
41
+ const langContent =
42
+ is_default || publishedWithoutLang
43
+ ? content
44
+ : _.isEmpty(contentLang?.content)
45
+ ? { ...noTranslatableContent }
46
+ : { ...noTranslatableContent, ...contentLang?.content };
47
+
43
48
  const langName = is_default ? concept.name : contentLang?.name || "";
44
49
 
45
50
  return {
@@ -52,7 +57,6 @@ export const ConceptDetails = ({ concept }) => {
52
57
  content: langContent,
53
58
  };
54
59
  }),
55
- _.filter(({ content }) => !_.isEmpty(content)),
56
60
  _.orderBy(["isDefault", "isRequired", "lang"], ["desc", "desc", "asc"]),
57
61
  _.keyBy("lang")
58
62
  )(locales);
@@ -37,7 +37,7 @@ describe("<ConceptDetails />", () => {
37
37
  },
38
38
  ],
39
39
  },
40
- content: {
40
+ dynamic_content: {
41
41
  field: { value: "value1", origin: "user" },
42
42
  },
43
43
  },