aleios-cloud / aleios-cloud/sls-dev-tools

Good First Issue: Store an event history for all previously submitted eventBridge events

Aperta
#239 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
enhancement good first issue
Lingua principale
JavaScript
Stelle
871
Fork
45
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

**Why:** When opening the Event Injection modal for a particular eventBus, the tool populates each field (source, detail type, and detail) with the _last values_ used for that eventBus. Allowing _all_ events to be saved, similar to the command history in the terminal, will allow users to quickly test multiple events without having to type the same parameters repeatedly.

**Expected Behaviour:**
- when using the event injection modal, users can use keypresses to cycle through all events previously injected on that bus

**Scope Limit:**
- this should at least work for the current session of the tool
- In a future issue/pr, this could be extended to include a persistent event history, by use of a event history file, to allow users to quit the tool and still access previously injected events on reopening the tool

Changes needed:
- When storing events, change the previous event dictionary to map to a list of events instead of a single instance [here](https://github.com/Theodo-UK/sls-dev-tools/blob/master/src/modals/eventInjectionModal.js#L67)
- Modify the modal to access the previously submitted event from an array of objects [here](https://github.com/Theodo-UK/sls-dev-tools/blob/master/src/modals/eventInjectionModal.js#L19-L33)
- Create a new function to use the list of events to set the text value of all the textboxes using ```textboxes[i].setContent(Field)```. It may help to use [this](https://github.com/Theodo-UK/sls-dev-tools/blob/master/src/modals/eventInjectionModal.js#L85) for-loop for some inspiration
- Trigger this function using a ```eventInjectLayout.key()``` event

![image](https://user-images.githubusercontent.com/11080984/79673814-e4ce5a00-81d4-11ea-814b-1a66a2cabb17.png)

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.