implemented editAwayStandings

This commit is contained in:
Jonathan Lamothe 2020-01-16 15:00:08 -05:00
parent 49963277be
commit 9c7c295a4b
5 changed files with 10 additions and 4 deletions

View File

@ -22,7 +22,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
module Mtlstats.Actions.EditStandings
( editStandings
, editHomeStandings
, editRoadStandings
, editAwayStandings
) where
import Lens.Micro ((.~))
@ -38,5 +38,5 @@ editHomeStandings :: ProgState -> ProgState
editHomeStandings = progMode .~ EditStandings ESMHome
-- | Edits the road standings
editRoadStandings :: ProgState -> ProgState
editRoadStandings = undefined
editAwayStandings :: ProgState -> ProgState
editAwayStandings = progMode .~ EditStandings ESMAway

View File

@ -36,10 +36,14 @@ editStandingsC :: EditStandingsMode -> Controller
editStandingsC = \case
ESMMenu -> menuControllerWith header editStandingsMenu
ESMHome -> editHomeStandingsC
ESMAway -> editAwayStandingsC
editHomeStandingsC :: Controller
editHomeStandingsC = undefined
editAwayStandingsC :: Controller
editAwayStandingsC = undefined
header :: ProgState -> C.Update ()
header = do
db <- (^.database)

View File

@ -32,7 +32,7 @@ editStandingsMenu = Menu "*** EDIT STANDINGS ***" ()
[ MenuItem '1' "Edit home standings" $
modify editHomeStandings
, MenuItem '2' "Edit road standings" $
modify editRoadStandings
modify editAwayStandings
, MenuItem 'R' "Return to main menu" $
modify backHome
]

View File

@ -397,6 +397,7 @@ data EditGoalieMode
data EditStandingsMode
= ESMMenu
| ESMHome
| ESMAway
deriving (Eq, Show)
-- | Represents the database

View File

@ -47,4 +47,5 @@ spec = describe "EditStandings" $ mapM_
-- label, function, expected mode
[ ( "editStandings", editStandings, ESMMenu )
, ( "editHomeStandings", editHomeStandings, ESMHome )
, ( "editAwayStandings", editAwayStandings, ESMAway )
]