Skip to content
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
3912108
feat: add route search form with 9 filter fields
DSingh0304 Oct 7, 2025
fab7806
feat(tests): add end-to-end tests for routes search functionality
DSingh0304 Oct 12, 2025
75a8903
Merge branch 'master' into master
DSingh0304 Oct 17, 2025
b95810a
Change import from 'clsx' to 'classNames'
DSingh0304 Oct 17, 2025
62850cd
refactor(SearchForm): remove placeholder text from input fields
DSingh0304 Oct 23, 2025
15329fe
Merge branch 'master' into master
Baoyuantop Nov 17, 2025
ed84e0b
fix: fetch all data for client-side filtering
DSingh0304 Nov 17, 2025
892983b
test: add e2e test for creating routes with version labels via UI
DSingh0304 Nov 17, 2025
3e34815
feat: add versionOptions to route SearchForm and update e2e test
DSingh0304 Nov 17, 2025
2facdec
feat: enhance pagination tests to filter routes across all pages
DSingh0304 Nov 18, 2025
e1489cc
fix: update type casting for pagination parameters in RouteList
DSingh0304 Nov 19, 2025
5c46c2f
fix: improve type casting for search parameters in RouteList
DSingh0304 Nov 19, 2025
15b45b1
feat: add deleteAllConsumers function to handle bulk deletion of cons…
DSingh0304 Nov 19, 2025
ae762d9
fix: routes search reset functionality
DSingh0304 Nov 21, 2025
4998fa1
Merge branch 'master' into master
DSingh0304 Nov 21, 2025
c8183f2
Merge branch 'apache:master' into master
DSingh0304 Nov 24, 2025
6d3b7c0
feat: Add search limit alert to tables and refactor clsx import.
DSingh0304 Dec 16, 2025
8e7bdf1
Merge branch 'master' into master
DSingh0304 Dec 17, 2025
5562c3d
Merge branch 'apache:master' into master
DSingh0304 Jan 2, 2026
661fe5d
Merge branch 'apache:master' into master
DSingh0304 Jan 14, 2026
726b303
Update src/types/schema/pageSearch.ts
DSingh0304 Feb 15, 2026
ff4da3a
test: add missing line breaks in various E2E test files for better re…
DSingh0304 Feb 15, 2026
56d6728
refactor: inline RouteDetailButton in RouteComponent for improved rea…
DSingh0304 Feb 15, 2026
6bbc6a3
Update src/routes/routes/index.tsx
DSingh0304 Feb 15, 2026
0b535b0
Update src/utils/clientSideFilter.ts
DSingh0304 Feb 15, 2026
7035fe5
perf: exclude name filter from client-side filtering check
DSingh0304 Feb 15, 2026
b762b3c
Update src/routes/routes/index.tsx
DSingh0304 Feb 15, 2026
cca2861
Update src/routes/routes/index.tsx
DSingh0304 Feb 15, 2026
5794d81
Update src/locales/es/common.json
DSingh0304 Feb 15, 2026
a4c2b98
Update e2e/tests/routes.filter-version.spec.ts
DSingh0304 Feb 15, 2026
e5ace68
Update src/locales/de/common.json
DSingh0304 Feb 15, 2026
f232c64
Update e2e/tests/routes.search.spec.ts
DSingh0304 Feb 15, 2026
11b17fa
Fix client-side filtering by ensuring route labels exist before matching
DSingh0304 Feb 15, 2026
dcad03f
Refactor status handling in route filtering and update localization s…
DSingh0304 Feb 15, 2026
2f0cf89
Update src/routes/routes/index.tsx
DSingh0304 Feb 15, 2026
838b614
Update src/routes/routes/index.tsx
DSingh0304 Feb 15, 2026
3f895dd
fix: enhance client-side route filtering and update e2e tests
DSingh0304 Feb 19, 2026
86cd829
feat: `useSearchParams` reset function now accepts optional default p…
DSingh0304 Feb 19, 2026
e4ad11e
Update src/utils/clientSideFilter.ts
DSingh0304 Feb 19, 2026
0359347
Update src/locales/es/common.json
DSingh0304 Feb 19, 2026
829e943
Update src/routes/routes/index.tsx
DSingh0304 Feb 19, 2026
4198c64
Update src/locales/de/common.json
DSingh0304 Feb 19, 2026
db8b164
feat: Add Turkish and Chinese translations for search form fields and…
DSingh0304 Feb 19, 2026
039a1b0
docs: Improve comments explaining the client-side filtering strategy
DSingh0304 Feb 19, 2026
1f20d17
Refine client-side plugin filtering to explicitly handle routes witho…
DSingh0304 Feb 19, 2026
873cbf2
fix(locale): move searchLimit to table section for es and de
DSingh0304 Feb 24, 2026
22695d2
fix(routes): fix setParams naming collision in RouteList
DSingh0304 Feb 24, 2026
4f468a9
refactor route version filter E2E tests to use API-based setup.
DSingh0304 Feb 24, 2026
de30b5f
Update src/types/schema/pageSearch.ts
DSingh0304 Feb 27, 2026
be130e2
Update src/utils/clientSideFilter.ts
DSingh0304 Feb 27, 2026
80d3f46
Merge branch 'apache:master' into master
DSingh0304 Feb 28, 2026
499598c
feat(SearchForm): add placeholders to text inputs for better UX and f…
DSingh0304 Mar 1, 2026
0b0e131
update SearchForm to use AutoComplete.
DSingh0304 Mar 1, 2026
7f7f3f1
feat(SearchForm): change labels select mode to tags to support free-f…
DSingh0304 Mar 1, 2026
eef0a79
fix(clientSideFilter): ensure routes without description are filtered…
DSingh0304 Mar 1, 2026
5e266c0
Update src/types/schema/pageSearch.ts
DSingh0304 Mar 1, 2026
61fcccd
Update src/components/form/SearchForm.tsx
DSingh0304 Mar 1, 2026
42f06cc
Update src/utils/clientSideFilter.ts
DSingh0304 Mar 1, 2026
7df285b
Typescript errors resolved
DSingh0304 Mar 10, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
128 changes: 128 additions & 0 deletions e2e/tests/routes.search.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import { routesPom } from '@e2e/pom/routes';
import { e2eReq } from '@e2e/utils/req';
import { test } from '@e2e/utils/test';
import { expect} from '@playwright/test';

import { deleteAllRoutes, putRouteReq } from '@/apis/routes';
import { API_ROUTES } from '@/config/constant';
import type { APISIXType } from '@/types/schema/apisix';

// Sample routes for testing search functionality
const testRoutes: APISIXType['Route'][] = [
{
id: 'search_route_1',
name: 'alpha_route',
uri: '/alpha',
desc: 'First test route',
methods: ['GET'],
upstream: {
nodes: [{ host: '127.0.0.1', port: 80, weight: 100 }],
},
},
{
id: 'search_route_2',
name: 'beta_route',
uri: '/beta',
desc: 'Second test route',
methods: ['POST'],
upstream: {
nodes: [{ host: '127.0.0.1', port: 80, weight: 100 }],
},
},
{
id: 'search_route_3',
name: 'gamma_route',
uri: '/gamma',
desc: 'Third test route',
methods: ['GET'],
upstream: {
nodes: [{ host: '127.0.0.1', port: 80, weight: 100 }],
},
},
];

test.describe('Routes search functionality', () => {
test.describe.configure({ mode: 'serial' });

test.beforeAll(async () => {
await deleteAllRoutes(e2eReq);
await Promise.all(testRoutes.map((route) => putRouteReq(e2eReq, route)));
});

test.afterAll(async () => {
await Promise.all(
testRoutes.map((route) => e2eReq.delete(`${API_ROUTES}/${route.id}`))
);
});

test('should filter routes by name', async ({ page }) => {
await test.step('navigate to routes page', async () => {
await routesPom.getRouteNavBtn(page).click();
await routesPom.isIndexPage(page);
});

await test.step('search for routes with "alpha" in name', async () => {
const nameInput = page.getByLabel('Name'); // Matches the label from SearchForm
await nameInput.fill('alpha');
const searchButton = page.getByRole('button', { name: 'Search' });
await searchButton.click();

// Wait for table to update
await expect(page.getByText('alpha_route')).toBeVisible();

// Verify only matching route is shown
const tableRows = page.getByRole('row');
await expect(tableRows).toHaveCount(2); // Header + 1 data row
await expect(page.getByText('beta_route')).toBeHidden();
await expect(page.getByText('gamma_route')).toBeHidden();
});

await test.step('reset search and verify all routes are shown', async () => {
const resetButton = page.getByRole('button', { name: 'Reset' });
await resetButton.click();

// Wait for table to update
await expect(page.getByText('beta_route')).toBeVisible();

// Verify all routes are back
const tableRows = page.getByRole('row');
await expect(tableRows).toHaveCount(4); // Header + 3 data rows
await expect(page.getByText('alpha_route')).toBeVisible();
await expect(page.getByText('gamma_route')).toBeVisible();
});
});

test('should show no results for non-matching search', async ({ page }) => {
await test.step('navigate to routes page', async () => {
await routesPom.getRouteNavBtn(page).click();
await routesPom.isIndexPage(page);
});

await test.step('search for non-existent name', async () => {
const nameInput = page.getByLabel('Name');
await nameInput.fill('nonexistent');
const searchButton = page.getByRole('button', { name: 'Search' });
await searchButton.click();

// Wait for table to update
await expect(page.getByText('No Data')).toBeVisible(); // Assuming Antd's empty state
});
});
});
4 changes: 2 additions & 2 deletions src/components/form/Editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/
import { InputWrapper, type InputWrapperProps, Skeleton } from '@mantine/core';
import { Editor } from '@monaco-editor/react';
import { clsx } from 'clsx';
import classNames from 'clsx';
import { useEffect, useMemo, useRef, useState } from 'react';
import {
type FieldValues,
Expand Down Expand Up @@ -132,7 +132,7 @@ export const FormItemEditor = <T extends FieldValues>(
)}
<Editor
wrapperProps={{
className: clsx(
className: classNames(
'editor-wrapper',
restField.disabled && 'editor-wrapper--disabled'
),
Expand Down
Loading
Loading