feat(web): 列表自适应布局并将分页固定页脚
数据源与查询列表整页不滚、仅表体内滚;名称筛选去掉「模糊」占位后缀。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
c1da6d7c3a
commit
be63e2fe5d
11 files changed
+314
-271
No files matched your search
@@ -313,14 +313,21 @@ test.describe("datasources console", () => {
|
||||
await expect(page.getByTestId("datasource-filter-search")).toBeVisible();
|
||||
await expect(page.getByTestId("datasource-filter-reset")).toBeVisible();
|
||||
|
||||
// 新建 sits above the table, right aligned.
|
||||
// 新建 sits above the table, right aligned; pagination is a page footer below the table.
|
||||
const create = await page.getByTestId("datasource-create").boundingBox();
|
||||
const table = await page.getByTestId("datasource-table").boundingBox();
|
||||
const pager = await page.getByTestId("datasource-pagination").boundingBox();
|
||||
const viewport = page.viewportSize();
|
||||
expect(create && table && viewport).toBeTruthy();
|
||||
expect(create && table && pager && viewport).toBeTruthy();
|
||||
expect(create!.y + create!.height).toBeLessThanOrEqual(table!.y);
|
||||
expect(create!.x + create!.width).toBeGreaterThan(table!.x + table!.width - 40);
|
||||
// No page footer on the list.
|
||||
expect(pager!.y).toBeGreaterThanOrEqual(table!.y + table!.height - 2);
|
||||
// The list page itself does not scroll; only the table body does.
|
||||
const listScrolls = await page
|
||||
.getByTestId("datasource-list")
|
||||
.evaluate((el) => el.scrollHeight > el.clientHeight + 1);
|
||||
expect(listScrolls).toBe(false);
|
||||
// Detail-style action footer is not used on the list.
|
||||
await expect(page.getByTestId("datasource-footer")).toHaveCount(0);
|
||||
|
||||
// Disabled row: visible, 测试 disabled, no 停用, no "停用后不能测试" copy.
|
||||
|
||||
@@ -516,8 +516,14 @@ test.describe("queries console", () => {
|
||||
|
||||
const create = (await page.getByTestId("query-create").boundingBox())!;
|
||||
const box = (await table.boundingBox())!;
|
||||
const pager = (await page.getByTestId("query-pagination").boundingBox())!;
|
||||
expect(create.y + create.height).toBeLessThanOrEqual(box.y);
|
||||
expect(create.x + create.width).toBeGreaterThan(box.x + box.width - 40);
|
||||
expect(pager.y).toBeGreaterThanOrEqual(box.y + box.height - 2);
|
||||
const listScrolls = await page
|
||||
.getByTestId("query-list")
|
||||
.evaluate((el) => el.scrollHeight > el.clientHeight + 1);
|
||||
expect(listScrolls).toBe(false);
|
||||
await expect(page.getByTestId("query-footer")).toHaveCount(0);
|
||||
|
||||
await expect(page.getByTestId("query-list-toolbar")).toBeVisible();
|
||||
|
||||
Reference in new issue
Block a user