Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,6 @@ Information regarding the changes will be disseminated to the owners of all prop
| config.user | 'auto' | no | Instruct the uni-nav to auto-fetch user profile info based on the `tcjwt` cookie value | {} |
| config.user | {photoURL, userId, initials, handle} | no | The logged in user | {} |
| config.supportMeta | {challengeId, isSelfService} | no | Additional meta data to be sent along with any support ticket created by the user | |
| config.integrations | {userflow?: 'disable'} | no | Disable userflow integration | |

### User Model
You can either pass user's details as described by the `AuthUser` interface, or pass a value of `auto` and uni-nav will automatically fetch user's details from the api based on the tcjwt auth cookie.
Expand Down Expand Up @@ -326,13 +325,6 @@ After `init` is called, you should call only `update` for further updates.

>**NOTE** Both methods accept the same config object as mentioned in the previous section [API for tcUniNav](#api-for-tcuninav).

### Custom Integrations

#### Userflow
Userflow is used to display surveys and tips for the user.
You can manually trigger a predefined userflow content item by calling the method `triggerFlow` via uninav. Eg. `tcUniNav('triggerFlow', 'userflow-content-id', ...userflowArgs)`.


### Typescript Support

Typescript type declarations (i.e. `*.d.ts`) can be sourced from the Github repo in the devDependencies of your package.json:
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/LinksMenu.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import { classnames } from "lib/utils/classnames";
import { getPublicPath } from 'lib/utils/paths';
import SubMenu from "./SubMenu.svelte";
import { NavigationHandler } from "../app-context/navigation-handler.model";
import type { NavigationHandler } from "../app-context/navigation-handler.model";
const chevronDownIconUrl = getPublicPath(`/assets/ic-chevron-down.svg`);

export let ref: Element | undefined = undefined;
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/SubMenu.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts">
import type { NavMenuItem } from 'lib/functions/nav-menu-item.model';
import { NavigationHandler } from "../app-context/navigation-handler.model";
import type { NavigationHandler } from "../app-context/navigation-handler.model";
import { onMount } from 'svelte';
import styles from './SubMenu.module.scss';

Expand Down
5 changes: 0 additions & 5 deletions src/lib/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,4 @@ export const AUTH0_AUTHENTICATOR_URL: string = getEnvValue(
"https://accounts-auth0.topcoder.com"
);

export const DISABLE_USERFLOW: string = getEnvValue('VITE_DISABLE_USERFLOW', '')
export const USERFLOW_ENVIRONMENT_TOKEN: string = getEnvValue('VITE_USERFLOW_ENVIRONMENT_TOKEN')
export const USERFLOW_TC_SIGNATURE: string = getEnvValue('VITE_USERFLOW_TC_SIGNATURE')
export const USERFLOW_DEFAULT_SURVEY_DELAY: string = getEnvValue('VITE_USERFLOW_DEFAULT_SURVEY_DELAY', '3000')

export * from './hosts'
9 changes: 0 additions & 9 deletions src/lib/functions/integrations/userflow-loader.js

This file was deleted.

137 changes: 0 additions & 137 deletions src/lib/functions/integrations/userflow.ts

This file was deleted.

3 changes: 1 addition & 2 deletions src/lib/marketing-navigation/components/NavigationBar.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
import LinksMenu from '../../components/LinksMenu.svelte';
import TopNavbar from 'lib/components/TopNavbar.svelte';
import MobileNavigation from 'lib/mobile-navigation/MobileNavigation.svelte';
import { marketingRightItems } from 'lib/functions/marketing-navigation.provider'
import { NavigationHandler } from "../../app-context/navigation-handler.model";
import type { NavigationHandler } from "../../app-context/navigation-handler.model";

export let style: 'primary'|'secondary'|'tertiary';
export let menuItems: NavMenuItem[] = [];
Expand Down
8 changes: 1 addition & 7 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { writable } from 'svelte/store'
import type { Writable } from 'svelte/store'

import { buildContext, type AuthUser, type NavigationHandler, type SupportMeta } from './lib/app-context'
import { initUserflow, triggerFlow } from 'lib/functions/integrations/userflow';
import { loadNudgeApp } from './lib/functions/load-nudge-app'
import { PubSub } from './lib/utils/pubsub';

Expand Down Expand Up @@ -38,7 +37,7 @@ export type NavigationAppProps = {
integrations?: {[key: string]: 'disable'}
}

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

export type TcUniNavFn = (
method: TcUniNavMethods,
Expand Down Expand Up @@ -138,7 +137,6 @@ async function init(
}

if (navType === 'tool' || navType === 'marketing') {
initUserflow(ctx.get('appContext'));
loadNudgeApp(ctx, targetEl.querySelector('.tc-universal-nav-wrap'));
}
}
Expand Down Expand Up @@ -177,10 +175,6 @@ function execQueueCall(method: TcUniNavMethods, ...args: any[]) {
update.call(null, ...args)
}

else if (method === 'triggerFlow') {
triggerFlow.call(null, ...args)
}

else if (method === 'destroy') {
destroy.call(null, ...args);
}
Expand Down
4 changes: 0 additions & 4 deletions types/src/lib/config/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,4 @@ export declare const PLATFORM_APP_HOST: string;
export declare const CUSTOMER_LOGIN: string;
export declare const CUSTOMER_SIGNUP: string;
export declare const AUTH0_AUTHENTICATOR_URL: string;
export declare const DISABLE_USERFLOW: string;
export declare const USERFLOW_ENVIRONMENT_TOKEN: string;
export declare const USERFLOW_TC_SIGNATURE: string;
export declare const USERFLOW_DEFAULT_SURVEY_DELAY: string;
export * from './hosts';
1 change: 0 additions & 1 deletion types/src/lib/functions/integrations/userflow-loader.d.ts

This file was deleted.

25 changes: 0 additions & 25 deletions types/src/lib/functions/integrations/userflow.d.ts

This file was deleted.

2 changes: 1 addition & 1 deletion types/src/main.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ export declare type NavigationAppProps = {
[key: string]: 'disable';
};
};
export declare type TcUniNavMethods = 'init' | 'update' | 'destroy' | 'triggerFlow';
export declare type TcUniNavMethods = 'init' | 'update' | 'destroy';
export declare type TcUniNavFn = (method: TcUniNavMethods, targetId: string, config: NavigationAppProps) => void;
2 changes: 0 additions & 2 deletions uni-nav.env.dev
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# environment variables for the dev env
VITE_APP_HOST_ENV=dev
VITE_USERFLOW_ENVIRONMENT_TOKEN=ct_6cskavahlnco7fqjpphvbjqlla
VITE_USERFLOW_TC_SIGNATURE=50cb1d775f80715513743264ef975d2fdc2eb69170d639e22f295914d47f02e2
VITE_PLATFORM_APP_HOST='https://develop.app-dev.topcoder.com'
VITE_CUSTOMER_SIGNUP='https://develop.app-dev.topcoder.com/signup'
VITE_AUTH0_AUTHENTICATOR_URL='https://accounts-auth0.topcoder-dev.com'
2 changes: 0 additions & 2 deletions uni-nav.env.prod
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# environment variables for the prod env
VITE_APP_HOST_ENV=prod
VITE_USERFLOW_ENVIRONMENT_TOKEN=ct_4no3lqex75fr3dhojxzu47vpf4
VITE_USERFLOW_TC_SIGNATURE=a36a72415c488dc781d32277756cd50313c25e8ac0f929f76172601cfc08139e
VITE_PLATFORM_APP_HOST='https://app.topcoder.com'
VITE_CUSTOMER_SIGNUP='https://app.topcoder.com/signup'
VITE_AUTH0_AUTHENTICATOR_URL='https://accounts-auth0.topcoder.com'
2 changes: 0 additions & 2 deletions uni-nav.env.qa
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# environment variables for the qa env
VITE_APP_HOST_ENV=qa
VITE_USERFLOW_ENVIRONMENT_TOKEN=ct_44zs4tkk2fcfhk4knitv3sujge
VITE_USERFLOW_TC_SIGNATURE=bce044d6dea2f4c1e2bea5df0b5e4dd8e1f4f7518c2b33219ba04317b9251782
VITE_PLATFORM_APP_HOST='https://qa.app-dev.topcoder.com'
VITE_CUSTOMER_SIGNUP='https://qa.app-dev.topcoder.com/signup'
VITE_AUTH0_AUTHENTICATOR_URL='https://accounts-auth0.topcoder-dev.com'