File tree Expand file tree Collapse file tree 17 files changed +39
-36
lines changed
platform/src/components/DbLabInstanceInstallForm
components/ResetCloneModal Expand file tree Collapse file tree 17 files changed +39
-36
lines changed Original file line number Diff line number Diff line change 1- import { defineConfig } from " cypress" ;
1+ import { defineConfig } from ' cypress'
22
33export default defineConfig ( {
4+ pageLoadTimeout : 10000 ,
5+ defaultCommandTimeout : 10000 ,
46 e2e : {
57 testIsolation : false ,
68 supportFile : false ,
@@ -11,8 +13,8 @@ export default defineConfig({
1113
1214 component : {
1315 devServer : {
14- framework : " create-react-app" ,
15- bundler : " webpack" ,
16+ framework : ' create-react-app' ,
17+ bundler : ' webpack' ,
1618 } ,
1719 } ,
18- } ) ;
20+ } )
Original file line number Diff line number Diff line change @@ -99,7 +99,7 @@ export const DbLabInstanceFormInstallSidebar = ({
9999 variant = "contained"
100100 color = "primary"
101101 onClick = { handleCreate }
102- disabled = { ! state . name || ! state . verificationToken || ! disabled }
102+ disabled = { ! state . name || ! state . verificationToken || disabled }
103103 >
104104 Install DLE
105105 </ Button >
Original file line number Diff line number Diff line change @@ -18,15 +18,14 @@ import { ImportantText } from '@postgres.ai/shared/components/ImportantText'
1818import { Spinner } from '@postgres.ai/shared/components/Spinner'
1919import { SimpleModalControls } from '@postgres.ai/shared/components/SimpleModalControls'
2020import { compareSnapshotsDesc } from '@postgres.ai/shared/utils/snapshot'
21- import { InstanceState } from '@postgres.ai/shared/types/api/entities/instanceState'
2221
2322type Props = {
2423 isOpen : boolean
2524 onClose : ( ) => void
2625 clone : Clone
2726 onResetClone : ( snapshotId : string ) => void
2827 snapshots : Snapshot [ ] | null
29- version : InstanceState [ 'engine' ] [ 'version' ]
28+ version : string | null | undefined
3029}
3130
3231const useStyles = makeStyles (
Original file line number Diff line number Diff line change @@ -398,7 +398,7 @@ export const Clone = observer((props: Props) => {
398398
399399 < p className = { classes . text } >
400400 < span className = { classes . paramTitle } > Logical data size:</ span >
401- { instance . state . dataSize
401+ { instance . state ? .dataSize
402402 ? formatBytesIEC ( instance . state . dataSize )
403403 : '-' }
404404 </ p >
@@ -625,7 +625,7 @@ export const Clone = observer((props: Props) => {
625625 clone = { clone }
626626 snapshots = { stores . main . snapshots . data }
627627 onResetClone = { resetClone }
628- version = { instance . state . engine . version }
628+ version = { instance . state ? .engine . version }
629629 />
630630 </ >
631631 </ div >
Original file line number Diff line number Diff line change @@ -210,7 +210,7 @@ export const CreateClone = observer((props: Props) => {
210210 < p className = { styles . param } >
211211 < span > Data size:</ span >
212212 < strong >
213- { stores . main . instance . state . dataSize
213+ { stores . main . instance . state ? .dataSize
214214 ? formatBytesIEC ( stores . main . instance . state . dataSize )
215215 : '-' }
216216 </ strong >
@@ -220,7 +220,7 @@ export const CreateClone = observer((props: Props) => {
220220 < span > Expected cloning time:</ span >
221221 < strong >
222222 { round (
223- stores . main . instance . state . cloning . expectedCloningTime ,
223+ stores . main . instance . state ? .cloning . expectedCloningTime as number ,
224224 2 ,
225225 ) } { ' ' }
226226 s
Original file line number Diff line number Diff line change @@ -63,15 +63,15 @@ export const Clones = observer(() => {
6363 const host = useHost ( )
6464
6565 const { instance } = stores . main
66- if ( ! instance ) return null
66+ if ( ! instance || ! instance . state ) return null
6767
6868 const isShortList = isMobile && isShortListForMobile
6969 const toggleListSize = ( ) => setIsShortListForMobile ( ! isShortListForMobile )
7070
7171 const goToCloneAddPage = ( ) => history . push ( host . routes . createClone ( ) )
7272
7373 const showListSizeButton =
74- instance . state . cloning . clones ?. length > SHORT_LIST_SIZE && isMobile
74+ instance . state ? .cloning . clones ?. length > SHORT_LIST_SIZE && isMobile
7575
7676 const isLoadingSnapshots = stores . main . snapshots . isLoading
7777 const hasSnapshots = Boolean ( stores . main . snapshots . data ?. length )
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ export const ClonesModal = observer(() => {
3636
3737 return (
3838 < Modal
39- title = { `Clones (${ instance . state . cloning . clones . length } )` }
39+ title = { `Clones (${ instance . state ? .cloning . clones . length } )` }
4040 isOpen = { isOpenModal }
4141 onClose = { closeModal }
4242 size = "md"
@@ -58,7 +58,7 @@ export const ClonesModal = observer(() => {
5858 >
5959 < ClonesList
6060 isDisabled = { false }
61- clones = { instance . state . cloning . clones . filter ( ( clone ) => {
61+ clones = { instance . state ? .cloning . clones . filter ( ( clone ) => {
6262 const isMatchedByPool = ! pool || pool === clone . snapshot ?. pool
6363 const isMatchedBySnapshot =
6464 ! snapshotId || snapshotId === clone . snapshot ?. id
Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ export const InactiveInstance = ({
6060} ) => {
6161 const classes = useStyles ( )
6262
63- const getVersionDigits = ( str : string | undefined ) => {
63+ const getVersionDigits = ( str : string | undefined | null ) => {
6464 if ( ! str ) {
6565 return 'N/A'
6666 }
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ export const Disks = observer(() => {
2222
2323 return (
2424 < Section title = "Disks" >
25- { instance . state . pools ?. map ( ( pool ) => {
25+ { instance . state ? .pools ?. map ( ( pool ) => {
2626 return (
2727 < Disk
2828 key = { pool . name }
@@ -38,11 +38,11 @@ export const Disks = observer(() => {
3838 totalDataSize = { pool . fileSystem . size }
3939 usedDataSize = { pool . fileSystem . used }
4040 freeDataSize = { pool . fileSystem . free }
41- refreshingStartDate = { instance . state . retrieving ?. lastRefresh ?? null }
41+ refreshingStartDate = { instance . state ? .retrieving ?. lastRefresh ?? null }
4242 />
4343 )
4444 } ) ??
45- ( instance . state . fileSystem && (
45+ ( instance . state ? .fileSystem && (
4646 < Disk
4747 status = { 'active' }
4848 name = { 'Main' }
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ export const RefreshFailedAlert = observer(() => {
1212 const stores = useStores ( )
1313
1414 const refreshFailed =
15- stores . main . instance ?. state . retrieving ?. alerts ?. refreshFailed
15+ stores . main . instance ?. state ? .retrieving ?. alerts ?. refreshFailed
1616 if ( ! refreshFailed ) return null
1717
1818 return (
You can’t perform that action at this time.
0 commit comments