From 30b5185a1f3ec4034234f5c31affc9292ca4f15d Mon Sep 17 00:00:00 2001 From: Scott Deeter Date: Mon, 22 Jul 2024 16:25:44 -0700 Subject: [PATCH 1/6] Remove the chronosInCash beta --- src/CONST.ts | 1 - src/libs/OptionsListUtils.ts | 2 +- src/libs/Permissions.ts | 5 ----- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/CONST.ts b/src/CONST.ts index e2ba7ef0aa1d..8c3197a48b8b 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -359,7 +359,6 @@ const CONST = { }, BETAS: { ALL: 'all', - CHRONOS_IN_CASH: 'chronosInCash', DEFAULT_ROOMS: 'defaultRooms', VIOLATIONS: 'violations', DUPE_DETECTION: 'dupeDetection', diff --git a/src/libs/OptionsListUtils.ts b/src/libs/OptionsListUtils.ts index d7614139927f..34692bee2b1a 100644 --- a/src/libs/OptionsListUtils.ts +++ b/src/libs/OptionsListUtils.ts @@ -1725,7 +1725,7 @@ function getUserToInviteOption({ isInSelectedOption || (!isValidEmail && !isValidPhoneNumber) || isInOptionToExclude || - (isChronosEmail && !Permissions.canUseChronos(betas)) || + isChronosEmail || excludeUnknownUsers ) { return null; diff --git a/src/libs/Permissions.ts b/src/libs/Permissions.ts index 23aabcf3c6d0..1ecde92eff19 100644 --- a/src/libs/Permissions.ts +++ b/src/libs/Permissions.ts @@ -7,10 +7,6 @@ function canUseAllBetas(betas: OnyxEntry): boolean { return !!betas?.includes(CONST.BETAS.ALL); } -function canUseChronos(betas: OnyxEntry): boolean { - return !!betas?.includes(CONST.BETAS.CHRONOS_IN_CASH) || canUseAllBetas(betas); -} - function canUseDefaultRooms(betas: OnyxEntry): boolean { return !!betas?.includes(CONST.BETAS.DEFAULT_ROOMS) || canUseAllBetas(betas); } @@ -64,7 +60,6 @@ function canUseLinkPreviews(): boolean { } export default { - canUseChronos, canUseDefaultRooms, canUseLinkPreviews, canUseViolations, From 2e1bd4dd360f716003aad908ac083c1578160043 Mon Sep 17 00:00:00 2001 From: Scott Deeter Date: Mon, 22 Jul 2024 18:35:00 -0700 Subject: [PATCH 2/6] Remove unused parameter --- src/libs/OptionsListUtils.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/libs/OptionsListUtils.ts b/src/libs/OptionsListUtils.ts index 34692bee2b1a..87fab9c40ec4 100644 --- a/src/libs/OptionsListUtils.ts +++ b/src/libs/OptionsListUtils.ts @@ -1706,7 +1706,6 @@ function getUserToInviteOption({ excludeUnknownUsers = false, optionsToExclude = [], selectedOptions = [], - betas, reportActions = {}, showChatPreviewLine = false, }: GetUserToInviteConfig): ReportUtils.OptionData | null { From 67d47820b9772b0f1a0a954acd099b4bda34b41d Mon Sep 17 00:00:00 2001 From: Scott Deeter Date: Mon, 29 Jul 2024 11:50:13 -0700 Subject: [PATCH 3/6] Update src/libs/OptionsListUtils.ts Co-authored-by: Abdelhafidh Belalia <16493223+s77rt@users.noreply.github.com> --- src/libs/OptionsListUtils.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/libs/OptionsListUtils.ts b/src/libs/OptionsListUtils.ts index 87fab9c40ec4..52c9aa98f532 100644 --- a/src/libs/OptionsListUtils.ts +++ b/src/libs/OptionsListUtils.ts @@ -1724,7 +1724,6 @@ function getUserToInviteOption({ isInSelectedOption || (!isValidEmail && !isValidPhoneNumber) || isInOptionToExclude || - isChronosEmail || excludeUnknownUsers ) { return null; From 73d6f98158dfa89adb1e489172a78354b2c27cd9 Mon Sep 17 00:00:00 2001 From: Scott Deeter Date: Mon, 29 Jul 2024 11:52:41 -0700 Subject: [PATCH 4/6] Remove outdated comment --- src/libs/OptionsListUtils.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/libs/OptionsListUtils.ts b/src/libs/OptionsListUtils.ts index 52c9aa98f532..4b5032674ea2 100644 --- a/src/libs/OptionsListUtils.ts +++ b/src/libs/OptionsListUtils.ts @@ -1699,7 +1699,6 @@ function canCreateOptimisticPersonalDetailOption({ * - There's no matching recent report and personal detail option * - The searchValue is a valid email or phone number * - The searchValue isn't the current personal detail login - * - We can use chronos or the search value is not the chronos email */ function getUserToInviteOption({ searchValue, From 28c405ea20a99bf25c0516eeed0743068a700d07 Mon Sep 17 00:00:00 2001 From: Scott Deeter Date: Mon, 29 Jul 2024 12:57:14 -0700 Subject: [PATCH 5/6] Remove variable declaration --- src/libs/OptionsListUtils.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/libs/OptionsListUtils.ts b/src/libs/OptionsListUtils.ts index 4b5032674ea2..da25b1b75ed6 100644 --- a/src/libs/OptionsListUtils.ts +++ b/src/libs/OptionsListUtils.ts @@ -1715,7 +1715,6 @@ function getUserToInviteOption({ const isValidPhoneNumber = parsedPhoneNumber.possible && Str.isValidE164Phone(LoginUtils.getPhoneNumberWithoutSpecialChars(parsedPhoneNumber.number?.input ?? '')); const isInOptionToExclude = optionsToExclude.findIndex((optionToExclude) => 'login' in optionToExclude && optionToExclude.login === PhoneNumber.addSMSDomainIfPhoneNumber(searchValue).toLowerCase()) !== -1; - const isChronosEmail = searchValue === CONST.EMAIL.CHRONOS; if ( !searchValue || From ad906adec9c4bc4b7c3b2a7c9e099ae973a54237 Mon Sep 17 00:00:00 2001 From: Scott Deeter Date: Mon, 29 Jul 2024 13:10:10 -0700 Subject: [PATCH 6/6] Prettier --- src/libs/OptionsListUtils.ts | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/libs/OptionsListUtils.ts b/src/libs/OptionsListUtils.ts index da25b1b75ed6..3268db4be641 100644 --- a/src/libs/OptionsListUtils.ts +++ b/src/libs/OptionsListUtils.ts @@ -1716,14 +1716,7 @@ function getUserToInviteOption({ const isInOptionToExclude = optionsToExclude.findIndex((optionToExclude) => 'login' in optionToExclude && optionToExclude.login === PhoneNumber.addSMSDomainIfPhoneNumber(searchValue).toLowerCase()) !== -1; - if ( - !searchValue || - isCurrentUserLogin || - isInSelectedOption || - (!isValidEmail && !isValidPhoneNumber) || - isInOptionToExclude || - excludeUnknownUsers - ) { + if (!searchValue || isCurrentUserLogin || isInSelectedOption || (!isValidEmail && !isValidPhoneNumber) || isInOptionToExclude || excludeUnknownUsers) { return null; }