update dashboard row inactive states
This commit is contained in:
parent
c2c8feb1f9
commit
0fb840a479
|
@ -5,7 +5,7 @@ import { hasAdminPermission, hasPushPermission } from 'travis/utils/permission';
|
||||||
|
|
||||||
export default Ember.Component.extend({
|
export default Ember.Component.extend({
|
||||||
tagName: 'li',
|
tagName: 'li',
|
||||||
classNameBindings: ['repo.default_branch.last_build.state'],
|
classNameBindings: ['repo.default_branch.last_build.state', 'repo.active:is-active'],
|
||||||
classNames: ['rows', 'rows--dashboard'],
|
classNames: ['rows', 'rows--dashboard'],
|
||||||
isLoading: false,
|
isLoading: false,
|
||||||
isTriggering: false,
|
isTriggering: false,
|
||||||
|
|
|
@ -28,6 +28,7 @@ export default Ember.Controller.extend({
|
||||||
return item.slug.match(new RegExp(filter));
|
return item.slug.match(new RegExp(filter));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
this.inactive();
|
||||||
}.property('filter', 'model', 'org'),
|
}.property('filter', 'model', 'org'),
|
||||||
|
|
||||||
updateFilter() {
|
updateFilter() {
|
||||||
|
|
|
@ -12,7 +12,7 @@ export default TravisRoute.extend({
|
||||||
model() {
|
model() {
|
||||||
var apiEndpoint;
|
var apiEndpoint;
|
||||||
apiEndpoint = config.apiEndpoint;
|
apiEndpoint = config.apiEndpoint;
|
||||||
return $.ajax(apiEndpoint + '/v3/repos?repository.active=true&include=repository.default_branch,build.commit', {
|
return $.ajax(apiEndpoint + '/v3/repos?repository.active=false&include=repository.default_branch,build.commit', {
|
||||||
headers: {
|
headers: {
|
||||||
Authorization: 'token ' + this.auth.token()
|
Authorization: 'token ' + this.auth.token()
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,6 +47,7 @@
|
||||||
fill: $canary-yellow
|
fill: $canary-yellow
|
||||||
|
|
||||||
.dash-header
|
.dash-header
|
||||||
|
position: relative
|
||||||
order: 2
|
order: 2
|
||||||
flex: 0 0 20%
|
flex: 0 0 20%
|
||||||
|
|
||||||
|
@ -102,9 +103,9 @@
|
||||||
.dash-last-build
|
.dash-last-build
|
||||||
display: flex
|
display: flex
|
||||||
order: 4
|
order: 4
|
||||||
flex: 0 0 55%
|
flex: 1 0 30%
|
||||||
flex-flow: row nowrap
|
flex-flow: row nowrap
|
||||||
justify-content: space-between
|
justify-content: flex-start
|
||||||
|
|
||||||
@media #{$small-only}
|
@media #{$small-only}
|
||||||
margin-top: 2em
|
margin-top: 2em
|
||||||
|
@ -114,3 +115,17 @@
|
||||||
|
|
||||||
> div
|
> div
|
||||||
flex: 0 0 33%
|
flex: 0 0 33%
|
||||||
|
|
||||||
|
.dash-button
|
||||||
|
order: 5
|
||||||
|
|
||||||
|
.activate-repo-button
|
||||||
|
@extend %button
|
||||||
|
background-color: $pebble-grey
|
||||||
|
color: $cement-grey
|
||||||
|
font-size: 14px
|
||||||
|
cursor: default
|
||||||
|
&.is-active:hover
|
||||||
|
background-color: $turf-green
|
||||||
|
color: white
|
||||||
|
cursor: pointer
|
||||||
|
|
|
@ -16,8 +16,9 @@
|
||||||
display: flex
|
display: flex
|
||||||
flex-flow: column wrap
|
flex-flow: column wrap
|
||||||
margin-bottom: 1rem
|
margin-bottom: 1rem
|
||||||
@each $key, $value in $stateMap
|
&.is-active
|
||||||
+rowColor(#{$key}, map-get($value, color))
|
@each $key, $value in $stateMap
|
||||||
|
+rowColor(#{$key}, map-get($value, color))
|
||||||
|
|
||||||
@media #{$medium-up}
|
@media #{$medium-up}
|
||||||
position: relative
|
position: relative
|
||||||
|
|
|
@ -123,3 +123,51 @@
|
||||||
white-space: normal
|
white-space: normal
|
||||||
&:before
|
&:before
|
||||||
right: .8em
|
right: .8em
|
||||||
|
|
||||||
|
|
||||||
|
// trying to rewrite
|
||||||
|
|
||||||
|
$tooltip-spacing: 4em
|
||||||
|
$tooltip-arrow-width: 1em
|
||||||
|
|
||||||
|
[data-tooltip]
|
||||||
|
position: relative
|
||||||
|
background-color: pink
|
||||||
|
&:after
|
||||||
|
content: attr(data-tooltip)
|
||||||
|
display: block
|
||||||
|
position: absolute
|
||||||
|
background: $asphalt-grey
|
||||||
|
padding: 0.5em
|
||||||
|
color: white
|
||||||
|
border-radius: 2px
|
||||||
|
bottom: $tooltip-spacing
|
||||||
|
left: 0
|
||||||
|
right: 0
|
||||||
|
white-space: normal
|
||||||
|
margin: auto
|
||||||
|
font-size: 12px
|
||||||
|
&:before
|
||||||
|
content: ""
|
||||||
|
display: block
|
||||||
|
width: $tooltip-arrow-width
|
||||||
|
height: $tooltip-arrow-width
|
||||||
|
transform: rotate(45deg)
|
||||||
|
position: absolute
|
||||||
|
left: 0
|
||||||
|
right: 0
|
||||||
|
bottom: $tooltip-spacing - $tooltip-arrow-width
|
||||||
|
margin: auto
|
||||||
|
background-color: $asphalt-grey
|
||||||
|
|
||||||
|
&:after,
|
||||||
|
&:before
|
||||||
|
display: none
|
||||||
|
|
||||||
|
&:hover,
|
||||||
|
&:active
|
||||||
|
&:after,
|
||||||
|
&:before
|
||||||
|
display: block
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -24,12 +24,14 @@
|
||||||
<p class="row-content color">
|
<p class="row-content color">
|
||||||
{{request-icon event=repo.default_branch.last_build.event_type state=repo.default_branch.last_build.state}}
|
{{request-icon event=repo.default_branch.last_build.event_type state=repo.default_branch.last_build.state}}
|
||||||
{{repo.default_branch.name}}
|
{{repo.default_branch.name}}
|
||||||
{{#if repo.default_branch.last_build.state}}is {{repo.default_branch.last_build.state}}{{/if}}
|
{{#if repo.active}}is {{repo.default_branch.last_build.state}}{{/if}}
|
||||||
</p>
|
</p>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
{{#if repo.default_branch.last_build}}
|
{{#if repo.default_branch.last_build}}
|
||||||
<section class="dash-last-build">
|
<section class="dash-last-build">
|
||||||
|
|
||||||
|
{{#if repo.active}}
|
||||||
<div>
|
<div>
|
||||||
<h3 class="label">Last build</h3>
|
<h3 class="label">Last build</h3>
|
||||||
<p class="row-content color">
|
<p class="row-content color">
|
||||||
|
@ -39,6 +41,8 @@
|
||||||
{{/link-to}}
|
{{/link-to}}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<h3 class="label">Last commit</h3>
|
<h3 class="label">Last commit</h3>
|
||||||
<p class="row-content">
|
<p class="row-content">
|
||||||
|
@ -63,8 +67,10 @@
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
|
|
||||||
|
{{#if repo.active}}
|
||||||
{{#if displayMenuTofu}}
|
{{#if displayMenuTofu}}
|
||||||
<div class="dash-menu">
|
<div class="dash-menu">
|
||||||
<div class="dropup {{if dropupIsOpen "is-open"}}">
|
<div class="dropup {{if dropupIsOpen "is-open"}}">
|
||||||
|
@ -87,11 +93,22 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
{{else}}
|
||||||
|
<div class="dash-button">
|
||||||
|
{{#unless displayActivateLink}}
|
||||||
|
<button type="button" class="activate-repo-button is-active" {{action 'activateRepo'}}>Activate repository</button>
|
||||||
|
{{else}}
|
||||||
|
<p class="activate-repo-button" data-tooltip="You need admin rights to activate a repository">Actiavte repository</p>
|
||||||
|
{{/unless}}
|
||||||
|
</div>
|
||||||
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<aside class="dash-aside">
|
{{#if repo.active}}
|
||||||
<ul class="lastbuilds">
|
<aside class="dash-aside">
|
||||||
{{lastbuild-tile repo=repo build=repo.default_branch.last_build}}
|
<ul class="lastbuilds">
|
||||||
</ul>
|
{{lastbuild-tile repo=repo build=repo.default_branch.last_build}}
|
||||||
</aside>
|
</ul>
|
||||||
|
</aside>
|
||||||
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user