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

Update archive feature #46934

Merged
merged 24 commits into from
Sep 17, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
2 changes: 1 addition & 1 deletion src/libs/OptionsListUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2332,7 +2332,7 @@ function getHeaderMessageForNonUserList(hasSelectableOptions: boolean, searchVal
* Helper method to check whether an option can show tooltip or not
*/
function shouldOptionShowTooltip(option: ReportUtils.OptionData): boolean {
return (!option.isChatRoom || !!option.isThread) && !option.isArchivedRoom;
return (!option.isChatRoom || !!option.isThread) && !ReportUtils.isArchivedRoom(option, ReportUtils.getReportNameValuePairs(option?.reportID));
cretadn22 marked this conversation as resolved.
Show resolved Hide resolved
}

/**
Expand Down
11 changes: 6 additions & 5 deletions src/libs/SidebarUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,8 @@ function getOptionData({
hasParentAccess: undefined,
isIOUReportOwner: null,
isChatRoom: false,
isArchivedRoom: false,
// eslint-disable-next-line @typescript-eslint/naming-convention
private_isArchived: undefined,
cretadn22 marked this conversation as resolved.
Show resolved Hide resolved
shouldShowSubscript: false,
isPolicyExpenseChat: false,
isMoneyRequestReport: false,
Expand All @@ -301,8 +302,8 @@ function getOptionData({
result.isTaskReport = ReportUtils.isTaskReport(report);
result.isInvoiceReport = ReportUtils.isInvoiceReport(report);
result.parentReportAction = parentReportAction;
const reportNameValuePairs = ReportUtils.getReportNameValuePairs(report?.reportID);
result.isArchivedRoom = ReportUtils.isArchivedRoom(report, reportNameValuePairs);
// eslint-disable-next-line @typescript-eslint/naming-convention
result.private_isArchived = report.private_isArchived;
result.isPolicyExpenseChat = ReportUtils.isPolicyExpenseChat(report);
result.isExpenseRequest = ReportUtils.isExpenseRequest(report);
result.isMoneyRequestReport = ReportUtils.isMoneyRequestReport(report);
Expand Down Expand Up @@ -389,8 +390,8 @@ function getOptionData({

const isThreadMessage =
ReportUtils.isThread(report) && lastAction?.actionName === CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT && lastAction?.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE;

if ((result.isChatRoom || result.isPolicyExpenseChat || result.isThread || result.isTaskReport || isThreadMessage) && !result.isArchivedRoom) {
const reportNameValuePairs = ReportUtils.getReportNameValuePairs(report?.reportID);
if ((result.isChatRoom || result.isPolicyExpenseChat || result.isThread || result.isTaskReport || isThreadMessage) && !ReportUtils.isArchivedRoom(report, reportNameValuePairs)) {
const lastActionName = lastAction?.actionName ?? report.lastActionType;

if (ReportActionsUtils.isRenamedAction(lastAction)) {
Expand Down
Loading