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

[CP Staging] [fix] Setup specialist appears in member list and throws error when invited #56370

Merged
merged 5 commits into from
Feb 4, 2025
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/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6570,6 +6570,7 @@ const CONST = {
},
},
SKIPPABLE_COLLECTION_MEMBER_IDS: [String(DEFAULT_NUMBER_ID), '-1', 'undefined', 'null', 'NaN'] as string[],
SETUP_SPECIALIST_LOGIN: 'Setup Specialist',
} as const;

type Country = keyof typeof CONST.ALL_COUNTRIES;
Expand Down
9 changes: 8 additions & 1 deletion src/libs/OptionsListUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1481,7 +1481,14 @@ function getValidOptions(
for (let i = 0; i < options.personalDetails.length; i++) {
// eslint-disable-next-line rulesdir/prefer-at
const detail = options.personalDetails[i];
if (!detail?.login || !detail.accountID || !!detail?.isOptimisticPersonalDetail || (!includeDomainEmail && Str.isDomainEmail(detail.login))) {
if (
!detail?.login ||
!detail.accountID ||
!!detail?.isOptimisticPersonalDetail ||
(!includeDomainEmail && Str.isDomainEmail(detail.login)) ||
// Exclude the setup specialist from the list of personal details as it's a fallback if guide is not assigned
detail?.login === CONST.SETUP_SPECIALIST_LOGIN
) {
continue;
}

Expand Down
1 change: 1 addition & 0 deletions src/libs/actions/Report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3664,6 +3664,7 @@ function prepareOnboardingOnyxData(
assignedGuideAccountID = generateAccountID(assignedGuideEmail);
Onyx.merge(ONYXKEYS.PERSONAL_DETAILS_LIST, {
[assignedGuideAccountID]: {
isOptimisticPersonalDetail: assignedGuideEmail === CONST.SETUP_SPECIALIST_LOGIN,
login: assignedGuideEmail,
displayName: assignedGuideEmail,
},
Expand Down
Loading