Skip to content

Commit

Permalink
feat: added feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoalee committed Oct 7, 2024
1 parent 3c5f1ae commit c65d0d1
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,8 @@ const DisplayExtractionTableState: React.FC = (props) => {
};

const filterStr = (extractionTableState?.columnFilters || []).reduce((acc, curr, index) => {
if (index === 0) {
return `Filtering by: ${curr.id}: ${curr.value}`;
}
return `${acc}, ${curr.id}: ${curr.value}`;
if (index === 0) return `Filtering by: ${curr.id}: ${curr.value || 'All'}`;
return `${acc}, ${curr.id}: ${curr.value || 'All'}`;
}, '');

const sortingStr = (extractionTableState?.sorting || []).reduce((acc, curr, index) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Box, Button } from '@mui/material';
import { Box } from '@mui/material';
import LoadingButton from 'components/Buttons/LoadingButton';
import { EExtractionStatus } from 'pages/Extraction/ExtractionPage';
import {
useProjectExtractionAddOrUpdateStudyListStatus,
Expand All @@ -7,7 +8,6 @@ import {
import React from 'react';
import { useParams } from 'react-router-dom';
import useSaveStudy from '../hooks/useSaveStudy';
import LoadingButton from 'components/Buttons/LoadingButton';

const EditStudyCompleteButton: React.FC = React.memo((props) => {
const { studyId } = useParams<{ studyId: string }>();
Expand All @@ -28,23 +28,18 @@ const EditStudyCompleteButton: React.FC = React.memo((props) => {
return (
<Box>
<LoadingButton
sx={{ width: '180px' }}
variant={
extractionStatus?.status === EExtractionStatus.COMPLETED
? 'contained'
: 'outlined'
}
sx={{ width: '200px' }}
variant="contained"
color="success"
disabled={extractionStatus?.status === EExtractionStatus.COMPLETED}
disableElevation
loaderColor="secondary"
isLoading={isLoading}
onClick={handleSaveAndComplete}
text={
extractionStatus?.status === EExtractionStatus.COMPLETED
? 'Complete'
: hasEdits
? 'Save and complete'
: 'Set as complete'
? 'Completed'
: 'Set as Complete'
}
/>
</Box>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,13 +137,13 @@ const EditStudySwapVersionButton: React.FC = (props) => {
<Tooltip title="Swap study version" placement="left">
<Button
color="secondary"
variant="contained"
disableElevation
onClick={handleButtonPress}
size="small"
variant="outlined"
sx={{ width: '40px', minWidth: '40px', height: '40px' }}
>
{isSwapping ? <CircularProgress size={20} /> : <SwapHorizIcon />}
{isSwapping ? <CircularProgress size={40} /> : <SwapHorizIcon />}
</Button>
</Tooltip>
</Box>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { KeyboardArrowLeft, KeyboardArrowRight } from '@mui/icons-material';
import { Check, KeyboardArrowLeft, KeyboardArrowRight } from '@mui/icons-material';
import BookmarkIcon from '@mui/icons-material/Bookmark';
import DoneAllIcon from '@mui/icons-material/DoneAll';
import QuestionMark from '@mui/icons-material/QuestionMark';
Expand Down Expand Up @@ -259,11 +259,11 @@ const EditStudyToolbar: React.FC<{ isViewOnly?: boolean }> = ({ isViewOnly = fal
>
<Box>
<Button
variant="contained"
color="success"
disabled={!hasEdits}
disableElevation
onClick={handleSave}
variant="outlined"
color="primary"
sx={{
width: '40px',
maxWidth: '40px',
Expand Down Expand Up @@ -326,6 +326,25 @@ const EditStudyToolbar: React.FC<{ isViewOnly?: boolean }> = ({ isViewOnly = fal
<BookmarkIcon />
</Button>
</Tooltip>
<Tooltip title="Complete" placement="left">
<Button
onClick={() =>
handleUpdateExtractionStatus(
EExtractionStatus.COMPLETED
)
}
sx={{ minWidth: '0', width: '40px', height: '40px' }}
disableElevation
color="success"
variant={
extractionStatus?.status === EExtractionStatus.COMPLETED
? 'contained'
: 'outlined'
}
>
<Check />
</Button>
</Tooltip>
</ButtonGroup>
</Box>
<Box>
Expand Down

0 comments on commit c65d0d1

Please sign in to comment.