Skip to content

Commit

Permalink
Merge branch 'stable' into stable-sms
Browse files Browse the repository at this point in the history
  • Loading branch information
thorsteneckel committed Oct 10, 2018
2 parents c6effcc + df40211 commit 38f7e63
Show file tree
Hide file tree
Showing 102 changed files with 28,154 additions and 498 deletions.
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Expand Up @@ -32,7 +32,7 @@ pre:bundle-audit:
script:
- gem install bundler-audit
- bundle-audit update
- bundle-audit --ignore CVE-2018-1000544
- bundle-audit

pre:github:
stage: pre
Expand Down
4 changes: 4 additions & 0 deletions Gemfile
Expand Up @@ -166,6 +166,10 @@ group :development, :test do

# mock http calls
gem 'webmock'

# record and replay TCP/HTTP transactions
gem 'tcr'
gem 'vcr'
end

# Want to extend Zammad with additional gems?
Expand Down
34 changes: 19 additions & 15 deletions Gemfile.lock
Expand Up @@ -240,7 +240,7 @@ GEM
net-ldap (0.16.1)
netrc (0.11.0)
nio4r (2.3.0)
nokogiri (1.8.4)
nokogiri (1.8.5)
mini_portile2 (~> 2.3.0)
nori (2.6.0)
notiffany (0.1.1)
Expand Down Expand Up @@ -317,7 +317,7 @@ GEM
rack (2.0.5)
rack-livereload (0.3.16)
rack
rack-test (1.0.0)
rack-test (1.1.0)
rack (>= 1.0, < 3)
rails (5.1.5)
actioncable (= 5.1.5)
Expand Down Expand Up @@ -357,23 +357,23 @@ GEM
mime-types (>= 1.16, < 4.0)
netrc (~> 0.8)
retriable (2.1.0)
rspec-core (3.7.0)
rspec-support (~> 3.7.0)
rspec-expectations (3.7.0)
rspec-core (3.8.0)
rspec-support (~> 3.8.0)
rspec-expectations (3.8.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.7.0)
rspec-mocks (3.7.0)
rspec-support (~> 3.8.0)
rspec-mocks (3.8.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.7.0)
rspec-rails (3.7.2)
rspec-support (~> 3.8.0)
rspec-rails (3.8.0)
actionpack (>= 3.0)
activesupport (>= 3.0)
railties (>= 3.0)
rspec-core (~> 3.7.0)
rspec-expectations (~> 3.7.0)
rspec-mocks (~> 3.7.0)
rspec-support (~> 3.7.0)
rspec-support (3.7.0)
rspec-core (~> 3.8.0)
rspec-expectations (~> 3.8.0)
rspec-mocks (~> 3.8.0)
rspec-support (~> 3.8.0)
rspec-support (3.8.0)
rubocop (0.54.0)
parallel (~> 1.10)
parser (>= 2.5)
Expand All @@ -383,7 +383,7 @@ GEM
unicode-display_width (~> 1.0, >= 1.0.1)
ruby-progressbar (1.9.0)
ruby_dep (1.5.0)
rubyzip (1.2.1)
rubyzip (1.2.2)
safe_yaml (1.0.4)
sass (3.5.3)
sass-listen (~> 4.0.0)
Expand Down Expand Up @@ -421,6 +421,7 @@ GEM
activesupport (>= 4.0)
sprockets (>= 3.0.0)
sqlite3 (1.3.13)
tcr (0.2.0)
telegramAPI (1.4.2)
rest-client (~> 2.0, >= 2.0.2)
telephone_number (1.3.0)
Expand Down Expand Up @@ -464,6 +465,7 @@ GEM
valid_email2 (2.1.0)
activemodel (>= 3.2)
mail (~> 2.5)
vcr (4.0.0)
viewpoint (1.1.0)
httpclient
logging
Expand Down Expand Up @@ -559,6 +561,7 @@ DEPENDENCIES
slack-notifier
sprockets
sqlite3
tcr
telegramAPI
telephone_number
test-unit
Expand All @@ -568,6 +571,7 @@ DEPENDENCIES
uglifier
unicorn
valid_email2
vcr
viewpoint
webmock
writeexcel
Expand Down
Expand Up @@ -37,6 +37,7 @@ class App.UiElement.datetime extends App.UiElement.basedate
@buildTimestamp: (currentInput) ->
timestamp = "#{currentInput[0]}T#{currentInput[1]}:00.000Z"
time = new Date( Date.parse(timestamp) )
return '' if isNaN time
time.setMinutes( time.getMinutes() + time.getTimezoneOffset() )
@log 'setNewTime', time.toString()
time.toISOString().replace(/\d\d\.\d\d\dZ$/, '00.000Z')
Expand Down
23 changes: 17 additions & 6 deletions app/assets/javascripts/app/controllers/ticket_overview.coffee
Expand Up @@ -1094,11 +1094,11 @@ class Table extends App.Controller
id: object.organization_id
value
callbackCheckbox = (id, checked, e) =>
if @$('table').find('input[name="bulk"]:checked').length == 0
@bulkForm.hide()
else
if @shouldShowBulkForm()
@bulkForm.render()
@bulkForm.show()
else
@bulkForm.hide()

if @lastChecked && e.shiftKey
# check items in a row
Expand Down Expand Up @@ -1192,11 +1192,11 @@ class Table extends App.Controller

# show/hide bulk action
@$('.table-overview').delegate('input[name="bulk"], input[name="bulk_all"]', 'change', (e) =>
if @$('.table-overview').find('input[name="bulk"]:checked').length == 0
if @shouldShowBulkForm()
@bulkForm.show()
else
@bulkForm.hide()
@bulkForm.reset()
else
@bulkForm.show()
)

# deselect bulk_all if one item is uncheck observ
Expand All @@ -1216,6 +1216,17 @@ class Table extends App.Controller
bulkAll.prop('indeterminate', true)
)

shouldShowBulkForm: =>
items = @$('table').find('input[name="bulk"]:checked')
return false if items.length == 0

ticket_ids = _.map(items, (el) -> $(el).val() )
ticket_group_ids = _.map(App.Ticket.findAll(ticket_ids), (ticket) -> ticket.group_id)
ticket_group_ids = _.uniq(ticket_group_ids)
user_permissions = App.Session.get('group_ids')
group_permissions = ticket_group_ids.map (id) -> user_permissions[id]
_.every(group_permissions, (list) -> 'full' in list || 'change' in list)

viewmode: (e) =>
e.preventDefault()
@view_mode = $(e.target).data('mode')
Expand Down
Expand Up @@ -26,10 +26,10 @@ class App.WidgetOrganization extends App.Controller
name = nameNew

# add to show if value exists
if ( organization[name] || attributeConfig.tag is 'richtext' ) && attributeConfig.shown
if ( organization[name]? || attributeConfig.tag is 'richtext' ) && attributeConfig.shown

# do not show firstname and lastname / already show via diplayName()
if name isnt 'name'
if name isnt 'name' && organization[name] isnt ''
organizationData.push attributeConfig

# insert userData
Expand Down
4 changes: 2 additions & 2 deletions app/assets/javascripts/app/controllers/widget/user.coffee
Expand Up @@ -28,10 +28,10 @@ class App.WidgetUser extends App.Controller
name = nameNew

# add to show if value exists
if ( user[name] || attributeConfig.tag is 'richtext' ) && attributeConfig.shown
if ( user[name]? || attributeConfig.tag is 'richtext' ) && attributeConfig.shown

# do not show firstname and lastname / already show via displayName()
if name isnt 'firstname' && name isnt 'lastname' && name isnt 'organization'
if name isnt 'firstname' && name isnt 'lastname' && name isnt 'organization' && user[name] isnt ''
userData.push attributeConfig

if user.preferences
Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/app/models/overview.coffee
@@ -1,5 +1,5 @@
class App.Overview extends App.Model
@configure 'Overview', 'name', 'prio', 'condition', 'order', 'group_by', 'group_direction', 'view', 'user_ids', 'organization_shared', 'role_ids', 'active'
@configure 'Overview', 'name', 'prio', 'condition', 'order', 'group_by', 'group_direction', 'view', 'user_ids', 'organization_shared', 'out_of_office', 'role_ids', 'active'
@extend Spine.Model.Ajax
@url: @apiPath + '/overviews'
@configure_attributes = [
Expand Down
Expand Up @@ -8,7 +8,7 @@
</div>

<% for row in @organizationData: %>
<% if @organization[row.name] || row.name is 'note': %>
<% if @organization[row.name]? || row.name is 'note': %>
<div class="sidebar-block">
<% if row.tag isnt 'richtext': %>
<label><%- @T(row.display) %></label>
Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/app/views/widget/user.jst.eco
Expand Up @@ -3,7 +3,7 @@
<h3 title="<%- @Ti('Name') %>"><%= @user.displayName() %></h3>
</div>
<% for row in @userData: %>
<% if @user[row.name] || row.name is 'note': %>
<% if @user[row.name]? || row.name is 'note': %>
<div class="sidebar-block">
<label><%- @T(row.display) %></label>
<% if row.tag isnt 'richtext': %>
Expand Down
105 changes: 102 additions & 3 deletions app/assets/stylesheets/print.scss
Expand Up @@ -11,6 +11,29 @@
border-bottom: 1px solid hsl(0,0%,90%);
}

html {
height: auto;
}

body,
.content {
background: none;
color: black;
}

// Disable flex to allow multi page prints in Firefox: https://bugzilla.mozilla.org/show_bug.cgi?id=939897
body,
#app,
#app > .content.active,
.tabsSidebar-holder,
main {
display: block;
}

#app {
min-width: 0;
}

/*
Dashboard
Expand Down Expand Up @@ -54,9 +77,85 @@
}

.tabsSidebar-sidebarSpacer {
margin-right: 0;
margin: 0;
transition: none;
}

.article-meta .article-meta-key {
display: none;
.textBubble-content {
height: auto !important;
}

.tabsSidebar-tabsSpacer {
padding: 0 !important;
overflow: visible;
}

.ticket-article,
.article-new {
max-width: none;
padding-left: 0;
padding-right: 0;
}

.ticketZoom {
background: none;
}

.textBubble {
padding: 20px;
border: 1px solid !important;
background: white !important;
}

.bubble-arrow:after {
background: white !important;
border-color: black !important;
}

.article-meta {
color: black;
background: none;
border: 1px dashed hsl(240,2%,60%);
padding: 11px 10px 1px;

&.top {
border-bottom-width: 0;
}

&.bottom {
border-top-width: 0;
padding-top: 7px;
padding-bottom: 3px;
}

&-clip {
height: auto !important;
}

&-icon {
fill: currentColor;
}
}

.article-content {
color: inherit;

a[href]:after {
content: none !important;
}
}

.article-content-meta {
opacity: 1 !important;
display: block !important;
transform: none !important;
position: static;
}

.attachments.attachments--list {
border-color: currentColor !important;
}

.avatar {
border: 1px solid black;
}
2 changes: 1 addition & 1 deletion app/controllers/time_accountings_controller.rb
Expand Up @@ -46,7 +46,7 @@ def by_ticket
end
end
end
if !customers[local_time_unit[:agent_id]]
if !agents[local_time_unit[:agent_id]]
agent_user = User.lookup(id: local_time_unit[:agent_id])
agent = '-'
if agent_user
Expand Down
2 changes: 1 addition & 1 deletion app/models/channel/driver/twitter.rb
Expand Up @@ -134,7 +134,7 @@ def disconnect
=end

def self.streamable?
true
false
end

=begin
Expand Down

0 comments on commit 38f7e63

Please sign in to comment.