zendesk_apps_tools 1.28.3 → 1.29.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 67eddb996c6c3bc0bca9e94e978caeb3f1ac4f0e
4
- data.tar.gz: 827d61d33d2906d156dcf8593577a59953669309
3
+ metadata.gz: 36ee652e6e086cb84215c7031d59b74720297106
4
+ data.tar.gz: 276c247e757b2515224c95c8e70feda75d75d625
5
5
  SHA512:
6
- metadata.gz: e0cdd87af3ef6d8556dcbf379f6f38d7b1b992a91acdf61647ad62904c086f1b6d2903a43c4758b7c36f81bb9bf9bd96ecb3be48f70aa4755f5ac271a4cb5cfd
7
- data.tar.gz: 17739f8fac3fd315f7eada3b91503ec28733649746608eae86d2bb480852ec73cd4632bb2514ed7c07a71a4e9ad4df206d368565d33be68c7225fa40f31946bd
6
+ metadata.gz: 5674be616d6d6ae41363e1cd9ceba758ab128f526d6cdf25ba954831c48131370d3ccae91b3ba9e1f3eb4b9ddbd5ed5b7460713d7df143dfa26990dea1aed1b4
7
+ data.tar.gz: b3d2e7cae634d1259360574b76d5f215780b972329ec9d578fd9e1baf0f6859699ec680ad0d3f1e852c12927c6bf109b81ea87e32e62c26a34421957ad9df5a9
@@ -7,7 +7,7 @@
7
7
  },
8
8
  "defaultLocale": "en",
9
9
  "private": true,
10
- "location": "ticket_sidebar",
10
+ "location": ["ticket_sidebar"],
11
11
  "version": "1.0",
12
12
  "frameworkVersion": "1.0"
13
13
  }
@@ -1,54 +1,16 @@
1
1
  {
2
2
  "app": {
3
- "package": "app_name",
4
- "description": {
5
- "value": "Play the famous zen tunes in your help desk.",
6
- "title": "app description"
7
- },
8
- "name": {
9
- "value": "Buddha Machine",
10
- "title": "app name"
11
- }
3
+ "description": "Play the famous zen tunes in your help desk.",
4
+ "name": "Buddha Machine"
12
5
  },
13
-
14
- "loading": {
15
- "value": "Welcome to this Sample App",
16
- "title": "loading placeholder"
17
- },
18
-
6
+ "loading": "Welcome to this Sample App",
19
7
  "fetch": {
20
- "done": {
21
- "value": "Good",
22
- "title": "fetch success"
23
- },
24
- "fail": {
25
- "value": "failed to fetch information from the server",
26
- "title": "fetch failure"
27
- }
28
- },
29
-
30
- "id": {
31
- "value": "ID",
32
- "title": "user id"
33
- },
34
-
35
- "email": {
36
- "value": "Email",
37
- "title": "user email"
38
- },
39
-
40
- "name": {
41
- "value": "Name",
42
- "title": "user name"
43
- },
44
-
45
- "role": {
46
- "value": "Role",
47
- "title": "user role"
8
+ "done": "Good",
9
+ "fail": "failed to fetch information from the server"
48
10
  },
49
-
50
- "groups": {
51
- "value": "Groups",
52
- "title": "user groups"
53
- }
11
+ "id": "ID",
12
+ "email": "Email",
13
+ "name": "Name",
14
+ "role": "Role",
15
+ "groups": "Groups"
54
16
  }
@@ -0,0 +1,14 @@
1
+ # App name
2
+
3
+ [brief description of the app]
4
+
5
+ ### The following information is displayed:
6
+
7
+ * info1
8
+ * info2
9
+ * info3
10
+
11
+ Please submit bug reports to [Insert Link](). Pull requests are welcome.
12
+
13
+ ### Screenshot(s):
14
+ [put your screenshots down here.]
@@ -0,0 +1,16 @@
1
+ <html>
2
+ <body>
3
+ <!-- https://github.com/zendesk/zendesk_app_framework_sdk -->
4
+ <script type="text/javascript" src="http://assets.zendesk.com/apps/sdk/latest/zaf_sdk.js"></script>
5
+ <script>
6
+ // Initialise the Zendesk JavaScript API client
7
+ // https://developer.zendesk.com/apps/docs/agent/iframes_in_apps
8
+ var app = window.ZAFClient.init(function(context) {
9
+ var currentUser = context.currentUser;
10
+ console.log('Hi ' + currentUser.name);
11
+ });
12
+ app.postMessage('helloApp', { works: true });
13
+ </script>
14
+ <p>It works!</p>
15
+ </body>
16
+ </html>
Binary file
@@ -0,0 +1,15 @@
1
+ {
2
+ "name": "<%= @app_name %>",
3
+ "author": {
4
+ "name": "<%= @author_name %>",
5
+ "email": "<%= @author_email %>",
6
+ "url": "<%= @author_url %>"
7
+ },
8
+ "defaultLocale": "en",
9
+ "private": true,
10
+ "location": { "zendesk":
11
+ { "ticket_sidebar": "<%= @iframe_location %>" }
12
+ },
13
+ "version": "1.0",
14
+ "frameworkVersion": "1.0"
15
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "app": {
3
+ "description": "Play the famous zen tunes in your help desk.",
4
+ "name": "Buddha Machine"
5
+ },
6
+ "loading": "Welcome to this Sample App",
7
+ "fetch": {
8
+ "done": "Good",
9
+ "fail": "failed to fetch information from the server"
10
+ },
11
+ "id": "ID",
12
+ "email": "Email",
13
+ "name": "Name",
14
+ "role": "Role",
15
+ "groups": "Groups"
16
+ }
data/features/new.feature CHANGED
@@ -13,113 +13,105 @@ Feature: create a template for a new zendesk app
13
13
  Then the app file "manifest.json" is created
14
14
  And I reset the working directory
15
15
 
16
- Scenario: create a template for a new zendesk app by running 'zat new' command
17
- Given an app directory "tmp/aruba" exists
18
- When I run "zat new" command with the following details:
19
- | author name | John Citizen |
20
- | author email | john@example.com |
21
- | author url | http://myapp.com |
22
- | app name | John Test App |
23
- | app dir | tmp/aruba |
24
-
25
- Then the app file "tmp/aruba/manifest.json" is created with:
26
- """
27
- {
28
- "name": "John Test App",
29
- "author": {
30
- "name": "John Citizen",
31
- "email": "john@example.com",
32
- "url": "http://myapp.com"
33
- },
34
- "defaultLocale": "en",
35
- "private": true,
36
- "location": "ticket_sidebar",
37
- "version": "1.0",
38
- "frameworkVersion": "1.0"
39
- }
40
- """
41
- And the app file "tmp/aruba/app.js" is created with:
42
- """
43
- (function() {
44
-
45
- return {
46
- events: {
47
- 'app.activated':'doSomething'
48
- },
16
+ Scenario: create a template for a new zendesk app by running 'zat new' command
17
+ Given an app directory "tmp/aruba" exists
18
+ When I run "zat new" command with the following details:
19
+ | author name | John Citizen |
20
+ | author email | john@example.com |
21
+ | author url | http://myapp.com |
22
+ | app name | John Test App |
23
+ | app dir | tmp/aruba |
49
24
 
50
- doSomething: function() {
51
- }
52
- };
25
+ Then the app file "tmp/aruba/manifest.json" is created with:
26
+ """
27
+ {
28
+ "name": "John Test App",
29
+ "author": {
30
+ "name": "John Citizen",
31
+ "email": "john@example.com",
32
+ "url": "http://myapp.com"
33
+ },
34
+ "defaultLocale": "en",
35
+ "private": true,
36
+ "location":["ticket_sidebar"],
37
+ "version": "1.0",
38
+ "frameworkVersion": "1.0"
39
+ }
40
+ """
41
+ And the app file "tmp/aruba/app.js" is created with:
42
+ """
43
+ (function() {
53
44
 
54
- }());
55
- """
56
- And the app file "tmp/aruba/templates/layout.hdbs" is created with:
57
- """
58
- <header>
59
- <span class="logo"></span>
60
- <h3>{{setting "name"}}</h3>
61
- </header>
62
- <section data-main></section>
63
- <footer>
64
- <a href="mailto:{{author.email}}">
65
- {{author.name}}
66
- </a>
67
- </footer>
68
- """
69
- And the app file "tmp/aruba/translations/en.json" is created with:
70
- """
71
- {
72
- "app": {
73
- "package": "app_name",
74
- "description": {
75
- "value": "Play the famous zen tunes in your help desk.",
76
- "title": "app description"
77
- },
78
- "name": {
79
- "value": "Buddha Machine",
80
- "title": "app name"
81
- }
82
- },
45
+ return {
46
+ events: {
47
+ 'app.activated':'doSomething'
48
+ },
83
49
 
84
- "loading": {
85
- "value": "Welcome to this Sample App",
86
- "title": "loading placeholder"
87
- },
50
+ doSomething: function() {
51
+ }
52
+ };
88
53
 
89
- "fetch": {
90
- "done": {
91
- "value": "Good",
92
- "title": "fetch success"
93
- },
94
- "fail": {
95
- "value": "failed to fetch information from the server",
96
- "title": "fetch failure"
97
- }
98
- },
54
+ }());
55
+ """
56
+ And the app file "tmp/aruba/templates/layout.hdbs" is created with:
57
+ """
58
+ <header>
59
+ <span class="logo"></span>
60
+ <h3>{{setting "name"}}</h3>
61
+ </header>
62
+ <section data-main></section>
63
+ <footer>
64
+ <a href="mailto:{{author.email}}">
65
+ {{author.name}}
66
+ </a>
67
+ </footer>
68
+ """
69
+ And the app file "tmp/aruba/translations/en.json" is created with:
70
+ """
71
+ {
72
+ "app": {
73
+ "description": "Play the famous zen tunes in your help desk.",
74
+ "name": "Buddha Machine"
75
+ },
76
+ "loading": "Welcome to this Sample App",
77
+ "fetch": {
78
+ "done": "Good",
79
+ "fail": "failed to fetch information from the server"
80
+ },
81
+ "id": "ID",
82
+ "email": "Email",
83
+ "name": "Name",
84
+ "role": "Role",
85
+ "groups": "Groups"
86
+ }
87
+ """
99
88
 
100
- "id": {
101
- "value": "ID",
102
- "title": "user id"
103
- },
89
+ Scenario: create a template for a new iframe only app by running 'zat new --iframe-only' command
90
+ Given an app directory "tmp/aruba" exists
91
+ And I move to the app directory
92
+ When I run "zat new --iframe-only" command with the following details:
93
+ | author name | John Citizen |
94
+ | author email | john@example.com |
95
+ | author url | http://myapp.com |
96
+ | app name | John Test App |
97
+ | iframe uri | assets/index.html |
98
+ | app dir | tmp/aruba |
104
99
 
105
- "email": {
106
- "value": "Email",
107
- "title": "user email"
108
- },
109
-
110
- "name": {
111
- "value": "Name",
112
- "title": "user name"
113
- },
114
-
115
- "role": {
116
- "value": "Role",
117
- "title": "user role"
118
- },
119
-
120
- "groups": {
121
- "value": "Groups",
122
- "title": "user groups"
123
- }
100
+ Then the app file "tmp/aruba/manifest.json" is created with:
101
+ """
102
+ {
103
+ "name": "John Test App",
104
+ "author": {
105
+ "name": "John Citizen",
106
+ "email": "john@example.com",
107
+ "url": "http://myapp.com"
108
+ },
109
+ "defaultLocale": "en",
110
+ "private": true,
111
+ "location": { "zendesk":
112
+ { "ticket_sidebar": "assets/index.html" }
113
+ },
114
+ "version": "1.0",
115
+ "frameworkVersion": "1.0"
124
116
  }
125
117
  """
@@ -80,7 +80,7 @@ Given /^I remove file "(.*?)"$/ do |file|
80
80
  end
81
81
 
82
82
  Then /^the zip file in "(.*?)" folder should not exist$/ do |path|
83
- Dir[path + '/app-*.zip'].size.should == 0
83
+ expect(Dir[path + '/app-*.zip'].size).to eq 0
84
84
  end
85
85
 
86
86
  Then /^it should pass the validation$/ do
@@ -29,15 +29,40 @@ module ZendeskAppsTools
29
29
  subcommand 'bump', Bump
30
30
 
31
31
  desc 'new', 'Generate a new app'
32
+ method_option :'iframe-only', type: :boolean,
33
+ default: false,
34
+ desc: 'Create an iFrame Only app template',
35
+ aliases: '-i'
32
36
  def new
33
- @author_name = get_value_from_stdin("Enter this app author's name:\n", error_msg: 'Invalid name, try again:')
34
- @author_email = get_value_from_stdin("Enter this app author's email:\n", valid_regex: /^.+@.+\..+$/, error_msg: 'Invalid email, try again:')
35
- @author_url = get_value_from_stdin("Enter this app author's url:\n", valid_regex: /^https?:\/\/.+$/, error_msg: 'Invalid url, try again:', allow_empty: true)
36
- @app_name = get_value_from_stdin("Enter a name for this new app:\n", error_msg: 'Invalid app name, try again:')
37
+ enter = ->(variable) { "Enter this app author's #{variable}:\n" }
38
+ invalid = ->(variable) { "Invalid #{variable}, try again:" }
39
+ @author_name = get_value_from_stdin(enter.call('name'),
40
+ error_msg: invalid.call('name'))
41
+ @author_email = get_value_from_stdin(enter.call('email'),
42
+ valid_regex: /^.+@.+\..+$/,
43
+ error_msg: invalid.call('email'))
44
+ @author_url = get_value_from_stdin(enter.call('url'),
45
+ valid_regex: %r{^https?://.+$},
46
+ error_msg: invalid.call('url'),
47
+ allow_empty: true)
48
+ @app_name = get_value_from_stdin("Enter a name for this new app:\n",
49
+ error_msg: invalid.call('app name'))
50
+
51
+ @iframe_location = if options[:'iframe-only']
52
+ iframe_uri_text = 'Enter your iFrame URI or leave it blank to use'\
53
+ " a default local template page:\n"
54
+ value = get_value_from_stdin(iframe_uri_text, allow_empty: true)
55
+ value == '' ? 'assets/iframe.html' : value
56
+ else
57
+ '_legacy'
58
+ end
37
59
 
38
60
  prompt_new_app_dir
39
61
 
40
- directory('app_template', @app_dir)
62
+ skeleton = options[:'iframe-only'] ? 'app_template_iframe' : 'app_template'
63
+ is_custom_iframe = options[:'iframe-only'] && @iframe_location != 'assets/iframe.html'
64
+ directory_options = is_custom_iframe ? { exclude_pattern: /iframe.html/ } : {}
65
+ directory(skeleton, @app_dir, directory_options)
41
66
  end
42
67
 
43
68
  desc 'validate', 'Validate your app'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zendesk_apps_tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.28.3
4
+ version: 1.29.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - James A. Rosen
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2016-01-07 00:00:00.000000000 Z
14
+ date: 2016-02-22 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: thor
@@ -75,14 +75,14 @@ dependencies:
75
75
  requirements:
76
76
  - - "~>"
77
77
  - !ruby/object:Gem::Version
78
- version: 1.21.1
78
+ version: '1.23'
79
79
  type: :runtime
80
80
  prerelease: false
81
81
  version_requirements: !ruby/object:Gem::Requirement
82
82
  requirements:
83
83
  - - "~>"
84
84
  - !ruby/object:Gem::Version
85
- version: 1.21.1
85
+ version: '1.23'
86
86
  - !ruby/object:Gem::Dependency
87
87
  name: cucumber
88
88
  requirement: !ruby/object:Gem::Requirement
@@ -173,6 +173,14 @@ files:
173
173
  - app_template/manifest.json.tt
174
174
  - app_template/templates/layout.hdbs
175
175
  - app_template/translations/en.json
176
+ - app_template_iframe/README.md
177
+ - app_template_iframe/assets/banner.png
178
+ - app_template_iframe/assets/iframe.html
179
+ - app_template_iframe/assets/logo-promotion.png
180
+ - app_template_iframe/assets/logo-small.png
181
+ - app_template_iframe/assets/logo.png
182
+ - app_template_iframe/manifest.json.tt
183
+ - app_template_iframe/translations/en.json
176
184
  - bin/zat
177
185
  - features/clean.feature
178
186
  - features/fixtures/quote_character_translation.json
@@ -218,7 +226,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
218
226
  version: 1.3.6
219
227
  requirements: []
220
228
  rubyforge_project:
221
- rubygems_version: 2.4.5
229
+ rubygems_version: 2.4.5.1
222
230
  signing_key:
223
231
  specification_version: 4
224
232
  summary: Tools to help you develop Zendesk Apps.
@@ -230,3 +238,4 @@ test_files:
230
238
  - features/step_definitions/app_steps.rb
231
239
  - features/support/env.rb
232
240
  - features/validate.feature
241
+ has_rdoc: