mirror of
https://github.com/umami-software/umami.git
synced 2026-02-10 15:47:13 +01:00
Add includeTeams param for fetching websites.
Some checks are pending
Node.js CI / build (postgresql, 18.18) (push) Waiting to run
Some checks are pending
Node.js CI / build (postgresql, 18.18) (push) Waiting to run
This commit is contained in:
parent
433ce98719
commit
9ccafc390a
6 changed files with 34 additions and 36 deletions
|
|
@ -18,6 +18,7 @@ import {
|
|||
import { useMessages, useNavigation } from '@/components/hooks';
|
||||
import { SideMenu } from '@/components/common/SideMenu';
|
||||
import { WebsiteSelect } from '@/components/input/WebsiteSelect';
|
||||
import { Text } from '@umami/react-zen';
|
||||
|
||||
export function WebsiteNav({ websiteId }: { websiteId: string }) {
|
||||
const { formatMessage, labels } = useMessages();
|
||||
|
|
@ -147,13 +148,27 @@ export function WebsiteNav({ websiteId }: { websiteId: string }) {
|
|||
router.push(renderUrl(`/websites/${value}`));
|
||||
};
|
||||
|
||||
const renderValue = (value: any) => {
|
||||
return (
|
||||
<Text truncate style={{ maxWidth: 160, lineHeight: 1 }}>
|
||||
{value?.selectedItem?.name}
|
||||
</Text>
|
||||
);
|
||||
};
|
||||
|
||||
const selectedKey = items
|
||||
.flatMap(e => e.items)
|
||||
.find(({ path }) => path && pathname.endsWith(path.split('?')[0]))?.id;
|
||||
|
||||
return (
|
||||
<SideMenu items={items} selectedKey={selectedKey} allowMinimize={false} muteItems={false}>
|
||||
<WebsiteSelect websiteId={websiteId} teamId={teamId} onChange={handleChange} />
|
||||
<WebsiteSelect
|
||||
websiteId={websiteId}
|
||||
teamId={teamId}
|
||||
onChange={handleChange}
|
||||
renderValue={renderValue}
|
||||
buttonProps={{ style: { outline: 'none' } }}
|
||||
/>
|
||||
</SideMenu>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue