buildingproduct-library 1.2.1 → 1.2.3

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.
@@ -1964,6 +1964,7 @@
1964
1964
  this.getCartId();
1965
1965
  cartLoaded = sessionStorage.getItem('isCartLoaded');
1966
1966
  if (!cartLoaded) {
1967
+ localStorage.removeItem('spartacus⚿dimond-spa⚿cart');
1967
1968
  sessionStorage.setItem('isCartLoaded', 'true');
1968
1969
  window.location.reload();
1969
1970
  }
@@ -7632,8 +7633,14 @@
7632
7633
  function OrderHistoryService(http) {
7633
7634
  this.http = http;
7634
7635
  }
7635
- OrderHistoryService.prototype.getOrderHistoryList = function (data, currentPage) {
7636
- var url = GET_ORDER_HISTORY_SEARCH_RESULTS.url;
7636
+ OrderHistoryService.prototype.getOrderHistoryList = function (data, currentPage, sortByValue) {
7637
+ var url;
7638
+ if (sortByValue != null || sortByValue != undefined) {
7639
+ url = GET_ORDER_HISTORY_SEARCH_RESULTS.url + '?sort=' + sortByValue;
7640
+ }
7641
+ else {
7642
+ url = GET_ORDER_HISTORY_SEARCH_RESULTS.url;
7643
+ }
7637
7644
  var params = new i1$1.HttpParams();
7638
7645
  params = params.set("currentPage", currentPage);
7639
7646
  return this.http.post(url, data, { params: params });
@@ -7667,7 +7674,7 @@
7667
7674
  return rxjs.throwError(errorRes);
7668
7675
  }));
7669
7676
  };
7670
- OrderHistoryService.prototype.sortOrderHistory = function (data, reqPayload) {
7677
+ OrderHistoryService.prototype.sortOrderHistory = function (data, reqPayload, currentPage) {
7671
7678
  var url = ORDER_HISTORY_SORTING_ENDPOINT.url + data;
7672
7679
  return this.http.post(url, reqPayload, {
7673
7680
  headers: { 'Content-Type': 'application/json' },
@@ -8154,10 +8161,24 @@
8154
8161
  };
8155
8162
  CustomOrderHistoryComponent.prototype.getOrderList = function () {
8156
8163
  var _this = this;
8157
- var reqObj = {
8158
- searchParams: this.selectedOrderState,
8159
- };
8160
- this.orderHistoryService.getOrderHistoryList(reqObj, this.currentPage)
8164
+ var reqObj;
8165
+ if (this.searchText != '' && (this.selectedOrderType == 'orderNumber' || this.selectedOrderType == 'poNumber')) {
8166
+ this.selectedFilters = [];
8167
+ var obj = {
8168
+ key: this.selectedOrderType,
8169
+ value: this.searchText,
8170
+ };
8171
+ this.selectedFilters.push(obj);
8172
+ reqObj = {
8173
+ searchParams: this.selectedFilters,
8174
+ };
8175
+ }
8176
+ else {
8177
+ reqObj = {
8178
+ searchParams: this.selectedOrderState,
8179
+ };
8180
+ }
8181
+ this.orderHistoryService.getOrderHistoryList(reqObj, this.currentPage, this.sortByValue)
8161
8182
  .subscribe(function (data) {
8162
8183
  var _a;
8163
8184
  // this.orderHistoryLists = this.orderHistoryLists.length == 0 ? data.orders : [...this.orderHistoryLists, data?.orders];
@@ -8355,12 +8376,27 @@
8355
8376
  };
8356
8377
  CustomOrderHistoryComponent.prototype.sortBy = function (e) {
8357
8378
  var _this = this;
8379
+ this.currentPage = 0;
8358
8380
  this.sortByValue = e.target.value;
8359
- var reqObj = {
8360
- searchParams: this.selectedFilters,
8361
- };
8381
+ this.selectedFilters = JSON.parse(JSON.stringify(this.selectedOrderState));
8382
+ var reqObj;
8383
+ if (this.searchText != '' && (this.selectedOrderType == 'orderNumber' || this.selectedOrderType == 'poNumber')) {
8384
+ var obj = {
8385
+ key: this.selectedOrderType,
8386
+ value: this.searchText,
8387
+ };
8388
+ this.selectedFilters.push(obj);
8389
+ reqObj = {
8390
+ searchParams: this.selectedFilters,
8391
+ };
8392
+ }
8393
+ else {
8394
+ reqObj = {
8395
+ searchParams: this.selectedFilters,
8396
+ };
8397
+ }
8362
8398
  this.orderHistoryService
8363
- .sortOrderHistory(this.sortByValue, reqObj)
8399
+ .sortOrderHistory(this.sortByValue, reqObj, this.currentPage)
8364
8400
  .subscribe(function (res) {
8365
8401
  var _a;
8366
8402
  _this.orderHistoryLists = res === null || res === void 0 ? void 0 : res.orders;
@@ -9402,7 +9438,7 @@
9402
9438
  var val = event.target.value;
9403
9439
  var orderDetail = (_a = this.orderDetails) === null || _a === void 0 ? void 0 : _a.entries;
9404
9440
  this.showWaitCursor.next(true);
9405
- if (event.currentTarget.checked) {
9441
+ if (event.target.checked) {
9406
9442
  this.filterVal.push(val.toLowerCase());
9407
9443
  orderDetail = this.totalRecord.filter(function (el) {
9408
9444
  return _this.filterVal.find(function (element) {
@@ -9412,9 +9448,8 @@
9412
9448
  this.cd.detectChanges();
9413
9449
  this.showWaitCursor.next(false);
9414
9450
  }
9415
- else {
9416
- var index = this.filterVal.indexOf(val);
9417
- this.filterVal.splice(index, 1);
9451
+ if (event.target.checked == false) {
9452
+ this.filterVal = this.filterVal.filter(function (x) { return x.toLowerCase() != val.toLowerCase(); });
9418
9453
  orderDetail = this.totalRecord.filter(function (el) {
9419
9454
  return _this.filterVal.find(function (element) {
9420
9455
  return element === el.statusDisplay.toLowerCase();
@@ -9423,6 +9458,7 @@
9423
9458
  if (this.filterVal.length == 0) {
9424
9459
  orderDetail = this.totalRecord;
9425
9460
  }
9461
+ this.cd.detectChanges();
9426
9462
  }
9427
9463
  this.showWaitCursor.next(false);
9428
9464
  this.cd.detectChanges();
@@ -12296,11 +12332,26 @@
12296
12332
  };
12297
12333
  InvoiceCreditComponent.prototype.sortBy = function (e) {
12298
12334
  var _this = this;
12335
+ var reqObj;
12336
+ this.selectedFilters = JSON.parse(JSON.stringify(this.selectedStatuses));
12299
12337
  this.showWaitCursor.next(true);
12300
12338
  this.sortByValue = e.target.value;
12301
- var reqObj = {
12302
- searchParams: this.selectedFilters,
12303
- };
12339
+ if (this.searchText != '') {
12340
+ this.selectedFilters = [];
12341
+ var obj = {
12342
+ key: this.selectedOrderType,
12343
+ value: this.searchText,
12344
+ };
12345
+ this.selectedFilters.push(obj);
12346
+ reqObj = {
12347
+ searchParams: this.selectedFilters,
12348
+ };
12349
+ }
12350
+ else {
12351
+ reqObj = {
12352
+ searchParams: this.selectedFilters,
12353
+ };
12354
+ }
12304
12355
  this.myAccountService.sortInvoiceCredit(this.sortByValue, reqObj).subscribe(function (res) {
12305
12356
  _this.invoiceCreditList = res === null || res === void 0 ? void 0 : res.documents;
12306
12357
  _this.getStatus();