Skip to content

Commit

Permalink
Decommission MoreCast 1 (#3155)
Browse files Browse the repository at this point in the history
- Removes all unused code from MoreCast (except maps)
- Reroutes MoreCast to MoreCast 2.0
- Moves code that's still needed for other applications in the repo
  • Loading branch information
brettedw authored Oct 11, 2023
1 parent 1013ff7 commit 3f96d74
Show file tree
Hide file tree
Showing 49 changed files with 26 additions and 7,381 deletions.
2 changes: 1 addition & 1 deletion codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ coverage:
paths:
- web/src
# web isn't quite amazing yet - would be nice to push it up to 80%
target: 80%
target: 75%
454 changes: 0 additions & 454 deletions web/cypress/e2e/morecast-page.cy.ts

This file was deleted.

2 changes: 0 additions & 2 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,9 @@
"match-sorter": "^6.3.1",
"ol": "^8.0.0",
"ol-pmtiles": "^0.3.0",
"plotly.js": "^2.5.1",
"prettier": "^2.4.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-plotly.js": "^2.5.1",
"react-redux": "^8.0.0",
"react-router-dom": "^6.0.0",
"recharts": "^2.1.8",
Expand Down
17 changes: 3 additions & 14 deletions web/src/app/Routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,15 @@ const HfiCalculatorPage = lazy(() => import('features/hfiCalculator/pages/HfiCal
const CHainesPage = lazy(() => import('features/cHaines/pages/CHainesPage'))
import {
PERCENTILE_CALC_ROUTE,
FIRE_WEATHER_ROUTE,
MORECAST_ROUTE,
HFI_CALC_ROUTE,
MORECAST_ROUTE,
C_HAINES_ROUTE,
FIRE_BEHAVIOR_CALC_ROUTE,
FIRE_BEHAVIOUR_ADVISORY_ROUTE,
LANDING_PAGE_ROUTE,
MORE_CAST_2_ROUTE
} from 'utils/constants'
const MoreCastPage = lazy(() => import('features/fireWeather/pages/MoreCastPage'))
import { NoMatchPage } from 'features/fireWeather/pages/NoMatchPage'
import { NoMatchPage } from 'features/NoMatchPage'
const FireBehaviourCalculator = lazy(() => import('features/fbaCalculator/pages/FireBehaviourCalculatorPage'))
const FireBehaviourAdvisoryPage = lazy(() => import('features/fba/pages/FireBehaviourAdvisoryPage'))
const LandingPage = lazy(() => import('features/landingPage/pages/LandingPage'))
Expand All @@ -40,15 +38,6 @@ const WPSRoutes: React.FunctionComponent = () => {
path={PERCENTILE_CALC_ROUTE}
element={<PercentileCalculatorPageWithDisclaimer showDisclaimer={shouldShowDisclaimer} />}
/>
<Route path={FIRE_WEATHER_ROUTE} element={<Navigate to={MORECAST_ROUTE} />} />
<Route
path={MORECAST_ROUTE}
element={
<AuthWrapper>
<MoreCastPage />
</AuthWrapper>
}
/>
<Route
path={HFI_CALC_ROUTE}
element={
Expand All @@ -58,7 +47,6 @@ const WPSRoutes: React.FunctionComponent = () => {
}
/>
<Route path={C_HAINES_ROUTE} element={<CHainesPage />} />

<Route
path={FIRE_BEHAVIOR_CALC_ROUTE}
element={
Expand All @@ -75,6 +63,7 @@ const WPSRoutes: React.FunctionComponent = () => {
</AuthWrapper>
}
/>
<Route path={MORECAST_ROUTE} element={<Navigate to={MORE_CAST_2_ROUTE} />} />
<Route
path={MORE_CAST_2_ROUTE}
element={
Expand Down
38 changes: 0 additions & 38 deletions web/src/app/rootReducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,6 @@ import cHainesModelRunReducer from 'features/cHaines/slices/cHainesModelRunsSlic
import cHainesPredictionReducer from 'features/cHaines/slices/cHainesPredictionsSlice'
import authReducer from 'features/auth/slices/authenticationSlice'
import wf1AuthReducer from 'features/auth/slices/wf1AuthenticationSlice'
import modelsReducer from 'features/fireWeather/slices/modelsSlice'
import observationsReducer from 'features/fireWeather/slices/observationsSlice'
import forecastsReducer from 'features/fireWeather/slices/forecastsSlice'
import modelSummariesReducer from 'features/fireWeather/slices/modelSummariesSlice'
import forecastSummariesReducer from 'features/fireWeather/slices/forecastSummariesSlice'
import highResModelsReducer from 'features/fireWeather/slices/highResModelsSlice'
import highResModelSummariesReducer from 'features/fireWeather/slices/highResModelSummariesSlice'
import regionalModelsReducer from 'features/fireWeather/slices/regionalModelsSlice'
import regionalModelSummariesReducer from 'features/fireWeather/slices/regionalModelSummariesSlice'
import hfiCalculatorDailiesReducer, { HFICalculatorState } from 'features/hfiCalculator/slices/hfiCalculatorSlice'
import hfiStationsReducer from 'features/hfiCalculator/slices/stationsSlice'
import hfiReadyReducer, { HFIReadyState } from 'features/hfiCalculator/slices/hfiReadySlice'
Expand All @@ -38,15 +29,6 @@ const rootReducer = combineReducers({
cHainesPredictions: cHainesPredictionReducer,
authentication: authReducer,
wf1Authentication: wf1AuthReducer,
observations: observationsReducer,
models: modelsReducer,
modelSummaries: modelSummariesReducer,
forecasts: forecastsReducer,
forecastSummaries: forecastSummariesReducer,
highResModels: highResModelsReducer,
highResModelSummaries: highResModelSummariesReducer,
regionalModels: regionalModelsReducer,
regionalModelSummaries: regionalModelSummariesReducer,
hfiCalculatorDailies: hfiCalculatorDailiesReducer,
hfiStations: hfiStationsReducer,
hfiReady: hfiReadyReducer,
Expand Down Expand Up @@ -78,16 +60,7 @@ export const selectChainesPredictions = (state: RootState) => state.cHainesPredi
export const selectAuthentication = (state: RootState) => state.authentication
export const selectWf1Authentication = (state: RootState) => state.wf1Authentication
export const selectToken = (state: RootState) => state.authentication.token
export const selectModels = (state: RootState) => state.models
export const selectObservations = (state: RootState) => state.observations
export const selectForecasts = (state: RootState) => state.forecasts
export const selectModelSummaries = (state: RootState) => state.modelSummaries
export const selectForecastSummaries = (state: RootState) => state.forecastSummaries
export const selectFireBehaviourCalcResult = (state: RootState) => state.fbaCalculatorResults
export const selectHighResModels = (state: RootState) => state.highResModels
export const selectHighResModelSummaries = (state: RootState) => state.highResModelSummaries
export const selectRegionalModels = (state: RootState) => state.regionalModels
export const selectRegionalModelSummaries = (state: RootState) => state.regionalModelSummaries
export const selectHFIStations = (state: RootState) => state.hfiStations
export const selectFireCenters = (state: RootState) => state.fireCenters
export const selectFireZoneAreas = (state: RootState) => state.fireZoneAreas
Expand All @@ -96,17 +69,6 @@ export const selectValueAtCoordinate = (state: RootState) => state.valueAtCoordi
export const selectHFIFuelTypes = (state: RootState) => state.hfiFuelTypes
export const selectFireZoneElevationInfo = (state: RootState) => state.fireZoneElevationInfo

export const selectWxDataLoading = (state: RootState): boolean =>
state.observations.loading ||
state.models.loading ||
state.modelSummaries.loading ||
state.forecasts.loading ||
state.forecastSummaries.loading ||
state.highResModels.loading ||
state.highResModelSummaries.loading ||
state.regionalModels.loading ||
state.regionalModelSummaries.loading
export const selectFireWeatherStationsLoading = (state: RootState): boolean => state.fireWeatherStations.loading
export const selectHFIDailiesLoading = (state: RootState): boolean => state.hfiCalculatorDailies.fireCentresLoading
export const selectHFICalculatorState = (state: RootState): HFICalculatorState => state.hfiCalculatorDailies
export const selectHFIStationsLoading = (state: RootState): boolean => state.hfiStations.loading
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion web/src/features/fbaCalculator/RowManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { formatCrownFractionBurned } from 'features/fbaCalculator/components/Cro
import { formatCriticalHoursAsString } from 'features/fbaCalculator/components/CriticalHoursCell'
import { FuelTypes } from 'features/fbaCalculator/fuelTypes'
import _, { isNull, isUndefined, merge } from 'lodash'
import { Order } from 'utils/table'
import { Order } from 'utils/constants'
export enum SortByColumn {
Zone,
Station,
Expand Down
3 changes: 1 addition & 2 deletions web/src/features/fbaCalculator/components/FBATable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import WeatherStationCell from 'features/fbaCalculator/components/WeatherStation
import FuelTypeCell from 'features/fbaCalculator/components/FuelTypeCell'
import GrassCureCell from 'features/fbaCalculator/components/GrassCureCell'
import WindSpeedCell from 'features/fbaCalculator/components/WindSpeedCell'
import { Order } from 'utils/table'
import { Order, PST_UTC_OFFSET } from 'utils/constants'
import { FBATableRow, RowManager, SortByColumn } from 'features/fbaCalculator/RowManager'
import { GeoJsonStation, getStations, StationSource } from 'api/stationAPI'
import { selectFireWeatherStations, selectFireBehaviourCalcResult } from 'app/rootReducer'
Expand All @@ -36,7 +36,6 @@ import FBATableHead from 'features/fbaCalculator/components/FBATableHead'
import FireTable from 'components/FireTable'
import FBATableInstructions from 'features/fbaCalculator/components/FBATableInstructions'
import FilterColumnsModal from 'components/FilterColumnsModal'
import { PST_UTC_OFFSET } from 'utils/constants'
import WPSDatePicker from 'components/WPSDatePicker'
import { AppDispatch } from 'app/store'
import { StyledFormControl } from 'components/StyledFormControl'
Expand Down
2 changes: 1 addition & 1 deletion web/src/features/fbaCalculator/components/FBATableHead.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import StickyCell from 'components/StickyCell'
import { FBATableRow, SortByColumn } from 'features/fbaCalculator/RowManager'
import { isUndefined } from 'lodash'
import React from 'react'
import { Order } from 'utils/table'
import { Order } from 'utils/constants'
import { ColumnLabel } from 'features/fbaCalculator/components/FBATable'

const PREFIX = 'FBATableHead'
Expand Down
Loading

0 comments on commit 3f96d74

Please sign in to comment.