Skip to content

Commit 4aa503f

Browse files
vishalshrm539Sharmatumms2021389
authored
Fixed the incorrect Metadat issues (#345)
Co-authored-by: Sharma <[email protected]> Co-authored-by: tumms2021389 <[email protected]>
1 parent 8adcecf commit 4aa503f

File tree

1 file changed

+35
-2
lines changed
  • packages/angular-sdk-components/src/lib/_components/infra/Containers/view-container

1 file changed

+35
-2
lines changed

packages/angular-sdk-components/src/lib/_components/infra/Containers/view-container/helper.ts

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,46 @@ export const addContainerItem = pConnect => {
1010
export const configureBrowserBookmark = pConnect => {
1111
const context = pConnect.getContextName();
1212
const containerName = pConnect.getContainerName();
13+
const envInfo = PCore.getEnvironmentInfo();
14+
const { APP } = PCore.getConstants();
15+
1316
const navPages = pConnect.getValue('pyPortal.pyPrimaryNavPages');
14-
const defaultViewLabel = Array.isArray(navPages) && navPages[0] ? navPages[0].pyLabel : '';
17+
let ruleName = '';
18+
let className = '';
19+
let defaultViewLabel = '';
20+
21+
const isNextGenLandingPageRouting = (envInfo?.environmentInfoObject as any)?.pyExecutionRuntimeName === (APP as any).INFINITY_RUNTIME;
22+
23+
if (Array.isArray(navPages) && navPages.length > 0) {
24+
const firstNavPage = navPages[0];
25+
const nestedNavPage = firstNavPage.NavigationPages?.[0];
26+
27+
if (isNextGenLandingPageRouting) {
28+
if (nestedNavPage?.pyRuleName) {
29+
ruleName = nestedNavPage.pyRuleName;
30+
className = nestedNavPage.pyClassName || '';
31+
} else if (firstNavPage?.pyRuleName) {
32+
ruleName = firstNavPage.pyRuleName;
33+
className = firstNavPage.pyClassName || '';
34+
} else if (nestedNavPage?.pyLabel) {
35+
defaultViewLabel = nestedNavPage.pyLabel;
36+
} else if (firstNavPage?.pyLabel) {
37+
defaultViewLabel = firstNavPage.pyLabel;
38+
}
39+
} else if (nestedNavPage?.pyLabel) {
40+
defaultViewLabel = nestedNavPage.pyLabel;
41+
} else if (firstNavPage?.pyLabel) {
42+
defaultViewLabel = firstNavPage.pyLabel;
43+
}
44+
}
45+
1546
PCore.configureForBrowserBookmark({
1647
context,
1748
containerName,
1849
acName: containerName,
1950
semanticURL: '',
20-
defaultViewLabel
51+
defaultViewLabel,
52+
ruleName,
53+
className
2154
});
2255
};

0 commit comments

Comments
 (0)