intercom-app 0.2.4 → 0.2.5

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: 8b468b4333930ad7c0c2028de78ab6d159ca6c4f
4
- data.tar.gz: 9c446200ab698c390a772c42819f7d5537d926a0
3
+ metadata.gz: 6521ba7c3a3b53f3d44eea888bbb433c838e5054
4
+ data.tar.gz: a03ce39dd76837d72c8abef0d4d2f93699d9ec25
5
5
  SHA512:
6
- metadata.gz: f4deb87d560ba5196d8e7acb2dfdd53ec5b51c597b98ac6c02e9701fae8c2dfb24595aa8634cba51da533fa4e5dbec0d7e3a7894c88dc93bbbbca6141e5256e6
7
- data.tar.gz: 67011cd585aa337a850e41c5ca537e4c761d10c7437956814663ac2cf44a48b4792c76e11c75f6e82556651c6f9c84112a4670c02ef91fe67e0a225fbf3d3b61
6
+ metadata.gz: 077b57c8e27db949d673610e1f3dbdb1f9d28331693745322504dfe56fac8b21e7c6f9ea1176f91518ae9dbb468c5041585cb0f7ef17f5fe4a45f4bebc7cee27
7
+ data.tar.gz: 5f56e25a296ffafce52d9dec185d11efa44791aa9e12ba3c93da6b4fd869f608f727b7fa2604c6a97f34a742b806ffd0d051cbe56ff4562c03f038a8c8264983
@@ -39,3 +39,10 @@ Features:
39
39
  ## 0.2.4 (2016-10-19)
40
40
 
41
41
  * Add name, email by default to App model (@Skaelv)
42
+
43
+
44
+ ## 0.2.5 (2016-10-27)
45
+
46
+ * Fix retrieving session on callback
47
+ * New login design
48
+ * New home page design (@Skaelv)
data/README.md CHANGED
@@ -24,7 +24,7 @@ $ rails new my_intercom_app
24
24
  $ cd my_intercom_app
25
25
  ```
26
26
  Then add `intercom-app` to your Gemfile and bundle install :
27
- `gem 'intercom-app', '>= 0.2.4'`
27
+ `gem 'intercom-app', '>= 0.2.5'`
28
28
  and run :
29
29
  ``` sh
30
30
  $ bundle install
@@ -1,23 +1,23 @@
1
1
  <% if IntercomApp.configuration.oauth_modal %>
2
- <a href="javascript:void(0)" class="intercom-oauth-cta">
2
+ <a href="javascript:authPopup('/auth/intercom')">
3
3
  <img src="https://static.intercomassets.com/assets/oauth/primary-7edb2ebce84c088063f4b86049747c3a.png" srcset="https://static.intercomassets.com/assets/oauth/primary-7edb2ebce84c088063f4b86049747c3a.png 1x, https://static.intercomassets.com/assets/oauth/primary@2x-0d69ca2141dfdfa0535634610be80994.png 2x, https://static.intercomassets.com/assets/oauth/primary@3x-788ed3c44d63a6aec3927285e920f542.png 3x"/>
4
4
  </a>
5
5
  <script type="text/javascript">
6
- $('.intercom-oauth-cta').unbind('click').click(function() {
7
- var left = (screen.width/2)-(700/2);
8
- var top = (screen.height/2)-(450/2);
9
- var opts = 'width=700, height=450, top='+top+', left='+left
10
- var auth_window = window.open('/auth/intercom', 'Sign in', opts);
11
- var checkWindow = function() {
12
- if (auth_window.closed) {
6
+ authPopup = function(url) {
7
+ var left = (screen.width/2)-(700/2);
8
+ var top = (screen.height/2)-(450/2);
9
+ var opts = 'width=700, height=450, top='+top+', left='+left
10
+ var auth_window = window.open(url, 'Sign in', opts);
11
+ var checkWindow = function() {
12
+ if (auth_window.closed) {
13
13
  window.location = '/';
14
- } else if (window.oauth_success === undefined) {
15
- setTimeout(checkWindow, 200);
14
+ } else if (window.oauth_success === undefined) {
15
+ setTimeout(checkWindow, 200);
16
16
  }
17
- };
17
+ };
18
18
  checkWindow();
19
- });
20
- </script>
19
+ };
20
+ </script>
21
21
  <% else %>
22
22
  <a href="/auth/intercom">
23
23
  <img src="https://static.intercomassets.com/assets/oauth/primary-7edb2ebce84c088063f4b86049747c3a.png" srcset="https://static.intercomassets.com/assets/oauth/primary-7edb2ebce84c088063f4b86049747c3a.png 1x, https://static.intercomassets.com/assets/oauth/primary@2x-0d69ca2141dfdfa0535634610be80994.png 2x, https://static.intercomassets.com/assets/oauth/primary@3x-788ed3c44d63a6aec3927285e920f542.png 3x"/>
@@ -19,8 +19,8 @@ Gem::Specification.new do |s|
19
19
 
20
20
  s.required_ruby_version = '>= 2.2.2'
21
21
 
22
- s.add_runtime_dependency 'intercom', '~> 3.5'
23
- s.add_runtime_dependency 'omniauth-intercom', '~>0.1'
22
+ s.add_runtime_dependency 'intercom', '~> 3.5.8'
23
+ s.add_runtime_dependency 'omniauth-intercom', '~> 0.1.3'
24
24
 
25
25
  s.add_development_dependency 'rails', '~> 4.2'
26
26
  s.add_development_dependency 'sqlite3', '~> 1.3'
@@ -15,9 +15,11 @@ module IntercomApp
15
15
 
16
16
  def create_intercom_css
17
17
  copy_file 'intercom.css', 'app/assets/stylesheets/intercom.css'
18
+ copy_file 'emoji.css', 'app/assets/stylesheets/emoji.css'
18
19
  end
19
20
 
20
- def create_intercom_logo
21
+ def create_logo
22
+ copy_file 'logo.png', 'app/assets/images/logos/logo.png'
21
23
  copy_file 'intercom.png', 'app/assets/images/logos/intercom.png'
22
24
  end
23
25
 
@@ -0,0 +1,5 @@
1
+ .emoji {
2
+ font-weight: normal;
3
+ font-size: 28px;
4
+ font-family: "Apple Color Emoji","Segoe UI Emoji","NotoColorEmoji","Segoe UI Symbol","Android Emoji","EmojiSymbols";
5
+ }
@@ -2,7 +2,7 @@ class HomeController < IntercomApp::AuthenticatedController
2
2
 
3
3
  def index
4
4
  # Example of an API request using intercom-ruby gem
5
- # Request 'read users' permission for the following request
6
- # @users_names = @intercom_client.users.find_all(:type=>'users', :per_page => 10, :page => 1, :order => "desc", :sort => "created_at").map(&:name)
5
+ # Need 'read single admin' permission for the following request
6
+ @me = intercom_client.admins.me
7
7
  end
8
8
  end
@@ -1,10 +1,40 @@
1
- <a href="/auth/intercom">
2
- <img src="https://static.intercomassets.com/assets/oauth/primary-7edb2ebce84c088063f4b86049747c3a.png" srcset="https://static.intercomassets.com/assets/oauth/primary-7edb2ebce84c088063f4b86049747c3a.png 1x, https://static.intercomassets.com/assets/oauth/primary@2x-0d69ca2141dfdfa0535634610be80994.png 2x, https://static.intercomassets.com/assets/oauth/primary@3x-788ed3c44d63a6aec3927285e920f542.png 3x"/>
3
- </a>
4
- <h1>Intercom application</h1>
5
- <!-- <h2>Users list:</h2>
6
- <ul>
7
- <% @users_names.each do | name | %>
8
- <li> <%= name %></li>
9
- <% end %> -->
10
- </ul>
1
+ <div class="card" style="max-width: 600px; margin: 0 auto;margin-top: 120px;">
2
+ <div class="card__inner">
3
+ <div class="layout__box o__has-raws o__flexes-to-1" style="width: 100%;">
4
+ <div class="layout__box" style="text-align: center;margin-bottom: 20px;align-items: center;justify-content: center;">
5
+ <div class="layout__box o__has-columns o__flexes-to-1" style="text-align: center;height:200px;align-items: center;justify-content: center;">
6
+ <div class="layout__box avatar__container o__medium" style="width: 50px;">
7
+ <span class="avatar o__contained">
8
+ <%= image_tag("logos/logo.png", :class => "avatar__media") %>
9
+ </span>
10
+ </div>
11
+ <span class="layout__box" style="margin:50px;margin-top:100px"><span class="emoji">&#10084;</span></span>
12
+ <div class="layout__box avatar__container o__medium" style="width: 35px;margin-top:5px">
13
+ <span class="avatar o__contained">
14
+ <%= image_tag("logos/intercom.png", :class => "avatar__media") %>
15
+ </span>
16
+ </div>
17
+ </div>
18
+ <h1 class="t__h1">You've got Intercom</h1>
19
+ <p style="margin-bottom: 20px">Get to know your customers:</p>
20
+ <strong>Segment them</strong> as new, loyal, or slipping away</br>
21
+ <strong>Watch what they do</strong> in your store</br>
22
+ <strong>Send them messages</strong> with an Intercom product
23
+ <div class="layout__box" style="text-align: center;margin: 20px">
24
+ <span class="btn o__primary" onclick="window.open('https://app.intercom.io/a/apps/<%= @app_id %>')">Go to your Intercom Inbox</span>
25
+ </div>
26
+ </div>
27
+ <div class="card__expanded-content o__visible layout__box" style="text-align: center; ">
28
+ <div class="card__inner">
29
+ <div class="outside-text">Did you sign in to the wrong Intercom app?</br>
30
+ <% if IntercomApp.configuration.oauth_modal %>
31
+ <a href="javascript:authPopup('/auth/intercom')">Sign in again and choose a new application</a>
32
+ <% else %>
33
+ <a href="/auth/intercom">Sign in again and choose a new application
34
+ </a>
35
+ <% end %>
36
+ </div>
37
+ </div>
38
+ </div>
39
+ </div>
40
+ </div>
@@ -9,7 +9,6 @@ module IntercomApp
9
9
  def intercom_session
10
10
  if app_session
11
11
  begin
12
- @intercom_client = Intercom::Client.new(token: app_session[:intercom_token])
13
12
  yield
14
13
  end
15
14
  else
@@ -19,11 +18,15 @@ module IntercomApp
19
18
 
20
19
  def app_session
21
20
  return unless session[:intercom]
22
- @intercom_session ||= IntercomApp::SessionRepository.retrieve(session[:intercom])
21
+ @app_session ||= IntercomApp::SessionRepository.retrieve(session[:intercom])
23
22
  end
24
23
 
25
24
  protected
26
25
 
26
+ def intercom_client
27
+ @intercom_client = Intercom::Client.new(token: app_session[:intercom_token])
28
+ end
29
+
27
30
  def redirect_to_login
28
31
  if request.xhr?
29
32
  head :unauthorized
@@ -12,11 +12,7 @@ module IntercomApp
12
12
 
13
13
  def retrieve(id)
14
14
  return unless id
15
- if app = self.find_by(id: id)
16
- session = {}
17
- app.instance_variables{|k| session[k] = app[k]}
18
- session
19
- end
15
+ self.find_by(id: id)
20
16
  end
21
17
  end
22
18
  end
@@ -1,3 +1,3 @@
1
1
  module IntercomApp
2
- VERSION = '0.2.4'
2
+ VERSION = '0.2.5'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: intercom-app
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Antoine
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '3.5'
19
+ version: 3.5.8
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '3.5'
26
+ version: 3.5.8
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: omniauth-intercom
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0.1'
33
+ version: 0.1.3
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '0.1'
40
+ version: 0.1.3
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rails
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -155,10 +155,12 @@ files:
155
155
  - lib/generators/intercom_app/controllers/controllers_generator.rb
156
156
  - lib/generators/intercom_app/home_controller/home_controller_generator.rb
157
157
  - lib/generators/intercom_app/home_controller/templates/application.html.erb
158
+ - lib/generators/intercom_app/home_controller/templates/emoji.css
158
159
  - lib/generators/intercom_app/home_controller/templates/home_controller.rb
159
160
  - lib/generators/intercom_app/home_controller/templates/index.html.erb
160
161
  - lib/generators/intercom_app/home_controller/templates/intercom.css
161
162
  - lib/generators/intercom_app/home_controller/templates/intercom.png
163
+ - lib/generators/intercom_app/home_controller/templates/logo.png
162
164
  - lib/generators/intercom_app/install/install_generator.rb
163
165
  - lib/generators/intercom_app/install/templates/intercom_app.rb
164
166
  - lib/generators/intercom_app/install/templates/intercom_provider.rb
@@ -199,7 +201,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
199
201
  version: '0'
200
202
  requirements: []
201
203
  rubyforge_project:
202
- rubygems_version: 2.6.1
204
+ rubygems_version: 2.4.8
203
205
  signing_key:
204
206
  specification_version: 4
205
207
  summary: Intercom.io ruby application boilerplate