Fixed issue #1381: Exchange folder with unsupported entries fails configuration. Also improved error handling of empty folders or not selected folders.
This commit is contained in:
parent
4573308f66
commit
4011c88493
5 changed files with 37 additions and 14 deletions
|
@ -187,6 +187,7 @@ class ConnectionWizard extends App.WizardModal
|
||||||
elements:
|
elements:
|
||||||
'.modal-body': 'body'
|
'.modal-body': 'body'
|
||||||
'.js-foldersSelect': 'foldersSelect'
|
'.js-foldersSelect': 'foldersSelect'
|
||||||
|
'.js-folders .js-submitTry': 'foldersSelectSubmit'
|
||||||
'.js-userMappingForm': 'userMappingForm'
|
'.js-userMappingForm': 'userMappingForm'
|
||||||
'.js-expertForm': 'expertForm'
|
'.js-expertForm': 'expertForm'
|
||||||
|
|
||||||
|
@ -321,6 +322,11 @@ class ConnectionWizard extends App.WizardModal
|
||||||
nulloption: false
|
nulloption: false
|
||||||
options: options
|
options: options
|
||||||
value: selected
|
value: selected
|
||||||
|
onChange: (val) =>
|
||||||
|
if val && val.length > 0
|
||||||
|
@foldersSelectSubmit.removeClass('is-disabled')
|
||||||
|
else
|
||||||
|
@foldersSelectSubmit.addClass('is-disabled')
|
||||||
)
|
)
|
||||||
|
|
||||||
mapping: (e) =>
|
mapping: (e) =>
|
||||||
|
|
|
@ -33,6 +33,11 @@ class App.ColumnSelect extends Spine.Controller
|
||||||
@select @pickedValue
|
@select @pickedValue
|
||||||
, 300, {trailing: false}
|
, 300, {trailing: false}
|
||||||
|
|
||||||
|
if @attribute.onChange
|
||||||
|
@shadow.on('change', =>
|
||||||
|
@attribute.onChange(@shadow.val())
|
||||||
|
)
|
||||||
|
|
||||||
render: ->
|
render: ->
|
||||||
@values = []
|
@values = []
|
||||||
_.each @options.attribute.options, (option) =>
|
_.each @options.attribute.options, (option) =>
|
||||||
|
|
|
@ -115,7 +115,7 @@
|
||||||
<a class="btn btn--text btn--secondary js-goToSlide align-left" data-slide="js-bind"><%- @T('Go Back') %></a>
|
<a class="btn btn--text btn--secondary js-goToSlide align-left" data-slide="js-bind"><%- @T('Go Back') %></a>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-rightFooter">
|
<div class="modal-rightFooter">
|
||||||
<button class="btn btn--primary align-right js-submitTry"><%- @T('Continue') %></button>
|
<button class="btn btn--primary align-right js-submitTry is-disabled"><%- @T('Continue') %></button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
|
@ -33,7 +33,9 @@ class Integration::ExchangeController < ApplicationController
|
||||||
|
|
||||||
def mapping
|
def mapping
|
||||||
answer_with do
|
answer_with do
|
||||||
Sequencer.process('Import::Exchange::AttributesExamples',
|
raise 'Please select at least one folder.' if params[:folders].blank?
|
||||||
|
|
||||||
|
examples = Sequencer.process('Import::Exchange::AttributesExamples',
|
||||||
parameters: {
|
parameters: {
|
||||||
ews_folder_ids: params[:folders],
|
ews_folder_ids: params[:folders],
|
||||||
ews_config: {
|
ews_config: {
|
||||||
|
@ -42,6 +44,9 @@ class Integration::ExchangeController < ApplicationController
|
||||||
password: params[:password],
|
password: params[:password],
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
examples.tap do |result|
|
||||||
|
raise 'No entries found in selected folder(s).' if result[:attributes].blank?
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -16,11 +16,18 @@ class Sequencer
|
||||||
|
|
||||||
ews_folder_ids.collect do |folder_id|
|
ews_folder_ids.collect do |folder_id|
|
||||||
|
|
||||||
|
begin
|
||||||
ews_folder.find(folder_id).items.each do |resource|
|
ews_folder.find(folder_id).items.each do |resource|
|
||||||
attributes = ::Import::Exchange::ItemAttributes.extract(resource)
|
attributes = ::Import::Exchange::ItemAttributes.extract(resource)
|
||||||
extractor.extract(attributes)
|
extractor.extract(attributes)
|
||||||
break if extractor.enough
|
break if extractor.enough
|
||||||
end
|
end
|
||||||
|
rescue NoMethodError => e
|
||||||
|
raise if e.message !~ /Viewpoint::EWS::/
|
||||||
|
|
||||||
|
logger.error e
|
||||||
|
logger.error "Skipping folder_id '#{folder_id}' due to unsupported entries."
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end.examples
|
end.examples
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue