Compare commits

..

No commits in common. "b84942b6dac1dcf64d946bfb321a2071a3af66aa" and "c5aa8be15cbee74f3264bcb09437f6cde12b857b" have entirely different histories.

5 changed files with 464 additions and 174 deletions

View file

@ -102,7 +102,7 @@
"kafkajs": "^2.1.0",
"lucide-react": "^0.543.0",
"maxmind": "^5.0.0",
"next": "^15.5.10",
"next": "^15.5.9",
"node-fetch": "^3.2.8",
"npm-run-all": "^4.1.5",
"papaparse": "^5.5.3",
@ -164,7 +164,7 @@
"stylelint-config-css-modules": "^4.5.1",
"stylelint-config-prettier": "^9.0.3",
"stylelint-config-recommended": "^14.0.0",
"tar": "^7.5.7",
"tar": "^7.5.4",
"ts-jest": "^29.4.6",
"ts-node": "^10.9.1",
"tsup": "^8.5.0",

617
pnpm-lock.yaml generated

File diff suppressed because it is too large Load diff

View file

@ -1,14 +1,13 @@
import { DataColumn, DataTable, type DataTableProps, Row } from '@umami/react-zen';
import { DateDistance } from '@/components/common/DateDistance';
import { ExternalLink } from '@/components/common/ExternalLink';
import { useConfig, useMessages, useMobile } from '@/components/hooks';
import { useConfig, useMessages } from '@/components/hooks';
import { ShareDeleteButton } from './ShareDeleteButton';
import { ShareEditButton } from './ShareEditButton';
export function SharesTable(props: DataTableProps) {
const { formatMessage, labels } = useMessages();
const { cloudMode } = useConfig();
const { isMobile } = useMobile();
const getUrl = (slug: string) => {
return `${cloudMode ? process.env.cloudUrl : window?.location.origin}${process.env.basePath || ''}/share/${slug}`;
@ -19,7 +18,7 @@ export function SharesTable(props: DataTableProps) {
<DataColumn id="name" label={formatMessage(labels.name)}>
{({ name }: any) => name}
</DataColumn>
<DataColumn id="slug" label={formatMessage(labels.shareUrl)} width="2fr">
<DataColumn id="slug" label={formatMessage(labels.shareUrl)}>
{({ slug }: any) => {
const url = getUrl(slug);
return (
@ -29,11 +28,9 @@ export function SharesTable(props: DataTableProps) {
);
}}
</DataColumn>
{!isMobile && (
<DataColumn id="created" label={formatMessage(labels.created)}>
{(row: any) => <DateDistance date={new Date(row.createdAt)} />}
</DataColumn>
)}
<DataColumn id="created" label={formatMessage(labels.created)} width="200px">
{(row: any) => <DateDistance date={new Date(row.createdAt)} />}
</DataColumn>
<DataColumn id="action" align="end" width="100px">
{({ id, slug }: any) => {
return (

View file

@ -11,7 +11,7 @@ export interface WebsiteShareFormProps {
export function WebsiteShareForm({ websiteId }: WebsiteShareFormProps) {
const { formatMessage, labels, messages } = useMessages();
const { data } = useWebsiteSharesQuery({ websiteId });
const { data, isLoading } = useWebsiteSharesQuery({ websiteId });
const shares = data?.data || [];
const hasShares = shares.length > 0;

View file

@ -18,5 +18,5 @@ test('getIpAddress: Standard header', () => {
});
test('getIpAddress: No header', () => {
expect(getIpAddress(new Headers())).toEqual(undefined);
expect(getIpAddress(new Headers())).toEqual(null);
});