canvas_webex 0.12 → 0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -20,18 +20,6 @@ class CiscoWebexConference < WebConference
20
20
 
21
21
  after_save :format_scheduled_date
22
22
 
23
- user_setting_field :webex_service, {
24
- name: -> { t('webex_service_setting', 'Service') },
25
- description: -> { t('webex_service_setting_description', 'Service') },
26
- type: :select,
27
- visible: true,
28
- location: 'userSettings',
29
- options: [
30
- {value: 'meeting', name: -> { t('webex_meeting_center', 'Meeting Center') }},
31
- {value: 'training', name: -> { t('webex_training_center', 'Training Center') }}
32
- ]
33
- }
34
-
35
23
  user_setting_field :scheduled_date, {
36
24
  name: -> { t('scheduled_date_setting', 'Scheduled Date') },
37
25
  description: -> { t('scheduled_date_setting_description', 'Scheduled Date') },
@@ -58,8 +46,7 @@ class CiscoWebexConference < WebConference
58
46
  options = {
59
47
  duration: self.duration || 0,
60
48
  emails: settings[:external_emails].nil? ? [] : settings[:external_emails].strip.split(';'),
61
- time_zone: user.time_zone,
62
- service: settings[:webex_service]
49
+ time_zone: user.time_zone
63
50
  }
64
51
  options[:scheduled_date] = scheduled_date.in_time_zone(user.time_zone) if scheduled_date.present?
65
52
  webex_session = CanvasWebex::WebexSession.create(self.title, options)
@@ -162,7 +149,7 @@ class CiscoWebexConference < WebConference
162
149
  # Returns the meeting object, or nil if the meeting is ended
163
150
  def meeting
164
151
  @meeting ||= if self.conference_key
165
- case settings[:webex_service]
152
+ case CanvasWebex.client.webex_service
166
153
  when 'meeting'
167
154
  CanvasWebex::Meeting.retrieve(self.conference_key)
168
155
  when 'training'
@@ -1,6 +1,15 @@
1
1
  <% fields_for :settings, OpenObject.new(settings) do |f| %>
2
2
  <table class="formtable" style="width: 500px;">
3
3
  <tbody>
4
+ <tr>
5
+ <td><%= f.blabel :webex_service, t('webex_service_setting', 'Service') %></td>
6
+ <td>
7
+ <%= f.select :webex_service, [[t('webex_meeting_center', 'Meeting Center'), 'meeting'],
8
+ [t('webex_training_center', 'Training Center'), 'training']] %>
9
+ <div class="hint-text">
10
+ <%= t(:sevrice_selector_change, "Changing this option will immediately terminate all current meetings of other service types") %>
11
+ </div>
12
+ </td>
4
13
  <tr>
5
14
  <td><%= f.blabel :webex_id, :en => "WebEx ID" %></td>
6
15
  <td>
@@ -37,6 +37,9 @@ module Canvas
37
37
  :author_website => 'http://instructure.com',
38
38
  :version => CanvasWebex::VERSION,
39
39
  :settings_partial => 'plugins/webex_settings',
40
+ :settings => {
41
+ :webex_service => nil
42
+ },
40
43
  :validator => 'CiscoWebexValidator',
41
44
  :encrypted_settings => [:password, :meeting_password]
42
45
  })
@@ -44,4 +47,4 @@ module Canvas
44
47
 
45
48
  end
46
49
  end
47
- end
50
+ end
@@ -21,7 +21,7 @@ module Canvas
21
21
  module Validators
22
22
  class CiscoWebexValidator
23
23
  # Public: An array of allowed plugin settings.
24
- REQUIRED_KEYS = %w{webex_id password site_id site_name meeting_password}
24
+ REQUIRED_KEYS = %w{webex_service webex_id password site_id site_name meeting_password}
25
25
 
26
26
  # Public: Validate setting input for this plugin.
27
27
  #
@@ -59,6 +59,6 @@ module CanvasWebex
59
59
  #
60
60
  # Returns a CiscoWwebex::Service.
61
61
  def self.client
62
- Service.new(*self.config.values_at(:webex_id, :password_dec, :site_id, :site_name, :partner_id, :meeting_password_dec))
62
+ Service.new(*self.config.values_at(:webex_service, :webex_id, :password_dec, :site_id, :site_name, :partner_id, :meeting_password_dec))
63
63
  end
64
64
  end
@@ -55,4 +55,4 @@ module CanvasWebex
55
55
  end
56
56
 
57
57
  end
58
- end
58
+ end
@@ -1,11 +1,12 @@
1
1
  module CanvasWebex
2
2
  class Service
3
3
 
4
- attr_reader :webex_id, :password, :site_id, :site_name, :partner_id, :status, :meeting_password
4
+ attr_reader :webex_service, :webex_id, :password, :site_id, :site_name, :partner_id, :status, :meeting_password
5
5
 
6
6
 
7
- def initialize(webex_id, password, site_id, site_name, partner_id, meeting_password)
8
- @webex_id, @password, @site_id, @site_name, @partner_id, @meeting_password = [webex_id, password, site_id, site_name, partner_id, meeting_password]
7
+ def initialize(webex_service, webex_id, password, site_id, site_name, partner_id, meeting_password)
8
+ @webex_service, @webex_id, @password, @site_id, @site_name, @partner_id, @meeting_password =
9
+ [webex_service, webex_id, password, site_id, site_name, partner_id, meeting_password]
9
10
  end
10
11
 
11
12
  def list_summary_meetings
@@ -52,4 +52,4 @@ module CanvasWebex
52
52
  end
53
53
 
54
54
  end
55
- end
55
+ end
@@ -17,6 +17,6 @@
17
17
  #
18
18
 
19
19
  module CanvasWebex
20
- VERSION = "0.12"
20
+ VERSION = "0.13"
21
21
  end
22
22
 
@@ -19,7 +19,7 @@ module CanvasWebex
19
19
  class WebexSession
20
20
 
21
21
  def self.create(meeting_name, options = {}, client = CanvasWebex.client)
22
- case options[:service]
22
+ case client.webex_service
23
23
  when 'meeting'
24
24
  CanvasWebex::Meeting.create(meeting_name, options, client)
25
25
  when 'training'
@@ -75,4 +75,4 @@ module CanvasWebex
75
75
  end
76
76
 
77
77
  end
78
- end
78
+ end
@@ -1,7 +1,7 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe CanvasWebex::Meeting do
4
- let(:client) {CanvasWebex::Service.new('proserv_instructure', 'foo', '123', 'instructure', nil, 'test')}
4
+ let(:client) {CanvasWebex::Service.new('meeting', 'proserv_instructure', 'foo', '123', 'instructure', nil, 'test')}
5
5
  subject{CanvasWebex::Meeting.retrieve(123, client)}
6
6
 
7
7
  before(:each) do
@@ -28,4 +28,4 @@ describe CanvasWebex::Meeting do
28
28
  subject.status.should == "NOT_INPROGRESS"
29
29
  end
30
30
 
31
- end
31
+ end
@@ -1,7 +1,7 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe CanvasWebex::Service do
4
- subject {CanvasWebex::Service.new('proserv_instructure', 'foo', '123', 'instructure', nil, 'test')}
4
+ subject {CanvasWebex::Service.new('training', 'proserv_instructure', 'foo', '123', 'instructure', nil, 'test')}
5
5
 
6
6
  describe 'api_calls' do
7
7
 
@@ -50,4 +50,4 @@ describe CanvasWebex::Service do
50
50
  end
51
51
 
52
52
 
53
- end
53
+ end
@@ -1,7 +1,7 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe CanvasWebex::Training do
4
- let(:client) {CanvasWebex::Service.new('proserv_instructure', 'foo', '123', 'instructure', nil, 'test')}
4
+ let(:client) {CanvasWebex::Service.new('training', 'proserv_instructure', 'foo', '123', 'instructure', nil, 'test')}
5
5
  subject{CanvasWebex::Training.retrieve(123, client)}
6
6
 
7
7
  before(:each) do
@@ -24,4 +24,4 @@ describe CanvasWebex::Training do
24
24
  subject.status.should == "NOT_INPROGRESS"
25
25
  end
26
26
 
27
- end
27
+ end
@@ -1,7 +1,7 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe CanvasWebex::WebexSession do
4
- let(:client) {CanvasWebex::Service.new('proserv_instructure', 'foo', '123', 'instructure', nil, 'test')}
4
+ let(:client) {CanvasWebex::Service.new('meeting', 'proserv_instructure', 'foo', '123', 'instructure', nil, 'test')}
5
5
 
6
6
  it 'parses a cisco timestamp' do
7
7
  stub_call('list_timezones')
@@ -9,4 +9,4 @@ describe CanvasWebex::WebexSession do
9
9
  ts.to_s.should == '2006-01-26T21:00:00-08:00'
10
10
  end
11
11
 
12
- end
12
+ end
@@ -36,4 +36,4 @@ describe CiscoWebexConference do
36
36
  end
37
37
 
38
38
  end
39
- end
39
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: canvas_webex
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.12'
4
+ version: '0.13'
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-01-22 00:00:00.000000000 Z
12
+ date: 2014-03-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake