clcollins / srepd

PagerDuty & Jira terminal user interface focused on common SRE tasks
MIT License
3 stars 6 forks source link

Convert "waitForSelectedIncidentThenX" tea.Msgs to one generic msg #2

Open clcollins opened 11 months ago

clcollins commented 11 months ago

Multiple flows require waiting for the selected incident to be retrieved from PageDuty before they can continue. Currently they're implemented as separate "waitForSelectedIncidentThenX" tea.Msgs.

It should be possible to implement a single "waitForSelectedIncidentThenDo" msg with an interface in the msg to allow specifying the follow-up action and the necessary data to use to do so. This would simplify the code base and remove multiple case statements for the unique tea.Msgs.

clcollins commented 8 months ago

Partially fixed by #25 - refactors the "waitForSelectedIncidentThenDo" command to be able to handle tea.Cmds. Just need to refactor remaining waitForSelectedIncidentThenX tea.Msgs to the new format and this can be closed.