From 44c70b5d011b27508bcc7b65fcf9eba5dd9d09c2 Mon Sep 17 00:00:00 2001 From: Pablo Lara Date: Thu, 13 Mar 2025 13:57:16 +0100 Subject: [PATCH] chore: remove unused regions (#7229) --- .../filters/custom-region-selection.tsx | 8 +- ui/lib/helper.ts | 94 ------------------- 2 files changed, 2 insertions(+), 100 deletions(-) diff --git a/ui/components/filters/custom-region-selection.tsx b/ui/components/filters/custom-region-selection.tsx index adab82823b..6cc4d78c18 100644 --- a/ui/components/filters/custom-region-selection.tsx +++ b/ui/components/filters/custom-region-selection.tsx @@ -4,12 +4,10 @@ import { Select, SelectItem } from "@nextui-org/react"; import { useRouter, useSearchParams } from "next/navigation"; import React, { useCallback, useMemo } from "react"; -import { regions } from "@/lib/helper"; - export const CustomRegionSelection: React.FC = () => { const router = useRouter(); const searchParams = useSearchParams(); - + const region = "none"; // Memoize selected keys based on the URL const selectedKeys = useMemo(() => { const params = searchParams.get("filter[regions]"); @@ -44,9 +42,7 @@ export const CustomRegionSelection: React.FC = () => { applyRegionFilter(Array.from(keys) as string[]) } > - {regions.map((region) => ( - {region.label} - ))} + {region} ); }; diff --git a/ui/lib/helper.ts b/ui/lib/helper.ts index e985390c7a..cf5bd39003 100644 --- a/ui/lib/helper.ts +++ b/ui/lib/helper.ts @@ -123,100 +123,6 @@ export const getErrorMessage = async (error: unknown): Promise => { return message; }; -export const regions = [ - // AWS Regions (ordered by usage) - { key: "us-east-1", label: "AWS - US East 1" }, - { key: "us-west-1", label: "AWS - US West 1" }, - { key: "us-west-2", label: "AWS - US West 2" }, - { key: "eu-west-1", label: "AWS - EU West 1" }, - { key: "eu-central-1", label: "AWS - EU Central 1" }, - { key: "ap-southeast-1", label: "AWS - AP Southeast 1" }, - { key: "ap-northeast-1", label: "AWS - AP Northeast 1" }, - { key: "ap-southeast-2", label: "AWS - AP Southeast 2" }, - { key: "ca-central-1", label: "AWS - CA Central 1" }, - { key: "sa-east-1", label: "AWS - SA East 1" }, - { key: "af-south-1", label: "AWS - AF South 1" }, - { key: "ap-east-1", label: "AWS - AP East 1" }, - { key: "ap-northeast-2", label: "AWS - AP Northeast 2" }, - { key: "ap-northeast-3", label: "AWS - AP Northeast 3" }, - { key: "ap-south-1", label: "AWS - AP South 1" }, - { key: "ap-south-2", label: "AWS - AP South 2" }, - { key: "ap-southeast-3", label: "AWS - AP Southeast 3" }, - { key: "ap-southeast-4", label: "AWS - AP Southeast 4" }, - { key: "ca-west-1", label: "AWS - CA West 1" }, - { key: "eu-central-2", label: "AWS - EU Central 2" }, - { key: "eu-north-1", label: "AWS - EU North 1" }, - { key: "eu-south-1", label: "AWS - EU South 1" }, - { key: "eu-south-2", label: "AWS - EU South 2" }, - { key: "eu-west-2", label: "AWS - EU West 2" }, - { key: "eu-west-3", label: "AWS - EU West 3" }, - { key: "il-central-1", label: "AWS - IL Central 1" }, - { key: "me-central-1", label: "AWS - ME Central 1" }, - { key: "me-south-1", label: "AWS - ME South 1" }, - - // Azure Regions (ordered by usage) - { key: "eastus", label: "Azure - East US" }, - { key: "eastus2", label: "Azure - East US 2" }, - { key: "westeurope", label: "Azure - West Europe" }, - { key: "southeastasia", label: "Azure - Southeast Asia" }, - { key: "uksouth", label: "Azure - UK South" }, - { key: "northeurope", label: "Azure - North Europe" }, - { key: "centralus", label: "Azure - Central US" }, - { key: "westus2", label: "Azure - West US 2" }, - { key: "southcentralus", label: "Azure - South Central US" }, - { key: "australiaeast", label: "Azure - Australia East" }, - { key: "canadacentral", label: "Azure - Canada Central" }, - { key: "japaneast", label: "Azure - Japan East" }, - { key: "koreacentral", label: "Azure - Korea Central" }, - { key: "southafricanorth", label: "Azure - South Africa North" }, - { key: "brazilsouth", label: "Azure - Brazil South" }, - { key: "francecentral", label: "Azure - France Central" }, - { key: "germanywestcentral", label: "Azure - Germany West Central" }, - { key: "switzerlandnorth", label: "Azure - Switzerland North" }, - { key: "uaenorth", label: "Azure - UAE North" }, - // Remaining Azure Regions (less frequently used) - { key: "westus", label: "Azure - West US" }, - { key: "northcentralus", label: "Azure - North Central US" }, - { key: "australiasoutheast", label: "Azure - Australia Southeast" }, - { key: "southindia", label: "Azure - South India" }, - { key: "westindia", label: "Azure - West India" }, - { key: "canadaeast", label: "Azure - Canada East" }, - { key: "francesouth", label: "Azure - France South" }, - { key: "norwayeast", label: "Azure - Norway East" }, - { key: "switzerlandwest", label: "Azure - Switzerland West" }, - { key: "ukwest", label: "Azure - UK West" }, - { key: "uaecentral", label: "Azure - UAE Central" }, - { key: "brazilsoutheast", label: "Azure - Brazil Southeast" }, - - // GCP Regions (ordered by usage) - { key: "us-central1", label: "GCP - US Central (Iowa)" }, - { key: "us-east1", label: "GCP - US East (South Carolina)" }, - { key: "us-west1", label: "GCP - US West (Oregon)" }, - { key: "europe-west1", label: "GCP - Europe West (Belgium)" }, - { key: "asia-east1", label: "GCP - Asia East (Taiwan)" }, - { key: "asia-northeast1", label: "GCP - Asia Northeast (Tokyo)" }, - { key: "europe-west2", label: "GCP - Europe West (London)" }, - { key: "europe-west3", label: "GCP - Europe West (Frankfurt)" }, - { key: "europe-west4", label: "GCP - Europe West (Netherlands)" }, - { key: "asia-southeast1", label: "GCP - Asia Southeast (Singapore)" }, - { key: "australia-southeast1", label: "GCP - Australia Southeast (Sydney)" }, - { - key: "northamerica-northeast1", - label: "GCP - North America Northeast (Montreal)", - }, - // Remaining GCP Regions - { key: "asia-east2", label: "GCP - Asia East (Hong Kong)" }, - { key: "asia-northeast2", label: "GCP - Asia Northeast (Osaka)" }, - { key: "asia-northeast3", label: "GCP - Asia Northeast (Seoul)" }, - { key: "asia-south1", label: "GCP - Asia South (Mumbai)" }, - { key: "asia-southeast2", label: "GCP - Asia Southeast (Jakarta)" }, - { key: "europe-north1", label: "GCP - Europe North (Finland)" }, - { key: "europe-west6", label: "GCP - Europe West (Zurich)" }, - { key: "southamerica-east1", label: "GCP - South America East (São Paulo)" }, - { key: "us-west2", label: "GCP - US West (Los Angeles)" }, - { key: "us-east4", label: "GCP - US East (Northern Virginia)" }, -]; - export const permissionFormFields: PermissionInfo[] = [ { field: "manage_users",