Skip to content

Commit

Permalink
Merge pull request #6127 from hotosm/fix/6115-incomplete-contributor-…
Browse files Browse the repository at this point in the history
…list

Fix incomplete contributors list in task comments for multiple tasks validation case
  • Loading branch information
ramyaragupathy authored Nov 27, 2023
2 parents aac4981 + 90d39ba commit 3de8782
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions frontend/src/components/taskSelection/actionSidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,10 @@ export function CompletionTabForMapping({
)}
{showReadCommentsAlert && (
<div
className="tc pa2 mb1 bg-grey-light blue-dark pointer"
role="button"
className="tc pa2 mb1 bg-grey-light blue-dark pointer"
onClick={() => historyTabSwitch()}
onKeyDown={() => {}}
>
<InfoIcon className="v-mid h1 w1" />
<span className="ml2 fw1 pa1">
Expand Down Expand Up @@ -586,19 +587,12 @@ const TaskValidationSelector = ({
// the contributors is filled only on the case of single task validation,
// so we need to fetch the task history in the case of multiple task validation
useEffect(() => {
if (showCommentInput && isValidatingMultipleTasks && !contributors.length) {
if (showCommentInput && isValidatingMultipleTasks) {
fetchLocalJSONAPI(`projects/${projectId}/tasks/${id}/`).then((response) =>
setContributorsList(getTaskContributors(response.taskHistory, userDetails.username)),
);
}
}, [
isValidatingMultipleTasks,
showCommentInput,
contributors,
id,
projectId,
userDetails.username,
]);
}, [isValidatingMultipleTasks, showCommentInput, id, projectId, userDetails.username]);

return (
<div className="cf w-100 db pt1 pv2 blue-dark">
Expand Down Expand Up @@ -650,7 +644,7 @@ const TaskValidationSelector = ({
<CommentInputField
comment={comment}
setComment={setComment}
contributors={contributors.length ? contributors : contributorsList}
contributors={isValidatingMultipleTasks ? contributorsList : contributors}
enableHashtagPaste
enableContributorsHashtag
isShowTabNavs
Expand Down Expand Up @@ -713,6 +707,7 @@ function CompletionInstructions({ setVisibility }: Object) {
<span
className="br-100 bg-grey-light white h1 w1 fr pointer tc v-mid di"
onClick={() => setVisibility(false)}
onKeyDown={() => {}}
>
<CloseIcon className="pv1" aria-label="hide instructions" />
</span>
Expand Down Expand Up @@ -836,6 +831,7 @@ function TaskSpecificInstructions({ instructions, open = true }: Object) {
className="ttu blue-grey mt1 mb0 pointer"
role="button"
onClick={() => setIsOpen(!isOpen)}
onKeyDown={() => {}}
>
{isOpen ? (
<ChevronDownIcon style={{ height: '14px' }} className="pr1 pb1 v-mid" />
Expand Down

0 comments on commit 3de8782

Please sign in to comment.