Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

various small fixes #1109

Merged
merged 7 commits into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions frontend/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import Link from 'next/link'
import React, { ChangeEvent, Fragment, useCallback, useState } from 'react'
import ChipSelector from 'src/common/ChipSelector'
import EmptyBlob from 'src/common/EmptyBlob'
import MultipleErrorWrapper from 'src/errors/MultipleErrorWrapper'
import useDebounce from 'src/hooks/useDebounce'
import MessageAlert from 'src/MessageAlert'
import Wrapper from 'src/Wrapper'

interface KeyAndLabel {
Expand Down Expand Up @@ -75,11 +75,6 @@ function Marketplace() {
e.preventDefault()
}

const error = MultipleErrorWrapper(`Unable to load marketplace page`, {
isModelsError,
})
if (error) return error

return (
<Stack direction={{ xs: 'column', sm: 'row' }} spacing={2}>
<Stack spacing={2} sx={{ maxWidth: '250px' }}>
Expand Down Expand Up @@ -163,6 +158,7 @@ function Marketplace() {
</Tabs>
</Box>
<div data-test='modelListBox'>
{isModelsError && <MessageAlert message={isModelsError.info.message} severity='error' />}
{models.length === 0 && <EmptyBlob data-test='emptyModelListBlob' text='No models here' />}
{models.map((model, index) => {
return (
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/MessageAlert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ type MessageAlertProps = {
message?: string
severity?: AlertProps['severity']
'data-test'?: string
hideContactUs?: boolean
} & PartialMessageAlertProps

export default function MessageAlert({
Expand All @@ -30,6 +31,7 @@ export default function MessageAlert({
linkText,
href,
'data-test': dataTest,
hideContactUs = false,
}: MessageAlertProps) {
const alertRef = useRef<HTMLDivElement>(null)
const [showContactMessage, setShowContactMessage] = useState(false)
Expand Down Expand Up @@ -73,7 +75,7 @@ export default function MessageAlert({
)}
</Stack>
<Typography>{!!(href && linkText) && <Link href={href}>{linkText}</Link>}</Typography>
{severity === 'error' && (
{severity === 'error' && !hideContactUs && (
<>
<div>
<Button
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/model/releases/ReleaseDisplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ export default function ReleaseDisplay({
))}
</>
)}
{(reviewsWithLatestResponses.length > 0 || release.comments.length > 0) && <Divider sx={{ my: 2 }} />}
{(reviewsWithLatestResponses.length > 0 || release.comments.length > 0) && <Divider />}
<Stack direction='row' justifyContent='space-between' spacing={2}>
<div>
<ReviewDisplay reviews={reviewsWithLatestResponses} />
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/wrapper/ModelSearchField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export default function ModelSearchField() {
}

if (isModelsError) {
return <MessageAlert message={isModelsError.info.message} severity='error' />
return <MessageAlert message={isModelsError.info.message} severity='error' hideContactUs />
}

return (
Expand Down
1 change: 1 addition & 0 deletions frontend/src/wrapper/TopNavigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ export default function TopNavigation({ drawerOpen = false, pageTopStyling = {},
</Stack>
</Link>
</Box>
<span style={{ width: '100%' }}></span>
{isSmOrLarger && (
<Box>
<Stack direction='row' spacing={2} justifyContent='center' alignItems='center'>
Expand Down
Loading