tango-app-ui-shared 3.0.19-dev → 3.0.20-dev

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.
@@ -1695,18 +1695,34 @@ class ClassicComponent {
1695
1695
  this.getClientList = res?.data?.result;
1696
1696
  if ("header-filters" in localStorage) {
1697
1697
  const headerFilters = JSON.parse(localStorage.getItem("header-filters") || "{}");
1698
- this.selectedFilters.date = headerFilters.date;
1699
- this.selectedDateRange.startDate = headerFilters.date.startDate;
1700
- this.selectedDateRange.endDate = headerFilters.date.endDate;
1701
- this.dataObject[0].Issues = this.getClientList;
1702
- this.toggleCheckbox("Select All", 0);
1703
- this.dummyArray = JSON.parse(JSON.stringify(this.dataObject));
1704
- this.responseArray = JSON.parse(JSON.stringify(this.dataObject));
1705
- const currentIssues = this.dummyArray[0].Issues.map((item) => item.clientId);
1706
- this.selectedFilters.clients = currentIssues;
1707
- this.selectedFilters.client = headerFilters.client;
1708
- this.globalService.dataRangeValue.next(this.selectedFilters);
1709
- this.cd.detectChanges();
1698
+ if (headerFilters.clients.length > 0 && headerFilters.date?.startDate) {
1699
+ this.dataObject[0].Issues = this.getClientList;
1700
+ this.toggleCheckbox("Select All", 0);
1701
+ this.dummyArray = JSON.parse(JSON.stringify(this.dataObject));
1702
+ this.responseArray = JSON.parse(JSON.stringify(this.dataObject));
1703
+ const currentIssues = this.dummyArray[0].Issues.map((item) => item.clientId);
1704
+ this.selectedFilters.clients = currentIssues;
1705
+ this.selectedFilters.client = headerFilters.client;
1706
+ this.selectedFilters.date = headerFilters.date;
1707
+ this.selectedDateRange.startDate = headerFilters.date.startDate;
1708
+ this.selectedDateRange.endDate = headerFilters.date.endDate;
1709
+ this.globalService.dataRangeValue.next(this.selectedFilters);
1710
+ // this.cd.detectChanges();
1711
+ }
1712
+ else {
1713
+ this.dataObject[0].Issues = this.getClientList;
1714
+ this.toggleCheckbox("Select All", 0);
1715
+ this.dummyArray = JSON.parse(JSON.stringify(this.dataObject));
1716
+ this.responseArray = JSON.parse(JSON.stringify(this.dataObject));
1717
+ this.selectedDateRange.startDate = this.dayjs().format("YYYY-MM-DD");
1718
+ this.selectedDateRange.endDate = this.dayjs().format("YYYY-MM-DD");
1719
+ const currentIssues = this.dummyArray[0].Issues.map((item) => item.clientId);
1720
+ this.selectedFilters.clients = currentIssues;
1721
+ this.selectedFilters.date = this.selectedDateRange;
1722
+ localStorage.setItem("header-filters", JSON.stringify(this.selectedFilters));
1723
+ this.globalService.dataRangeValue.next(this.selectedFilters);
1724
+ console.log(this.selectedFilters);
1725
+ }
1710
1726
  }
1711
1727
  else {
1712
1728
  this.dataObject[0].Issues = this.getClientList;
@@ -1719,6 +1735,8 @@ class ClassicComponent {
1719
1735
  this.selectedFilters.clients = currentIssues;
1720
1736
  this.selectedFilters.date = this.selectedDateRange;
1721
1737
  localStorage.setItem("header-filters", JSON.stringify(this.selectedFilters));
1738
+ this.globalService.dataRangeValue.next(this.selectedFilters);
1739
+ console.log(this.selectedFilters);
1722
1740
  this.cd.detectChanges();
1723
1741
  }
1724
1742
  },
@@ -1843,7 +1861,6 @@ class ClassicComponent {
1843
1861
  });
1844
1862
  }
1845
1863
  }
1846
- this.globalService.dataRangeValue.next(this.selectedFilters);
1847
1864
  this.Opendropdown = false;
1848
1865
  this.selectedValuesArray.forEach((item, index) => {
1849
1866
  item = item.map((ele) => ele.clientId);
@@ -1857,6 +1874,8 @@ class ClassicComponent {
1857
1874
  this.selectedFilters.clients = this.responseArray[0].Issues;
1858
1875
  this.selectedFilters.date = this.selectedDateRange;
1859
1876
  localStorage.setItem("header-filters", JSON.stringify(this.selectedFilters));
1877
+ this.globalService.dataRangeValue.next(this.selectedFilters);
1878
+ this.cd.detectChanges();
1860
1879
  }
1861
1880
  ranges = {
1862
1881
  "Today": [this.dayjs(), this.dayjs()],
@@ -2072,29 +2091,20 @@ class ClientSettingsComponent {
2072
2091
  next: (e) => {
2073
2092
  if (e) {
2074
2093
  this.clientList = e.data.result;
2075
- if ("header-filters" in localStorage) {
2076
- const headerFilters = JSON.parse(localStorage.getItem("header-filters") || "{}");
2077
- this.cd.detectChanges();
2078
- if (headerFilters.client) {
2079
- this.clientList.find((obj) => {
2080
- if (obj.clientId === headerFilters.client) {
2081
- this.selectedClient = obj;
2082
- }
2083
- });
2084
- }
2085
- else {
2086
- this.selectedClient = this.clientList[0];
2087
- this.selectedFilters.client = this.selectedClient.clientId;
2088
- this.gs.selectedClient.next(this.selectedFilters);
2089
- this.cd.detectChanges();
2090
- }
2091
- this.selectedFilters.client = headerFilters.client;
2092
- this.gs.dataRangeValue.next(this.selectedFilters);
2093
- this.cd.detectChanges();
2094
+ // if ("header-filters" in localStorage) {
2095
+ const headerFilters = JSON.parse(localStorage.getItem("header-filters") || "{}");
2096
+ this.cd.detectChanges();
2097
+ if (headerFilters.client) {
2098
+ this.clientList.find((obj) => {
2099
+ if (obj.clientId === headerFilters.client) {
2100
+ this.selectedClient = obj;
2101
+ }
2102
+ });
2094
2103
  }
2095
2104
  else {
2096
2105
  this.selectedClient = this.clientList[0];
2097
- this.selectedFilters.client = this.selectedClient.clientId;
2106
+ this.selectedFilters.client = headerFilters.client;
2107
+ localStorage.setItem("header-filters", JSON.stringify(this.selectedFilters));
2098
2108
  this.gs.dataRangeValue.next(this.selectedFilters);
2099
2109
  this.cd.detectChanges();
2100
2110
  }
@@ -2104,7 +2114,6 @@ class ClientSettingsComponent {
2104
2114
  }
2105
2115
  onClientSelect(event) {
2106
2116
  this.selectedClient = event;
2107
- this.gs.selectedClient.next(this.selectedClient);
2108
2117
  const headerFilters = JSON.parse(localStorage.getItem("header-filters") || "{}");
2109
2118
  this.selectedFilters = headerFilters;
2110
2119
  this.selectedFilters.client = this.selectedClient.clientId;
@@ -2232,6 +2241,7 @@ class DateSingleSelectComponent {
2232
2241
  this.auth.getClients().subscribe({
2233
2242
  next: (e) => {
2234
2243
  if (e) {
2244
+ // debugger
2235
2245
  this.clientList = e.data.result;
2236
2246
  const headerFilters = JSON.parse(localStorage.getItem("header-filters") || "{}");
2237
2247
  this.cd.detectChanges();
@@ -2244,8 +2254,8 @@ class DateSingleSelectComponent {
2244
2254
  this.selectedFilters.client = headerFilters.client;
2245
2255
  this.selectedFilters.clients = [headerFilters.clients];
2246
2256
  this.selectedFilters.date = headerFilters.date;
2247
- this.selectedDateRange.startDate = headerFilters.date.startDate;
2248
- this.selectedDateRange.endDate = headerFilters.date.endDate;
2257
+ this.selectedDateRange.startDate = this.selectedFilters.date.startDate;
2258
+ this.selectedDateRange.endDate = this.selectedFilters.date.endDate;
2249
2259
  this.gs.dataRangeValue.next(this.selectedFilters);
2250
2260
  this.cd.detectChanges();
2251
2261
  }
@@ -2265,7 +2275,6 @@ class DateSingleSelectComponent {
2265
2275
  ngOnInit() { }
2266
2276
  onClientSelect(event) {
2267
2277
  this.selectedClient = event;
2268
- this.gs.selectedClient.next(this.selectedClient);
2269
2278
  }
2270
2279
  ranges = {
2271
2280
  Today: [this.dayjs(), this.dayjs()],
@@ -2366,11 +2375,8 @@ class SingleStoreComponent {
2366
2375
  this.storeList.find((obj) => {
2367
2376
  if (obj.storeId === headerFilters.store) {
2368
2377
  this.selectedClient = obj;
2369
- console.log("1111111111111");
2370
- // this.gs.dataRangeValue.next(this.selectedFilters);
2371
2378
  }
2372
2379
  });
2373
- // console.log("222222222222222");
2374
2380
  this.selectedFilters.store = headerFilters.store;
2375
2381
  this.selectedFilters.client = headerFilters.client;
2376
2382
  this.selectedFilters.clients = [headerFilters.clients];
@@ -2386,7 +2392,6 @@ class SingleStoreComponent {
2386
2392
  this.selectedDateRange.startDate = this.dayjs().format('YYYY-MM-DD');
2387
2393
  this.selectedDateRange.endDate = this.dayjs().format('YYYY-MM-DD');
2388
2394
  this.selectedFilters.date = this.selectedDateRange;
2389
- console.log("33333333333333");
2390
2395
  this.gs.dataRangeValue.next(this.selectedFilters);
2391
2396
  this.cd.detectChanges();
2392
2397
  }
@@ -2397,7 +2402,6 @@ class SingleStoreComponent {
2397
2402
  }
2398
2403
  onClientSelect(event) {
2399
2404
  this.selectedClient = event;
2400
- // this.gs.selectedClient.next(this.selectedClient)
2401
2405
  }
2402
2406
  ranges = {
2403
2407
  'Today': [this.dayjs(), this.dayjs()],
@@ -2438,7 +2442,6 @@ class SingleStoreComponent {
2438
2442
  this.selectedFilters = headerFilters;
2439
2443
  this.selectedFilters.store = this.selectedClient.storeId;
2440
2444
  this.selectedFilters.date = this.selectedDateRange;
2441
- console.log("4444444444444444");
2442
2445
  this.gs.dataRangeValue.next(this.selectedFilters);
2443
2446
  localStorage.setItem('header-filters', JSON.stringify(this.selectedFilters));
2444
2447
  }