MonthsController

MonthsController

Stimulus controller that handles the months buttons data and interaction.

Constructor

new MonthsController()

Source:

Extends

  • Controller

Methods

connect()

Source:

Subscribe to the store.

disconnect()

Source:

Unsubscribe from the store

fetchDataVizData()

Source:

Fetch all of the data for the selected month. If the data for the month is already present then it does not fetch again.

monthClicked()

Source:

Ignores month if already clicked. Set the month clicked as selected in the store and gives the class selected to the clicked month.

reconnect()

Source:

Handles a repeated Turbo visit to the dashboard page.

storeUpdated()

Source:

Triggered by the store whenever any store data changes. Fetches the relevant data when a month is selected

yearSelectedValueChanged()

Source:

Triggered when a year is set. Uses a document fragment to fully create the months buttons before removing the load button and adding all the new months buttons. The last button is set as selected