chore: finish filter

chore/offline-the-sys-files
Joel 11 months ago
parent 015ce09593
commit 169ae55635

@ -6,8 +6,11 @@ import useLegacyList from './use-legacy-list'
import Chip from '@/app/components/base/chip' import Chip from '@/app/components/base/chip'
import { RiFilter3Line } from '@remixicon/react' import { RiFilter3Line } from '@remixicon/react'
import { useCallback } from 'react' import { useCallback } from 'react'
import { useTranslation } from 'react-i18next'
const i18nPrefix = 'app.checkLegacy'
const Page = () => { const Page = () => {
const { t } = useTranslation()
const { const {
sort_by, sort_by,
setOrderBy, setOrderBy,
@ -22,13 +25,14 @@ const Page = () => {
const renderTriggerContent = useCallback(() => { const renderTriggerContent = useCallback(() => {
if(published === undefined) if(published === undefined)
return 'Published' return t(`${i18nPrefix}.published`)
return ( return (
<div> <div className='flex space-x-1'>
Published <span>{published === 1 ? 'Yes' : 'No'}</span> <div>{t(`${i18nPrefix}.published`)}</div>
<span className='system-sm-medium text-text-secondary'>{published === 1 ? t(`${i18nPrefix}.yes`) : t(`${i18nPrefix}.no`)}</span>
</div> </div>
) )
}, [published]) }, [published, t])
return ( return (
<div className='h-full rounded-t-2xl border-t border-effects-highlight bg-background-default-subtle px-6 pt-4'> <div className='h-full rounded-t-2xl border-t border-effects-highlight bg-background-default-subtle px-6 pt-4'>
@ -44,8 +48,8 @@ const Page = () => {
onSelect={handleSelectPublished} onSelect={handleSelectPublished}
onClear={clearPublished} onClear={clearPublished}
items={[ items={[
{ value: 1, name: 'Yes' }, { value: 1, name: t(`${i18nPrefix}.yes`) },
{ value: 0, name: 'No' }, { value: 0, name: t(`${i18nPrefix}.no`) },
]} ]}
/> />
<div className='h-3.5 w-px bg-divider-regular'></div> <div className='h-3.5 w-px bg-divider-regular'></div>
@ -54,8 +58,8 @@ const Page = () => {
order={sort_by?.startsWith('-') ? '-' : ''} order={sort_by?.startsWith('-') ? '-' : ''}
value={sort_by?.replace('-', '') || 'created_at'} value={sort_by?.replace('-', '') || 'created_at'}
items={[ items={[
{ value: 'created_at', name: 'Created At' }, { value: 'created_at', name: t(`${i18nPrefix}.createAt`) },
{ value: 'last_request', name: 'Last request' }, { value: 'last_request', name: t(`${i18nPrefix}.lastRequest`) },
]} ]}
onSelect={setOrderBy} onSelect={setOrderBy}
/> />

@ -75,7 +75,7 @@ const Chip: FC<Props> = ({
</div> </div>
</div> </div>
{!value && <RiArrowDownSLine className='h-4 w-4 text-text-tertiary' />} {!value && <RiArrowDownSLine className='h-4 w-4 text-text-tertiary' />}
{!!value && ( {(!!value || value === 0) && (
<div className='group/clear cursor-pointer p-[1px]' onClick={(e) => { <div className='group/clear cursor-pointer p-[1px]' onClick={(e) => {
e.stopPropagation() e.stopPropagation()
onClear() onClear()

@ -236,6 +236,11 @@ const translation = {
checkLegacy: { checkLegacy: {
title: 'Apps affected by image upload legacy', title: 'Apps affected by image upload legacy',
description: 'The current workspace has {{num}} applications affected, {{publishedNum}} of which have been published.', description: 'The current workspace has {{num}} applications affected, {{publishedNum}} of which have been published.',
published: 'Published',
yes: 'Yes',
no: 'No',
createAt: 'Created At',
lastRequest: 'Last Request',
}, },
} }

@ -237,6 +237,11 @@ const translation = {
checkLegacy: { checkLegacy: {
title: '受图像上传遗留问题影响的应用', title: '受图像上传遗留问题影响的应用',
description: '当前工作区有 {{num}} 个应用受图像上传遗留问题影响,其中 {{publishedNum}} 个已发布。', description: '当前工作区有 {{num}} 个应用受图像上传遗留问题影响,其中 {{publishedNum}} 个已发布。',
published: '已发布',
yes: '是',
no: '否',
createAt: '创建时间',
lastRequest: '最后请求',
}, },
} }

Loading…
Cancel
Save