mirror of
https://github.com/umami-software/umami.git
synced 2026-02-10 15:47:13 +01:00
Lint fixes.
This commit is contained in:
parent
c948bbca12
commit
e1e6493dec
17 changed files with 41 additions and 71 deletions
|
|
@ -4,7 +4,6 @@ import { useContext } from 'react';
|
|||
import { Button, Row, Label, Icon, Popover, MenuTrigger } from '@umami/react-zen';
|
||||
import { FieldSelectForm } from '../[reportId]/FieldSelectForm';
|
||||
import { ParameterList } from '../[reportId]/ParameterList';
|
||||
import { PopupForm } from '../[reportId]/PopupForm';
|
||||
import { ReportContext } from './Report';
|
||||
|
||||
export function FieldParameters() {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { useContext } from 'react';
|
||||
import { useMessages, useFormat, useFilters, useFields } from '@/components/hooks';
|
||||
import { Icons } from '@/components/icons';
|
||||
import { Button, Text, Row, Label, Icon, Popover, MenuTrigger } from '@umami/react-zen';
|
||||
import { Button, Row, Label, Icon, Popover, MenuTrigger } from '@umami/react-zen';
|
||||
import { FilterSelectForm } from '../[reportId]/FilterSelectForm';
|
||||
import { ParameterList } from '../[reportId]/ParameterList';
|
||||
import { PopupForm } from '../[reportId]/PopupForm';
|
||||
|
|
|
|||
|
|
@ -71,14 +71,6 @@ export function GoalsAddForm({
|
|||
}
|
||||
};
|
||||
|
||||
const renderTypeValue = (value: any) => {
|
||||
return items.find(item => item.value === value)?.label;
|
||||
};
|
||||
|
||||
const renderoperatorValue = (value: any) => {
|
||||
return operators.find(item => item.value === value)?.label;
|
||||
};
|
||||
|
||||
return (
|
||||
<Column gap="3">
|
||||
<Label>{formatMessage(defaultValue ? labels.update : labels.add)}</Label>
|
||||
|
|
@ -87,7 +79,6 @@ export function GoalsAddForm({
|
|||
className={styles.dropdown}
|
||||
items={items}
|
||||
value={type}
|
||||
renderValue={renderTypeValue}
|
||||
onChange={(value: any) => setType(value)}
|
||||
>
|
||||
{({ value, label }: any) => {
|
||||
|
|
|
|||
|
|
@ -22,10 +22,6 @@ export function RetentionParameters() {
|
|||
}
|
||||
};
|
||||
|
||||
const handleDateChange = value => {
|
||||
updateReport({ parameters: { dateRange: { ...parseDateRange(value) } } });
|
||||
};
|
||||
|
||||
return (
|
||||
<Form values={parameters} onSubmit={handleSubmit} preventSubmit={true}>
|
||||
<BaseParameters showDateSelect={false} allowWebsiteSelect={!id} />
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@ import {
|
|||
} from '@umami/react-zen';
|
||||
import { useApi, useMessages } from '@/components/hooks';
|
||||
import { ROLES } from '@/lib/constants';
|
||||
import { messages } from '@/components/messages';
|
||||
|
||||
export function UserAddForm({ onSave, onClose }) {
|
||||
const { post, useMutation } = useApi();
|
||||
|
|
@ -51,9 +50,15 @@ export function UserAddForm({ onSave, onClose }) {
|
|||
rules={{ required: formatMessage(labels.required) }}
|
||||
>
|
||||
<Select>
|
||||
<ListItem id={ROLES.viewOnly} data-test="dropdown-item-viewOnly">{formatMessage(labels.viewOnly)}</ListItem>
|
||||
<ListItem id={ROLES.user} data-test="dropdown-item-user">{formatMessage(labels.user)}</ListItem>
|
||||
<ListItem id={ROLES.admin} data-test="dropdown-item-admin">{formatMessage(labels.admin)}</ListItem>
|
||||
<ListItem id={ROLES.viewOnly} data-test="dropdown-item-viewOnly">
|
||||
{formatMessage(labels.viewOnly)}
|
||||
</ListItem>
|
||||
<ListItem id={ROLES.user} data-test="dropdown-item-user">
|
||||
{formatMessage(labels.user)}
|
||||
</ListItem>
|
||||
<ListItem id={ROLES.admin} data-test="dropdown-item-admin">
|
||||
{formatMessage(labels.admin)}
|
||||
</ListItem>
|
||||
</Select>
|
||||
</FormField>
|
||||
<FormButtons>
|
||||
|
|
|
|||
|
|
@ -3,8 +3,7 @@ import Link from 'next/link';
|
|||
import { formatDistance } from 'date-fns';
|
||||
import { ROLES } from '@/lib/constants';
|
||||
import { useMessages, useLocale } from '@/components/hooks';
|
||||
import UserDeleteButton from './UserDeleteButton';
|
||||
import LinkButton from '@/components/common/LinkButton';
|
||||
import { UserDeleteButton } from './UserDeleteButton';
|
||||
|
||||
export function UsersTable({
|
||||
data = [],
|
||||
|
|
|
|||
|
|
@ -66,14 +66,22 @@ export function UserEditForm({ userId, onSave }: { userId: string; onSave?: () =
|
|||
rules={{ required: formatMessage(labels.required) }}
|
||||
>
|
||||
<Select defaultSelectedKey={user.role}>
|
||||
<ListItem id={ROLES.viewOnly} data-test="dropdown-item-viewOnly">{formatMessage(labels.viewOnly)}</ListItem>
|
||||
<ListItem id={ROLES.user} data-test="dropdown-item-user">{formatMessage(labels.user)}</ListItem>
|
||||
<ListItem id={ROLES.admin} data-test="dropdown-item-admin">{formatMessage(labels.admin)}</ListItem>
|
||||
<ListItem id={ROLES.viewOnly} data-test="dropdown-item-viewOnly">
|
||||
{formatMessage(labels.viewOnly)}
|
||||
</ListItem>
|
||||
<ListItem id={ROLES.user} data-test="dropdown-item-user">
|
||||
{formatMessage(labels.user)}
|
||||
</ListItem>
|
||||
<ListItem id={ROLES.admin} data-test="dropdown-item-admin">
|
||||
{formatMessage(labels.admin)}
|
||||
</ListItem>
|
||||
</Select>
|
||||
</FormField>
|
||||
)}
|
||||
<FormButtons>
|
||||
<FormSubmitButton data-test="button-submit" variant="primary">{formatMessage(labels.save)}</FormSubmitButton>
|
||||
<FormSubmitButton data-test="button-submit" variant="primary">
|
||||
{formatMessage(labels.save)}
|
||||
</FormSubmitButton>
|
||||
</FormButtons>
|
||||
</Form>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -37,7 +37,6 @@ export function ShareUrl({ hostUrl, onSave }: { hostUrl?: string; onSave?: () =>
|
|||
};
|
||||
|
||||
const handleSwitch = (checked: boolean) => {
|
||||
console.log({ checked });
|
||||
const data = {
|
||||
name: website.name,
|
||||
domain: website.domain,
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { Select, Icon, Icons, ListItem, Text, Grid, Column } from '@umami/react-zen';
|
||||
import { Icon, Icons, Text, Grid, Column } from '@umami/react-zen';
|
||||
import { LinkButton } from '@/components/common/LinkButton';
|
||||
import { useMessages, useNavigation } from '@/components/hooks';
|
||||
import { MenuNav } from '@/components/layout/MenuNav';
|
||||
|
|
@ -17,7 +17,6 @@ import { RegionsTable } from '@/components/metrics/RegionsTable';
|
|||
import { ScreenTable } from '@/components/metrics/ScreenTable';
|
||||
import { TagsTable } from '@/components/metrics/TagsTable';
|
||||
import { ChannelsTable } from '@/components/metrics/ChannelsTable';
|
||||
import Link from 'next/link';
|
||||
|
||||
const views = {
|
||||
url: PagesTable,
|
||||
|
|
@ -50,7 +49,6 @@ export function WebsiteExpandedView({
|
|||
}) {
|
||||
const { formatMessage, labels } = useMessages();
|
||||
const {
|
||||
router,
|
||||
renderUrl,
|
||||
query: { view },
|
||||
} = useNavigation();
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
import { Button, Icon, Icons, Box, MenuTrigger, Popover, Text } from '@umami/react-zen';
|
||||
import { PopupForm } from '@/app/(main)/reports/[reportId]/PopupForm';
|
||||
import { FilterSelectForm } from '@/app/(main)/reports/[reportId]/FilterSelectForm';
|
||||
import { useFields, useMessages, useNavigation, useDateRange } from '@/components/hooks';
|
||||
import { OPERATOR_PREFIXES } from '@/lib/constants';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue