Commit 04a9cb4
authored
Allow skipping of header selection page (#306)
It's possible that a spreadsheet does not have headers, and so this PR makes it possible for a user to skip the header selection step by clicking the Skip button.
<img width="1310" height="723" alt="Upload_monthly_pension_return_–_GOV_UK_Prototype_Kit" src="https://github.com/user-attachments/assets/793c811f-2e69-4f4e-b723-df0e9787cf5b" />
Before this button existed, not selecting a header row achieved the same result, which was that the first row was chosen as headers. This means that when, for instance, using tribble.xlsx we get the following result on the mapping page:
<img width="1043" height="463" alt="Upload_monthly_pension_return_–_GOV_UK_Prototype_Kit" src="https://github.com/user-attachments/assets/0e479383-faff-4878-8e1e-5a6065570048" />
This isn't ideal as the first row (the default when nothing selected) could contain useful data.
To work around this assumption of a non-null header, we instead make the row for the header range out of bounds (e.g. -1) so that we can use it as a sentinel. This allows us to fetch the column names during mapping as the base26 value of the index, which results in a mapping screen of
<img width="1031" height="760" alt="Upload_monthly_pension_return_–_GOV_UK_Prototype_Kit" src="https://github.com/user-attachments/assets/51b7ee0e-1411-4bfc-9cf9-b054852daa0a" />
Unfortunately this approach requires that the backend expose the raw dimensions of the sheet so that the appropriate number of column headings can be generated.1 parent e7d59c6 commit 04a9cb4
File tree
6 files changed
+58
-12
lines changed- lib/importer
- src
- dudk
- templates
- prototypes/basic/app/views
6 files changed
+58
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
206 | 206 | | |
207 | 207 | | |
208 | 208 | | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
209 | 218 | | |
210 | 219 | | |
211 | 220 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | 20 | | |
24 | 21 | | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
29 | 27 | | |
30 | 28 | | |
31 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
32 | 44 | | |
33 | 45 | | |
34 | 46 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
218 | 218 | | |
219 | 219 | | |
220 | 220 | | |
221 | | - | |
222 | | - | |
| 221 | + | |
| 222 | + | |
223 | 223 | | |
224 | 224 | | |
225 | 225 | | |
| |||
244 | 244 | | |
245 | 245 | | |
246 | 246 | | |
247 | | - | |
| 247 | + | |
248 | 248 | | |
249 | 249 | | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
250 | 260 | | |
251 | 261 | | |
252 | 262 | | |
| |||
579 | 589 | | |
580 | 590 | | |
581 | 591 | | |
582 | | - | |
| 592 | + | |
583 | 593 | | |
584 | 594 | | |
585 | 595 | | |
586 | 596 | | |
587 | 597 | | |
588 | | - | |
| 598 | + | |
589 | 599 | | |
590 | 600 | | |
591 | 601 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
| 31 | + | |
30 | 32 | | |
31 | 33 | | |
32 | 34 | | |
| |||
114 | 116 | | |
115 | 117 | | |
116 | 118 | | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
117 | 130 | | |
118 | 131 | | |
119 | 132 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| 60 | + | |
60 | 61 | | |
61 | 62 | | |
62 | 63 | | |
| |||
0 commit comments