intercom-app 0.2.4 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/README.md +1 -1
- data/app/views/intercom_app/sessions/_connect_button.html.erb +13 -13
- data/intercom-app.gemspec +2 -2
- data/lib/generators/intercom_app/home_controller/home_controller_generator.rb +3 -1
- data/lib/generators/intercom_app/home_controller/templates/emoji.css +5 -0
- data/lib/generators/intercom_app/home_controller/templates/home_controller.rb +2 -2
- data/lib/generators/intercom_app/home_controller/templates/index.html.erb +40 -10
- data/lib/generators/intercom_app/home_controller/templates/logo.png +0 -0
- data/lib/intercom-app/login_protection.rb +5 -2
- data/lib/intercom-app/session_storage.rb +1 -5
- data/lib/intercom-app/version.rb +1 -1
- metadata +8 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6521ba7c3a3b53f3d44eea888bbb433c838e5054
|
4
|
+
data.tar.gz: a03ce39dd76837d72c8abef0d4d2f93699d9ec25
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 077b57c8e27db949d673610e1f3dbdb1f9d28331693745322504dfe56fac8b21e7c6f9ea1176f91518ae9dbb468c5041585cb0f7ef17f5fe4a45f4bebc7cee27
|
7
|
+
data.tar.gz: 5f56e25a296ffafce52d9dec185d11efa44791aa9e12ba3c93da6b4fd869f608f727b7fa2604c6a97f34a742b806ffd0d051cbe56ff4562c03f038a8c8264983
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,23 +1,23 @@
|
|
1
1
|
<% if IntercomApp.configuration.oauth_modal %>
|
2
|
-
<a href="javascript:
|
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
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
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
|
-
|
15
|
-
|
14
|
+
} else if (window.oauth_success === undefined) {
|
15
|
+
setTimeout(checkWindow, 200);
|
16
16
|
}
|
17
|
-
|
17
|
+
};
|
18
18
|
checkWindow();
|
19
|
-
}
|
20
|
-
|
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"/>
|
data/intercom-app.gemspec
CHANGED
@@ -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
|
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
|
|
@@ -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
|
-
#
|
6
|
-
|
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
|
-
<
|
2
|
-
<
|
3
|
-
|
4
|
-
<
|
5
|
-
|
6
|
-
<
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
</
|
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">❤</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>
|
Binary file
|
@@ -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
|
-
@
|
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
|
data/lib/intercom-app/version.rb
CHANGED
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
|
+
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:
|
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:
|
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:
|
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:
|
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.
|
204
|
+
rubygems_version: 2.4.8
|
203
205
|
signing_key:
|
204
206
|
specification_version: 4
|
205
207
|
summary: Intercom.io ruby application boilerplate
|