@hmcts/ccpay-web-component 5.0.1-beta15 → 5.0.1-beta19

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.
@@ -210,6 +210,9 @@
210
210
  errorMessage = err.error;
211
211
  }
212
212
  }
213
+ else if (err.status === 500) {
214
+ errorMessage = 'Internal server error';
215
+ }
213
216
  else if (err.error.messsage === undefined) {
214
217
  if (typeof err.error === 'object') {
215
218
  errorMessage = JSON.parse(JSON.stringify(err.error)).error;
@@ -2841,7 +2844,7 @@
2841
2844
  * @param {?} response
2842
2845
  * @return {?}
2843
2846
  */function (response) {
2844
- _this.cpoDetails = JSON.parse(response).data.content[0];
2847
+ _this.cpoDetails = JSON.parse(response).content[0];
2845
2848
  }), ( /**
2846
2849
  * @param {?} error
2847
2850
  * @return {?}
@@ -2872,7 +2875,7 @@
2872
2875
  * @param {?} response
2873
2876
  * @return {?}
2874
2877
  */function (response) {
2875
- _this.cpoDetails = JSON.parse(response).data.content[0];
2878
+ _this.cpoDetails = JSON.parse(response).content[0];
2876
2879
  }), ( /**
2877
2880
  * @param {?} error
2878
2881
  * @return {?}
@@ -7953,11 +7956,9 @@
7953
7956
  * @fileoverview added by tsickle
7954
7957
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
7955
7958
  */
7956
- /** @type {?} */
7957
- var BS_ENABLE_FLAG$4 = 'bulk-scan-enabling-fe';
7958
7959
  var RefundStatusComponent = /** @class */ (function () {
7959
- // allowedRolesToAccessRefund = ['payments-refund-approver', 'payments-refund'];
7960
7960
  function RefundStatusComponent(formBuilder, refundService, paymentLibComponent, paymentViewService, router$$1, OrderslistService$$1) {
7961
+ var _this = this;
7961
7962
  this.formBuilder = formBuilder;
7962
7963
  this.refundService = refundService;
7963
7964
  this.paymentLibComponent = paymentLibComponent;
@@ -7981,6 +7982,17 @@
7981
7982
  this.isRefundBtnDisabled = true;
7982
7983
  this.isLastUpdatedByCurrentUser = true;
7983
7984
  this.isProcessRefund = false;
7985
+ this.allowedRolesToAccessRefund = ['payments-refund-approver', 'payments-refund'];
7986
+ this.check4AllowedRoles2AccessRefund = ( /**
7987
+ * @return {?}
7988
+ */function () {
7989
+ return _this.allowedRolesToAccessRefund.some(( /**
7990
+ * @param {?} role
7991
+ * @return {?}
7992
+ */function (role) {
7993
+ return _this.LOGGEDINUSERROLES.indexOf(role) !== -1;
7994
+ }));
7995
+ });
7984
7996
  }
7985
7997
  /**
7986
7998
  * @return {?}
@@ -7990,89 +8002,73 @@
7990
8002
  */
7991
8003
  function () {
7992
8004
  var _this = this;
7993
- // if (this.check4AllowedRoles2AccessRefund()) {
7994
- this.resetRemissionForm([false, false, false, false], 'All');
7995
- this.bsPaymentDcnNumber = this.paymentLibComponent.bspaymentdcn;
7996
- this.isCallFromRefundList = this.paymentLibComponent.isCallFromRefundList;
7997
- // if(this.paymentLibComponent.isFromRefundStatusPage) {
7998
- // this.viewName = 'reviewandsubmitview';
7999
- // }
8000
- if (this.paymentLibComponent.isRefundStatusView) {
8001
- this.viewName = 'refundview';
8002
- this.OrderslistService.getRefundView().subscribe(( /**
8003
- * @param {?} data
8004
- * @return {?}
8005
- */function (data) { return _this.refundlist = data; }));
8006
- this.OrderslistService.getCCDCaseNumberforRefund.subscribe(( /**
8007
- * @param {?} data
8008
- * @return {?}
8009
- */function (data) { return _this.ccdCaseNumber = data; }));
8010
- }
8011
- else {
8012
- this.viewName = 'refundstatuslist';
8013
- this.refundService.getRefundStatusList(this.ccdCaseNumber).subscribe(( /**
8014
- * @param {?} refundList
8015
- * @return {?}
8016
- */function (refundList) {
8017
- _this.rejectedRefundList = refundList['refund_list'];
8018
- })),
8019
- ( /**
8020
- * @param {?} error
8005
+ if (this.check4AllowedRoles2AccessRefund()) {
8006
+ this.resetRemissionForm([false, false, false, false], 'All');
8007
+ this.bsPaymentDcnNumber = this.paymentLibComponent.bspaymentdcn;
8008
+ this.isCallFromRefundList = this.paymentLibComponent.isCallFromRefundList;
8009
+ // if(this.paymentLibComponent.isFromRefundStatusPage) {
8010
+ // this.viewName = 'reviewandsubmitview';
8011
+ // }
8012
+ if (this.paymentLibComponent.isRefundStatusView) {
8013
+ this.viewName = 'refundview';
8014
+ this.OrderslistService.getRefundView().subscribe(( /**
8015
+ * @param {?} data
8021
8016
  * @return {?}
8022
- */function (error) {
8023
- _this.errorMessage = error.replace(/"/g, "");
8024
- });
8025
- }
8026
- this.refundStatusForm = this.formBuilder.group({
8027
- amount: new forms.FormControl('', forms.Validators.compose([
8028
- forms.Validators.required,
8029
- forms.Validators.pattern('^[0-9]+(\.[0-9]{1,2})?$')
8030
- ])),
8031
- refundReason: new forms.FormControl('', forms.Validators.compose([forms.Validators.required])),
8032
- reason: new forms.FormControl()
8033
- });
8034
- if (this.refundlist !== undefined) {
8035
- this.getRefundsStatusHistoryList();
8036
- if (this.LOGGEDINUSERROLES.some(( /**
8037
- * @param {?} i
8038
- * @return {?}
8039
- */function (i) { return i.includes('payments-refund-approver'); }))) {
8040
- this.isProcessRefund = true;
8041
- this.refundButtonState = this.refundlist.refund_status.name;
8042
- return;
8017
+ */function (data) { return _this.refundlist = data; }));
8018
+ this.OrderslistService.getCCDCaseNumberforRefund.subscribe(( /**
8019
+ * @param {?} data
8020
+ * @return {?}
8021
+ */function (data) { return _this.ccdCaseNumber = data; }));
8043
8022
  }
8044
- if (this.LOGGEDINUSERROLES.some(( /**
8045
- * @param {?} i
8046
- * @return {?}
8047
- */function (i) { return i.includes('payments-refund'); }))) {
8048
- this.isProcessRefund = false;
8049
- this.refundButtonState = this.refundlist.refund_status.name;
8023
+ else {
8024
+ this.viewName = 'refundstatuslist';
8025
+ this.refundService.getRefundStatusList(this.ccdCaseNumber).subscribe(( /**
8026
+ * @param {?} refundList
8027
+ * @return {?}
8028
+ */function (refundList) {
8029
+ _this.rejectedRefundList = refundList['refund_list'];
8030
+ })),
8031
+ ( /**
8032
+ * @param {?} error
8033
+ * @return {?}
8034
+ */function (error) {
8035
+ _this.errorMessage = error.replace(/"/g, "");
8036
+ });
8037
+ }
8038
+ this.refundStatusForm = this.formBuilder.group({
8039
+ amount: new forms.FormControl('', forms.Validators.compose([
8040
+ forms.Validators.required,
8041
+ forms.Validators.pattern('^[0-9]+(\.[0-9]{1,2})?$')
8042
+ ])),
8043
+ refundReason: new forms.FormControl('', forms.Validators.compose([forms.Validators.required])),
8044
+ reason: new forms.FormControl()
8045
+ });
8046
+ if (this.refundlist !== undefined) {
8047
+ this.getRefundsStatusHistoryList();
8048
+ if (this.LOGGEDINUSERROLES.some(( /**
8049
+ * @param {?} i
8050
+ * @return {?}
8051
+ */function (i) { return i.includes('payments-refund-approver'); }))) {
8052
+ this.isProcessRefund = true;
8053
+ this.refundButtonState = this.refundlist.refund_status.name;
8054
+ return;
8055
+ }
8056
+ if (this.LOGGEDINUSERROLES.some(( /**
8057
+ * @param {?} i
8058
+ * @return {?}
8059
+ */function (i) { return i.includes('payments-refund'); }))) {
8060
+ this.isProcessRefund = false;
8061
+ this.refundButtonState = this.refundlist.refund_status.name;
8062
+ }
8050
8063
  }
8051
8064
  }
8052
- // }
8053
8065
  };
8054
- // check4AllowedRoles2AccessRefund = (): boolean => {
8055
- // return this.allowedRolesToAccessRefund.some(role =>
8056
- // this.LOGGEDINUSERROLES.indexOf(role) !== -1
8057
- // );
8058
- // }
8059
- // check4AllowedRoles2AccessRefund = (): boolean => {
8060
- // return this.allowedRolesToAccessRefund.some(role =>
8061
- // this.LOGGEDINUSERROLES.indexOf(role) !== -1
8062
- // );
8063
- // }
8064
8066
  /**
8065
8067
  * @return {?}
8066
8068
  */
8067
- RefundStatusComponent.prototype.getRefundsStatusHistoryList =
8068
- // check4AllowedRoles2AccessRefund = (): boolean => {
8069
- // return this.allowedRolesToAccessRefund.some(role =>
8070
- // this.LOGGEDINUSERROLES.indexOf(role) !== -1
8071
- // );
8072
- // }
8073
- /**
8074
- * @return {?}
8075
- */
8069
+ RefundStatusComponent.prototype.getRefundsStatusHistoryList = /**
8070
+ * @return {?}
8071
+ */
8076
8072
  function () {
8077
8073
  var _this = this;
8078
8074
  if (this.refundlist !== undefined) {
@@ -8116,26 +8112,10 @@
8116
8112
  * @return {?}
8117
8113
  */
8118
8114
  function () {
8119
- var _this = this;
8120
8115
  this.paymentLibComponent.isRefundStatusView = false;
8121
8116
  //this.paymentLibComponent.TAKEPAYMENT = true;
8122
8117
  this.paymentLibComponent.viewName = 'case-transactions';
8123
- this.paymentViewService.getBSfeature().subscribe(( /**
8124
- * @param {?} features
8125
- * @return {?}
8126
- */function (features) {
8127
- /** @type {?} */
8128
- var result = JSON.parse(features).filter(( /**
8129
- * @param {?} feature
8130
- * @return {?}
8131
- */function (feature) { return feature.uid === BS_ENABLE_FLAG$4; }));
8132
- _this.paymentLibComponent.ISBSENABLE = result[0] ? result[0].enable : false;
8133
- }), ( /**
8134
- * @param {?} err
8135
- * @return {?}
8136
- */function (err) {
8137
- _this.paymentLibComponent.ISBSENABLE = false;
8138
- }));
8118
+ this.paymentLibComponent.ISBSENABLE = true;
8139
8119
  /** @type {?} */
8140
8120
  var partUrl = "selectedOption=" + this.paymentLibComponent.SELECTED_OPTION;
8141
8121
  partUrl += this.bsPaymentDcnNumber ? "&dcn=" + this.bsPaymentDcnNumber : '';