mirror of
https://github.com/umami-software/umami.git
synced 2026-02-09 15:17:23 +01:00
Refactor filter handling for queries.
This commit is contained in:
parent
5b300f1ff5
commit
ee6c68d27c
107 changed files with 731 additions and 835 deletions
|
|
@ -24,7 +24,7 @@ export function PasswordEditForm({ onSave, onClose }) {
|
|||
});
|
||||
};
|
||||
|
||||
const samePassword = (value: string, values: { [key: string]: any }) => {
|
||||
const samePassword = (value: string, values: Record<string, any>) => {
|
||||
if (value !== values.newPassword) {
|
||||
return formatMessage(messages.noMatchPassword);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
import { WebsitesTable } from '@/app/(main)/settings/websites/WebsitesTable';
|
||||
import { DataGrid } from '@/components/common/DataGrid';
|
||||
import { useWebsites } from '@/components/hooks';
|
||||
import { useWebsitesQuery } from '@/components/hooks';
|
||||
|
||||
export function UserWebsites({ userId }) {
|
||||
const queryResult = useWebsites({ userId });
|
||||
const queryResult = useWebsitesQuery({ userId });
|
||||
|
||||
return (
|
||||
<DataGrid queryResult={queryResult}>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { ReactNode } from 'react';
|
||||
import { WebsitesTable } from '@/app/(main)/settings/websites/WebsitesTable';
|
||||
import { DataGrid } from '@/components/common/DataGrid';
|
||||
import { useWebsites } from '@/components/hooks';
|
||||
import { useWebsitesQuery } from '@/components/hooks';
|
||||
|
||||
export function WebsitesDataTable({
|
||||
teamId,
|
||||
|
|
@ -16,10 +16,10 @@ export function WebsitesDataTable({
|
|||
showActions?: boolean;
|
||||
children?: ReactNode;
|
||||
}) {
|
||||
const queryResult = useWebsites({ teamId });
|
||||
const queryResult = useWebsitesQuery({ teamId });
|
||||
|
||||
return (
|
||||
<DataGrid queryResult={queryResult} renderEmpty={() => children}>
|
||||
<DataGrid queryResult={queryResult} renderEmpty={() => children} allowSearch allowPaging>
|
||||
{({ data }) => (
|
||||
<WebsitesTable
|
||||
teamId={teamId}
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ export function WebsitesTable({
|
|||
return (
|
||||
<DataTable data={data}>
|
||||
<DataColumn id="name" label={formatMessage(labels.name)}>
|
||||
{(row: any) => <Link href={renderUrl(`/websites/${row.id}`)}>{row.name}</Link>}
|
||||
{(row: any) => <Link href={renderUrl(`/websites/${row.id}`, false)}>{row.name}</Link>}
|
||||
</DataColumn>
|
||||
<DataColumn id="domain" label={formatMessage(labels.domain)} />
|
||||
{showActions && (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue