Skip to content

Commit 6d3b7c0

Browse files
committed
feat: Add search limit alert to tables and refactor clsx import.
1 parent c8183f2 commit 6d3b7c0

File tree

3 files changed

+20
-7
lines changed

3 files changed

+20
-7
lines changed

src/components/form/Editor.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*/
1717
import { InputWrapper, type InputWrapperProps, Skeleton } from '@mantine/core';
1818
import { Editor } from '@monaco-editor/react';
19-
import classNames from 'clsx';
19+
import { clsx } from 'clsx';
2020
import { useEffect, useMemo, useRef, useState } from 'react';
2121
import {
2222
type FieldValues,
@@ -132,7 +132,7 @@ export const FormItemEditor = <T extends FieldValues>(
132132
)}
133133
<Editor
134134
wrapperProps={{
135-
className: classNames(
135+
className: clsx(
136136
'editor-wrapper',
137137
restField.disabled && 'editor-wrapper--disabled'
138138
),

src/locales/en/common.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -387,9 +387,10 @@
387387
"table": {
388388
"actions": "Actions",
389389
"disabled": "Disabled",
390-
"enabled": "Enabled"
390+
"enabled": "Enabled",
391+
"searchLimit": "Search only allows searching in the first {{count}} records."
391392
},
392393
"upstreams": {
393394
"singular": "Upstream"
394395
}
395-
}
396+
}

src/routes/routes/index.tsx

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ export const RouteList = (props: RouteListProps) => {
129129
totalCount: paginated.total,
130130
};
131131
}
132-
132+
133133
// Otherwise, use paginated data from backend
134134
return {
135135
filteredData: data?.list || [],
@@ -151,14 +151,14 @@ export const RouteList = (props: RouteListProps) => {
151151
const versionOptions = useMemo(() => {
152152
const dataSource = needsAllData && allData?.list ? allData.list : data?.list || [];
153153
const versions = new Set<string>();
154-
154+
155155
dataSource.forEach((route) => {
156156
const versionLabel = route.value.labels?.version;
157157
if (versionLabel) {
158158
versions.add(versionLabel);
159159
}
160160
});
161-
161+
162162
return Array.from(versions)
163163
.sort()
164164
.map((version) => ({
@@ -250,6 +250,18 @@ export const RouteList = (props: RouteListProps) => {
250250
],
251251
},
252252
}}
253+
tableAlertRender={
254+
needsAllData
255+
? () => (
256+
<span style={{ color: '#faad14' }}>
257+
{t('table.searchLimit', {
258+
defaultValue: `Search only allows searching in the first ${PAGE_SIZE_MAX} records.`,
259+
count: PAGE_SIZE_MAX,
260+
})}
261+
</span>
262+
)
263+
: undefined
264+
}
253265
/>
254266
</AntdConfigProvider>
255267
);

0 commit comments

Comments
 (0)