feat: enhance table layout and interaction across various components
Deploy production / deploy (push) Successful in 53s
Deploy production / deploy (push) Successful in 53s
- Introduced a new `WorkspaceTable` component for consistent table styling and behavior. - Updated `BacktestPage`, `DatasetPage`, and `DataPreparationPage` to utilize the new `WorkspaceTable`. - Implemented compact row heights and ellipsis for long text in table cells. - Added validation for online field queries to ensure at least one filter is provided. - Enhanced error handling and user feedback for invalid input scenarios. - Improved pagination controls with dynamic page size options. - Documented table display specifications in `ui-tables.md`. - Added tests to verify table layout, interaction, and error handling.
This commit is contained in:
@@ -411,3 +411,30 @@ async def test_terminal_detail_failure_releases_slot_but_keeps_platform_success(
|
||||
await tick(lane)
|
||||
assert len(platform.posts) == 2
|
||||
await lane.interrupt()
|
||||
|
||||
|
||||
async def test_run_list_projects_source_metadata_without_accepting_unknown_input(app, logged_in):
|
||||
"""Persisted source metadata must not turn the entire run list into a 500."""
|
||||
await setup(app)
|
||||
created = await start(logged_in, await preview(logged_in))
|
||||
async with app.state.sessions.begin() as db:
|
||||
row = await db.get(BacktestRun, created["backtest_run_id"])
|
||||
row.source = {**row.source, "template_input_id": None, "extra_metadata": "not-an-input"}
|
||||
response = await logged_in.get(f"{PREFIX}/runs?offset=0&source=")
|
||||
assert response.status_code == 200
|
||||
source = response.json()["items"][0]["source"]
|
||||
assert source["kind"] == "test"
|
||||
assert "template_input_id" not in source and "extra_metadata" not in source
|
||||
assert source["input_snapshot_ids"] == []
|
||||
detail = await logged_in.get(f"{PREFIX}/runs/{created['backtest_run_id']}")
|
||||
assert detail.status_code == 200
|
||||
assert detail.json()["source"] == source
|
||||
rejected = await logged_in.post(
|
||||
f"{PREFIX}/drafts",
|
||||
json={
|
||||
"name": "invalid",
|
||||
"source": {"kind": "manual", "extra_metadata": "invalid"},
|
||||
"candidates": [candidate()],
|
||||
},
|
||||
)
|
||||
assert rejected.status_code == 422
|
||||
|
||||
@@ -88,12 +88,13 @@ async def test_scope_dimensions_rejected_without_creating_collection(catalog, ke
|
||||
|
||||
async def test_online_fields_without_sync_and_local_search_before_pagination(catalog):
|
||||
client, _, _ = catalog
|
||||
response = await client.get("/api/v1/catalog/worldquant/fields", params={**SCOPE, "limit": 100})
|
||||
params = {**SCOPE, "dataset_id": "TEST_FIN", "limit": 100}
|
||||
response = await client.get("/api/v1/catalog/worldquant/fields", params=params)
|
||||
assert response.status_code == 200, response.text
|
||||
first = response.json()
|
||||
assert len(first["items"]) == 100 and first["has_more"]
|
||||
second = (
|
||||
await client.get("/api/v1/catalog/worldquant/fields", params={**SCOPE, "limit": 100, "offset": 100})
|
||||
await client.get("/api/v1/catalog/worldquant/fields", params={**params, "offset": 100})
|
||||
).json()
|
||||
assert len(second["items"]) > 0
|
||||
assert (await client.get("/api/v1/catalog/fields", params=SCOPE)).json()["total"] == 0
|
||||
@@ -298,7 +299,8 @@ async def test_full_sync_restart_keeps_page_and_auth_pauses_all_datasets(catalog
|
||||
async def test_online_instrument_type_is_verified(catalog):
|
||||
client, _, state = catalog
|
||||
state["fields"][0]["instrumentType"] = "FUTURE"
|
||||
assert (await client.get("/api/v1/catalog/worldquant/fields", params=SCOPE)).status_code == 502
|
||||
response = await client.get("/api/v1/catalog/worldquant/fields", params={**SCOPE, "q": "TEST"})
|
||||
assert response.status_code == 502
|
||||
|
||||
|
||||
async def test_mcp_collection_reads_and_versioned_submit_contract(catalog):
|
||||
@@ -350,3 +352,12 @@ async def test_retry_waiting_full_job_requeues_its_checkpoint(catalog):
|
||||
async with runner.sessions.begin() as db:
|
||||
result = await Business(db).retry_job(job.id)
|
||||
assert result["status"] == "queued" and result["checkpoint"]["offset"] == 100
|
||||
|
||||
|
||||
async def test_online_fields_reject_empty_criteria_before_requesting_platform(catalog):
|
||||
client, _, state = catalog
|
||||
before = list(state["calls"])
|
||||
for params in (SCOPE, {**SCOPE, "q": " ", "dataset_id": ""}):
|
||||
response = await client.get("/api/v1/catalog/worldquant/fields", params=params)
|
||||
assert response.status_code == 422
|
||||
assert state["calls"] == before
|
||||
|
||||
Reference in New Issue
Block a user