Begin the work of adding a new type, with more modular form - #661
Begin the work of adding a new type, with more modular form#661Pete-Y-CS wants to merge 7 commits into
Conversation
…g to Bec's database export directly
There was a problem hiding this comment.
Perhaps this wants a different name, it is awkward that we have 'features' of a geojson file and 'features' of a piece of infrastructure. This means our features will have features.....
|
|
||
| let nameId = uuidv4(); | ||
|
|
||
| function formatForDisplay(original: string): string { |
There was a problem hiding this comment.
This might want to be brought out to be shared with other bits of codebase, but I'm not sure
| return filteredTypeOptions[0]; | ||
| } | ||
|
|
||
| function formatForRadio(original: string): [string, string] { |
There was a problem hiding this comment.
Like here's a very similar but slightly different version of the same function, probably best to split it out elsewhere and settle on which way of it working is nicer
| }) | ||
| : []; | ||
|
|
||
| $: { |
There was a problem hiding this comment.
This is Svelte syntax for 'run this code if the inputs to it change' so it means that when you change the subtype or context change prune any unneeded features and measures from the properties, and add any newly needed features and measures
| } | ||
| } | ||
|
|
||
| if (schema == "v3" && copy.v3) { |
There was a problem hiding this comment.
This where we are checking if there are any properties on a given feature that aren't expected for the schema we are currently using
|
@Sparrow0hawk I've added some explanatory comments throughout the code, hopefully a decent amount of it is self explanatory but if you have any questions we can definitely go through em |
No description provided.