opsask 2.1.8 → 2.1.9

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: af93ae578c607f384a72e4b183930e9f212b4c5d
4
- data.tar.gz: 82c16c2e1a331d95082383cb26100b016849b3ba
3
+ metadata.gz: 4f3245625d9bf275d4572fdfc4fa5201a137e968
4
+ data.tar.gz: 8ac79891039bab1e396b2a98908012fb8e9a28ab
5
5
  SHA512:
6
- metadata.gz: f9be32baa6228b3226486f3f631ef7d923c04171e587b2ff71f824aed35729e68d982a441ad9b53c7722e8025a7ecfd7b7ee8e66dab57b6d42c91f4d425cb1aa
7
- data.tar.gz: 24e603e77d9d4c3d857d3f9b5288d4ce9297ee20fe53ac716dcef74e13f5e135cfa4276552ab2bc2b377db87af0d5d9d820809d6a69aa5a85817190d2d0cf4f7
6
+ metadata.gz: 14251899fadd6128bb20fbbb26ca1319e98a7799db5d34beb02949bbd352ef31531b30deaa94ab7704bd5f7c956d512ec8e59fb1d8238991217ef0e4dd8f65dc
7
+ data.tar.gz: 0440bde8b454f4a86213f0e66a94edd97c426f1db06a8c91188be647d33ef97e64356c36afcb84ffaa27f2f9346d3d27f1d87121c42b46ca427ba9af978ef63a
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.1.8
1
+ 2.1.9
@@ -247,21 +247,22 @@ module OpsAsk
247
247
  todays_date.strftime 'Week of %-d %b'
248
248
  end
249
249
 
250
- def jiras_for date
250
+ def jiras_for date, really=false
251
251
  return [] unless logged_in?
252
- unless ops?
253
- return @jira_client.Issue.jql normalized_jql("due = #{date} and type != Change and labels in (OpsAsk) and labels not in (OpsOnly)"), max_results: 100
252
+ if !ops? || really
253
+ @jira_client.Issue.jql normalized_jql("due = #{date} and type != Change and labels in (OpsAsk) and labels not in (OpsOnly)"), max_results: 100
254
+ else
255
+ @jira_client.Issue.jql normalized_jql("due = #{date} and labels in (OpsAsk) and type != Change"), max_results: 100
254
256
  end
255
- return @jira_client.Issue.jql normalized_jql("due = #{date} and labels in (OpsAsk) and type != Change"), max_results: 100
256
257
  end
257
258
 
258
- def jira_count_for date
259
- jiras_for(date).length
259
+ def jira_count_for date, really=false
260
+ jiras_for(date, really).length
260
261
  end
261
262
 
262
- def jira_count_for_today ; jira_count_for(today) end
263
+ def jira_count_for_today really=false ; jira_count_for(today, really) end
263
264
 
264
- def jira_count_for_tomorrow ; jira_count_for(tomorrow) end
265
+ def jira_count_for_tomorrow really=false ; jira_count_for(tomorrow, really) end
265
266
 
266
267
  def raw_classes_for jira
267
268
  classes = [ jira.fields['resolution'].nil? ? 'open' : 'closed' ]
@@ -290,28 +291,28 @@ module OpsAsk
290
291
  now.saturday? || now.sunday?
291
292
  end
292
293
 
293
- def room_for_new_jiras_for? date
294
- return true if params[:force]
294
+ def room_for_new_jiras_for? date, really=false
295
+ return true if params[:force]
295
296
  return false if params[:full]
296
- return true if ops?
297
- jira_count_for(date) < settings.config[:queue_size]
297
+ return true if ops? && !really
298
+ jira_count_for(date, really) < settings.config[:queue_size]
298
299
  end
299
300
 
300
- def date_for_new_jiras
301
+ def date_for_new_jiras really=false
301
302
  if now.hour < settings.config[:cutoff_hour] || its_the_weekend?
302
- return today if room_for_new_jiras_for? today
303
- return tomorrow if room_for_new_jiras_for? tomorrow
303
+ return today if room_for_new_jiras_for? today, really
304
+ return tomorrow if room_for_new_jiras_for? tomorrow, really
304
305
  else
305
- return tomorrow if room_for_new_jiras_for? tomorrow
306
+ return tomorrow if room_for_new_jiras_for? tomorrow, really
306
307
  end
307
308
  return nil
308
309
  end
309
310
 
310
- def room_for_new_jiras?
311
- return true if params[:force]
311
+ def room_for_new_jiras? really=false
312
+ return true if params[:force]
312
313
  return false if params[:full]
313
- return true if ops?
314
- !date_for_new_jiras.nil?
314
+ return true if ops? && !really
315
+ !date_for_new_jiras(really).nil?
315
316
  end
316
317
 
317
318
  def validate_room_for_new_jiras
data/public/css/style.css CHANGED
@@ -205,4 +205,11 @@ input[type="checkbox"] + label {
205
205
  #more-stats {
206
206
  margin-top: 1em;
207
207
  text-align: center;
208
+ }
209
+
210
+ #opsonly-full {
211
+ display: inline-block;
212
+ text-align: right;
213
+ float: right;
214
+ margin-top: 1em;
208
215
  }
data/views/index.erb CHANGED
@@ -18,7 +18,11 @@
18
18
  <% end %>
19
19
 
20
20
  <section id="ops-ask" class="small-4 columns">
21
- <h2>Create JIRA</h2>
21
+ <h2>Create JIRA
22
+ <% unless logged_in? && ops? && room_for_new_jiras?(true) %>
23
+ <span id="opsonly-full" class="alert label radius">Full</span>
24
+ <% end %>
25
+ </h2>
22
26
  <%= partial :form, locals: {
23
27
  jiras_for_today: jiras_for_today,
24
28
  jiras_for_tomorrow: jiras_for_tomorrow
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.1.8
4
+ version: 2.1.9
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-03-13 00:00:00.000000000 Z
11
+ date: 2015-04-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -206,7 +206,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
206
206
  version: '0'
207
207
  requirements: []
208
208
  rubyforge_project:
209
- rubygems_version: 2.2.2
209
+ rubygems_version: 2.4.5
210
210
  signing_key:
211
211
  specification_version: 4
212
212
  summary: Ask Ops for stuff