Skip to content

Commit

Permalink
Merge pull request #2815 from umami-software/dev
Browse files Browse the repository at this point in the history
v2.12.1
  • Loading branch information
mikecao committed Jun 25, 2024
2 parents d265845 + 05e4555 commit d7141e6
Show file tree
Hide file tree
Showing 26 changed files with 52 additions and 9 deletions.
2 changes: 1 addition & 1 deletion next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ const config = {
destination: '/api/scripts/telemetry',
},
{
source: '/teams/:teamId/:path*',
source: '/teams/:teamId/:path((?!settings).*)*',
destination: '/:path*',
},
];
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "umami",
"version": "2.12.0",
"version": "2.12.1",
"description": "A simple, fast, privacy-focused alternative to Google Analytics.",
"author": "Umami Software, Inc. <hello@umami.is>",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion src/app/(main)/reports/journey/JourneyView.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
}

.name {
font-weight: 500;
max-width: 200px;
}

.count {
Expand Down
6 changes: 4 additions & 2 deletions src/app/(main)/reports/journey/JourneyView.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useContext, useMemo, useState } from 'react';
import { TooltipPopup } from 'react-basics';
import { TextOverflow, TooltipPopup } from 'react-basics';
import { firstBy } from 'thenby';
import classNames from 'classnames';
import { useEscapeKey, useMessages } from 'components/hooks';
Expand Down Expand Up @@ -191,7 +191,9 @@ export default function JourneyView() {
})}
onClick={() => handleClick(name, columnIndex, paths)}
>
<div className={styles.name}>{name}</div>
<div className={styles.name} title={name}>
<TextOverflow> {name}</TextOverflow>
</div>
<TooltipPopup label={dropOffPercent} disabled={!selected}>
<div className={styles.count} title={nodeCount}>
{formatLongNumber(nodeCount)}
Expand Down
7 changes: 6 additions & 1 deletion src/app/(main)/teams/[teamId]/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
import TeamProvider from './TeamProvider';
import { Metadata } from 'next';
import TeamSettingsLayout from './settings/TeamSettingsLayout';

export default function ({ children, params: { teamId } }) {
return <TeamProvider teamId={teamId}>{children}</TeamProvider>;
return (
<TeamProvider teamId={teamId}>
<TeamSettingsLayout>{children}</TeamSettingsLayout>
</TeamProvider>
);
}

export const metadata: Metadata = {
Expand Down
29 changes: 29 additions & 0 deletions src/app/(main)/teams/[teamId]/settings/TeamSettingsLayout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
'use client';
import { ReactNode } from 'react';
import { useMessages, useTeamUrl } from 'components/hooks';
import MenuLayout from 'components/layout/MenuLayout';

export default function TeamSettingsLayout({ children }: { children: ReactNode }) {
const { formatMessage, labels } = useMessages();
const { teamId } = useTeamUrl();

const items = [
{
key: 'team',
label: formatMessage(labels.team),
url: `/teams/${teamId}/settings/team`,
},
{
key: 'websites',
label: formatMessage(labels.websites),
url: `/teams/${teamId}/settings/websites`,
},
{
key: 'members',
label: formatMessage(labels.members),
url: `/teams/${teamId}/settings/members`,
},
].filter(n => n);

return <MenuLayout items={items}>{children}</MenuLayout>;
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import PageHeader from 'components/layout/PageHeader';
import { ROLES } from 'lib/constants';
import { useContext, useState } from 'react';
import { Flexbox, Item, Tabs } from 'react-basics';
import TeamLeaveButton from '../../TeamLeaveButton';
import TeamLeaveButton from 'app/(main)/settings/teams/TeamLeaveButton';
import TeamManage from './TeamManage';
import TeamEditForm from './TeamEditForm';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
} from 'react-basics';
import { getRandomChars } from 'next-basics';
import { useContext, useRef, useState } from 'react';
import { useApi, useMessages } from 'components/hooks';
import { useApi, useMessages, useModified } from 'components/hooks';
import { TeamContext } from 'app/(main)/teams/[teamId]/TeamProvider';

const generateId = () => getRandomChars(16);
Expand All @@ -26,12 +26,14 @@ export function TeamEditForm({ teamId, allowEdit }: { teamId: string; allowEdit?
const ref = useRef(null);
const [accessCode, setAccessCode] = useState(team.accessCode);
const { showToast } = useToasts();
const { touch } = useModified();
const cloudMode = !!process.env.cloudMode;

const handleSubmit = async (data: any) => {
mutate(data, {
onSuccess: async () => {
ref.current.reset(data);
touch('teams');
showToast({ message: formatMessage(messages.saved), variant: 'success' });
},
});
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import Page from 'app/(main)/settings/websites/[websiteId]/page';

export default function ({ params }) {
return <Page params={params} />;
}
2 changes: 1 addition & 1 deletion src/components/metrics/MetricCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const MetricCard = ({
return (
<div className={classNames(styles.card, className, showPrevious && styles.compare)}>
{showLabel && <div className={styles.label}>{label}</div>}
<animated.div className={styles.value} title={value.toString()}>
<animated.div className={styles.value} title={value?.toString()}>
{props?.x?.to(x => formatValue(x))}
</animated.div>
{showChange && (
Expand Down

0 comments on commit d7141e6

Please sign in to comment.