From bc7412f1f15fd625eef8aede699d995d15751098 Mon Sep 17 00:00:00 2001 From: Guillaume Da Silva Date: Thu, 26 Feb 2026 11:16:16 +0100 Subject: [PATCH 1/3] fix(azure): add ClusterRegionWithZones type and display AZ count in region selector Add forward-compatible ClusterRegionWithZones interface extending ClusterRegion with an optional zones field. Update the region selector dropdown to display zone count when available from the API. The type augmentation can be removed once qovery-typescript-axios is regenerated from the updated OpenAPI spec. --- .../step-general/step-general.tsx | 23 +++++++++++++------ libs/shared/interfaces/src/index.ts | 1 + .../types/cluster-region-with-zones.type.ts | 16 +++++++++++++ 3 files changed, 33 insertions(+), 7 deletions(-) create mode 100644 libs/shared/interfaces/src/lib/types/cluster-region-with-zones.type.ts diff --git a/libs/pages/clusters/src/lib/ui/page-clusters-create/step-general/step-general.tsx b/libs/pages/clusters/src/lib/ui/page-clusters-create/step-general/step-general.tsx index b8b27f6b000..8dda3b3dad7 100644 --- a/libs/pages/clusters/src/lib/ui/page-clusters-create/step-general/step-general.tsx +++ b/libs/pages/clusters/src/lib/ui/page-clusters-create/step-general/step-general.tsx @@ -1,11 +1,16 @@ -import { type CloudProvider, CloudProviderEnum, type ClusterRegion } from 'qovery-typescript-axios' +import { type CloudProvider, CloudProviderEnum } from 'qovery-typescript-axios' import { type FormEventHandler, useEffect, useMemo, useState } from 'react' import { Controller, useFormContext } from 'react-hook-form' import { useNavigate, useParams } from 'react-router-dom' import { match } from 'ts-pattern' import { LabelSetting } from '@qovery/domains/organizations/feature' import { ClusterCredentialsSettingsFeature, ClusterGeneralSettings } from '@qovery/shared/console-shared' -import { type ClusterGeneralData, type ClusterResourcesData, type Value } from '@qovery/shared/interfaces' +import { + type ClusterGeneralData, + type ClusterRegionWithZones, + type ClusterResourcesData, + type Value, +} from '@qovery/shared/interfaces' import { CLUSTERS_NEW_URL, CLUSTERS_URL } from '@qovery/shared/routes' import { Button, Callout, Heading, Icon, IconFlag, InputSelect, LoaderSpinner, Section } from '@qovery/shared/ui' import { upperCaseFirstLetter } from '@qovery/shared/util-js' @@ -40,11 +45,15 @@ export function StepGeneral(props: StepGeneralProps) { const buildRegions: Value[] = useMemo( () => - currentProvider?.regions?.map((region: ClusterRegion) => ({ - label: `${region.city} (${region.name})`, - value: region.name, - icon: , - })) || [], + currentProvider?.regions?.map((region) => { + const r = region as ClusterRegionWithZones + const zoneLabel = r.zones?.length ? ` — ${r.zones.length} AZs` : '' + return { + label: `${r.city} (${r.name})${zoneLabel}`, + value: r.name, + icon: , + } + }) || [], [currentProvider?.regions] ) diff --git a/libs/shared/interfaces/src/index.ts b/libs/shared/interfaces/src/index.ts index 2ba191677a2..deb437d4af6 100644 --- a/libs/shared/interfaces/src/index.ts +++ b/libs/shared/interfaces/src/index.ts @@ -11,3 +11,4 @@ export * from './lib/domain/cluster-creation-flow.interface' export * from './lib/types/loading-status.type' export * from './lib/types/deployment-service.type' export * from './lib/types/environment-variable-secret-or-public.type' +export * from './lib/types/cluster-region-with-zones.type' diff --git a/libs/shared/interfaces/src/lib/types/cluster-region-with-zones.type.ts b/libs/shared/interfaces/src/lib/types/cluster-region-with-zones.type.ts new file mode 100644 index 00000000000..d831e3ff7a4 --- /dev/null +++ b/libs/shared/interfaces/src/lib/types/cluster-region-with-zones.type.ts @@ -0,0 +1,16 @@ +import type { ClusterRegion } from 'qovery-typescript-axios' + +/** + * Extended ClusterRegion that includes availability zones. + * + * The upstream `qovery-typescript-axios` client will include the `zones` + * field once regenerated from the updated OpenAPI spec. Until then, this + * type provides forward-compatible access to the property that the API + * already returns. + * + * Remove this file after updating `qovery-typescript-axios` to a version + * that includes `zones` on `ClusterRegion`. + */ +export interface ClusterRegionWithZones extends ClusterRegion { + zones?: string[] +} From 6adf78d9b43943cca920ae89b131a9b3eed8af68 Mon Sep 17 00:00:00 2001 From: Guillaume Da Silva Date: Fri, 27 Feb 2026 11:45:14 +0100 Subject: [PATCH 2/3] refactor: remove ClusterRegionWithZones, use updated axios client Update qovery-typescript-axios to 1.1.834 which includes zones on ClusterRegion natively. Remove the temporary extended type. --- .../step-general/step-general.tsx | 16 +++++--------- libs/shared/interfaces/src/index.ts | 1 - .../types/cluster-region-with-zones.type.ts | 16 -------------- package.json | 22 ++++++++++++++----- yarn.lock | 10 ++++----- 5 files changed, 27 insertions(+), 38 deletions(-) delete mode 100644 libs/shared/interfaces/src/lib/types/cluster-region-with-zones.type.ts diff --git a/libs/pages/clusters/src/lib/ui/page-clusters-create/step-general/step-general.tsx b/libs/pages/clusters/src/lib/ui/page-clusters-create/step-general/step-general.tsx index 8dda3b3dad7..7a52f5cbfde 100644 --- a/libs/pages/clusters/src/lib/ui/page-clusters-create/step-general/step-general.tsx +++ b/libs/pages/clusters/src/lib/ui/page-clusters-create/step-general/step-general.tsx @@ -5,12 +5,7 @@ import { useNavigate, useParams } from 'react-router-dom' import { match } from 'ts-pattern' import { LabelSetting } from '@qovery/domains/organizations/feature' import { ClusterCredentialsSettingsFeature, ClusterGeneralSettings } from '@qovery/shared/console-shared' -import { - type ClusterGeneralData, - type ClusterRegionWithZones, - type ClusterResourcesData, - type Value, -} from '@qovery/shared/interfaces' +import { type ClusterGeneralData, type ClusterResourcesData, type Value } from '@qovery/shared/interfaces' import { CLUSTERS_NEW_URL, CLUSTERS_URL } from '@qovery/shared/routes' import { Button, Callout, Heading, Icon, IconFlag, InputSelect, LoaderSpinner, Section } from '@qovery/shared/ui' import { upperCaseFirstLetter } from '@qovery/shared/util-js' @@ -46,12 +41,11 @@ export function StepGeneral(props: StepGeneralProps) { const buildRegions: Value[] = useMemo( () => currentProvider?.regions?.map((region) => { - const r = region as ClusterRegionWithZones - const zoneLabel = r.zones?.length ? ` — ${r.zones.length} AZs` : '' + const zoneLabel = region.zones?.length ? ` — ${region.zones.length} AZs` : '' return { - label: `${r.city} (${r.name})${zoneLabel}`, - value: r.name, - icon: , + label: `${region.city} (${region.name})${zoneLabel}`, + value: region.name, + icon: , } }) || [], [currentProvider?.regions] diff --git a/libs/shared/interfaces/src/index.ts b/libs/shared/interfaces/src/index.ts index deb437d4af6..2ba191677a2 100644 --- a/libs/shared/interfaces/src/index.ts +++ b/libs/shared/interfaces/src/index.ts @@ -11,4 +11,3 @@ export * from './lib/domain/cluster-creation-flow.interface' export * from './lib/types/loading-status.type' export * from './lib/types/deployment-service.type' export * from './lib/types/environment-variable-secret-or-public.type' -export * from './lib/types/cluster-region-with-zones.type' diff --git a/libs/shared/interfaces/src/lib/types/cluster-region-with-zones.type.ts b/libs/shared/interfaces/src/lib/types/cluster-region-with-zones.type.ts deleted file mode 100644 index d831e3ff7a4..00000000000 --- a/libs/shared/interfaces/src/lib/types/cluster-region-with-zones.type.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { ClusterRegion } from 'qovery-typescript-axios' - -/** - * Extended ClusterRegion that includes availability zones. - * - * The upstream `qovery-typescript-axios` client will include the `zones` - * field once regenerated from the updated OpenAPI spec. Until then, this - * type provides forward-compatible access to the property that the API - * already returns. - * - * Remove this file after updating `qovery-typescript-axios` to a version - * that includes `zones` on `ClusterRegion`. - */ -export interface ClusterRegionWithZones extends ClusterRegion { - zones?: string[] -} diff --git a/package.json b/package.json index 12249793d9e..b02e52aa5f2 100644 --- a/package.json +++ b/package.json @@ -68,7 +68,7 @@ "mermaid": "^11.6.0", "monaco-editor": "0.53.0", "posthog-js": "^1.260.1", - "qovery-typescript-axios": "1.1.832", + "qovery-typescript-axios": "1.1.834", "react": "18.3.1", "react-country-flag": "^3.0.2", "react-datepicker": "^4.12.0", @@ -207,10 +207,22 @@ "@semantic-release/commit-analyzer", { "releaseRules": [ - { "type": "feat", "release": "minor" }, - { "type": "fix", "release": "patch" }, - { "type": "chore", "release": "patch" }, - { "type": "refactor", "release": "patch" } + { + "type": "feat", + "release": "minor" + }, + { + "type": "fix", + "release": "patch" + }, + { + "type": "chore", + "release": "patch" + }, + { + "type": "refactor", + "release": "patch" + } ] } ], diff --git a/yarn.lock b/yarn.lock index 140729fc9e0..ae25d667631 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5451,7 +5451,7 @@ __metadata: prettier: ^3.2.5 prettier-plugin-tailwindcss: ^0.5.14 pretty-quick: ^4.0.0 - qovery-typescript-axios: 1.1.832 + qovery-typescript-axios: 1.1.834 qovery-ws-typescript-axios: ^0.1.420 react: 18.3.1 react-country-flag: ^3.0.2 @@ -24269,12 +24269,12 @@ __metadata: languageName: node linkType: hard -"qovery-typescript-axios@npm:1.1.832": - version: 1.1.832 - resolution: "qovery-typescript-axios@npm:1.1.832" +"qovery-typescript-axios@npm:1.1.834": + version: 1.1.834 + resolution: "qovery-typescript-axios@npm:1.1.834" dependencies: axios: 1.12.2 - checksum: 1337d725e15ff6c5ed82f183a2e0b2bd0cbfa86ff0826df327da8a1778f05ff363279b0dd74e9a9f450eb9f09fd63fc35988c9928960466fbc7767b9d4639ddd + checksum: e5904e1bdf797d0b29faff1c96031432dc1f04780d2916c3509ca6d2a6aa5fd069fdde25ad171c30373054dc4110eafd92218ca0817deafc789ffd1170ffcfdf languageName: node linkType: hard From 5c9a0d9ee27a707ee2f65469ba169a84767603cf Mon Sep 17 00:00:00 2001 From: Guillaume Da Silva Date: Fri, 27 Feb 2026 12:17:14 +0100 Subject: [PATCH 3/3] refactor: remove AZ count label from region selector MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Displaying zone count adds noise without value — AWS doesn't show it either and Azure regions almost all have 3 AZs. --- .../step-general/step-general.tsx | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/libs/pages/clusters/src/lib/ui/page-clusters-create/step-general/step-general.tsx b/libs/pages/clusters/src/lib/ui/page-clusters-create/step-general/step-general.tsx index 7a52f5cbfde..ea2b1b11b62 100644 --- a/libs/pages/clusters/src/lib/ui/page-clusters-create/step-general/step-general.tsx +++ b/libs/pages/clusters/src/lib/ui/page-clusters-create/step-general/step-general.tsx @@ -40,14 +40,11 @@ export function StepGeneral(props: StepGeneralProps) { const buildRegions: Value[] = useMemo( () => - currentProvider?.regions?.map((region) => { - const zoneLabel = region.zones?.length ? ` — ${region.zones.length} AZs` : '' - return { - label: `${region.city} (${region.name})${zoneLabel}`, - value: region.name, - icon: , - } - }) || [], + currentProvider?.regions?.map((region) => ({ + label: `${region.city} (${region.name})`, + value: region.name, + icon: , + })) || [], [currentProvider?.regions] )