chore(forms): revert apreq change and use areq directly for boolFields with defaults
This commit is contained in:
parent
6339e71efd
commit
54c9198669
@ -13,7 +13,7 @@ Company
|
|||||||
UniqueCompanyName name
|
UniqueCompanyName name
|
||||||
UniqueCompanyShorthand shorthand
|
UniqueCompanyShorthand shorthand
|
||||||
-- UniqueCompanyAvsId avsId -- should be the case, unclear if enforcing works here, since we cannot query avs by company id
|
-- UniqueCompanyAvsId avsId -- should be the case, unclear if enforcing works here, since we cannot query avs by company id
|
||||||
Primary shorthand -- newtype Key Company = CompanyKey { unSchoolKey :: CompanyShorthand }
|
Primary shorthand -- newtype Key Company = CompanyKey { unCompanyKey :: CompanyShorthand }
|
||||||
deriving Ord Eq Show Generic Binary
|
deriving Ord Eq Show Generic Binary
|
||||||
|
|
||||||
-- TODO: a way to populate this table (manually)
|
-- TODO: a way to populate this table (manually)
|
||||||
|
|||||||
@ -605,7 +605,7 @@ mkLicenceTable apidStatus dbtIdent aLic apids = do
|
|||||||
then singletonMap LicenceTableRevokeFDrive $ LicenceTableRevokeFDriveData
|
then singletonMap LicenceTableRevokeFDrive $ LicenceTableRevokeFDriveData
|
||||||
<$> apreq (selectField . fmap mkOptionList $ mapM qualOpt avsQualifications) (fslI MsgQualificationName) aLicQid
|
<$> apreq (selectField . fmap mkOptionList $ mapM qualOpt avsQualifications) (fslI MsgQualificationName) aLicQid
|
||||||
<*> apreq textField (fslI MsgQualificationBlockReason) Nothing
|
<*> apreq textField (fslI MsgQualificationBlockReason) Nothing
|
||||||
<*> apreq (boolField . Just $ SomeMessage MsgBoolIrrelevant) (fslI MsgQualificationBlockNotify) (Just False)
|
<*> areq (boolField . Just $ SomeMessage MsgBoolIrrelevant) (fslI MsgQualificationBlockNotify) (Just False)
|
||||||
|
|
||||||
else singletonMap LicenceTableGrantFDrive $ LicenceTableGrantFDriveData
|
else singletonMap LicenceTableGrantFDrive $ LicenceTableGrantFDriveData
|
||||||
<$> apreq (selectField . fmap mkOptionList $ mapM qualOpt avsQualifications) (fslI MsgQualificationName) aLicQid
|
<$> apreq (selectField . fmap mkOptionList $ mapM qualOpt avsQualifications) (fslI MsgQualificationName) aLicQid
|
||||||
|
|||||||
@ -1667,8 +1667,7 @@ mpreq :: (RenderMessage site (ValueRequired site), HandlerSite m ~ site, MonadHa
|
|||||||
-- ^ Pseudo required
|
-- ^ Pseudo required
|
||||||
--
|
--
|
||||||
-- `FieldView` has `fvRequired` set to `True` and @FormSuccess Nothing@ is cast to `FormFailure`.
|
-- `FieldView` has `fvRequired` set to `True` and @FormSuccess Nothing@ is cast to `FormFailure`.
|
||||||
-- Otherwise acts exactly like `mopt` without a default value and like `mreq` with a given default value
|
-- Otherwise acts exactly like `mopt`. Note that a shortcut to mreq for isJust mx does create problems mit checkBoxField
|
||||||
mpreq f fs mx@(Just _) = mreq f fs mx -- This shortcut hides the invalid no-answer option if a default is provided
|
|
||||||
mpreq f fs@FieldSettings{..} mx = do
|
mpreq f fs@FieldSettings{..} mx = do
|
||||||
mr <- getMessageRender
|
mr <- getMessageRender
|
||||||
(res, fv') <- mpreq' f fs $ Just <$> mx
|
(res, fv') <- mpreq' f fs $ Just <$> mx
|
||||||
|
|||||||
Reference in New Issue
Block a user