From 3a8d4302acef3fb9b2f7f187bdde7c2d36d7ba63 Mon Sep 17 00:00:00 2001 From: daledah Date: Wed, 4 Dec 2024 17:41:42 +0700 Subject: [PATCH 01/54] fix: some member appear as Hidden --- src/libs/PersonalDetailsUtils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/PersonalDetailsUtils.ts b/src/libs/PersonalDetailsUtils.ts index 3d9aed117ca3..31d344facb32 100644 --- a/src/libs/PersonalDetailsUtils.ts +++ b/src/libs/PersonalDetailsUtils.ts @@ -75,7 +75,7 @@ function getDisplayNameOrDefault(passedPersonalDetails?: Partial Date: Fri, 6 Dec 2024 14:48:37 +0700 Subject: [PATCH 02/54] refactor: change logics to more precise --- src/libs/PersonalDetailsUtils.ts | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/libs/PersonalDetailsUtils.ts b/src/libs/PersonalDetailsUtils.ts index 31d344facb32..395ab930b116 100644 --- a/src/libs/PersonalDetailsUtils.ts +++ b/src/libs/PersonalDetailsUtils.ts @@ -52,6 +52,8 @@ const regexMergedAccount = new RegExp(CONST.REGEX.MERGED_ACCOUNT_PREFIX); function getDisplayNameOrDefault(passedPersonalDetails?: Partial | null, defaultValue = '', shouldFallbackToHidden = true, shouldAddCurrentUserPostfix = false): string { let displayName = passedPersonalDetails?.displayName ?? ''; + let login = passedPersonalDetails?.login ?? ''; + // If the displayName starts with the merged account prefix, remove it. if (regexMergedAccount.test(displayName)) { // Remove the merged account prefix from the displayName. @@ -60,8 +62,11 @@ function getDisplayNameOrDefault(passedPersonalDetails?: Partial Date: Mon, 9 Dec 2024 16:02:00 +0530 Subject: [PATCH 03/54] fix: Make all task titles/descriptions read-only to all but the author/assignee. Signed-off-by: krishna2323 --- .../ReportActionItem/TaskPreview.tsx | 6 ++-- src/components/ReportActionItem/TaskView.tsx | 6 ++-- src/components/TaskHeaderActionButton.tsx | 2 +- src/libs/actions/Task.ts | 32 +++++++------------ src/pages/ReportDetailsPage.tsx | 2 +- src/pages/home/HeaderView.tsx | 6 +++- src/pages/home/ReportScreen.tsx | 3 +- 7 files changed, 27 insertions(+), 30 deletions(-) diff --git a/src/components/ReportActionItem/TaskPreview.tsx b/src/components/ReportActionItem/TaskPreview.tsx index f6f436cbd51e..e09054baa58c 100644 --- a/src/components/ReportActionItem/TaskPreview.tsx +++ b/src/components/ReportActionItem/TaskPreview.tsx @@ -106,12 +106,12 @@ function TaskPreview({taskReportID, action, contextMenuAnchor, chatReportID, che { if (isTaskCompleted) { - Task.reopenTask(taskReport); + Task.reopenTask(taskReport, taskReportID); } else { - Task.completeTask(taskReport); + Task.completeTask(taskReport, taskReportID); } })} accessibilityLabel={translate('task.task')} diff --git a/src/components/ReportActionItem/TaskView.tsx b/src/components/ReportActionItem/TaskView.tsx index 9a2906aa7d62..480c4573f293 100644 --- a/src/components/ReportActionItem/TaskView.tsx +++ b/src/components/ReportActionItem/TaskView.tsx @@ -56,7 +56,7 @@ function TaskView({report, ...props}: TaskViewProps) { const isCompleted = ReportUtils.isCompletedTaskReport(report); const isOpen = ReportUtils.isOpenTaskReport(report); const canModifyTask = Task.canModifyTask(report, props.currentUserPersonalDetails.accountID); - const canActionTask = Task.canActionTask(report, props.currentUserPersonalDetails.accountID); + const canActionTask = Task.canModifyTask(report, props.currentUserPersonalDetails.accountID, true); const disableState = !canModifyTask; const isDisableInteractive = !canModifyTask || !isOpen; const personalDetails = usePersonalDetails() || CONST.EMPTY_OBJECT; @@ -88,8 +88,8 @@ function TaskView({report, ...props}: TaskViewProps) { styles.pv2, StyleUtils.getButtonBackgroundColorStyle(getButtonState(hovered, pressed, false, disableState, !isDisableInteractive), true), isDisableInteractive && !disableState && styles.cursorDefault, + disableState && styles.cursorDisabled, ]} - disabled={disableState} accessibilityLabel={taskTitle || translate('task.task')} > {({pressed}) => ( @@ -114,7 +114,7 @@ function TaskView({report, ...props}: TaskViewProps) { containerBorderRadius={8} caretSize={16} accessibilityLabel={taskTitle || translate('task.task')} - disabled={!canModifyTask || !canActionTask} + disabled={!canActionTask} />