mirror of
https://github.com/mulgadc/spinifex.git
synced 2026-10-15 17:11:30 +00:00
fix: enable prefer nullish coalescing
This commit is contained in:
+1
-1
@@ -1 +1 @@
|
||||
import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useSuspenseQuery.js";import{t as r}from"./link.js";import{Jt as i,Xt as a,Zt as o,nn as s}from"./cluster-config.js";import{t as c}from"./back-link.js";import{n as l,r as u,t as d}from"./upload-button.js";import{r as f}from"./s3.js";import{t as p}from"./s32.js";import{t as m}from"./error-banner.js";import{t as h}from"./_.js";var g=t(),_=e();function v(){let e=(0,g.c)(24),{bucket:t,_splat:v}=h.useParams(),y=a(v??``),{data:b}=n(p(t,y)),x=f(),S;e[0]===b.Contents?S=e[1]:(S=b.Contents??[],e[0]=b.Contents,e[1]=S);let C=S,w;e[2]===b.CommonPrefixes?w=e[3]:(w=b.CommonPrefixes??[],e[2]=b.CommonPrefixes,e[3]=w);let T=w,E=y.split(`/`).filter(Boolean),D=[{name:t,path:`/s3/ls/${t}`},...E.map((e,n)=>{let r=`${E.slice(0,n+1).join(`/`)}/`;return{name:e,path:`/s3/ls/${t}/${r}`}})],O=E.length>1?`/s3/ls/${t}/${E.slice(0,-1).join(`/`)}/`:`/s3/ls/${t}`,k;e[4]===O?k=e[5]:(k=(0,_.jsx)(c,{to:O,children:`Back`}),e[4]=O,e[5]=k);let A;e[6]!==t||e[7]!==y||e[8]!==x.isPending||e[9]!==x.mutateAsync?(A=(0,_.jsx)(d,{bucket:t,isPending:x.isPending,onUpload:x.mutateAsync,prefix:y}),e[6]=t,e[7]=y,e[8]=x.isPending,e[9]=x.mutateAsync,e[10]=A):A=e[10];let j;e[11]===x.error?j=e[12]:(j=x.error&&(0,_.jsx)(m,{error:x.error,msg:`Failed to upload object`}),e[11]=x.error,e[12]=j);let M;e[13]!==t||e[14]!==T||e[15]!==y?(M=T.length>0&&(0,_.jsxs)(`div`,{className:`mb-6`,children:[(0,_.jsx)(`h2`,{className:`mb-3 text-lg font-semibold`,children:`Folders`}),(0,_.jsx)(`div`,{className:`space-y-2`,children:T.map(e=>{if(!e.Prefix)return null;let n=s(o(e.Prefix,y)),r=i(e.Prefix,y);return(0,_.jsx)(u,{bucketName:t,folderName:n,fullPrefix:r},e.Prefix)})})]}),e[13]=t,e[14]=T,e[15]=y,e[16]=M):M=e[16];let N;e[17]!==t||e[18]!==C||e[19]!==y?(N=C.length>0&&(0,_.jsxs)(`div`,{className:`space-y-2`,children:[(0,_.jsx)(`h2`,{className:`mb-3 text-lg font-semibold`,children:`Objects`}),C.map(e=>{if(!e.Key)return null;let n=o(e.Key,y),r=i(e.Key,y);return(0,_.jsx)(l,{bucketName:t,displayName:n,fullKey:r,object:e},e.Key)})]}),e[17]=t,e[18]=C,e[19]=y,e[20]=N):N=e[20];let P;return e[21]!==T.length||e[22]!==C.length?(P=C.length===0&&T.length===0&&(0,_.jsx)(`p`,{className:`text-muted-foreground`,children:`No objects found in this folder.`}),e[21]=T.length,e[22]=C.length,e[23]=P):P=e[23],(0,_.jsxs)(_.Fragment,{children:[k,(0,_.jsx)(`div`,{className:`mb-6`,children:(0,_.jsxs)(`div`,{className:`mb-2 flex items-center justify-between`,children:[(0,_.jsx)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:D.map((e,t)=>(0,_.jsxs)(`div`,{className:`flex items-center gap-2`,children:[t>0&&(0,_.jsx)(`span`,{children:`/`}),t===D.length-1?(0,_.jsx)(`span`,{className:`text-foreground`,children:e.name}):(0,_.jsx)(r,{className:`hover:text-foreground`,to:e.path,children:e.name})]},e.path))}),A]})}),j,M,N,P]})}export{v as component};
|
||||
import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useSuspenseQuery.js";import{t as r}from"./link.js";import{Jt as i,Xt as a,Zt as o,nn as s}from"./cluster-config.js";import{t as c}from"./back-link.js";import{n as l,r as u,t as d}from"./upload-button.js";import{r as f}from"./s3.js";import{t as p}from"./s32.js";import{t as m}from"./error-banner.js";import{t as h}from"./_.js";var g=t(),_=e();function v(){let e=(0,g.c)(26),{bucket:t,_splat:v}=h.useParams(),y=a(v??``),{data:b}=n(p(t,y)),x=f(),S;e[0]===b.Contents?S=e[1]:(S=b.Contents??[],e[0]=b.Contents,e[1]=S);let C=S,w;e[2]===b.CommonPrefixes?w=e[3]:(w=b.CommonPrefixes??[],e[2]=b.CommonPrefixes,e[3]=w);let T=w,E=y.split(`/`).filter(Boolean),D=[{name:t,path:`/s3/ls/${t}`},...E.map((e,n)=>{let r=`${E.slice(0,n+1).join(`/`)}/`;return{name:e,path:`/s3/ls/${t}/${r}`}})],O=`${E.slice(0,-1).join(`/`)}/`,k;e[4]!==t||e[5]!==O||e[6]!==E.length?(k=E.length>1?(0,_.jsx)(c,{params:{bucket:t,_splat:O},to:`/s3/ls/$bucket/$`,children:`Back`}):(0,_.jsx)(c,{params:{bucket:t},to:`/s3/ls/$bucket`,children:`Back`}),e[4]=t,e[5]=O,e[6]=E.length,e[7]=k):k=e[7];let A;e[8]!==t||e[9]!==y||e[10]!==x.isPending||e[11]!==x.mutateAsync?(A=(0,_.jsx)(d,{bucket:t,isPending:x.isPending,onUpload:x.mutateAsync,prefix:y}),e[8]=t,e[9]=y,e[10]=x.isPending,e[11]=x.mutateAsync,e[12]=A):A=e[12];let j;e[13]===x.error?j=e[14]:(j=x.error&&(0,_.jsx)(m,{error:x.error,msg:`Failed to upload object`}),e[13]=x.error,e[14]=j);let M;e[15]!==t||e[16]!==T||e[17]!==y?(M=T.length>0&&(0,_.jsxs)(`div`,{className:`mb-6`,children:[(0,_.jsx)(`h2`,{className:`mb-3 text-lg font-semibold`,children:`Folders`}),(0,_.jsx)(`div`,{className:`space-y-2`,children:T.map(e=>{if(!e.Prefix)return null;let n=s(o(e.Prefix,y)),r=i(e.Prefix,y);return(0,_.jsx)(u,{bucketName:t,folderName:n,fullPrefix:r},e.Prefix)})})]}),e[15]=t,e[16]=T,e[17]=y,e[18]=M):M=e[18];let N;e[19]!==t||e[20]!==C||e[21]!==y?(N=C.length>0&&(0,_.jsxs)(`div`,{className:`space-y-2`,children:[(0,_.jsx)(`h2`,{className:`mb-3 text-lg font-semibold`,children:`Objects`}),C.map(e=>{if(!e.Key)return null;let n=o(e.Key,y),r=i(e.Key,y);return(0,_.jsx)(l,{bucketName:t,displayName:n,fullKey:r,object:e},e.Key)})]}),e[19]=t,e[20]=C,e[21]=y,e[22]=N):N=e[22];let P;return e[23]!==T.length||e[24]!==C.length?(P=C.length===0&&T.length===0&&(0,_.jsx)(`p`,{className:`text-muted-foreground`,children:`No objects found in this folder.`}),e[23]=T.length,e[24]=C.length,e[25]=P):P=e[25],(0,_.jsxs)(_.Fragment,{children:[k,(0,_.jsx)(`div`,{className:`mb-6`,children:(0,_.jsxs)(`div`,{className:`mb-2 flex items-center justify-between`,children:[(0,_.jsx)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:D.map((e,t)=>(0,_.jsxs)(`div`,{className:`flex items-center gap-2`,children:[t>0&&(0,_.jsx)(`span`,{children:`/`}),t===D.length-1?(0,_.jsx)(`span`,{className:`text-foreground`,children:e.name}):(0,_.jsx)(r,{className:`hover:text-foreground`,to:e.path,children:e.name})]},e.path))}),A]})}),j,M,N,P]})}export{v as component};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -80,6 +80,10 @@ export default defineConfig({
|
||||
],
|
||||
},
|
||||
],
|
||||
"typescript/prefer-nullish-coalescing": [
|
||||
"error",
|
||||
{ ignorePrimitives: { string: true }, ignoreBooleanCoercion: true },
|
||||
],
|
||||
"typescript/strict-boolean-expressions": "off",
|
||||
"typescript/strict-void-return": "off",
|
||||
"unicorn/filename-case": [
|
||||
|
||||
@@ -123,7 +123,6 @@ export function CliCommandPanel({ commands }: CliCommandPanelProps) {
|
||||
<pre className="font-mono text-xs/relaxed">
|
||||
<code>
|
||||
{cmd.parts.map((part, j) => (
|
||||
// oxlint-disable-next-line react/no-array-index-key -- positional inline spans with no stable id
|
||||
<span key={j} className={partStyles[part.type]}>
|
||||
{part.value}
|
||||
</span>
|
||||
|
||||
@@ -11,7 +11,6 @@ export function DetailRow({
|
||||
<div>
|
||||
<dt className="text-sm text-muted-foreground">{label}</dt>
|
||||
<dd className="mt-1 font-mono text-sm">
|
||||
{/* oxlint-disable-next-line typescript/prefer-nullish-coalescing */}
|
||||
{value || <span className="text-muted-foreground">—</span>}
|
||||
</dd>
|
||||
</div>
|
||||
|
||||
@@ -281,7 +281,6 @@ export function TargetGroupForm({
|
||||
<FieldTitle>Tags</FieldTitle>
|
||||
<div className="space-y-2">
|
||||
{tags.map((_, index) => (
|
||||
// oxlint-disable-next-line react/no-array-index-key -- form array with no stable id
|
||||
<div className="flex items-center gap-2" key={index}>
|
||||
<Input placeholder="Key" {...register(`tags.${index}.key`)} />
|
||||
<Input placeholder="Value" {...register(`tags.${index}.value`)} />
|
||||
|
||||
@@ -50,7 +50,9 @@ export function InputGroupAddon({
|
||||
...props
|
||||
}: React.ComponentProps<"div"> & VariantProps<typeof inputGroupAddonVariants>) {
|
||||
return (
|
||||
// oxlint-disable-next-line jsx_a11y/click-events-have-key-events, jsx_a11y/no-noninteractive-element-interactions
|
||||
// The click only forwards focus to the input, which keyboard users reach by
|
||||
// tabbing, so it grants no capability the keyboard lacks.
|
||||
// oxlint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
|
||||
<div
|
||||
className={cn(inputGroupAddonVariants({ align }), className)}
|
||||
data-align={align}
|
||||
|
||||
@@ -4,7 +4,7 @@ import { cn } from "@/lib/utils"
|
||||
|
||||
function Label({ className, ...props }: React.ComponentProps<"label">) {
|
||||
return (
|
||||
// oxlint-disable-next-line jsx_a11y/label-has-associated-control
|
||||
// oxlint-disable-next-line jsx-a11y/label-has-associated-control -- a pass-through primitive; callers supply htmlFor or wrap the control
|
||||
<label
|
||||
className={cn(
|
||||
"flex items-center gap-2 text-sm/relaxed leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
|
||||
|
||||
@@ -30,6 +30,10 @@ const SIDEBAR_WIDTH_MOBILE = "16rem"
|
||||
const SIDEBAR_WIDTH_ICON = "3rem"
|
||||
const SIDEBAR_KEYBOARD_SHORTCUT = "b"
|
||||
|
||||
// Style objects that also carry CSS custom properties, which CSSProperties
|
||||
// alone does not admit.
|
||||
type CSSVariables = React.CSSProperties & Record<`--${string}`, string | number>
|
||||
|
||||
interface SidebarContextProps {
|
||||
state: "expanded" | "collapsed"
|
||||
open: boolean
|
||||
@@ -127,6 +131,12 @@ export function SidebarProvider({
|
||||
[state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar],
|
||||
)
|
||||
|
||||
const wrapperStyle: CSSVariables = {
|
||||
"--sidebar-width": SIDEBAR_WIDTH,
|
||||
"--sidebar-width-icon": SIDEBAR_WIDTH_ICON,
|
||||
...style,
|
||||
}
|
||||
|
||||
return (
|
||||
<SidebarContext.Provider value={contextValue}>
|
||||
<div
|
||||
@@ -135,13 +145,7 @@ export function SidebarProvider({
|
||||
className,
|
||||
)}
|
||||
data-slot="sidebar-wrapper"
|
||||
style={
|
||||
{
|
||||
"--sidebar-width": SIDEBAR_WIDTH,
|
||||
"--sidebar-width-icon": SIDEBAR_WIDTH_ICON,
|
||||
...style,
|
||||
} as React.CSSProperties
|
||||
}
|
||||
style={wrapperStyle}
|
||||
{...props}
|
||||
>
|
||||
{children}
|
||||
@@ -180,10 +184,9 @@ export function Sidebar({
|
||||
}
|
||||
|
||||
if (isMobile) {
|
||||
// oxlint-disable-next-line typescript/no-unsafe-type-assertion
|
||||
const mobileStyle = {
|
||||
const mobileStyle: CSSVariables = {
|
||||
"--sidebar-width": SIDEBAR_WIDTH_MOBILE,
|
||||
} as React.CSSProperties
|
||||
}
|
||||
return (
|
||||
<Sheet onOpenChange={setOpenMobile} open={openMobile} {...props}>
|
||||
<SheetContent
|
||||
@@ -285,7 +288,6 @@ export function SidebarRail({
|
||||
const { toggleSidebar } = useSidebar()
|
||||
|
||||
return (
|
||||
// oxlint-disable-next-line react/button-has-type
|
||||
<button
|
||||
aria-label="Toggle Sidebar"
|
||||
className={cn(
|
||||
@@ -302,6 +304,7 @@ export function SidebarRail({
|
||||
onClick={toggleSidebar}
|
||||
tabIndex={-1}
|
||||
title="Toggle Sidebar"
|
||||
type="button"
|
||||
{...props}
|
||||
/>
|
||||
)
|
||||
@@ -639,6 +642,8 @@ export function SidebarMenuSkeleton({
|
||||
() => `${Math.floor(Math.random() * 40) + 50}%`,
|
||||
)
|
||||
|
||||
const skeletonStyle: CSSVariables = { "--skeleton-width": width }
|
||||
|
||||
return (
|
||||
<div
|
||||
className={cn("flex h-8 items-center gap-2 rounded-md px-2", className)}
|
||||
@@ -655,8 +660,7 @@ export function SidebarMenuSkeleton({
|
||||
<Skeleton
|
||||
className="h-4 max-w-(--skeleton-width) flex-1"
|
||||
data-sidebar="menu-skeleton-text"
|
||||
// oxlint-disable-next-line typescript/no-unsafe-type-assertion
|
||||
style={{ "--skeleton-width": width } as React.CSSProperties}
|
||||
style={skeletonStyle}
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
|
||||
@@ -27,7 +27,6 @@ export function TagEditor({ form }: TagEditorProps) {
|
||||
return (
|
||||
<div className="space-y-2">
|
||||
{tags.map((_, index) => (
|
||||
// oxlint-disable-next-line react/no-array-index-key -- form array with no stable id
|
||||
<div className="flex items-center gap-2" key={index}>
|
||||
<Input placeholder="Key" {...form.register(`tags.${index}.key`)} />
|
||||
<Input
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
// oxlint-disable no-bitwise
|
||||
// oxlint-disable unicorn/prefer-math-trunc
|
||||
// oxlint-disable no-plusplus
|
||||
/**
|
||||
* Subnet CIDR auto-calculation from a VPC CIDR block.
|
||||
*
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
import {
|
||||
type _InstanceType,
|
||||
type PlacementStrategy,
|
||||
type RequestLaunchTemplateData,
|
||||
type Tag,
|
||||
type TagSpecification,
|
||||
type Tenancy,
|
||||
AllocateAddressCommand,
|
||||
AssociateAddressCommand,
|
||||
AssociateIamInstanceProfileCommand,
|
||||
@@ -164,17 +162,14 @@ export function useCreateInstance() {
|
||||
const client = getEc2Client()
|
||||
const securityGroupIds = await resolveSecurityGroupIds(client, params)
|
||||
const command = new RunInstancesCommand({
|
||||
// oxlint-disable-next-line typescript/prefer-nullish-coalescing
|
||||
ImageId: params.imageId || undefined,
|
||||
InstanceType: params.instanceType
|
||||
? // oxlint-disable-next-line typescript/no-unsafe-type-assertion -- AWS SDK expects _InstanceType enum
|
||||
(params.instanceType as _InstanceType)
|
||||
: undefined,
|
||||
// oxlint-disable-next-line typescript/prefer-nullish-coalescing
|
||||
KeyName: params.keyName || undefined,
|
||||
MinCount: params.count,
|
||||
MaxCount: params.count,
|
||||
// oxlint-disable-next-line typescript/prefer-nullish-coalescing
|
||||
SubnetId: params.subnetId || undefined,
|
||||
SecurityGroupIds:
|
||||
securityGroupIds.length > 0 ? securityGroupIds : undefined,
|
||||
@@ -187,7 +182,6 @@ export function useCreateInstance() {
|
||||
LaunchTemplate: params.launchTemplateId
|
||||
? {
|
||||
LaunchTemplateId: params.launchTemplateId,
|
||||
// oxlint-disable-next-line typescript/prefer-nullish-coalescing
|
||||
Version: params.launchTemplateVersion || "$Default",
|
||||
}
|
||||
: undefined,
|
||||
@@ -220,7 +214,6 @@ async function resolveSecurityGroupIds(
|
||||
const sg = await client.send(
|
||||
new CreateSecurityGroupCommand({
|
||||
GroupName: params.newSgName,
|
||||
// oxlint-disable-next-line typescript/prefer-nullish-coalescing
|
||||
Description: params.newSgDescription || "Created by launch wizard",
|
||||
VpcId: params.resolvedVpcId,
|
||||
}),
|
||||
@@ -354,7 +347,6 @@ export function useCreateLaunchTemplate() {
|
||||
mutationFn: async (params: CreateLaunchTemplateParams) => {
|
||||
const command = new CreateLaunchTemplateCommand({
|
||||
LaunchTemplateName: params.launchTemplateName,
|
||||
// oxlint-disable-next-line typescript/prefer-nullish-coalescing
|
||||
VersionDescription: params.versionDescription || undefined,
|
||||
LaunchTemplateData: buildLaunchTemplateData(params),
|
||||
})
|
||||
@@ -374,9 +366,7 @@ export function useCreateLaunchTemplateVersion() {
|
||||
mutationFn: async (params: CreateLaunchTemplateVersionParams) => {
|
||||
const command = new CreateLaunchTemplateVersionCommand({
|
||||
LaunchTemplateId: params.launchTemplateId,
|
||||
// oxlint-disable-next-line typescript/prefer-nullish-coalescing
|
||||
SourceVersion: params.sourceVersion || undefined,
|
||||
// oxlint-disable-next-line typescript/prefer-nullish-coalescing
|
||||
VersionDescription: params.versionDescription || undefined,
|
||||
LaunchTemplateData: buildLaunchTemplateData(params),
|
||||
})
|
||||
@@ -579,7 +569,6 @@ export function useCreateSnapshot() {
|
||||
mutationFn: async (params: CreateSnapshotFormData) => {
|
||||
const command = new CreateSnapshotCommand({
|
||||
VolumeId: params.volumeId,
|
||||
// oxlint-disable-next-line typescript/prefer-nullish-coalescing
|
||||
Description: params.description || undefined,
|
||||
})
|
||||
return await getEc2Client().send(command)
|
||||
@@ -612,7 +601,6 @@ export function useCopySnapshot() {
|
||||
const command = new CopySnapshotCommand({
|
||||
SourceSnapshotId: params.sourceSnapshotId,
|
||||
SourceRegion: params.sourceRegion,
|
||||
// oxlint-disable-next-line typescript/prefer-nullish-coalescing
|
||||
Description: params.description || undefined,
|
||||
})
|
||||
return await getEc2Client().send(command)
|
||||
@@ -630,7 +618,6 @@ export function useAttachVolume() {
|
||||
const command = new AttachVolumeCommand({
|
||||
VolumeId: params.volumeId,
|
||||
InstanceId: params.instanceId,
|
||||
// oxlint-disable-next-line typescript/prefer-nullish-coalescing
|
||||
Device: params.device || undefined,
|
||||
})
|
||||
return await getEc2Client().send(command)
|
||||
@@ -648,7 +635,6 @@ export function useDetachVolume() {
|
||||
mutationFn: async (params: DetachVolumeFormData) => {
|
||||
const command = new DetachVolumeCommand({
|
||||
VolumeId: params.volumeId,
|
||||
// oxlint-disable-next-line typescript/prefer-nullish-coalescing
|
||||
InstanceId: params.instanceId || undefined,
|
||||
Force: params.force,
|
||||
})
|
||||
@@ -698,7 +684,6 @@ export function useCreateImage() {
|
||||
const command = new CreateImageCommand({
|
||||
InstanceId: params.instanceId,
|
||||
Name: params.name,
|
||||
// oxlint-disable-next-line typescript/prefer-nullish-coalescing
|
||||
Description: params.description || undefined,
|
||||
})
|
||||
return await getEc2Client().send(command)
|
||||
@@ -719,7 +704,6 @@ export function useRegisterImage() {
|
||||
}) => {
|
||||
const command = new RegisterImageCommand({
|
||||
Name: params.name,
|
||||
// oxlint-disable-next-line typescript/prefer-nullish-coalescing
|
||||
Description: params.description || undefined,
|
||||
BlockDeviceMappings: [
|
||||
{
|
||||
@@ -796,7 +780,6 @@ export function useCreateSubnet() {
|
||||
new CreateSubnetCommand({
|
||||
VpcId: params.vpcId,
|
||||
CidrBlock: params.cidrBlock,
|
||||
// oxlint-disable-next-line typescript/prefer-nullish-coalescing
|
||||
AvailabilityZone: params.availabilityZone || undefined,
|
||||
}),
|
||||
)
|
||||
@@ -838,8 +821,7 @@ export function useCreatePlacementGroup() {
|
||||
mutationFn: async (params: CreatePlacementGroupFormData) => {
|
||||
const command = new CreatePlacementGroupCommand({
|
||||
GroupName: params.groupName,
|
||||
// oxlint-disable-next-line typescript/no-unsafe-type-assertion -- AWS SDK expects PlacementStrategy enum
|
||||
Strategy: params.strategy as PlacementStrategy,
|
||||
Strategy: params.strategy,
|
||||
})
|
||||
return await getEc2Client().send(command)
|
||||
},
|
||||
@@ -1428,12 +1410,10 @@ export function useCreateVpcWizard() {
|
||||
try {
|
||||
// Step 1: Create VPC
|
||||
const vpcName = prefix ? `${prefix}-vpc` : params.namePrefix
|
||||
// oxlint-disable-next-line typescript/no-unsafe-type-assertion -- AWS SDK expects Tenancy enum
|
||||
const tenancy = params.tenancy as Tenancy
|
||||
const vpcResult = await client.send(
|
||||
new CreateVpcCommand({
|
||||
CidrBlock: params.cidrBlock,
|
||||
InstanceTenancy: tenancy,
|
||||
InstanceTenancy: params.tenancy,
|
||||
TagSpecifications: buildTagSpec(
|
||||
ResourceType.vpc,
|
||||
vpcName,
|
||||
|
||||
@@ -55,7 +55,6 @@ export function useCreateUser() {
|
||||
mutationFn: async (params: CreateUserFormData) => {
|
||||
const command = new CreateUserCommand({
|
||||
UserName: params.userName,
|
||||
// oxlint-disable-next-line typescript/prefer-nullish-coalescing
|
||||
Path: params.path || undefined,
|
||||
})
|
||||
return await getIamClient().send(command)
|
||||
@@ -135,7 +134,6 @@ export function useCreatePolicy() {
|
||||
mutationFn: async (params: CreatePolicyFormData) => {
|
||||
const command = new CreatePolicyCommand({
|
||||
PolicyName: params.policyName,
|
||||
// oxlint-disable-next-line typescript/prefer-nullish-coalescing
|
||||
Description: params.description || undefined,
|
||||
PolicyDocument: params.policyDocument,
|
||||
})
|
||||
@@ -243,9 +241,7 @@ export function useCreateRole() {
|
||||
mutationFn: async (params: CreateRoleFormData) => {
|
||||
const command = new CreateRoleCommand({
|
||||
RoleName: params.roleName,
|
||||
// oxlint-disable-next-line typescript/prefer-nullish-coalescing
|
||||
Path: params.path || undefined,
|
||||
// oxlint-disable-next-line typescript/prefer-nullish-coalescing
|
||||
Description: params.description || undefined,
|
||||
AssumeRolePolicyDocument: params.assumeRolePolicyDocument,
|
||||
})
|
||||
@@ -353,7 +349,6 @@ export function useCreateInstanceProfile() {
|
||||
mutationFn: async (params: CreateInstanceProfileFormData) => {
|
||||
const command = new CreateInstanceProfileCommand({
|
||||
InstanceProfileName: params.instanceProfileName,
|
||||
// oxlint-disable-next-line typescript/prefer-nullish-coalescing
|
||||
Path: params.path || undefined,
|
||||
})
|
||||
return await getIamClient().send(command)
|
||||
@@ -431,7 +426,6 @@ export function useCreateGroup() {
|
||||
mutationFn: async (params: CreateGroupFormData) => {
|
||||
const command = new CreateGroupCommand({
|
||||
GroupName: params.groupName,
|
||||
// oxlint-disable-next-line typescript/prefer-nullish-coalescing
|
||||
Path: params.path || undefined,
|
||||
})
|
||||
return await getIamClient().send(command)
|
||||
|
||||
-2
@@ -259,13 +259,11 @@ function InstanceDetail() {
|
||||
</DetailCard>
|
||||
|
||||
{/* Network & Security */}
|
||||
{/* oxlint-disable typescript/prefer-nullish-coalescing */}
|
||||
{(instance.PrivateIpAddress ||
|
||||
instance.PublicIpAddress ||
|
||||
instance.VpcId ||
|
||||
instance.SubnetId ||
|
||||
(instance.SecurityGroups && instance.SecurityGroups.length > 0)) && (
|
||||
/* oxlint-enable typescript/prefer-nullish-coalescing */
|
||||
<DetailCard>
|
||||
<DetailCard.Header>Network & Security</DetailCard.Header>
|
||||
<DetailCard.Content>
|
||||
|
||||
-3
@@ -347,7 +347,6 @@ export function CreateLoadBalancerPage() {
|
||||
</p>
|
||||
<ul className="mt-1 list-inside list-disc text-xs text-destructive">
|
||||
{wizardResult.created.map((r, i) => (
|
||||
// oxlint-disable-next-line react/no-array-index-key -- error list with no stable id
|
||||
<li key={i}>
|
||||
{r.type}: {r.id ?? "(created)"}
|
||||
</li>
|
||||
@@ -540,7 +539,6 @@ export function CreateLoadBalancerPage() {
|
||||
<FieldTitle>Tags</FieldTitle>
|
||||
<div className="space-y-2">
|
||||
{tags.map((_, index) => (
|
||||
// oxlint-disable-next-line react/no-array-index-key -- form array with no stable id
|
||||
<div className="flex items-center gap-2" key={index}>
|
||||
<Input placeholder="Key" {...register(`tags.${index}.key`)} />
|
||||
<Input
|
||||
@@ -829,7 +827,6 @@ export function CreateLoadBalancerPage() {
|
||||
)
|
||||
}
|
||||
|
||||
// oxlint-disable-next-line complexity -- CLI preview composition
|
||||
function buildCreateLbCommands(
|
||||
watch: (name?: string) => unknown,
|
||||
tgWatch: (name?: string) => unknown,
|
||||
|
||||
@@ -104,7 +104,6 @@ function CreateVpc() {
|
||||
: data.namePrefix
|
||||
const result = await createVpcMutation.mutateAsync({
|
||||
cidrBlock: data.cidrBlock,
|
||||
// oxlint-disable-next-line typescript/prefer-nullish-coalescing
|
||||
name: name || undefined,
|
||||
})
|
||||
const vpcId = result.Vpc?.VpcId
|
||||
@@ -158,7 +157,6 @@ function CreateVpc() {
|
||||
</p>
|
||||
<ul className="mt-1 list-inside list-disc text-xs text-destructive">
|
||||
{wizardResult.created.map((r, i) => (
|
||||
// oxlint-disable-next-line react/no-array-index-key -- error list with no stable id
|
||||
<li key={i}>
|
||||
{r.type}: {r.id}
|
||||
</li>
|
||||
|
||||
-1
@@ -368,7 +368,6 @@ export function CreateClusterPage() {
|
||||
<span className="font-mono">0.0.0.0/0</span>.
|
||||
</p>
|
||||
{publicCidrs.map((cidr, index) => (
|
||||
// eslint-disable-next-line react/no-array-index-key
|
||||
<div className="flex items-center gap-2" key={index}>
|
||||
<Input
|
||||
aria-label={`Public access CIDR ${index + 1}`}
|
||||
|
||||
+11
-12
@@ -209,11 +209,9 @@ export function CreateDBInstancePage() {
|
||||
const allSecurityGroups = securityGroupsData.SecurityGroups ?? []
|
||||
const securityGroups = securityGroupsForVpc(allSecurityGroups, placementVpcId)
|
||||
|
||||
const handleEngineChange = (engine: string | null) => {
|
||||
// oxlint-disable-next-line typescript/prefer-nullish-coalescing -- Select reports an explicit null when cleared
|
||||
const nextEngine = engine === null ? "" : engine
|
||||
setValue("engine", nextEngine, { shouldValidate: true })
|
||||
setValue("engineVersion", firstBootableVersion(nextEngine))
|
||||
const handleEngineChange = (engine: string) => {
|
||||
setValue("engine", engine, { shouldValidate: true })
|
||||
setValue("engineVersion", firstBootableVersion(engine))
|
||||
setValue("dbInstanceClass", "")
|
||||
setValue("dbParameterGroupName", "")
|
||||
}
|
||||
@@ -221,13 +219,11 @@ export function CreateDBInstancePage() {
|
||||
const setSecurityGroups = (next: string[]) =>
|
||||
setValue("vpcSecurityGroupIds", next, { shouldValidate: true })
|
||||
|
||||
const handleSubnetGroupChange = (name: string | null) => {
|
||||
// oxlint-disable-next-line typescript/prefer-nullish-coalescing -- Select reports an explicit null when cleared
|
||||
const nextName = name === null ? "" : name
|
||||
const handleSubnetGroupChange = (name: string) => {
|
||||
const nextVpcId =
|
||||
subnetGroups.find((group) => group.DBSubnetGroupName === nextName)
|
||||
?.VpcId ?? defaultVpcId
|
||||
setValue("dbSubnetGroupName", nextName, { shouldValidate: true })
|
||||
subnetGroups.find((group) => group.DBSubnetGroupName === name)?.VpcId ??
|
||||
defaultVpcId
|
||||
setValue("dbSubnetGroupName", name, { shouldValidate: true })
|
||||
setSecurityGroups(
|
||||
securityGroupIdsForVpc(
|
||||
allSecurityGroups,
|
||||
@@ -316,7 +312,10 @@ export function CreateDBInstancePage() {
|
||||
control={control}
|
||||
name="engine"
|
||||
render={({ field }) => (
|
||||
<Select onValueChange={handleEngineChange} value={field.value}>
|
||||
<Select
|
||||
onValueChange={(value) => handleEngineChange(value ?? "")}
|
||||
value={field.value}
|
||||
>
|
||||
<SelectTrigger
|
||||
aria-invalid={!!errors.engine}
|
||||
className="w-full"
|
||||
|
||||
+5
-7
@@ -164,19 +164,17 @@ export function RestoreDBSnapshotPage({ dbSnapshotIdentifier }: Props) {
|
||||
setValue("vpcSecurityGroupIds", next, { shouldValidate: true })
|
||||
}
|
||||
|
||||
const handleSubnetGroupChange = (name: string | null) => {
|
||||
// oxlint-disable-next-line typescript/prefer-nullish-coalescing -- Select reports an explicit null when cleared
|
||||
const nextName = name === null ? "" : name
|
||||
const handleSubnetGroupChange = (name: string) => {
|
||||
const nextVpcId =
|
||||
subnetGroups.find((group) => group.DBSubnetGroupName === nextName)
|
||||
?.VpcId ?? snapshot?.VpcId
|
||||
subnetGroups.find((group) => group.DBSubnetGroupName === name)?.VpcId ??
|
||||
snapshot?.VpcId
|
||||
let nextSecurityGroups = securityGroupIdsForVpc(
|
||||
allSecurityGroups,
|
||||
nextVpcId,
|
||||
selectedSecurityGroups,
|
||||
)
|
||||
if (
|
||||
nextName !== "" &&
|
||||
name !== "" &&
|
||||
nextVpcId !== snapshot?.VpcId &&
|
||||
nextSecurityGroups.length === 0
|
||||
) {
|
||||
@@ -186,7 +184,7 @@ export function RestoreDBSnapshotPage({ dbSnapshotIdentifier }: Props) {
|
||||
)
|
||||
nextSecurityGroups = defaultGroupId ? [defaultGroupId] : []
|
||||
}
|
||||
setValue("dbSubnetGroupName", nextName, { shouldValidate: true })
|
||||
setValue("dbSubnetGroupName", name, { shouldValidate: true })
|
||||
setSecurityGroups(nextSecurityGroups)
|
||||
}
|
||||
|
||||
|
||||
+4
-3
@@ -36,10 +36,11 @@ export function ObjectListItem({
|
||||
const response = await getS3Client().send(command)
|
||||
|
||||
if (response.Body) {
|
||||
// tsgolint cannot resolve the SDK's conditional streaming-blob type and
|
||||
// reports Body as an error type; tsc types it correctly.
|
||||
// oxlint-disable-next-line typescript/no-unsafe-call, typescript/no-unsafe-member-access, typescript/no-unsafe-assignment
|
||||
const blob = await response.Body.transformToByteArray()
|
||||
// oxlint-disable-next-line typescript/no-unsafe-type-assertion
|
||||
const url = URL.createObjectURL(new Blob([blob as BlobPart]))
|
||||
const bytes = await response.Body.transformToByteArray()
|
||||
const url = URL.createObjectURL(new Blob([bytes]))
|
||||
|
||||
const link = document.createElement("a")
|
||||
link.href = url
|
||||
|
||||
@@ -61,15 +61,22 @@ function BucketObjectsWithPrefix() {
|
||||
]
|
||||
|
||||
// Get parent path for back navigation
|
||||
const parentPath =
|
||||
pathParts.length > 1
|
||||
? `/s3/ls/${bucket}/${pathParts.slice(0, -1).join("/")}/`
|
||||
: `/s3/ls/${bucket}`
|
||||
const parentSplat = `${pathParts.slice(0, -1).join("/")}/`
|
||||
|
||||
return (
|
||||
<>
|
||||
{/* oxlint-disable-next-line typescript/no-explicit-any, typescript/no-unsafe-type-assertion, typescript/no-unsafe-assignment -- dynamic route path */}
|
||||
<BackLink to={parentPath as any}>Back</BackLink>
|
||||
{pathParts.length > 1 ? (
|
||||
<BackLink
|
||||
params={{ bucket, _splat: parentSplat }}
|
||||
to="/s3/ls/$bucket/$"
|
||||
>
|
||||
Back
|
||||
</BackLink>
|
||||
) : (
|
||||
<BackLink params={{ bucket }} to="/s3/ls/$bucket">
|
||||
Back
|
||||
</BackLink>
|
||||
)}
|
||||
<div className="mb-6">
|
||||
<div className="mb-2 flex items-center justify-between">
|
||||
<div className="flex items-center gap-2 text-sm text-muted-foreground">
|
||||
|
||||
@@ -408,7 +408,7 @@ export const createPlacementGroupSchema = z.object({
|
||||
/^[\w\s._\-:/()#,@[\]+=&;{}!$*]+$/,
|
||||
"Group name contains invalid characters",
|
||||
),
|
||||
strategy: z.string().min(1, "Strategy is required"),
|
||||
strategy: z.enum(["spread", "cluster"]),
|
||||
})
|
||||
|
||||
export type CreatePlacementGroupFormData = z.infer<
|
||||
|
||||
Reference in New Issue
Block a user