Update testing library

This commit is contained in:
Alejandro Celaya
2023-08-08 11:24:19 +02:00
parent 2da0043e0a
commit 5bce7b91f1
4 changed files with 38 additions and 20 deletions

View File

@@ -1,7 +1,6 @@
import { LabeledFormGroup, OrderingDropdown, SimpleCard } from '@shlinkio/shlink-frontend-kit';
import type { Settings, ShortUrlsListSettings as ShortUrlsSettings } from '@shlinkio/shlink-web-component';
import type { FC } from 'react';
import { SHORT_URLS_ORDERABLE_FIELDS } from '../../shlink-web-component/src/short-urls/data';
import { DEFAULT_SHORT_URLS_ORDERING } from './reducers/settings';
interface ShortUrlsListSettingsProps {
@@ -9,6 +8,14 @@ interface ShortUrlsListSettingsProps {
setShortUrlsListSettings: (settings: ShortUrlsSettings) => void;
}
const SHORT_URLS_ORDERABLE_FIELDS = {
dateCreated: 'Created at',
shortCode: 'Short URL',
longUrl: 'Long URL',
title: 'Title',
visits: 'Visits',
};
export const ShortUrlsListSettings: FC<ShortUrlsListSettingsProps> = (
{ settings: { shortUrlsList }, setShortUrlsListSettings },
) => (

View File

@@ -1,7 +1,6 @@
import { LabeledFormGroup, OrderingDropdown, SimpleCard } from '@shlinkio/shlink-frontend-kit';
import type { Settings, TagsSettings as TagsSettingsOptions } from '@shlinkio/shlink-web-component';
import type { FC } from 'react';
import { TAGS_ORDERABLE_FIELDS } from '../../shlink-web-component/src/tags/data/TagsListChildrenProps';
import type { Defined } from '../utils/types';
export type TagsOrder = Defined<TagsSettingsOptions['defaultOrdering']>;
@@ -11,6 +10,12 @@ interface TagsProps {
setTagsSettings: (settings: TagsSettingsOptions) => void;
}
const TAGS_ORDERABLE_FIELDS = {
tag: 'Tag',
shortUrls: 'Short URLs',
visits: 'Visits',
};
export const TagsSettings: FC<TagsProps> = ({ settings: { tags }, setTagsSettings }) => (
<SimpleCard title="Tags" className="h-100">
<LabeledFormGroup noMargin label="Default ordering for tags list:">