mirror of
https://code.sup39.dev/repos/Wqawg
synced 2024-12-27 18:14:52 +09:00
Custom ticket fields specify whether required
This commit is contained in:
parent
17643c6d49
commit
a2ca78c790
4 changed files with 6 additions and 0 deletions
|
@ -168,6 +168,7 @@ WorkflowField
|
|||
name Text
|
||||
desc Text Maybe
|
||||
type WorkflowFieldType
|
||||
required Bool
|
||||
-- filter TicketStatusFilterId
|
||||
|
||||
UniqueWorkflowField workflow ident
|
||||
|
|
|
@ -56,6 +56,7 @@ data NewField = NewField
|
|||
, nfName :: Text
|
||||
, nfDesc :: Maybe Text
|
||||
, nfType :: WorkflowFieldType
|
||||
, nfReq :: Bool
|
||||
}
|
||||
|
||||
newFieldAForm :: WorkflowId -> AForm Handler NewField
|
||||
|
@ -64,6 +65,7 @@ newFieldAForm wid = NewField
|
|||
<*> areq textField "Name*" Nothing
|
||||
<*> aopt textField "Description" Nothing
|
||||
<*> areq (selectField optionsEnum) "Type*" Nothing
|
||||
<*> areq checkBoxField "Required*" Nothing
|
||||
|
||||
newFieldForm :: WorkflowId -> Form NewField
|
||||
newFieldForm wid = renderDivs $ newFieldAForm wid
|
||||
|
|
|
@ -149,6 +149,7 @@ postWorkflowFieldsR shr wfl = do
|
|||
, workflowFieldName = nfName nf
|
||||
, workflowFieldDesc = nfDesc nf
|
||||
, workflowFieldType = nfType nf
|
||||
, workflowFieldRequired = nfReq nf
|
||||
}
|
||||
runDB $ insert_ field
|
||||
setMessage "Workflow field added."
|
||||
|
|
|
@ -24,3 +24,5 @@ $# <http://creativecommons.org/publicdomain/zero/1.0/>.
|
|||
Description: #{fromMaybe "(none)" $ workflowFieldDesc f}
|
||||
<li>
|
||||
Type: #{show $ workflowFieldType f}
|
||||
<li>
|
||||
Required: #{workflowFieldRequired f}
|
||||
|
|
Loading…
Reference in a new issue