This repository has been archived by the owner on Mar 24, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dashboard: update multi-pipeline top bar
concourse/concourse#1623 Signed-off-by: Gabriel Dumitrescu <gdumitrescu@pivotal.io>
- Loading branch information
Showing
11 changed files
with
378 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,3 +32,5 @@ | |
|
||
@import "build.less"; | ||
@import "dashboard.less"; | ||
|
||
@import "newtopbar.less"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
// top bar | ||
|
||
.module-topbar { | ||
@base01: #000000; | ||
@base03: #333333; | ||
@base05: #6E6E6E; | ||
@base07: #FFFFFF; | ||
@base0D: #4A90E2; | ||
background: #333333; | ||
border-bottom: 1px solid black; | ||
color: #E6E7E8; | ||
display: flex; | ||
height: 55px; | ||
|
||
div { | ||
// border: 1px dotted lime; | ||
} | ||
|
||
.topbar-logo { | ||
flex-shrink: 1; | ||
flex-basis: 50%; | ||
.logo-image-link { | ||
background-image: url('images/concourse_logo_white.png'); | ||
background-size: 30px 30px; | ||
background-position: center center; | ||
background-repeat: no-repeat; | ||
display: inline-block; | ||
height: 55px; | ||
width: 55px; | ||
} | ||
} | ||
|
||
.topbar-search { | ||
text-align: center; | ||
|
||
.topbar-search-form { | ||
display: flex; | ||
margin: 0 auto; | ||
position: relative; | ||
transform: translateY(30%); | ||
|
||
.search-input-field { | ||
background: transparent url('images/ic_search_white_24px.svg') 10px 10px no-repeat; | ||
border: 1px solid @base05; | ||
color: @base07; | ||
font-family: monospace; | ||
font-size: 14px; | ||
height: 35px; | ||
max-width: 290px; | ||
padding: 0 35px 0 30px; | ||
&:focus { | ||
border: 1px solid @base0D; | ||
outline: 0; | ||
} | ||
} | ||
|
||
.search-clear-button { | ||
flex-grow: 1; | ||
background: transparent url('images/ic_close_white_24px.svg') 10px 12px no-repeat; | ||
border: 0; | ||
color: @base03; | ||
height: 24px; | ||
padding: 5px 10px; | ||
position: absolute; | ||
right: 10px; | ||
width: 24px; | ||
} | ||
} | ||
} | ||
|
||
.topbar-login { | ||
flex-shrink: 1; | ||
flex-basis: 50%; | ||
line-height: 55px; | ||
text-align: right; | ||
|
||
.topbar-user-info { | ||
border-left: 1px solid @base01; | ||
display: inline-block; | ||
padding: 0 35px; | ||
} | ||
} | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
module NewTopBar exposing (Model, Msg, init, update, view) | ||
|
||
import Concourse | ||
import Concourse.User | ||
import Html exposing (Html) | ||
import Html.Attributes exposing (class, href, src, type_, placeholder) | ||
import RemoteData exposing (RemoteData) | ||
|
||
|
||
type alias Model = | ||
{ user : RemoteData.WebData Concourse.User } | ||
|
||
|
||
type Msg | ||
= UserFetched (RemoteData.WebData Concourse.User) | ||
|
||
|
||
init : ( Model, Cmd Msg ) | ||
init = | ||
( { user = RemoteData.Loading }, fetchUser ) | ||
|
||
|
||
update : Msg -> Model -> ( Model, Cmd Msg ) | ||
update msg model = | ||
case msg of | ||
UserFetched response -> | ||
( { model | user = response }, Cmd.none ) | ||
|
||
|
||
showUserInfo : Model -> Html Msg | ||
showUserInfo model = | ||
case model.user of | ||
RemoteData.NotAsked -> | ||
Html.text "n/a" | ||
|
||
RemoteData.Loading -> | ||
Html.text "loading" | ||
|
||
RemoteData.Success user -> | ||
Html.text user.team.name | ||
|
||
RemoteData.Failure _ -> | ||
Html.text "log in" | ||
|
||
|
||
view : Model -> Html Msg | ||
view model = | ||
Html.div [ class "module-topbar" ] | ||
[ Html.div [ class "topbar-logo" ] [ Html.a [ class "logo-image-link", href "#" ] [] ] | ||
, Html.div [ class "topbar-search" ] | ||
[ Html.form [ class "topbar-search-form" ] | ||
[ Html.input [ class "search-input-field", type_ "text", placeholder "search" ] [] | ||
, Html.button [ class "search-clear-button" ] [] | ||
] | ||
] | ||
, Html.div [ class "topbar-login" ] | ||
[ Html.div [ class "topbar-user-info" ] | ||
[ showUserInfo model ] | ||
] | ||
] | ||
|
||
|
||
fetchUser : Cmd Msg | ||
fetchUser = | ||
Cmd.map UserFetched <| | ||
RemoteData.asCmd Concourse.User.fetchUser |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.