Skip to content

Commit

Permalink
Add banner about Ramp pilot
Browse files Browse the repository at this point in the history
  • Loading branch information
kberzinch committed Oct 20, 2024
1 parent 39ebc74 commit a5bbf86
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions elm/Main.elm
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ type alias Model =
, time : Time.Posix
, zone : Time.Zone
, nextAction : NextAction
, showRampBanner : Bool
}


Expand Down Expand Up @@ -240,6 +241,7 @@ type Msg
| GoogleAddressValidationResultReceived (Result Http.Error GoogleAddressValidation)
| SetTime Time.Posix
| SetZone Time.Zone
| DismissRampBanner



Expand Down Expand Up @@ -635,6 +637,14 @@ update msg model =
, Cmd.none
)

DismissRampBanner ->
( { model
| showRampBanner = False
, nextAction = NoOpNextAction
}
, saveToLocalStorage (stringifyModel { model | showRampBanner = False })
)


subscriptions : Model -> Sub Msg
subscriptions _ =
Expand All @@ -659,6 +669,14 @@ view model =
]
, text " to issue corporate credit cards and manage reimbursements. We need some information from you to create your BILL Spend & Expense account."
]
, div [ class "alert", class "alert-primary", class "alert-dismissible", class "mb-4", classList [ ( "d-none", not model.showRampBanner ) ] ]
[ text "RoboJackets is currently piloting "
, a [ href "https://ramp.com", class "alert-link" ] [ text "Ramp" ]
, text " to replace BILL Spend & Expense. Please check with your project manager if you should "
, a [ href "https://ramp.robojackets.org", class "alert-link" ] [ text "request a Ramp account" ]
, text " instead."
, button [ type_ "button", class "btn-close", onClick DismissRampBanner ] []
]
, Html.form
[ class "row"
, class "g-3"
Expand Down Expand Up @@ -1475,6 +1493,7 @@ stringifyModel model =
Json.Encode.null
)
, ( "zip", Json.Encode.string (String.trim model.zip) )
, ( "showRampBanner", Json.Encode.bool model.showRampBanner )
]
)

Expand Down Expand Up @@ -1702,6 +1721,7 @@ buildInitialModel value =
(Time.millisToPosix 0)
Time.utc
NoOpNextAction
(Result.withDefault True (decodeString (field "showRampBanner" bool) (Result.withDefault "{}" (decodeValue (field "localData" string) value))))


stringStringTupleToMaybeIntStringTuple : ( String, String ) -> Maybe ( Int, String )
Expand Down

0 comments on commit a5bbf86

Please sign in to comment.