tango-app-ui-shared 3.0.11 → 3.0.12-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.
@@ -8,11 +8,11 @@ import * as i2 from '@angular/common';
8
8
  import { CommonModule } from '@angular/common';
9
9
  import { filter } from 'rxjs/operators';
10
10
  import * as i3 from '@angular/platform-browser';
11
+ import { BehaviorSubject, Subject, throwError, map, catchError } from 'rxjs';
11
12
  import dayjs from 'dayjs';
12
13
  import 'dayjs/locale/en';
13
14
  import utc from 'dayjs/plugin/utc';
14
15
  import timezone from 'dayjs/plugin/timezone';
15
- import { BehaviorSubject, throwError, map, catchError } from 'rxjs';
16
16
  import * as i3$1 from '@angular/common/http';
17
17
  import * as i4 from '@angular/forms';
18
18
  import { FormsModule } from '@angular/forms';
@@ -1539,6 +1539,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImpor
1539
1539
  args: [{ selector: 'lib-scripts-init', template: "" }]
1540
1540
  }], ctorParameters: () => [{ type: i1.LayoutService }, { type: i1.PageInfoService }, { type: i1$1.Router }, { type: i3.Title }] });
1541
1541
 
1542
+ class GlobalStateService {
1543
+ userData = new BehaviorSubject(null);
1544
+ environment = new BehaviorSubject(null);
1545
+ dataRangeValue = new Subject();
1546
+ selectedClient = new BehaviorSubject(null);
1547
+ apply(options) {
1548
+ this.dataRangeValue.next(options);
1549
+ }
1550
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: GlobalStateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1551
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: GlobalStateService, providedIn: 'root' });
1552
+ }
1553
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: GlobalStateService, decorators: [{
1554
+ type: Injectable,
1555
+ args: [{
1556
+ providedIn: 'root'
1557
+ }]
1558
+ }] });
1559
+
1542
1560
  class PageTitleComponent {
1543
1561
  pageInfo;
1544
1562
  cd;
@@ -1584,21 +1602,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImpor
1584
1602
  type: Input
1585
1603
  }] } });
1586
1604
 
1587
- class GlobalStateService {
1588
- userData = new BehaviorSubject(null);
1589
- environment = new BehaviorSubject(null);
1590
- dataRangeValue = new BehaviorSubject(null);
1591
- selectedClient = new BehaviorSubject(null);
1592
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: GlobalStateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1593
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: GlobalStateService, providedIn: 'root' });
1594
- }
1595
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: GlobalStateService, decorators: [{
1596
- type: Injectable,
1597
- args: [{
1598
- providedIn: 'root'
1599
- }]
1600
- }] });
1601
-
1602
1605
  class AuthService {
1603
1606
  router;
1604
1607
  gs;
@@ -1711,7 +1714,7 @@ class ClassicComponent {
1711
1714
  this.selectedFilters.clients = currentIssues;
1712
1715
  this.selectedFilters.client = headerFilters.client;
1713
1716
  // }
1714
- this.globalService.dataRangeValue.next(this.selectedFilters);
1717
+ this.globalService.apply(this.selectedFilters);
1715
1718
  this.cd.detectChanges();
1716
1719
  }
1717
1720
  else {
@@ -1855,7 +1858,7 @@ class ClassicComponent {
1855
1858
  });
1856
1859
  }
1857
1860
  }
1858
- this.globalService.dataRangeValue.next(this.selectedFilters);
1861
+ this.globalService.apply(this.selectedFilters);
1859
1862
  this.cd.detectChanges();
1860
1863
  this.Opendropdown = false;
1861
1864
  this.selectedValuesArray.forEach((item, index) => {
@@ -2094,15 +2097,20 @@ class ClientSettingsComponent {
2094
2097
  }
2095
2098
  else {
2096
2099
  this.selectedClient = this.clientList[0];
2097
- this.gs.selectedClient.next(this.selectedClient);
2100
+ this.selectedFilters.client = this.selectedClient.clientId;
2101
+ this.gs.apply(this.selectedFilters);
2098
2102
  this.cd.detectChanges();
2099
2103
  }
2100
2104
  this.selectedFilters.client = headerFilters.client;
2101
- this.gs.dataRangeValue.next(this.selectedFilters);
2105
+ this.gs.apply(this.selectedFilters);
2106
+ this.cd.detectChanges();
2107
+ }
2108
+ else {
2109
+ this.selectedClient = this.clientList[0];
2110
+ this.selectedFilters.client = this.selectedClient.clientId;
2111
+ this.gs.apply(this.selectedFilters);
2102
2112
  this.cd.detectChanges();
2103
2113
  }
2104
- }
2105
- else {
2106
2114
  }
2107
2115
  },
2108
2116
  });
@@ -2210,7 +2218,7 @@ class DatepickerComponent {
2210
2218
  }
2211
2219
  const headerFilters = JSON.parse(localStorage.getItem("header-filters") || "{}");
2212
2220
  this.selectedFilters = headerFilters;
2213
- this.gs.dataRangeValue.next(this.selectedFilters);
2221
+ this.gs.apply(this.selectedFilters);
2214
2222
  this.selectedFilters.date = this.selectedDateRange;
2215
2223
  localStorage.setItem('header-filters', JSON.stringify(this.selectedFilters));
2216
2224
  this.cd.detectChanges();
@@ -2254,16 +2262,15 @@ class DateSingleSelectComponent {
2254
2262
  this.clientList.find((obj) => {
2255
2263
  if (obj.clientId === headerFilters.client) {
2256
2264
  this.selectedClient = obj;
2257
- this.gs.dataRangeValue.next(this.selectedFilters);
2265
+ this.gs.apply(this.selectedFilters);
2258
2266
  this.cd.detectChanges();
2259
2267
  }
2260
2268
  });
2261
2269
  }
2262
2270
  else {
2263
2271
  this.selectedClient = this.clientList[0];
2264
- console.log(this.selectedClient);
2265
2272
  this.selectedFilters.client = this.selectedClient.clientId;
2266
- this.gs.dataRangeValue.next(this.selectedFilters);
2273
+ this.gs.apply(this.selectedFilters);
2267
2274
  this.cd.detectChanges();
2268
2275
  }
2269
2276
  }
@@ -2281,7 +2288,7 @@ class DateSingleSelectComponent {
2281
2288
  }
2282
2289
  });
2283
2290
  }
2284
- this.gs.dataRangeValue.next(this.selectedFilters);
2291
+ this.gs.apply(this.selectedFilters);
2285
2292
  this.selectedFilters.client = headerFilters.client;
2286
2293
  this.selectedFilters.clients = [headerFilters.clients];
2287
2294
  this.selectedFilters.date = headerFilters.date;
@@ -2295,7 +2302,7 @@ class DateSingleSelectComponent {
2295
2302
  }
2296
2303
  onClientSelect(event) {
2297
2304
  this.selectedClient = event;
2298
- this.gs.selectedClient.next(this.selectedClient);
2305
+ this.gs.apply(this.selectedClient);
2299
2306
  this.cd.detectChanges();
2300
2307
  }
2301
2308
  ranges = {
@@ -2350,7 +2357,7 @@ class DateSingleSelectComponent {
2350
2357
  this.selectedFilters = headerFilters;
2351
2358
  this.selectedFilters.client = this.selectedClient.clientId;
2352
2359
  this.selectedFilters.date = this.selectedDateRange;
2353
- this.gs.dataRangeValue.next(this.selectedFilters);
2360
+ this.gs.apply(this.selectedFilters);
2354
2361
  localStorage.setItem('header-filters', JSON.stringify(this.selectedFilters));
2355
2362
  }
2356
2363
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: DateSingleSelectComponent, deps: [{ token: AuthService }, { token: GlobalStateService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
@@ -2391,7 +2398,7 @@ class SingleStoreComponent {
2391
2398
  this.storeList.find((obj) => {
2392
2399
  if (obj.storeId === headerFilters.store) {
2393
2400
  this.selectedClient = obj;
2394
- this.gs.dataRangeValue.next(this.selectedFilters);
2401
+ this.gs.apply(this.selectedFilters);
2395
2402
  this.cd.detectChanges();
2396
2403
  }
2397
2404
  });
@@ -2399,8 +2406,8 @@ class SingleStoreComponent {
2399
2406
  else {
2400
2407
  this.selectedClient = this.storeList[0];
2401
2408
  this.selectedFilters.store = this.selectedClient.storeId;
2402
- console.log(this.selectedFilters);
2403
- this.gs.dataRangeValue.next(this.selectedFilters);
2409
+ // console.log(this.selectedFilters)
2410
+ this.gs.apply(this.selectedFilters);
2404
2411
  this.cd.detectChanges();
2405
2412
  }
2406
2413
  }
@@ -2418,7 +2425,7 @@ class SingleStoreComponent {
2418
2425
  }
2419
2426
  });
2420
2427
  }
2421
- this.gs.dataRangeValue.next(this.selectedFilters);
2428
+ this.gs.apply(this.selectedFilters);
2422
2429
  this.selectedFilters.store = headerFilters.store;
2423
2430
  this.selectedFilters.client = headerFilters.client;
2424
2431
  this.selectedFilters.clients = [headerFilters.clients];
@@ -2434,7 +2441,7 @@ class SingleStoreComponent {
2434
2441
  }
2435
2442
  onClientSelect(event) {
2436
2443
  this.selectedClient = event;
2437
- this.gs.selectedClient.next(this.selectedClient);
2444
+ this.gs.apply(this.selectedClient);
2438
2445
  }
2439
2446
  ranges = {
2440
2447
  'Today': [this.dayjs(), this.dayjs()],
@@ -2487,7 +2494,7 @@ class SingleStoreComponent {
2487
2494
  this.selectedFilters = headerFilters;
2488
2495
  this.selectedFilters.store = this.selectedClient.storeId;
2489
2496
  this.selectedFilters.date = this.selectedDateRange;
2490
- this.gs.dataRangeValue.next(this.selectedFilters);
2497
+ this.gs.apply(this.selectedFilters);
2491
2498
  localStorage.setItem('header-filters', JSON.stringify(this.selectedFilters));
2492
2499
  this.cd.detectChanges();
2493
2500
  }
@@ -2503,6 +2510,7 @@ class ToolbarComponent {
2503
2510
  layout;
2504
2511
  router;
2505
2512
  route;
2513
+ gs;
2506
2514
  unsubscribe = [];
2507
2515
  // Public props
2508
2516
  currentLayoutType;
@@ -2525,12 +2533,17 @@ class ToolbarComponent {
2525
2533
  datepicker;
2526
2534
  singleSelectdatepicker;
2527
2535
  singleStore;
2528
- constructor(layout, router, route) {
2536
+ headervalue;
2537
+ storeId;
2538
+ constructor(layout, router, route, gs) {
2529
2539
  this.layout = layout;
2530
2540
  this.router = router;
2531
2541
  this.route = route;
2542
+ this.gs = gs;
2532
2543
  }
2533
2544
  ngOnInit() {
2545
+ // let data:any = JSON.parse(localStorage.getItem('header-filters') || '');
2546
+ // this.storeId = data.store;
2534
2547
  this.route.queryParams.subscribe((queryParams) => {
2535
2548
  this.querParams = queryParams;
2536
2549
  });
@@ -2576,6 +2589,10 @@ class ToolbarComponent {
2576
2589
  this.unsubscribe.forEach((sb) => sb.unsubscribe());
2577
2590
  }
2578
2591
  showPageTitle() {
2592
+ if ("header-filters" in localStorage) {
2593
+ const data = JSON.parse(localStorage.getItem("header-filters") || "{}");
2594
+ this.storeId = data.store;
2595
+ }
2579
2596
  let url = this.router.url.split("/");
2580
2597
  if (url[2] == 'settings') {
2581
2598
  console.log(this.router.url);
@@ -2599,20 +2616,27 @@ class ToolbarComponent {
2599
2616
  this.singleStore = false;
2600
2617
  this.singleSelectdatepicker = false;
2601
2618
  }
2602
- else if (this.router.url == "/manage/stores") {
2619
+ else if (this.router.url == "/manage/stores" || this.router.url == "/manage/stores/addition-method" || this.router.url == "/manage/stores/add-single-store" || this.router.url == "manage/stores/edge-app") {
2603
2620
  this.singleSelect = false;
2604
2621
  this.multiSelect = false;
2605
2622
  this.datepicker = false;
2606
2623
  this.singleStore = false;
2607
2624
  this.singleSelectdatepicker = true;
2608
2625
  }
2609
- else if (this.router.url == "/manage/stores/LKST123/infra-ticket") {
2626
+ else if (this.router.url == `/manage/stores/${this.storeId}/infra-ticket` || this.router.url == `/manage/stores/${this.storeId}/settings`) {
2610
2627
  this.singleSelect = false;
2611
2628
  this.multiSelect = false;
2612
2629
  this.datepicker = false;
2613
2630
  this.singleSelectdatepicker = false;
2614
2631
  this.singleStore = true;
2615
2632
  }
2633
+ else if (this.router.url == "/profile") {
2634
+ this.singleSelect = false;
2635
+ this.multiSelect = false;
2636
+ this.datepicker = false;
2637
+ this.singleStore = false;
2638
+ this.singleSelectdatepicker = false;
2639
+ }
2616
2640
  else {
2617
2641
  this.singleSelect = false;
2618
2642
  this.multiSelect = true;
@@ -2624,13 +2648,13 @@ class ToolbarComponent {
2624
2648
  return (this.appPageTitleDisplay &&
2625
2649
  viewsWithPageTitles.some((t) => t === this.appToolbarLayout));
2626
2650
  }
2627
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: ToolbarComponent, deps: [{ token: i1.LayoutService }, { token: i1$1.Router }, { token: i1$1.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Component });
2651
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: ToolbarComponent, deps: [{ token: i1.LayoutService }, { token: i1$1.Router }, { token: i1$1.ActivatedRoute }, { token: GlobalStateService }], target: i0.ɵɵFactoryTarget.Component });
2628
2652
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.8", type: ToolbarComponent, selector: "lib-toolbar", inputs: { currentLayoutType: "currentLayoutType", appToolbarLayout: "appToolbarLayout" }, ngImport: i0, template: "<!--begin::Toolbar container-->\r\n<div id=\"kt_app_toolbar_container\" class=\"app-container\" [ngClass]=\"appToolbarContainerCSSClass\">\r\n <ng-container *ngIf=\"showPageTitle()\">\r\n <lib-page-title [appPageTitleDirection]=\"appPageTitleDirection\" [appPageTitleBreadcrumb]=\"appPageTitleBreadcrumb\"\r\n [appPageTitleDescription]=\"appPageTitleDescription\" class=\"page-title d-flex flex-wrap me-3\"\r\n [ngClass]=\"{'flex-column justify-content-center': appPageTitleDirection === 'column', 'align-items-center': appPageTitleDirection !== 'column', appPageTitleCSSClass}\">\r\n </lib-page-title>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"multiSelect\">\r\n <lib-classic class=\"d-flex align-items-center gap-2 gap-lg-3\"></lib-classic>\r\n </ng-container>\r\n <ng-container *ngIf=\"singleSelect\">\r\n <lib-client-settings class=\"d-flex align-items-center me-5\"></lib-client-settings>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"datepicker\">\r\n <lib-datepicker class=\"d-flex align-items-center me-5\"></lib-datepicker>\r\n </ng-container>\r\n <ng-container *ngIf=\"singleSelectdatepicker\">\r\n <lib-date-single-select class=\"d-flex align-items-center me-5\"></lib-date-single-select>\r\n </ng-container>\r\n <ng-container *ngIf=\"singleStore\">\r\n <lib-single-store class=\"d-flex align-items-center me-5\"></lib-single-store>\r\n </ng-container>\r\n <!-- <ng-container *ngIf=\"appToolbarLayout === 'extended'\">\r\n <lib-extended class=\"d-flex align-items-center flex-shrink-0 me-5\"></lib-extended>\r\n </ng-container>\r\n <ng-container *ngIf=\"appToolbarLayout === 'reports'\">\r\n <lib-reports class=\"d-flex align-items-center overflow-auto\" [appPageTitleDisplay]=\"appPageTitleDisplay\">\r\n </lib-reports>\r\n </ng-container>\r\n <ng-container *ngIf=\"appToolbarLayout === 'saas'\">\r\n <lib-saas class=\"d-flex align-items-center gap-2\" [appPageTitleDisplay]=\"appPageTitleDisplay\"></lib-saas>\r\n </ng-container> -->\r\n</div>\r\n<!--end::Toolbar container-->\r\n", styles: [""], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: PageTitleComponent, selector: "lib-page-title", inputs: ["appPageTitleDirection", "appPageTitleBreadcrumb", "appPageTitleDescription"] }, { kind: "component", type: ClassicComponent, selector: "lib-classic" }, { kind: "component", type: ClientSettingsComponent, selector: "lib-client-settings" }, { kind: "component", type: DatepickerComponent, selector: "lib-datepicker" }, { kind: "component", type: DateSingleSelectComponent, selector: "lib-date-single-select" }, { kind: "component", type: SingleStoreComponent, selector: "lib-single-store" }] });
2629
2653
  }
2630
2654
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: ToolbarComponent, decorators: [{
2631
2655
  type: Component,
2632
2656
  args: [{ selector: "lib-toolbar", template: "<!--begin::Toolbar container-->\r\n<div id=\"kt_app_toolbar_container\" class=\"app-container\" [ngClass]=\"appToolbarContainerCSSClass\">\r\n <ng-container *ngIf=\"showPageTitle()\">\r\n <lib-page-title [appPageTitleDirection]=\"appPageTitleDirection\" [appPageTitleBreadcrumb]=\"appPageTitleBreadcrumb\"\r\n [appPageTitleDescription]=\"appPageTitleDescription\" class=\"page-title d-flex flex-wrap me-3\"\r\n [ngClass]=\"{'flex-column justify-content-center': appPageTitleDirection === 'column', 'align-items-center': appPageTitleDirection !== 'column', appPageTitleCSSClass}\">\r\n </lib-page-title>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"multiSelect\">\r\n <lib-classic class=\"d-flex align-items-center gap-2 gap-lg-3\"></lib-classic>\r\n </ng-container>\r\n <ng-container *ngIf=\"singleSelect\">\r\n <lib-client-settings class=\"d-flex align-items-center me-5\"></lib-client-settings>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"datepicker\">\r\n <lib-datepicker class=\"d-flex align-items-center me-5\"></lib-datepicker>\r\n </ng-container>\r\n <ng-container *ngIf=\"singleSelectdatepicker\">\r\n <lib-date-single-select class=\"d-flex align-items-center me-5\"></lib-date-single-select>\r\n </ng-container>\r\n <ng-container *ngIf=\"singleStore\">\r\n <lib-single-store class=\"d-flex align-items-center me-5\"></lib-single-store>\r\n </ng-container>\r\n <!-- <ng-container *ngIf=\"appToolbarLayout === 'extended'\">\r\n <lib-extended class=\"d-flex align-items-center flex-shrink-0 me-5\"></lib-extended>\r\n </ng-container>\r\n <ng-container *ngIf=\"appToolbarLayout === 'reports'\">\r\n <lib-reports class=\"d-flex align-items-center overflow-auto\" [appPageTitleDisplay]=\"appPageTitleDisplay\">\r\n </lib-reports>\r\n </ng-container>\r\n <ng-container *ngIf=\"appToolbarLayout === 'saas'\">\r\n <lib-saas class=\"d-flex align-items-center gap-2\" [appPageTitleDisplay]=\"appPageTitleDisplay\"></lib-saas>\r\n </ng-container> -->\r\n</div>\r\n<!--end::Toolbar container-->\r\n" }]
2633
- }], ctorParameters: () => [{ type: i1.LayoutService }, { type: i1$1.Router }, { type: i1$1.ActivatedRoute }], propDecorators: { currentLayoutType: [{
2657
+ }], ctorParameters: () => [{ type: i1.LayoutService }, { type: i1$1.Router }, { type: i1$1.ActivatedRoute }, { type: GlobalStateService }], propDecorators: { currentLayoutType: [{
2634
2658
  type: Input
2635
2659
  }], appToolbarLayout: [{
2636
2660
  type: Input
@@ -4292,6 +4316,10 @@ const Routing = [
4292
4316
  path: 'manage',
4293
4317
  loadChildren: () => import('./tango-app-ui-shared-manage-wrapper.module-B6GJQNQZ.mjs').then((m) => m.ManageWrapperModule),
4294
4318
  },
4319
+ {
4320
+ path: 'manage/stores/edge-app',
4321
+ loadChildren: () => import('./tango-app-ui-shared-edge-wrapper.module-DM8Er_Bd.mjs').then((m) => m.TangoEdgeAppWrapperModule),
4322
+ },
4295
4323
  {
4296
4324
  path: 'manage/stores/:id',
4297
4325
  loadChildren: () => import('./tango-app-ui-shared-store-wrapper.module-UYYC9an_.mjs').then((m) => m.StoreWrapperModule),