-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for secondary construction materials #790
base: master
Are you sure you want to change the base?
Conversation
Note that primary materials are not appearing to be validated and just rely on https://github.com/colouring-cities/colouring-london/blob/master/app/src/frontend/building/data-containers/construction.tsx#L10 being in synch with database (I think?). See also https://github.com/colouring-cities/colouring-london/blob/master/app/src/frontend/building/data-containers/community.tsx#L127 repeating I am not entirely sure is this database-based verification is needed. Maybe it should be limited to dropdown selection and block freeform entries? Maybe it is superior to relying on this manually maintained copy of valid value list? |
I have tried to take a look at this but it creates an error in the app for me. I did the following:
ed@ed-VirtualBox:~/colouring-london/app$ npm start
> [email protected] start
> razzle start
WAIT Compiling...
✔ Client
✔ Server
Compiled successfully in 13.91s
Issues checking in progress...
ERROR in src/frontend/route.tsx:36:25
TS2339: Property 'from' does not exist on type '{}'.
34 | render={props => {
35 | if(isAuthenticated) {
> 36 | const { from } = props.location.state ?? { from: '/my-account.html'};
| ^^^^
37 | return <Redirect to={{pathname: from }} />;
38 | } else {
39 | if(Component) {
sswp> Handling Hot Module Reloading
✅ Server-side HMR Enabled!
🚀 started And the result at http://localhost:8080/ is that the homepage is viewable but unresponsive (I can't click anything) |
@matkoniecz I realise that the error I posted above might be some basic typescript error that I don't understand without looking into it more |
colouring-cities@4e40b31 should do it |
} | ||
|
||
if(hasDuplicates(groupMaterials)) { | ||
throw new ArgumentError('Cannot supply duplicate materials', 'secondaryMaterialsUpdate'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, I have just one comment - perhaps similar to this error thrown here, can there be one for when the Main Secondary Construction Material/s selected is the same as the Core Material (presumably we don't want that)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just suggested a fix for typo which crept in, otherwise good to go.
I'd be open to a separate discussion of data typing and storage. I think this approach works okay, but we are incrementally adding complex data types to our one big table. Could consider moving towards more normalised tables, (or another direction, e.g. towards JSON blobs) - but would suggest doing that with a look across the data model as a whole.
part of #727