Skip to content

Commit

Permalink
feat(frontend): add user to task popup (#1670)
Browse files Browse the repository at this point in the history
* fix(taskSelectionPopup): task locked username add if task is lockedForMapping

* fix(dialogTaskActions): popup border UI fix
  • Loading branch information
NSUWAL123 authored Jul 18, 2024
1 parent d39bb5d commit 553617f
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 31 deletions.
61 changes: 30 additions & 31 deletions src/frontend/src/components/DialogTaskActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -161,42 +161,41 @@ export default function Dialog({ taskId, feature }: dialogPropType) {
}
className=""
/>
{list_of_task_status?.length > 0 && (
{list_of_task_status?.length > 0 && checkIfTaskAssignedOrNot && (
<div
className={`fmtm-grid fmtm-border-t-[1px] fmtm-p-2 sm:fmtm-p-5 ${
list_of_task_status?.length === 1 ? 'fmtm-grid-cols-1' : 'fmtm-grid-cols-2'
}`}
>
{checkIfTaskAssignedOrNot &&
list_of_task_status?.map((data, index) => {
return list_of_task_status?.length != 0 ? (
<Button
btnId={data.value}
key={index}
onClick={(e) => {
if (
data.key === 'Mark as fully mapped' &&
currentTaskInfo &&
currentTaskInfo?.submission_count < currentTaskInfo?.feature_count
) {
setToggleMappedConfirmationModal(true);
} else {
handleOnClick(e);
}
}}
disabled={loading}
btnText={data.key.toUpperCase()}
btnType={data.btnBG === 'red' ? 'primary' : 'other'}
className={`fmtm-font-bold !fmtm-rounded fmtm-text-sm !fmtm-py-2 !fmtm-w-full fmtm-flex fmtm-justify-center ${
data.btnBG === 'gray'
? '!fmtm-bg-[#4C4C4C] hover:!fmtm-bg-[#5f5f5f] fmtm-text-white hover:!fmtm-text-white !fmtm-border-none'
: data.btnBG === 'transparent'
? '!fmtm-bg-transparent !fmtm-text-primaryRed !fmtm-border-none !fmtm-w-fit fmtm-mx-auto hover:!fmtm-text-red-700'
: ''
}`}
/>
) : null;
})}
{list_of_task_status?.map((data, index) => {
return list_of_task_status?.length != 0 ? (
<Button
btnId={data.value}
key={index}
onClick={(e) => {
if (
data.key === 'Mark as fully mapped' &&
currentTaskInfo &&
currentTaskInfo?.submission_count < currentTaskInfo?.feature_count
) {
setToggleMappedConfirmationModal(true);
} else {
handleOnClick(e);
}
}}
disabled={loading}
btnText={data.key.toUpperCase()}
btnType={data.btnBG === 'red' ? 'primary' : 'other'}
className={`fmtm-font-bold !fmtm-rounded fmtm-text-sm !fmtm-py-2 !fmtm-w-full fmtm-flex fmtm-justify-center ${
data.btnBG === 'gray'
? '!fmtm-bg-[#4C4C4C] hover:!fmtm-bg-[#5f5f5f] fmtm-text-white hover:!fmtm-text-white !fmtm-border-none'
: data.btnBG === 'transparent'
? '!fmtm-bg-transparent !fmtm-text-primaryRed !fmtm-border-none !fmtm-w-fit fmtm-mx-auto hover:!fmtm-text-red-700'
: ''
}`}
/>
) : null;
})}
</div>
)}
{task_status !== 'READY' && task_status !== 'LOCKED_FOR_MAPPING' && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ const TaskSelectionPopup = ({ taskId, body, feature }: TaskSelectionPopupPropTyp
<div className="fmtm-flex fmtm-flex-col fmtm-gap-2 fmtm-p-3 sm:fmtm-p-5">
<h4 className="fmtm-text-lg fmtm-font-bold">Task: {selectedTask.index}</h4>
<p className="fmtm-text-base fmtm-text-[#757575]">Status: {task_status}</p>
{selectedTask?.locked_by_username && (
<p className="fmtm-text-base fmtm-text-[#757575]">Locked By: {selectedTask?.locked_by_username}</p>
)}
</div>
{checkIfTaskAssignedOrNot && task_status !== 'LOCKED_FOR_MAPPING' && (
<QrcodeComponent qrcode={qrcode} projectId={currentProjectId} taskIndex={selectedTask.index} />
Expand Down

0 comments on commit 553617f

Please sign in to comment.