@rh-support/manage 2.1.42 → 2.1.44

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":"PartnershipsTermsModal.d.ts","sourceRoot":"","sources":["../../../../src/components/ManagePartnerships/PartnershipsTermsModal.tsx"],"names":[],"mappings":"AAgBA,wBAAgB,SAAS,WAMxB;AAID,eAAO,MAAM,sBAAsB,mBA0KlC,CAAC"}
1
+ {"version":3,"file":"PartnershipsTermsModal.d.ts","sourceRoot":"","sources":["../../../../src/components/ManagePartnerships/PartnershipsTermsModal.tsx"],"names":[],"mappings":"AAgBA,wBAAgB,SAAS,WAMxB;AAID,eAAO,MAAM,sBAAsB,mBA0LlC,CAAC"}
@@ -66,30 +66,40 @@ export const PartnershipsTermsModal = () => {
66
66
  const termAck = (ackResponse) => __awaiter(void 0, void 0, void 0, function* () {
67
67
  setIsUpdating(true);
68
68
  setAckChoice(ackResponse);
69
+ setIsTermsModalOpen(false);
69
70
  try {
70
71
  yield pcm.partnerships.partnerLinkAckResponse(linkHash, ackResponse);
71
72
  setIsUpdating(false);
72
73
  setIsUpdatingAccounts(dispatch, true);
74
+ setIsTermsVisited(true);
75
+ setIsTermsModalOpen(true);
73
76
  }
74
77
  catch (e) {
75
- ToastNotification.addDangerMessage(ackResponse === 'accept' ? t('Failed to add partnership.') : t('Failed to decline partnership.'), React.createElement(Button, { variant: ButtonVariant.link, isInline: true, onClick: () => setIsTermsModalOpen(true) },
78
+ const errorDetail = e.detailMessage || '';
79
+ const errorBody = errorDetail ? (errorDetail) : (React.createElement(Button, { variant: ButtonVariant.link, isInline: true, onClick: () => setIsTermsModalOpen(true) },
76
80
  React.createElement(Trans, null, "Try again")));
81
+ ToastNotification.addDangerMessage(ackResponse === 'accept' ? t('Failed to add partnership.') : t('Failed to decline partnership.'), errorBody);
77
82
  setIsUpdating(false);
83
+ setIsTermsVisited(false);
78
84
  }
79
- history.push({
85
+ const navigationObj = {
86
+ pathname: '/manage/partnerships',
80
87
  search: '',
81
- });
88
+ };
89
+ history.replace(navigationObj);
82
90
  });
83
91
  verifyLink();
84
92
  const decisionAccepted = /decision-\d+=accepted/gi.exec(location.search);
85
93
  const decisionDeclined = /rejectedTnC=true/gi.exec(location.search);
86
94
  const ackID = get(/ackID=(\d+)/gi.exec(location.search), [1]);
87
- if ((!!decisionAccepted && ackID) || !!decisionDeclined) {
88
- const choice = !!decisionAccepted ? 'accept' : !!decisionDeclined ? 'decline' : undefined;
89
- setAckChoice(choice);
90
- termAck(choice);
91
- setIsTermsVisited(true);
92
- }
95
+ const showModal = () => __awaiter(void 0, void 0, void 0, function* () {
96
+ if ((!!decisionAccepted && ackID) || !!decisionDeclined) {
97
+ const choice = !!decisionAccepted ? 'accept' : !!decisionDeclined ? 'decline' : undefined;
98
+ setAckChoice(choice);
99
+ yield termAck(choice);
100
+ }
101
+ });
102
+ showModal();
93
103
  // eslint-disable-next-line react-hooks/exhaustive-deps
94
104
  }, [linkHash]);
95
105
  return (React.createElement(Modal, { id: "partnership-terms-and-conditions-modal", className: "pf-modal-overflow-visible", title: 'Confirm partnership collaboration', isOpen: isTermsModalOpen, onClose: onClose, showClose: true, onEscapePress: onClose, variant: ModalVariant.large, actions: !isTermVisited
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rh-support/manage",
3
- "version": "2.1.42",
3
+ "version": "2.1.44",
4
4
  "description": "Customer Support Manage App",
5
5
  "author": "Jordan Eudy <jeudy100@gmail.com>",
6
6
  "homepage": "",
@@ -77,9 +77,9 @@
77
77
  "@patternfly/patternfly": "5.1.0",
78
78
  "@patternfly/react-core": "5.1.1",
79
79
  "@patternfly/react-table": "5.1.1",
80
- "@rh-support/components": "2.1.31",
80
+ "@rh-support/components": "2.1.32",
81
81
  "@rh-support/configs": "2.0.14",
82
- "@rh-support/react-context": "2.1.34",
82
+ "@rh-support/react-context": "2.1.35",
83
83
  "@rh-support/types": "2.0.2",
84
84
  "@rh-support/user-permissions": "2.1.22",
85
85
  "@rh-support/utils": "2.1.15",
@@ -96,5 +96,5 @@
96
96
  "defaults and supports es6-module",
97
97
  "maintained node versions"
98
98
  ],
99
- "gitHead": "0be2733af553431eb0064993df8c0f097e12a47f"
99
+ "gitHead": "d52b9ccf062855933cbb1da3dac7f4c6a2694671"
100
100
  }