Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In 24Q4 some columns changed names and some additional columns have been added. Since the model table consistently changes from release to release, I changed strategy in this PR. The front end will always have a dependency on the schema of model.csv. However, that doesn't mean all of the
portal-backend
code needs to as well. Instead of mapping column names from model.csv -> snake case -> portal db -> json response -> react component, I've cut out several layers.Now, any fields in that the portal depends on, should still go into the database, but for all columns, with column names as they appear in the Model.csv go into a single field as a json encoded dict, which the frontend can receive. There is also a interface automatically defined to ensure the frontend is kept in sync with the columns in the actual model.csv file.
This means that for columns that the backend doesn't care about the flow is:
model.csv -> db -> react component
Which eliminates a lot of boilerplate.
(Also this PR includes some small fixes to react warnings I saw when testing)