Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

include task status messages in last message text #28248

Merged
Merged
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
7 changes: 7 additions & 0 deletions src/libs/OptionsListUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,7 @@ function getLastMessageTextForReport(report) {
(reportAction, key) => ReportActionUtils.shouldReportActionBeVisible(reportAction, key) && reportAction.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE,
);
let lastMessageTextFromReport = '';
const lastActionName = lodashGet(lastReportAction, 'actionName', '');

if (ReportUtils.isReportMessageAttachment({text: report.lastMessageText, html: report.lastMessageHtml, translationKey: report.lastMessageTranslationKey})) {
lastMessageTextFromReport = `[${Localize.translateLocal(report.lastMessageTranslationKey || 'common.attachment')}]`;
Expand All @@ -397,6 +398,12 @@ function getLastMessageTextForReport(report) {
} else if (ReportActionUtils.isModifiedExpenseAction(lastReportAction)) {
const properSchemaForModifiedExpenseMessage = ReportUtils.getModifiedExpenseMessage(lastReportAction);
lastMessageTextFromReport = ReportUtils.formatReportLastMessageText(properSchemaForModifiedExpenseMessage, true);
} else if (
lastActionName === CONST.REPORT.ACTIONS.TYPE.TASKCOMPLETED ||
lastActionName === CONST.REPORT.ACTIONS.TYPE.TASKREOPENED ||
lastActionName === CONST.REPORT.ACTIONS.TYPE.TASKCANCELLED
Copy link
Member

Choose a reason for hiding this comment

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

@rojiphil I think we should add TASKEDITED here because on edit, we're still showing the old task name in search page.

image

This comment was marked as off-topic.

Copy link
Member

Choose a reason for hiding this comment

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

@rojiphil it doesn't have a message associated with it but when a task is edited, the action type is edited.

If we don't add edited action, the search page won't have the edited task. it'll show old task title

Copy link
Member

Choose a reason for hiding this comment

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

looks outside of the scope in our current context

i think we should add task edited. It's a one line change

This comment was marked as off-topic.

This comment was marked as off-topic.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I confirmed it locally yesterday

@rushatgabhane

Can you please share the details of your tests?
We have an obvious disconnect here. So, just want to check if I am missing something very simple.

Copy link
Member

@rushatgabhane rushatgabhane Sep 27, 2023

Choose a reason for hiding this comment

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

@rojiphil im sorry for poor communication, im away from my laptop. Anyway, let's work it out today 😊

Can you please share the details of your tests

  1. Create a task - "water plants"
  2. Mark it as done
  3. Make it as undone
  4. Click task name and change it's name to - "do laundry"
  5. Open LHN
  6. Notice that the LHN's subtitle for task refers fo the original task name "water plants"

Expected: LHN subtitle is "do laundry"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@rushatgabhane

Ah! Now, I get it.
Please have a look at the attached test video.
As seen in video, the BE doesn't update the text message[0].text with edited task name.
Looks like a bug in BE.
Does this make sense?

subtitle-BE-issue.mp4

Copy link
Member

Choose a reason for hiding this comment

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

Thank you so much for clarifying that @rojiphil
You're right, the backend isn't updating the text. It's a different issue. Please report it on slack for a bonus :)

) {
lastMessageTextFromReport = lodashGet(lastReportAction, 'message[0].text', '');
} else {
lastMessageTextFromReport = report ? report.lastMessageText || '' : '';

Expand Down
Loading