NASA-IMPACT / admg-backend

Apache License 2.0
2 stars 0 forks source link

Ensure short_name is visibile on unpublished CREATE drafts in Canonical workflow #579

Closed alukach closed 10 months ago

alukach commented 10 months ago

What I'm Changing

Currently, our (poorly named) ConditionalValueColumn isn't properly rendering the fallback value for columns of the Campaign table

Before

image

After

image

How I did It

To serve only Canonical drafts, the feature/canonincal-mi-workflow Canonical Redcord List only looks for CREATE drafts when rendering our list views:

https://github.com/NASA-IMPACT/admg-backend/blob/03687abf9117cdf6fb4fe211461f105f8785134e/app/admin_ui/views/v2.py#L99-L104

However, our custom fallback column on our tables only look up the fallback value if the draft was not a CREATE draft:

https://github.com/NASA-IMPACT/admg-backend/blob/03687abf9117cdf6fb4fe211461f105f8785134e/app/admin_ui/tables/tables.py#L50

The fix was to remove this check from the fallback column.

Along the way...

While dissecting how the fallback column works, I realized the column logic was unnecessarily complicated and I trimmed it down to a simpler form (which should be functionally equivalent, aside from the check for CREATE drafts).


Relates to #555