YearsController

YearsController

Stimulus controller that fetches the data to populate the years and months buttons.

Constructor

new YearsController()

Source:

Extends

  • Controller

Methods

connect()

Source:

Subscribe to the store. Setup dataVizData and then fetch years and months data

disconnect()

Source:

Unsubscribe from the store

reconnect()

Source:

Handles a repeated Turbo visit to the dashboard page.

statusValueChanged()

Source:

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

storeUpdated()

Source:

Triggered by the store whenever any store data changes. Sets us the store when yearsAndMonths data has been set following the fetch statement

yearClicked()

Source:

Ignores year if already clicked. Set the months data for the selected year. Set the last month as selected in the store and gives the class selected to the clicked year.

yearsAndMonths()

Source:

Fetch the data for years and months.