-
Notifications
You must be signed in to change notification settings - Fork 0
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
fix: miscellaneous fixes to table components #610
base: staging
Are you sure you want to change the base?
Conversation
Visit the preview URL for this PR (updated for commit a101fce): https://jump-math-staging--pr610-carissa-fix-search-b-b1k0j8ac.web.app (expires Mon, 06 Nov 2023 05:26:18 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: c42d8d0d853b05885664a2dd73f8245f4333ae51 |
return ( | ||
<Center __css={styles}> | ||
<MessageContainer | ||
image={DisplayStudentsIllustration} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not the most fitting image, but i don't think we have another design for this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair! Let's add a backlog ticket to ask design for a better image, but I'm fine with keeping this image for the mvp
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great! Just a couple of minor comments and one larger question about accessibility
@@ -44,7 +44,7 @@ const Pagination = ({ | |||
< Previous | |||
</PaginationPrevious> | |||
)} | |||
<PaginationPageGroup align="center" isInline> | |||
<HStack align="center"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In order to maintain semantic HTML I think we should use the library's built-in components (according to here the component already sets isInline
so we sidestep the deprecation), or else duplicate all the other props that the library already sets.
{filterMenuComponent} | ||
</HStack> | ||
<VStack py={4} spacing={6} w="full"> | ||
{!noResults && ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to make sure, have you checked that we never pass in filteredData.length
for this prop anywhere? That would result in filters breaking the page, so you can probably just set the filters on every filter page to a combination with no results.
@@ -109,11 +104,13 @@ const DisplayAssessmentsPage = (): React.ReactElement => { | |||
<SearchableTablePage | |||
filterMenuComponent={<FilterMenu filterProps={filterOptions} />} | |||
nameOfTableItems="assessments" | |||
noResults={isEmpty} | |||
noResults={(data?.tests?.length ?? 0) === 0} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could also just do !data?.tests?.length
@@ -100,7 +100,7 @@ const DisplayClassroomAssessmentsPage = () => { | |||
<QueryStateHandler error={error} loading={loading}> | |||
<SearchableTablePage | |||
nameOfTableItems="assessments" | |||
noResults={paginatedData.length === 0} | |||
noResults={(data?.class?.testSessions?.length ?? 0) === 0} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto
noResults={(data?.class?.testSessions?.length ?? 0) === 0} | |
noResults={!data?.class?.testSessions?.length} |
<AdminTab | ||
<SearchableTablePage | ||
nameOfTableItems="teachers" | ||
noResults={(teacherData?.teachers?.length ?? 0) === 0} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
noResults={(teacherData?.teachers?.length ?? 0) === 0} | |
noResults={!teacherData?.teachers?.length} |
return ( | ||
<Center __css={styles}> | ||
<MessageContainer | ||
image={DisplayStudentsIllustration} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair! Let's add a backlog ticket to ask design for a better image, but I'm fine with keeping this image for the mvp
Notion ticket link
N/A
Implementation description
AdminTab
withSearchableTablePage
EmptyUsersMessage
for empty admin / teacher tableisInline
withHStack
search
to SearchBar to clear input on tab switchSteps to test
What should reviewers focus on?
Checklist