Open Pete-Y-CS opened 12 months ago
There are some notes in both #387 and https://github.com/acteng/atip/pull/379#issuecomment-1784928203 about how this should all work. Since it's a complex change, we could find a way to break it down into a few PRs with smaller steps. I haven't thought about it carefully, but how about:
1) First change the GJ format to make room for multiple schemes in a single file. We already have scheme_reference
in InterventionProps
and AllSchemeGJ
used in the browse page. The Scheme
interface has 4 foreign member properties, but I think scheme_name
and the optional pipeline
should both get moved into a new place. We can first define what the new thing looks like, make the backfill function convert the old single-scheme file into a multi-scheme file with just one scheme filled out. No UI changes yet, and some tests (that may already exist) to make sure the old format loads fine.
2) Then the basic UI elements, maybe following the mockup with layer style in one of the PRs linked. Add a new scheme, delete a scheme, move interventions between schemes.
3) Then the nicer UI bits -- color things in a scheme, show/hide the whole thing as a layer.
The GJ file should be usable in browse mode, and nothing should be tied to the pipeline schema at all. You should be able to load multiple ATF4 or v1 schemes at the same time. If you filtered the all_schemes.geojson file we're using in browse mode right now for one authority, that should work in the sketch page
Copying the draft from the call:
// TODO this name is now wrong
export interface Scheme {
type: "FeatureCollection";
features: FeatureUnion[];
// Foreign members
authority?: string;
origin?: string;
// scheme_reference in each FeatureUnion is keyed to this
schemes: { [name: string]: SchemeData };
}
interface SchemeData {
scheme_name: string;
pipeline?: PipelineScheme;
browse?: BrowseSchemeData;
}
interface BrowseSchemeData {
num_features: number;
authority_or_region: string;
capital_scheme_id: string;
funding_programme: string;
}