Closed neongreen closed 8 years ago
I believe the file View.hs
resides in /lib
and not /src
.
Yeah, it was moved together with the rest of /src
.
So are we supposed to check for all the Edit'Set*
cases to see if the old value is empty? What about when new values are empty?
So are we supposed to check for all the Edit'Set* cases to see if the old value is empty?
Yeah. I wish I had a less boilerplatey definition of Edit
(with some kind of first-class record fields), but currently it is what it is, and I don't know how to make it better without losing type safety. If you have any ideas, please tell!
What about when new values are empty?
They can't be, because code that generates Edit
s won't create an edit when the old value is equal to the new value. Furthermore, even if an empty value slips through, nothing bad will happen (the admin interface isn't even visible for ordinary users), so you can ignore this possibility.
Here's the function which adds an edit: https://github.com/aelve/guide/blob/master/lib/Guide.hs#L180-L190. Here's the function which checks that an edit actually changes something: https://github.com/aelve/guide/blob/master/lib/Types.hs#L672-L711.
Great! I think I'll take a look today evening. Does anyone mind?
I definitely don't!
Fixed by @babhishek21 in #131 and deployed.
Currently we have this, it's silly:
How to fix it:
renderEdit
check for emptiness in branches likeEdit'SetCategoryNotes
, etc. and render them differently if they are empty