feat(podcasts): the rules page retires — the collection builder IS the filter builder (item 3.4)
The smart-collection editor at /collections/:id/rules now hosts the SAME builder island as All-Books (FilterBuilderRows — the rows markup extracted into one shared templ both mounts render; the shared filterBuilderExtra component). One vocabulary, one engine, one row UI; the collection differences are exactly three: the payload is the collection's scope (episode trees get the episode fields — books trees hide them), Apply writes the tree to the collection (PUT filter_tree through the validated write path), and a legacy rules array preloads as its CONVERTED tree (RulesToFilterTree rendered server-side) so the upgrade lands at the first Apply — read-compat never mutates data silently. Retired with the page: the per-rule CRUD endpoints and test-rules (their handler bodies, routes, api-docs rows, and the dead collections.ts island functions — the file's LIVE halves, the collection modal/navigate/ grid-refresh, stay; the dead rules half went). match-mode endpoint and preview survive (legacy channel + the dashboard custom-section-builder, flagged for its own migration). Contract-pin changelog documents the deletions per the asymmetry rule. The builder component gains collection mounts: scopeKey (the row universe for counts/apply), data-tree prefill, treeJSON (the apply wire with scope riding the top level), and an apply hook (the page owns the write; All-Books never sets one). ensureReadyRule defaults to the scope's first field instead of hardcoding author. Tests migrated onto trees: TestSmartCollections' live-membership / reject-mutations / include-auto / system-collection subtests now drive TREE collections; the deleted-endpoint subtests die with them.
This commit is contained in:
1 parent
eb68672390
commit
4f71eda6be
16 files changed
+518
-1422
No files matched your search
@@ -835,22 +835,6 @@ var Schemas = map[string]Schema{
|
||||
"DELETE /api/devices/:id/file-aliases/:aliasId": {
|
||||
Response: json.RawMessage(`{"message": ""}`),
|
||||
},
|
||||
"POST /api/collections/:id/rules": {
|
||||
// First rule converts a static collection to smart.
|
||||
Request: handlers.AddRuleRequest{},
|
||||
Response: json.RawMessage(`{
|
||||
"collection_id": "", "rule": {}, "is_smart": false
|
||||
}`),
|
||||
},
|
||||
"DELETE /api/collections/:id/rules/:ruleId": {
|
||||
Response: json.RawMessage(`{
|
||||
"collection_id": "", "is_smart": false
|
||||
}`),
|
||||
},
|
||||
"POST /api/collections/test-rules": {
|
||||
Request: handlers.TestRulesRequest{},
|
||||
Response: json.RawMessage(`{"matches": [], "total": 0}`),
|
||||
},
|
||||
"POST /api/collections/:id/books": {
|
||||
// Bulk add: {operations: [{collection_id, book_ids:[...]}]}.
|
||||
Request: json.RawMessage(`{
|
||||
|
||||
Reference in new issue
Block a user