@rh-support/components 1.2.12 → 1.2.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.
@@ -1 +1 @@
1
- {"version":3,"file":"AcceptTermsModal.d.ts","sourceRoot":"","sources":["../../../src/TermsAndConditions/AcceptTermsModal.tsx"],"names":[],"mappings":";AAmBA,UAAU,MAAM;IACZ,WAAW,EAAE,OAAO,CAAC;IACrB,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5C,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;CAC3B;AAiBD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,eAkI7C"}
1
+ {"version":3,"file":"AcceptTermsModal.d.ts","sourceRoot":"","sources":["../../../src/TermsAndConditions/AcceptTermsModal.tsx"],"names":[],"mappings":";AAmBA,UAAU,MAAM;IACZ,WAAW,EAAE,OAAO,CAAC;IACrB,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5C,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;CAC3B;AAiBD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,eAyI7C"}
@@ -103,25 +103,32 @@ function AcceptTermsModal(props) {
103
103
  var t = react_i18next_1.useTranslation().t;
104
104
  react_1.useEffect(function () {
105
105
  var fetchTerms = function () { return __awaiter(_this, void 0, void 0, function () {
106
- var siteCode, eventCode, loggedInUser, response, defaultTranslation, translationLangInfoMap;
107
- return __generator(this, function (_a) {
108
- switch (_a.label) {
106
+ var siteCode, eventCode, loggedInUser, response, defaultTranslation_1, translationLangInfoMap, e_1;
107
+ var _a, _b, _c, _d;
108
+ return __generator(this, function (_e) {
109
+ switch (_e.label) {
109
110
  case 0:
111
+ _e.trys.push([0, 2, , 3]);
110
112
  siteCode = props.siteCode, eventCode = props.eventCode, loggedInUser = props.loggedInUser;
111
113
  return [4 /*yield*/, request(siteCode, eventCode, loggedInUser)];
112
114
  case 1:
113
- response = _a.sent();
114
- defaultTranslation = response[0].translations[0];
115
- translationLangInfoMap = response[0].translations.reduce(function (allTranslationsmap, translation) {
115
+ response = _e.sent();
116
+ defaultTranslation_1 = (_b = (_a = response === null || response === void 0 ? void 0 : response[0]) === null || _a === void 0 ? void 0 : _a.translations) === null || _b === void 0 ? void 0 : _b[0];
117
+ translationLangInfoMap = (_d = (_c = response === null || response === void 0 ? void 0 : response[0]) === null || _c === void 0 ? void 0 : _c.translations) === null || _d === void 0 ? void 0 : _d.reduce(function (allTranslationsmap, translation) {
116
118
  if (translation.isDefault) {
117
- defaultTranslation = translation;
119
+ defaultTranslation_1 = translation;
118
120
  }
119
121
  allTranslationsmap[translation['localeCode']] = translation;
120
122
  return allTranslationsmap;
121
123
  }, {});
122
- setSelectedTranslation(defaultTranslation);
124
+ setSelectedTranslation(defaultTranslation_1);
123
125
  setAllTranslations(translationLangInfoMap);
124
- return [2 /*return*/];
126
+ return [3 /*break*/, 3];
127
+ case 2:
128
+ e_1 = _e.sent();
129
+ console.log(e_1);
130
+ return [3 /*break*/, 3];
131
+ case 3: return [2 /*return*/];
125
132
  }
126
133
  });
127
134
  }); };
@@ -1 +1 @@
1
- {"version":3,"file":"AcceptTermsModal.d.ts","sourceRoot":"","sources":["../../../src/TermsAndConditions/AcceptTermsModal.tsx"],"names":[],"mappings":";AAmBA,UAAU,MAAM;IACZ,WAAW,EAAE,OAAO,CAAC;IACrB,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5C,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;CAC3B;AAiBD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,eAkI7C"}
1
+ {"version":3,"file":"AcceptTermsModal.d.ts","sourceRoot":"","sources":["../../../src/TermsAndConditions/AcceptTermsModal.tsx"],"names":[],"mappings":";AAmBA,UAAU,MAAM;IACZ,WAAW,EAAE,OAAO,CAAC;IACrB,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5C,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;CAC3B;AAiBD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,eAyI7C"}
@@ -37,18 +37,24 @@ export function AcceptTermsModal(props) {
37
37
  const { t } = useTranslation();
38
38
  useEffect(() => {
39
39
  const fetchTerms = () => __awaiter(this, void 0, void 0, function* () {
40
- const { siteCode, eventCode, loggedInUser } = props;
41
- const response = yield request(siteCode, eventCode, loggedInUser);
42
- let defaultTranslation = response[0].translations[0];
43
- const translationLangInfoMap = response[0].translations.reduce((allTranslationsmap, translation) => {
44
- if (translation.isDefault) {
45
- defaultTranslation = translation;
46
- }
47
- allTranslationsmap[translation['localeCode']] = translation;
48
- return allTranslationsmap;
49
- }, {});
50
- setSelectedTranslation(defaultTranslation);
51
- setAllTranslations(translationLangInfoMap);
40
+ var _a, _b, _c, _d;
41
+ try {
42
+ const { siteCode, eventCode, loggedInUser } = props;
43
+ const response = yield request(siteCode, eventCode, loggedInUser);
44
+ let defaultTranslation = (_b = (_a = response === null || response === void 0 ? void 0 : response[0]) === null || _a === void 0 ? void 0 : _a.translations) === null || _b === void 0 ? void 0 : _b[0];
45
+ const translationLangInfoMap = (_d = (_c = response === null || response === void 0 ? void 0 : response[0]) === null || _c === void 0 ? void 0 : _c.translations) === null || _d === void 0 ? void 0 : _d.reduce((allTranslationsmap, translation) => {
46
+ if (translation.isDefault) {
47
+ defaultTranslation = translation;
48
+ }
49
+ allTranslationsmap[translation['localeCode']] = translation;
50
+ return allTranslationsmap;
51
+ }, {});
52
+ setSelectedTranslation(defaultTranslation);
53
+ setAllTranslations(translationLangInfoMap);
54
+ }
55
+ catch (e) {
56
+ console.log(e);
57
+ }
52
58
  });
53
59
  fetchTerms();
54
60
  // eslint-disable-next-line react-hooks/exhaustive-deps
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rh-support/components",
3
- "version": "1.2.12",
3
+ "version": "1.2.13",
4
4
  "description": "Contains all reusabel components for support app",
5
5
  "author": "Vikas Rathee <vrathee@redhat.com>",
6
6
  "license": "ISC",
@@ -126,5 +126,5 @@
126
126
  "not ie <= 11",
127
127
  "not op_mini all"
128
128
  ],
129
- "gitHead": "e37bef728cf73aec23bea1060d855aeb01ae62b6"
129
+ "gitHead": "8e9b0b138cec4a9e71180e96ee391702b6754236"
130
130
  }