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

Commit6dcd0ca

Browse files
chore: Temporarily disable redirects (#1338)
1 parente1438bd commit6dcd0ca

File tree

2 files changed

+14
-46
lines changed

2 files changed

+14
-46
lines changed

‎README.md‎

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -76,28 +76,6 @@ For more details, refer to the "Auto Redirect from Enterprise to ArgoHub Collect
7676
- 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.
7777
- 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.
7878

79-
####Disabling Auto-Redirect to Stay in the Enterprise Segment
80-
81-
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.
82-
You can also link to mid-topic titles using `?ent. Add the link_after_ the query parameter as in Example 2 below.
83-
84-
**Example:**
85-
86-
- URL to topic title:
87-
`https://[placeholder-domain]/docs/docs/promotions/promotion-flow/?ent`
88-
89-
- URL for mid-topic links:
90-
`https://[placeholder-domain]/docs/docs/promotions/product-promotion-props/?ent#product-properties-for-promotion`
91-
92-
93-
Adding the`ent` parameter ensures users remain in the Enterprise segment without being redirected to the ArgoHub collection.
94-
95-
>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.
96-
>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.
97-
98-
99-
100-
10179
####To switch segments in local development:
10280

10381
In the local documentation site (`http://localhost:3131/`), open the console in developer tools and inject the appropriate cookie:

‎assets/js/src/argohub-redirect.js‎

Lines changed: 14 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
constenterpriseDocumentationCookie='cfdoctype=enterprise'
1+
constenterpriseDocumentationCookie="cfdoctype=enterprise";
22
constARGOHUB_MAIN_PATH=`/${SITE_GITOPS_COLLECTION}/`;
3-
constenterpriseDocTypeLockKey='enterpriseDocTypeLock';
3+
constenterpriseDocTypeLockKey="enterpriseDocTypeLock";
44

55
functioncheckIfEnterpriseDocumentationCookieSet(){
6-
returndocument.cookie.includes(enterpriseDocumentationCookie)
6+
returndocument.cookie.includes(enterpriseDocumentationCookie);
77
}
88

99
asyncfunctiongetArgoHubRedirectURL(currentPath){
@@ -22,9 +22,7 @@ async function getArgoHubRedirectURL(currentPath) {
2222
returnnewURL;
2323
}
2424

25-
asyncfunctionhandleRedirect(){
26-
handleEnterpriseDocTypeLock()
27-
25+
asyncfunctionhandleRedirect(){
2826
if(shouldSkipRedirect())return;
2927

3028
constargoHubRedirectURL=awaitgetArgoHubRedirectURL(location.pathname);
@@ -33,36 +31,28 @@ async function handleRedirect () {
3331
location.href=argoHubRedirectURL;
3432
}
3533

36-
asyncfunctionfetchRedirectMap(){
34+
asyncfunctionfetchRedirectMap(){
3735
constresponse=awaitfetch(
3836
`${SITE_BASE_URL}/assets/js/src/argohub-redirect-mapping.json`
3937
);
4038
if(!response.ok){
4139
thrownewError("Failed to fetch the collections redirect map.");
4240
}
4341
returnresponse.json();
44-
};
45-
46-
functionhandleEnterpriseDocTypeLock(){
47-
constqueryParams=newURLSearchParams(location.search);
48-
if(!queryParams.has('ent'))return;
49-
50-
localStorage.setItem(enterpriseDocTypeLockKey,'true');
5142
}
5243

53-
54-
functionisEnterpriseLockPresent(){
55-
constenterpriseDocTypeLock=localStorage.getItem(enterpriseDocTypeLockKey)
56-
return!!enterpriseDocTypeLock
57-
44+
functionisEnterpriseLockPresent(){
45+
constenterpriseDocTypeLock=localStorage.getItem(enterpriseDocTypeLockKey);
46+
return!!enterpriseDocTypeLock;
5847
}
5948

6049
functionshouldSkipRedirect(){
61-
return(
62-
isEnterpriseLockPresent()||
63-
SITE_IS_GITOPS_COLLECTION||
64-
checkIfEnterpriseDocumentationCookieSet()
65-
);
50+
returntrue;// Redirect temporarily disabled. Will be re-enabled with a new cookie-based mechanism.
51+
// return (
52+
// isEnterpriseLockPresent() ||
53+
// SITE_IS_GITOPS_COLLECTION ||
54+
// checkIfEnterpriseDocumentationCookieSet()
55+
// );
6656
}
6757

6858
handleRedirect();

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp