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(console): only show m2m role notification for m2m roles #5957

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
16 changes: 7 additions & 9 deletions packages/console/src/pages/RoleDetails/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@
? Boolean(m2mRoleNotificationAcknowledged)
: true;

const isM2mRole = data?.type === RoleType.MachineToMachine;

const [isDeletionAlertOpen, setIsDeletionAlertOpen] = useState(false);

useEffect(() => {
Expand Down Expand Up @@ -97,8 +99,8 @@
className={classNames(isPageHasTable && styles.withTable)}
onRetry={mutate}
>
{/* Todo @xiaoyijun remove dev feature flag */}

Check warning on line 102 in packages/console/src/pages/RoleDetails/index.tsx

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

packages/console/src/pages/RoleDetails/index.tsx#L102

[no-warning-comments] Unexpected 'todo' comment: 'Todo @xiaoyijun remove dev feature flag'.
{isDevFeaturesEnabled && !isM2mRoleNotificationAcknowledged && (
{isDevFeaturesEnabled && isM2mRole && !isM2mRoleNotificationAcknowledged && (
<InlineNotification
action="general.got_it"
onClick={() => {
Expand All @@ -119,12 +121,10 @@
{data && (
<>
<DetailsPageHeader
icon={data.type === RoleType.User ? <UserIcon /> : <MachineToMachineIcon />}
icon={isM2mRole ? <MachineToMachineIcon /> : <UserIcon />}
title={data.name}
primaryTag={t(
data.type === RoleType.User
? 'role_details.type_user_role_tag'
: 'role_details.type_m2m_role_tag'
isM2mRole ? 'role_details.type_m2m_role_tag' : 'role_details.type_user_role_tag'
)}
identifier={{ name: 'ID', value: data.id }}
actionMenuItems={[
Expand Down Expand Up @@ -155,12 +155,10 @@
</TabNavItem>
<TabNavItem
href={`/roles/${data.id}/${
data.type === RoleType.User ? RoleDetailsTabs.Users : RoleDetailsTabs.M2mApps
isM2mRole ? RoleDetailsTabs.M2mApps : RoleDetailsTabs.Users
}`}
>
{t(
data.type === RoleType.User ? 'role_details.users_tab' : 'role_details.m2m_apps_tab'
)}
{t(isM2mRole ? 'role_details.m2m_apps_tab' : 'role_details.users_tab')}
</TabNavItem>
<TabNavItem href={`/roles/${data.id}/${RoleDetailsTabs.General}`}>
{t('role_details.general_tab')}
Expand Down
Loading