Skip to content

Commit

Permalink
test(): update and add test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
MarvinPerry committed Nov 15, 2024
1 parent 44e403d commit e680b3c
Show file tree
Hide file tree
Showing 4 changed files with 584 additions and 89 deletions.
14 changes: 6 additions & 8 deletions packages/common/src/users/_internal/UserUiSchemaSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,12 +290,10 @@ async function _getCommunityOrEnterpriseAGOUrl(
export async function _getPortalSettings(
context: IArcGISContext
): Promise<any> {
if (context.portal) {
// Fail safe fetch the portal settings
const fsGetPortalSettings = failSafe(getPortalSettings, {});
const settings = await fsGetPortalSettings(context.portal.id, {
portal: context.sharingApiUrl,
});
return settings;
}
// Fail safe fetch the portal settings
const fsGetPortalSettings = failSafe(getPortalSettings, {});
const settings = await fsGetPortalSettings(context.portal.id, {
portal: context.sharingApiUrl,
});
return settings;
}
10 changes: 5 additions & 5 deletions packages/common/src/users/_internal/computeProps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ export async function computeProps(
const _portalself = await fsGetSelf(context.requestOptions);
user.hubOrgSettings = {
showInformationalBanner:
!!_portalself?.portalProperties?.hub?.settings?.informationalBanner,
enableTermsAndConditions: !!signinSettings?.termsAndConditions,
termsAndConditions: signinSettings?.termsAndConditions,
enableSignupText: !!signinSettings?.signupText,
signupText: signinSettings?.signupText,
!!_portalself.portalProperties?.hub?.settings?.informationalBanner,
enableTermsAndConditions: !!signinSettings.termsAndConditions,
termsAndConditions: signinSettings.termsAndConditions,
enableSignupText: !!signinSettings.signupText,
signupText: signinSettings.signupText,
};

return user;
Expand Down
Loading

0 comments on commit e680b3c

Please sign in to comment.