@truedat/dd 5.13.9 → 5.14.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/dd",
3
- "version": "5.13.9",
3
+ "version": "5.14.1",
4
4
  "description": "Truedat Web Data Dictionary",
5
5
  "sideEffects": false,
6
6
  "jsnext:main": "src/index.js",
@@ -88,9 +88,9 @@
88
88
  },
89
89
  "dependencies": {
90
90
  "@apollo/client": "^3.7.1",
91
- "@truedat/auth": "5.13.9",
92
- "@truedat/core": "5.13.9",
93
- "@truedat/df": "5.13.9",
91
+ "@truedat/auth": "5.14.1",
92
+ "@truedat/core": "5.14.1",
93
+ "@truedat/df": "5.14.1",
94
94
  "lodash": "^4.17.21",
95
95
  "moment": "^2.29.4",
96
96
  "path-to-regexp": "^1.7.0",
@@ -115,5 +115,5 @@
115
115
  "react-dom": ">= 16.8.6 < 17",
116
116
  "semantic-ui-react": ">= 2.0.3 < 2.2"
117
117
  },
118
- "gitHead": "afb7ed17e429ca033fafcbb23abafb14a3017ff6"
118
+ "gitHead": "a4ee212708f281ed1bbe15431e6d8731a55f2d29"
119
119
  }
@@ -13,7 +13,7 @@ export const StructuresEditableDownloadOption = ({
13
13
  downloadEditableStructures,
14
14
  hasFilterApplied,
15
15
  }) => {
16
- const { formatMessage } = useIntl();
16
+ const { formatMessage, locale } = useIntl();
17
17
  const isDisabled = _.isEmpty(structures) || !hasFilterApplied;
18
18
  return (
19
19
  !structuresLoading && (
@@ -33,7 +33,7 @@ export const StructuresEditableDownloadOption = ({
33
33
  )}
34
34
  </>
35
35
  }
36
- onClick={() => downloadEditableStructures()}
36
+ onClick={() => downloadEditableStructures({ lang: locale })}
37
37
  disabled={isDisabled || structuresEditableDownloading}
38
38
  />
39
39
  )
@@ -41,9 +41,11 @@ export const StructuresEditableDownloadOption = ({
41
41
  };
42
42
 
43
43
  StructuresEditableDownloadOption.propTypes = {
44
+ structures: PropTypes.object,
44
45
  structuresEditableDownloading: PropTypes.bool,
45
46
  structuresLoading: PropTypes.bool,
46
47
  downloadEditableStructures: PropTypes.func,
48
+ hasFilterApplied: PropTypes.bool,
47
49
  };
48
50
 
49
51
  const mapStateToProps = (state) => ({
@@ -11,14 +11,14 @@ export const StructuresUploadOption = ({
11
11
  loading,
12
12
  canAutoPublish,
13
13
  }) => {
14
- const { formatMessage } = useIntl();
14
+ const { formatMessage, locale } = useIntl();
15
15
  const extraAction = {
16
16
  key: "yesWithAutoPublish",
17
17
  primary: true,
18
18
  content: formatMessage({ id: "uploadModal.accept.publish" }),
19
19
  onClick: (data) => {
20
20
  data.append("auto_publish", canAutoPublish);
21
- return uploadStructures({ data });
21
+ return uploadStructures({ data, lang: locale });
22
22
  },
23
23
  };
24
24
 
@@ -43,6 +43,7 @@ export const StructuresUploadOption = ({
43
43
  handleSubmit={(data) =>
44
44
  uploadStructures({
45
45
  data,
46
+ lang: locale,
46
47
  })
47
48
  }
48
49
  />
@@ -33,16 +33,19 @@ describe("sagas: downloadEditableStructuresRequestSaga", () => {
33
33
  });
34
34
 
35
35
  describe("sagas: downloadEditableStructuresSaga", () => {
36
+ const lang = "es";
37
+ const payload = { lang };
36
38
  const query = { filters: {} };
37
39
  const body = {
38
40
  structure_url_schema: "http://localhost/structures/:id",
39
41
  ...query,
42
+ lang,
40
43
  };
41
44
  const data = "SOME CSV DATA";
42
45
 
43
46
  it("should put a success action when a response is returned", () => {
44
47
  expect(() => {
45
- testSaga(downloadEditableStructuresSaga)
48
+ testSaga(downloadEditableStructuresSaga, { payload })
46
49
  .next()
47
50
  .select(getPreviousStructureQuery)
48
51
  .next(query)
@@ -65,7 +68,7 @@ describe("sagas: downloadEditableStructuresSaga", () => {
65
68
  const error = { message };
66
69
 
67
70
  expect(() => {
68
- testSaga(downloadEditableStructuresSaga)
71
+ testSaga(downloadEditableStructuresSaga, { payload })
69
72
  .next()
70
73
  .select(getPreviousStructureQuery)
71
74
  .next(query)
@@ -28,8 +28,9 @@ describe("sagas: uploadStructuresRequestSaga", () => {
28
28
  });
29
29
 
30
30
  describe("sagas: uploadStructuresSaga", () => {
31
- const body = { structures: "content" };
32
- const payload = { data: body };
31
+ const lang = "es";
32
+ const body = new FormData();
33
+ const payload = { data: body, lang };
33
34
  const status = "JUST_STARTED";
34
35
  const data = { message: [1, 2] };
35
36
  it("should put a success action when a response is returned", () => {
@@ -16,11 +16,13 @@ export function saveFile(data) {
16
16
  }
17
17
  }
18
18
 
19
- export function* downloadEditableStructuresSaga() {
19
+ export function* downloadEditableStructuresSaga({ payload }) {
20
+ const lang = _.propOr("en", "lang")(payload);
20
21
  try {
21
22
  const query = yield select(getPreviousStructureQuery);
22
23
  const body = {
23
24
  structure_url_schema: getStructureUrlSchema(),
25
+ lang,
24
26
  ...query,
25
27
  };
26
28
  const url = API_DATA_STRUCTURES_EDITABLE_CSV;
@@ -19,7 +19,7 @@ export function saveFile(data) {
19
19
  export function* downloadStructuresSaga({ payload }) {
20
20
  try {
21
21
  const headerLabels = _.propOr({}, "headerLabels")(payload);
22
- const lang = _.propOr("es", "lang")(payload);
22
+ const lang = _.propOr("en", "lang")(payload);
23
23
 
24
24
  const query = yield select(getPreviousStructureQuery);
25
25
  const body = {
@@ -5,7 +5,8 @@ import { API_STRUCTURES_UPLOAD } from "../api";
5
5
 
6
6
  export function* uploadStructuresSaga({ payload }) {
7
7
  try {
8
- const { data: body } = payload;
8
+ const { data: body, lang } = payload;
9
+ body.append("lang", lang);
9
10
  yield put(uploadStructures.request());
10
11
  const { status, data } = yield call(
11
12
  apiJsonPost,