@zeniai/client-epic-state 4.11.44 → 4.11.45

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.
@@ -15,34 +15,36 @@ const approveOrRejectBillsBulkActionEpic = (actions$, state$, zeniAPI) => action
15
15
  return zeniAPI
16
16
  .putAndGetJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/bulk/bills/transactions`, payload)
17
17
  .pipe((0, operators_1.mergeMap)((response) => {
18
- var _a, _b, _c, _d, _e, _f, _g, _h;
18
+ var _a, _b, _c, _d, _e, _f;
19
19
  if ((0, responsePayload_1.isSuccessStatus)(response)) {
20
20
  const actions = [];
21
21
  const processingBillsCount = (_b = (_a = response.data) === null || _a === void 0 ? void 0 : _a.total_operations_processing) !== null && _b !== void 0 ? _b : 0;
22
22
  actions.push((0, billsBulkActionViewReducer_1.billsBulkActionSuccess)({
23
- billsProcessing: (_d = (_c = response.data) === null || _c === void 0 ? void 0 : _c.total_operations_processing) !== null && _d !== void 0 ? _d : 0,
24
- refreshTime: (_f = (_e = response.data) === null || _e === void 0 ? void 0 : _e.hard_refresh_after_sec) !== null && _f !== void 0 ? _f : 0,
25
- }));
26
- actions.push((0, billTransactionReducer_1.updateBillTransactionsWithBulkActionStatus)((_h = (_g = response.data) === null || _g === void 0 ? void 0 : _g.operations) !== null && _h !== void 0 ? _h : []));
27
- actions.push((0, snackbarReducer_1.openSnackbar)({
28
- messageSection: 'bill_pay_bulk_submit',
29
- messageText: 'success',
30
- type: 'success',
31
- variables: [
32
- {
33
- variableName: '_count_',
34
- variableValue: processingBillsCount.toString(),
35
- },
36
- {
37
- variableName: '_bill_',
38
- variableValue: processingBillsCount > 1 ? 'bills' : 'bill',
39
- },
40
- {
41
- variableName: '_action_',
42
- variableValue: approvalType,
43
- },
44
- ],
23
+ billsProcessing: processingBillsCount,
24
+ refreshTime: (_d = (_c = response.data) === null || _c === void 0 ? void 0 : _c.hard_refresh_after_sec) !== null && _d !== void 0 ? _d : 0,
45
25
  }));
26
+ actions.push((0, billTransactionReducer_1.updateBillTransactionsWithBulkActionStatus)((_f = (_e = response.data) === null || _e === void 0 ? void 0 : _e.operations) !== null && _f !== void 0 ? _f : []));
27
+ if (processingBillsCount > 0) {
28
+ actions.push((0, snackbarReducer_1.openSnackbar)({
29
+ messageSection: 'bill_pay_bulk_submit',
30
+ messageText: 'success',
31
+ type: 'success',
32
+ variables: [
33
+ {
34
+ variableName: '_count_',
35
+ variableValue: processingBillsCount.toString(),
36
+ },
37
+ {
38
+ variableName: '_bill_',
39
+ variableValue: processingBillsCount > 1 ? 'bills' : 'bill',
40
+ },
41
+ {
42
+ variableName: '_action_',
43
+ variableValue: approvalType,
44
+ },
45
+ ],
46
+ }));
47
+ }
46
48
  return (0, rxjs_1.from)(actions);
47
49
  }
48
50
  else {
@@ -26,25 +26,27 @@ const cancelOrDeleteBillsBulkActionEpic = (actions$, state$, zeniAPI) => actions
26
26
  refreshTime: (_d = (_c = response.data) === null || _c === void 0 ? void 0 : _c.hard_refresh_after_sec) !== null && _d !== void 0 ? _d : 0,
27
27
  }));
28
28
  actions.push((0, billTransactionReducer_1.updateBillTransactionsWithBulkActionStatus)((_f = (_e = response.data) === null || _e === void 0 ? void 0 : _e.operations) !== null && _f !== void 0 ? _f : []));
29
- actions.push((0, snackbarReducer_1.openSnackbar)({
30
- messageSection: 'bill_pay_bulk_submit',
31
- messageText: 'success',
32
- type: 'success',
33
- variables: [
34
- {
35
- variableName: '_count_',
36
- variableValue: processingBillsCount.toString(),
37
- },
38
- {
39
- variableName: '_bill_',
40
- variableValue: processingBillsCount > 1 ? 'bills' : 'bill',
41
- },
42
- {
43
- variableName: '_action_',
44
- variableValue: operationType === 'cancel' ? 'canceled' : 'deleted',
45
- },
46
- ],
47
- }));
29
+ if (processingBillsCount > 0) {
30
+ actions.push((0, snackbarReducer_1.openSnackbar)({
31
+ messageSection: 'bill_pay_bulk_submit',
32
+ messageText: 'success',
33
+ type: 'success',
34
+ variables: [
35
+ {
36
+ variableName: '_count_',
37
+ variableValue: processingBillsCount.toString(),
38
+ },
39
+ {
40
+ variableName: '_bill_',
41
+ variableValue: processingBillsCount > 1 ? 'bills' : 'bill',
42
+ },
43
+ {
44
+ variableName: '_action_',
45
+ variableValue: operationType === 'cancel' ? 'canceled' : 'deleted',
46
+ },
47
+ ],
48
+ }));
49
+ }
48
50
  return (0, rxjs_1.from)(actions);
49
51
  }
50
52
  else {
@@ -18,34 +18,36 @@ const submitDraftBillsBulkActionEpic = (actions$, state$, zeniAPI) => actions$.p
18
18
  return zeniAPI
19
19
  .putAndGetJSON(bulkApiUrl, payload)
20
20
  .pipe((0, operators_1.mergeMap)((response) => {
21
- var _a, _b, _c, _d, _e, _f, _g, _h;
21
+ var _a, _b, _c, _d, _e, _f;
22
22
  if ((0, responsePayload_1.isSuccessStatus)(response)) {
23
23
  const actions = [];
24
24
  const processingBillsCount = (_b = (_a = response.data) === null || _a === void 0 ? void 0 : _a.total_operations_processing) !== null && _b !== void 0 ? _b : 0;
25
25
  actions.push((0, billsBulkActionViewReducer_1.billsBulkActionSuccess)({
26
- billsProcessing: (_d = (_c = response.data) === null || _c === void 0 ? void 0 : _c.total_operations_processing) !== null && _d !== void 0 ? _d : 0,
27
- refreshTime: (_f = (_e = response.data) === null || _e === void 0 ? void 0 : _e.hard_refresh_after_sec) !== null && _f !== void 0 ? _f : 0,
28
- }));
29
- actions.push((0, billTransactionReducer_1.updateBillTransactionsWithBulkActionStatus)((_h = (_g = response.data) === null || _g === void 0 ? void 0 : _g.operations) !== null && _h !== void 0 ? _h : []));
30
- actions.push((0, snackbarReducer_1.openSnackbar)({
31
- messageSection: 'bill_pay_bulk_submit',
32
- messageText: 'success',
33
- type: 'success',
34
- variables: [
35
- {
36
- variableName: '_count_',
37
- variableValue: processingBillsCount.toString(),
38
- },
39
- {
40
- variableName: '_bill_',
41
- variableValue: processingBillsCount > 1 ? 'bills' : 'bill',
42
- },
43
- {
44
- variableName: '_action_',
45
- variableValue: 'sent for approval',
46
- },
47
- ],
26
+ billsProcessing: processingBillsCount,
27
+ refreshTime: (_d = (_c = response.data) === null || _c === void 0 ? void 0 : _c.hard_refresh_after_sec) !== null && _d !== void 0 ? _d : 0,
48
28
  }));
29
+ actions.push((0, billTransactionReducer_1.updateBillTransactionsWithBulkActionStatus)((_f = (_e = response.data) === null || _e === void 0 ? void 0 : _e.operations) !== null && _f !== void 0 ? _f : []));
30
+ if (processingBillsCount > 0) {
31
+ actions.push((0, snackbarReducer_1.openSnackbar)({
32
+ messageSection: 'bill_pay_bulk_submit',
33
+ messageText: 'success',
34
+ type: 'success',
35
+ variables: [
36
+ {
37
+ variableName: '_count_',
38
+ variableValue: processingBillsCount.toString(),
39
+ },
40
+ {
41
+ variableName: '_bill_',
42
+ variableValue: processingBillsCount > 1 ? 'bills' : 'bill',
43
+ },
44
+ {
45
+ variableName: '_action_',
46
+ variableValue: 'sent for approval',
47
+ },
48
+ ],
49
+ }));
50
+ }
49
51
  return (0, rxjs_1.from)(actions);
50
52
  }
51
53
  else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "4.11.44",
3
+ "version": "4.11.45",
4
4
  "description": "Shared module between Web & Mobile containing required abstractions for state management, async network communication. ",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",