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

UI tweaks for the comment listing page #1854

Merged
merged 1 commit into from
Jul 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export const AdvancedSearch = () => {
</TextField>
</Grid>
<Grid item xs={12} sm={6} md={4} lg={4}>
<MetLabel>Filter by Comment Date - From</MetLabel>
<MetLabel>Comment Date - From</MetLabel>
<TextField
name="commentDateFrom"
type="date"
Expand All @@ -79,7 +79,7 @@ export const AdvancedSearch = () => {
/>
</Grid>
<Grid item xs={12} sm={6} md={4} lg={4}>
<MetLabel>Filter by Comment Date - To</MetLabel>
<MetLabel>Comment Date - To</MetLabel>
<TextField
name="commentDateTo"
type="date"
Expand Down Expand Up @@ -120,7 +120,7 @@ export const AdvancedSearch = () => {
/>
</Grid>
<Grid item xs={12} sm={6} md={4} lg={4}>
<MetLabel>Filter by Reviewed Date - From</MetLabel>
<MetLabel>Review Date - From</MetLabel>
<TextField
name="reviewedDateFrom"
type="date"
Expand All @@ -136,7 +136,7 @@ export const AdvancedSearch = () => {
/>
</Grid>
<Grid item xs={12} sm={6} md={4} lg={4}>
<MetLabel>Filter by Reviewed Date - To</MetLabel>
<MetLabel>Review Date - To</MetLabel>
<TextField
name="reviewedDateTo"
type="date"
Expand All @@ -160,7 +160,6 @@ export const AdvancedSearch = () => {
justifyContent="flex-end"
>
<SecondaryButton
size="small"
onClick={() => {
setAdvancedSearchFilters(initialSearchFilters);
setSearchFilters(initialSearchFilters);
Expand Down
86 changes: 44 additions & 42 deletions met-web/src/components/comments/admin/reviewListing/Submissions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,49 +112,51 @@ const Submissions = () => {
container
rowSpacing={1}
>
<Stack direction={{ xs: 'column', md: 'row' }} spacing={1} width="100%" justifyContent="space-between">
<Stack direction="row" spacing={1}>
<TextField
id="comments"
variant="outlined"
label="Search Comments"
value={searchText}
onChange={(e) => setSearchText(e.target.value)}
size="small"
/>
<PrimaryButton
data-testid="CommentListing/search-button"
onClick={() => handleSearchBarClick(searchText)}
>
<SearchIcon />
</PrimaryButton>
<SecondaryButton
data-testid="comment-listing/advanced-search-button"
onClick={() => setIsAdvancedSearchOpen(!isAdvancedSearchOpen)}
startIcon={
<ExpandMoreIcon
sx={{
transition: (theme) =>
theme.transitions.create('transform', {
duration: theme.transitions.duration.shortest,
}),
transform: isAdvancedSearchOpen ? 'rotate(180deg)' : 'rotate(0deg)',
}}
/>
}
>
Advanced Search
</SecondaryButton>
</Stack>
<Stack direction="row" spacing={1}>
<PrimaryButton component={Link} to={`/surveys/${survey.id}/comments/all`}>
Read All Comments
</PrimaryButton>
<SecondaryButton onClick={handleExportComments} loading={isExporting}>
Export to CSV
</SecondaryButton>
<Grid item xs={12}>
<Stack direction={{ xs: 'column', md: 'row' }} spacing={1} width="100%" justifyContent="space-between">
<Stack direction="row" spacing={1}>
<TextField
id="comments"
variant="outlined"
label="Search Comments"
value={searchText}
onChange={(e) => setSearchText(e.target.value)}
size="small"
/>
<PrimaryButton
data-testid="CommentListing/search-button"
onClick={() => handleSearchBarClick(searchText)}
>
<SearchIcon />
</PrimaryButton>
<SecondaryButton
data-testid="comment-listing/advanced-search-button"
onClick={() => setIsAdvancedSearchOpen(!isAdvancedSearchOpen)}
startIcon={
<ExpandMoreIcon
sx={{
transition: (theme) =>
theme.transitions.create('transform', {
duration: theme.transitions.duration.shortest,
}),
transform: isAdvancedSearchOpen ? 'rotate(180deg)' : 'rotate(0deg)',
}}
/>
}
>
Advanced Search
</SecondaryButton>
</Stack>
<Stack direction="row" spacing={1}>
<PrimaryButton component={Link} to={`/surveys/${survey.id}/comments/all`}>
Read All Comments
</PrimaryButton>
<SecondaryButton onClick={handleExportComments} loading={isExporting}>
Export to CSV
</SecondaryButton>
</Stack>
</Stack>
</Stack>
</Grid>

<Grid item xs={12}>
<Collapse in={isAdvancedSearchOpen}>
Expand Down
Loading