@hmcts/ccpay-web-component 5.0.7-beta03 → 5.0.7-beta06
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/bundles/hmcts-ccpay-web-component.umd.js +37 -4
- package/bundles/hmcts-ccpay-web-component.umd.js.map +1 -1
- package/bundles/hmcts-ccpay-web-component.umd.min.js +1 -1
- package/bundles/hmcts-ccpay-web-component.umd.min.js.map +1 -1
- package/esm2015/lib/components/reports/reports.component.js +28 -3
- package/esm2015/lib/services/shared/error-handler.service.js +7 -3
- package/esm5/lib/components/reports/reports.component.js +28 -3
- package/esm5/lib/services/shared/error-handler.service.js +11 -3
- package/fesm2015/hmcts-ccpay-web-component.js +29 -4
- package/fesm2015/hmcts-ccpay-web-component.js.map +1 -1
- package/fesm5/hmcts-ccpay-web-component.js +33 -4
- package/fesm5/hmcts-ccpay-web-component.js.map +1 -1
- package/hmcts-ccpay-web-component.metadata.json +1 -1
- package/lib/components/reports/reports.component.d.ts +2 -0
- package/lib/services/shared/error-handler.service.d.ts +1 -1
- package/package.json +1 -1
|
@@ -710,16 +710,28 @@
|
|
|
710
710
|
};
|
|
711
711
|
/**
|
|
712
712
|
* @param {?} isErrorExist
|
|
713
|
+
* @param {?=} isDataNotExist
|
|
714
|
+
* @param {?=} error
|
|
713
715
|
* @return {?}
|
|
714
716
|
*/
|
|
715
717
|
ErrorHandlerService.prototype.getServerErrorMessage = /**
|
|
716
718
|
* @param {?} isErrorExist
|
|
719
|
+
* @param {?=} isDataNotExist
|
|
720
|
+
* @param {?=} error
|
|
717
721
|
* @return {?}
|
|
718
722
|
*/
|
|
719
|
-
function (isErrorExist) {
|
|
723
|
+
function (isErrorExist, isDataNotExist, error) {
|
|
724
|
+
if (isDataNotExist === void 0) {
|
|
725
|
+
isDataNotExist = false;
|
|
726
|
+
}
|
|
727
|
+
if (error === void 0) {
|
|
728
|
+
error = '';
|
|
729
|
+
}
|
|
730
|
+
/** @type {?} */
|
|
731
|
+
var bodyContent = isDataNotExist ? error : 'Try again later';
|
|
720
732
|
return {
|
|
721
733
|
title: "There is a problem with the service",
|
|
722
|
-
body:
|
|
734
|
+
body: bodyContent,
|
|
723
735
|
showError: isErrorExist
|
|
724
736
|
};
|
|
725
737
|
};
|
|
@@ -8065,6 +8077,7 @@
|
|
|
8065
8077
|
this.loc = 'en-US';
|
|
8066
8078
|
this.isDownLoadButtondisabled = false;
|
|
8067
8079
|
this.isStartDateLesthanEndDate = false;
|
|
8080
|
+
this.isDateBetwnMonth = false;
|
|
8068
8081
|
this.isDateRangeBetnWeek = false;
|
|
8069
8082
|
this.errorMessage = this.errorHandlerService.getServerErrorMessage(false);
|
|
8070
8083
|
this.paymentGroups = [];
|
|
@@ -8111,16 +8124,26 @@
|
|
|
8111
8124
|
var selectedEndDate = this.tranformDate(this.reportsForm.get('endDate').value);
|
|
8112
8125
|
/** @type {?} */
|
|
8113
8126
|
var isDateRangeMoreThanWeek = (( /** @type {?} */(new Date(selectedStartDate))) - ( /** @type {?} */(new Date(selectedEndDate)))) / (1000 * 3600 * -24) > 7;
|
|
8127
|
+
/** @type {?} */
|
|
8128
|
+
var isDateRangeMoreThanMonth = (( /** @type {?} */(new Date(selectedStartDate))) - ( /** @type {?} */(new Date(selectedEndDate)))) / (1000 * 3600 * -24) > 30;
|
|
8114
8129
|
if (new Date(selectedStartDate) > new Date(selectedEndDate) && selectedEndDate !== '') {
|
|
8115
8130
|
this.reportsForm.get('startDate').setValue('');
|
|
8116
8131
|
this.isDateRangeBetnWeek = false;
|
|
8132
|
+
this.isDateBetwnMonth = false;
|
|
8117
8133
|
this.isStartDateLesthanEndDate = true;
|
|
8118
8134
|
}
|
|
8119
8135
|
else if (reportName && reportName === 'SURPLUS_AND_SHORTFALL' && isDateRangeMoreThanWeek) {
|
|
8120
8136
|
this.isDateRangeBetnWeek = true;
|
|
8137
|
+
this.isDateBetwnMonth = false;
|
|
8138
|
+
this.isStartDateLesthanEndDate = false;
|
|
8139
|
+
}
|
|
8140
|
+
else if (reportName && reportName === 'PAYMENT_FAILURE_EVENT' && isDateRangeMoreThanMonth) {
|
|
8141
|
+
this.isDateRangeBetnWeek = false;
|
|
8142
|
+
this.isDateBetwnMonth = true;
|
|
8121
8143
|
this.isStartDateLesthanEndDate = false;
|
|
8122
8144
|
}
|
|
8123
8145
|
else {
|
|
8146
|
+
this.isDateBetwnMonth = false;
|
|
8124
8147
|
this.isDateRangeBetnWeek = false;
|
|
8125
8148
|
this.isStartDateLesthanEndDate = false;
|
|
8126
8149
|
}
|
|
@@ -8224,6 +8247,9 @@
|
|
|
8224
8247
|
if (res['data'][i]["disputed_amount"] !== undefined) {
|
|
8225
8248
|
res['data'][i]['disputed_amount'] = _this.convertToFloatValue(res['data'][i]["disputed_amount"]);
|
|
8226
8249
|
}
|
|
8250
|
+
if (res['data'][i]["representment_status"] !== undefined) {
|
|
8251
|
+
res['data'][i]['representment_status'] = res['data'][i]["representment_status"].toLowerCase() === 'yes' ? 'Success' : 'Failure';
|
|
8252
|
+
}
|
|
8227
8253
|
}
|
|
8228
8254
|
}
|
|
8229
8255
|
_this.isDownLoadButtondisabled = false;
|
|
@@ -8233,7 +8259,14 @@
|
|
|
8233
8259
|
* @return {?}
|
|
8234
8260
|
*/function (error) {
|
|
8235
8261
|
_this.isDownLoadButtondisabled = false;
|
|
8236
|
-
|
|
8262
|
+
/** @type {?} */
|
|
8263
|
+
var errorContent = error.replace(/[^a-zA-Z ]/g, '').trim();
|
|
8264
|
+
/** @type {?} */
|
|
8265
|
+
var statusCode = error.replace(/[^a-zA-Z0-9 ]/g, '').trim().split(' ')[0];
|
|
8266
|
+
if (statusCode === '404') {
|
|
8267
|
+
_this.errorHandlerService.getServerErrorMessage(true, true, errorContent);
|
|
8268
|
+
}
|
|
8269
|
+
_this.errorHandlerService.getServerErrorMessage(true);
|
|
8237
8270
|
}));
|
|
8238
8271
|
}
|
|
8239
8272
|
else {
|
|
@@ -8438,7 +8471,7 @@
|
|
|
8438
8471
|
ReportsComponent.decorators = [
|
|
8439
8472
|
{ type: i0.Component, args: [{
|
|
8440
8473
|
selector: 'ccpay-reports',
|
|
8441
|
-
template: "<div class=\"header\">\n <input #myInput type='hidden' id='iFrameDrivenImageValue' value='REPORTS'>\n <ccpay-error-banner *ngIf=\"errorMessage.showError\" [errorMessage]=\"errorMessage\"></ccpay-error-banner>\n <legend class=\"govuk-fieldset__legend--xl\">\n <h1 class=\"govuk-fieldset__heading\"> Choose the report type and date range</h1>\n </legend>\n</div>\n<form [formGroup]=\"reportsForm\">\n <div class=\"govuk-form-group\">\n <div class=\"govuk-radios govuk-radios--conditional\" data-module=\"govuk-radios\">\n <div class=\"govuk-radios__item\">\n <input \n required\n id=\"DataLoss\"\n class=\"govuk-radios__input\"\n formControlName=\"selectedreport\"\n (click)=\"validateDates('DATA_LOSS')\"\n name=\"selectedreport\"\n type=\"radio\"\n value=\"DATA_LOSS\" \n data-aria-controls=\"DataLoss\"/>\n <label class=\"govuk-label govuk-radios__label govuk-label--m\" for=\"DataLoss\">Data loss</label>\n <span class=\"form-hint\">Missing transactions where data has been received from only either of Exela or Bulk scan</span>\n </div>\n\n <div class=\"govuk-radios__item\">\n <input \n id=\"UnprocessedTransactions\"\n class=\"govuk-radios__input\"\n formControlName=\"selectedreport\"\n (click)=\"validateDates('UNPROCESSED')\"\n name=\"selectedreport\"\n type=\"radio\"\n value=\"UNPROCESSED\" \n data-aria-controls=\"UnprocessedTransactions\"/>\n <label class=\"govuk-label govuk-radios__label govuk-label--m\" for=\"UnprocessedTransactions\">Unprocessed transactions</label>\n <span class=\"form-hint\">Transaction records that are still unprocessed by staff.</span>\n </div>\n\n <div class=\"govuk-radios__item\">\n <input \n id=\"ProcessedUnallocated\"\n class=\"govuk-radios__input\"\n formControlName=\"selectedreport\"\n name=\"selectedreport\"\n (click)=\"validateDates('PROCESSED_UNALLOCATED')\"\n type=\"radio\"\n value=\"PROCESSED_UNALLOCATED\" \n data-aria-controls=\"ProcessedUnallocated\"/>\n <label class=\"govuk-label govuk-radios__label govuk-label--m\" for=\"ProcessedUnallocated\">Processed unallocated</label>\n <span class=\"form-hint\">Payments that are marked as \u2018Unidentified\u2019 or \u2018Transferred\u2019 (Unsolicited requests)</span>\n </div>\n\n <div class=\"govuk-radios__item\">\n <input \n id=\"ShortfallsandSurplus\"\n class=\"govuk-radios__input\"\n formControlName=\"selectedreport\"\n name=\"selectedreport\"\n (click)=\"validateDates('SURPLUS_AND_SHORTFALL')\"\n type=\"radio\"\n value=\"SURPLUS_AND_SHORTFALL\" \n data-aria-controls=\"ShortfallsandSurplus\"/>\n <label class=\"govuk-label govuk-radios__label govuk-label--m\" for=\"ShortfallsandSurplus\">Under payment and Over payment</label>\n <span class=\"form-hint\">Requests where balances are marked as Under payment/Over payment further case management.\n E.g: Refund approval, Customer contact</span>\n </div>\n <div class=\"govuk-radios__item\">\n <input \n id=\"PaymentFailureEvent\"\n class=\"govuk-radios__input\"\n formControlName=\"selectedreport\"\n name=\"selectedreport\"\n (click)=\"validateDates('PAYMENT_FAILURE_EVENT')\"\n type=\"radio\"\n value=\"PAYMENT_FAILURE_EVENT\" \n data-aria-controls=\"PaymentFailureEvent\"/>\n <label class=\"govuk-label govuk-radios__label govuk-label--m\" for=\"PaymentFailureEvent\">Payment failure event</label>\n <span class=\"form-hint\">Failed payment transaction details</span>\n </div>\n </div>\n </div>\n <div class=\"govuk-form-group\">\n <div class=\"datefrom\">\n <label class=\"govuk-label govuk-radios__label govuk-label--m\" for=\"date-from\">Date from</label>\n <input (change)=\"getSelectedFromDate()\" [max]=\"getToday()\" class=\"form-control\" id=\"date-from\" name=\"date-from\" type=\"date\" formControlName=\"startDate\" required/>\n </div>\n\n <div class=\"dateto\">\n <label class=\"govuk-label govuk-radios__label govuk-label--m\" for=\"date-to\">Date to</label>\n <input (change)=\"getSelectedFromDate()\" [max]=\"getToday()\" class=\"form-control\" id=\"date-to\" name=\"search\" type=\"date\" formControlName=\"endDate\" required/>\n </div>\n </div>\n <p class=\"inline-error-message\" *ngIf=\"isStartDateLesthanEndDate || isDateRangeBetnWeek\">\n <span *ngIf=\"isStartDateLesthanEndDate\">Please select 'Date From' less than or equal to 'Date To'</span>\n <span *ngIf=\"isDateRangeBetnWeek\"> Please select the date range between 7 days</span>\n </p>\n <div class=\"btnsubmit\">\n <button type=\"submit\" (click)=\"downloadReport()\" class=\"button\" [disabled]=\"!reportsForm.valid || isDownLoadButtondisabled || isStartDateLesthanEndDate || isDateRangeBetnWeek\">Download report</button>\n </div>\n </form>\n \n",
|
|
8474
|
+
template: "<div class=\"header\">\n <input #myInput type='hidden' id='iFrameDrivenImageValue' value='REPORTS'>\n <ccpay-error-banner *ngIf=\"errorMessage.showError\" [errorMessage]=\"errorMessage\"></ccpay-error-banner>\n <legend class=\"govuk-fieldset__legend--xl\">\n <h1 class=\"govuk-fieldset__heading\"> Choose the report type and date range</h1>\n </legend>\n</div>\n<form [formGroup]=\"reportsForm\">\n <div class=\"govuk-form-group\">\n <div class=\"govuk-radios govuk-radios--conditional\" data-module=\"govuk-radios\">\n <div class=\"govuk-radios__item\">\n <input \n required\n id=\"DataLoss\"\n class=\"govuk-radios__input\"\n formControlName=\"selectedreport\"\n (click)=\"validateDates('DATA_LOSS')\"\n name=\"selectedreport\"\n type=\"radio\"\n value=\"DATA_LOSS\" \n data-aria-controls=\"DataLoss\"/>\n <label class=\"govuk-label govuk-radios__label govuk-label--m\" for=\"DataLoss\">Data loss</label>\n <span class=\"form-hint\">Missing transactions where data has been received from only either of Exela or Bulk scan</span>\n </div>\n\n <div class=\"govuk-radios__item\">\n <input \n id=\"UnprocessedTransactions\"\n class=\"govuk-radios__input\"\n formControlName=\"selectedreport\"\n (click)=\"validateDates('UNPROCESSED')\"\n name=\"selectedreport\"\n type=\"radio\"\n value=\"UNPROCESSED\" \n data-aria-controls=\"UnprocessedTransactions\"/>\n <label class=\"govuk-label govuk-radios__label govuk-label--m\" for=\"UnprocessedTransactions\">Unprocessed transactions</label>\n <span class=\"form-hint\">Transaction records that are still unprocessed by staff.</span>\n </div>\n\n <div class=\"govuk-radios__item\">\n <input \n id=\"ProcessedUnallocated\"\n class=\"govuk-radios__input\"\n formControlName=\"selectedreport\"\n name=\"selectedreport\"\n (click)=\"validateDates('PROCESSED_UNALLOCATED')\"\n type=\"radio\"\n value=\"PROCESSED_UNALLOCATED\" \n data-aria-controls=\"ProcessedUnallocated\"/>\n <label class=\"govuk-label govuk-radios__label govuk-label--m\" for=\"ProcessedUnallocated\">Processed unallocated</label>\n <span class=\"form-hint\">Payments that are marked as \u2018Unidentified\u2019 or \u2018Transferred\u2019 (Unsolicited requests)</span>\n </div>\n\n <div class=\"govuk-radios__item\">\n <input \n id=\"ShortfallsandSurplus\"\n class=\"govuk-radios__input\"\n formControlName=\"selectedreport\"\n name=\"selectedreport\"\n (click)=\"validateDates('SURPLUS_AND_SHORTFALL')\"\n type=\"radio\"\n value=\"SURPLUS_AND_SHORTFALL\" \n data-aria-controls=\"ShortfallsandSurplus\"/>\n <label class=\"govuk-label govuk-radios__label govuk-label--m\" for=\"ShortfallsandSurplus\">Under payment and Over payment</label>\n <span class=\"form-hint\">Requests where balances are marked as Under payment/Over payment further case management.\n E.g: Refund approval, Customer contact</span>\n </div>\n <div class=\"govuk-radios__item\">\n <input \n id=\"PaymentFailureEvent\"\n class=\"govuk-radios__input\"\n formControlName=\"selectedreport\"\n name=\"selectedreport\"\n (click)=\"validateDates('PAYMENT_FAILURE_EVENT')\"\n type=\"radio\"\n value=\"PAYMENT_FAILURE_EVENT\" \n data-aria-controls=\"PaymentFailureEvent\"/>\n <label class=\"govuk-label govuk-radios__label govuk-label--m\" for=\"PaymentFailureEvent\">Payment failure event</label>\n <span class=\"form-hint\">Failed payment transaction details</span>\n </div>\n </div>\n </div>\n <div class=\"govuk-form-group\">\n <div class=\"datefrom\">\n <label class=\"govuk-label govuk-radios__label govuk-label--m\" for=\"date-from\">Date from</label>\n <input (change)=\"getSelectedFromDate()\" [max]=\"getToday()\" class=\"form-control\" id=\"date-from\" name=\"date-from\" type=\"date\" formControlName=\"startDate\" required/>\n </div>\n\n <div class=\"dateto\">\n <label class=\"govuk-label govuk-radios__label govuk-label--m\" for=\"date-to\">Date to</label>\n <input (change)=\"getSelectedFromDate()\" [max]=\"getToday()\" class=\"form-control\" id=\"date-to\" name=\"search\" type=\"date\" formControlName=\"endDate\" required/>\n </div>\n </div>\n <p class=\"inline-error-message\" *ngIf=\"isStartDateLesthanEndDate || isDateRangeBetnWeek || isDateBetwnMonth\">\n <span *ngIf=\"isStartDateLesthanEndDate\">Please select 'Date From' less than or equal to 'Date To'</span>\n <span *ngIf=\"isDateRangeBetnWeek\"> Please select the date range between 7 days</span>\n <span *ngIf=\"isDateBetwnMonth\"> Please select the date range between 30 days</span>\n </p>\n <div class=\"btnsubmit\">\n <button type=\"submit\" (click)=\"downloadReport()\" class=\"button\" [disabled]=\"!reportsForm.valid || isDownLoadButtondisabled || isStartDateLesthanEndDate || isDateRangeBetnWeek\">Download report</button>\n </div>\n </form>\n \n",
|
|
8442
8475
|
styles: [".govuk-radios__input:focus+.govuk-radios__label::before{border-width:4px;box-shadow:0 0 0 4px #ffaf00}.datefrom{width:50%;float:left}.dateto{width:50%;float:right}.govuk-label--m{font-size:large}.form-hint{padding-left:.7em}.header{margin-top:10px;margin-bottom:15px}.btnsubmit{margin-bottom:30px}.inline-error-message{color:#a71414;font-weight:700;margin-top:10px}"]
|
|
8443
8476
|
}] }
|
|
8444
8477
|
];
|