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

fix(experience): hide scope list if no user scopes and resource scopes #5840

Merged
merged 1 commit into from
May 10, 2024
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,12 @@
[t, userScopes]
);

const showTerms = Boolean(termsUrl ?? privacyUrl);
// Todo @xiaoyijun remove dev feature flag and authorization agreement from this component

Check warning on line 48 in packages/experience/src/pages/Consent/ScopesListCard/index.tsx

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

packages/experience/src/pages/Consent/ScopesListCard/index.tsx#L48

[no-warning-comments] Unexpected 'todo' comment: 'Todo @xiaoyijun remove dev feature flag...'.
const showTerms = !isDevFeaturesEnabled && Boolean(termsUrl ?? privacyUrl);

// If there is no user scopes and resource scopes, we don't need to show the scopes list.
// This is a fallback for the corner case that all the scopes are already granted.
if (
!isDevFeaturesEnabled && // Todo @xiaoyijun remove dev feature flag
!userScopesData?.length &&
!resourceScopes?.length
) {
if (!userScopesData?.length && !resourceScopes?.length) {
return showTerms ? (
<div className={className}>
<Trans
Expand Down Expand Up @@ -90,7 +87,7 @@
<ScopeGroup
key={resource.id}
groupName={
// Todo @xiaoyijun remove this when the org scopes display in the new card

Check warning on line 90 in packages/experience/src/pages/Consent/ScopesListCard/index.tsx

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

packages/experience/src/pages/Consent/ScopesListCard/index.tsx#L90

[no-warning-comments] Unexpected 'todo' comment: 'Todo @xiaoyijun remove this when the org...'.
resource.id === ReservedResource.Organization
? t('description.organization_scopes')
: resource.name
Expand All @@ -100,7 +97,7 @@
isAutoExpand={!userScopesData?.length && resourceScopes.length === 1}
/>
))}
{!isDevFeaturesEnabled && // Todo @xiaoyijun remove dev feature flag

Check warning on line 100 in packages/experience/src/pages/Consent/ScopesListCard/index.tsx

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

packages/experience/src/pages/Consent/ScopesListCard/index.tsx#L100

[no-warning-comments] Unexpected 'todo' comment: 'Todo @xiaoyijun remove dev feature flag'.
showTerms && (
<div className={styles.terms}>
<Trans
Expand Down
Loading