As a developer, I want methodology data to be inside its own object instead of flat with the emission data, so that querying is easier.
This means
the json_schema_builder service needs to populate that data properly by creating an rjsf object for methodology inside the emission object
updating the uiSchemas to make sure the change in form structure does not have side effects in how the form is presented visually on the frontend
The result we want can likely be achieved by doing the following:
When instantiating the methodology property in the handle_gas_types() function, the methodology enum field should be encased in an rjsf object.
This has added a layer of {methodology: properties {...}} to our schema structure, so in handle_methodologies() we will have to traverse to that level in json tree to add the methodology enum & dependencies.
Adding an object to the rjsf schema will automatically add a title to the object, which we don't want (the methodology fields should still look flat to the emission fields on the form). This means we'll have to update all the rjsf ui schemas to tell them to hide the label by adding the methodology object to the ui schemas & adding the ui:option "label": false.
Note:
I see that the json schema for carbonates_use has a methodology object defined in the json schema. This has been fine because it was being overwritten by the form_builder_service, but now that we're changing where those fields live, it might cause issues. The methodology property should be removed from this json schema & allow the form_builder_service to create it dynamically.
Acceptance Criteria:
Given a schema returned by the form_builder_service
When I traverse the json tree
Then the methodology data fields are contained in a methodology object rather than flat with the emission data
Development Checklist:
[ ] Methodology fields are contained in a methodology object
[ ] The form builder service should create the methodology object as a property at the same level as gas_type
[ ] The methodology property in the carbonate_use json schema is removed (see Note above)
[ ] All ui schemas have been updated so the forms do not visibly change when viewing them on the frontend
[ ] Meets the DOD
Definition of Ready (Note: If any of these points are not applicable, mark N/A)
[ ] User story is included
[ ] User role and type are identified
[ ] Acceptance criteria are included
[ ] Wireframes are included (if required)
[ ] Design / Solution is accepted by Product Owner
[ ] Dependencies are identified (technical, business, regulatory/policy)
[ ] Story has been estimated (under 13 pts)
Definition of Done (Note: If any of these points are not applicable, mark N/A)
[ ] Acceptance criteria are tested by the CI pipeline
[ ] UI meets accessibility requirements
[ ] Configuration changes are documented, documentation and designs are updated
[ ] Passes code peer-review
[ ] Passes QA of Acceptance Criteria with verification in Dev and Test
[ ] Ticket is ready to be merged to main branch
[ ] Can be demoed in Sprint Review
[ ] Bugs or future work cards are identified and created
Description:
As a developer, I want methodology data to be inside its own object instead of flat with the emission data, so that querying is easier. This means
The result we want can likely be achieved by doing the following:
When instantiating the methodology property in the handle_gas_types() function, the methodology enum field should be encased in an rjsf object.
This has added a layer of {methodology: properties {...}} to our schema structure, so in handle_methodologies() we will have to traverse to that level in json tree to add the methodology enum & dependencies.
Adding an object to the rjsf schema will automatically add a title to the object, which we don't want (the methodology fields should still look flat to the emission fields on the form). This means we'll have to update all the rjsf ui schemas to tell them to hide the label by adding the methodology object to the ui schemas & adding the
ui:option
"label": false.RJSF Docs: Objects: https://rjsf-team.github.io/react-jsonschema-form/docs/json-schema/objects/ Dependencies: https://rjsf-team.github.io/react-jsonschema-form/docs/json-schema/dependencies/
Note: I see that the json schema for carbonates_use has a methodology object defined in the json schema. This has been fine because it was being overwritten by the form_builder_service, but now that we're changing where those fields live, it might cause issues. The methodology property should be removed from this json schema & allow the form_builder_service to create it dynamically.
Acceptance Criteria:
Given a schema returned by the form_builder_service When I traverse the json tree Then the methodology data fields are contained in a methodology object rather than flat with the emission data
Development Checklist:
Definition of Ready (Note: If any of these points are not applicable, mark N/A)
Definition of Done (Note: If any of these points are not applicable, mark N/A)
Notes:
-