From 784667b3cc6f3ef2f158fd71cb03c6c0866b2bf6 Mon Sep 17 00:00:00 2001 From: Brooke Date: Wed, 23 Nov 2022 13:20:37 -0800 Subject: [PATCH 1/2] PROD-3245 #comment This commit adds a header-specific readme and updates the version of the uni-nav.js #time 30m --- .../environment.default.config.ts | 2 +- .../environments/environment.prod.config.ts | 2 +- src-ts/header/README.md | 28 +++++++++++++++++++ 3 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 src-ts/header/README.md diff --git a/src-ts/config/environments/environment.default.config.ts b/src-ts/config/environments/environment.default.config.ts index 1df819a2e..9583612d6 100644 --- a/src-ts/config/environments/environment.default.config.ts +++ b/src-ts/config/environments/environment.default.config.ts @@ -42,6 +42,6 @@ export const EnvironmentConfigDefault: EnvironmentConfigModel = { WP_CONTENT: `${COMMUNITY_WEBSITE}/wp-content`, }, UNIVERSAL_NAV: { - URL: 'https://uni-nav.topcoder-dev.com/tc-universal-nav.js', + URL: 'https://uni-nav.topcoder-dev.com/tc-universal-nav-1.js', }, } diff --git a/src-ts/config/environments/environment.prod.config.ts b/src-ts/config/environments/environment.prod.config.ts index b9a861803..d3df68b15 100644 --- a/src-ts/config/environments/environment.prod.config.ts +++ b/src-ts/config/environments/environment.prod.config.ts @@ -40,6 +40,6 @@ export const EnvironmentConfigProd: EnvironmentConfigModel = { WP_CONTENT: `${COMMUNITY_WEBSITE}/wp-content`, }, UNIVERSAL_NAV: { - URL: 'https://uni-nav.topcoder.com/tc-universal-nav.js', + URL: 'https://uni-nav.topcoder.com/tc-universal-nav-1.js', }, } diff --git a/src-ts/header/README.md b/src-ts/header/README.md new file mode 100644 index 000000000..9e842f1c0 --- /dev/null +++ b/src-ts/header/README.md @@ -0,0 +1,28 @@ +# Topcoder Universal Navigation + +The Platform UI project uses the Topcoder Universal navigation ([README](https://github.com/topcoder-platform/universal-navigation)). + +## Uni-nav Versions + +The Uni-nav is a hosted JS library. There are currently dev and prod versions of the library located at: + +https://uni-nav.topcoder.com/tc-universal-nav-1.js + +https://uni-nav.topcoder-dev.com/tc-universal-nav-1.js + +The URL is set at build time with the [Global Config](../lib/global-config.model.ts) `UNIVERSAL_NAV.URL` property. + +>See the [Local Environment Setup](../../README.md#local-environment-setup) section of the main README for instructions on how to set your environment configuration. + +>See the [Uni-Nav Version README](https://github.com/topcoder-platform/universal-navigation#versioning) for more information about versioning. + +## Uni-nav Initialization + +The Header uses the `tcUniNav` method to initialize the nav with: + +- active tool name +- active tool root route +- current user, if logged in +- action handler callbacks (e.g. navigation, log in, sign up) + +Because the Platform UI hosts multiple tools, each time the user navigates to a new tool, the Header updates the uni-nav w/the active tool info. From 2dae3694178ca4cf5862f72d064b14309fdb79c3 Mon Sep 17 00:00:00 2001 From: Brooke Date: Mon, 28 Nov 2022 09:32:22 -0800 Subject: [PATCH 2/2] PROD-3257 #comment This commit changes the path to the uni nav script #time 15m --- src-ts/config/environments/environment.default.config.ts | 2 +- src-ts/config/environments/environment.prod.config.ts | 2 +- src-ts/header/README.md | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src-ts/config/environments/environment.default.config.ts b/src-ts/config/environments/environment.default.config.ts index 9583612d6..17b21d180 100644 --- a/src-ts/config/environments/environment.default.config.ts +++ b/src-ts/config/environments/environment.default.config.ts @@ -42,6 +42,6 @@ export const EnvironmentConfigDefault: EnvironmentConfigModel = { WP_CONTENT: `${COMMUNITY_WEBSITE}/wp-content`, }, UNIVERSAL_NAV: { - URL: 'https://uni-nav.topcoder-dev.com/tc-universal-nav-1.js', + URL: 'https://uni-nav.topcoder-dev.com/v1/tc-universal-nav.js', }, } diff --git a/src-ts/config/environments/environment.prod.config.ts b/src-ts/config/environments/environment.prod.config.ts index d3df68b15..6f242de5e 100644 --- a/src-ts/config/environments/environment.prod.config.ts +++ b/src-ts/config/environments/environment.prod.config.ts @@ -40,6 +40,6 @@ export const EnvironmentConfigProd: EnvironmentConfigModel = { WP_CONTENT: `${COMMUNITY_WEBSITE}/wp-content`, }, UNIVERSAL_NAV: { - URL: 'https://uni-nav.topcoder.com/tc-universal-nav-1.js', + URL: 'https://uni-nav.topcoder.com/v1/tc-universal-nav.js', }, } diff --git a/src-ts/header/README.md b/src-ts/header/README.md index 9e842f1c0..930d9d9f6 100644 --- a/src-ts/header/README.md +++ b/src-ts/header/README.md @@ -6,9 +6,9 @@ The Platform UI project uses the Topcoder Universal navigation ([README](https:/ The Uni-nav is a hosted JS library. There are currently dev and prod versions of the library located at: -https://uni-nav.topcoder.com/tc-universal-nav-1.js +https://uni-nav.topcoder.com/v1/tc-universal-nav.js -https://uni-nav.topcoder-dev.com/tc-universal-nav-1.js +https://uni-nav.topcoder-dev.com/v1/tc-universal-nav.js The URL is set at build time with the [Global Config](../lib/global-config.model.ts) `UNIVERSAL_NAV.URL` property. @@ -23,6 +23,6 @@ The Header uses the `tcUniNav` method to initialize the nav with: - active tool name - active tool root route - current user, if logged in -- action handler callbacks (e.g. navigation, log in, sign up) +- action handler callbacks (e.g. navigation, log in, log out, sign up) Because the Platform UI hosts multiple tools, each time the user navigates to a new tool, the Header updates the uni-nav w/the active tool info.