application-sidebar 1.0.41 → 2.0.0
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/app-details.mjs +1 -1
- package/esm2022/lib/application-sidebar.component.mjs +839 -88
- package/esm2022/lib/nav-menu-item.mjs +1 -1
- package/esm2022/lib/nav-menus/nav-menus.component.mjs +33 -9
- package/esm2022/lib/navmenu1.mjs +263 -216
- package/esm2022/lib/revised-navigation.mjs +2 -0
- package/esm2022/lib/services/application-sidebar.service.mjs +305 -8
- package/esm2022/lib/services/rest-api.services.mjs +39 -6
- package/esm2022/lib/sidebar-layout.local.mjs +86 -0
- package/esm2022/lib/translations/translations-en.mjs +57 -31
- package/esm2022/public-api.mjs +2 -1
- package/fesm2022/application-sidebar.mjs +3031 -135
- package/fesm2022/application-sidebar.mjs.map +1 -1
- package/lib/app-details.d.ts +2 -0
- package/lib/application-sidebar.component.d.ts +132 -1
- package/lib/nav-menu-item.d.ts +7 -0
- package/lib/navmenu1.d.ts +146 -77
- package/lib/revised-navigation.d.ts +83 -0
- package/lib/services/application-sidebar.service.d.ts +49 -1
- package/lib/services/rest-api.services.d.ts +12 -0
- package/lib/sidebar-layout.local.d.ts +19 -0
- package/lib/translations/translations-en.d.ts +53 -27
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
package/lib/app-details.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { RevisedNavigationConfig } from './revised-navigation';
|
|
1
2
|
export interface appDetails {
|
|
2
3
|
applicationId: string;
|
|
3
4
|
currentOrganization?: any;
|
|
@@ -10,4 +11,5 @@ export interface appDetails {
|
|
|
10
11
|
sidebarInfo: any;
|
|
11
12
|
listMenus: any;
|
|
12
13
|
appSet: boolean;
|
|
14
|
+
revisedNavigation?: RevisedNavigationConfig;
|
|
13
15
|
}
|
|
@@ -10,6 +10,8 @@ import { NavMenusComponent } from './nav-menus/nav-menus.component';
|
|
|
10
10
|
import { CookieService } from 'ngx-cookie-service';
|
|
11
11
|
import { TranslationService } from './services/translation.service';
|
|
12
12
|
import { MixpanelService } from './services/mixpanel.service';
|
|
13
|
+
import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
|
|
14
|
+
import { RevisedAppTabsSection, RevisedIntelligenceGroup, RevisedNavMenuItem, RevisedNavigationState, RevisedSection } from './revised-navigation';
|
|
13
15
|
import * as i0 from "@angular/core";
|
|
14
16
|
export declare class ApplicationSidebarComponent implements OnInit, OnDestroy {
|
|
15
17
|
navigation: ApplicationSidebarService;
|
|
@@ -19,6 +21,7 @@ export declare class ApplicationSidebarComponent implements OnInit, OnDestroy {
|
|
|
19
21
|
private cdref;
|
|
20
22
|
private translation;
|
|
21
23
|
private mixpanel;
|
|
24
|
+
private sanitizer;
|
|
22
25
|
applicationDetails: appDetails;
|
|
23
26
|
sidenav: MatSidenav;
|
|
24
27
|
listItems: QueryList<OffsetTopDirective>;
|
|
@@ -32,12 +35,14 @@ export declare class ApplicationSidebarComponent implements OnInit, OnDestroy {
|
|
|
32
35
|
adminRoles: string[];
|
|
33
36
|
currentApp: any;
|
|
34
37
|
sideNavStatusSubscription: any;
|
|
38
|
+
sideNavClosedStartSubscription: any;
|
|
35
39
|
myObserver: any;
|
|
36
40
|
expandGlobalSettings: any;
|
|
37
41
|
inContextInsightsWLApp: boolean;
|
|
38
42
|
themePoint: string;
|
|
39
43
|
showTitle: boolean;
|
|
40
|
-
|
|
44
|
+
private revisedSectionIconCache;
|
|
45
|
+
constructor(navigation: ApplicationSidebarService, router: Router, RestApiService: RestApiService, cookie: CookieService, cdref: ChangeDetectorRef, translation: TranslationService, mixpanel: MixpanelService, sanitizer: DomSanitizer);
|
|
41
46
|
/**
|
|
42
47
|
* Determines the theme point based on the current domain
|
|
43
48
|
* Uses STAGING_THEME_POINT for local, heroku, or apptest domains
|
|
@@ -77,6 +82,18 @@ export declare class ApplicationSidebarComponent implements OnInit, OnDestroy {
|
|
|
77
82
|
toDisplayApplications: any[];
|
|
78
83
|
toDisplayGlobalSettingsMenu: any[];
|
|
79
84
|
toDisplayLinkMenu: any[];
|
|
85
|
+
revisedNavigationState: RevisedNavigationState;
|
|
86
|
+
revisedSections: RevisedSection[];
|
|
87
|
+
revisedSectionState: {
|
|
88
|
+
[sectionId: string]: boolean;
|
|
89
|
+
};
|
|
90
|
+
/** Group-level expansion (key: sectionId_groupId). Only for grouped-menus with a group title. */
|
|
91
|
+
revisedGroupExpandedState: {
|
|
92
|
+
[sectionId_groupId: string]: boolean;
|
|
93
|
+
};
|
|
94
|
+
revisedSelectedAppBySection: {
|
|
95
|
+
[sectionId: string]: string;
|
|
96
|
+
};
|
|
80
97
|
errorMsg: string;
|
|
81
98
|
ngOnInit(): void;
|
|
82
99
|
calculateLeftnavStatus(): void;
|
|
@@ -86,9 +103,122 @@ export declare class ApplicationSidebarComponent implements OnInit, OnDestroy {
|
|
|
86
103
|
private setMenuList;
|
|
87
104
|
menuClicked(obj: any): void;
|
|
88
105
|
expandChildMenuOnly(toDisplayGlobalSettingsMenu: any): void;
|
|
106
|
+
/**
|
|
107
|
+
* Opens each Global Settings head panel when the current URL matches that panel’s menu tree
|
|
108
|
+
* (any depth). Used on sidenav open and after menu data refresh.
|
|
109
|
+
*/
|
|
110
|
+
private syncGlobalSettingsPanelOpenToActiveRoute;
|
|
89
111
|
expandCurrentMenuOnly(applicationDetails: any, onMenuClicked: any): void;
|
|
90
112
|
getTooltipInfo(headmenu: any): any;
|
|
91
113
|
selectedApplication(headmenu: any): any;
|
|
114
|
+
isRevisedNavigationEnabled(): boolean;
|
|
115
|
+
isLegacyNavigationEnabled(): boolean;
|
|
116
|
+
onRevisedSectionHeaderClick(sectionId: string): void;
|
|
117
|
+
isRevisedSectionExpanded(sectionId: string): boolean;
|
|
118
|
+
/** True when any menu under this section matches the current route (e.g. collapsed rail active indicator). */
|
|
119
|
+
isRevisedSectionActive(section: RevisedSection): boolean;
|
|
120
|
+
getRevisedSectionIcon(section: RevisedSection): SafeHtml | string;
|
|
121
|
+
isRevisedAppTabsSection(section: RevisedSection): section is RevisedAppTabsSection;
|
|
122
|
+
getRevisedSectionApps(section: RevisedSection): RevisedNavMenuItem[];
|
|
123
|
+
getRevisedGroupedSectionGroups(section: RevisedSection): RevisedIntelligenceGroup[];
|
|
124
|
+
/** JSON `groups[]` row: optional flat list with no group title */
|
|
125
|
+
isRevisedUntitledGroup(group: RevisedIntelligenceGroup): boolean;
|
|
126
|
+
/** JSON `groups[]` row: one menu item under a titled group (e.g. FOUNDATION rows) */
|
|
127
|
+
isRevisedSingleItemGroup(group: RevisedIntelligenceGroup): boolean;
|
|
128
|
+
/** JSON `groups[]` row: titled group with multiple menu roots (e.g. Commerce Insights) */
|
|
129
|
+
isRevisedMultiItemGroup(group: RevisedIntelligenceGroup): boolean;
|
|
130
|
+
hasExpandableMenusInSection(section: RevisedSection): boolean;
|
|
131
|
+
hasExpandableMenusInGroup(group: RevisedIntelligenceGroup): boolean;
|
|
132
|
+
getRevisedSectionSelectedApp(section: RevisedSection): RevisedNavMenuItem;
|
|
133
|
+
isSelectedRevisedSectionApp(section: RevisedSection, app: RevisedNavMenuItem): boolean;
|
|
134
|
+
selectRevisedSectionApp(section: RevisedSection, app: RevisedNavMenuItem, loadDefaultPage?: boolean): void;
|
|
135
|
+
getRevisedSectionMenus(section: RevisedSection): RevisedNavMenuItem[];
|
|
136
|
+
getRevisedSectionTabBadgeCount(app: RevisedNavMenuItem): number | null;
|
|
137
|
+
trackByRevisedSection(index: number, section: RevisedSection): string | number;
|
|
138
|
+
trackByRevisedGroup(index: number, group: RevisedIntelligenceGroup): string | number;
|
|
139
|
+
trackByRevisedMenu(index: number, menu: RevisedNavMenuItem): string | number;
|
|
140
|
+
/** Plain-text app name for Optimize tab tooltips (`left-nav-tooltip`, same as collapsed rail). */
|
|
141
|
+
getRevisedOptimizeAppTabTooltip(app: RevisedNavMenuItem): string | null;
|
|
142
|
+
isRevisedMenuActive(menu: RevisedNavMenuItem): boolean;
|
|
143
|
+
/**
|
|
144
|
+
* Nested submenu (legacy + revised): keep mat-expansion-panel open when the current URL matches
|
|
145
|
+
* any descendant leaf, not only when `activePanel` was set from a sidebar click.
|
|
146
|
+
* Still honors user-open state via `menu.panelOpenState` and click-driven `activePanel`.
|
|
147
|
+
*/
|
|
148
|
+
isChildMenuPanelExpanded(menu: any): boolean;
|
|
149
|
+
/** Highlight styling: active panel or any active descendant. */
|
|
150
|
+
isChildMenuPanelHighlighted(menu: any): boolean;
|
|
151
|
+
onChildMenuPanelHeaderClick(menu: any): void;
|
|
152
|
+
onChildMenuPanelOpened(menu: any): void;
|
|
153
|
+
onChildMenuPanelClosed(menu: any): void;
|
|
154
|
+
getRevisedParentMenuId(menu: RevisedNavMenuItem, fallbackParentId?: string): string;
|
|
155
|
+
getRevisedParentPanelId(menu: RevisedNavMenuItem): string;
|
|
156
|
+
/** Leaf row in `revisedGroupMenuItemShell`: OPTIMIZE (app-tabs) omits panel id; grouped-menus uses `getRevisedParentPanelId`. */
|
|
157
|
+
getRevisedShellLeafParentPanelId(menu: RevisedNavMenuItem, optimizeParentApp?: RevisedNavMenuItem): string | undefined;
|
|
158
|
+
shouldShowRevisedIntelligenceGroupTitle(group: RevisedIntelligenceGroup): boolean;
|
|
159
|
+
private rebuildRevisedNavigationState;
|
|
160
|
+
private buildRevisedGroupExpandedState;
|
|
161
|
+
isRevisedGroupExpanded(sectionId: string, groupId: string): boolean;
|
|
162
|
+
onRevisedGroupHeaderClick(sectionId: string, groupId: string): void;
|
|
163
|
+
onRevisedGroupPanelOpened(sectionId: string, groupId: string): void;
|
|
164
|
+
onRevisedGroupPanelClosed(sectionId: string, groupId: string): void;
|
|
165
|
+
private buildRevisedSectionState;
|
|
166
|
+
private buildRevisedSelectedAppState;
|
|
167
|
+
/**
|
|
168
|
+
* Optimize/app-tabs should stay anchored to the current Angular host app.
|
|
169
|
+
* Sponsored Ads is an AngularJS app and should not drive app-tabs selection/expansion here.
|
|
170
|
+
*/
|
|
171
|
+
private getCurrentOptimizeApp;
|
|
172
|
+
private logOptimizeDebugState;
|
|
173
|
+
private collapseAllRevisedSections;
|
|
174
|
+
/** When the sidenav opens, expand any revised section that owns the current route (and sync app-tabs selection). */
|
|
175
|
+
private expandRevisedSectionsContainingActiveRoute;
|
|
176
|
+
private openOnlyRevisedSection;
|
|
177
|
+
/** Clears `panelOpenState` on expandable rows so reopening a section does not keep arbitrary panels open. */
|
|
178
|
+
private clearRevisedExpandablePanelOpenStateInMenuTree;
|
|
179
|
+
private clearExpandablePanelOpenStateForRevisedSection;
|
|
180
|
+
/** Titled group panels: expanded only when a leaf under the group matches the current route (unless user toggled later). */
|
|
181
|
+
private resetRevisedGroupExpandedStateForSection;
|
|
182
|
+
private getRevisedSectionById;
|
|
183
|
+
private scrollToActiveMenuIfVisible;
|
|
184
|
+
private syncSectionSelectionToActiveRoute;
|
|
185
|
+
private findActiveAppForSection;
|
|
186
|
+
private sectionContainsActiveRoute;
|
|
187
|
+
private hasActiveRouteInMenus;
|
|
188
|
+
/**
|
|
189
|
+
* Normalizes a path for nav matching. Some shells differ: `router.url` vs `location.pathname` vs hash (`#/…`, `#!/…`).
|
|
190
|
+
*/
|
|
191
|
+
private normalizeNavPathSegment;
|
|
192
|
+
/**
|
|
193
|
+
* Strip `#!/` / `#/` from `menu.route` so it can match `collectCandidateNavPaths()` (hash → `/segment`).
|
|
194
|
+
* Used only for **exact** (and legacy keyword suffix) checks — no prefix wildcard, to avoid cross-menu false positives.
|
|
195
|
+
*/
|
|
196
|
+
private normalizeMenuRouteForPathMatch;
|
|
197
|
+
/** Collect all URL shapes that might represent the current page (fixes Criteo / ancillary when Router URL lags or omits base). */
|
|
198
|
+
private collectCandidateNavPaths;
|
|
199
|
+
/**
|
|
200
|
+
* Menus whose `link` is a real path (`dsp/…`, `dp/…`, `content/…`, `criteo/…`, `walmart/…`, etc.).
|
|
201
|
+
* For these, never treat bare `menu.route` (e.g. `overview`) as active — it collides across apps (DSP vs SOV).
|
|
202
|
+
*/
|
|
203
|
+
private menuUsesPathPrefixedLink;
|
|
204
|
+
/** `link` like `criteo/criteo-overview` vs URL `/criteo/criteo-overview` or `.../criteo/criteo-overview` (base href). */
|
|
205
|
+
private menuPathMatchesLinkPath;
|
|
206
|
+
/**
|
|
207
|
+
* `child_routes` entries are often host-relative segments (e.g. `walmart-keywords/keyword-report`) while
|
|
208
|
+
* the browser URL is `/walmart/walmart-keywords/keyword-report`.
|
|
209
|
+
*/
|
|
210
|
+
private menuChildRouteMatchesPath;
|
|
211
|
+
/**
|
|
212
|
+
* Expandable apps use `defaulturl` like `criteo/` — treat any `/criteo` or `/criteo/...` as under that app for active detection.
|
|
213
|
+
* Skips `#!` / `#` values used by legacy Amazon ui-router entries.
|
|
214
|
+
*/
|
|
215
|
+
private menuDefaultUrlMatchesPath;
|
|
216
|
+
/** Public so route rules stay in one place (used by revised grouped menus + unified isCheckActiveRoute). */
|
|
217
|
+
isMenuRouteActive(menu: RevisedNavMenuItem): boolean;
|
|
218
|
+
private normalizeRevisedLabel;
|
|
219
|
+
private getRevisedOptimizeRecommendationCount;
|
|
220
|
+
private getMenuCountValue;
|
|
221
|
+
private findRevisedMenuById;
|
|
92
222
|
get sideIdInfo(): number;
|
|
93
223
|
checkForRedirection(appMenus: any, gsMenus: any, applicationDetails: any): void;
|
|
94
224
|
validateRouteByState(state: any, listMenus: any): any;
|
|
@@ -103,6 +233,7 @@ export declare class ApplicationSidebarComponent implements OnInit, OnDestroy {
|
|
|
103
233
|
goToMenuLink(item: any): void;
|
|
104
234
|
ngOnDestroy(): void;
|
|
105
235
|
goToAppDefaultPage(item: any, appId: any): void;
|
|
236
|
+
private getDefaultNavigationTarget;
|
|
106
237
|
hideMenuForWL(): boolean;
|
|
107
238
|
static ɵfac: i0.ɵɵFactoryDeclaration<ApplicationSidebarComponent, never>;
|
|
108
239
|
static ɵcmp: i0.ɵɵComponentDeclaration<ApplicationSidebarComponent, "lnc-navigation-sidebar", never, { "applicationDetails": { "alias": "applicationDetails"; "required": false; }; "sidenav": { "alias": "sidenav"; "required": false; }; }, {}, never, never, false, never>;
|
package/lib/nav-menu-item.d.ts
CHANGED
|
@@ -31,6 +31,13 @@ export interface NavMenuItem {
|
|
|
31
31
|
siteNotIds?: any;
|
|
32
32
|
defaulturl?: string;
|
|
33
33
|
matchRoutes?: any[];
|
|
34
|
+
child_routes?: any[];
|
|
34
35
|
visibility_roles_not_in?: any[];
|
|
35
36
|
app_spacific_config_check?: Array<String>;
|
|
37
|
+
ownerAppId?: string;
|
|
38
|
+
sourceMenuId?: string;
|
|
39
|
+
sourceParentId?: string;
|
|
40
|
+
sourcePath?: string[];
|
|
41
|
+
children?: NavMenuItem[];
|
|
42
|
+
all_accounts?: boolean;
|
|
36
43
|
}
|