tango-app-ui-shared 3.3.1-beta.74 → 3.3.1-beta.76
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/esm2022/lib/modules/layout/layout.module.mjs +6 -3
- package/esm2022/lib/modules/layout/toolbar/toolbar.component.mjs +36 -27
- package/esm2022/lib/modules/layout/toolbar/traffic-header/traffic-header/traffic-header.component.mjs +3 -1
- package/esm2022/lib/modules/layout/toolbar/traffic-nob/traffic-nob.component.mjs +784 -0
- package/esm2022/lib/modules/layout/toolbar/trax-header/trax-header.component.mjs +2 -1
- package/esm2022/lib/modules/layout/toolbar/trax-withoutdate/trax-withoutdate.component.mjs +2 -1
- package/fesm2022/tango-app-ui-shared.mjs +967 -179
- package/fesm2022/tango-app-ui-shared.mjs.map +1 -1
- package/lib/modules/layout/layout.module.d.ts +11 -10
- package/lib/modules/layout/toolbar/toolbar.component.d.ts +2 -1
- package/lib/modules/layout/toolbar/traffic-nob/traffic-nob.component.d.ts +80 -0
- package/package.json +1 -1
|
@@ -3896,12 +3896,14 @@ class TrafficHeaderComponent {
|
|
|
3896
3896
|
this.Opendropdown = false;
|
|
3897
3897
|
// Fetch existing filters from localStorage
|
|
3898
3898
|
const headerFilters = JSON.parse(localStorage.getItem("header-filters") || "{}");
|
|
3899
|
+
this.selectedFilters.store = null;
|
|
3899
3900
|
// Ensure current selections are reflected
|
|
3900
3901
|
this.selectedFilters.location = this.locations;
|
|
3901
3902
|
this.selectedFilters.group = this.groupsData;
|
|
3902
3903
|
this.selectedFilters.stores = headerFilters.stores ? headerFilters.stores : this.stores;
|
|
3903
3904
|
// Store updated filters back in localStorage
|
|
3904
3905
|
localStorage.setItem("header-filters", JSON.stringify(this.selectedFilters));
|
|
3906
|
+
// this.gs.dataRangeValue.next(this.selectedFilters);
|
|
3905
3907
|
window.location.reload();
|
|
3906
3908
|
// Emit the updated filters via the service
|
|
3907
3909
|
// this.gs.dataRangeValue.next(this.selectedFilters);
|
|
@@ -4697,6 +4699,7 @@ class TraxHeaderComponent {
|
|
|
4697
4699
|
this.Opendropdown = false;
|
|
4698
4700
|
// Fetch existing filters from localStorage
|
|
4699
4701
|
const headerFilters = JSON.parse(localStorage.getItem("header-filters") || "{}");
|
|
4702
|
+
this.selectedFilters.store = null;
|
|
4700
4703
|
// Ensure current selections are reflected
|
|
4701
4704
|
this.selectedFilters.location = this.locations;
|
|
4702
4705
|
this.selectedFilters.group = this.groupsData;
|
|
@@ -5525,6 +5528,7 @@ class TraxWithoutdateComponent {
|
|
|
5525
5528
|
this.Opendropdown = false;
|
|
5526
5529
|
// Fetch existing filters from localStorage
|
|
5527
5530
|
const headerFilters = JSON.parse(localStorage.getItem("header-filters") || "{}");
|
|
5531
|
+
this.selectedFilters.store = null;
|
|
5528
5532
|
// Ensure current selections are reflected
|
|
5529
5533
|
this.selectedFilters.location = this.locations;
|
|
5530
5534
|
this.selectedFilters.group = this.groupsData;
|
|
@@ -5625,225 +5629,1006 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
|
|
|
5625
5629
|
args: ["document:click", ["$event"]]
|
|
5626
5630
|
}] } });
|
|
5627
5631
|
|
|
5628
|
-
class
|
|
5629
|
-
|
|
5632
|
+
class TrafficNobComponent {
|
|
5633
|
+
auth;
|
|
5630
5634
|
router;
|
|
5631
|
-
route;
|
|
5632
5635
|
gs;
|
|
5633
|
-
|
|
5634
|
-
|
|
5635
|
-
|
|
5636
|
-
|
|
5637
|
-
|
|
5638
|
-
|
|
5639
|
-
|
|
5640
|
-
|
|
5641
|
-
appToolbarFixedDesktop;
|
|
5642
|
-
appToolbarFixedMobile;
|
|
5643
|
-
appPageTitleDisplay;
|
|
5644
|
-
// page title
|
|
5645
|
-
appPageTitleDirection = "";
|
|
5646
|
-
appPageTitleCSSClass = "";
|
|
5647
|
-
appPageTitleBreadcrumb;
|
|
5648
|
-
appPageTitleDescription;
|
|
5649
|
-
querParams;
|
|
5650
|
-
singleSelect;
|
|
5651
|
-
multiSelect;
|
|
5652
|
-
datepicker;
|
|
5653
|
-
singleSelectdatepicker;
|
|
5654
|
-
singleStore;
|
|
5655
|
-
headervalue;
|
|
5656
|
-
storeId;
|
|
5657
|
-
users;
|
|
5636
|
+
cd;
|
|
5637
|
+
dayjs = dayjs;
|
|
5638
|
+
isCustomDate = (m) => {
|
|
5639
|
+
const isValidDate = m > this.dayjs();
|
|
5640
|
+
return isValidDate ? "invalid-date" : false;
|
|
5641
|
+
};
|
|
5642
|
+
selectedDateRange = { startDate: dayjs().subtract(30, 'days'),
|
|
5643
|
+
endDate: dayjs().subtract(1, "days"), };
|
|
5658
5644
|
selectedFilters = {
|
|
5659
5645
|
client: null,
|
|
5646
|
+
clientName: null,
|
|
5660
5647
|
clients: [],
|
|
5661
5648
|
store: null,
|
|
5662
5649
|
stores: [],
|
|
5663
5650
|
date: null,
|
|
5651
|
+
group: [],
|
|
5652
|
+
location: [],
|
|
5664
5653
|
};
|
|
5665
|
-
|
|
5666
|
-
|
|
5667
|
-
|
|
5668
|
-
|
|
5669
|
-
|
|
5670
|
-
|
|
5671
|
-
|
|
5654
|
+
Opendropdown = false;
|
|
5655
|
+
dropdownOpen = null; // 'location' or 'group'
|
|
5656
|
+
searchLocationText = "";
|
|
5657
|
+
searchGroupText = "";
|
|
5658
|
+
locations = [];
|
|
5659
|
+
filteredLocations = [];
|
|
5660
|
+
groupsData = [];
|
|
5661
|
+
filteredGroups = [];
|
|
5662
|
+
filteredStores = [];
|
|
5663
|
+
stores = [];
|
|
5664
|
+
searchStoreText = '';
|
|
5665
|
+
clientList = [];
|
|
5666
|
+
selectedClient;
|
|
5667
|
+
locationLabel = [];
|
|
5668
|
+
groupLabel = [];
|
|
5669
|
+
users;
|
|
5670
|
+
url;
|
|
5671
|
+
constructor(auth, router, gs, cd) {
|
|
5672
|
+
this.auth = auth;
|
|
5672
5673
|
this.router = router;
|
|
5673
|
-
this.route = route;
|
|
5674
5674
|
this.gs = gs;
|
|
5675
|
+
this.cd = cd;
|
|
5675
5676
|
}
|
|
5676
|
-
|
|
5677
|
-
|
|
5678
|
-
|
|
5679
|
-
this.
|
|
5680
|
-
}
|
|
5681
|
-
this.showPageTitle();
|
|
5682
|
-
const subscr = this.layout.layoutConfigSubject
|
|
5683
|
-
.asObservable()
|
|
5684
|
-
.subscribe((config) => {
|
|
5685
|
-
this.updateProps(config);
|
|
5686
|
-
});
|
|
5687
|
-
this.unsubscribe.push(subscr);
|
|
5688
|
-
}
|
|
5689
|
-
updateProps(config) {
|
|
5690
|
-
this.appToolbarDisplay = this.layout.getProp("app.toolbar.display", config);
|
|
5691
|
-
if (!this.appToolbarDisplay) {
|
|
5692
|
-
return;
|
|
5693
|
-
}
|
|
5694
|
-
this.appPageTitleDisplay = this.layout.getProp("app.pageTitle.display", config);
|
|
5695
|
-
this.appToolbarContainer = this.layout.getProp("app.toolbar.container", config);
|
|
5696
|
-
this.appToolbarContainerCSSClass =
|
|
5697
|
-
this.appToolbarContainer === "fixed"
|
|
5698
|
-
? "container-xxl"
|
|
5699
|
-
: "container-fluid";
|
|
5700
|
-
const containerClass = this.layout.getProp("app.toolbar.containerClass", config);
|
|
5701
|
-
if (containerClass) {
|
|
5702
|
-
this.appToolbarContainerCSSClass += ` ${containerClass}`;
|
|
5703
|
-
}
|
|
5704
|
-
this.appToolbarFixedDesktop = this.layout.getProp("app.toolbar.fixed.desktop", config);
|
|
5705
|
-
if (this.appToolbarFixedDesktop) {
|
|
5706
|
-
document.body.setAttribute("data-kt-app-toolbar-fixed", "true");
|
|
5707
|
-
}
|
|
5708
|
-
this.appToolbarFixedMobile = this.layout.getProp("app.toolbar.fixed.mobile", config);
|
|
5709
|
-
if (this.appToolbarFixedMobile) {
|
|
5710
|
-
document.body.setAttribute("data-kt-app-toolbar-fixed-mobile", "true");
|
|
5677
|
+
onClick(event) {
|
|
5678
|
+
const target = event.target;
|
|
5679
|
+
if (!target.closest('.dropdown1')) {
|
|
5680
|
+
this.Opendropdown = false;
|
|
5711
5681
|
}
|
|
5712
|
-
// toolbar
|
|
5713
|
-
this.appPageTitleDirection = this.layout.getProp("app.pageTitle.direction", config);
|
|
5714
|
-
this.appPageTitleCSSClass = this.layout.getProp("app.pageTitle.class", config);
|
|
5715
|
-
this.appPageTitleBreadcrumb = this.layout.getProp("app.pageTitle.breadCrumb", config);
|
|
5716
|
-
this.appPageTitleDescription = this.layout.getProp("app.pageTitle.description", config);
|
|
5717
|
-
document.body.setAttribute("data-kt-app-toolbar-enabled", "true");
|
|
5718
5682
|
}
|
|
5719
|
-
|
|
5720
|
-
|
|
5721
|
-
this.unsubscribe.forEach((sb) => sb.unsubscribe());
|
|
5722
|
-
this.destroy$.next(true);
|
|
5723
|
-
this.destroy$.complete();
|
|
5683
|
+
closeDropdown1() {
|
|
5684
|
+
this.Opendropdown = false;
|
|
5724
5685
|
}
|
|
5725
|
-
|
|
5726
|
-
|
|
5727
|
-
|
|
5728
|
-
|
|
5729
|
-
|
|
5730
|
-
|
|
5731
|
-
|
|
5732
|
-
|
|
5733
|
-
data.store = store.params['storeId'];
|
|
5734
|
-
localStorage.setItem('header-filters', JSON.stringify(data));
|
|
5735
|
-
}
|
|
5736
|
-
const currentUrl = this.router.url;
|
|
5737
|
-
const updatedUrl = currentUrl.replace(/\/manage\/stores\/\d+-\d+\//, `/manage/stores/`);
|
|
5738
|
-
URL = updatedUrl;
|
|
5739
|
-
// this.router.navigate([URL])
|
|
5740
|
-
}
|
|
5741
|
-
const url = URL.split("?")[0].split('/');
|
|
5742
|
-
this.urlString = URL;
|
|
5743
|
-
if (this.users?.userType === "tango") {
|
|
5744
|
-
if (url[2] == "settings" || URL == "/manage/users/client" ||
|
|
5745
|
-
URL == "/manage/stores" || URL === "/manage/stores?type=stores" || URL === "/manage/stores?type=clusters" ||
|
|
5746
|
-
URL == "/manage/stores/addition-method" ||
|
|
5747
|
-
URL == "/manage/stores/add-single-store" || URL === "/manage/trax/gallery" || URL == "/notifications/alerts?tab=alert" || URL == "/notifications/alerts?tab=download") {
|
|
5748
|
-
this.setUIProperties(true, false, false, false, false, false, false, false, false);
|
|
5749
|
-
}
|
|
5750
|
-
else if (url[3] == "edge-app") {
|
|
5751
|
-
this.setUIProperties(false, false, false, false, true, false, false, false, false);
|
|
5752
|
-
}
|
|
5753
|
-
else if (URL == `/manage/stores/infra-ticket?storeId=${this.storeId}` || URL == `/manage/stores/infra-ticket?storeId=${this.storeId}&type=infra` ||
|
|
5754
|
-
URL == `/manage/stores/settings?storeId=${this.storeId}` || URL == `/manage/stores/infra-ticket?storeId=${this.storeId}&type=dataMismatch` ||
|
|
5755
|
-
URL == `/manage/stores/zones?storeId=${this.storeId}` ||
|
|
5756
|
-
URL == `/manage/stores/cameras?storeId=${this.storeId}` ||
|
|
5757
|
-
// URL == `/manage/stores/infrastructure?storeId=${this.storeId}` ||
|
|
5758
|
-
URL == `/manage/stores/mat?storeId=${this.storeId}`) {
|
|
5759
|
-
this.setUIProperties(false, false, false, true, false, false, false, false, false);
|
|
5760
|
-
}
|
|
5761
|
-
else if (url[2] === 'controlcenter') {
|
|
5762
|
-
if (URL == `/manage/controlcenter/playback?storeId=${this.storeId}` || URL == `/manage/controlcenter/playback`) {
|
|
5763
|
-
this.setUIProperties(false, false, false, false, false, false, false, false, true);
|
|
5686
|
+
ngOnInit() {
|
|
5687
|
+
this.url = this.router.url.split("?")[0].split('/');
|
|
5688
|
+
const user = JSON.parse(localStorage.getItem('user-info'));
|
|
5689
|
+
this.users = user;
|
|
5690
|
+
this.gs?.manageRefreshTrigger?.subscribe((e) => {
|
|
5691
|
+
if (e) {
|
|
5692
|
+
if (user.userType === 'tango') {
|
|
5693
|
+
this.getClient();
|
|
5764
5694
|
}
|
|
5765
5695
|
else {
|
|
5766
|
-
|
|
5696
|
+
const storedFilters = localStorage.getItem("header-filters");
|
|
5697
|
+
if (storedFilters) {
|
|
5698
|
+
const headerFilters = JSON.parse(storedFilters);
|
|
5699
|
+
this.filteredStores = headerFilters?.stores.map((store) => ({
|
|
5700
|
+
...store,
|
|
5701
|
+
checked: store.checked
|
|
5702
|
+
}));
|
|
5703
|
+
}
|
|
5767
5704
|
}
|
|
5768
5705
|
}
|
|
5769
|
-
|
|
5770
|
-
|
|
5771
|
-
|
|
5772
|
-
|
|
5773
|
-
|
|
5774
|
-
|
|
5775
|
-
|
|
5776
|
-
|
|
5777
|
-
|
|
5778
|
-
|
|
5779
|
-
|
|
5780
|
-
|
|
5781
|
-
|
|
5782
|
-
|
|
5783
|
-
|
|
5784
|
-
|
|
5785
|
-
|
|
5786
|
-
|
|
5787
|
-
|
|
5788
|
-
|
|
5706
|
+
});
|
|
5707
|
+
// Fetch client data if the user is of type 'tango'
|
|
5708
|
+
if (user.userType === 'tango') {
|
|
5709
|
+
this.getClient();
|
|
5710
|
+
}
|
|
5711
|
+
else {
|
|
5712
|
+
this.getLocations();
|
|
5713
|
+
this.getGroups();
|
|
5714
|
+
this.getStore();
|
|
5715
|
+
// this.emitAndStoreFilters();
|
|
5716
|
+
// console.log("1")
|
|
5717
|
+
}
|
|
5718
|
+
// Load filters from localStorage if they exist
|
|
5719
|
+
const storedFilters = localStorage.getItem("header-filters");
|
|
5720
|
+
if (storedFilters) {
|
|
5721
|
+
const headerFilters = JSON.parse(storedFilters);
|
|
5722
|
+
// Initialize selectedFilters with defaults or existing values
|
|
5723
|
+
this.selectedFilters = {
|
|
5724
|
+
client: headerFilters.client || this.users.client,
|
|
5725
|
+
clientName: headerFilters.clientName || '',
|
|
5726
|
+
clients: headerFilters.clients || [],
|
|
5727
|
+
store: headerFilters.store || null,
|
|
5728
|
+
date: headerFilters.date || {},
|
|
5729
|
+
stores: headerFilters.stores || [],
|
|
5730
|
+
group: headerFilters.group || [],
|
|
5731
|
+
location: headerFilters.location || []
|
|
5732
|
+
};
|
|
5733
|
+
// Sync filtered data with stored selections
|
|
5734
|
+
this.filteredLocations = this.syncWithLocalStorage(headerFilters.location);
|
|
5735
|
+
this.filteredGroups = this.syncWithLocalStorage(headerFilters.group);
|
|
5736
|
+
this.filteredStores = this.syncWithLocalStorage(headerFilters.stores);
|
|
5737
|
+
// Format date range if it exists
|
|
5738
|
+
if (headerFilters.date) {
|
|
5739
|
+
this.selectedDateRange = {
|
|
5740
|
+
startDate: this.dayjs(headerFilters.date.startDate, "YYYY-MM-DD").format("DD-MM-YYYY"),
|
|
5741
|
+
endDate: this.dayjs(headerFilters.date.endDate, "YYYY-MM-DD").format("DD-MM-YYYY"),
|
|
5742
|
+
};
|
|
5789
5743
|
}
|
|
5790
5744
|
else {
|
|
5791
|
-
this.
|
|
5745
|
+
this.selectedDateRange = {
|
|
5746
|
+
startDate: this.dayjs(this.selectedDateRange.startDate, "YYYY-MM-DD").format("DD-MM-YYYY"),
|
|
5747
|
+
endDate: this.dayjs(this.selectedDateRange.endDate, "YYYY-MM-DD").format("DD-MM-YYYY"),
|
|
5748
|
+
};
|
|
5792
5749
|
}
|
|
5750
|
+
// console.log("3")
|
|
5751
|
+
// Emit data via service and update localStorage
|
|
5752
|
+
this.emitAndStoreFilters();
|
|
5793
5753
|
}
|
|
5794
5754
|
else {
|
|
5795
|
-
if
|
|
5796
|
-
|
|
5797
|
-
|
|
5798
|
-
|
|
5799
|
-
|
|
5800
|
-
|
|
5801
|
-
|
|
5802
|
-
|
|
5803
|
-
|
|
5804
|
-
|
|
5805
|
-
}
|
|
5806
|
-
|
|
5807
|
-
|
|
5808
|
-
|
|
5809
|
-
|
|
5810
|
-
|
|
5811
|
-
|
|
5812
|
-
|
|
5813
|
-
|
|
5814
|
-
|
|
5815
|
-
|
|
5816
|
-
|
|
5817
|
-
|
|
5818
|
-
|
|
5819
|
-
|
|
5755
|
+
// Initialize empty states if no header filters are present in localStorage
|
|
5756
|
+
this.resetFilters();
|
|
5757
|
+
// console.log("2")
|
|
5758
|
+
}
|
|
5759
|
+
}
|
|
5760
|
+
syncWithLocalStorage(items) {
|
|
5761
|
+
return items
|
|
5762
|
+
? items.map((item) => ({
|
|
5763
|
+
...item,
|
|
5764
|
+
checked: item.checked === true
|
|
5765
|
+
}))
|
|
5766
|
+
: [];
|
|
5767
|
+
}
|
|
5768
|
+
emitAndStoreFilters() {
|
|
5769
|
+
this.gs.dataRangeValue.next(this.selectedFilters);
|
|
5770
|
+
localStorage.setItem("header-filters", JSON.stringify(this.selectedFilters));
|
|
5771
|
+
// console.log("1")
|
|
5772
|
+
}
|
|
5773
|
+
/**
|
|
5774
|
+
* Reset selectedFilters and all related arrays to empty states
|
|
5775
|
+
*/
|
|
5776
|
+
resetFilters() {
|
|
5777
|
+
this.selectedFilters = {
|
|
5778
|
+
client: null,
|
|
5779
|
+
clientName: '',
|
|
5780
|
+
clients: [],
|
|
5781
|
+
store: null,
|
|
5782
|
+
date: {},
|
|
5783
|
+
stores: [],
|
|
5784
|
+
group: [],
|
|
5785
|
+
location: []
|
|
5786
|
+
};
|
|
5787
|
+
this.filteredLocations = [];
|
|
5788
|
+
this.filteredGroups = [];
|
|
5789
|
+
this.filteredStores = [];
|
|
5790
|
+
}
|
|
5791
|
+
getClient() {
|
|
5792
|
+
this.auth.getClients().subscribe({
|
|
5793
|
+
next: (e) => {
|
|
5794
|
+
if (e) {
|
|
5795
|
+
this.clientList = e.data.result;
|
|
5796
|
+
const headerFilters = JSON.parse(localStorage.getItem("header-filters") || "{}");
|
|
5797
|
+
if (headerFilters.client) {
|
|
5798
|
+
this.clientList.find((obj) => {
|
|
5799
|
+
if (obj.clientId === headerFilters.client) {
|
|
5800
|
+
this.selectedClient = obj;
|
|
5801
|
+
}
|
|
5802
|
+
});
|
|
5803
|
+
this.selectedFilters.client = headerFilters.client;
|
|
5804
|
+
this.selectedFilters.clientName = headerFilters.clientName;
|
|
5805
|
+
this.selectedFilters.clients = headerFilters.clients;
|
|
5806
|
+
this.selectedFilters.store = headerFilters.store;
|
|
5807
|
+
this.selectedFilters.date = headerFilters.date;
|
|
5808
|
+
this.selectedFilters.stores = headerFilters.stores;
|
|
5809
|
+
this.selectedFilters.group = headerFilters.group;
|
|
5810
|
+
this.selectedFilters.location = headerFilters.location;
|
|
5811
|
+
this.gs.dataRangeValue.next(this.selectedFilters);
|
|
5812
|
+
// console.log("2")
|
|
5813
|
+
// Ensure locations and groups are loaded before fetching stores
|
|
5814
|
+
this.getLocations();
|
|
5815
|
+
this.getGroups();
|
|
5816
|
+
// Fetch stores only after locations and groups are set
|
|
5817
|
+
this.getStore();
|
|
5818
|
+
}
|
|
5819
|
+
else {
|
|
5820
|
+
this.selectedClient = this.clientList[0];
|
|
5821
|
+
this.selectedFilters.client = this.selectedClient.clientId;
|
|
5822
|
+
this.selectedFilters.clientName = this.selectedClient.clientName;
|
|
5823
|
+
this.selectedFilters.clients = headerFilters.clients;
|
|
5824
|
+
this.selectedFilters.store = headerFilters.store;
|
|
5825
|
+
this.selectedFilters.date = headerFilters.date;
|
|
5826
|
+
this.selectedFilters.stores = headerFilters.stores;
|
|
5827
|
+
this.selectedFilters.group = headerFilters.group;
|
|
5828
|
+
this.selectedFilters.location = headerFilters.location;
|
|
5829
|
+
localStorage.setItem("header-filters", JSON.stringify(this.selectedFilters));
|
|
5830
|
+
this.gs.dataRangeValue.next(this.selectedFilters);
|
|
5831
|
+
// console.log("3")
|
|
5832
|
+
this.cd.detectChanges();
|
|
5833
|
+
// Ensure locations and groups are loaded before fetching stores
|
|
5834
|
+
this.getLocations();
|
|
5835
|
+
this.getGroups();
|
|
5836
|
+
// Fetch stores only after locations and groups are set
|
|
5837
|
+
this.getStore();
|
|
5838
|
+
}
|
|
5839
|
+
}
|
|
5840
|
+
else {
|
|
5841
|
+
this.selectedClient = this.clientList[0];
|
|
5842
|
+
this.selectedFilters.client = this.selectedClient.clientId;
|
|
5843
|
+
this.selectedFilters.clientName = this.selectedClient.clientName;
|
|
5844
|
+
// Ensure locations and groups are loaded before fetching stores
|
|
5845
|
+
this.getLocations();
|
|
5846
|
+
this.getGroups();
|
|
5847
|
+
// Fetch stores only after locations and groups are set
|
|
5848
|
+
this.getStore();
|
|
5849
|
+
localStorage.setItem("header-filters", JSON.stringify(this.selectedFilters));
|
|
5850
|
+
this.gs.dataRangeValue.next(this.selectedFilters);
|
|
5851
|
+
// console.log("4")
|
|
5852
|
+
this.cd.detectChanges();
|
|
5853
|
+
}
|
|
5854
|
+
},
|
|
5855
|
+
});
|
|
5856
|
+
}
|
|
5857
|
+
onClientSelect(event) {
|
|
5858
|
+
// Update the selected client
|
|
5859
|
+
this.selectedClient = event;
|
|
5860
|
+
// Clear previous filtered data and selections
|
|
5861
|
+
this.filteredGroups = [];
|
|
5862
|
+
this.filteredStores = [];
|
|
5863
|
+
this.filteredLocations = [];
|
|
5864
|
+
this.selectedFilters.stores = [];
|
|
5865
|
+
this.selectedFilters.group = [];
|
|
5866
|
+
this.selectedFilters.location = [];
|
|
5867
|
+
// Fetch header filters from localStorage
|
|
5868
|
+
const headerFilters = JSON.parse(localStorage.getItem("header-filters") || "{}");
|
|
5869
|
+
// Update the selected filters with the new client
|
|
5870
|
+
this.selectedFilters.client = this.selectedClient.clientId;
|
|
5871
|
+
this.selectedFilters.clientName = this.selectedClient.clientName;
|
|
5872
|
+
// Remove old store, group, and location data from the header filters
|
|
5873
|
+
delete headerFilters.stores;
|
|
5874
|
+
delete headerFilters.groups;
|
|
5875
|
+
delete headerFilters.location;
|
|
5876
|
+
// Fetch new data based on the new client
|
|
5877
|
+
this.getLocations();
|
|
5878
|
+
this.getStore();
|
|
5879
|
+
this.getGroups();
|
|
5880
|
+
// Update localStorage with the new client selection and empty filter data
|
|
5881
|
+
localStorage.setItem('header-filters', JSON.stringify(this.selectedFilters));
|
|
5882
|
+
window.location.reload();
|
|
5883
|
+
// Emit data to the global service
|
|
5884
|
+
// this.gs.dataRangeValue.next(this.selectedFilters);
|
|
5885
|
+
// Trigger change detection to reflect UI changes
|
|
5886
|
+
this.cd.detectChanges();
|
|
5887
|
+
}
|
|
5888
|
+
ranges = {
|
|
5889
|
+
Today: [dayjs(), dayjs()],
|
|
5890
|
+
Yesterday: [dayjs().subtract(1, 'days'), dayjs().subtract(1, 'days')],
|
|
5891
|
+
'This Week': [dayjs().subtract(7, 'days'), dayjs().subtract(1, 'days')],
|
|
5892
|
+
'Last Week': [
|
|
5893
|
+
dayjs().subtract(14, 'days').startOf('day'),
|
|
5894
|
+
dayjs().subtract(8, 'days').endOf('day'),
|
|
5895
|
+
],
|
|
5896
|
+
'This Month': [dayjs().subtract(30, 'days'), dayjs().subtract(1, 'days')],
|
|
5897
|
+
'Last Month': [
|
|
5898
|
+
dayjs().subtract(1, 'month').startOf('month'),
|
|
5899
|
+
dayjs().subtract(1, 'month').endOf('month'),
|
|
5900
|
+
],
|
|
5901
|
+
};
|
|
5902
|
+
onStartDateChange(event) {
|
|
5903
|
+
if (this.dayjs(event.startDate).isValid()) {
|
|
5904
|
+
this.isCustomDate = (m) => {
|
|
5905
|
+
const isValidDate = m > this.dayjs() || m > this.dayjs(event.startDate.add(90, "days"));
|
|
5906
|
+
return isValidDate ? "invalid-date" : false;
|
|
5907
|
+
};
|
|
5908
|
+
}
|
|
5909
|
+
}
|
|
5910
|
+
datechange(event) {
|
|
5911
|
+
if (event && event.startDate && event.endDate) {
|
|
5912
|
+
if (this.dayjs(event.startDate).isValid() &&
|
|
5913
|
+
this.dayjs(event.endDate).isValid()) {
|
|
5914
|
+
this.selectedDateRange.startDate = event.startDate;
|
|
5915
|
+
this.selectedDateRange.endDate = event.endDate;
|
|
5916
|
+
var datetime = {
|
|
5917
|
+
startDate: this.dayjs(event.startDate, "DD-MM-YYYY").format("YYYY-MM-DD"),
|
|
5918
|
+
endDate: this.dayjs(event.endDate, "DD-MM-YYYY").format("YYYY-MM-DD"),
|
|
5919
|
+
};
|
|
5920
|
+
this.selectedFilters.date = datetime;
|
|
5921
|
+
localStorage.setItem("header-filters", JSON.stringify(this.selectedFilters));
|
|
5922
|
+
window.location.reload();
|
|
5923
|
+
// this.gs.dataRangeValue.next(this.selectedFilters);
|
|
5924
|
+
}
|
|
5925
|
+
}
|
|
5926
|
+
}
|
|
5927
|
+
opendropdown(e) {
|
|
5928
|
+
e.stopPropagation();
|
|
5929
|
+
this.Opendropdown = !this.Opendropdown;
|
|
5930
|
+
}
|
|
5931
|
+
getLocations() {
|
|
5932
|
+
// const headerFilters: any = JSON.parse(localStorage.getItem("header-filters") || "{}");
|
|
5933
|
+
let obj = {
|
|
5934
|
+
clientId: this.selectedFilters.client ? this.selectedFilters.client : this.users.clientId,
|
|
5935
|
+
city: [],
|
|
5936
|
+
group: [],
|
|
5937
|
+
};
|
|
5938
|
+
this.auth.getLocation(obj).subscribe({
|
|
5939
|
+
next: (res) => {
|
|
5940
|
+
let cityList = this.selectedFilters?.location?.filter((location) => location.checked).map((loc) => loc.city);
|
|
5941
|
+
// Map the fetched locations with default unchecked state
|
|
5942
|
+
this.locations = res?.data?.locationData.map((city) => ({
|
|
5943
|
+
city: city.city,
|
|
5944
|
+
checked: cityList?.includes(city.city) ? true : false,
|
|
5945
|
+
}));
|
|
5946
|
+
// Sync the fetched locations with any stored checked values in localStorage
|
|
5947
|
+
if (this.selectedFilters.location && Array.isArray(this.selectedFilters.location)) {
|
|
5948
|
+
this.filteredLocations = this.locations.map(location => {
|
|
5949
|
+
const matchedLocation = this.selectedFilters.location.find((loc) => loc.city === location.city);
|
|
5950
|
+
return matchedLocation ? { ...location, checked: matchedLocation.checked } : location;
|
|
5951
|
+
});
|
|
5952
|
+
}
|
|
5953
|
+
else {
|
|
5954
|
+
this.filteredLocations = this.locations;
|
|
5955
|
+
}
|
|
5956
|
+
if (this.searchLocationText) {
|
|
5957
|
+
this.filteredLocations = this.locations.filter((location) => location.city.toLowerCase().includes(this.searchLocationText.toLowerCase()));
|
|
5958
|
+
}
|
|
5959
|
+
},
|
|
5960
|
+
error: (err) => {
|
|
5961
|
+
console.error("Failed to fetch locations", err);
|
|
5962
|
+
},
|
|
5963
|
+
});
|
|
5964
|
+
}
|
|
5965
|
+
isAllLocationsSelected() {
|
|
5966
|
+
return this.filteredLocations.every(location => location.checked);
|
|
5967
|
+
}
|
|
5968
|
+
selectedLocationsLabel() {
|
|
5969
|
+
const selectedLocations = this.locationLabel = this.searchLocationText.length ? this.locations
|
|
5970
|
+
.filter(location => location.checked).map(location => location.city) : this.filteredLocations
|
|
5971
|
+
.filter(location => location.checked).map(location => location.city);
|
|
5972
|
+
return selectedLocations.length === 0
|
|
5973
|
+
? ''
|
|
5974
|
+
: selectedLocations.length === 1
|
|
5975
|
+
? selectedLocations[0]
|
|
5976
|
+
: `${selectedLocations.length} locations`;
|
|
5977
|
+
}
|
|
5978
|
+
removeLocation() {
|
|
5979
|
+
this.Reset();
|
|
5980
|
+
}
|
|
5981
|
+
getGroups() {
|
|
5982
|
+
const city = this.locations
|
|
5983
|
+
.filter(location => location.checked)
|
|
5984
|
+
.map(location => location.city);
|
|
5985
|
+
const obj = { city, clientId: this.selectedFilters.client ? this.selectedFilters.client : this.users.clientId, group: [] };
|
|
5986
|
+
this.auth.getGroups(obj).subscribe({
|
|
5987
|
+
next: (res) => {
|
|
5988
|
+
let checkedGroup = this.selectedFilters?.group?.filter((group) => group.checked).map((group) => group.groupName);
|
|
5989
|
+
const combinedGroups = res?.data?.groupData?.map((groupName) => ({
|
|
5990
|
+
groupName: groupName.groupName,
|
|
5991
|
+
checked: checkedGroup?.includes(groupName.groupName) ? true : false,
|
|
5992
|
+
}));
|
|
5993
|
+
this.groupsData = combinedGroups;
|
|
5994
|
+
if (this.searchGroupText.length) {
|
|
5995
|
+
this.filteredGroups = combinedGroups.filter((item) => item.groupName.toLowerCase().includes(this.searchGroupText));
|
|
5996
|
+
}
|
|
5997
|
+
else {
|
|
5998
|
+
this.filteredGroups = combinedGroups;
|
|
5999
|
+
}
|
|
6000
|
+
// Auto-fetch stores when groups are selected
|
|
6001
|
+
const selectedGroups = this.groupsData.filter((group) => group.checked).map((group) => group.groupName);
|
|
6002
|
+
if (selectedGroups.length > 0) {
|
|
6003
|
+
this.getStore(); // Fetch stores based on selected groups
|
|
6004
|
+
}
|
|
6005
|
+
},
|
|
6006
|
+
error: (err) => {
|
|
6007
|
+
console.error("Failed to fetch groups", err);
|
|
6008
|
+
},
|
|
6009
|
+
});
|
|
6010
|
+
}
|
|
6011
|
+
toggleDropdown(type) {
|
|
6012
|
+
if (this.dropdownOpen === type) {
|
|
6013
|
+
// If the dropdown is open, close it and avoid resetting the selected values unnecessarily
|
|
6014
|
+
this.dropdownOpen = null;
|
|
6015
|
+
}
|
|
6016
|
+
else {
|
|
6017
|
+
// Open the specific dropdown and handle data fetching only if necessary
|
|
6018
|
+
this.dropdownOpen = type;
|
|
6019
|
+
if (type === 'group') {
|
|
6020
|
+
// Fetch groups only if there are selected cities and no active search text
|
|
6021
|
+
const selectedCities = this.locations
|
|
6022
|
+
.filter((location) => location.checked)
|
|
6023
|
+
.map((location) => location.city);
|
|
6024
|
+
// Fetch groups only if locations are selected, no search text exists, and dropdown is opened
|
|
6025
|
+
if (this.filteredLocations.length > 0 || (selectedCities.length > 0 && !this.searchGroupText.trim())) {
|
|
6026
|
+
this.getGroups();
|
|
6027
|
+
}
|
|
6028
|
+
else {
|
|
6029
|
+
this.filteredGroups = []; // Clear groups if no locations are selected
|
|
6030
|
+
}
|
|
6031
|
+
}
|
|
6032
|
+
if (type === 'store') {
|
|
6033
|
+
// Fetch stores only if not already fetched and no search text is active
|
|
6034
|
+
if ((!this.filteredStores || this.filteredStores.length === 0) && !this.searchStoreText.trim()) {
|
|
6035
|
+
this.getStore();
|
|
6036
|
+
}
|
|
6037
|
+
}
|
|
6038
|
+
}
|
|
6039
|
+
}
|
|
6040
|
+
handleGroupDropdownClick() {
|
|
6041
|
+
if (this.dropdownOpen === 'group') {
|
|
6042
|
+
this.resetSelectedGroups();
|
|
6043
|
+
}
|
|
6044
|
+
this.toggleDropdown('group');
|
|
6045
|
+
}
|
|
6046
|
+
resetSelectedGroups() {
|
|
6047
|
+
this.filteredGroups.forEach((group) => (group.checked = false));
|
|
6048
|
+
this.searchGroupText = "";
|
|
6049
|
+
}
|
|
6050
|
+
selectedGroupsLabel() {
|
|
6051
|
+
const selectedGroups = this.groupLabel = this.searchGroupText.length ? this.groupsData.filter((group) => group.checked) : this.filteredGroups.filter((group) => group.checked);
|
|
6052
|
+
return selectedGroups.length === 0
|
|
6053
|
+
? ""
|
|
6054
|
+
: selectedGroups.length === 1
|
|
6055
|
+
? selectedGroups[0].groupName
|
|
6056
|
+
: `${selectedGroups.length} groups`;
|
|
6057
|
+
}
|
|
6058
|
+
removeGroup() {
|
|
6059
|
+
this.Reset();
|
|
6060
|
+
}
|
|
6061
|
+
isAllGroupsSelected() {
|
|
6062
|
+
return this.filteredGroups.length ? this.filteredGroups.every((group) => group.checked) : false;
|
|
6063
|
+
}
|
|
6064
|
+
getStore() {
|
|
6065
|
+
const city = this.locations
|
|
6066
|
+
.filter(location => location.checked)
|
|
6067
|
+
.map(location => location.city);
|
|
6068
|
+
const group = this.groupsData
|
|
6069
|
+
.filter(group => group.checked)
|
|
6070
|
+
.map(group => group.groupName);
|
|
6071
|
+
const data = { city, clusters: group, clientId: this.users.clientId ? this.users.clientId : this.selectedFilters.client };
|
|
6072
|
+
this.auth.getHeaderStores(data).subscribe({
|
|
6073
|
+
next: (res) => {
|
|
6074
|
+
if (res && res.code === 200) {
|
|
6075
|
+
this.stores = res.data.storesData;
|
|
6076
|
+
// Retrieve checked store IDs from selectedFilters
|
|
6077
|
+
const checkedStoreIds = this.selectedFilters?.stores
|
|
6078
|
+
? this.selectedFilters.stores.filter((store) => store.checked).map((store) => store.storeId)
|
|
6079
|
+
: [];
|
|
6080
|
+
this.stores.forEach(store => {
|
|
6081
|
+
if (checkedStoreIds.includes(store.storeId)) {
|
|
6082
|
+
store.checked = true; // Sync the checked state with full store list
|
|
6083
|
+
}
|
|
6084
|
+
});
|
|
6085
|
+
// Map the stores and retain the 'checked' status
|
|
6086
|
+
if (this.searchStoreText.length) {
|
|
6087
|
+
this.filteredStores = this.stores?.filter(store => store.storeName.toLowerCase().includes(this.searchStoreText));
|
|
6088
|
+
}
|
|
6089
|
+
else {
|
|
6090
|
+
this.filteredStores = this.stores;
|
|
6091
|
+
}
|
|
6092
|
+
// Ensure selectedFilters is in sync with filteredStores
|
|
6093
|
+
if (!this.selectedFilters.stores || !this.selectedFilters.stores.length) {
|
|
6094
|
+
this.stores.forEach(store => {
|
|
6095
|
+
store.checked = true; // Sync the checked state with full store list
|
|
6096
|
+
});
|
|
6097
|
+
// No previously selected stores, mark all as checked
|
|
6098
|
+
this.filteredStores = this.selectedFilters.stores = this.filteredStores.map(store => ({
|
|
6099
|
+
...store,
|
|
6100
|
+
checked: true
|
|
6101
|
+
}));
|
|
6102
|
+
}
|
|
6103
|
+
else {
|
|
6104
|
+
// Update selectedFilters to reflect current state of stores
|
|
6105
|
+
this.selectedFilters.stores = this.filteredStores.map(store => ({
|
|
6106
|
+
...store,
|
|
6107
|
+
checked: store.checked
|
|
6108
|
+
}));
|
|
6109
|
+
}
|
|
6110
|
+
// Update localStorage with the latest selectedFilters
|
|
6111
|
+
localStorage.setItem('header-filters', JSON.stringify(this.selectedFilters));
|
|
6112
|
+
// Emit data via service
|
|
6113
|
+
// this.gs.dataRangeValue.next(this.selectedFilters);
|
|
6114
|
+
// Trigger change detection to reflect changes in the UI
|
|
6115
|
+
this.cd.detectChanges();
|
|
6116
|
+
}
|
|
6117
|
+
else {
|
|
6118
|
+
this.stores = [];
|
|
6119
|
+
this.selectedFilters.stores = [];
|
|
6120
|
+
this.filteredStores = [];
|
|
6121
|
+
this.selectedFilters.stores = this.filteredStores.map(store => ({
|
|
6122
|
+
...store,
|
|
6123
|
+
checked: false
|
|
6124
|
+
}));
|
|
6125
|
+
localStorage.setItem('header-filters', JSON.stringify(this.selectedFilters));
|
|
6126
|
+
}
|
|
6127
|
+
},
|
|
6128
|
+
error: (err) => {
|
|
6129
|
+
this.stores = [];
|
|
6130
|
+
this.selectedFilters.stores = this.filteredStores.map(store => ({
|
|
6131
|
+
...store,
|
|
6132
|
+
checked: false
|
|
6133
|
+
}));
|
|
6134
|
+
this.filteredStores = [];
|
|
6135
|
+
this.selectedFilters.stores = [];
|
|
6136
|
+
localStorage.setItem('header-filters', JSON.stringify(this.selectedFilters));
|
|
6137
|
+
console.error("Failed to fetch stores", err);
|
|
6138
|
+
},
|
|
6139
|
+
});
|
|
6140
|
+
}
|
|
6141
|
+
resetSelectedStores() {
|
|
6142
|
+
this.filteredStores.forEach((store) => (store.checked = false));
|
|
6143
|
+
this.searchStoreText = "";
|
|
6144
|
+
}
|
|
6145
|
+
selectedStoresLabel() {
|
|
6146
|
+
const selectedStores = this.searchStoreText.length ? this.stores.filter((store) => store.checked) : this.filteredStores.filter((store) => store.checked);
|
|
6147
|
+
return selectedStores.length === 0
|
|
6148
|
+
? "0 Stores"
|
|
6149
|
+
: selectedStores.length === 1
|
|
6150
|
+
? selectedStores[0].storeName
|
|
6151
|
+
: `${selectedStores.length} Stores`;
|
|
6152
|
+
}
|
|
6153
|
+
isAllStoresSelected() {
|
|
6154
|
+
return this.filteredStores.length > 0 && this.filteredStores.every(store => store.checked);
|
|
6155
|
+
}
|
|
6156
|
+
// Method to handle dropdown item selection
|
|
6157
|
+
updateSelectedStores() {
|
|
6158
|
+
this.filteredStores.forEach(store => {
|
|
6159
|
+
const filteredStore = this.stores.findIndex(fStore => fStore.storeId === store.storeId);
|
|
6160
|
+
if (filteredStore != -1) {
|
|
6161
|
+
this.stores[filteredStore].checked = store.checked; // Sync the checked state with full store list
|
|
6162
|
+
}
|
|
6163
|
+
});
|
|
6164
|
+
// Update selectedFilters based on the current store selection
|
|
6165
|
+
this.selectedFilters.stores = this.stores.filter(store => store.checked);
|
|
6166
|
+
// Update localStorage with the latest selection
|
|
6167
|
+
localStorage.setItem('header-filters', JSON.stringify(this.selectedFilters));
|
|
6168
|
+
// Emit updated filters via service
|
|
6169
|
+
// this.gs.dataRangeValue.next(this.selectedFilters);
|
|
6170
|
+
// Trigger change detection if necessary
|
|
6171
|
+
this.cd.detectChanges();
|
|
6172
|
+
}
|
|
6173
|
+
toggleSelectAllLocations(event) {
|
|
6174
|
+
const isChecked = event.target.checked;
|
|
6175
|
+
this.filteredLocations.forEach((location) => (location.checked = isChecked));
|
|
6176
|
+
this.updateSelectedLocations();
|
|
6177
|
+
}
|
|
6178
|
+
toggleSelectAllStores(event) {
|
|
6179
|
+
const checked = event.target.checked;
|
|
6180
|
+
// Apply the selection to both filtered and full list of stores
|
|
6181
|
+
this.filteredStores.forEach(store => store.checked = checked);
|
|
6182
|
+
this.stores.forEach(store => {
|
|
6183
|
+
const filteredStore = this.filteredStores.find(fStore => fStore.storeId === store.storeId);
|
|
6184
|
+
if (filteredStore) {
|
|
6185
|
+
store.checked = checked; // Sync the checked state with full store list
|
|
6186
|
+
}
|
|
6187
|
+
});
|
|
6188
|
+
// Update the selected stores and persist the selection
|
|
6189
|
+
this.updateSelectedStores();
|
|
6190
|
+
}
|
|
6191
|
+
updateSelectedLocations() {
|
|
6192
|
+
// When locations are selected, fetch the related groups
|
|
6193
|
+
const selectedCities = this.filteredLocations
|
|
6194
|
+
.filter((location) => location.checked)
|
|
6195
|
+
.map((location) => location.city);
|
|
6196
|
+
this.filteredLocations.forEach((location) => {
|
|
6197
|
+
let findLocationIndex = this.locations.findIndex((loc) => loc.city == location.city);
|
|
6198
|
+
if (findLocationIndex != -1) {
|
|
6199
|
+
this.locations[findLocationIndex].checked = location.checked;
|
|
6200
|
+
}
|
|
6201
|
+
});
|
|
6202
|
+
if (selectedCities.length > 0 || !selectedCities.length) {
|
|
6203
|
+
this.selectedFilters.stores = [];
|
|
6204
|
+
this.selectedFilters.location = this.locations;
|
|
6205
|
+
this.getGroups(); // Fetch groups based on selected cities
|
|
6206
|
+
// If there are selected groups, fetch the stores based on selected groups
|
|
6207
|
+
this.getStore();
|
|
6208
|
+
}
|
|
6209
|
+
else {
|
|
6210
|
+
this.filteredGroups = []; // Clear groups if no locations are selected
|
|
6211
|
+
this.selectedFilters.location = [];
|
|
6212
|
+
}
|
|
6213
|
+
this.selectedFilters.group = [];
|
|
6214
|
+
this.filteredStores = []; // Reset stores as well
|
|
6215
|
+
this.searchGroupText = '';
|
|
6216
|
+
this.searchStoreText = '';
|
|
6217
|
+
// this.Opendropdown = false;
|
|
6218
|
+
}
|
|
6219
|
+
toggleSelectAllGroups(event) {
|
|
6220
|
+
const isChecked = event.target.checked;
|
|
6221
|
+
this.filteredGroups.forEach((group) => (group.checked = isChecked));
|
|
6222
|
+
this.updateSelectedGroups();
|
|
6223
|
+
// if (!isChecked) {
|
|
6224
|
+
// this.selectedFilters.stores =[];
|
|
6225
|
+
// // If there are selected groups, fetch the stores based on selected groups
|
|
6226
|
+
// this.getStore();
|
|
6227
|
+
// }
|
|
6228
|
+
}
|
|
6229
|
+
updateSelectedGroups() {
|
|
6230
|
+
// Fetch the relevant stores after groups are selected
|
|
6231
|
+
const selectedGroups = this.filteredGroups
|
|
6232
|
+
.filter((group) => group.checked)
|
|
6233
|
+
.map((group) => group.groupName);
|
|
6234
|
+
this.filteredGroups.forEach((group) => {
|
|
6235
|
+
let findGroupIndex = this.groupsData.findIndex((item) => item.groupName == group.groupName);
|
|
6236
|
+
if (findGroupIndex != -1) {
|
|
6237
|
+
this.groupsData[findGroupIndex].checked = group.checked;
|
|
6238
|
+
}
|
|
6239
|
+
});
|
|
6240
|
+
if (selectedGroups.length > 0 || !selectedGroups.length) {
|
|
6241
|
+
this.selectedFilters.stores = [];
|
|
6242
|
+
// If there are selected groups, fetch the stores based on selected groups
|
|
6243
|
+
this.getStore();
|
|
6244
|
+
this.selectedFilters.group = this.groupsData;
|
|
6245
|
+
}
|
|
6246
|
+
else {
|
|
6247
|
+
// If no groups are selected, clear the stores list
|
|
6248
|
+
this.filteredStores = [];
|
|
6249
|
+
// Also, update localStorage to reflect the cleared store selection
|
|
6250
|
+
this.selectedFilters.stores = [];
|
|
6251
|
+
localStorage.setItem('header-filters', JSON.stringify(this.selectedFilters));
|
|
6252
|
+
// Emit data via service
|
|
6253
|
+
// this.gs.dataRangeValue.next(this.selectedFilters);
|
|
6254
|
+
}
|
|
6255
|
+
// Clear the search store text when groups are updated
|
|
6256
|
+
this.searchStoreText = '';
|
|
6257
|
+
}
|
|
6258
|
+
Reset() {
|
|
6259
|
+
// Clear selected groups, stores, and locations
|
|
6260
|
+
this.filteredGroups = [];
|
|
6261
|
+
this.filteredStores = [];
|
|
6262
|
+
this.filteredLocations = []; // Reset locations as well
|
|
6263
|
+
// Clear search input fields
|
|
6264
|
+
this.searchLocationText = "";
|
|
6265
|
+
this.searchGroupText = "";
|
|
6266
|
+
this.searchStoreText = "";
|
|
6267
|
+
// Fetch locations, groups, and stores again
|
|
6268
|
+
this.getLocations();
|
|
6269
|
+
this.getStore();
|
|
6270
|
+
this.getGroups();
|
|
6271
|
+
// Reset the filters in selectedFilters
|
|
6272
|
+
this.selectedFilters = {
|
|
6273
|
+
...this.selectedFilters,
|
|
6274
|
+
stores: [],
|
|
6275
|
+
group: [],
|
|
6276
|
+
location: [] // Clear locations selection
|
|
6277
|
+
};
|
|
6278
|
+
// // Once stores are fetched, mark all as checked
|
|
6279
|
+
// setTimeout(() => {
|
|
6280
|
+
// this.filteredStores = this.stores.map(store => ({
|
|
6281
|
+
// ...store,
|
|
6282
|
+
// checked: true // Mark all stores as checked
|
|
6283
|
+
// }));
|
|
6284
|
+
// // Sync selectedFilters with the updated store state
|
|
6285
|
+
// this.selectedFilters.stores = this.filteredStores.map(store => ({
|
|
6286
|
+
// ...store,
|
|
6287
|
+
// checked: true
|
|
6288
|
+
// }));
|
|
6289
|
+
// Update localStorage with the latest selectedFilters
|
|
6290
|
+
localStorage.setItem('header-filters', JSON.stringify(this.selectedFilters));
|
|
6291
|
+
window.location.reload();
|
|
6292
|
+
// Emit the reset filters to update other components if needed
|
|
6293
|
+
// this.gs.dataRangeValue.next(this.selectedFilters);
|
|
6294
|
+
// Trigger change detection
|
|
6295
|
+
this.cd.detectChanges();
|
|
6296
|
+
// Adding a slight delay to ensure stores are fetched first
|
|
6297
|
+
// Close dropdown after reset if necessary
|
|
6298
|
+
this.Opendropdown = false;
|
|
6299
|
+
}
|
|
6300
|
+
Apply() {
|
|
6301
|
+
// Close the dropdown
|
|
6302
|
+
this.Opendropdown = false;
|
|
6303
|
+
// Fetch existing filters from localStorage
|
|
6304
|
+
const headerFilters = JSON.parse(localStorage.getItem("header-filters") || "{}");
|
|
6305
|
+
this.selectedFilters.store = null;
|
|
6306
|
+
// Ensure current selections are reflected
|
|
6307
|
+
this.selectedFilters.location = this.locations;
|
|
6308
|
+
this.selectedFilters.group = this.groupsData;
|
|
6309
|
+
this.selectedFilters.stores = headerFilters.stores ? headerFilters.stores : this.stores;
|
|
6310
|
+
// Store updated filters back in localStorage
|
|
6311
|
+
localStorage.setItem("header-filters", JSON.stringify(this.selectedFilters));
|
|
6312
|
+
window.location.reload();
|
|
6313
|
+
// Emit the updated filters via the service
|
|
6314
|
+
// this.gs.dataRangeValue.next(this.selectedFilters);
|
|
6315
|
+
// Trigger refresh if necessary
|
|
6316
|
+
// this.gs.manageRefreshTrigger.next(true);
|
|
6317
|
+
this.cd.detectChanges();
|
|
6318
|
+
}
|
|
6319
|
+
filterLocations() {
|
|
6320
|
+
const searchText = this.searchLocationText.toLowerCase();
|
|
6321
|
+
if (searchText) {
|
|
6322
|
+
// Preserve the checked state during filtering
|
|
6323
|
+
this.filteredLocations = this.locations
|
|
6324
|
+
.map(location => ({
|
|
6325
|
+
...location,
|
|
6326
|
+
checked: this.filteredLocations.find(l => l.city === location.city)?.checked || false
|
|
6327
|
+
}))
|
|
6328
|
+
.filter(location => location?.city?.toLowerCase().includes(searchText));
|
|
6329
|
+
}
|
|
6330
|
+
else {
|
|
6331
|
+
// Restore the original checked state when search text is cleared
|
|
6332
|
+
this.filteredLocations = this.locations.map(location => ({
|
|
6333
|
+
...location,
|
|
6334
|
+
checked: this.selectedFilters.location.find((l) => l.city === location.city)?.checked || false
|
|
6335
|
+
}));
|
|
6336
|
+
}
|
|
6337
|
+
}
|
|
6338
|
+
filterGroups() {
|
|
6339
|
+
const searchText = this.searchGroupText.toLowerCase();
|
|
6340
|
+
if (searchText) {
|
|
6341
|
+
// Preserve the checked state during filtering
|
|
6342
|
+
this.filteredGroups = this.groupsData
|
|
6343
|
+
.map(group => ({
|
|
6344
|
+
...group,
|
|
6345
|
+
checked: this.filteredGroups.find(g => g.groupName === group.groupName)?.checked || false
|
|
6346
|
+
}))
|
|
6347
|
+
.filter(group => group?.groupName?.toLowerCase().includes(searchText));
|
|
6348
|
+
}
|
|
6349
|
+
else {
|
|
6350
|
+
// Restore the original checked state when search text is cleared
|
|
6351
|
+
this.filteredGroups = this.groupsData.map(group => ({
|
|
6352
|
+
...group,
|
|
6353
|
+
checked: this.selectedFilters.group.find((g) => g.groupName === group.groupName)?.checked || false
|
|
6354
|
+
}));
|
|
6355
|
+
}
|
|
6356
|
+
}
|
|
6357
|
+
filterStores() {
|
|
6358
|
+
const searchText = this.searchStoreText.toLowerCase();
|
|
6359
|
+
// Preserve checked states during filtering
|
|
6360
|
+
if (searchText) {
|
|
6361
|
+
// Filter based on search text while preserving checked state
|
|
6362
|
+
this.filteredStores = this.stores
|
|
6363
|
+
.map(store => ({
|
|
6364
|
+
...store,
|
|
6365
|
+
// Check if the store is already checked in filteredStores, fallback to original stores' checked state
|
|
6366
|
+
checked: this.selectedFilters.stores.find((s) => s.storeId === store.storeId)?.checked || store.checked || false
|
|
6367
|
+
}))
|
|
6368
|
+
.filter(store => store.storeName.toLowerCase().includes(searchText));
|
|
6369
|
+
}
|
|
6370
|
+
else {
|
|
6371
|
+
// When the search text is cleared, restore the original list with preserved checked states
|
|
6372
|
+
this.filteredStores = this.stores.map(store => ({
|
|
6373
|
+
...store,
|
|
6374
|
+
// Preserve the checked state based on the selected filters
|
|
6375
|
+
checked: this.selectedFilters.stores.find((s) => s.storeId === store.storeId)?.checked || store.checked || false
|
|
6376
|
+
}));
|
|
6377
|
+
}
|
|
6378
|
+
}
|
|
6379
|
+
closeDropdown() {
|
|
6380
|
+
this.dropdownOpen = null;
|
|
6381
|
+
}
|
|
6382
|
+
clickOutside(event) {
|
|
6383
|
+
const clickedInside = event.target.closest(".dropdown-container");
|
|
6384
|
+
const clickedoutSide = event.target.closest(".dropdown1");
|
|
6385
|
+
if (!clickedInside) {
|
|
6386
|
+
this.closeDropdown();
|
|
6387
|
+
}
|
|
6388
|
+
if (!clickedoutSide) {
|
|
6389
|
+
this.closeDropdown1();
|
|
6390
|
+
}
|
|
6391
|
+
}
|
|
6392
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: TrafficNobComponent, deps: [{ token: AuthService }, { token: i2.Router }, { token: i1.GlobalStateService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
6393
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: TrafficNobComponent, selector: "lib-traffic-nob", host: { listeners: { "document:click": "clickOutside($event)" } }, ngImport: i0, template: "<div class=\"me-3\">\r\n <label *ngIf=\"selectedLocationsLabel()\" class=\"badge badge-light-default mx-2\">{{selectedLocationsLabel()}} \r\n <span class=\"cursor-pointer\" (click)=\"removeLocation()\"><svg xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"none\">\r\n <path d=\"M9 3L3 9M3 3L9 9\" stroke=\"#667085\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\r\n </svg></span>\r\n </label>\r\n <label *ngIf=\"selectedGroupsLabel()\" class=\"badge badge-light-default mx-2\">{{selectedGroupsLabel()}} \r\n <span class=\"cursor-pointer\" (click)=\"removeGroup()\"><svg xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"none\">\r\n <path d=\"M9 3L3 9M3 3L9 9\" stroke=\"#667085\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\r\n </svg></span>\r\n </label>\r\n <label class=\"badge badge-light-default\">{{selectedStoresLabel()}}</label>\r\n</div>\r\n\r\n<div class=\"d-flex align-items-center position-relative my-1\">\r\n <span class=\"svg-icon svg-icon-1 position-absolute ms-3\">\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\">\r\n <path\r\n d=\"M13.3333 1.66663V4.99996M6.66667 1.66663V4.99996M2.5 8.33329H17.5M4.16667 3.33329H15.8333C16.7538 3.33329 17.5 4.07948 17.5 4.99996V16.6666C17.5 17.5871 16.7538 18.3333 15.8333 18.3333H4.16667C3.24619 18.3333 2.5 17.5871 2.5 16.6666V4.99996C2.5 4.07948 3.24619 3.33329 4.16667 3.33329Z\"\r\n stroke=\"#344054\" stroke-width=\"1.67\" stroke-linecap=\"round\" stroke-linejoin=\"round\" />\r\n </svg>\r\n </span>\r\n <input class=\"fx-date-range form-control ps-14\" style=\"min-width: 260px !important;\" type=\"text\" matInput\r\n ngxDaterangepickerMd [drops]=\"'down'\" [opens]=\"'right'\" [ranges]=\"ranges\" [showCustomRangeLabel]=\"true\" [autoApply]=\"true\"\r\n [alwaysShowCalendars]=\"false\" [keepCalendarOpeningWithRange]=\"true\" [showCancel]=\"true\" autocomplete=\"off\"\r\n [(ngModel)]=\"selectedDateRange\" (startDateChanged)=\"onStartDateChange($event)\" [isCustomDate]=\"isCustomDate\"\r\n [locale]=\"{ format: 'DD-MM-YYYY', firstDay: 1, monthNames: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'] }\"\r\n (datesUpdated)=\"datechange($event)\" name=\"daterange\" [readonly]=\"true\" />\r\n</div>\r\n<div class=\"position-relative\">\r\n <button type=\"button\" (click)=\"opendropdown($event)\" class=\"btn btn-default mx-2 rounded-3 text-nowrap border-val\">\r\n <!-- <span class=\"me-2\">Filter</span> -->\r\n <svg class=\"pl-3\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\r\n <path d=\"M5 10H15M2.5 5H17.5M7.5 15H12.5\" stroke=\"#344054\" stroke-width=\"2\" stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\" />\r\n </svg>\r\n </button>\r\n\r\n <div *ngIf=\"Opendropdown\" class=\"card p-5 dropdown1 position-absolute z-1 end-0\" style=\"z-index: 1 !important;\" (clickOutside)=\"closeDropdown1()\">\r\n <div class=\"dropdown-title d-flex justify-content-between mb-2\">Filter Options\r\n <button class=\"btn btn-outline w-25 ms-3 btn-resize\" (click)=\"Reset()\"> Reset </button>\r\n <button class=\"btn btn-primary w-25 btn-resize\" (click)=\"Apply()\">Apply</button>\r\n </div>\r\n\r\n <!-- Location Dropdown -->\r\n<div class=\"dropdown-container\" (clickOutside)=\"closeDropdown()\">\r\n <div class=\"dropdown-header\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control dropdown-input cursor-pointer\" \r\n [value]=\"selectedLocationsLabel()\"\r\n (focus)=\"toggleDropdown('location')\" \r\n readonly\r\n placeholder=\"Select locations...\"\r\n />\r\n </div>\r\n <div class=\"dropdown-menu custom-dropdown-menu\" *ngIf=\"dropdownOpen === 'location'\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control mb-2 dropdown-search\" \r\n placeholder=\"Search locations...\" \r\n [(ngModel)]=\"searchLocationText\" \r\n (ngModelChange)=\"filterLocations()\" \r\n />\r\n <div class=\"form-check mb-2 dropdown-item custom-dropdown-item\">\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n id=\"selectAllLocations\" \r\n [checked]=\"isAllLocationsSelected()\" \r\n (change)=\"toggleSelectAllLocations($event)\" \r\n />\r\n <label class=\"form-check-label\" for=\"selectAllLocations\">\r\n Select All Locations\r\n </label>\r\n </div>\r\n <div \r\n class=\"dropdown-item form-check custom-dropdown-item\" \r\n *ngFor=\"let location of filteredLocations\"\r\n >\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n [id]=\"location.city\" \r\n [(ngModel)]=\"location.checked\"\r\n (change)=\"updateSelectedLocations()\" \r\n />\r\n <label class=\"form-check-label\" [for]=\"location.city\">\r\n {{ location.city }}\r\n </label>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<!-- Group Dropdown -->\r\n<div class=\"dropdown-container mt-3\" (clickOutside)=\"closeDropdown()\">\r\n <div class=\"dropdown-header\" (click)=\"toggleDropdown('group')\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control dropdown-input cursor-pointer\" \r\n [value]=\"selectedGroupsLabel()\" readonly\r\n placeholder=\"Select clusters..\"\r\n />\r\n </div>\r\n <div class=\"dropdown-menu custom-dropdown-menu\" *ngIf=\"dropdownOpen === 'group'\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control mb-2 dropdown-search\" \r\n placeholder=\"Search clusters...\" \r\n [(ngModel)]=\"searchGroupText\" \r\n (ngModelChange)=\"filterGroups()\" \r\n />\r\n <div class=\"form-check mb-2 dropdown-item custom-dropdown-item\">\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n id=\"selectAllGroups\" \r\n [checked]=\"isAllGroupsSelected()\" \r\n (change)=\"toggleSelectAllGroups($event)\" \r\n />\r\n <label class=\"form-check-label\" for=\"selectAllGroups\">\r\n Select All\r\n </label>\r\n </div>\r\n <div \r\n class=\"dropdown-item form-check custom-dropdown-item\" \r\n *ngFor=\"let group of filteredGroups\"\r\n >\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n [id]=\"group.groupName\"\r\n [(ngModel)]=\"group.checked\"\r\n (change)=\"updateSelectedGroups()\" \r\n />\r\n <label class=\"form-check-label\" [for]=\"group.groupName\">\r\n {{ group.groupName }}\r\n </label>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n\r\n<!-- Store Dropdown -->\r\n<div class=\"dropdown-container mt-3\" (clickOutside)=\"closeDropdown()\">\r\n <div class=\"dropdown-header\" (click)=\"toggleDropdown('store')\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control dropdown-input cursor-pointer\"\r\n [value]=\"selectedStoresLabel()\"\r\n readonly\r\n placeholder=\"Select stores...\"\r\n />\r\n </div>\r\n <div class=\"dropdown-menu custom-dropdown-menu\" *ngIf=\"dropdownOpen === 'store'\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control mb-2 dropdown-search \" \r\n placeholder=\"Search stores...\" \r\n [(ngModel)]=\"searchStoreText\" \r\n (ngModelChange)=\"filterStores()\" \r\n />\r\n <div class=\"form-check mb-2 dropdown-item custom-dropdown-item\">\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n id=\"selectAllStores\" \r\n [checked]=\"isAllStoresSelected()\" \r\n (change)=\"toggleSelectAllStores($event)\" \r\n />\r\n <label class=\"form-check-label\" for=\"selectAllStores\">\r\n Select All\r\n </label>\r\n </div>\r\n <div \r\n class=\"dropdown-item form-check custom-dropdown-item\" \r\n *ngFor=\"let store of filteredStores\"\r\n >\r\n <input \r\n class=\"form-check-input\" \r\n type=\"checkbox\" \r\n [id]=\"store.storeId\"\r\n [(ngModel)]=\"store.checked\"\r\n (change)=\"updateSelectedStores()\" \r\n />\r\n <label class=\"form-check-label\" [for]=\"store.storeId\">\r\n {{ store.storeName }}\r\n </label>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n </div>\r\n</div>", styles: [".daterangepicker{display:block!important;top:153.85px!important;left:900px!important;right:0}.form-control{color:var(--Gray-700, #344054)!important;font-size:14px!important;font-weight:600;line-height:20px;text-transform:capitalize}::ng-deep .applyBtn{display:none!important}:host::ng-deep .md-drppicker .btn{line-height:10px!important}:host::ng-deep .daterangepicker-input+.ngx-daterangepicker-material .applyBtn{display:none}:host::ng-deep .md-drppicker.drops-down-right.ltr.double.show-ranges.shown{top:65px!important;left:-470px!important;height:365px!important}:host::ng-deep .md-drppicker .btn{border-radius:8px!important;border:1px solid var(--Primary-600, #00A3FF)!important;background:var(--Primary-600, #00A3FF)!important;box-shadow:0 1px 2px #1018280d!important;color:var(--White, #FFF)!important;font-size:14px!important;font-weight:600!important;line-height:20px;text-transform:capitalize}:host::ng-deep .md-drppicker .ranges ul li button{padding:12px 16px;width:160px;color:var(--Gray-700, #344054);font-size:14px;font-weight:400;line-height:20px;background:none;border:none;text-align:left;cursor:pointer}:host::ng-deep .md-drppicker td.active,:host::ng-deep .md-drppicker td.active:hover{background-color:#029cf4!important;border-radius:20px!important;color:var(--White, #FFF)!important;text-align:center!important;font-size:14px!important;font-weight:500!important;line-height:20px}:host::ng-deep .md-drppicker.ltr .ranges{float:left;margin-top:10px!important}:host::ng-deep .md-drppicker td.in-range{background:var(--Primary-50, #EAF8FF)}:host::ng-deep .md-drppicker .ranges ul li button.active{background:var(--Primary-50, #EAF8FF)!important;border-radius:8px!important;color:var(--Primary-700, #009BF3);font-size:14px!important;font-weight:500!important;line-height:20px!important}:host::ng-deep table th,:host::ng-deep table td{width:40px!important;height:40px!important;padding:10px 8px!important}:host::ng-deep .md-drppicker td.available.prev,:host::ng-deep .md-drppicker th.available.prev{background-image:url(data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMy43IDYiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDMuNyA2IiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxnPg0KCTxwYXRoIGQ9Ik0zLjcsMC43TDEuNCwzbDIuMywyLjNMMyw2TDAsM2wzLTNMMy43LDAuN3oiLz4NCjwvZz4NCjwvc3ZnPg0K)!important;background-repeat:no-repeat!important;background-size:.5em!important;background-position:center!important}:host::ng-deep .md-drppicker td.available.next,:host::ng-deep .md-drppicker th.available.next{background-image:url(data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMy43IDYiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDMuNyA2IiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxnPg0KCTxwYXRoIGQ9Ik0zLjcsMC43TDEuNCwzbDIuMywyLjNMMyw2TDAsM2wzLTNMMy43LDAuN3oiLz4NCjwvZz4NCjwvc3ZnPg0K)!important;background-repeat:no-repeat!important;background-size:.5em!important;background-position:center!important}:host::ng-deep table th{border-bottom:0px solid var(--Gray-200, #EAECF0)!important;background:transparent!important;color:var(--Gray-700, #344054)!important;text-align:center;font-size:16px!important;font-weight:500!important;line-height:24px}:host::ng-deep .md-drppicker .btn.btn-default{border-radius:8px!important;border:1px solid var(--Gray-300, #D0D5DD)!important;background:var(--White, #FFF)!important;box-shadow:0 1px 2px #1018280d!important;color:var(--Gray-700, #344054)!important;font-size:14px!important;font-weight:600!important;line-height:20px;text-transform:capitalize;margin-right:10px!important}:host::ng-deep .md-drppicker td.available.invalid-date{text-decoration:line-through;pointer-events:none;color:#a9a9a9}:host::ng-deep .md-drppicker td.available.today:not(.invalid-date){text-decoration:unset;pointer-events:unset;color:unset}.wrapper{min-width:200px}.btn-primary{line-height:18px!important}.filter-label{color:var(--Gray-500, #667085)!important;font-size:14px;font-style:normal;font-weight:600;line-height:20px;text-transform:capitalize}.position-relative{position:relative}.filter-icon{cursor:pointer}.dropdown-container{position:relative;display:inline-block;width:100%}.dropdown-header{cursor:pointer;width:100%}.form-control{color:var(--Gray-700, #344054)!important;font-size:14px!important;font-weight:600;line-height:20px;text-transform:capitalize;width:100%;box-sizing:border-box}.dropdown-menu{position:absolute;top:100%;left:0;right:0;border:1px solid #ccc;background-color:#fff;z-index:1000;max-height:230px;overflow-y:auto;display:block;box-sizing:border-box;padding:10px 5px}.dropdown-item{padding:6px 0}.dropdown-item:hover{background-color:#f1f1f1}.dropdown-item input[type=checkbox]{margin-right:10px}.custom-dropdown-menu{border-radius:4px;box-shadow:0 1px 2px #1018280d}.custom-dropdown-item{display:flex;align-items:center}.custom-dropdown-item input{margin-left:10px}.btn-resize{font-size:13px!important;height:29px!important;line-height:11px!important;padding:3px!important}.dropdown1{position:absolute;top:70px;min-width:270px!important}.dropdown1 .dropdown-title{color:var(--Gray-900, #101828);font-size:14px;font-weight:600;line-height:24px}.dropdown1 .dropdown{position:relative;display:inline-block}.dropdown1 .dropdown span{color:var(--Gray-700, #344054);font-size:14px;font-weight:600;line-height:20px}::ng-deep .dropdown1{z-index:1!important}.form-check-label{color:var(--Gray-700, #344054)!important;font-size:14px;font-style:normal;font-weight:500;line-height:20px}input[type=checkbox]{width:16px!important;height:16px!important;margin:0 5px;border-radius:4px!important;-webkit-appearance:none;-moz-appearance:none;-o-appearance:none;appearance:none;outline:1px solid var(--gray-300, #D0D5DD);box-shadow:none;font-size:.8em;text-align:center;line-height:1em;background:#fff}input[type=checkbox]:checked{outline:1px solid var(--primary-600, #00A3FF);background-color:var(--primary-50, #EAF8FF)}input[type=checkbox]:checked:after{content:\"\";transform:rotate(45deg);border-bottom:2px solid #00A3FF;border-right:2px solid #00A3FF;display:inline-block;width:.2em;padding-left:0;padding-top:9px;padding-right:4px}\n"], dependencies: [{ kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i6.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i6.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i6.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i6.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i7.DaterangepickerDirective, selector: "input[ngxDaterangepickerMd]", inputs: ["minDate", "maxDate", "autoApply", "alwaysShowCalendars", "showCustomRangeLabel", "linkedCalendars", "dateLimit", "singleDatePicker", "showWeekNumbers", "showISOWeekNumbers", "showDropdowns", "isInvalidDate", "isCustomDate", "isTooltipDate", "showClearButton", "customRangeDirection", "ranges", "opens", "drops", "firstMonthDayClass", "lastMonthDayClass", "emptyWeekRowClass", "emptyWeekColumnClass", "firstDayOfNextMonthClass", "lastDayOfPreviousMonthClass", "keepCalendarOpeningWithRange", "showRangeLabelOnInput", "showCancel", "lockStartDate", "timePicker", "timePicker24Hour", "timePickerIncrement", "timePickerSeconds", "closeOnAutoApply", "endKeyHolder", "startKey", "locale", "endKey"], outputs: ["change", "rangeClicked", "datesUpdated", "startDateChanged", "endDateChanged", "clearClicked"] }] });
|
|
6394
|
+
}
|
|
6395
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: TrafficNobComponent, decorators: [{
|
|
6396
|
+
type: Component,
|
|
6397
|
+
args: [{ selector: 'lib-traffic-nob', template: "<div class=\"me-3\">\r\n <label *ngIf=\"selectedLocationsLabel()\" class=\"badge badge-light-default mx-2\">{{selectedLocationsLabel()}} \r\n <span class=\"cursor-pointer\" (click)=\"removeLocation()\"><svg xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"none\">\r\n <path d=\"M9 3L3 9M3 3L9 9\" stroke=\"#667085\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\r\n </svg></span>\r\n </label>\r\n <label *ngIf=\"selectedGroupsLabel()\" class=\"badge badge-light-default mx-2\">{{selectedGroupsLabel()}} \r\n <span class=\"cursor-pointer\" (click)=\"removeGroup()\"><svg xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"none\">\r\n <path d=\"M9 3L3 9M3 3L9 9\" stroke=\"#667085\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\r\n </svg></span>\r\n </label>\r\n <label class=\"badge badge-light-default\">{{selectedStoresLabel()}}</label>\r\n</div>\r\n\r\n<div class=\"d-flex align-items-center position-relative my-1\">\r\n <span class=\"svg-icon svg-icon-1 position-absolute ms-3\">\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\">\r\n <path\r\n d=\"M13.3333 1.66663V4.99996M6.66667 1.66663V4.99996M2.5 8.33329H17.5M4.16667 3.33329H15.8333C16.7538 3.33329 17.5 4.07948 17.5 4.99996V16.6666C17.5 17.5871 16.7538 18.3333 15.8333 18.3333H4.16667C3.24619 18.3333 2.5 17.5871 2.5 16.6666V4.99996C2.5 4.07948 3.24619 3.33329 4.16667 3.33329Z\"\r\n stroke=\"#344054\" stroke-width=\"1.67\" stroke-linecap=\"round\" stroke-linejoin=\"round\" />\r\n </svg>\r\n </span>\r\n <input class=\"fx-date-range form-control ps-14\" style=\"min-width: 260px !important;\" type=\"text\" matInput\r\n ngxDaterangepickerMd [drops]=\"'down'\" [opens]=\"'right'\" [ranges]=\"ranges\" [showCustomRangeLabel]=\"true\" [autoApply]=\"true\"\r\n [alwaysShowCalendars]=\"false\" [keepCalendarOpeningWithRange]=\"true\" [showCancel]=\"true\" autocomplete=\"off\"\r\n [(ngModel)]=\"selectedDateRange\" (startDateChanged)=\"onStartDateChange($event)\" [isCustomDate]=\"isCustomDate\"\r\n [locale]=\"{ format: 'DD-MM-YYYY', firstDay: 1, monthNames: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'] }\"\r\n (datesUpdated)=\"datechange($event)\" name=\"daterange\" [readonly]=\"true\" />\r\n</div>\r\n<div class=\"position-relative\">\r\n <button type=\"button\" (click)=\"opendropdown($event)\" class=\"btn btn-default mx-2 rounded-3 text-nowrap border-val\">\r\n <!-- <span class=\"me-2\">Filter</span> -->\r\n <svg class=\"pl-3\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\r\n <path d=\"M5 10H15M2.5 5H17.5M7.5 15H12.5\" stroke=\"#344054\" stroke-width=\"2\" stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\" />\r\n </svg>\r\n </button>\r\n\r\n <div *ngIf=\"Opendropdown\" class=\"card p-5 dropdown1 position-absolute z-1 end-0\" style=\"z-index: 1 !important;\" (clickOutside)=\"closeDropdown1()\">\r\n <div class=\"dropdown-title d-flex justify-content-between mb-2\">Filter Options\r\n <button class=\"btn btn-outline w-25 ms-3 btn-resize\" (click)=\"Reset()\"> Reset </button>\r\n <button class=\"btn btn-primary w-25 btn-resize\" (click)=\"Apply()\">Apply</button>\r\n </div>\r\n\r\n <!-- Location Dropdown -->\r\n<div class=\"dropdown-container\" (clickOutside)=\"closeDropdown()\">\r\n <div class=\"dropdown-header\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control dropdown-input cursor-pointer\" \r\n [value]=\"selectedLocationsLabel()\"\r\n (focus)=\"toggleDropdown('location')\" \r\n readonly\r\n placeholder=\"Select locations...\"\r\n />\r\n </div>\r\n <div class=\"dropdown-menu custom-dropdown-menu\" *ngIf=\"dropdownOpen === 'location'\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control mb-2 dropdown-search\" \r\n placeholder=\"Search locations...\" \r\n [(ngModel)]=\"searchLocationText\" \r\n (ngModelChange)=\"filterLocations()\" \r\n />\r\n <div class=\"form-check mb-2 dropdown-item custom-dropdown-item\">\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n id=\"selectAllLocations\" \r\n [checked]=\"isAllLocationsSelected()\" \r\n (change)=\"toggleSelectAllLocations($event)\" \r\n />\r\n <label class=\"form-check-label\" for=\"selectAllLocations\">\r\n Select All Locations\r\n </label>\r\n </div>\r\n <div \r\n class=\"dropdown-item form-check custom-dropdown-item\" \r\n *ngFor=\"let location of filteredLocations\"\r\n >\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n [id]=\"location.city\" \r\n [(ngModel)]=\"location.checked\"\r\n (change)=\"updateSelectedLocations()\" \r\n />\r\n <label class=\"form-check-label\" [for]=\"location.city\">\r\n {{ location.city }}\r\n </label>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<!-- Group Dropdown -->\r\n<div class=\"dropdown-container mt-3\" (clickOutside)=\"closeDropdown()\">\r\n <div class=\"dropdown-header\" (click)=\"toggleDropdown('group')\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control dropdown-input cursor-pointer\" \r\n [value]=\"selectedGroupsLabel()\" readonly\r\n placeholder=\"Select clusters..\"\r\n />\r\n </div>\r\n <div class=\"dropdown-menu custom-dropdown-menu\" *ngIf=\"dropdownOpen === 'group'\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control mb-2 dropdown-search\" \r\n placeholder=\"Search clusters...\" \r\n [(ngModel)]=\"searchGroupText\" \r\n (ngModelChange)=\"filterGroups()\" \r\n />\r\n <div class=\"form-check mb-2 dropdown-item custom-dropdown-item\">\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n id=\"selectAllGroups\" \r\n [checked]=\"isAllGroupsSelected()\" \r\n (change)=\"toggleSelectAllGroups($event)\" \r\n />\r\n <label class=\"form-check-label\" for=\"selectAllGroups\">\r\n Select All\r\n </label>\r\n </div>\r\n <div \r\n class=\"dropdown-item form-check custom-dropdown-item\" \r\n *ngFor=\"let group of filteredGroups\"\r\n >\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n [id]=\"group.groupName\"\r\n [(ngModel)]=\"group.checked\"\r\n (change)=\"updateSelectedGroups()\" \r\n />\r\n <label class=\"form-check-label\" [for]=\"group.groupName\">\r\n {{ group.groupName }}\r\n </label>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n\r\n<!-- Store Dropdown -->\r\n<div class=\"dropdown-container mt-3\" (clickOutside)=\"closeDropdown()\">\r\n <div class=\"dropdown-header\" (click)=\"toggleDropdown('store')\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control dropdown-input cursor-pointer\"\r\n [value]=\"selectedStoresLabel()\"\r\n readonly\r\n placeholder=\"Select stores...\"\r\n />\r\n </div>\r\n <div class=\"dropdown-menu custom-dropdown-menu\" *ngIf=\"dropdownOpen === 'store'\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control mb-2 dropdown-search \" \r\n placeholder=\"Search stores...\" \r\n [(ngModel)]=\"searchStoreText\" \r\n (ngModelChange)=\"filterStores()\" \r\n />\r\n <div class=\"form-check mb-2 dropdown-item custom-dropdown-item\">\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n id=\"selectAllStores\" \r\n [checked]=\"isAllStoresSelected()\" \r\n (change)=\"toggleSelectAllStores($event)\" \r\n />\r\n <label class=\"form-check-label\" for=\"selectAllStores\">\r\n Select All\r\n </label>\r\n </div>\r\n <div \r\n class=\"dropdown-item form-check custom-dropdown-item\" \r\n *ngFor=\"let store of filteredStores\"\r\n >\r\n <input \r\n class=\"form-check-input\" \r\n type=\"checkbox\" \r\n [id]=\"store.storeId\"\r\n [(ngModel)]=\"store.checked\"\r\n (change)=\"updateSelectedStores()\" \r\n />\r\n <label class=\"form-check-label\" [for]=\"store.storeId\">\r\n {{ store.storeName }}\r\n </label>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n </div>\r\n</div>", styles: [".daterangepicker{display:block!important;top:153.85px!important;left:900px!important;right:0}.form-control{color:var(--Gray-700, #344054)!important;font-size:14px!important;font-weight:600;line-height:20px;text-transform:capitalize}::ng-deep .applyBtn{display:none!important}:host::ng-deep .md-drppicker .btn{line-height:10px!important}:host::ng-deep .daterangepicker-input+.ngx-daterangepicker-material .applyBtn{display:none}:host::ng-deep .md-drppicker.drops-down-right.ltr.double.show-ranges.shown{top:65px!important;left:-470px!important;height:365px!important}:host::ng-deep .md-drppicker .btn{border-radius:8px!important;border:1px solid var(--Primary-600, #00A3FF)!important;background:var(--Primary-600, #00A3FF)!important;box-shadow:0 1px 2px #1018280d!important;color:var(--White, #FFF)!important;font-size:14px!important;font-weight:600!important;line-height:20px;text-transform:capitalize}:host::ng-deep .md-drppicker .ranges ul li button{padding:12px 16px;width:160px;color:var(--Gray-700, #344054);font-size:14px;font-weight:400;line-height:20px;background:none;border:none;text-align:left;cursor:pointer}:host::ng-deep .md-drppicker td.active,:host::ng-deep .md-drppicker td.active:hover{background-color:#029cf4!important;border-radius:20px!important;color:var(--White, #FFF)!important;text-align:center!important;font-size:14px!important;font-weight:500!important;line-height:20px}:host::ng-deep .md-drppicker.ltr .ranges{float:left;margin-top:10px!important}:host::ng-deep .md-drppicker td.in-range{background:var(--Primary-50, #EAF8FF)}:host::ng-deep .md-drppicker .ranges ul li button.active{background:var(--Primary-50, #EAF8FF)!important;border-radius:8px!important;color:var(--Primary-700, #009BF3);font-size:14px!important;font-weight:500!important;line-height:20px!important}:host::ng-deep table th,:host::ng-deep table td{width:40px!important;height:40px!important;padding:10px 8px!important}:host::ng-deep .md-drppicker td.available.prev,:host::ng-deep .md-drppicker th.available.prev{background-image:url(data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMy43IDYiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDMuNyA2IiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxnPg0KCTxwYXRoIGQ9Ik0zLjcsMC43TDEuNCwzbDIuMywyLjNMMyw2TDAsM2wzLTNMMy43LDAuN3oiLz4NCjwvZz4NCjwvc3ZnPg0K)!important;background-repeat:no-repeat!important;background-size:.5em!important;background-position:center!important}:host::ng-deep .md-drppicker td.available.next,:host::ng-deep .md-drppicker th.available.next{background-image:url(data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMy43IDYiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDMuNyA2IiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxnPg0KCTxwYXRoIGQ9Ik0zLjcsMC43TDEuNCwzbDIuMywyLjNMMyw2TDAsM2wzLTNMMy43LDAuN3oiLz4NCjwvZz4NCjwvc3ZnPg0K)!important;background-repeat:no-repeat!important;background-size:.5em!important;background-position:center!important}:host::ng-deep table th{border-bottom:0px solid var(--Gray-200, #EAECF0)!important;background:transparent!important;color:var(--Gray-700, #344054)!important;text-align:center;font-size:16px!important;font-weight:500!important;line-height:24px}:host::ng-deep .md-drppicker .btn.btn-default{border-radius:8px!important;border:1px solid var(--Gray-300, #D0D5DD)!important;background:var(--White, #FFF)!important;box-shadow:0 1px 2px #1018280d!important;color:var(--Gray-700, #344054)!important;font-size:14px!important;font-weight:600!important;line-height:20px;text-transform:capitalize;margin-right:10px!important}:host::ng-deep .md-drppicker td.available.invalid-date{text-decoration:line-through;pointer-events:none;color:#a9a9a9}:host::ng-deep .md-drppicker td.available.today:not(.invalid-date){text-decoration:unset;pointer-events:unset;color:unset}.wrapper{min-width:200px}.btn-primary{line-height:18px!important}.filter-label{color:var(--Gray-500, #667085)!important;font-size:14px;font-style:normal;font-weight:600;line-height:20px;text-transform:capitalize}.position-relative{position:relative}.filter-icon{cursor:pointer}.dropdown-container{position:relative;display:inline-block;width:100%}.dropdown-header{cursor:pointer;width:100%}.form-control{color:var(--Gray-700, #344054)!important;font-size:14px!important;font-weight:600;line-height:20px;text-transform:capitalize;width:100%;box-sizing:border-box}.dropdown-menu{position:absolute;top:100%;left:0;right:0;border:1px solid #ccc;background-color:#fff;z-index:1000;max-height:230px;overflow-y:auto;display:block;box-sizing:border-box;padding:10px 5px}.dropdown-item{padding:6px 0}.dropdown-item:hover{background-color:#f1f1f1}.dropdown-item input[type=checkbox]{margin-right:10px}.custom-dropdown-menu{border-radius:4px;box-shadow:0 1px 2px #1018280d}.custom-dropdown-item{display:flex;align-items:center}.custom-dropdown-item input{margin-left:10px}.btn-resize{font-size:13px!important;height:29px!important;line-height:11px!important;padding:3px!important}.dropdown1{position:absolute;top:70px;min-width:270px!important}.dropdown1 .dropdown-title{color:var(--Gray-900, #101828);font-size:14px;font-weight:600;line-height:24px}.dropdown1 .dropdown{position:relative;display:inline-block}.dropdown1 .dropdown span{color:var(--Gray-700, #344054);font-size:14px;font-weight:600;line-height:20px}::ng-deep .dropdown1{z-index:1!important}.form-check-label{color:var(--Gray-700, #344054)!important;font-size:14px;font-style:normal;font-weight:500;line-height:20px}input[type=checkbox]{width:16px!important;height:16px!important;margin:0 5px;border-radius:4px!important;-webkit-appearance:none;-moz-appearance:none;-o-appearance:none;appearance:none;outline:1px solid var(--gray-300, #D0D5DD);box-shadow:none;font-size:.8em;text-align:center;line-height:1em;background:#fff}input[type=checkbox]:checked{outline:1px solid var(--primary-600, #00A3FF);background-color:var(--primary-50, #EAF8FF)}input[type=checkbox]:checked:after{content:\"\";transform:rotate(45deg);border-bottom:2px solid #00A3FF;border-right:2px solid #00A3FF;display:inline-block;width:.2em;padding-left:0;padding-top:9px;padding-right:4px}\n"] }]
|
|
6398
|
+
}], ctorParameters: () => [{ type: AuthService }, { type: i2.Router }, { type: i1.GlobalStateService }, { type: i0.ChangeDetectorRef }], propDecorators: { onClick: [{
|
|
6399
|
+
type: HostListener,
|
|
6400
|
+
args: ['document:click', ['$event']]
|
|
6401
|
+
}], clickOutside: [{
|
|
6402
|
+
type: HostListener,
|
|
6403
|
+
args: ["document:click", ["$event"]]
|
|
6404
|
+
}] } });
|
|
6405
|
+
|
|
6406
|
+
class ToolbarComponent {
|
|
6407
|
+
layout;
|
|
6408
|
+
router;
|
|
6409
|
+
route;
|
|
6410
|
+
gs;
|
|
6411
|
+
unsubscribe = [];
|
|
6412
|
+
// Public props
|
|
6413
|
+
currentLayoutType;
|
|
6414
|
+
appToolbarLayout;
|
|
6415
|
+
// toolbar
|
|
6416
|
+
appToolbarDisplay;
|
|
6417
|
+
appToolbarContainer;
|
|
6418
|
+
appToolbarContainerCSSClass = "";
|
|
6419
|
+
appToolbarFixedDesktop;
|
|
6420
|
+
appToolbarFixedMobile;
|
|
6421
|
+
appPageTitleDisplay;
|
|
6422
|
+
// page title
|
|
6423
|
+
appPageTitleDirection = "";
|
|
6424
|
+
appPageTitleCSSClass = "";
|
|
6425
|
+
appPageTitleBreadcrumb;
|
|
6426
|
+
appPageTitleDescription;
|
|
6427
|
+
querParams;
|
|
6428
|
+
singleSelect;
|
|
6429
|
+
multiSelect;
|
|
6430
|
+
datepicker;
|
|
6431
|
+
singleSelectdatepicker;
|
|
6432
|
+
singleStore;
|
|
6433
|
+
headervalue;
|
|
6434
|
+
storeId;
|
|
6435
|
+
users;
|
|
6436
|
+
selectedFilters = {
|
|
6437
|
+
client: null,
|
|
6438
|
+
clients: [],
|
|
6439
|
+
store: null,
|
|
6440
|
+
stores: [],
|
|
6441
|
+
date: null,
|
|
6442
|
+
};
|
|
6443
|
+
trafficdatepicker;
|
|
6444
|
+
traxdatepicker;
|
|
6445
|
+
urlString;
|
|
6446
|
+
traxwithoutdatepicker;
|
|
6447
|
+
storesSingle;
|
|
6448
|
+
nobWithoutClient;
|
|
6449
|
+
constructor(layout, router, route, gs) {
|
|
6450
|
+
this.layout = layout;
|
|
6451
|
+
this.router = router;
|
|
6452
|
+
this.route = route;
|
|
6453
|
+
this.gs = gs;
|
|
6454
|
+
}
|
|
6455
|
+
ngOnInit() {
|
|
6456
|
+
if ("user-info" in localStorage) {
|
|
6457
|
+
const userData = JSON.parse(localStorage.getItem("user-info") || "{}");
|
|
6458
|
+
this.users = userData;
|
|
6459
|
+
}
|
|
6460
|
+
this.showPageTitle();
|
|
6461
|
+
const subscr = this.layout.layoutConfigSubject
|
|
6462
|
+
.asObservable()
|
|
6463
|
+
.subscribe((config) => {
|
|
6464
|
+
this.updateProps(config);
|
|
6465
|
+
});
|
|
6466
|
+
this.unsubscribe.push(subscr);
|
|
6467
|
+
}
|
|
6468
|
+
updateProps(config) {
|
|
6469
|
+
this.appToolbarDisplay = this.layout.getProp("app.toolbar.display", config);
|
|
6470
|
+
if (!this.appToolbarDisplay) {
|
|
6471
|
+
return;
|
|
6472
|
+
}
|
|
6473
|
+
this.appPageTitleDisplay = this.layout.getProp("app.pageTitle.display", config);
|
|
6474
|
+
this.appToolbarContainer = this.layout.getProp("app.toolbar.container", config);
|
|
6475
|
+
this.appToolbarContainerCSSClass =
|
|
6476
|
+
this.appToolbarContainer === "fixed"
|
|
6477
|
+
? "container-xxl"
|
|
6478
|
+
: "container-fluid";
|
|
6479
|
+
const containerClass = this.layout.getProp("app.toolbar.containerClass", config);
|
|
6480
|
+
if (containerClass) {
|
|
6481
|
+
this.appToolbarContainerCSSClass += ` ${containerClass}`;
|
|
6482
|
+
}
|
|
6483
|
+
this.appToolbarFixedDesktop = this.layout.getProp("app.toolbar.fixed.desktop", config);
|
|
6484
|
+
if (this.appToolbarFixedDesktop) {
|
|
6485
|
+
document.body.setAttribute("data-kt-app-toolbar-fixed", "true");
|
|
6486
|
+
}
|
|
6487
|
+
this.appToolbarFixedMobile = this.layout.getProp("app.toolbar.fixed.mobile", config);
|
|
6488
|
+
if (this.appToolbarFixedMobile) {
|
|
6489
|
+
document.body.setAttribute("data-kt-app-toolbar-fixed-mobile", "true");
|
|
6490
|
+
}
|
|
6491
|
+
// toolbar
|
|
6492
|
+
this.appPageTitleDirection = this.layout.getProp("app.pageTitle.direction", config);
|
|
6493
|
+
this.appPageTitleCSSClass = this.layout.getProp("app.pageTitle.class", config);
|
|
6494
|
+
this.appPageTitleBreadcrumb = this.layout.getProp("app.pageTitle.breadCrumb", config);
|
|
6495
|
+
this.appPageTitleDescription = this.layout.getProp("app.pageTitle.description", config);
|
|
6496
|
+
document.body.setAttribute("data-kt-app-toolbar-enabled", "true");
|
|
6497
|
+
}
|
|
6498
|
+
destroy$ = new Subject();
|
|
6499
|
+
ngOnDestroy() {
|
|
6500
|
+
this.unsubscribe.forEach((sb) => sb.unsubscribe());
|
|
6501
|
+
this.destroy$.next(true);
|
|
6502
|
+
this.destroy$.complete();
|
|
6503
|
+
}
|
|
6504
|
+
showPageTitle() {
|
|
6505
|
+
let URL = "";
|
|
6506
|
+
if ("header-filters" in localStorage) {
|
|
6507
|
+
const data = JSON.parse(localStorage.getItem("header-filters") || "{}");
|
|
6508
|
+
const store = this.route.snapshot.queryParamMap;
|
|
6509
|
+
this.storeId = data?.store;
|
|
6510
|
+
if (store?.params?.['storeId']) {
|
|
6511
|
+
this.storeId = store.params['storeId'];
|
|
6512
|
+
data.store = store.params['storeId'];
|
|
6513
|
+
localStorage.setItem('header-filters', JSON.stringify(data));
|
|
6514
|
+
}
|
|
6515
|
+
const currentUrl = this.router.url;
|
|
6516
|
+
const updatedUrl = currentUrl.replace(/\/manage\/stores\/\d+-\d+\//, `/manage/stores/`);
|
|
6517
|
+
URL = updatedUrl;
|
|
6518
|
+
// this.router.navigate([URL])
|
|
6519
|
+
}
|
|
6520
|
+
const url = URL.split("?")[0].split('/');
|
|
6521
|
+
this.urlString = URL;
|
|
6522
|
+
if (this.users?.userType === "tango") {
|
|
6523
|
+
if (url[2] == "settings" || URL == "/manage/users/client" ||
|
|
6524
|
+
URL == "/manage/stores" || URL === "/manage/stores?type=stores" || URL === "/manage/stores?type=clusters" ||
|
|
6525
|
+
URL == "/manage/stores/addition-method" ||
|
|
6526
|
+
URL == "/manage/stores/add-single-store" || URL === "/manage/trax/gallery" || URL == "/notifications/alerts?tab=alert" || URL == "/notifications/alerts?tab=download") {
|
|
6527
|
+
this.setUIProperties(true, false, false, false, false, false, false, false, false, false);
|
|
6528
|
+
}
|
|
6529
|
+
else if (url[3] == "edge-app") {
|
|
6530
|
+
this.setUIProperties(false, false, false, false, true, false, false, false, false, false);
|
|
6531
|
+
}
|
|
6532
|
+
else if (URL == `/manage/stores/infra-ticket?storeId=${this.storeId}` || URL == `/manage/stores/infra-ticket?storeId=${this.storeId}&type=infra` ||
|
|
6533
|
+
URL == `/manage/stores/settings?storeId=${this.storeId}` || URL == `/manage/stores/infra-ticket?storeId=${this.storeId}&type=dataMismatch` ||
|
|
6534
|
+
URL == `/manage/stores/zones?storeId=${this.storeId}` ||
|
|
6535
|
+
URL == `/manage/stores/cameras?storeId=${this.storeId}` ||
|
|
6536
|
+
// URL == `/manage/stores/infrastructure?storeId=${this.storeId}` ||
|
|
6537
|
+
URL == `/manage/stores/mat?storeId=${this.storeId}`) {
|
|
6538
|
+
this.setUIProperties(false, false, false, true, false, false, false, false, false, false);
|
|
6539
|
+
}
|
|
6540
|
+
else if (url[2] === 'controlcenter') {
|
|
6541
|
+
if (URL == `/manage/controlcenter/playback?storeId=${this.storeId}` || URL == `/manage/controlcenter/playback`) {
|
|
6542
|
+
this.setUIProperties(false, false, false, false, false, false, false, false, true, false);
|
|
6543
|
+
}
|
|
6544
|
+
else {
|
|
6545
|
+
this.setUIProperties(false, false, false, false, true, false, false, false, false, false);
|
|
6546
|
+
}
|
|
6547
|
+
}
|
|
6548
|
+
else if (URL == "/profile" || url[2] === "data-mismatch" || url[2] === "employeetraining"
|
|
6549
|
+
|| URL == "/manage/brands" || URL == "/manage/users/tango" || (url[1] === "tickets" && url[2] === "audit")) {
|
|
6550
|
+
this.setUIProperties(false, false, false, false, false, false, false, false, false, false);
|
|
6551
|
+
}
|
|
6552
|
+
else if (URL == "/manage/traffic/nob") {
|
|
6553
|
+
this.setUIProperties(false, false, false, false, false, false, false, false, false, true);
|
|
6554
|
+
}
|
|
6555
|
+
else if (url[2] === "traffic" || url[2] === "zones" || URL == "/manage/analyse/reports") {
|
|
6556
|
+
this.setUIProperties(false, false, false, false, false, true, false, false, false, false);
|
|
6557
|
+
}
|
|
6558
|
+
else if (url[2] == 'trax') {
|
|
6559
|
+
if (url[2] == 'trax' && (url.includes('createChecklist') || url.includes('configure') || url.includes('create-order') || url[3] == 'create-task' || url[3] == 'task-configure')) {
|
|
6560
|
+
this.setUIProperties(false, false, false, false, false, false, false, false, false, false);
|
|
6561
|
+
}
|
|
6562
|
+
else if (url[2] == 'trax' && (url.includes('taskinfo'))) {
|
|
6563
|
+
this.setUIProperties(false, false, false, false, false, false, false, true, false, false);
|
|
6564
|
+
}
|
|
6565
|
+
else if (url[2] == 'trax' && (url.includes('checklist') || url.includes('gallery'))) {
|
|
6566
|
+
this.setUIProperties(true, false, false, false, false, false, false, false, false, false);
|
|
6567
|
+
}
|
|
6568
|
+
else {
|
|
6569
|
+
this.setUIProperties(false, false, false, false, false, false, true, false, false, false);
|
|
6570
|
+
}
|
|
6571
|
+
}
|
|
6572
|
+
else {
|
|
6573
|
+
this.setUIProperties(false, false, false, false, true, false, false, false, false, false);
|
|
6574
|
+
}
|
|
6575
|
+
}
|
|
6576
|
+
else {
|
|
6577
|
+
if (url[3] == "edge-app") {
|
|
6578
|
+
this.setUIProperties(false, false, true, false, false, false, false, false, false, false);
|
|
6579
|
+
}
|
|
6580
|
+
else if (URL == `/manage/stores/infra-ticket?storeId=${this.storeId}` || URL == `/manage/stores/infra-ticket?storeId=${this.storeId}&type=infra` ||
|
|
6581
|
+
URL == `/manage/stores/settings?storeId=${this.storeId}` || URL == `/manage/stores/infra-ticket?storeId=${this.storeId}&type=dataMismatch` ||
|
|
6582
|
+
URL == `/manage/stores/zones?storeId=${this.storeId}` ||
|
|
6583
|
+
URL == `/manage/stores/cameras?storeId=${this.storeId}` ||
|
|
6584
|
+
// URL == `/manage/stores/infrastructure?storeId=${this.storeId}` ||
|
|
6585
|
+
URL == `/manage/stores/mat?storeId=${this.storeId}`) {
|
|
6586
|
+
this.setUIProperties(false, false, false, true, false, false, false, false, false, false);
|
|
6587
|
+
}
|
|
6588
|
+
else if (url[2] === 'controlcenter') {
|
|
6589
|
+
if (URL == `/manage/controlcenter/playback?storeId=${this.storeId}` || URL == `/manage/controlcenter/playback`) {
|
|
6590
|
+
this.setUIProperties(false, false, false, false, false, false, false, false, true, false);
|
|
6591
|
+
}
|
|
6592
|
+
else {
|
|
6593
|
+
this.setUIProperties(false, false, false, false, true, false, false, false, false, false);
|
|
6594
|
+
}
|
|
6595
|
+
}
|
|
6596
|
+
else if (URL == "/profile" || URL == "/manage/users/client" || URL == "/manage/users/tango" ||
|
|
6597
|
+
URL == "/manage/stores" || URL === "/manage/stores?type=stores" || URL === "/manage/stores?type=clusters" || url[2] == "settings" ||
|
|
6598
|
+
URL == "/manage/stores/addition-method" ||
|
|
6599
|
+
URL == "/manage/stores/add-single-store" || url[2] === "data-mismatch" || url[2] === "employeetraining" || URL == "/notifications/alerts?tab=alert" || URL == "/notifications/alerts?tab=download"
|
|
6600
|
+
|| URL == "/manage/users/tango" || URL === "/manage/controlcenter" || URL === 'manage/controlcenter/template-manager' || url[2] === 'controlcenter') {
|
|
6601
|
+
this.setUIProperties(false, false, false, false, false, false, false, false, false, false);
|
|
6602
|
+
}
|
|
6603
|
+
else if (URL == "/manage/traffic/nob") {
|
|
6604
|
+
this.setUIProperties(false, false, false, false, false, false, false, false, false, true);
|
|
5820
6605
|
}
|
|
5821
6606
|
else if (url[2] === "traffic" || url[2] === "zones" || URL == "/manage/analyse/reports") {
|
|
5822
|
-
this.setUIProperties(false, false, false, false, false, true, false, false, false);
|
|
6607
|
+
this.setUIProperties(false, false, false, false, false, true, false, false, false, false);
|
|
5823
6608
|
}
|
|
5824
6609
|
else if (url[2] == 'trax') {
|
|
5825
6610
|
if (url[2] == 'trax' && (url.includes('createChecklist') || url.includes('configure') || url.includes('create-order') || url[3] == 'create-task' || url[3] == 'task-configure')) {
|
|
5826
|
-
this.setUIProperties(false, false, false, false, false, false, false, false, false);
|
|
6611
|
+
this.setUIProperties(false, false, false, false, false, false, false, false, false, false);
|
|
5827
6612
|
}
|
|
5828
6613
|
else if (url[2] == 'trax' && (url.includes('taskinfo'))) {
|
|
5829
|
-
this.setUIProperties(false, false, false, false, false, false, false, true, false);
|
|
6614
|
+
this.setUIProperties(false, false, false, false, false, false, false, true, false, false);
|
|
5830
6615
|
}
|
|
5831
6616
|
else if (url[2] == 'trax' && (url.includes('checklist') || url.includes('gallery'))) {
|
|
5832
|
-
this.setUIProperties(true, false, false, false, false, false, false, false, false);
|
|
6617
|
+
this.setUIProperties(true, false, false, false, false, false, false, false, false, false);
|
|
5833
6618
|
}
|
|
5834
6619
|
else {
|
|
5835
|
-
this.setUIProperties(false, false, false, false, false, false, true, false, false);
|
|
6620
|
+
this.setUIProperties(false, false, false, false, false, false, true, false, false, false);
|
|
5836
6621
|
}
|
|
5837
6622
|
}
|
|
5838
6623
|
else {
|
|
5839
|
-
this.setUIProperties(false, false, true, false, false, false, false, false, false);
|
|
6624
|
+
this.setUIProperties(false, false, true, false, false, false, false, false, false, false);
|
|
5840
6625
|
}
|
|
5841
6626
|
}
|
|
5842
6627
|
const viewsWithPageTitles = ["classic", "reports", "saas"];
|
|
5843
6628
|
return (this.appPageTitleDisplay &&
|
|
5844
6629
|
viewsWithPageTitles.some((t) => t === this.appToolbarLayout));
|
|
5845
6630
|
}
|
|
5846
|
-
setUIProperties(singleSelect, multiSelect, datepicker, singleStore, singleSelectdatepicker, trafficdatepicker, traxdatepicker, traxwithoutdatepicker, storesSingle) {
|
|
6631
|
+
setUIProperties(singleSelect, multiSelect, datepicker, singleStore, singleSelectdatepicker, trafficdatepicker, traxdatepicker, traxwithoutdatepicker, storesSingle, nobWithoutClient) {
|
|
5847
6632
|
this.singleSelect = singleSelect;
|
|
5848
6633
|
this.multiSelect = multiSelect;
|
|
5849
6634
|
this.datepicker = datepicker;
|
|
@@ -5853,13 +6638,14 @@ class ToolbarComponent {
|
|
|
5853
6638
|
this.traxdatepicker = traxdatepicker;
|
|
5854
6639
|
this.traxwithoutdatepicker = traxwithoutdatepicker;
|
|
5855
6640
|
this.storesSingle = storesSingle;
|
|
6641
|
+
this.nobWithoutClient = nobWithoutClient;
|
|
5856
6642
|
}
|
|
5857
6643
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ToolbarComponent, deps: [{ token: i1.LayoutService }, { token: i2.Router }, { token: i2.ActivatedRoute }, { token: i1.GlobalStateService }], target: i0.ɵɵFactoryTarget.Component });
|
|
5858
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", 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=\"(gs.userAccess | async)?.userType === 'tango' || (gs.userAccess | async)?.userType === 'client' || (gs.userAccess | async)?.userType === 'lead'\" >\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 && users.userType ==='tango'\">\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 && users.userType ==='tango'\">\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 && users.userType ==='client'\">\r\n <lib-datepicker class=\"d-flex align-items-center me-5\"></lib-datepicker>\r\n </ng-container>\r\n <ng-container *ngIf=\"singleSelectdatepicker && users.userType ==='tango'\">\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=\"trafficdatepicker\">\r\n <lib-traffic-header class=\"d-flex align-items-center me-5\"></lib-traffic-header>\r\n </ng-container>\r\n <ng-container *ngIf=\"traxdatepicker\">\r\n <lib-trax-header class=\"d-flex align-items-center me-5\"></lib-trax-header>\r\n </ng-container>\r\n <ng-container *ngIf=\"traxwithoutdatepicker\">\r\n <lib-trax-withoutdate class=\"d-flex align-items-center me-5\"></lib-trax-withoutdate>\r\n </ng-container>\r\n <ng-container *ngIf=\"storesSingle\">\r\n <lib-single-storedate class=\"d-flex align-items-center me-5\"></lib-single-storedate>\r\n </ng-container>\r\n \r\n \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</ng-container>\r\n</div>\r\n<!--end::Toolbar container-->\r\n", styles: [""], dependencies: [{ kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.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", inputs: ["urlString"] }, { kind: "component", type: TrafficHeaderComponent, selector: "lib-traffic-header" }, { kind: "component", type: TraxHeaderComponent, selector: "lib-trax-header" }, { kind: "component", type: SingleStoredateComponent, selector: "lib-single-storedate" }, { kind: "component", type: TraxWithoutdateComponent, selector: "lib-trax-withoutdate" }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }] });
|
|
6644
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", 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=\"(gs.userAccess | async)?.userType === 'tango' || (gs.userAccess | async)?.userType === 'client' || (gs.userAccess | async)?.userType === 'lead'\" >\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 && users.userType ==='tango'\">\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 && users.userType ==='tango'\">\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 && users.userType ==='client'\">\r\n <lib-datepicker class=\"d-flex align-items-center me-5\"></lib-datepicker>\r\n </ng-container>\r\n <ng-container *ngIf=\"singleSelectdatepicker && users.userType ==='tango'\">\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=\"trafficdatepicker\">\r\n <lib-traffic-header class=\"d-flex align-items-center me-5\"></lib-traffic-header>\r\n </ng-container>\r\n <ng-container *ngIf=\"traxdatepicker\">\r\n <lib-trax-header class=\"d-flex align-items-center me-5\"></lib-trax-header>\r\n </ng-container>\r\n <ng-container *ngIf=\"traxwithoutdatepicker\">\r\n <lib-trax-withoutdate class=\"d-flex align-items-center me-5\"></lib-trax-withoutdate>\r\n </ng-container>\r\n <ng-container *ngIf=\"storesSingle\">\r\n <lib-single-storedate class=\"d-flex align-items-center me-5\"></lib-single-storedate>\r\n </ng-container>\r\n <ng-container *ngIf=\"nobWithoutClient\">\r\n <lib-traffic-nob class=\"d-flex align-items-center me-5\"></lib-traffic-nob>\r\n </ng-container>\r\n \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</ng-container>\r\n</div>\r\n<!--end::Toolbar container-->\r\n", styles: [""], dependencies: [{ kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.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", inputs: ["urlString"] }, { kind: "component", type: TrafficHeaderComponent, selector: "lib-traffic-header" }, { kind: "component", type: TraxHeaderComponent, selector: "lib-trax-header" }, { kind: "component", type: SingleStoredateComponent, selector: "lib-single-storedate" }, { kind: "component", type: TraxWithoutdateComponent, selector: "lib-trax-withoutdate" }, { kind: "component", type: TrafficNobComponent, selector: "lib-traffic-nob" }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }] });
|
|
5859
6645
|
}
|
|
5860
6646
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ToolbarComponent, decorators: [{
|
|
5861
6647
|
type: Component,
|
|
5862
|
-
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=\"(gs.userAccess | async)?.userType === 'tango' || (gs.userAccess | async)?.userType === 'client' || (gs.userAccess | async)?.userType === 'lead'\" >\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 && users.userType ==='tango'\">\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 && users.userType ==='tango'\">\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 && users.userType ==='client'\">\r\n <lib-datepicker class=\"d-flex align-items-center me-5\"></lib-datepicker>\r\n </ng-container>\r\n <ng-container *ngIf=\"singleSelectdatepicker && users.userType ==='tango'\">\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=\"trafficdatepicker\">\r\n <lib-traffic-header class=\"d-flex align-items-center me-5\"></lib-traffic-header>\r\n </ng-container>\r\n <ng-container *ngIf=\"traxdatepicker\">\r\n <lib-trax-header class=\"d-flex align-items-center me-5\"></lib-trax-header>\r\n </ng-container>\r\n <ng-container *ngIf=\"traxwithoutdatepicker\">\r\n <lib-trax-withoutdate class=\"d-flex align-items-center me-5\"></lib-trax-withoutdate>\r\n </ng-container>\r\n <ng-container *ngIf=\"storesSingle\">\r\n <lib-single-storedate class=\"d-flex align-items-center me-5\"></lib-single-storedate>\r\n </ng-container>\r\n \r\n \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</ng-container>\r\n</div>\r\n<!--end::Toolbar container-->\r\n" }]
|
|
6648
|
+
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=\"(gs.userAccess | async)?.userType === 'tango' || (gs.userAccess | async)?.userType === 'client' || (gs.userAccess | async)?.userType === 'lead'\" >\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 && users.userType ==='tango'\">\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 && users.userType ==='tango'\">\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 && users.userType ==='client'\">\r\n <lib-datepicker class=\"d-flex align-items-center me-5\"></lib-datepicker>\r\n </ng-container>\r\n <ng-container *ngIf=\"singleSelectdatepicker && users.userType ==='tango'\">\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=\"trafficdatepicker\">\r\n <lib-traffic-header class=\"d-flex align-items-center me-5\"></lib-traffic-header>\r\n </ng-container>\r\n <ng-container *ngIf=\"traxdatepicker\">\r\n <lib-trax-header class=\"d-flex align-items-center me-5\"></lib-trax-header>\r\n </ng-container>\r\n <ng-container *ngIf=\"traxwithoutdatepicker\">\r\n <lib-trax-withoutdate class=\"d-flex align-items-center me-5\"></lib-trax-withoutdate>\r\n </ng-container>\r\n <ng-container *ngIf=\"storesSingle\">\r\n <lib-single-storedate class=\"d-flex align-items-center me-5\"></lib-single-storedate>\r\n </ng-container>\r\n <ng-container *ngIf=\"nobWithoutClient\">\r\n <lib-traffic-nob class=\"d-flex align-items-center me-5\"></lib-traffic-nob>\r\n </ng-container>\r\n \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</ng-container>\r\n</div>\r\n<!--end::Toolbar container-->\r\n" }]
|
|
5863
6649
|
}], ctorParameters: () => [{ type: i1.LayoutService }, { type: i2.Router }, { type: i2.ActivatedRoute }, { type: i1.GlobalStateService }], propDecorators: { currentLayoutType: [{
|
|
5864
6650
|
type: Input
|
|
5865
6651
|
}], appToolbarLayout: [{
|
|
@@ -8009,7 +8795,8 @@ class LayoutModule {
|
|
|
8009
8795
|
TraxHeaderComponent,
|
|
8010
8796
|
SingleStoredateComponent,
|
|
8011
8797
|
StoresingleComponent,
|
|
8012
|
-
TraxWithoutdateComponent
|
|
8798
|
+
TraxWithoutdateComponent,
|
|
8799
|
+
TrafficNobComponent], imports: [CommonModule, i2.RouterModule, TranslationModule,
|
|
8013
8800
|
InlineSVGModule,
|
|
8014
8801
|
NgbDropdownModule,
|
|
8015
8802
|
NgbProgressbarModule,
|
|
@@ -8076,7 +8863,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
|
|
|
8076
8863
|
TraxHeaderComponent,
|
|
8077
8864
|
SingleStoredateComponent,
|
|
8078
8865
|
StoresingleComponent,
|
|
8079
|
-
TraxWithoutdateComponent
|
|
8866
|
+
TraxWithoutdateComponent,
|
|
8867
|
+
TrafficNobComponent
|
|
8080
8868
|
],
|
|
8081
8869
|
imports: [
|
|
8082
8870
|
CommonModule,
|