Merge pull request #108 from chamikaJ/fix/custom-progress-methods
Add task progress confirmation prompts and localization updates
This commit is contained in:
@@ -82,5 +82,11 @@
|
|||||||
},
|
},
|
||||||
"taskActivityLogTab": {
|
"taskActivityLogTab": {
|
||||||
"title": "Activity Log"
|
"title": "Activity Log"
|
||||||
|
},
|
||||||
|
"taskProgress": {
|
||||||
|
"markAsDoneTitle": "Mark Task as Done?",
|
||||||
|
"confirmMarkAsDone": "Yes, mark as done",
|
||||||
|
"cancelMarkAsDone": "No, keep current status",
|
||||||
|
"markAsDoneDescription": "You've set the progress to 100%. Would you like to update the task status to \"Done\"?"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -82,5 +82,11 @@
|
|||||||
},
|
},
|
||||||
"taskActivityLogTab": {
|
"taskActivityLogTab": {
|
||||||
"title": "Registro de actividad"
|
"title": "Registro de actividad"
|
||||||
|
},
|
||||||
|
"taskProgress": {
|
||||||
|
"markAsDoneTitle": "¿Marcar Tarea como Completada?",
|
||||||
|
"confirmMarkAsDone": "Sí, marcar como completada",
|
||||||
|
"cancelMarkAsDone": "No, mantener estado actual",
|
||||||
|
"markAsDoneDescription": "Has establecido el progreso al 100%. ¿Quieres actualizar el estado de la tarea a \"Completada\"?"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -82,5 +82,11 @@
|
|||||||
},
|
},
|
||||||
"taskActivityLogTab": {
|
"taskActivityLogTab": {
|
||||||
"title": "Registro de atividade"
|
"title": "Registro de atividade"
|
||||||
|
},
|
||||||
|
"taskProgress": {
|
||||||
|
"markAsDoneTitle": "Marcar Tarefa como Concluída?",
|
||||||
|
"confirmMarkAsDone": "Sim, marcar como concluída",
|
||||||
|
"cancelMarkAsDone": "Não, manter status atual",
|
||||||
|
"markAsDoneDescription": "Você definiu o progresso como 100%. Deseja atualizar o status da tarefa para \"Concluída\"?"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -242,9 +242,20 @@ const TaskDrawerProgress = ({ task, form }: TaskDrawerProgressProps) => {
|
|||||||
formatter={percentFormatter}
|
formatter={percentFormatter}
|
||||||
parser={percentParser}
|
parser={percentParser}
|
||||||
onBlur={e => {
|
onBlur={e => {
|
||||||
const value = percentParser(e.target.value);
|
let value = percentParser(e.target.value);
|
||||||
|
// Ensure value doesn't exceed 100
|
||||||
|
if (value > 100) {
|
||||||
|
value = 100;
|
||||||
|
form.setFieldsValue({ weight: 100 });
|
||||||
|
}
|
||||||
handleWeightChange(value);
|
handleWeightChange(value);
|
||||||
}}
|
}}
|
||||||
|
onChange={value => {
|
||||||
|
if (value !== null && value > 100) {
|
||||||
|
form.setFieldsValue({ weight: 100 });
|
||||||
|
handleWeightChange(100);
|
||||||
|
}
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
)}
|
)}
|
||||||
@@ -274,22 +285,33 @@ const TaskDrawerProgress = ({ task, form }: TaskDrawerProgressProps) => {
|
|||||||
formatter={percentFormatter}
|
formatter={percentFormatter}
|
||||||
parser={percentParser}
|
parser={percentParser}
|
||||||
onBlur={e => {
|
onBlur={e => {
|
||||||
const value = percentParser(e.target.value);
|
let value = percentParser(e.target.value);
|
||||||
|
// Ensure value doesn't exceed 100
|
||||||
|
if (value > 100) {
|
||||||
|
value = 100;
|
||||||
|
form.setFieldsValue({ progress_value: 100 });
|
||||||
|
}
|
||||||
handleProgressChange(value);
|
handleProgressChange(value);
|
||||||
}}
|
}}
|
||||||
|
onChange={value => {
|
||||||
|
if (value !== null && value > 100) {
|
||||||
|
form.setFieldsValue({ progress_value: 100 });
|
||||||
|
handleProgressChange(100);
|
||||||
|
}
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<Modal
|
<Modal
|
||||||
title="Mark Task as Done?"
|
title={t('taskProgress.markAsDoneTitle', 'Mark Task as Done?')}
|
||||||
open={isCompletionModalVisible}
|
open={isCompletionModalVisible}
|
||||||
onOk={handleMarkTaskAsComplete}
|
onOk={handleMarkTaskAsComplete}
|
||||||
onCancel={() => setIsCompletionModalVisible(false)}
|
onCancel={() => setIsCompletionModalVisible(false)}
|
||||||
okText="Yes, mark as done"
|
okText={t('taskProgress.confirmMarkAsDone', 'Yes, mark as done')}
|
||||||
cancelText="No, keep current status"
|
cancelText={t('taskProgress.cancelMarkAsDone', 'No, keep current status')}
|
||||||
>
|
>
|
||||||
<p>You've set the progress to 100%. Would you like to update the task status to "Done"?</p>
|
<p>{t('taskProgress.markAsDoneDescription', 'You\'ve set the progress to 100%. Would you like to update the task status to "Done"?')}</p>
|
||||||
</Modal>
|
</Modal>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ const TaskDrawerStatusDropdown = ({ statuses, task, teamId }: TaskDrawerStatusDr
|
|||||||
SocketEvents.TASK_STATUS_CHANGE.toString(),
|
SocketEvents.TASK_STATUS_CHANGE.toString(),
|
||||||
(data: ITaskListStatusChangeResponse) => {
|
(data: ITaskListStatusChangeResponse) => {
|
||||||
dispatch(setTaskStatus(data));
|
dispatch(setTaskStatus(data));
|
||||||
|
socket?.emit(SocketEvents.GET_TASK_PROGRESS.toString(), task.id);
|
||||||
|
|
||||||
if (tab === 'tasks-list') {
|
if (tab === 'tasks-list') {
|
||||||
dispatch(updateTaskStatus(data));
|
dispatch(updateTaskStatus(data));
|
||||||
@@ -65,7 +66,6 @@ const TaskDrawerStatusDropdown = ({ statuses, task, teamId }: TaskDrawerStatusDr
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const options = useMemo(
|
const options = useMemo(
|
||||||
|
|||||||
Reference in New Issue
Block a user