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
1 change: 1 addition & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ workflows:
only:
- dev
- TOP-2044_show-signin-modal
- maintenance

- deployProd:
context: org-global
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/code_reviewer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: AI PR Reviewer

on:
pull_request:
types:
- opened
- synchronize
permissions:
pull-requests: write
jobs:
tc-ai-pr-review:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3

- name: TC AI PR Reviewer
uses: topcoder-platform/tc-ai-pr-reviewer@master
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # The GITHUB_TOKEN is there by default so you just need to keep it like it is and not necessarily need to add it as secret as it will throw an error. [More Details](https://docs.github.com/en/actions/security-guides/automatic-token-authentication#about-the-github_token-secret)
LAB45_API_KEY: ${{ secrets.LAB45_API_KEY }}
exclude: '**/*.json, **/*.md, **/*.jpg, **/*.png, **/*.jpeg, **/*.bmp, **/*.webp' # Optional: exclude patterns separated by commas
10 changes: 1 addition & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ Information regarding the changes will be disseminated to the owners of all prop

| Parameter | Type | Required | Description | Default value |
|-------------------------|----------------------------------------------|-------------------------|------------------------------------------------------------------------------------------|---------------|
| method | Enum: 'init' \| 'update' \| 'triggerFlow' | yes | The method to be called | |
| method | Enum: 'init' \| 'update' | yes | The method to be called | |
| targetId | string(html element id) | yes | target element for the navigation to be rendered on | none |
| config | object | no | The config object for the specific navigation type | {} |
| config.handleNavigation | (route: {path, label}) => void | no | Allow for external handling of route navigation (eg. via react-router-dom) | none |
Expand All @@ -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
43 changes: 43 additions & 0 deletions src/lib/components/Maintenance.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
@import 'lib/styles/fonts.scss';

.bannerWrap {
position: relative;
height: 48px;
width: 100%;
}

.banner {
background: rgb(157, 27, 27);
color: #fff;
padding: 0.5rem;
display: flex;
justify-content: space-between;

&:before {
content: "";
display: block;
}
}

.bannerContent {
flex: 1 1 0;
display: flex;
justify-content: center;
align-items: center;
column-gap: 1rem;
row-gap: 0.5rem;
margin: 0 0.5rem;
min-width: 0;
flex-wrap: wrap;
}

.bannerText {
white-space: pre-wrap;
overflow-wrap: break-word;
font-family: $roboto;
font-size: 16px;
color: #fff;
line-height: 24px;
font-weight: bold;
}

12 changes: 12 additions & 0 deletions src/lib/components/Maintenance.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<script lang="ts">
import styles from './Maintenance.module.scss';
const bannerName = 'maintenance';
</script>

<div class={styles.banner}>
<div class={styles.bannerContent}>
<div class={styles.bannerText}>
Topcoder will be undergoing maintenance on Tuesday, October 21, 2025 from 1 AM to 6 AM EST
</div>
</div>
</div>
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.

2 changes: 2 additions & 0 deletions src/lib/marketing-navigation/MarketingNavigation.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import { checkAndLoadFonts } from 'lib/utils/fonts';
import NavigationBar from './components/NavigationBar.svelte';
import UserArea from 'lib/components/user-area/UserArea.svelte';
import Maintenance from 'lib/components/Maintenance.svelte';

const ctx = getAppContext()
$: ({auth, navigationHandler} = $ctx)
Expand All @@ -35,6 +36,7 @@

<div class="tc-universal-nav-wrap">
<!-- <Banner /> -->
<Maintenance />
<NavigationBar
activeRoutePath={activeRoute}
activeRoute={primaryRoute}
Expand Down
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
2 changes: 2 additions & 0 deletions src/lib/tool-navigation/ToolNavigation.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import type { NavMenuItem } from 'lib/functions/nav-menu-item.model';
import { useSessionStorage } from 'lib/utils/use-storage';
import { marketingRightItems } from 'lib/functions/marketing-navigation.provider'
import Maintenance from 'lib/components/Maintenance.svelte';
import styles from './ToolNavigation.module.scss';
import ToolNavSeparator from './tool-nav-separator/ToolNavSeparator.svelte';
Expand Down Expand Up @@ -48,6 +49,7 @@
onMount(checkAndLoadFonts)
</script>

<Maintenance />
<TopNavbar class={classnames(styles.navbar, 'tc-universal-nav-wrap')} style="primary" minVersionLogo>
{#if $isMobile}
<MobileNavigation
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.

Loading