Add Landkit styles to billing creation
[?]
Feb 7, 2021, 8:05 PM
RUAQYIXI4G3RUD4L7536QFGFUFPWFAW7U4PTLFEDIW7FXNLRAMFACDependencies
- [2]
3PFXXJTLWIP - [3]
YBLHJFCNImplement billing modal. - [4]
4GOBY5NQWIP on modals. - [5]
N6FG4EW6Working bootstrap modal! Only a little FFI. - [6]
T2DN23M7Factor out billing create component.
Change contents
- edit in client/src/Aftok/Billing/Create.purs at line 4
import Aftok.Api.Billing (BillableId, Billable, Recurrence(..), createBillable)import Aftok.Api.Types (APIError(..))import Aftok.HTML.Classes as Cimport Aftok.Modals as Modalsimport Aftok.Modals.ModalFFI as ModalFFIimport Aftok.Types (System, ProjectId)import Aftok.Zcash (ZEC(..), toZatoshi) - edit in client/src/Aftok/Billing/Create.purs at line 13
-- import Data.DateTime (DateTime, date) - edit in client/src/Aftok/Billing/Create.purs at line 21
-- import Data.Unfoldable as Uimport Data.Validation.Semigroup (V(..), toEither) - edit in client/src/Aftok/Billing/Create.purs at line 22
-- import Data.Traversable (traverse) - edit in client/src/Aftok/Billing/Create.purs at line 23
import Data.Validation.Semigroup (V(..), toEither) - edit in client/src/Aftok/Billing/Create.purs at line 25
-- import Effect.Class (liftEffect)-- import Effect.Now (nowDateTime) - edit in client/src/Aftok/Billing/Create.purs at line 26
import Halogen.HTML.Core (ClassName(..)) - edit in client/src/Aftok/Billing/Create.purs at line 27
import Halogen.HTML.Core (ClassName(..)) - edit in client/src/Aftok/Billing/Create.purs at line 30[3.1116]→[3.1116:1155](∅→∅),[3.1155]→[3.729:760](∅→∅),[3.760]→[3.464:535](∅→∅),[3.1228]→[3.464:535](∅→∅),[3.535]→[3.761:799](∅→∅),[3.535]→[3.1228:1281](∅→∅),[3.799]→[3.1228:1281](∅→∅),[3.1228]→[3.1228:1281](∅→∅),[3.1281]→[3.800:819](∅→∅),[3.819]→[3.1321:1340](∅→∅),[3.1321]→[3.1321:1340](∅→∅),[3.1395]→[3.1395:1399](∅→∅),[3.1399]→[3.820:860](∅→∅)
import Aftok.Types (System, ProjectId)import Aftok.HTML.Classes as Cimport Aftok.Modals as Modalsimport Aftok.Modals.ModalFFI as ModalFFIimport Aftok.Api.Types (APIError(..))import Aftok.Api.Billing( BillableId, Billable, Recurrence(..), createBillable)import Aftok.Zcash (ZEC(..), toZatoshi) - replacement in client/src/Aftok/Billing/Create.purs at line 130
[ HH.label[ HH.label - replacement in client/src/Aftok/Billing/Create.purs at line 132
[ HH.text "Product Name" ][ HH.text "Product Name" ] - replacement in client/src/Aftok/Billing/Create.purs at line 135
, P.classes [ C.formControlSm ], P.classes [ C.formControl, C.formControlSm ] - replacement in client/src/Aftok/Billing/Create.purs at line 140
]] - replacement in client/src/Aftok/Billing/Create.purs at line 143
[ HH.label[ HH.label - replacement in client/src/Aftok/Billing/Create.purs at line 145
[ HH.text "Product Description" ][ HH.text "Product Description" ] - replacement in client/src/Aftok/Billing/Create.purs at line 148
, P.classes [ C.formControlSm ], P.classes [ C.formControl, C.formControlSm ] - replacement in client/src/Aftok/Billing/Create.purs at line 156
[ HH.label[ HH.label - replacement in client/src/Aftok/Billing/Create.purs at line 158
[ HH.text "Message to be included with bill" ][ HH.text "Message to be included with bill" ] - edit in client/src/Aftok/Billing/Create.purs at line 161
, P.classes [C.formControl, C.formControlSm] - replacement in client/src/Aftok/Billing/Create.purs at line 169
[ HH.label_[ HH.input([ P.type_ P.InputRadio, P.name "recurType", E.onClick \_ -> Just (SetRecurrenceType RTAnnual)] <> (if st.recurrenceType == RTAnnual then [P.checked true] else [])), HH.text " Annual"], HH.label_[ HH.input([ P.type_ P.InputRadio, P.name "recurType", E.onClick \_ -> Just (SetRecurrenceType RTMonthly)] <> (if st.recurrenceType == RTMonthly then [P.checked true] else [])), HH.text " every "[ formCheckGroup{ id: "recurAnnual", checked: (st.recurrenceType == RTAnnual), labelClasses: []}(\_ -> Just (SetRecurrenceType RTAnnual))[ HH.text "Annual" ], formCheckGroup{ id: "recurMonthly", checked: (st.recurrenceType == RTMonthly), labelClasses: [C.formInline]}(\_ -> Just (SetRecurrenceType RTMonthly))[ HH.text "Every", HH.input[ P.type_ P.InputNumber, P.classes [ C.formControl, C.formControlXs, C.formControlFlush, C.marginX2 ], P.value (if st.recurrenceType == RTMonthlythen maybe "" show st.recurrenceValueelse ""), P.min 1.0, P.max 12.0, E.onValueInput (Just <<< SetRecurrenceMonths)], HH.text "Months"], formCheckGroup{ id: "recurWeekly", checked: (st.recurrenceType == RTWeekly), labelClasses: [C.formInline]}(\_ -> Just (SetRecurrenceType RTWeekly))[ HH.text "Every" - replacement in client/src/Aftok/Billing/Create.purs at line 203
, P.classes [ C.formControlSm ], P.value (if st.recurrenceType == RTMonthlythen maybe "" show st.recurrenceValueelse ""), P.min 1.0, P.max 12.0, E.onValueInput (Just <<< SetRecurrenceMonths)], HH.text " Months"], HH.label_[ HH.input([ P.type_ P.InputRadio, P.name "recurType", E.onClick \_ -> Just (SetRecurrenceType RTWeekly)] <> (if st.recurrenceType == RTWeekly then [P.checked true] else [])), HH.text " every ", HH.input[ P.type_ P.InputNumber, P.classes [ C.formControlSm ], P.classes [ C.formControl, C.formControlXs, C.formControlFlush, C.marginX2 ] - replacement in client/src/Aftok/Billing/Create.purs at line 210
], HH.text " Weeks"], HH.label_[ HH.input([ P.type_ P.InputRadio, P.name "recurType", E.onClick \_ -> Just (SetRecurrenceType RTOneTime)] <> (if st.recurrenceType == RTOneTime then [P.checked true] else [])), HH.text " One-Time"], HH.text "Weeks" - edit in client/src/Aftok/Billing/Create.purs at line 213
, formCheckGroup{ id: "oneTime", checked: st.recurrenceType == RTOneTime, labelClasses: []}(\_ -> Just (SetRecurrenceType RTOneTime))[ HH.text "One-Time" ] - replacement in client/src/Aftok/Billing/Create.purs at line 223
[ HH.label[ HH.label - replacement in client/src/Aftok/Billing/Create.purs at line 225
[ HH.text "Amount" ], HH.input[ P.type_ P.InputNumber, P.classes [ C.formControlSm ], P.id_ "billableAmount", P.value (maybe "" (Fixed.toString <<< unwrap) st.amount), P.placeholder "1.0", P.min 0.0, E.onValueInput (Just <<< SetBillingAmount)][ HH.text "Amount" ] - replacement in client/src/Aftok/Billing/Create.purs at line 227
[ P.classes [ ClassName "input-group-append" ] ][ HH.span [ P.classes [ ClassName "input-group-text" ] ] [ HH.text "ZEC" ] ][ P.classes [ ClassName "input-group", ClassName "input-group-sm" ] ][ HH.input[ P.type_ P.InputNumber, P.classes [ C.formControl ], P.id_ "billableAmount", P.value (maybe "" (Fixed.toString <<< unwrap) st.amount), P.placeholder "1.0", P.min 0.0, E.onValueInput (Just <<< SetBillingAmount)], HH.div[ P.classes [ ClassName "input-group-append"] ][ HH.span[ P.classes [ ClassName "input-group-text" ], P.style "height: auto;" -- fix bad calculated height from LandKit][ HH.text "ZEC" ] ]] - replacement in client/src/Aftok/Billing/Create.purs at line 248
[ HH.label[ HH.label - replacement in client/src/Aftok/Billing/Create.purs at line 250
[ HH.text "Grace Period (Days)" ][ HH.text "Grace Period (Days)" ] - replacement in client/src/Aftok/Billing/Create.purs at line 254
, P.classes [ C.formControlSm ], P.classes [ C.formControl, C.formControlSm ] - replacement in client/src/Aftok/Billing/Create.purs at line 259
]] - replacement in client/src/Aftok/Billing/Create.purs at line 263
[ HH.label[ HH.label - replacement in client/src/Aftok/Billing/Create.purs at line 265
[ HH.text "Request Expiry Period (Hours)" ][ HH.text "Request Expiry Period (Hours)" ] - replacement in client/src/Aftok/Billing/Create.purs at line 269
, P.classes [ C.formControlSm ], P.classes [ C.formControl, C.formControlSm ] - replacement in client/src/Aftok/Billing/Create.purs at line 274
]] - edit in client/src/Aftok/Billing/Create.purs at line 278
formCheckGroup :: forall i a.{ id :: String, checked :: Boolean, labelClasses :: Array ClassName}-> (Unit -> Maybe a)-> Array (HH.HTML i a)-> HH.HTML i aformCheckGroup { id, checked, labelClasses } onChange children =HH.div[ P.classes [C.formCheck] ][ HH.input([ P.type_ P.InputRadio, P.name "recurType", P.classes [C.formCheckInput], P.id_ id, E.onClick \_ -> onChange unit] <> (if checked then [P.checked true] else [])), HH.label[ P.classes ([C.formCheckLabel ] <> labelClasses), P.for id]children] - replacement in client/src/Aftok/Billing/Create.purs at line 304
formGroup st fields body =formGroup st fields body = - replacement in client/src/Aftok/Billing/Create.purs at line 307
(body <> (fieldError st =<< fields))(body <> (fieldError st =<< fields)) - replacement in client/src/Aftok/Billing/Create.purs at line 310
fieldError st field =if any (_ == field) st.fieldErrorsfieldError st field =if any (_ == field) st.fieldErrors - replacement in client/src/Aftok/Billing/Create.purs at line 329
SetName name ->SetName name -> - replacement in client/src/Aftok/Billing/Create.purs at line 331
SetDesc desc ->SetDesc desc -> - replacement in client/src/Aftok/Billing/Create.purs at line 333
SetMessage msg ->SetMessage msg -> - replacement in client/src/Aftok/Billing/Create.purs at line 343
SetRecurrenceMonths dur ->SetRecurrenceMonths dur -> - replacement in client/src/Aftok/Billing/Create.purs at line 347
SetRecurrenceWeeks dur ->SetRecurrenceWeeks dur -> - replacement in client/src/Aftok/Billing/Create.purs at line 351
SetBillingAmount amt ->SetBillingAmount amt -> - replacement in client/src/Aftok/Billing/Create.purs at line 355
SetGracePeriod dur ->SetGracePeriod dur -> - replacement in client/src/Aftok/Billing/Create.purs at line 359
SetRequestExpiry dur ->SetRequestExpiry dur -> - replacement in client/src/Aftok/Billing/Create.purs at line 384
- replacement in client/src/Aftok/Billing/Create.purs at line 386
reqV =reqV = - replacement in client/src/Aftok/Billing/Create.purs at line 405
Left errs ->Left errs -> - replacement in client/src/Aftok/HTML/Classes.purs at line 5
btn :: ClassNamebtn :: ClassName - replacement in client/src/Aftok/HTML/Classes.purs at line 8
btnPrimary :: ClassNamebtnPrimary :: ClassName - replacement in client/src/Aftok/HTML/Classes.purs at line 11
btnSecondary :: ClassNamebtnSecondary :: ClassName - replacement in client/src/Aftok/HTML/Classes.purs at line 14
close :: ClassNameclose :: ClassName - edit in client/src/Aftok/HTML/Classes.purs at line 44
formInline :: ClassNameformInline = ClassName "form-inline" - edit in client/src/Aftok/HTML/Classes.purs at line 49
formControl :: ClassNameformControl = ClassName "form-control" - edit in client/src/Aftok/HTML/Classes.purs at line 55[3.19347]
formControlXs :: ClassNameformControlXs = ClassName "form-control-xs"formControlFlush :: ClassNameformControlFlush = ClassName "form-control-flush"formCheck :: ClassNameformCheck = ClassName "form-check"formCheckLabel :: ClassNameformCheckLabel = ClassName "form-check-label"formCheckInput :: ClassNameformCheckInput = ClassName "form-check-input"-- SizingmarginX2 :: ClassNamemarginX2 = ClassName "mx-2"