Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/languages/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -1294,6 +1294,7 @@ export default {
completed: 'completed task',
canceled: 'canceled task',
reopened: 'reopened task',
error: 'You do not have the permission to do the requested action.',
},
markAsDone: 'Mark as done',
markAsIncomplete: 'Mark as incomplete',
Expand Down
3 changes: 2 additions & 1 deletion src/languages/es.js
Original file line number Diff line number Diff line change
Expand Up @@ -1302,7 +1302,8 @@ export default {
messages: {
completed: 'tarea completada',
canceled: 'tarea cancelada',
reopened: 'tarea reabierta',
reopened: 'tarea reabrir',
error: 'No tiene permiso para realizar la acción solicitada.',
},
markAsDone: 'Marcar como completada',
markAsIncomplete: 'Marcar como incompleta',
Expand Down
13 changes: 11 additions & 2 deletions src/libs/actions/Task.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import ROUTES from '../../ROUTES';
import CONST from '../../CONST';
import DateUtils from '../DateUtils';
import * as UserUtils from '../UserUtils';
import * as ErrorUtils from '../ErrorUtils';
import * as ReportActionsUtils from '../ReportActionsUtils';
import * as Expensicons from '../../components/Icon/Expensicons';

Expand Down Expand Up @@ -225,7 +226,11 @@ function completeTask(taskReportID, taskTitle) {
{
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${taskReportID}`,
value: {[completedTaskReportAction.reportActionID]: {pendingAction: null}},
value: {
[completedTaskReportAction.reportActionID]: {
errors: ErrorUtils.getMicroSecondOnyxError('task.messages.error'),
},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can keep the pendingAction: null} maybe it will be needed.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mollfpr We need to keep pendingAction in failureData to check in clearReportActionErrors function.

if (reportAction.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for confirming it; I didn't realize that 😅

},
},
];

Expand Down Expand Up @@ -281,7 +286,11 @@ function reopenTask(taskReportID, taskTitle) {
{
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${taskReportID}`,
value: {[reopenedTaskReportAction.reportActionID]: {pendingAction: null}},
value: {
[reopenedTaskReportAction.reportActionID]: {
errors: ErrorUtils.getMicroSecondOnyxError('task.messages.error'),
},
},
},
];

Expand Down