diff --git a/src/features/AddModel/AddModelDialog/AddModelDialog.styled.ts b/src/features/AddModel/AddModelDialog/AddModelDialog.styled.ts index 72b7fab3..ad50b34b 100644 --- a/src/features/AddModel/AddModelDialog/AddModelDialog.styled.ts +++ b/src/features/AddModel/AddModelDialog/AddModelDialog.styled.ts @@ -15,7 +15,8 @@ const StyledDialogCustomContent = styled(Dialog.CustomContent)` display: flex; flex-direction: column; row-gap: ${spacings.X_LARGE}; - height: 740px; + height: fit-content; + padding-bottom: ${spacings.XXX_LARGE}; > p { &.error { diff --git a/src/features/AddModel/AddModelDialog/AddModelDialog.tsx b/src/features/AddModel/AddModelDialog/AddModelDialog.tsx index 2f2f6119..0da0f7d0 100644 --- a/src/features/AddModel/AddModelDialog/AddModelDialog.tsx +++ b/src/features/AddModel/AddModelDialog/AddModelDialog.tsx @@ -119,7 +119,9 @@ export const AddModelDialog = ({ return ( - Add new model + + {isEdit ? 'Edit model details' : 'Add new model'} + {!isEdit && ( diff --git a/src/features/ModelTable/ModelTable.styled.ts b/src/features/ModelTable/ModelTable.styled.ts index b4c2df3c..07194bc7 100644 --- a/src/features/ModelTable/ModelTable.styled.ts +++ b/src/features/ModelTable/ModelTable.styled.ts @@ -10,8 +10,18 @@ export const Table = styled.div` min-width: 90% !important; } > div { + margin-top: 2rem; min-width: 90% !important; } + + @media (max-width: 1500px) { + > table { + min-width: 100% !important; + } + > div { + min-width: 100% !important; + } + } } `; @@ -25,7 +35,6 @@ export const Buttons = styled.div` export const List = styled.div` display: flex; flex-direction: row; - overflow: auto; > p { padding-right: ${spacings.X_SMALL}; } diff --git a/src/features/ModelTable/ModelTable.tsx b/src/features/ModelTable/ModelTable.tsx index 4387cf1f..a1674b1a 100644 --- a/src/features/ModelTable/ModelTable.tsx +++ b/src/features/ModelTable/ModelTable.tsx @@ -35,6 +35,7 @@ export const ModelTable = ({ queryKey: ['analogue-models'], queryFn: () => AnalogueModelsService.getApiAnalogueModels(), enabled: !!token, + refetchInterval: 60000, }); if (isLoading || !data?.success) return

Loading...

; @@ -54,7 +55,7 @@ export const ModelTable = ({ }; const isTransforming = (id: string, status: boolean) => { - if (transforming && id === activeUploadId) { + if (transforming && id === activeUploadId && !status) { return <>Transforming model; } else { return status && <>Ready; @@ -70,20 +71,15 @@ export const ModelTable = ({ emptyMessage="Empty :(" columnResizeMode="onChange" rows={data.data} - pageSize={5} + pageSize={10} columns={[ - { - accessorKey: 'analogueModelId', - header: 'Model ID', - id: 'analogueModelId', - }, { accessorKey: 'name', header: 'Model name', id: 'name' }, { accessorKey: 'analogues', id: 'analogues', header: 'Analogue', enableColumnFilter: false, - size: 120, + size: 100, cell: ({ row }) => ( {row.original.analogues.map((a) => ( @@ -97,7 +93,7 @@ export const ModelTable = ({ id: 'formation', header: 'Formation', enableColumnFilter: false, - size: 120, + size: 150, cell: ({ row }) => ( {row.original.metadata @@ -113,7 +109,7 @@ export const ModelTable = ({ id: 'zone', header: 'Zone', enableColumnFilter: false, - size: 120, + size: 150, cell: ({ row }) => ( {row.original.metadata @@ -129,6 +125,7 @@ export const ModelTable = ({ id: 'field', header: 'Field', enableColumnFilter: false, + size: 200, cell: ({ row }) => ( {row.original.metadata @@ -145,7 +142,7 @@ export const ModelTable = ({ id: 'isProcessed', header: 'Status', enableColumnFilter: false, - size: 50, + size: 100, cell: ({ row }) => ( <> {isActiveModel(row.original.analogueModelId) ? ( @@ -175,7 +172,6 @@ export const ModelTable = ({ enableColumnFilter: false, enableResizing: false, maxSize: 220, - size: 200, cell: ({ row }) => (