@thecb/components 10.2.4-beta.13 → 10.2.4-beta.14

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": "@thecb/components",
3
- "version": "10.2.4-beta.13",
3
+ "version": "10.2.4-beta.14",
4
4
  "description": "Common lib for CityBase react components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "typings": "dist/index.d.ts",
@@ -115,6 +115,7 @@ const Obligation = ({
115
115
  description={description}
116
116
  subDescription={subDescription}
117
117
  allowedPaymentInstruments={allowedPaymentInstruments}
118
+ isInCustomerManagement={isInCustomerManagement}
118
119
  />
119
120
  )}
120
121
  </Cluster>
@@ -221,6 +222,7 @@ const Obligation = ({
221
222
  description={description}
222
223
  subDescription={subDescription}
223
224
  allowedPaymentInstruments={allowedPaymentInstruments}
225
+ isInCustomerManagement={isInCustomerManagement}
224
226
  />
225
227
  )}
226
228
  </Cluster>
@@ -243,6 +245,7 @@ const Obligation = ({
243
245
  description={description}
244
246
  subDescription={subDescription}
245
247
  allowedPaymentInstruments={allowedPaymentInstruments}
248
+ isInCustomerManagement={isInCustomerManagement}
246
249
  />
247
250
  )}
248
251
  </Stack>
@@ -18,7 +18,8 @@ const AmountModule = ({
18
18
  nextAutopayDate,
19
19
  description,
20
20
  subDescription,
21
- allowedPaymentInstruments
21
+ allowedPaymentInstruments,
22
+ isInCustomerManagement = false
22
23
  }) => {
23
24
  const [modalOpen, toggleModal] = useState(false);
24
25
  return (
@@ -49,6 +50,7 @@ const AmountModule = ({
49
50
  description={description}
50
51
  subDescription={subDescription}
51
52
  allowedPaymentInstruments={allowedPaymentInstruments}
53
+ isInCustomerManagement={isInCustomerManagement}
52
54
  />
53
55
  )}
54
56
  </Stack>
@@ -10,7 +10,7 @@ const groupId = "props";
10
10
  export const amountModule = () => (
11
11
  <AmountModule
12
12
  totalAmountDue={text("totalAmountDue", "123", groupId)}
13
- autoPayEnabled={boolean("autopayEnabled", true, groupId)}
13
+ autoPayEnabled={boolean("autoPayEnabled", true, groupId)}
14
14
  isMobile={boolean("isMobile", false, groupId)}
15
15
  deactivatePaymentSchedule={noop}
16
16
  navigateToSettings={noop}
@@ -87,7 +87,7 @@ const AutopayModal = ({
87
87
  }
88
88
  variant="secondary"
89
89
  action={() => {
90
- toggleModal(true);
90
+ isInCustomerManagement ? noop : toggleModal(true);
91
91
  }}
92
92
  dataQa="Turn off Autopay"
93
93
  extraStyles={
@@ -101,14 +101,14 @@ const AutopayModal = ({
101
101
  case "tertiary": {
102
102
  return (
103
103
  <ButtonWithAction
104
- disabled={isInCustomerManagement}
105
104
  text={autoPayActive ? `Manage ${shortPlan}` : `Set Up ${shortPlan}`}
106
105
  variant="tertiary"
107
106
  action={() => {
108
- toggleModal(true);
107
+ isInCustomerManagement ? noop : toggleModal(true);
109
108
  }}
110
109
  dataQa="Manage Autopay"
111
110
  extraStyles={isMobile && `flex-grow: 1; width: 100%;`}
111
+ disabled={isInCustomerManagement}
112
112
  />
113
113
  );
114
114
  }
@@ -117,7 +117,7 @@ const AutopayModal = ({
117
117
  <Box
118
118
  padding="0"
119
119
  onClick={() => {
120
- toggleModal(true);
120
+ isInCustomerManagement ? noop : toggleModal(true);
121
121
  }}
122
122
  hoverStyles={hoverStyles}
123
123
  activeStyles={activeStyles}
@@ -130,9 +130,13 @@ const AutopayModal = ({
130
130
  <AutopayOnIcon />
131
131
  <Text
132
132
  variant="pS"
133
- onClick={() => toggleModal(true)}
133
+ onClick={() =>
134
+ isInCustomerManagement ? noop : toggleModal(true)
135
+ }
134
136
  onKeyPress={e => {
135
- e.key === "Enter" && toggleModal(true);
137
+ isInCustomerManagement
138
+ ? noop
139
+ : e.key === "Enter" && toggleModal(true);
136
140
  }}
137
141
  tabIndex="0"
138
142
  dataQa={`${shortPlan} On`}
@@ -151,8 +155,8 @@ const AutopayModal = ({
151
155
  };
152
156
  return (
153
157
  <Modal
154
- showModal={() => toggleModal(true)}
155
- hideModal={() => toggleModal(false)}
158
+ showModal={() => (isInCustomerManagement ? noop : toggleModal(true))}
159
+ hideModal={() => (isInCustomerManagement ? noop : toggleModal(false))}
156
160
  modalOpen={modalOpen}
157
161
  {...modalExtraProps}
158
162
  >
@@ -21,7 +21,8 @@ const InactiveControlsModule = ({
21
21
  actions,
22
22
  description,
23
23
  subDescription,
24
- allowedPaymentInstruments
24
+ allowedPaymentInstruments,
25
+ isInCustomerManagement = false
25
26
  }) => {
26
27
  const [modalOpen, toggleModal] = useState(false);
27
28
  const { deleteObligationAssoc } = actions;
@@ -58,15 +59,17 @@ const InactiveControlsModule = ({
58
59
  description={description}
59
60
  subDescription={subDescription}
60
61
  allowedPaymentInstruments={allowedPaymentInstruments}
62
+ isInCustomerManagement={isInCustomerManagement}
61
63
  />
62
64
  </Box>
63
65
  )}
64
66
  <Box padding="0" extraStyles={`flex-grow: 1;`}>
65
67
  <RemoveAccountModalModule
66
68
  agencyName={agencyName}
67
- removeAccount={handleRemoveAccount}
69
+ removeAccount={isInCustomerManagement ? noop : handleRemoveAccount}
68
70
  accountType={configType === "ACCOUNT" ? "Account" : "Property"}
69
71
  isMobile={isMobile}
72
+ isInCustomerManagement={isInCustomerManagement}
70
73
  />
71
74
  </Box>
72
75
  </Cluster>
@@ -4,6 +4,7 @@ import ButtonWithAction from "../../../atoms/button-with-action";
4
4
  import { AutopayModalModule } from "./AutopayModalModule";
5
5
  import { GHOST_GREY } from "../../../../constants/colors";
6
6
  import AmountModule from "./AmountModule";
7
+ import { noop } from "../../../../util/general";
7
8
 
8
9
  const PaymentDetailsActions = ({
9
10
  isMobile,
@@ -80,6 +81,7 @@ const PaymentDetailsActions = ({
80
81
  description={description}
81
82
  subDescription={subDescription}
82
83
  allowedPaymentInstruments={allowedPaymentInstruments}
84
+ isInCustomerManagement={isInCustomerManagement}
83
85
  />
84
86
  </Cluster>
85
87
  </Box>
@@ -139,6 +141,7 @@ const PaymentDetailsActions = ({
139
141
  description={description}
140
142
  subDescription={subDescription}
141
143
  allowedPaymentInstruments={allowedPaymentInstruments}
144
+ isInCustomerManagement={isInCustomerManagement}
142
145
  />
143
146
  )}
144
147
  </Box>
@@ -146,7 +149,9 @@ const PaymentDetailsActions = ({
146
149
  <Box padding={"0"}>
147
150
  <ButtonWithAction
148
151
  isLoading={isLoading}
149
- action={() => handleClick(obligations)}
152
+ action={() =>
153
+ isInCustomerManagement ? noop : handleClick(obligations)
154
+ }
150
155
  text="Pay Now"
151
156
  variant={isMobile ? "smallSecondary" : "secondary"}
152
157
  dataQa="Pay Now"
@@ -8,7 +8,8 @@ const RemoveAccountModalModule = ({
8
8
  obligations = [],
9
9
  removeAccount,
10
10
  accountType,
11
- isMobile
11
+ isMobile,
12
+ isInCustomerManagement = false
12
13
  }) => {
13
14
  const [modalIsOpen, setModalIsOpen] = useState(false);
14
15
  const lastItem = [...obligations].pop();
@@ -54,6 +55,7 @@ const RemoveAccountModalModule = ({
54
55
  extraStyles={
55
56
  isMobile ? `flex-grow: 1; width: 100%; margin: 0;` : `flex-grow: 1;`
56
57
  }
58
+ disabled={isInCustomerManagement}
57
59
  />
58
60
  </Box>
59
61
  </Modal>