Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
OlegMoshkovich committed Jun 5, 2024
1 parent ca17361 commit e88b57d
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 27 deletions.
46 changes: 21 additions & 25 deletions src/Components/Notes/NoteFooter.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -151,42 +151,38 @@ export default function NoteFooter({
icon={<AddCommentOutlinedIcon className='icon-share'/>}
/>
}
{editMode &&
<Box sx={{marginLeft: 'auto', padding: '0 0.5em'}}>
<TooltipIconButton
title='Save'
placement='top'
icon={<CheckIcon className='icon-share'/>}
onClick={() => submitUpdate(repository, accessToken, id)}
/>
</Box>
}

{numberOfComments > 0 && !editMode &&
<Box sx={{marginLeft: 'auto', padding: '0 0.5em'}}>
{!selected &&
<Box sx={{marginLeft: 'auto', padding: '0 0.5em'}}>
{editMode &&
<TooltipIconButton
title='Discussion'
size='small'
title='Save'
placement='top'
onClick={selectCard}
icon={<ForumOutlinedIcon className='icon-share'/>}
icon={<CheckIcon className='icon-share'/>}
onClick={() => submitUpdate(repository, accessToken, id)}
/>
}
{!selected && numberOfComments}
</Box>
}
{!isNote && user && username === user.nickname &&
<Box sx={{marginLeft: 'auto', padding: '0 0 0 0.5em'}}>
}
{!selected && numberOfComments > 0 && !editMode &&
<>
<TooltipIconButton
title='Discussion'
size='small'
placement='top'
onClick={selectCard}
icon={<ForumOutlinedIcon className='icon-share'/>}
/>
{numberOfComments}
</>
}
{!isNote && user && username === user.nickname &&
<TooltipIconButton
title='Delete'
placement='top'
buttonTestId='deleteComment'
icon={<DeleteOutlineIcon className='icon-share'/>}
onClick={() => deleteComment(id)}
/>
</Box>
}
}
</Box>
</CardActions>
)
}
2 changes: 1 addition & 1 deletion src/__mocks__/api-handlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ function githubHandlers(githubStore) {
rest.delete(`${GH_BASE}/repos/:org/:repo/issues/comments/:commentId`, (req, res, ctx) => {
const {org, repo, commentId} = req.params

if (org !== 'pablo-mayrgundter' || repo !== 'Share' || !commentId) {
if (org !== 'cypresstester' || repo !== 'Share' || !commentId) {
return res(ctx.status(httpNotFound))
}

Expand Down
2 changes: 1 addition & 1 deletion src/net/github/Comments.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe('net/github/Comments', () => {
})

it('successfully delete comment', async () => {
const res = await deleteComment({orgName: 'pablo-mayrgundter', name: 'Share'}, 1)
const res = await deleteComment({orgName: 'cypresstester', name: 'Share'}, 1)
expect(res.status).toEqual(httpOK)
})
})

0 comments on commit e88b57d

Please sign in to comment.