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 +4 -4
- data/VERSION +1 -1
- data/lib/opsask/app.rb +27 -2
- data/lib/opsask/helpers.rb +8 -8
- data/public/css/style.css +1 -1
- data/public/js/opsask.js +13 -0
- data/views/_form.erb +3 -0
- data/views/layout.erb +4 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 059273659a5289a1e0780e64270cdc848d11e952
|
4
|
+
data.tar.gz: 35af36122a71a36d9701c9dcde00c42ea626cfe3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2358424286dc896a03d256401cc0bbbeaa0ed2a30bb28f38e3595da0259b13fa410a13fa4e5111788c8e47a0aeae4cbb51b3aca3e48630a695221a3a1e4dca1b
|
7
|
+
data.tar.gz: 2ebedfaa512641bd2615d95a01d9f8803c3251895b8df271136081f13f3fbbf35f31383cb278047058cd3b81fd315ecea1f93f6441fcb314d71a6371dbcf6fe8
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
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
|
-
|
142
|
-
|
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
|
data/lib/opsask/helpers.rb
CHANGED
@@ -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
|
-
#
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
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
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="/
|
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.
|
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-
|
11
|
+
date: 2015-08-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|