Commit 2390635
committed
fix(import): address PR #254 review round 2 — MacDive XML polish
- MacDiveXmlReader now rejects non-`<dives>` root elements with a
clear FormatException, instead of silently producing an empty
logbook when a user forces the MacDive XML source onto a UDDF or
other file. The parser's try/catch converts the exception into a
user-visible ImportWarning.
- MacDive XML real-sample test replaces the hardcoded
`/Users/ericgriffin/...` path with a `MACDIVE_XML_SAMPLE` compile-
time env var and skip-safe fallback, mirroring the UDDF sample
test. CI and fresh clones now stay green.
- MacDive XML parser links imported gear back onto each dive via
`equipmentRefs` keyed by the composite `(manufacturer|name|serial)`
uddfId, so dives actually reference the equipment entities created
from their `<gear>` children. Added tests covering both the normal
case and the empty-item path (no phantom refs).1 parent b0b9fbd commit 2390635
5 files changed
Lines changed: 107 additions & 13 deletions
File tree
- lib/features/universal_import/data
- parsers
- services
- test/features/universal_import/data
- parsers
- services
Lines changed: 24 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
137 | 150 | | |
138 | 151 | | |
139 | 152 | | |
| |||
290 | 303 | | |
291 | 304 | | |
292 | 305 | | |
293 | | - | |
294 | | - | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
295 | 313 | | |
296 | 314 | | |
297 | 315 | | |
| |||
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
27 | 38 | | |
28 | 39 | | |
29 | 40 | | |
| |||
Lines changed: 15 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
104 | 115 | | |
105 | 116 | | |
106 | 117 | | |
| |||
213 | 224 | | |
214 | 225 | | |
215 | 226 | | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
216 | 231 | | |
217 | 232 | | |
218 | 233 | | |
| |||
Lines changed: 44 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
1 | 14 | | |
2 | 15 | | |
3 | 16 | | |
| |||
11 | 24 | | |
12 | 25 | | |
13 | 26 | | |
14 | | - | |
15 | | - | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
16 | 36 | | |
17 | 37 | | |
18 | 38 | | |
19 | 39 | | |
| 40 | + | |
20 | 41 | | |
21 | 42 | | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
27 | 47 | | |
| 48 | + | |
28 | 49 | | |
29 | 50 | | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
30 | 60 | | |
| 61 | + | |
31 | 62 | | |
32 | 63 | | |
33 | 64 | | |
| |||
40 | 71 | | |
41 | 72 | | |
42 | 73 | | |
| 74 | + | |
43 | 75 | | |
44 | 76 | | |
45 | 77 | | |
| |||
50 | 82 | | |
51 | 83 | | |
52 | 84 | | |
| 85 | + | |
53 | 86 | | |
54 | 87 | | |
55 | 88 | | |
| |||
65 | 98 | | |
66 | 99 | | |
67 | 100 | | |
| 101 | + | |
68 | 102 | | |
69 | 103 | | |
70 | 104 | | |
| |||
77 | 111 | | |
78 | 112 | | |
79 | 113 | | |
| 114 | + | |
80 | 115 | | |
81 | 116 | | |
82 | 117 | | |
| |||
86 | 121 | | |
87 | 122 | | |
88 | 123 | | |
| 124 | + | |
89 | 125 | | |
90 | 126 | | |
91 | 127 | | |
| |||
99 | 135 | | |
100 | 136 | | |
101 | 137 | | |
| 138 | + | |
102 | 139 | | |
103 | 140 | | |
104 | 141 | | |
| |||
Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
175 | 188 | | |
176 | 189 | | |
177 | 190 | | |
| |||
0 commit comments