Skip to content

Commit

Permalink
fix(filter): change pull -> pull_request (#112)
Browse files Browse the repository at this point in the history
Co-authored-by: Jordan Brockopp <[email protected]>
  • Loading branch information
wass3r and jbrockopp authored Feb 18, 2020
1 parent c8db7bf commit c31a3a3
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 17 deletions.
4 changes: 2 additions & 2 deletions cypress/fixtures/builds_pull.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"repo_id": 1,
"number": 2,
"parent": 1,
"event": "pull",
"event": "pull_request",
"status": "success",
"error": "unable to retrieve repo secret docker_username: unable to get secret repo/vela/ui/docker_username from native service: record not found",
"enqueued": 1572980376,
Expand All @@ -31,7 +31,7 @@
"repo_id": 1,
"number": 3,
"parent": 1,
"event": "pull",
"event": "pull_request",
"status": "failure",
"error": "unable to retrieve repo secret docker_username: unable to get secret repo/vela/ui/docker_username from native service: record not found",
"enqueued": 1572980376,
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/builds.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ context('Builds', () => {
});

it('should only show two pull events', () => {
cy.get('[data-test=build-filter-pull]').click({ force: true });
cy.get('[data-test=build-filter-pull_request]').click({ force: true });
cy.get('[data-test=build]')
.should('be.visible')
.should('have.length', 2);
Expand Down
10 changes: 2 additions & 8 deletions src/elm/Main.elm
Original file line number Diff line number Diff line change
Expand Up @@ -1440,7 +1440,7 @@ viewBuildsFilter shouldRender org repo maybeEvent =
let
eventEnum : List String
eventEnum =
[ "all", "push", "pull", "tag", "deploy" ]
[ "all", "push", "pull_request", "tag", "deploy" ]

eventToMaybe : String -> Maybe Event
eventToMaybe event =
Expand Down Expand Up @@ -1471,13 +1471,7 @@ viewBuildsFilter shouldRender org repo maybeEvent =
[ class "form-label"
, for <| "filter-" ++ e
]
[ text <|
if e == "pull" then
"pull request"

else
e
]
[ text <| String.replace "_" " " e ]
]
)
eventEnum
Expand Down
6 changes: 1 addition & 5 deletions src/elm/Pages/Build.elm
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,7 @@ viewPreview now org repo build =
[ buildStatusToIcon build.status ]

commit =
[ if build.event == "pull" then
text "pull request"

else
text build.event
[ text <| String.replace "_" " " build.event
, text " ("
, a [ href build.source ] [ text <| trimCommitHash build.commit ]
, text <| ")"
Expand Down
2 changes: 1 addition & 1 deletion src/scss/_main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1319,7 +1319,7 @@ nav {
// TODO: revisit the following
.form-control .form-label::before,
.form-control .form-label::after {
top: auto;
top: 2px;
}

@media only screen and (max-width: 40em) {
Expand Down

0 comments on commit c31a3a3

Please sign in to comment.