Add a better error message

This commit is contained in:
Piotr Sarnacki 2015-04-22 16:51:41 +02:00
parent c76d4de614
commit f9563187d3
3 changed files with 18 additions and 6 deletions

View File

@ -1,14 +1,18 @@
`import Ember from 'ember'` `import Ember from 'ember'`
`import config from 'travis/config/environment'`
HooksListItemComponent = Ember.Component.extend HooksListItemComponent = Ember.Component.extend
tagName: 'li' tagName: 'li'
classNames: ['row'] classNames: ['row']
classNameBindings: ['hook.active:active'] classNameBindings: ['hook.active:active']
githubOrgsOauthAccessSettingsUrl: config.githubOrgsOauthAccessSettingsUrl
actions: actions:
handleToggleError: -> handleToggleError: ->
@set("errorMessage", "There was an error") @set("showError", true)
close: -> close: ->
@set("errorMessage", null) @set("showError", false)
`export default HooksListItemComponent` `export default HooksListItemComponent`

View File

@ -201,7 +201,7 @@ p.profile-user-last
padding: 0 $column-gutter/2; padding: 0 $column-gutter/2;
p p
position: relative position: relative
padding: $column-gutter/2; padding: $column-gutter/2 $column-gutter*2 $column-gutter/2 $column-gutter/2;
color: #de4248 color: #de4248
background-color: #f1b6ad background-color: #f1b6ad
&:after &:after

View File

@ -11,10 +11,18 @@
{{hook.slug}} {{hook.slug}}
<span>{{hook.description}}</span></a> <span>{{hook.description}}</span></a>
{{#if errorMessage}} {{#if showError}}
<div class="error"> <div class="error">
<p> <p>
{{errorMessage}} An error happened when we tried to alter settings on GitHub.
<a class="close" {{action "close" target=view}}></a></p> {{#if githubOrgsOauthAccessSettingsUrl}}
It may be caused by API restrictions, please
<a {{bind-attr href="githubOrgsOauthAccessSettingsUrl"}}
title="Orgs Oauth Access Settings on GitHub">
review and add
</a> your authorized Orgs.
{{/if}}
<a class="close" {{action "close" target=view}}></a>
</p>
</div> </div>
{{/if}} {{/if}}