Skip to content

Commit 28cdb50

Browse files
committed
Correct approved, exclude, reject logs
1 parent 9d6fc71 commit 28cdb50

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

src/components/map-projects/Discuss.jsx

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@ import CommentIcon from '@mui/icons-material/Message';
1515
import MapIcon from '@mui/icons-material/Link';
1616
import UnmapIcon from '@mui/icons-material/LinkOff';
1717
import RejectIcon from '@mui/icons-material/Clear';
18+
import ExcludeIcon from '@mui/icons-material/Block';
1819
import AutoMatchIcon from '@mui/icons-material/MotionPhotosAutoOutlined';
1920
import AssistantIcon from '@mui/icons-material/Assistant';
21+
import ReviewedIcon from '@mui/icons-material/FactCheckOutlined';
2022

2123
import map from 'lodash/map'
2224
import startCase from 'lodash/startCase'
@@ -27,12 +29,20 @@ const Discuss = ({ logs, onAdd }) => {
2729
const [comment, setComment] = React.useState('')
2830
const getTitle = log => {
2931
if(['mapped', 'unmapped', 'auto-matched', 'rejected'].includes(log.action)) {
30-
let description = `${startCase(log.action)}: ${log.extras.name}`
32+
if(log.action === 'rejected' && log.description)
33+
return log.description
34+
let description = startCase(log.action)
35+
if(log.extras?.name)
36+
description += `: ${log.extras?.name}`
3137
if(log?.extras?.map_type || log?.extras?.mapType) {
38+
if(description?.includes(':'))
39+
description += ':'
3240
description += ` (${log.extras.map_type || log.extras.mapType})`
3341
}
3442
return description
3543
}
44+
if (log.action === 'exclude')
45+
return 'Excluded'
3646
if(['AIRecommendation'].includes(log.action))
3747
return `${log.action}: ${log.description}`
3848
if(['commented'].includes(log.action)) {
@@ -46,6 +56,8 @@ const Discuss = ({ logs, onAdd }) => {
4656
return <AssistantIcon fontSize='small' color={color} />
4757
if(log.action === 'commented')
4858
return <CommentIcon fontSize='small' color={color} />
59+
if(log.action === 'approved' || log.action === 'reviewed')
60+
return <ReviewedIcon fontSize='small' color={color} />
4961
if(['mapped'].includes(log.action))
5062
return <MapIcon fontSize='small' color={color} />
5163
if(['auto-matched'].includes(log.action))
@@ -54,15 +66,17 @@ const Discuss = ({ logs, onAdd }) => {
5466
return <UnmapIcon fontSize='small' color={color} />
5567
if(log.action === 'rejected')
5668
return <RejectIcon fontSize='small' color={color} />
69+
if(log.action === 'exclude')
70+
return <ExcludeIcon fontSize='small' color={color} />
5771
return log.user.slice(0, 2).toUpperCase()
5872
}
5973

6074
const getDotColor = log => {
61-
if(['unmapped', 'rejected'].includes(log.action))
75+
if(['unmapped', 'rejected', 'exclude'].includes(log.action))
6276
return 'error'
6377
if(['proposed'].includes(log.action))
6478
return 'warning'
65-
if(['mapped', 'auto-matched', 'AIRecommendation'].includes(log.action))
79+
if(['mapped', 'auto-matched', 'AIRecommendation', 'approved', 'reviewed'].includes(log.action))
6680
return 'primary'
6781
return undefined
6882
}

src/components/map-projects/MapProject.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1236,11 +1236,11 @@ const MapProject = () => {
12361236
const newRowStatuses = {...rowStatuses, reviewed: uniq([...rowStatuses.reviewed, rowIndex]), readyForReview: without(rowStatuses.readyForReview, rowIndex), unmapped: without(rowStatuses.unmapped, rowIndex)}
12371237
setRowStatuses(newRowStatuses)
12381238
updateMatchTypeCounts('reviewed', newRowStatuses)
1239+
log({'action': 'approved'})
12391240
if(next){
12401241
const nextRow = data[selectedRowStatus === 'all' ? rowIndex + 1 : find(rowStatuses[selectedRowStatus], idx => idx > rowIndex)]
12411242
if(nextRow !== undefined)
12421243
setTimeout(() => onCSVRowSelect(nextRow), 300)
1243-
log({'action': 'approved'})
12441244
}
12451245
}
12461246

0 commit comments

Comments
 (0)