Add task progress confirmation prompts and localization updates
- Introduced new localization entries for task progress confirmation prompts in English, Spanish, and Portuguese, enhancing user experience. - Updated frontend components to utilize localized strings for task completion modals, ensuring consistency across languages. - Implemented logic to restrict task progress input to a maximum of 100%, improving data integrity and user feedback during task updates.
This commit is contained in:
@@ -82,5 +82,11 @@
|
||||
},
|
||||
"taskActivityLogTab": {
|
||||
"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": {
|
||||
"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": {
|
||||
"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}
|
||||
parser={percentParser}
|
||||
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);
|
||||
}}
|
||||
onChange={value => {
|
||||
if (value !== null && value > 100) {
|
||||
form.setFieldsValue({ weight: 100 });
|
||||
handleWeightChange(100);
|
||||
}
|
||||
}}
|
||||
/>
|
||||
</Form.Item>
|
||||
)}
|
||||
@@ -274,22 +285,33 @@ const TaskDrawerProgress = ({ task, form }: TaskDrawerProgressProps) => {
|
||||
formatter={percentFormatter}
|
||||
parser={percentParser}
|
||||
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);
|
||||
}}
|
||||
onChange={value => {
|
||||
if (value !== null && value > 100) {
|
||||
form.setFieldsValue({ progress_value: 100 });
|
||||
handleProgressChange(100);
|
||||
}
|
||||
}}
|
||||
/>
|
||||
</Form.Item>
|
||||
)}
|
||||
|
||||
<Modal
|
||||
title="Mark Task as Done?"
|
||||
title={t('taskProgress.markAsDoneTitle', 'Mark Task as Done?')}
|
||||
open={isCompletionModalVisible}
|
||||
onOk={handleMarkTaskAsComplete}
|
||||
onCancel={() => setIsCompletionModalVisible(false)}
|
||||
okText="Yes, mark as done"
|
||||
cancelText="No, keep current status"
|
||||
okText={t('taskProgress.confirmMarkAsDone', 'Yes, mark as done')}
|
||||
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>
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -46,6 +46,7 @@ const TaskDrawerStatusDropdown = ({ statuses, task, teamId }: TaskDrawerStatusDr
|
||||
SocketEvents.TASK_STATUS_CHANGE.toString(),
|
||||
(data: ITaskListStatusChangeResponse) => {
|
||||
dispatch(setTaskStatus(data));
|
||||
socket?.emit(SocketEvents.GET_TASK_PROGRESS.toString(), task.id);
|
||||
|
||||
if (tab === 'tasks-list') {
|
||||
dispatch(updateTaskStatus(data));
|
||||
@@ -65,7 +66,6 @@ const TaskDrawerStatusDropdown = ({ statuses, task, teamId }: TaskDrawerStatusDr
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
const options = useMemo(
|
||||
|
||||
Reference in New Issue
Block a user