Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

chore: Temporarily disable redirects#1338

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
olegt-codefresh merged 1 commit intomasterfromCR-29501
Jun 5, 2025
Merged
Show file tree
Hide file tree
Changes fromall 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
22 changes: 0 additions & 22 deletionsREADME.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -76,28 +76,6 @@ For more details, refer to the "Auto Redirect from Enterprise to ArgoHub Collect
- To switch to the GitOps segment, log in to Codefresh and switch to an account with the GitOps type. This will clear the Enterprise cookie.
- To switch to the Enterprise segment, log in to Codefresh and switch to an account with any other type. This will set the Enterprise cookie.

#### Disabling Auto-Redirect to Stay in the Enterprise Segment

To prevent automatic redirection to the ArgoHub collection and remain in the Enterprise segment, add the `?ent` query parameter to the URL. When this parameter is present, the redirect logic is bypassed.
You can also link to mid-topic titles using `?ent. Add the link _after_ the query parameter as in Example 2 below.

**Example:**

- URL to topic title:
`https://[placeholder-domain]/docs/docs/promotions/promotion-flow/?ent`

- URL for mid-topic links:
`https://[placeholder-domain]/docs/docs/promotions/product-promotion-props/?ent#product-properties-for-promotion`


Adding the `ent` parameter ensures users remain in the Enterprise segment without being redirected to the ArgoHub collection.

> When a page is accessed with the `?ent` parameter, it will remain locked in the Enterprise segment for the duration of the browser session. Closing the specific window or tab will release this lock.
> The lock is _not inherited_ when opening a new tab or window with the same link. It will function as per the default behavior without the override.




#### To switch segments in local development:

In the local documentation site (`http://localhost:3131/`), open the console in developer tools and inject the appropriate cookie:
Expand Down
38 changes: 14 additions & 24 deletionsassets/js/src/argohub-redirect.js
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
const enterpriseDocumentationCookie ='cfdoctype=enterprise'
const enterpriseDocumentationCookie ="cfdoctype=enterprise";
const ARGOHUB_MAIN_PATH = `/${SITE_GITOPS_COLLECTION}/`;
const enterpriseDocTypeLockKey ='enterpriseDocTypeLock';
const enterpriseDocTypeLockKey ="enterpriseDocTypeLock";

function checkIfEnterpriseDocumentationCookieSet() {
return document.cookie.includes(enterpriseDocumentationCookie)
return document.cookie.includes(enterpriseDocumentationCookie);
}

async function getArgoHubRedirectURL(currentPath) {
Expand All@@ -22,9 +22,7 @@ async function getArgoHubRedirectURL(currentPath) {
return newURL;
}

async function handleRedirect () {
handleEnterpriseDocTypeLock()

async function handleRedirect() {
if (shouldSkipRedirect()) return;

const argoHubRedirectURL = await getArgoHubRedirectURL(location.pathname);
Expand All@@ -33,36 +31,28 @@ async function handleRedirect () {
location.href = argoHubRedirectURL;
}

async function fetchRedirectMap() {
async function fetchRedirectMap() {
const response = await fetch(
`${SITE_BASE_URL}/assets/js/src/argohub-redirect-mapping.json`
);
if (!response.ok) {
throw new Error("Failed to fetch the collections redirect map.");
}
return response.json();
};

function handleEnterpriseDocTypeLock() {
const queryParams = new URLSearchParams(location.search);
if (!queryParams.has('ent')) return;

localStorage.setItem(enterpriseDocTypeLockKey, 'true');
}


function isEnterpriseLockPresent(){
const enterpriseDocTypeLock = localStorage.getItem(enterpriseDocTypeLockKey)
return !!enterpriseDocTypeLock

function isEnterpriseLockPresent() {
const enterpriseDocTypeLock = localStorage.getItem(enterpriseDocTypeLockKey);
return !!enterpriseDocTypeLock;
}

function shouldSkipRedirect() {
return (
isEnterpriseLockPresent() ||
SITE_IS_GITOPS_COLLECTION ||
checkIfEnterpriseDocumentationCookieSet()
);
return true; // Redirect temporarily disabled. Will be re-enabled with a new cookie-based mechanism.
// return (
// isEnterpriseLockPresent() ||
// SITE_IS_GITOPS_COLLECTION ||
// checkIfEnterpriseDocumentationCookieSet()
// );
}

handleRedirect();

[8]ページ先頭

©2009-2025 Movatter.jp