Fix: add application_role to account-related fields (#48)
* Fix: fix accounts view, menu * add migration * add application_role to account-related fields
This commit is contained in:
@@ -1,7 +1,4 @@
|
||||
import {
|
||||
BorderedNavigationMenu,
|
||||
BorderedNavigationMenuItem,
|
||||
} from '@kit/ui/bordered-navigation-menu';
|
||||
import { useMemo } from 'react';
|
||||
|
||||
import { AppLogo } from '~/components/app-logo';
|
||||
import { ProfileAccountDropdownContainer } from '~/components/personal-account-dropdown-container';
|
||||
@@ -10,18 +7,22 @@ import { getTeamAccountSidebarConfig } from '~/config/team-account-navigation.co
|
||||
// local imports
|
||||
import { TeamAccountWorkspace } from '../_lib/server/team-account-workspace.loader';
|
||||
import { TeamAccountNotifications } from './team-account-notifications';
|
||||
import { useMemo } from 'react';
|
||||
|
||||
export function TeamAccountNavigationMenu(props: {
|
||||
workspace: TeamAccountWorkspace;
|
||||
}) {
|
||||
const { account, user, accounts: rawAccounts } = props.workspace;
|
||||
|
||||
const accounts = useMemo(() => rawAccounts.map((account) => ({
|
||||
label: account.name,
|
||||
value: account.slug,
|
||||
image: account.picture_url,
|
||||
})),[rawAccounts])
|
||||
const accounts = useMemo(
|
||||
() =>
|
||||
rawAccounts.map((account) => ({
|
||||
label: account.name,
|
||||
value: account.slug,
|
||||
image: account.picture_url,
|
||||
application_role: account.application_role,
|
||||
})),
|
||||
[rawAccounts],
|
||||
);
|
||||
|
||||
const routes = getTeamAccountSidebarConfig(account.slug).routes.reduce<
|
||||
Array<{
|
||||
@@ -48,7 +49,7 @@ export function TeamAccountNavigationMenu(props: {
|
||||
<AppLogo />
|
||||
</div>
|
||||
|
||||
<div className={'flex items-center justify-end space-x-2.5 gap-2'}>
|
||||
<div className={'flex items-center justify-end gap-2 space-x-2.5'}>
|
||||
<TeamAccountNotifications accountId={account.id} userId={user.id} />
|
||||
<ProfileAccountDropdownContainer
|
||||
user={user}
|
||||
|
||||
Reference in New Issue
Block a user