diff --git a/.circleci/config.yml b/.circleci/config.yml index da5ad240..6cd09e84 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -220,6 +220,7 @@ workflows: only: - dev - TOP-2044_show-signin-modal + - maintenance - deployProd: context: org-global diff --git a/.github/workflows/code_reviewer.yml b/.github/workflows/code_reviewer.yml new file mode 100644 index 00000000..82c78626 --- /dev/null +++ b/.github/workflows/code_reviewer.yml @@ -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 \ No newline at end of file diff --git a/README.md b/README.md index 12e3dc05..b73242e0 100644 --- a/README.md +++ b/README.md @@ -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 | @@ -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. @@ -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: diff --git a/src/lib/components/LinksMenu.svelte b/src/lib/components/LinksMenu.svelte index 280b34bb..ee13040f 100644 --- a/src/lib/components/LinksMenu.svelte +++ b/src/lib/components/LinksMenu.svelte @@ -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; diff --git a/src/lib/components/Maintenance.module.scss b/src/lib/components/Maintenance.module.scss new file mode 100644 index 00000000..18cdfc90 --- /dev/null +++ b/src/lib/components/Maintenance.module.scss @@ -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; +} + diff --git a/src/lib/components/Maintenance.svelte b/src/lib/components/Maintenance.svelte new file mode 100644 index 00000000..e5179a93 --- /dev/null +++ b/src/lib/components/Maintenance.svelte @@ -0,0 +1,12 @@ + + +
+
+
+ Topcoder will be undergoing maintenance on Tuesday, October 21, 2025 from 1 AM to 6 AM EST +
+
+
diff --git a/src/lib/components/SubMenu.svelte b/src/lib/components/SubMenu.svelte index ee896811..61b3b8fd 100644 --- a/src/lib/components/SubMenu.svelte +++ b/src/lib/components/SubMenu.svelte @@ -1,6 +1,6 @@ + {#if $isMobile} Promise; -/** - * Subscribes to a writable auth context, - * and watches for when the user data is ready. - * Once user data is ready, calls userflow's identify() method - * @param appContext Svelte writable/readable context - */ -declare const subscribeToAuthContext: (appContext: any) => void; -/** - * Triggers a Userflow content item - * @param flowId Userflow content ID - * @param options.once Boolean, optional - If set to true, - * the content will only start if the user has not seen it before. - * If the user has already seen it before, nothing happens. - * Defaults to true. - */ -declare const triggerFlow: (flowId: string, options?: { - once?: boolean; - delay?: number; -}) => void; -export { subscribeToAuthContext as initUserflow, initAndIdentifyUser as identify, triggerFlow, }; diff --git a/types/src/main.d.ts b/types/src/main.d.ts index cf0a307f..fd6842b4 100644 --- a/types/src/main.d.ts +++ b/types/src/main.d.ts @@ -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; diff --git a/uni-nav.env.dev b/uni-nav.env.dev index a9c9bc45..f3fbe09f 100644 --- a/uni-nav.env.dev +++ b/uni-nav.env.dev @@ -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' diff --git a/uni-nav.env.prod b/uni-nav.env.prod index ea0540bb..3821edbe 100644 --- a/uni-nav.env.prod +++ b/uni-nav.env.prod @@ -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' diff --git a/uni-nav.env.qa b/uni-nav.env.qa index d2947bd0..c6550068 100644 --- a/uni-nav.env.qa +++ b/uni-nav.env.qa @@ -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'