Skip to content

Commit

Permalink
refactor: clean up hardcoded docs urls
Browse files Browse the repository at this point in the history
  • Loading branch information
plyr4 committed Jan 27, 2024
1 parent 5c412c6 commit 3953b61
Show file tree
Hide file tree
Showing 11 changed files with 18 additions and 16 deletions.
4 changes: 2 additions & 2 deletions src/elm/Components/Builds.elm
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ view shared props =
, code [] [ text ".vela.yml" ]
, text " file that describes your build pipeline in the root of your repository."
, br [] []
, a [ href "https://go-vela.github.io/docs/usage/" ] [ text "Review the documentation" ]
, a [ href <| shared.velaDocsURL ++ "/usage/" ] [ text "Review the documentation" ]
, text " for help or "
, a [ href "https://go-vela.github.io/docs/usage/examples/" ] [ text "check some of the pipeline examples" ]
, a [ href <| shared.velaDocsURL ++ "/usage/examples/" ] [ text "check some of the pipeline examples" ]
, text "."
]
, li []
Expand Down
6 changes: 3 additions & 3 deletions src/elm/Components/ScheduleForm.elm
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,12 @@ viewEnabledInput { msg, value, disabled_ } =
]


viewHelp : Html msg
viewHelp =
viewHelp : String -> Html msg
viewHelp docsUrl =
div [ class "help" ]
[ text "Need help? Visit our "
, a
[ href "https://go-vela.github.io/docs/tour/schedules/"
[ href "/usage/schedule_build/"
, target "_blank"
]
[ text "docs" ]
Expand Down
6 changes: 3 additions & 3 deletions src/elm/Components/SecretForm.elm
Original file line number Diff line number Diff line change
Expand Up @@ -252,12 +252,12 @@ viewAllowCommandsInput { msg, value, disabled_ } =
]


viewHelp : Html msg
viewHelp =
viewHelp : String -> Html msg
viewHelp docsUrl =
div [ class "help" ]
[ text "Need help? Visit our "
, a
[ href "https://go-vela.github.io/docs/tour/secrets/"
[ href <| docsUrl ++ "/usage/secrets/"
, target "_blank"
]
[ text "docs" ]
Expand Down
2 changes: 1 addition & 1 deletion src/elm/Pages/Org_/Repo_/Deployments/Add.elm
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ view shared route model =
, div [ class "help" ]
[ text "Need help? Visit our "
, Html.a
[ Html.Attributes.href "https://go-vela.github.io/docs/usage/deployments/"
[ Html.Attributes.href <| shared.velaDocsURL ++ "/usage/deployments/"
, Html.Attributes.target "_blank"
]
[ text "docs" ]
Expand Down
2 changes: 1 addition & 1 deletion src/elm/Pages/Org_/Repo_/Schedules/Add.elm
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ view shared route model =
, msg = BranchOnInput
, disabled_ = False
}
, Components.ScheduleForm.viewHelp
, Components.ScheduleForm.viewHelp shared.velaDocsURL
, Components.ScheduleForm.viewSubmitButton
{ msg = SubmitForm
, disabled_ = False
Expand Down
2 changes: 1 addition & 1 deletion src/elm/Pages/Org_/Repo_/Schedules/Edit_.elm
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ view shared route model =
, msg = BranchOnInput
, disabled_ = not <| RemoteData.isSuccess model.schedule
}
, Components.ScheduleForm.viewHelp
, Components.ScheduleForm.viewHelp shared.velaDocsURL
, Components.ScheduleForm.viewSubmitButton
{ msg = SubmitForm
, disabled_ = not <| RemoteData.isSuccess model.schedule
Expand Down
2 changes: 1 addition & 1 deletion src/elm/Pages/Org_/Repo_/Secrets/Add.elm
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ view shared route model =
, value = model.allowCommands
, disabled_ = False
}
, Components.SecretForm.viewHelp
, Components.SecretForm.viewHelp shared.velaDocsURL
, Components.SecretForm.viewSubmitButton
{ msg = SubmitForm
, disabled_ = False
Expand Down
2 changes: 1 addition & 1 deletion src/elm/Pages/Org_/Repo_/Secrets/Edit_.elm
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ view shared route model =
, value = model.allowCommands
, disabled_ = not <| RemoteData.isSuccess model.secret
}
, Components.SecretForm.viewHelp
, Components.SecretForm.viewHelp shared.velaDocsURL
, Components.SecretForm.viewSubmitButton
{ msg = SubmitForm
, disabled_ = not <| RemoteData.isSuccess model.secret
Expand Down
4 changes: 3 additions & 1 deletion src/elm/Pages/Org_/Repo_/Settings.elm
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,9 @@ viewBadge shared repo velaURL copyMsg =
]
, small []
[ text "To customize branch, "
, a [ href "https://go-vela.github.io/docs/usage/badge/" ] [ text "see our Badges documentation" ]
, a [ href <| shared.velaDocsURL ++ "/usage/badge/" ]
[ text "see our Badges documentation"
]
, text "."
]
]
Expand Down
2 changes: 1 addition & 1 deletion src/elm/Pages/Org_/Secrets/Add.elm
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ view shared route model =
, value = model.allowCommands
, disabled_ = False
}
, Components.SecretForm.viewHelp
, Components.SecretForm.viewHelp shared.velaDocsURL
, Components.SecretForm.viewSubmitButton
{ msg = SubmitForm
, disabled_ = False
Expand Down
2 changes: 1 addition & 1 deletion src/elm/Pages/Org_/Secrets/Edit_.elm
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ view shared route model =
, value = model.allowCommands
, disabled_ = not <| RemoteData.isSuccess model.secret
}
, Components.SecretForm.viewHelp
, Components.SecretForm.viewHelp shared.velaDocsURL
, Components.SecretForm.viewSubmitButton
{ msg = SubmitForm
, disabled_ = not <| RemoteData.isSuccess model.secret
Expand Down

0 comments on commit 3953b61

Please sign in to comment.