maestrano-connector-rails 0.3.6 → 0.3.7

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d94d15e3a6fd70083f95437d043eaa3a75483798
4
- data.tar.gz: 265289bdb90adbc369999c37e22b0614b4793c9a
3
+ metadata.gz: 9fbcf23f810c8f8163bffe839d39ef0d36531fde
4
+ data.tar.gz: 1ef445f37a5a3dc44bd737e966a65ca5a03ef73b
5
5
  SHA512:
6
- metadata.gz: 5876b376594568daf87136ffe2db59812f25d023def013a2419f8e4e1a8bd47b51d0b971c7584d7ee7b869821d7db91a47ea5b92178ceece70c2a3f284b3c9b6
7
- data.tar.gz: 10e5113d838dbd8a9bfbb282955a4b9ad715772289d2a4afd510d5e542612157fcdef2a2303bbf0bbb0c677f04c1c3fb01ffb0d062855655bfff670b80f5f1cf
6
+ metadata.gz: 20f2202b8094a5c43fe5066f9b918fa4307b527531228d1d5f21e37de581e7c292d90a5984134231f6d40fc585417b4c7eabc4d8b812109eeea65aab5a49a986
7
+ data.tar.gz: 14d8ba996bb7c9e11525d12d17086126035a882d2b7fe532ff8c6b22ff8ee9377555b5a3580d91a0e615eac7cd8c5b24dad8b09e88837ed7f017d8cdf6e7079a
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.6
1
+ 0.3.7
@@ -167,22 +167,30 @@ module Maestrano::Connector::Rails::Concerns::Entity
167
167
  # ----------------------------------------------
168
168
  # Connec! methods
169
169
  # ----------------------------------------------
170
+ # Supported options:
171
+ # * full_sync
172
+ # * $filter (see Connec! documentation)
173
+ # * $orderby (see Connec! documentation)
170
174
  def get_connec_entities(client, last_synchronization, organization, opts={})
171
175
  return [] unless self.class.can_read_connec?
172
176
 
173
177
  Maestrano::Connector::Rails::ConnectorLogger.log('info', organization, "Fetching Connec! #{self.class.connec_entity_name}")
174
178
 
175
179
  entities = []
180
+ query_params = {}
181
+ query_params[:$orderby] = opts[:$orderby] if opts[:$orderby]
176
182
 
177
183
  # Fetch first page
178
184
  if last_synchronization.blank? || opts[:full_sync]
179
185
  Maestrano::Connector::Rails::ConnectorLogger.log('debug', organization, "entity=#{self.class.connec_entity_name}, fetching all data")
180
- response = client.get("/#{self.class.normalized_connec_entity_name}")
186
+ query_params[:$filter] = opts[:$filter] if opts[:$filter]
181
187
  else
182
188
  Maestrano::Connector::Rails::ConnectorLogger.log('debug', organization, "entity=#{self.class.connec_entity_name}, fetching data since #{last_synchronization.updated_at.iso8601}")
183
- query_param = URI.encode("$filter=updated_at gt '#{last_synchronization.updated_at.iso8601}'")
184
- response = client.get("/#{self.class.normalized_connec_entity_name}?#{query_param}")
189
+ filter = "updated_at gt '#{last_synchronization.updated_at.iso8601}'"
190
+ filter += " and #{opts[:$filter]}" if opts[:$filter]
191
+ query_params[:$filter] = filter
185
192
  end
193
+ response = client.get("/#{self.class.normalized_connec_entity_name}?#{query_params.to_query}")
186
194
  raise "No data received from Connec! when trying to fetch #{self.class.connec_entity_name.pluralize}" unless response
187
195
 
188
196
  response_hash = JSON.parse(response.body)
@@ -51,7 +51,6 @@ module Connector
51
51
 
52
52
  def copy_stylesheets
53
53
  copy_file 'stylesheets/application.sass', 'app/assets/stylesheets/application.sass'
54
- copy_file 'stylesheets/banners.sass', 'app/assets/stylesheets/banners.sass'
55
54
  copy_file 'stylesheets/home.sass', 'app/assets/stylesheets/home.sass'
56
55
  copy_file 'stylesheets/layout.sass', 'app/assets/stylesheets/layout.sass'
57
56
  copy_file 'stylesheets/spacers.sass', 'app/assets/stylesheets/spacers.sass'
@@ -7,14 +7,18 @@ class HomeController < ApplicationController
7
7
  organization = Maestrano::Connector::Rails::Organization.find_by_id(params[:id])
8
8
 
9
9
  if organization && is_admin?(current_user, organization)
10
+ old_sync_state = organization.sync_enabled
11
+
10
12
  organization.synchronized_entities.keys.each do |entity|
11
- if !!params["#{entity}"]
12
- organization.synchronized_entities[entity] = true
13
- else
14
- organization.synchronized_entities[entity] = false
15
- end
13
+ organization.synchronized_entities[entity] = !!params["#{entity}"]
16
14
  end
15
+ organization.sync_enabled = organization.synchronized_entities.values.any?
17
16
  organization.save
17
+
18
+ if !old_sync_state
19
+ Maestrano::Connector::Rails::SynchronizationJob.perform_later(organization, {})
20
+ flash[:info] = 'Congrats, you\'re all set up! Your data are now being synced'
21
+ end
18
22
  end
19
23
 
20
24
  redirect_to(:back)
@@ -29,12 +33,8 @@ class HomeController < ApplicationController
29
33
  redirect_to(:back)
30
34
  end
31
35
 
32
- def toggle_sync
33
- if is_admin
34
- current_organization.update(sync_enabled: !current_organization.sync_enabled)
35
- flash[:info] = current_organization.sync_enabled ? 'Synchronization enabled' : 'Synchronization disabled'
36
- end
37
-
38
- redirect_to(:back)
36
+ def redirect_to_external
37
+ redirect_to 'https://path/to/external/app'
39
38
  end
39
+
40
40
  end
@@ -32,11 +32,28 @@ describe HomeController, :type => :controller do
32
32
 
33
33
  it { expect(subject).to redirect_to back_path }
34
34
 
35
- it 'updates organization' do
35
+ it 'updates organization synchronized_entities' do
36
36
  subject
37
37
  organization.reload
38
38
  expect(organization.synchronized_entities).to eq({'people' => true, 'item' => false})
39
39
  end
40
+
41
+ it 'updates organization sync_enabled' do
42
+ subject
43
+ organization.reload
44
+ expect(organization.sync_enabled).to eq true
45
+ end
46
+
47
+ context 'when removing all entities' do
48
+ subject { put :update, id: organization.id, 'people' => false, 'item' => false }
49
+ before { organization.update(sync_enabled: true) }
50
+
51
+ it 'set sync_enabled to false' do
52
+ subject
53
+ organization.reload
54
+ expect(organization.sync_enabled).to eq false
55
+ end
56
+ end
40
57
  end
41
58
  end
42
59
 
@@ -49,7 +66,7 @@ describe HomeController, :type => :controller do
49
66
 
50
67
  context 'when user is not admin' do
51
68
  before {
52
- allow_any_instance_of(Maestrano::Connector::Rails::SessionHelper).to receive(:is_admin).and_return(false)
69
+ allow_any_instance_of(ApplicationHelper).to receive(:is_admin).and_return(false)
53
70
  }
54
71
 
55
72
  it { expect(subject).to redirect_to back_path }
@@ -62,7 +79,7 @@ describe HomeController, :type => :controller do
62
79
 
63
80
  context 'when user is admin' do
64
81
  before {
65
- allow_any_instance_of(Maestrano::Connector::Rails::SessionHelper).to receive(:is_admin).and_return(true)
82
+ allow_any_instance_of(ApplicationHelper).to receive(:is_admin).and_return(true)
66
83
  }
67
84
 
68
85
  it { expect(subject).to redirect_to back_path }
@@ -85,40 +102,22 @@ describe HomeController, :type => :controller do
85
102
  end
86
103
  end
87
104
  end
105
+ end
88
106
 
89
- describe 'toggle_sync' do
90
- subject { put :toggle_sync }
91
- let(:organization) { create(:organization, sync_enabled: true) }
107
+ describe 'redirect_to_external' do
108
+ subject { get :redirect_to_external }
109
+
110
+ context 'when organization has a redirect url' do
111
+ let(:organization) { create(:organization, instance_url: 'url') }
92
112
  before {
93
113
  allow_any_instance_of(Maestrano::Connector::Rails::SessionHelper).to receive(:current_organization).and_return(organization)
94
114
  }
95
115
 
96
- context 'when user is not an admin' do
97
- before {
98
- allow_any_instance_of(Maestrano::Connector::Rails::SessionHelper).to receive(:is_admin).and_return(false)
99
- }
100
- it { expect(subject).to redirect_to back_path }
101
-
102
- it 'does nothing' do
103
- expect{ subject }.to_not change{ organization.sync_enabled }
104
- end
105
- end
106
-
107
- context 'when user is admin' do
108
- before {
109
- allow_any_instance_of(Maestrano::Connector::Rails::SessionHelper).to receive(:is_admin).and_return(true)
110
- }
111
- it { expect(subject).to redirect_to back_path }
112
-
113
- it 'change sync_enabled from true to false' do
114
- expect{ subject }.to change{ organization.sync_enabled }.from(true).to(false)
115
- end
116
+ it {expect(subject).to redirect_to('url')}
117
+ end
116
118
 
117
- it 'change sync_enabled from false to true' do
118
- organization.update(sync_enabled: false)
119
- expect{ subject }.to change{ organization.sync_enabled }.from(false).to(true)
120
- end
121
- end
119
+ context 'otherwise' do
120
+ it {expect(subject).to redirect_to('https://login.salesforce.com')}
122
121
  end
123
122
  end
124
123
  end
@@ -6,7 +6,10 @@
6
6
  .col-md-10.col-md-offset-2
7
7
  %h2 ApplicationName Connector
8
8
  %p
9
- Link your Maestrano account to ApplicationName to get your business in synch. Check the status of your connection on this screen.
9
+ -if @organization
10
+ Link your company <strong>#{@organization.name} (#{@organization.uid})</strong> to ApplicationName to get your business in synch. Check the status of your connection on this screen.
11
+ -else
12
+ Link your account to ApplicationName to get your business in synch. Check the status of your connection on this screen.
10
13
 
11
14
  .container
12
15
  - if current_user
@@ -15,89 +18,58 @@
15
18
  .col-md-12.alert.alert-warning
16
19
  Only administrators can modify the application settings
17
20
 
18
- .row.link-step
21
+ .row.link-step{class: "#{@organization.oauth_uid ? 'done' : 'todo'}"}
19
22
  .col-md-1.text-center.link-step-number
20
23
  %span.badge.link-step-badge
21
24
  1
22
- .col-md-3.text-center
23
- =image_tag "logos/default-white.png", class: 'logo'
24
- .col-md-6.link-step-description
25
- %h
26
- Your Maestrano company <strong>#{@organization.name} (#{@organization.uid})</strong> is currently linked
27
- .col-md-2.text-center.link-step-action
28
- = link_to "Disconnect", Maestrano::Connector::Rails::Engine.routes.url_helpers.maestrano_signout_path, class: "btn btn-warning btn-lg #{is_admin ? '' : 'disabled'}"
29
-
30
- .spacer1
31
-
32
- .row.link-step
33
- .col-md-1.text-center.link-step-number
34
- %span.badge.link-step-badge
35
- 2
36
- .col-md-3.text-center
37
- =image_tag "logos/external.png", class: 'logo'
38
25
  .col-md-6.link-step-description
39
26
  %h
40
27
  - if @organization.oauth_uid
41
28
  Your ApplicationName account <strong>#{@organization.oauth_name} (#{@organization.oauth_uid})</strong> is currently linked
42
29
  - else
43
30
  Your ApplicationName account is not linked
44
- .col-md-2.text-center.link-step-action
31
+ .col-md-2.col-md-offset-3.text-center.link-step-action
45
32
  - if @organization.oauth_uid
46
- / TODO
47
- = link_to "Disconnect", root_path, class: "btn btn-warning btn-lg #{is_admin ? '' : 'disabled'}"
33
+ = link_to "Disconnect", signout_omniauth_path(organization_id: @organization.id), class: "btn btn-warning btn-lg #{is_admin ? '' : 'disabled'}"
48
34
  - else
49
- / TODO
50
- = link_to "Link to ApplicationName", root_path, class: "btn btn-warning btn-lg #{is_admin ? '' : 'disabled'}"
35
+ = link_to "Link to ApplicationName", "/auth/ApplicationName/request?org_uid=#{@organization.uid}", class: "btn btn-warning btn-lg" if is_admin
51
36
 
52
37
  .spacer1
53
38
 
54
- .row.link-step
55
- .col-md-1.text-center.link-step-number
56
- %span.badge.link-step-badge
57
- 3
58
- .col-md-3.text-center
59
- =image_tag "logos/sync.png", class: 'logo'
60
- .col-md-6.link-step-description
61
- %h
62
- - if @organization.sync_enabled
63
- Synchronizations are enabled
64
- - else
65
- Synchronizations are disabled
66
- .col-md-2.text-center.link-step-action
67
- = link_to "Toggle #{@organization.sync_enabled ? 'off' : 'on'}", home_toggle_sync_path, method: :put, class: "btn btn-warning btn-lg #{is_admin ? '' : 'disabled'}"
39
+ .row.link-step{class: "#{(@organization.sync_enabled && @organization.synchronized_entities.values.any?) ? 'done' : 'todo'}"}
40
+ = form_tag home_update_path(id: @organization.id), method: :put do
41
+ .col-md-1.text-center.link-step-number
42
+ %span.badge.link-step-badge
43
+ 2
44
+ .col-md-9.link-step-description
45
+ %h
46
+ You can customize which entities are synchronized by the connector:
47
+ .spacer1
48
+ .row
49
+ .col-md-11.col-md-offset-1
50
+ - @organization.synchronized_entities.each do |k, v|
51
+ .row.sync-entity
52
+ .col-md-1.link-step-action
53
+ %input{type: "checkbox", id: "#{k}", name: "#{k}", checked: v}
54
+ .col-md-6{style: 'padding-top: 5px;'}
55
+ %label{:for => "#{k}"} #{k.to_s.humanize.pluralize}
56
+ -if is_admin
57
+ .col-md-5.text-right
58
+ - if v && @organization.oauth_uid && @organization.sync_enabled
59
+ = link_to "Force a synchronization for #{k.to_s.humanize.pluralize} only", home_synchronize_path(opts: {only_entities: [k.to_s]}), method: :post, class: "btn btn-warning btn-sm"
60
+ .spacer1
61
+ .row
62
+ .col-md-2.col-md-offset-10.text-center.link-step-action
63
+ =submit_tag "#{@organization.sync_enabled ? 'Update' : 'Start synchronizing!'}", class: "btn btn-lg btn-warning #{@organization.oauth_uid ? '' : 'disabled'} text-sm"
64
+
65
+ -if @organization.oauth_uid && @organization.sync_enabled
66
+ .spacer2
67
+ .row
68
+ .col-md-4.col-md-offset-4.text-center
69
+ = link_to 'Go to ApplicationName', home_redirect_to_external_path, class: 'btn btn-lg btn-primary'
68
70
 
69
71
  - else
70
72
  .row
71
73
  .col-md-4.col-md-offset-4.center
72
74
  = link_to "Link your Maestrano account", Maestrano::Connector::Rails::Engine.routes.url_helpers.default_maestrano_auth_saml_index_path(tenant: :default), class: 'btn btn-warning'
73
75
 
74
- - if @organization
75
- .spacer2
76
- .row
77
- .col-md-12
78
- %h1
79
- Synchronized entities
80
- %small You can customize which entities are synchronized by the connector
81
-
82
- .spacer1
83
- .row
84
- .col-md-10.col-md-offset-1
85
- = form_tag home_update_path(id: @organization.id), method: :put do
86
- - @organization.synchronized_entities.each do |k, v|
87
- .row.sync-entity
88
- .col-md-1.link-step-action
89
- %input{type: "checkbox", id: "#{k}", name: "#{k}", checked: v}
90
- .col-md-7{style: 'padding-top: 5px;'}
91
- %label{:for => "#{k}"} #{k.to_s.humanize}
92
- -if is_admin
93
- .col-md-4.text-right
94
- - if v && @organization.oauth_uid
95
- - if @organization.sync_enabled
96
- = link_to "Force a synchronization for #{k.to_s.humanize.pluralize} only", home_synchronize_path(opts: {only_entities: [k.to_s]}), method: :post, class: "btn btn-warning btn-sm #{is_admin && @organization.sync_enabled ? '' : 'disabled'}"
97
- - else
98
- .btn.btn-warning.btn-sm.disabled= "Force a synchronization for #{k.to_s.humanize.pluralize} only"
99
- -if is_admin
100
- .spacer1
101
- .row
102
- .col-md-4.col-md-offset-8.text-right
103
- =submit_tag :Save, class: "btn btn-primary"
@@ -3,7 +3,7 @@
3
3
  !!!
4
4
  %html
5
5
  %head
6
- %title ApplicationName Connector for Connec!™
6
+ %title SalesForce Connector
7
7
  = stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true
8
8
  = javascript_include_tag 'application', 'data-turbolinks-track' => true
9
9
  = csrf_meta_tags
@@ -16,7 +16,9 @@
16
16
 
17
17
  %ul.nav.navbar-nav
18
18
  %li=link_to "Status", root_path
19
+
19
20
  %li=link_to "History", synchronizations_index_path
21
+
20
22
  -if is_admin
21
23
  %li=link_to "Mapping", shared_entities_index_path
22
24
 
@@ -41,5 +43,4 @@
41
43
  .row
42
44
  .col-xs-12
43
45
  .copyright
44
- © Copyright #{Time.now.year} Maestrano Pty Ltd (ABN: 80 152 564 424).
45
- All rights reserved. Various trademarks held by their respective owners.
46
+ © Copyright #{Time.now.year}. All rights reserved. Various trademarks held by their respective owners.
@@ -34,6 +34,7 @@ class OauthController < ApplicationController
34
34
  organization.oauth_uid = nil
35
35
  organization.oauth_token = nil
36
36
  organization.refresh_token = nil
37
+ organization.sync_enabled = false
37
38
  organization.save
38
39
  end
39
40
 
@@ -7,15 +7,15 @@
7
7
  .row
8
8
  .col-md-10
9
9
  %h3 Data Shared
10
- %small Equivalence between Maestrano's Connec!™ id and ApplicationName id for each of your entities
10
+ %small Equivalence between the internal id and ApplicationName id for each of your entities
11
11
 
12
12
  - if @idmaps
13
13
  %table.table.table-condensed
14
14
  %th Entity name
15
- %th Connec!™ entity
16
- %th Connec!™ id
17
- %th SalesForce entity
18
- %th SalesForce id
15
+ %th Internal entity
16
+ %th Internal id
17
+ %th ApplicationName entity
18
+ %th ApplicationName id
19
19
  %th Message
20
20
 
21
21
  - @idmaps.each do |idmap|
@@ -16,7 +16,6 @@
16
16
  @import 'bootstrap-sprockets'
17
17
  @import 'bootstrap'
18
18
 
19
- @import 'banners'
20
19
  @import 'spacers'
21
20
 
22
21
  @import 'layout'
@@ -10,7 +10,6 @@
10
10
  .link-step-badge
11
11
  padding: 10px
12
12
  font-size: 20px
13
- background-color: cornflowerblue
14
13
  border-radius: 20px
15
14
 
16
15
  .link-step-description
@@ -19,7 +18,22 @@
19
18
  .link-step-action
20
19
  padding-top: 3px
21
20
 
21
+ &.done
22
+ background-color: $done-step-bg-color
23
+ border-color: $done-step-border-color
24
+ .link-step-badge
25
+ background-color: $done-step-badge-color
26
+
27
+ &.todo
28
+ background-color: $todo-step-bg-color
29
+ border-color: $todo-step-border-color
30
+ .link-step-badge
31
+ background-color: $todo-step-badge-color
32
+
22
33
  .sync-entity
23
34
  padding-bottom: 8px
24
35
  margin-bottom: 8px
25
- border-bottom: dashed 1px silver
36
+ border-bottom: dashed 1px silver
37
+
38
+ .btn.btn-lg.text-sm
39
+ font-size: 16px
@@ -1,59 +1,30 @@
1
- .mno-main-logo
2
- width: 201px
3
- height: 51px
4
- background: image-url('sprites/shared-icons.sprite.png') 0px 0px no-repeat
5
-
6
- .logo
7
- height: 51px
8
-
9
- .navbar
10
- &.navbar-dashboard
11
- top: 0px
12
-
13
- .container-fluid
14
- .navbar-brand
15
- position: absolute
16
- margin-top: -44px
17
-
18
- .navbar-submenu
19
- background-color: $purple
20
- padding: 15px
21
- margin-top: 14px
22
- margin-bottom: -1px
23
- width: 100%
24
-
25
- ul
26
- margin: auto
27
- list-style-type: none
28
-
29
- li
30
- display: inline
31
- margin: 0px 13px
1
+ html, body
2
+ height: 100%
3
+ background-color: $bg-color
4
+ color: $text-color
32
5
 
33
- a
34
- color: white
35
- font-size: 14px
36
- font-weight: 300
6
+ .wrapper
7
+ min-height: 100%
8
+ margin-bottom: -$footer-height
37
9
 
38
- &.active
39
- color: $darkblue
40
- font-weight: 300
10
+ &:after
11
+ content: ""
12
+ display: block
41
13
 
42
- .navbar-nav
43
- &.navbar-right:last-child
44
- margin-right: 10px
14
+ .footer
15
+ padding-top: $navbar-padding
16
+ height: $footer-height
17
+ border-top: 1px solid darken($navbar-bg-color, 10%)
18
+ border-bottom: 1px solid darken($navbar-bg-color, 10%)
19
+ background-color: $navbar-bg-color
45
20
 
46
- li.active
47
- .navbar-arrow
48
- position: absolute
49
- margin-top: 60px
50
- width: 0
51
- height: 0
52
- border-left: 27px solid transparent
53
- border-right: 27px solid transparent
54
- margin-left: calc(50% - 27px)
55
- border-bottom: 20px solid $purple
21
+ .copyright
22
+ text-align: center
23
+ font-size: 10px
24
+ color: $copyright-color
25
+ margin-top: 20px
56
26
 
27
+ .navbar
57
28
  .container-fluid
58
29
  .navbar-brand
59
30
  margin-left: 20px
@@ -69,17 +40,6 @@
69
40
  a
70
41
  font-size: $normal
71
42
 
72
- ul.nav.navbar-nav.navbar-right
73
- button
74
- margin-top: (($navbar-height - $line-height-computed) / 2) - 18
75
-
76
- a
77
- text-transform: none
78
-
79
- .padding-navbar
80
- margin-top: $navbar-height
81
-
82
-
83
43
  // Reduce the height of the navbar if on mobile device
84
44
  @media(min-width: 768px)
85
45
  .navbar-fixed-top
@@ -89,37 +49,15 @@
89
49
  .padding-navbar
90
50
  margin-top: $navbar-desktop-height
91
51
 
52
+ .banners
53
+ width: 100%
54
+ padding: 58px 0 58px 0
55
+
56
+ .logo
57
+ height: 51px
58
+
92
59
  .center
93
60
  text-align: center
94
61
 
95
62
  .align-right
96
- text-align: right
97
-
98
- html, body
99
- height: 100%
100
-
101
- .wrapper
102
- min-height: 100%
103
- margin-bottom: -$footer-height
104
-
105
- &:after
106
- content: ""
107
- display: block
108
-
109
- .footer
110
- padding-top: $navbar-padding
111
- height: $footer-height
112
- border-top: 1px solid darken(#e5e5e5, 10%)
113
- border-bottom: 1px solid darken(#e5e5e5, 10%)
114
- background-color: $darkblue
115
-
116
- .copyright
117
- text-align: center
118
- font-size: 10px
119
- color: #f4f4f4
120
- margin-top: 20px
121
-
122
-
123
- .banners
124
- &.sticky-top
125
- padding-top: 10px
63
+ text-align: right
@@ -11,30 +11,23 @@ $font-family-base: $font-family-sans-serif
11
11
  /*-----------------------------------------------------------------------*/
12
12
  /* Color palette */
13
13
  /*-----------------------------------------------------------------------*/
14
- $darkerblue: #16252c
15
- $darkblue: #17262d
16
- $darkerblue: darken($darkblue,4%)
17
- $darkblue2: #25333a
18
- $mediumblue: #626d6d
19
- $lightblue: #abc4c6
20
- $pink: #ed1e79
21
- $fluroblue: #00e5f0
22
- $fluroorange: #ff7300
23
- $flureoyellow: #fbd925
24
- $flurogreen: #47ff00
25
- $fluropink: #e01f74
26
- $darkgreen: #33d375
27
- $green: #d1e55c
28
- $purple: #977bf0
29
- $lightgray: #e6edee
30
- $bluegray: #abc4c6
31
- $bluegray2: #35464c
32
-
33
- $brand-success: $fluroblue
34
- $brand-warning: $purple
35
- $brand-info: $fluroblue
36
- $brand-danger: $fluropink
37
- $brand-primary: $fluroblue
14
+ $bg-color: #fff
15
+ $text-color: #000
16
+
17
+ $navbar-bg-color: #aaa
18
+ $navbar-text-color: #fff
19
+
20
+ $copyright-color: $navbar-text-color
21
+
22
+ $primary-button-color: blue
23
+ $warning-button-color: red
24
+
25
+ $done-step-bg-color: #dff0d8
26
+ $done-step-border-color: #d6e9c6
27
+ $done-step-badge-color: darken($done-step-border-color, 20%)
28
+ $todo-step-bg-color: #fcf8e3
29
+ $todo-step-border-color: #faebcc
30
+ $todo-step-badge-color: darken($todo-step-border-color, 20%)
38
31
 
39
32
  /*-----------------------------------------------------------------------*/
40
33
  /* Text Size */
@@ -45,13 +38,17 @@ $normal: 13px
45
38
  /*-----------------------------------------------------------------------*/
46
39
  /* Nav bar */
47
40
  /*-----------------------------------------------------------------------*/
48
- $navbar-inverse-bg: $darkblue
41
+ $navbar-inverse-bg: $navbar-bg-color
49
42
  $navbar-height: 40px
50
- $navbar-inverse-link-color: $lightblue
43
+ $navbar-inverse-link-color: $navbar-text-color
51
44
  $navbar-border-radius: 0px
52
- $navbar-inverse-border: $darkblue
45
+ $navbar-inverse-border: $navbar-bg-color
53
46
  $navbar-desktop-height: 80px
54
47
  $navbar-inverse-link-active-bg: $navbar-inverse-bg
55
48
 
56
49
  $navbar-padding: 10px
57
- $footer-height: 50px
50
+ $footer-height: 50px
51
+
52
+ $brand-success: $primary-button-color
53
+ $brand-primary: $primary-button-color
54
+ $brand-warning: $warning-button-color
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: maestrano-connector-rails 0.3.6 ruby lib
5
+ # stub: maestrano-connector-rails 0.3.7 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "maestrano-connector-rails"
9
- s.version = "0.3.6"
9
+ s.version = "0.3.7"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
13
13
  s.authors = ["Pierre Berard"]
14
- s.date = "2016-03-29"
14
+ s.date = "2016-03-31"
15
15
  s.description = "Maestrano is the next generation marketplace for SME applications. See https://maestrano.com for details."
16
16
  s.email = "pierre.berard@maestrano.com"
17
17
  s.executables = ["rails"]
@@ -83,7 +83,6 @@ Gem::Specification.new do |s|
83
83
  "lib/generators/connector/templates/shared_entities_controller_spec.rb",
84
84
  "lib/generators/connector/templates/shared_entities_index.haml",
85
85
  "lib/generators/connector/templates/stylesheets/application.sass",
86
- "lib/generators/connector/templates/stylesheets/banners.sass",
87
86
  "lib/generators/connector/templates/stylesheets/home.sass",
88
87
  "lib/generators/connector/templates/stylesheets/layout.sass",
89
88
  "lib/generators/connector/templates/stylesheets/spacers.sass",
@@ -203,7 +203,7 @@ describe Maestrano::Connector::Rails::Entity do
203
203
  }
204
204
 
205
205
  it 'calls get with a singularize url' do
206
- expect(client).to receive(:get).with("/#{connec_name.downcase}")
206
+ expect(client).to receive(:get).with("/#{connec_name.downcase}?")
207
207
  subject.get_connec_entities(client, nil, organization)
208
208
  end
209
209
  end
@@ -215,26 +215,46 @@ describe Maestrano::Connector::Rails::Entity do
215
215
 
216
216
  context 'when opts[:full_sync] is true' do
217
217
  it 'performs a full get' do
218
- expect(client).to receive(:get).with("/#{connec_name.downcase.pluralize}")
219
- subject.get_connec_entities(client, nil, organization, {full_sync: true})
218
+ expect(client).to receive(:get).with("/#{connec_name.downcase.pluralize}?")
219
+ subject.get_connec_entities(client, sync, organization, {full_sync: true})
220
220
  end
221
221
  end
222
222
 
223
223
  context 'when there is no last sync' do
224
224
  it 'performs a full get' do
225
- expect(client).to receive(:get).with("/#{connec_name.downcase.pluralize}")
225
+ expect(client).to receive(:get).with("/#{connec_name.downcase.pluralize}?")
226
226
  subject.get_connec_entities(client, nil, organization)
227
227
  end
228
228
  end
229
229
 
230
230
  context 'when there is a last sync' do
231
231
  it 'performs a time limited get' do
232
- uri_param = URI.encode("$filter=updated_at gt '#{sync.updated_at.iso8601}'")
232
+ uri_param = {"$filter" => "updated_at gt '#{sync.updated_at.iso8601}'"}.to_query
233
233
  expect(client).to receive(:get).with("/#{connec_name.downcase.pluralize}?#{uri_param}")
234
234
  subject.get_connec_entities(client, sync, organization)
235
235
  end
236
236
  end
237
237
 
238
+ context 'with options' do
239
+ it 'support filter option for full sync' do
240
+ uri_param = {'$filter'=>'code eq \'PEO12\''}.to_query
241
+ expect(client).to receive(:get).with("/#{connec_name.downcase.pluralize}?#{uri_param}")
242
+ subject.get_connec_entities(client, sync, organization, {full_sync: true, :$filter => "code eq 'PEO12'"})
243
+ end
244
+
245
+ it 'support filter option for time limited sync' do
246
+ uri_param = {"$filter"=>"updated_at gt '#{sync.updated_at.iso8601}' and code eq 'PEO12'"}.to_query
247
+ expect(client).to receive(:get).with("/#{connec_name.downcase.pluralize}?#{uri_param}")
248
+ subject.get_connec_entities(client, sync, organization, {:$filter => "code eq 'PEO12'"})
249
+ end
250
+
251
+ it 'support orderby option for time limited sync' do
252
+ uri_param = {"$orderby"=>"name asc", "$filter"=>"updated_at gt '#{sync.updated_at.iso8601}'"}.to_query
253
+ expect(client).to receive(:get).with("/#{connec_name.downcase.pluralize}?#{uri_param}")
254
+ subject.get_connec_entities(client, sync, organization, {:$orderby => "name asc"})
255
+ end
256
+ end
257
+
238
258
  context 'with pagination' do
239
259
  before {
240
260
  allow(client).to receive(:get).and_return(ActionDispatch::Response.new(200, {}, {people: [], pagination: {next: "https://api-connec.maestrano.com/api/v2/cld-dkg601/people?%24skip=10&%24top=10"}}.to_json, {}), ActionDispatch::Response.new(200, {}, {people: []}.to_json, {}))
@@ -7,7 +7,6 @@ Rails.application.routes.draw do
7
7
  get 'home/index' => 'home#index'
8
8
  put 'home/update' => 'home#update'
9
9
  post 'home/synchronize' => 'home#synchronize'
10
- put 'home/toggle_sync' => 'home#toggle_sync'
11
10
 
12
11
  get 'synchronizations/index' => 'synchronizations#index'
13
12
  get 'shared_entities/index' => 'shared_entities#index'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: maestrano-connector-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.6
4
+ version: 0.3.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pierre Berard
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-29 00:00:00.000000000 Z
11
+ date: 2016-03-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: maestrano-rails
@@ -293,7 +293,6 @@ files:
293
293
  - lib/generators/connector/templates/shared_entities_controller_spec.rb
294
294
  - lib/generators/connector/templates/shared_entities_index.haml
295
295
  - lib/generators/connector/templates/stylesheets/application.sass
296
- - lib/generators/connector/templates/stylesheets/banners.sass
297
296
  - lib/generators/connector/templates/stylesheets/home.sass
298
297
  - lib/generators/connector/templates/stylesheets/layout.sass
299
298
  - lib/generators/connector/templates/stylesheets/spacers.sass
@@ -1,59 +0,0 @@
1
- .banners
2
- width: 100%
3
- padding: 58px 0 58px 0
4
-
5
- &.small-padding
6
- padding: 10px 0px 10px 0px
7
-
8
- &.lightgray
9
- background-color: $lightgray
10
-
11
- &.purple
12
- background-color: $purple
13
-
14
- &.darkblue
15
- background-color: $darkblue
16
- p
17
- color: $lightgray
18
- font-size: 1.1em
19
- font-weight: 300
20
-
21
- h2
22
- font-weight: 700
23
- font-size: 40px
24
- color: $darkblue
25
-
26
- h4
27
- font-weight: 900
28
- font-size: 14px
29
- color: $darkblue
30
-
31
- p
32
- color: $mediumblue
33
- font-weight: 300
34
- font-size: 16px
35
-
36
- &.promo
37
- h2
38
- font-weight: 700
39
- font-size: 40px
40
- text-align: center
41
- color: $darkblue
42
-
43
- h3
44
- font-weight: 300
45
- font-size: 18px
46
- text-align: center
47
- color: $darkblue
48
-
49
- h4
50
- font-size: 24px
51
- font-weight: 400
52
-
53
- h5
54
- text-align: center
55
- font-size: 14px
56
- font-weight: 300
57
-
58
- &.sticky
59
- padding: 5px 0