Repository navigation
Commit cc38a91
fix(console): View all → New seeds the relationship lookup's dependsOn fields (#37421)
Fixes #37290
Clause-②: no
Metadata-protocol: none
## 维护者速读
-
用户能看到什么变化:从记录页相关列表点「查看全部」进入列表,再点「新建」时,关联字段所依赖的上级值(如客户)会和父记录一起预填,不再卡在「请先选择客户」。
- 为什么做:补齐上一张相关页签预填改动漏掉的「查看全部」入口,两条入口用同一套预填规则。
- 出错会怎样:只影响新建表单打开时的初始值;关联字段没有声明依赖时行为与今天一致,读不到父记录时退回只带父记录;可直接撤回。
- 要你做什么:无。
## What changes
`ObjectDataPage`'s New under a record trail (a related list's "View
all") wrote the parent `formLink` pair alone. It now applies
`relatedCreateSeedOf` (from `@object-ui/plugin-detail/core`, already
exported and already imported by `RelatedRecordActionsBridge`): parent
pair first, then one `formLink` pair per `dependsOn` field, the same URL
shape the related tab's New writes.
- A2 measured: the page holds only the trail's parent id (`source.i`),
not the parent record. The related-tab New uses its mounted parent
record; here the page reads it once via `dataSource.findOne(source.o,
source.i)`, and only when the relationship lookup declares a non-empty
`dependsOn` (looked up with `parentRelationshipFieldDef`, so array-form
field lists count too). No `dependsOn` means no read. A failed or empty
read opens with the parent pair alone.
- A1 holds: no export change; nothing copied.
Files to read first (by risk):
`ui/packages/app-shell/src/views/ObjectDataPage.tsx` (the New button's
`onClick`, the async `findOne` branch).
## Tests
`ui/packages/app-shell/src/views/ObjectDataPage.viewAllNewSeed-37290.test.tsx`:
two cases.
- `contract.opportunity` `dependsOn: ['account']`, trail parent
`opportunity O-1` (account `A-1`): `formLink` = `['opportunity:O-1',
'account:A-1']`, `findOne` called once with `('opportunity', 'O-1')`.
- CONTROL: `task.opportunity` with no `dependsOn`: `formLink` =
`['opportunity:O-1']`, no read of the parent.
<details><summary>Pin green with fix, red without (head
ad4ceb5)</summary>
- With the fix: `Test Files 1 passed (1) · Tests 2 passed (2)`, lock
`VERDICT command-exit 0`.
- `ObjectDataPage.tsx` checked out from base `ff6f9768d2`
(`relatedCreateSeedOf` count 0), restored from `HEAD` (hash matches the
HEAD blob, `git diff HEAD` empty): `Tests 1 failed | 1 passed (2)`,
`AssertionError: expected [ 'opportunity:O-1' ] to deeply equal [
'opportunity:O-1', 'account:A-1' ]`, lock `VERDICT command-exit 1`. The
control stays green both ways.
</details>
## Acceptance notes
- "That path seeds through the same `relatedCreateSeedOf`": yes, the one
exported function, no copy.
- "One pin covers it, red without the fix": the file above, red reading
quoted.
## Verification
<details><summary>Local gates</summary>
- `dispatch-gates --ran`: 38 derived, 36 run (all exit 0), 2
NOT-MEASURED (`check:type-check-debt` and `pnpm --dir ui exec vitest run
scripts/`: both need the shared verify lock, held by a sibling run 30+
minutes). CI runs both.
- `pnpm --filter @object-ui/app-shell run type-check`: NOT MEASURED
locally for the same reason; CI `Type Check UI` covers it.
- `overlap-check --branch=HEAD`: `VERDICT clean exit 0`. origin/main
merged once before opening (no conflict).
</details>
Two-minute check: `cd ui && pnpm exec vitest run
packages/app-shell/src/views/ObjectDataPage.viewAllNewSeed-37290.test.tsx`;
expect 2 passed.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01Utp6Ca6EBDpTBZk8v46Jjv)_
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01Utp6Ca6EBDpTBZk8v46Jjv
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: objectstack-fleet[bot] <332303061+objectstack-fleet[bot]@users.noreply.github.com>1 parent 82a8510 commit cc38a91
3 files changed
Lines changed: 295 additions & 4 deletions
File tree
- .changeset
- ui/packages/app-shell/src/views
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| |||
55 | 56 | | |
56 | 57 | | |
57 | 58 | | |
58 | | - | |
| 59 | + | |
59 | 60 | | |
60 | 61 | | |
61 | 62 | | |
| |||
323 | 324 | | |
324 | 325 | | |
325 | 326 | | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
326 | 334 | | |
327 | 335 | | |
328 | 336 | | |
| |||
907 | 915 | | |
908 | 916 | | |
909 | 917 | | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
910 | 924 | | |
911 | 925 | | |
912 | 926 | | |
| |||
961 | 975 | | |
962 | 976 | | |
963 | 977 | | |
964 | | - | |
965 | | - | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
966 | 1014 | | |
967 | 1015 | | |
968 | 1016 | | |
969 | 1017 | | |
970 | | - | |
| 1018 | + | |
| 1019 | + | |
971 | 1020 | | |
972 | 1021 | | |
973 | 1022 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
0 commit comments