opsask 2.2.3 → 2.3.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: 5c2a167cc4d6b88c15b8a6f564cd1fb7efe217b3
4
- data.tar.gz: 05219406e6467a1ae5392053fd76433e00399860
3
+ metadata.gz: 059273659a5289a1e0780e64270cdc848d11e952
4
+ data.tar.gz: 35af36122a71a36d9701c9dcde00c42ea626cfe3
5
5
  SHA512:
6
- metadata.gz: 9f9a919aa7ab24df80ec98f0cfba0f1c93ff3ef36ce995193bd3971ad5d96a5647f5ec2d0d21d5740d08f842c632e56fb0ceed4050e5e747ce1050d9cdbe599a
7
- data.tar.gz: ace1363e142fd393f4e927c8440970d69673daeff6a3c2ae817946219d0f28b4641a5e496473abe8205447ee501f40823015573285f5f8ebf2870b83f44c4da9
6
+ metadata.gz: 2358424286dc896a03d256401cc0bbbeaa0ed2a30bb28f38e3595da0259b13fa410a13fa4e5111788c8e47a0aeae4cbb51b3aca3e48630a695221a3a1e4dca1b
7
+ data.tar.gz: 2ebedfaa512641bd2615d95a01d9f8803c3251895b8df271136081f13f3fbbf35f31383cb278047058cd3b81fd315ecea1f93f6441fcb314d71a6371dbcf6fe8
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.2.3
1
+ 2.3.0
data/lib/opsask/app.rb CHANGED
@@ -62,6 +62,16 @@ module OpsAsk
62
62
  }
63
63
  end
64
64
 
65
+ get '/room' do
66
+ content_type :json
67
+ room = {}
68
+ (0..365).each do |n|
69
+ date = today n * one_day
70
+ room[date] = room_for_new_jiras_for? date
71
+ end
72
+ JSON.pretty_generate(room)
73
+ end
74
+
65
75
  get '/untracked' do
66
76
  erb :untracked, locals: {
67
77
  untracked_jiras: untracked_issues,
@@ -136,11 +146,24 @@ module OpsAsk
136
146
  "opsask #{settings.config[:app_version]}"
137
147
  end
138
148
 
149
+ get '/v' do
150
+ content_type :txt
151
+ settings.config[:app_version]
152
+ end
153
+
154
+
139
155
  # Try to create a JIRA
140
156
  post '/' do
141
- duedate = validate_room_for_new_jiras
142
- component, summary, description, assign_to_me, epic, ops_only = validate_jira_params
157
+ component, summary, description, assign_to_me, epic, ops_only, datepicker = validate_jira_params
158
+
159
+ if datepicker.nil? || datepicker.empty?
160
+ duedate = validate_room_for_new_jiras
161
+ else
162
+ duedate = datepicker
163
+ end
164
+
143
165
  jira = create_jira duedate, component, summary, description, assign_to_me, epic, ops_only
166
+
144
167
  if jira.nil? or !jira.has_key?('key')
145
168
  flash[:error] = [ %Q| Failure!
146
169
  JIRA had an issue processing your request. Try again?
@@ -151,9 +174,11 @@ module OpsAsk
151
174
  has been created on your behalf.
152
175
  | ]
153
176
  end
177
+
154
178
  redirect '/'
155
179
  end
156
180
 
181
+
157
182
  # Public assets
158
183
  %w[ css img js fonts ].each do |asset|
159
184
  get "/#{asset}/:file" do
@@ -324,14 +324,13 @@ module OpsAsk
324
324
  if now.hour < settings.config[:cutoff_hour] || its_the_weekend?
325
325
  return today if room_for_new_jiras_for? today, really
326
326
  end
327
- return tomorrow if room_for_new_jiras_for? tomorrow, really
328
327
 
329
- # # Remove the two-day limit [OPS-1862]
330
- # n = 1 # day, i.e. tomorrow
331
- # loop do
332
- # next_day = today n * one_day
333
- # return next_day if room_for_new_jiras_for? next_day, really
334
- # end
328
+ # Remove the two-day limit [OPS-1862]
329
+ n = 1 # day, i.e. tomorrow
330
+ loop do
331
+ next_day = today n * one_day
332
+ return next_day if room_for_new_jiras_for? next_day, really
333
+ end
335
334
  end
336
335
 
337
336
  def room_for_new_jiras? really=false
@@ -358,7 +357,8 @@ module OpsAsk
358
357
  params['jira-description'],
359
358
  !!params['jira-assign_to_me'],
360
359
  params['jira-epic'],
361
- !!params['jira-ops_only']
360
+ !!params['jira-ops_only'],
361
+ params['jira-datepicker']
362
362
  ]
363
363
  end
364
364
 
data/public/css/style.css CHANGED
@@ -108,7 +108,7 @@ select, select:hover {
108
108
  background-color: #222;
109
109
  }
110
110
 
111
- textarea { height: 100px; }
111
+ textarea { height: 200px; }
112
112
 
113
113
  .count.label {
114
114
  float: right;
data/public/js/opsask.js CHANGED
@@ -15,5 +15,18 @@
15
15
  }, 2500);
16
16
  });
17
17
 
18
+ $.get('/room', function(dates){
19
+ $('#jira-datepicker').show().datepicker({
20
+ minDate: new Date(),
21
+ dateFormat: 'yy-mm-dd',
22
+ constrainInput: true,
23
+ beforeShowDay: function(date) {
24
+ date = date.toString('yyyy-MM-dd')
25
+ var room = dates[date];
26
+ if (room === undefined) room = false;
27
+ return [ room ];
28
+ }
29
+ });
30
+ });
18
31
  });
19
32
  })();
data/views/_form.erb CHANGED
@@ -19,6 +19,9 @@
19
19
  <div class="small-12 columns">
20
20
  <textarea id="jira-description" name="jira-description" placeholder="Description (optional)"></textarea>
21
21
  </div>
22
+ <div class="small-12 columns">
23
+ <input type="text" id="jira-datepicker" name="jira-datepicker" placeholder="Due Date (optional)" style="display:none" />
24
+ </div>
22
25
  </div>
23
26
  <div class="row actions">
24
27
  <div class="small-8 columns">
data/views/layout.erb CHANGED
@@ -6,6 +6,7 @@
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
7
  <link href="//fonts.googleapis.com/css?family=Lato:300,400,700" rel="stylesheet" />
8
8
  <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
9
+ <link href="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/flick/jquery-ui.css" rel="stylesheet" />
9
10
  <link rel="stylesheet" href="/css/foundation.css" />
10
11
  <link rel="stylesheet" href="/css/style.css" />
11
12
  <link rel="shortcut icon" href="favicon.ico" />
@@ -35,7 +36,9 @@
35
36
  </div>
36
37
  <% end %>
37
38
  </div>
38
- <script src="/js/vendor/jquery.js"></script>
39
+ <script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
40
+ <script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script>
41
+ <script src="//cdnjs.cloudflare.com/ajax/libs/datejs/1.0/date.min.js"></script>
39
42
  <script src="/js/opsask.js"></script>
40
43
  </body>
41
44
  </html>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opsask
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.3
4
+ version: 2.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Clemmer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-06 00:00:00.000000000 Z
11
+ date: 2015-08-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor