From 64da02366c72e741bb4fe437777950bce55f37c9 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Fri, 28 Aug 2015 16:50:40 +0200 Subject: [PATCH] Some small improvements to email channel management. --- .../app/controllers/_channel/email.js.coffee | 30 +++--- .../app/models/email_address.js.coffee | 2 +- .../channel/email_account_wizard.jst.eco | 99 +++++++++++++------ .../channel/email_notification_wizard.jst.eco | 43 +++++--- app/assets/stylesheets/zammad.css.scss | 3 + app/models/email_address.rb | 20 +++- 6 files changed, 140 insertions(+), 57 deletions(-) diff --git a/app/assets/javascripts/app/controllers/_channel/email.js.coffee b/app/assets/javascripts/app/controllers/_channel/email.js.coffee index 79553cf53..4ff00d118 100644 --- a/app/assets/javascripts/app/controllers/_channel/email.js.coffee +++ b/app/assets/javascripts/app/controllers/_channel/email.js.coffee @@ -11,16 +11,16 @@ class App.ChannelEmail extends App.ControllerTabs target: 'c-account', controller: App.ChannelEmailAccountOverview, }, - { - name: 'Signatures', - target: 'c-signature', - controller: App.ChannelEmailSignature, - }, { name: 'Filter', target: 'c-filter', controller: App.ChannelEmailFilter, }, + { + name: 'Signatures', + target: 'c-signature', + controller: App.ChannelEmailSignature, + }, { name: 'Settings', target: 'c-setting', @@ -354,6 +354,7 @@ class App.ChannelEmailAccountWizard extends App.Controller 'change .js-outbound [name=adapter]': 'toggleOutboundAdapter' 'submit .js-outbound': 'probleOutbound' 'click .js-back': 'goToSlide' + 'click .js-close': 'hide' constructor: -> super @@ -385,12 +386,10 @@ class App.ChannelEmailAccountWizard extends App.Controller backdrop: true container: @container .on - 'show.bs.modal': @onShow - 'shown.bs.modal': @onComplete 'hidden.bs.modal': => if @callback @callback() - $('.modal').remove() + @el.remove() if @slide @showSlide(@slide) @@ -418,7 +417,7 @@ class App.ChannelEmailAccountWizard extends App.Controller # inbound configureAttributesInbound = [ - { name: 'adapter', display: 'Type', tag: 'select', multiple: false, null: false, options: { imap: 'IMAP', pop3: 'POP3' } }, + { name: 'adapter', display: 'Type', tag: 'select', multiple: false, null: false, options: { imap: 'imap', pop3: 'pop3' } }, { name: 'options::host', display: 'Host', tag: 'input', type: 'text', limit: 120, null: false, autocapitalize: false }, { name: 'options::user', display: 'User', tag: 'input', type: 'text', limit: 120, null: false, autocapitalize: false }, { name: 'options::password', display: 'Password', tag: 'input', type: 'password', limit: 120, null: false, autocapitalize: false, single: true }, @@ -645,6 +644,10 @@ class App.ChannelEmailAccountWizard extends App.Controller @formEnable(e) @$('.wizard-controls .btn').attr('disabled', false) + hide: (e) => + e.preventDefault() + @el.modal('hide') + class App.ChannelEmailNotificationWizard extends App.Controller elements: '.modal-body': 'body' @@ -654,6 +657,7 @@ class App.ChannelEmailNotificationWizard extends App.Controller events: 'change .js-outbound [name=adapter]': 'toggleOutboundAdapter' 'submit .js-outbound': 'probleOutbound' + 'click .js-close': 'hide' constructor: -> super @@ -689,7 +693,7 @@ class App.ChannelEmailNotificationWizard extends App.Controller 'hidden.bs.modal': => if @callback @callback() - $('.modal').remove() + @el.remove() if @slide @showSlide(@slide) @@ -784,4 +788,8 @@ class App.ChannelEmailNotificationWizard extends App.Controller enable: (e) => @formEnable(e) - @$('.wizard-controls .btn').attr('disabled', false) \ No newline at end of file + @$('.wizard-controls .btn').attr('disabled', false) + + hide: (e) => + e.preventDefault() + @el.modal('hide') diff --git a/app/assets/javascripts/app/models/email_address.js.coffee b/app/assets/javascripts/app/models/email_address.js.coffee index a44f2b627..11b114dde 100644 --- a/app/assets/javascripts/app/models/email_address.js.coffee +++ b/app/assets/javascripts/app/models/email_address.js.coffee @@ -17,7 +17,7 @@ class App.EmailAddress extends App.Model { name: 'channel_id', display: 'Channel', tag: 'select', multiple: false, null: true, relation: 'Channel', nulloption: true, filter: @filterChannel }, { name: 'note', display: 'Note', tag: 'textarea', note: 'Notes are visible to agents only, never to customers.', limit: 250, null: true }, { name: 'updated_at', display: 'Updated', tag: 'datetime', readonly: 1 }, - { name: 'active', display: 'Active', tag: 'active', default: true }, + { name: 'active', display: 'Active', tag: 'active', readonly: 1 }, ] @configure_overview = [ 'realname', 'email' diff --git a/app/assets/javascripts/app/views/channel/email_account_wizard.jst.eco b/app/assets/javascripts/app/views/channel/email_account_wizard.jst.eco index e30300144..c5ec1433e 100644 --- a/app/assets/javascripts/app/views/channel/email_account_wizard.jst.eco +++ b/app/assets/javascripts/app/views/channel/email_account_wizard.jst.eco @@ -1,8 +1,13 @@ -