Skip to content

Commit 1f41b89

Browse files
authored
Merge pull request #389 from topcoder-platform/dev
LPU release
2 parents 75c86e3 + d8ef14c commit 1f41b89

File tree

9 files changed

+40
-15
lines changed

9 files changed

+40
-15
lines changed

src/lib/app-context/app-context.functions.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ export const buildContext = (newConfig: Partial<NavigationAppProps>, prevContext
1818
fullFooter = prevContext.toolConfig?.fullFooter,
1919
showSalesCta = prevContext.toolConfig?.showSalesCta,
2020
profileCompletionData = prevContext.auth?.profileCompletionData,
21+
signupUtmCodes = prevContext.signupUtmCodes,
22+
simplifiedNav = prevContext.simplifiedNav,
2123
} = {...newConfig, user: undefined}
2224

2325
const hasUserProp = hasOwnProperty(newConfig, 'user') && newConfig['user'] !== 'auto'
@@ -45,6 +47,8 @@ export const buildContext = (newConfig: Partial<NavigationAppProps>, prevContext
4547
fullFooter,
4648
showSalesCta,
4749
},
50+
signupUtmCodes,
51+
simplifiedNav,
4852
supportMeta,
4953
integrations,
5054
}

src/lib/app-context/app-context.model.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,6 @@ export interface AppContext {
88
toolConfig: ToolConfig
99
navigationHandler: NavigationHandler
1010
supportMeta?: SupportMeta
11+
signupUtmCodes?: string
12+
simplifiedNav?: boolean
1113
}

src/lib/components/user-area/UserArea.svelte

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,14 @@
8080
8181
function onSignIn(signup?: any) {
8282
const locationHref = `${window.location.origin}${window.location.pathname}`
83-
window.location.href = `${AUTH0_AUTHENTICATOR_URL}?retUrl=${encodeURIComponent(locationHref)}${signup === true ? '&mode=signUp' : ''}`;
83+
84+
const signupUrl = [
85+
`${AUTH0_AUTHENTICATOR_URL}?retUrl=${encodeURIComponent(locationHref)}`,
86+
signup === true ? '&mode=signUp' : '',
87+
$ctx.signupUtmCodes,
88+
].filter(Boolean).join('&')
89+
90+
window.location.href = signupUrl;
8491
}
8592
8693
function onSignUp() {

src/lib/marketing-navigation/MarketingNavigation.svelte

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
menuItems={menuItems}
4545
isMobile={$isMobile}
4646
navigationHandler={navigationHandler}
47+
simplifiedNav={$ctx.simplifiedNav}
4748
>
4849
<UserArea slot="auth" />
4950
</NavigationBar>

src/lib/marketing-navigation/components/NavigationBar.svelte

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,26 @@
1111
export let activeRoute: NavMenuItem;
1212
export let isMobile: boolean = false;
1313
export let navigationHandler: NavigationHandler | undefined;
14+
export let simplifiedNav: boolean = false;
1415
</script>
1516

1617
<TopNavbar style={style} minVersionLogo={isMobile}>
17-
{#if isMobile}
18-
<MobileNavigation
19-
menuItems={[...menuItems]}
20-
activeRoute={activeRoute}
21-
activeRoutePath={activeRoutePath}
22-
/>
23-
{:else}
24-
<LinksMenu
25-
menuItems={menuItems}
26-
style={style}
27-
activeRoute={activeRoute}
28-
activeRoutePath={activeRoutePath}
29-
navigationHandler={navigationHandler}
30-
/>
18+
{#if !simplifiedNav}
19+
{#if isMobile}
20+
<MobileNavigation
21+
menuItems={[...menuItems]}
22+
activeRoute={activeRoute}
23+
activeRoutePath={activeRoutePath}
24+
/>
25+
{:else}
26+
<LinksMenu
27+
menuItems={menuItems}
28+
style={style}
29+
activeRoute={activeRoute}
30+
activeRoutePath={activeRoutePath}
31+
navigationHandler={navigationHandler}
32+
/>
33+
{/if}
3134
{/if}
3235

3336
<svelte:fragment slot="right">

src/main.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ export type NavigationAppProps = {
3535
supportMeta?: SupportMeta
3636

3737
integrations?: {[key: string]: 'disable'}
38+
signupUtmCodes?: string
39+
simplifiedNav?: boolean
3840
}
3941

4042
export type TcUniNavMethods = 'init' | 'update' | 'destroy'

types/src/lib/app-context/app-context.functions.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ export declare const buildContext: (newConfig: Partial<NavigationAppProps>, prev
1818
fullFooter: any;
1919
showSalesCta: any;
2020
};
21+
signupUtmCodes: any;
22+
simplifiedNav: any;
2123
supportMeta: any;
2224
integrations: any;
2325
};

types/src/lib/app-context/app-context.model.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,6 @@ export interface AppContext {
77
toolConfig: ToolConfig;
88
navigationHandler: NavigationHandler;
99
supportMeta?: SupportMeta;
10+
signupUtmCodes?: string;
11+
simplifiedNav?: boolean;
1012
}

types/src/main.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ export declare type NavigationAppProps = {
2020
integrations?: {
2121
[key: string]: 'disable';
2222
};
23+
signupUtmCodes?: string;
24+
simplifiedNav?: boolean;
2325
};
2426
export declare type TcUniNavMethods = 'init' | 'update' | 'destroy';
2527
export declare type TcUniNavFn = (method: TcUniNavMethods, targetId: string, config: NavigationAppProps) => void;

0 commit comments

Comments
 (0)