Added required fields as discussed: headline, excerpt, topic
Added current list of topics to select dropdown
Added tests both for the form component and the page
Closes #98.
Implementation Decisions
Note that this is still rough around the edges but since it was getting pretty big I thought I shouldn't be adding any more to it for the time being.
I have wired this up both to the Add Story form - so you can immediately edit the prospect data parsed by the API, as well as the "Edit & Approve" button on the Prospects tab. If you access the page directly, the prospect won't be loaded from the API - I think this should be done later on, once the API is reworked otherwise multiple calls to Apollo directly from the page get very messy very quickly.
For the same reason (waiting for API abstraction layer), only the "Approve" button sends a call to the API at the moment - the other buttons just show a success message regardless. Additionally, a successful update sends the user back to the tab they came from The loading spinner remains for now - to be updated to a consistent UI further down the track.
Added form validation to Edit & Approve form
Added required fields as discussed: headline, excerpt, topic
Added current list of topics to select dropdown
Added tests both for the form component and the page
Closes #98.
Implementation Decisions
Note that this is still rough around the edges but since it was getting pretty big I thought I shouldn't be adding any more to it for the time being.
I have wired this up both to the Add Story form - so you can immediately edit the prospect data parsed by the API, as well as the "Edit & Approve" button on the Prospects tab. If you access the page directly, the prospect won't be loaded from the API - I think this should be done later on, once the API is reworked otherwise multiple calls to Apollo directly from the page get very messy very quickly.
For the same reason (waiting for API abstraction layer), only the "Approve" button sends a call to the API at the moment - the other buttons just show a success message regardless. Additionally, a successful update sends the user back to the tab they came from The loading spinner remains for now - to be updated to a consistent UI further down the track.