Skip to content

Commit

Permalink
adjust
Browse files Browse the repository at this point in the history
  • Loading branch information
ecrupper committed Jan 15, 2025
1 parent b48d08a commit 406fe8e
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 9 deletions.
8 changes: 7 additions & 1 deletion cypress/integration/deployment.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,13 @@ context('Deployment', () => {
cy.login('/github/octocat/deployments');
cy.get('[data-test=cell-list-item-parameters]')
.should('exist')
.contains('DEPLOYMENT_PARAMETER_FOO=bar');
.contains('foo=bar');
});
it('deployments table should list parameters copy text', () => {
cy.login('/github/octocat/deployments');
cy.get('[data-test=copy-parameter-foo]')
.should('exist')
.contains('$DEPLOYMENT_PARAMETER_FOO');
});
});
});
41 changes: 33 additions & 8 deletions src/elm/Pages/Org_/Repo_/Deployments/Add.elm
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ import Components.Loading as Loading
import Components.Nav
import Dict exposing (Dict, empty)
import Effect exposing (Effect)
import FeatherIcons
import Html exposing (a, button, code, div, em, h2, label, main_, p, section, small, span, strong, text)
import Html.Attributes exposing (class, disabled, for, href, id)
import Html.Attributes exposing (attribute, class, disabled, for, href, id)
import Html.Events exposing (onClick)
import Http
import Http.Detailed
Expand Down Expand Up @@ -582,14 +583,38 @@ view shared route model =
if List.length model.parameters > 0 then
let
viewParameter parameter =
div [ class "parameter", class "chevron" ]
[ div [ class "name" ] [ text ("DEPLOYMENT_PARAMETER_" ++ (String.toUpper parameter.key) ++ "=" ++ parameter.value) ]
, button
[ class "button"
, class "-outline"
, onClick <| RemoveParameter parameter
div [ class "set-parameter" ]
[ div [ class "parameter", class "chevron" ]
[ div [ class "name" ] [ text (parameter.key ++ "=" ++ parameter.value) ]
, button
[ class "button"
, class "-outline"
, onClick <| RemoveParameter parameter
]
[ text "remove"
]
]
[ text "remove"
, div [ class "small no-wrap" ]
[ span
[ class "copy-text"
, Util.testAttribute ("copy-parameter-" ++ parameter.key)
]
[ text ("$DEPLOYMENT_PARAMETER_" ++ String.toUpper parameter.key) ]
, div [ class "vert-icon-container" ]
[ button
[ class "copy-button"
, class "button"
, class "-icon"
, class "-white"
, attribute "data-clipboard-text" ("$DEPLOYMENT_PARAMETER_" ++ String.toUpper parameter.key)
, attribute "aria-label" "copy token"
, Util.testAttribute "copy-token"
]
[ FeatherIcons.copy
|> FeatherIcons.withSize 18
|> FeatherIcons.toHtml []
]
]
]
]
in
Expand Down
37 changes: 37 additions & 0 deletions src/scss/_main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1650,6 +1650,11 @@ details.build-toggle {
align-items: flex-start;
}

.set-parameter {
display: flex;
align-items: center;
}

.image,
.parameter {
position: relative;
Expand Down Expand Up @@ -1871,3 +1876,35 @@ select {
.custom-select-container .custom-select-options:not(.hidden) {
display: block;
}

.small.no-wrap {
display: flex;
align-items: center;

font-size: 0.8em;
white-space: nowrap;
}

.copy-text {
margin-right: 5px;
margin-left: 5px;

font-weight: bold;
font-family: monospace;

background-color: var(--color-bg-dark);
}

.copy-button {
margin-left: 5px;
padding: 0;

background: none;
border: none;
cursor: pointer;
}

.copy-icon {
font-size: 0.8em;
/* Add additional styling for the icon if needed */
}

0 comments on commit 406fe8e

Please sign in to comment.