WIP on modals.
[?]
Feb 3, 2021, 3:19 PM
4GOBY5NQYPISPYKVN74SM7JYWV7PALUDWWGVXWRHW2J2CPPMC42QCDependencies
- [2]
T2DN23M7Factor out billing create component. - [3]
ANDJ6GEYAdd billing component skeleton. - [4]
VTZT2ILUWire up billing navigation. - [*]
NJNMO72SAdd zcash.com submodule and update client to modern halogen. - [*]
SAESJLLYInitial experiments in hash routing. - [*]
EA5BFM5GSplit Login component into its own module.
Change contents
- edit in client/dev/index.html at line 6
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous"> - edit in client/dev/index.html at line 14
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script><script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script> - replacement in client/src/Aftok/Billing/Create.purs at line 109
HH.div[ P.classes (ClassName <$> ["card-body"]) ][ HH.form_[HH.div[ P.classes (ClassName <$> ["form-group"]) ][ HH.label [ P.for "billableName" ] [ HH.text "Bill Name:" ], HH.input[ P.type_ P.InputText, P.classes (ClassName <$> [ "form-control" ]), P.id_ "billableName", P.placeholder "A name for the product or service you want to bill for", P.required true, P.autofocus true, E.onValueInput (Just <<< SetName)], HH.label [ P.for "billableDesc" ] [ HH.text "Bill Description:" ], HH.input[ P.type_ P.InputText, P.classes (ClassName <$> [ "form-control" ]), P.id_ "billableDesc", P.placeholder "Description of the product or service", P.required true, P.autofocus true, E.onValueInput (Just <<< SetDesc)]HH.form_[ HH.div[ P.classes (ClassName <$> ["form-group"]) ][ HH.label[ P.for "billableName", P.classes (ClassName <$> ["font-weight-bold", "mb-1"] )][ HH.text "Bill Name:" ], HH.input[ P.type_ P.InputText, P.classes (ClassName <$> [ "form-control-sm" ]), P.id_ "billableName", P.placeholder "A name for the product or service you want to bill for", P.required true, P.autofocus true, E.onValueInput (Just <<< SetName)], HH.label[ P.for "billableDesc", P.classes (ClassName <$> ["font-weight-bold", "mb-1"] )][ HH.text "Bill Description:" ], HH.input[ P.type_ P.InputText, P.classes (ClassName <$> [ "form-control-sm" ]), P.id_ "billableDesc", P.placeholder "Description of the product or service", P.required true, P.autofocus true, E.onValueInput (Just <<< SetDesc) - edit in client/src/Aftok/Billing/Create.purs at line 136
, HH.label[ P.for "billableMsg", P.classes (ClassName <$> ["font-weight-bold", "mb-1"] )][ HH.text "Message to be included with bill:" ], HH.input[ P.type_ P.InputText, P.classes (ClassName <$> [ "form-control-sm" ]), P.id_ "billableMsg", P.placeholder "Description of the product or service", P.required true, P.autofocus true, E.onValueInput (Just <<< SetDesc)] - edit in client/src/Aftok/Billing/Create.purs at line 150
colmd :: forall a s. Int -> Array (H.ComponentHTML a s m) -> H.ComponentHTML a s mcolmd i xs = HH.div [ P.classes (ClassName <$> [ "col-md-" <> show i ]) ] xs - edit in client/src/Aftok/Billing/Create.purs at line 154
- replacement in client/src/Aftok/Billing.purs at line 12
import Data.Time.Duration (Hours(..))-- import Data.Time.Duration (Hours(..)) - replacement in client/src/Aftok/Billing.purs at line 21
import Halogen.HTML.Events as E-- import Halogen.HTML.Events as E - edit in client/src/Aftok/Billing.purs at line 37
import Aftok.Modals as Modals - replacement in client/src/Aftok/Billing.purs at line 121
case st.selectedProject of(case st.selectedProject of - replacement in client/src/Aftok/Billing.purs at line 123
[ HH.slot_createBillableunit(Create.component system caps.createBillable)(unwrap p).projectId(Just <<< BillableCreated)[ Modals.modalButton "createBillable" "Create billable", Modals.modal "createBillable" "Create Billable"[ HH.slot_createBillableunit(Create.component system caps.createBillable)(unwrap p).projectId(Just <<< BillableCreated)] - replacement in client/src/Aftok/Billing.purs at line 134
) - file addition: HTML[8.1]
- file addition: Classes.purs[0.3158]
module Aftok.HTML.Classes whereimport Halogen.HTML.Core (ClassName(..))btn :: ClassNamebtn = ClassName "btn"btnPrimary :: ClassNamebtnPrimary = ClassName "btn-primary"btnSecondary :: ClassNamebtnSecondary = ClassName "btn-secondary"close :: ClassNameclose = ClassName "close"fade :: ClassNamefade = ClassName "fade"show :: ClassNameshow = ClassName "show"modal :: ClassNamemodal = ClassName "modal"modalBody :: ClassNamemodalBody = ClassName "modal-body"modalContent :: ClassNamemodalContent = ClassName "modal-content"modalDialog :: ClassNamemodalDialog = ClassName "modal-dialog"modalHeader :: ClassNamemodalHeader = ClassName "modal-header"modalFooter :: ClassNamemodalFooter = ClassName "modal-footer"modalTitle :: ClassNamemodalTitle = ClassName "modal-title" - file addition: Properties.purs[0.3158]
module Aftok.HTML.Properties whereimport Halogen.HTML.Core (AttrName(..))import Halogen.HTML.Properties (IProp, attr)dataToggle :: forall r i. String -> IProp r idataToggle = attr (AttrName "data-toggle")dataTarget :: forall r i. String -> IProp r idataTarget = attr (AttrName "data-target")dataDismiss :: forall r i. String -> IProp r idataDismiss = attr (AttrName "data-dismiss") - file addition: HTML.purs[8.1]
module Aftok.HTML where - file addition: Modals.purs[8.1]
module Aftok.Modals whereimport Prelude ((<>), negate)import DOM.HTML.Indexed.ButtonType (ButtonType(..))import Halogen.HTML as HHimport Halogen.HTML.Properties as Pimport Halogen.HTML.Properties.ARIA as ARIAimport Aftok.HTML.Classes as Cimport Aftok.HTML.Properties as APmodalButton :: forall w i. String -> String -> HH.HTML w imodalButton target text =HH.button[ P.classes [ C.btn, C.btnPrimary ], AP.dataToggle "modal", AP.dataTarget ("#" <> target), P.type_ ButtonButton][ HH.text text ]modal :: forall w i. String -> String -> Array (HH.HTML w i) -> HH.HTML w imodal modalId title contents =HH.div[ P.classes [ C.modal ], P.id_ modalId, P.tabIndex (negate 1), ARIA.role "dialog", ARIA.labelledBy (modalId <> "Title"), ARIA.hidden "true"][ HH.div[ P.classes [C.modalDialog], ARIA.role "document" ][ HH.div[ P.classes [C.modalContent] ][ HH.div[ P.classes [C.modalHeader] ][ HH.h5 [P.classes [C.modalTitle], P.id_ (modalId <>"Title") ] [HH.text title], HH.button[ P.classes [ C.close ], AP.dataDismiss "modal", ARIA.label "Close", P.type_ ButtonButton][ HH.span [ARIA.hidden "true"] [HH.text "×"]]], HH.div[ P.classes [C.modalBody] ]contents, HH.div[ P.classes [C.modalFooter] ][ HH.button[ P.type_ ButtonButton, P.classes [ C.btn, C.btnSecondary], AP.dataDismiss "modal"][ HH.text "Close" ], HH.button[ P.type_ ButtonButton, P.classes [ C.btn, C.btnPrimary ]][ HH.text "Save changes"]]]]]