This pull request addresses issue #505, "Mock data UI,". Specifically, the following files were added
Added the data fetching modules under /nowcasting-app/components/helpers/
fetchData: A module that includes two functions: fetchData and fetchDataFromAPI. fetchData accepts a file path and a boolean flag (useMockData). It fetches data either from a local mock file (loadMockData) or from an external API (fetchDataFromAPI) based on the value of the flag. Users need to update the file path to the mock data and set the useMockData flag accordingly.
fetchDataFromAPI : This function sends a POST request to obtain an access token for authentication, then uses this token to fetch data from the API. Users need to update the login requirements to generate a token.
loadMockData :This function parses JSON data from a file and returns it. Users need to provide the file path to the mock data.
Added mock data files under data/mockData
Added mock data for Delta and PV forecast views. Three random sites were chosen for each.
Pull Request
This pull request addresses issue #505, "Mock data UI,". Specifically, the following files were added
Added the data fetching modules under /nowcasting-app/components/helpers/
Added mock data files under data/mockData
Added mock data for Delta and PV forecast views. Three random sites were chosen for each.
Checklist: