|
| 1 | +--- |
| 2 | +'@object-ui/plugin-grid': patch |
| 3 | +'@object-ui/plugin-list': patch |
| 4 | +--- |
| 5 | + |
| 6 | +A directly authored `object-grid` or `list-view` node resolves the spec's context tokens in its own filter (objectui#10607). |
| 7 | + |
| 8 | +`filter: [['owner', '=', '{current_user_id}']]` on an `object-grid` or `list-view` node authored |
| 9 | +straight into a page, not reached through `object-view`, went out on `$filter` as the literal |
| 10 | +token: neither package called `@object-ui/core`'s `resolveFilterPlaceholders`. Each now resolves |
| 11 | +the node's own filter once through that shared resolver, with the session scope the host provides |
| 12 | +through `useFilterScope` (the console shell mounts `FilterScopeProvider` from the signed-in user |
| 13 | +and the active organization). On `object-grid` that is `filter` and its deprecated alias |
| 14 | +`defaultFilters`: the resolved `filter` feeds the grid's query and its server-side export, and the |
| 15 | +resolved alias feeds the query when `filter` is absent. On |
| 16 | +`list-view` it is `filter`, and the resolved value feeds the list's query, the child view it |
| 17 | +renders, the self-querying views (gantt, tree, chart), the export and the empty-state copy. |
| 18 | +`object-view` has done this since objectui#10506; these two nodes, authored directly, had not. |
| 19 | + |
| 20 | +The relative-date macros (`{today}`, `{current_quarter_start}`, …) resolve in the same call, in |
| 21 | +the browser's local time, as on the other surfaces that call the resolver. Where they used to |
| 22 | +reach a backend that resolves them itself, as the ObjectStack server does in the tenant's |
| 23 | +configured `localization.timezone` (UTC by default), a browser whose local day differs from the |
| 24 | +server's day can now get a different day. |
| 25 | + |
| 26 | +A token the scope cannot resolve is left as written and the resolver warns once, which is the |
| 27 | +resolver's own rule, so the filter is never widened. |
| 28 | + |
| 29 | +The resolved value is held against its inputs: the authored filter, compared by structure, and the |
| 30 | +scope's three members (`currentUserId`, `currentOrgId`, `onUnresolved`), each compared on its own. |
| 31 | +A re-render that changes none of them does not refetch, including one that rebuilds an equal |
| 32 | +filter inline; a new signed-in user refetches with the new id. Date macros are therefore resolved |
| 33 | +once and held until the scope or the authored filter changes, and a refetch for another reason |
| 34 | +reuses the held value. `object-view` already hands these nodes a filter it has resolved |
| 35 | +(objectui#10506); resolving that value again changes nothing, because a resolved id or date no |
| 36 | +longer matches the placeholder pattern. |
| 37 | + |
| 38 | +On `object-grid`, the load effect now also refetches when the resolved `defaultFilters` changes (a |
| 39 | +new signed-in user, or an in-place edit of the alias). It read that alias without keying on it |
| 40 | +before. |
0 commit comments