Skip to content

Commit 2f6ee04

Browse files
committed
chore: remove old console settings
Signed-off-by: Alessandro Yuichi Okimoto <yuichijpn@gmail.com>
1 parent c52016c commit 2f6ee04

8 files changed

Lines changed: 6 additions & 146 deletions

File tree

docker-compose/config/nginx/bucketeer.conf

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -458,22 +458,7 @@ server {
458458
proxy_read_timeout 60s;
459459
}
460460

461-
# Old dashboard endpoints
462-
location /legacy {
463-
proxy_pass https://web_console_backend;
464-
proxy_set_header Host $host;
465-
proxy_set_header X-Real-IP $remote_addr;
466-
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
467-
proxy_set_header X-Forwarded-Proto $scheme;
468-
proxy_http_version 1.1;
469-
proxy_set_header Upgrade $http_upgrade;
470-
proxy_set_header Connection "upgrade";
471-
proxy_connect_timeout 15s;
472-
proxy_send_timeout 15s;
473-
proxy_read_timeout 15s;
474-
}
475-
476-
# New dashboard endpoints
461+
# Dashboard endpoints
477462
location / {
478463
proxy_pass https://web_dashboard_backend;
479464
proxy_set_header Host $host;

manifests/bucketeer/charts/web/templates/envoy-configmap.yaml

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -436,38 +436,6 @@ data:
436436
explicit_http_config:
437437
http2_protocol_options: {}
438438
ignore_health_on_host_removal: true
439-
- name: web_console
440-
type: strict_dns
441-
connect_timeout: 5s
442-
dns_lookup_family: V4_ONLY
443-
lb_policy: {{ .Values.envoy.lbPolicy }}
444-
load_assignment:
445-
cluster_name: web_console
446-
endpoints:
447-
- lb_endpoints:
448-
- endpoint:
449-
address:
450-
socket_address:
451-
address: localhost
452-
port_value: 9102
453-
transport_socket:
454-
name: envoy.transport_sockets.tls
455-
typed_config:
456-
'@type': type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.UpstreamTlsContext
457-
common_tls_context:
458-
alpn_protocols:
459-
- h2
460-
tls_certificates:
461-
- certificate_chain:
462-
filename: /usr/local/certs/service/tls.crt
463-
private_key:
464-
filename: /usr/local/certs/service/tls.key
465-
typed_extension_protocol_options:
466-
envoy.extensions.upstreams.http.v3.HttpProtocolOptions:
467-
'@type': type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions
468-
explicit_http_config:
469-
http2_protocol_options: {}
470-
ignore_health_on_host_removal: true
471439
- name: dashboard
472440
type: strict_dns
473441
connect_timeout: 5s
@@ -959,14 +927,6 @@ data:
959927
retry_policy:
960928
retry_on: 5xx
961929
num_retries: 3
962-
- match:
963-
prefix: /legacy
964-
route:
965-
cluster: web_console
966-
timeout: 15s
967-
retry_policy:
968-
retry_on: 5xx
969-
num_retries: 3
970930
- match:
971931
prefix: /v1/
972932
route:

ui/dashboard/src/@locales/en/common.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,5 @@
289289
"member-role-description": "Can only access specific environments and cannot create or update organization settings, projects, environments, API keys, or members.",
290290
"admin-role-description": "Has access to all environments and can do anything",
291291
"teams": "Teams",
292-
"docs": "Docs",
293-
"new-console": "New console",
294-
"old-console": "Old console"
292+
"docs": "Docs"
295293
}

ui/dashboard/src/@locales/ja/common.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,5 @@
289289
"member-role-description": "特定の環境にのみアクセスでき、組織設定、プロジェクト、環境、APIキー、メンバーの作成や更新はできません。",
290290
"admin-role-description": "すべての環境にアクセスでき、すべての操作を実行できます。",
291291
"teams": "チーム",
292-
"docs": "ドキュメント",
293-
"new-console": "新コンソール",
294-
"old-console": "旧コンソール"
292+
"docs": "ドキュメント"
295293
}

ui/dashboard/src/auth/auth-context.tsx

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,16 @@ import React, {
33
useContext,
44
useEffect,
55
ReactNode,
6-
useState,
7-
useCallback
6+
useState
87
} from 'react';
98
import { useNavigate } from 'react-router-dom';
109
import { accountOrganizationFetcher, MeFetcherParams } from '@api/account';
1110
import { accountMeFetcher } from '@api/account';
12-
import { urls } from 'configs';
1311
import { PAGE_PATH_ROOT } from 'constants/routing';
1412
import { useToast } from 'hooks';
1513
import { getLanguage, Language, setLanguage, useTranslation } from 'i18n';
1614
import isNil from 'lodash/isNil';
1715
import { Undefinable } from 'option-t/undefinable';
18-
import { clearConsoleVersion, getConsoleVersion } from 'storage/console';
1916
import {
2017
clearCurrentEnvIdStorage,
2118
getCurrentEnvIdStorage,
@@ -38,7 +35,6 @@ import {
3835
} from 'storage/token';
3936
import { AuthToken, ConsoleAccount, Organization } from '@types';
4037
import { onChangeFontWithLocalized } from 'utils/function';
41-
import { useSearchParams } from 'utils/search-params';
4238
import { getAccountAccess } from './utils';
4339

4440
interface AuthContextType {
@@ -72,7 +68,6 @@ export const AuthProvider: React.FC<{ children: ReactNode }> = ({
7268
const organizationId = getOrgIdStorage();
7369
const environmentId = getCurrentEnvIdStorage();
7470
const { errorNotify } = useToast();
75-
const { searchOptions } = useSearchParams();
7671

7772
const [isInitialLoading, setIsInitialLoading] = useState(
7873
!!authToken?.accessToken
@@ -92,22 +87,6 @@ export const AuthProvider: React.FC<{ children: ReactNode }> = ({
9287
clearCurrentProjectEnvironmentStorage();
9388
};
9489

95-
const handleCheckConsoleVersion = useCallback(
96-
(account: ConsoleAccount) => {
97-
const backFromOldConsole = !!searchOptions?.fromOldConsole;
98-
const consoleVersion = getConsoleVersion();
99-
const isRedirectToOldConsole =
100-
consoleVersion?.version === 'old' &&
101-
consoleVersion?.email === account.email;
102-
if (!isRedirectToOldConsole || backFromOldConsole)
103-
return clearConsoleVersion();
104-
105-
if (isRedirectToOldConsole)
106-
return (window.location.href = urls.OLD_CONSOLE_ENDPOINT as string);
107-
},
108-
[searchOptions]
109-
);
110-
11190
const onMeFetcher = async (params: MeFetcherParams) => {
11291
try {
11392
const response = await accountMeFetcher(params);
@@ -117,7 +96,6 @@ export const AuthProvider: React.FC<{ children: ReactNode }> = ({
11796
errorNotify(null, t('message:env-are-empty'));
11897
return logout();
11998
}
120-
handleCheckConsoleVersion(response.account);
12199
setConsoleAccount(response.account);
122100
setIsLogin(true);
123101
if (response.account.lastSeen === '0' || !response.account.lastSeen)

ui/dashboard/src/components/navigation/user-menu.tsx

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,13 @@
11
import { useCallback, useMemo, useRef, useState } from 'react';
2-
import { IconLaunchOutlined } from 'react-icons-material-design';
32
import { AccountAvatar, accountUpdater } from '@api/account/account-updater';
43
import * as Popover from '@radix-ui/react-popover';
54
import defaultAvatar from 'assets/avatars/default.svg';
65
import { getCurrentEnvironment, useAuth } from 'auth';
7-
import { urls } from 'configs';
86
import { useToast, useToggleOpen } from 'hooks';
97
import { getLanguage, Language, setLanguage, useTranslation } from 'i18n';
108
import compact from 'lodash/compact';
11-
import { setConsoleVersion } from 'storage/console';
129
import { onChangeFontWithLocalized } from 'utils/function';
13-
import {
14-
IconBucketWhite,
15-
IconBuilding,
16-
IconChevronRight,
17-
IconLogout,
18-
IconUser
19-
} from '@icons';
10+
import { IconBuilding, IconChevronRight, IconLogout, IconUser } from '@icons';
2011
import { languageList } from 'pages/members/member-modal/add-member-modal';
2112
import { AvatarImage } from 'components/avatar';
2213
import { DropdownOption } from 'components/dropdown';
@@ -98,18 +89,6 @@ const UserMenu = ({ onOpenSwitchOrg }: { onOpenSwitchOrg: () => void }) => {
9889
);
9990

10091
const menuItems = compact([
101-
{
102-
label: t('old-console'),
103-
icon: IconBucketWhite,
104-
actIcon: IconLaunchOutlined,
105-
onClick: () => {
106-
setConsoleVersion({
107-
version: 'old',
108-
email: consoleAccount!.email
109-
});
110-
window.location.href = urls.OLD_CONSOLE_ENDPOINT;
111-
}
112-
},
11392
!isHiddenProfileMenu && {
11493
label: t(`navigation.user-profile`),
11594
icon: IconUser,

ui/dashboard/src/configs/index.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ declare global {
1717
DEMO_SIGN_IN_PASSWORD?: string;
1818
GOOGLE_TAG_MANAGER_ID?: string;
1919
API_ENDPOINT?: string;
20-
OLD_CONSOLE_ENDPOINT?: string;
2120
};
2221
}
2322
}
@@ -40,11 +39,7 @@ export const urls = {
4039
API_ENDPOINT:
4140
releaseMode !== 'prod'
4241
? import.meta.env.VITE_API_ENDPOINT
43-
: window.env?.API_ENDPOINT,
44-
OLD_CONSOLE_ENDPOINT:
45-
releaseMode !== 'prod'
46-
? import.meta.env.VITE_OLD_CONSOLE_ENDPOINT
47-
: `${window.location.origin}/legacy` // TODO: Remove the `/legacy` when the new console is released
42+
: window.env?.API_ENDPOINT
4843
};
4944

5045
export const GOOGLE_TAG_MANAGER_ID = window.env?.GOOGLE_TAG_MANAGER_ID || '';

ui/dashboard/src/storage/console.ts

Lines changed: 0 additions & 33 deletions
This file was deleted.

0 commit comments

Comments
 (0)