Skip to content

Commit 80e8584

Browse files
Devin-Hollandclaude
andcommitted
fix: Only show cloud instance type for Akamai channel
Pass cloudProvider as undefined for non-Akamai orgs so the row is hidden, instead of defaulting to gcp. Future cloud providers can extend the ternary in ClusterForm without spreading conditionals. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent fce33e4 commit 80e8584

5 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/features/clusters/upsert/ClusterDetails.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ interface ClusterDetailsProps {
2323
form: UseFormReturn<UpsertClusterSchemaType>;
2424
harperVersions: HarperVersionsResponse | undefined;
2525
isEnterprise: boolean;
26-
cloudProvider: keyof SchemaCloudInstanceTypes;
26+
cloudProvider: keyof SchemaCloudInstanceTypes | undefined;
2727
isPending: boolean;
2828
mode: 'version' | undefined;
2929
regionLocations: SchemaRegion[] | undefined;

src/features/clusters/upsert/ClusterForm.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export function ClusterForm({
6464
const navigate = useNavigate();
6565
const router = useRouter();
6666
const isEnterprise = organization?.type === ENTERPRISE;
67-
const cloudProvider = organization?.channel === 'Akamai' ? 'linode' : 'gcp';
67+
const cloudProvider = organization?.channel === 'Akamai' ? 'linode' : undefined;
6868

6969
const queryClient = useQueryClient();
7070
const { mutate: submitNewClusterData, isPending: isCreatePending } = useCreateNewClusterMutation();

src/features/clusters/upsert/ClusterRegions.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ interface ClusterRegionsProps {
1515
selectedPlan: SchemaPlan | undefined;
1616
totalPrice: number | undefined;
1717
isEnterprise: boolean;
18-
cloudProvider: keyof SchemaCloudInstanceTypes;
18+
cloudProvider: keyof SchemaCloudInstanceTypes | undefined;
1919
}
2020

2121
export function ClusterRegions({

src/features/clusters/upsert/components/RegionFormInputs.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ type RegionFormInputsProps = {
2121
regionNameToLatencyToRegion: Record<string, Record<string, SchemaRegion>>;
2222
selectedPlan: SchemaPlan | undefined;
2323
isEnterprise: boolean;
24-
cloudProvider: keyof SchemaCloudInstanceTypes;
24+
cloudProvider: keyof SchemaCloudInstanceTypes | undefined;
2525
};
2626

2727
export function RegionFormInputs({

src/features/clusters/upsert/components/ResourcesPerInstance.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ export function ResourcesPerInstance({ selectedPlan, selectedRegion, isEnterpris
1717
readonly selectedPlan: SchemaPlan | undefined;
1818
readonly selectedRegion: SchemaRegion | undefined;
1919
readonly isEnterprise: boolean;
20-
readonly cloudProvider: keyof SchemaCloudInstanceTypes;
20+
readonly cloudProvider: keyof SchemaCloudInstanceTypes | undefined;
2121
}) {
2222
const [toggled, setToggled] = useState(false);
2323
const onUsageLimitsClick = useCallback(() => {
2424
setToggled(!toggled);
2525
}, [toggled, setToggled]);
2626
const planLimits = selectedPlan?.planLimits;
2727
const resourcesPerInstance = selectedPlan?.resourcesPerInstance;
28-
const cloudInstanceType = selectedPlan?.cloudInstanceTypes?.[cloudProvider];
28+
const cloudInstanceType = cloudProvider && selectedPlan?.cloudInstanceTypes?.[cloudProvider];
2929

3030
const expirationMonths = isPositive(planLimits?.expirationMonths) && planLimits.expirationMonths < 1000
3131
&& planLimits.expirationMonths;

0 commit comments

Comments
 (0)