Cleanup, fixed typos and improved error handling.

This commit is contained in:
Martin Edenhofer 2016-12-13 14:58:13 +01:00
parent d6ee7025ab
commit a0caaa06e9
12 changed files with 20 additions and 14 deletions

View file

@ -23,9 +23,7 @@ class Index extends App.ControllerSubContent
url: "#{@apiPath}/monitoring/health_check"
success: (data) =>
@stopLoading()
console.log('111', data, @data)
return if @data && data.token is @data.token && data.healthy is @data.healthy && data.message is @data.message
console.log('222')
@data = data
@render()
)

View file

@ -1,4 +1,4 @@
<form>
<form autocomplete="off">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">

View file

@ -77,12 +77,12 @@
</div>
<div class="action-controls">
<% if !calendar.default: %>
<div class="sla-toggle btn btn--danger btn--secondary js-delete"><%- @T('Delete') %></div>
<div class="sla-toggle btn btn--secondary js-default"><%- @T('Set as Default') %></div>
<div class="btn btn--danger btn--secondary js-delete"><%- @T('Delete') %></div>
<div class="btn btn--secondary js-default"><%- @T('Set as Default') %></div>
<% else: %>
<div class="btn btn--danger btn--secondary is-disabled"><%- @T('Delete') %></div>
<% end %>
<div class="sla-edit btn js-edit"><%- @T('Edit') %></div>
<div class="btn js-edit"><%- @T('Edit') %></div>
</div>
</div>
<% end %>

View file

@ -7,7 +7,7 @@
</div>
<div class="page-content">
<form role="form" class="ticket-create">
<form role="form" class="ticket-create" autocomplete="off">
<input type="hidden" name="form_id" value="<%= @form_id %>"/>
<div class="ticket-form-top"></div>

View file

@ -1,5 +1,5 @@
<div class="modal-dialog">
<form>
<form autocomplete="off">
<div class="modal-content">
<div class="modal-header">
<% if @buttonClose: %>

View file

@ -68,7 +68,7 @@ returns calendar object
=begin
returnes preset of ical feeds
returns preset of ical feeds
feeds = Calendar.ical_feeds

View file

@ -61,7 +61,9 @@ returns
items = SearchIndexBackend.search(query, limit, 'Organization')
organizations = []
items.each { |item|
organizations.push Organization.lookup(id: item[:id])
organization = Organization.lookup(id: item[:id])
next if !organization
organizations.push organization
}
return organizations
end

View file

@ -11,7 +11,7 @@ class Permission < ApplicationModel
permissions = Permission.with_parents('some_key.sub_key')
returnes
returns
['some_key.sub_key', 'some_key']

View file

@ -143,7 +143,9 @@ returns
end
tickets = []
items.each { |item|
tickets.push Ticket.lookup(id: item[:id])
ticket = Ticket.lookup(id: item[:id])
next if !ticket
tickets.push ticket
}
return tickets
end

View file

@ -61,7 +61,9 @@ returns
items = SearchIndexBackend.search(query, limit, 'User')
users = []
items.each { |item|
users.push User.lookup(id: item[:id])
user = User.lookup(id: item[:id])
next if !user
users.push user
}
return users
end

View file

@ -55,7 +55,7 @@ types:
restart_auto -> app is restarting
config_changed -> config has changed
returnes
returns
{
event: 'maintenance'

View file

@ -4,6 +4,8 @@ require 'test_helper'
class EmailProcessTest < ActiveSupport::TestCase
test 'process simple' do
Ticket.destroy_all
files = [
{
data: 'From: me@example.com