Successfully rendering QR codes sometimes.

[?]
Feb 8, 2021, 4:39 AM
DAPLYXHYFBC6C642AAQ4MHRS44TDFWHLZYM646JZ3WLEK5EMUY4AC

Dependencies

  • [2] NACSEFXG Explicitly add uuid to our package.json
  • [3] FBFDB2ZQ We can render QR codes now.
  • [4] V54JCKJX Payment request creation.
  • [5] PPW6ROC5 Render project data
  • [6] OUR4PAOT Use local dates for display of intervals.
  • [7] ANDJ6GEY Add billing component skeleton.
  • [8] YBLHJFCN Implement billing modal.
  • [9] QMEYU4MW Add display for prior intervals.
  • [10] NJNMO72S Add zcash.com submodule and update client to modern halogen.
  • [11] WRPIYG3E Use project listing functionality to check for whether we have a cookie.
  • [12] QU5FW67R Add project selection to time tracker.
  • [13] KET5QGQP Add billable list (in-progress)
  • [14] N6FG4EW6 Working bootstrap modal! Only a little FFI.
  • [15] QH4UB73N Format with purty.
  • [16] 4GOBY5NQ WIP on modals.
  • [17] KKJSBWO6 Add createPaymentRequestHandler
  • [18] JOJO5P2Q Update uuid dependency
  • [*] JXG3FCXY Upgrade ps + halogen versions.

Change contents

  • edit in client/package-lock.json at line 4339
    [4.174964][4.174964:174971](),[4.174971][4.21:248]()
    },
    "kjua": {
    "version": "0.9.0",
    "resolved": "https://registry.npmjs.org/kjua/-/kjua-0.9.0.tgz",
    "integrity": "sha512-Wmh5k6hpl+wiYkcEIx0/Ocj1DOxacw/myh/SQ3NbY0RWD4360CXaaAJkdeeV+moqf7fxvACYK95LXQ8vtLWKxA=="
  • edit in client/package-lock.json at line 5855
    [4.232434]
    [4.232434]
    "qrious": {
    "version": "4.0.2",
    "resolved": "https://registry.npmjs.org/qrious/-/qrious-4.0.2.tgz",
    "integrity": "sha512-xWPJIrK1zu5Ypn898fBp8RHkT/9ibquV2Kv24S/JY9VYEhMBMKur1gHVsOiNUh7PHP9uCgejjpZUHUIXXKoU/g=="
    },
  • edit in client/package.json at line 18
    [4.291][4.257:279]()
    "kjua": "^0.9.0",
  • edit in client/package.json at line 19
    [4.274]
    [2.2]
    "qrious": "^4.0.2",
  • replacement in client/src/Aftok/Api/Billing.purs at line 125
    [4.623][4.623:701]()
    annually = traverse (map \(_ :: Unit) -> Annually) (obj .:? "annually")
    [4.623]
    [4.701]
    annually = traverse (map \(_ :: Json) -> Annually) (obj .:? "annually")
  • replacement in client/src/Aftok/Api/Billing.purs at line 128
    [4.854][4.898:974](),[4.898][4.898:974]()
    onetime = traverse (map \(_ :: Unit) -> OneTime) (obj .:? "onetime")
    [4.854]
    [4.974]
    onetime = traverse (map \(_ :: Json) -> OneTime) (obj .:? "onetime")
  • replacement in client/src/Aftok/Billing/PaymentRequest.purs at line 5
    [4.970][4.3514:3553]()
    import Control.Monad.State.Class (get)
    [4.970]
    [4.1011]
    -- import Control.Monad.State.Class (get)
  • edit in client/src/Aftok/Billing/PaymentRequest.purs at line 10
    [4.3614]
    [4.1312]
    -- import Data.Traversable (traverse_)
    import Data.Unfoldable as U
  • edit in client/src/Aftok/Billing/PaymentRequest.purs at line 13
    [4.1363][4.3615:3651]()
    import Data.Traversable (traverse_)
  • replacement in client/src/Aftok/Billing/PaymentRequest.purs at line 194
    [4.7092][4.7092:7128]()
    type QrState = Maybe PaymentRequest
    [4.7092]
    [4.7128]
    type QrInput = Maybe PaymentRequest
    type QrState =
    { req :: Maybe PaymentRequest
    , dataUrl :: Maybe String
    }
  • replacement in client/src/Aftok/Billing/PaymentRequest.purs at line 217
    [4.7358][4.7358:7420]()
    H.Component HH.HTML QrQuery (Maybe PaymentRequest) output m
    [4.7358]
    [4.7420]
    H.Component HH.HTML QrQuery QrInput output m
  • replacement in client/src/Aftok/Billing/PaymentRequest.purs at line 231
    [4.7702][4.7702:7794]()
    initialState :: Maybe PaymentRequest -> Maybe PaymentRequest
    initialState input = input
    [4.7702]
    [4.7794]
    initialState :: QrInput -> QrState
    initialState input =
    { req: input, dataUrl: Nothing }
  • replacement in client/src/Aftok/Billing/PaymentRequest.purs at line 239
    [4.7949][4.7949:8010]()
    [ HH.div [P.id_ "paymentRequestQRCode"] []
    ]
    [4.7949]
    [4.8010]
    ((\url -> HH.img [P.src url]) <$> U.fromMaybe st.dataUrl)
  • replacement in client/src/Aftok/Billing/PaymentRequest.purs at line 245
    [4.8167][4.8167:8191]()
    lift $ renderQR r
    [4.8167]
    [4.8191]
    dataUrl <- lift $ renderQR r
    H.modify_ (_ { dataUrl = Just dataUrl })
  • replacement in client/src/Aftok/Billing/PaymentRequest.purs at line 250
    [4.8304][4.8304:8392]()
    handleAction = case _ of
    QrInit -> do
    traverse_ (lift <<< renderQR) =<< get
    [4.8304]
    [4.14504]
    handleAction _ = pure unit
  • replacement in client/src/Aftok/Billing/PaymentRequest.purs at line 252
    [4.14505][4.8393:8432]()
    renderQR :: PaymentRequest -> m Unit
    [4.14505]
    [4.8432]
    renderQR :: PaymentRequest -> m String
  • replacement in client/src/Aftok/Billing/PaymentRequest.purs at line 254
    [4.8465][3.5:90]()
    system.renderQR "paymentRequestQRCode" { text: r.native_request.zip321_request }
    [4.8465]
    system.renderQR { value: r.native_request.zip321_request, size: 300 }
  • file deletion: KjuaQR.js (----------)
    [4.3158][4.10825:10858](),[4.10858][4.10729:10729]()
    exports.renderQRInternal = selector => content => () => {
    $('#' + selector).kjua(content)
    }
    require("kjua")
  • file deletion: KjuaQR.purs (----------)
    [4.3158][4.13318:13353](),[4.13353][4.10861:10861]()
    module Aftok.HTML.KjuaQR
    ( QRType(..)
    , QROpts
    , renderQR
    )
    where
    import Prelude
    import Effect (Effect)
    data QRType
    = Canvas
    | Image
    | SVG
    data ErrorCorrection = L | M | Q | H
    renderQR :: String -> QROpts -> Effect Unit
    renderQR = renderQRInternal
    type QROpts =
    }
    -- -- render method: 'canvas', 'image' or 'svg'
    -- render :: QRType,
    -- -- render pixel-perfect lines
    -- crisp :: Boolean,
    -- -- minimum version: 1..40
    -- minVersion :: Int,
    -- -- error correction level: 'L', 'M', 'Q' or 'H'
    -- ecLevel :: ErrorCorrection,
    -- -- size in pixel: 200
    -- size :: Int,
    -- -- pixel-ratio, null for devicePixelRatio
    -- -- ratio :: null,
    --
    -- --code color: '#333',
    -- fill :: String -- hack, fine for now
    -- -- background color '#fff'
    -- back :: String,
    --
    -- -- content
    -- text :: String,
    --
    -- -- roundend corners in pc: 0..100
    -- rounded: Int,
    --
    -- -- quiet zone in modules: 0
    -- quiet: Int,
    --
    -- -- modes: 'plain', 'label' or 'image'
    -- mode: 'plain',
    --
    -- -- label/image size and pos in pc: 0..100
    -- mSize: 30,
    -- mPosX: 50,
    -- mPosY: 50,
    --
    -- -- label
    -- label: 'no label',
    -- fontname: 'sans',
    -- fontcolor: '#333',
    --
    -- -- image element
    -- image: null
    --
    -- type QROptsInternal =
    -- {
    -- -- render method: 'canvas', 'image' or 'svg'
    -- render :: String,
    --
    -- -- render pixel-perfect lines
    -- crisp :: Boolean,
    --
    -- -- minimum version: 1..40
    -- minVersion :: Int
    --
    -- -- error correction level: 'L', 'M', 'Q' or 'H'
    -- ecLevel: 'L',
    --
    -- -- size in pixel
    -- size: 200,
    --
    -- -- pixel-ratio, null for devicePixelRatio
    -- ratio: null,
    --
    -- -- code color
    -- fill: '#333',
    --
    -- -- background color
    -- back: '#fff',
    --
    -- -- content
    -- text: 'no text',
    --
    -- -- roundend corners in pc: 0..100
    -- rounded: 0,
    --
    -- -- quiet zone in modules
    -- quiet: 0,
    --
    -- -- modes: 'plain', 'label' or 'image'
    -- mode: 'plain',
    --
    -- -- label/image size and pos in pc: 0..100
    -- mSize: 30,
    -- mPosX: 50,
    -- mPosY: 50,
    --
    -- -- label
    -- label: 'no label',
    -- fontname: 'sans',
    -- fontcolor: '#333',
    --
    -- -- image element
    -- image: null
    --
    --
    -- }
    foreign import renderQRInternal :: String -> QROpts -> Effect Unit
    { text :: String
  • file addition: QRious.js (----------)
    [4.3158]
    var QRious = require('qrious');
    exports.renderQRInternal = options => () => {
    var qrious = new QRious(options);
    return qrious.toDataURL();
    }
  • file addition: QRious.purs (----------)
    [4.3158]
    module Aftok.HTML.QRious
    ( renderQR
    , QROpts
    )
    where
    import Effect (Effect)
    renderQR :: QROpts -> Effect String
    renderQR = renderQRInternal
    type QROpts =
    { value :: String
    , size :: Int
    }
    foreign import renderQRInternal :: QROpts -> Effect String
  • replacement in client/src/Aftok/Types.purs at line 29
    [4.3753][4.14835:14870]()
    import Aftok.HTML.KjuaQR as KjuaQR
    [4.3753]
    [4.7524]
    import Aftok.HTML.QRious as QRious
  • replacement in client/src/Aftok/Types.purs at line 54
    [4.4228][4.14871:14923]()
    , renderQR :: String -> KjuaQR.QROpts -> m Unit
    [4.4228]
    [4.36602]
    , renderQR :: QRious.QROpts -> m String
  • replacement in client/src/Aftok/Types.purs at line 69
    [4.4389][4.14924:14985]()
    , renderQR: \i opts -> liftEffect (KjuaQR.renderQR i opts)
    [4.4389]
    [4.7336]
    , renderQR: \opts -> liftEffect (QRious.renderQR opts)