Skip to content

Commit f53d4f4

Browse files
author
bmarkons
committed
Add form to run releases in admin page
1 parent 5ae20cb commit f53d4f4

4 files changed

Lines changed: 43 additions & 10 deletions

File tree

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
$(document).on('turbolinks:load', function() {
2-
$('#manual_run_form').submit(function(event) {
2+
$('#commits_run_form').submit(function(event) {
33
$('#notice').remove();
4-
$('#wait_alert').removeClass('hidden');
4+
$('#wait_commits_alert').removeClass('hidden');
5+
});
6+
7+
$('#releases_run_form').submit(function(event) {
8+
$('#notice').remove();
9+
$('#wait_releases_alert').removeClass('hidden');
510
});
611
});
712

app/views/admin/repos/show.html.haml

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,41 @@
77
#notice.alert.alert-success
88
= notice
99

10-
#wait_alert.alert.alert-warning.hidden
11-
= t('admin.wait_manual_run')
12-
10+
#wait_commits_alert.alert.alert-warning.hidden
11+
= t('admin.wait_commits_run')
12+
13+
#wait_releases_alert.alert.alert-warning.hidden
14+
= t('admin.wait_releases_run')
15+
.row
16+
.col-lg-6
1317
.panel.panel-warning
18+
.panel-heading
19+
= t('admin.commits_run_header')
1420
.panel-body
15-
= form_tag(admin_run_commits_path(@repo.name), id: 'manual_run_form') do
21+
= form_tag(admin_run_commits_path(@repo.name), id: 'commits_run_form') do
1622
.form-group
1723
= label_tag(t('admin.manual_run_pattern_label'))
1824
= text_field_tag(:pattern, 'all', class: 'form-control')
1925

2026
.form-group
21-
= label_tag(t('admin.manual_run_count_label'))
27+
= label_tag(t('admin.commits_run_count_label'))
2228
= select_tag(:count, options_for_select(ManualRunner::OPTIONS, ManualRunner::OPTIONS.last), class: 'form-control')
2329

2430
= button_tag(t('admin.manual_run_button'), class: 'btn btn-default')
31+
32+
.col-lg-6
33+
.panel.panel-warning
34+
.panel-heading
35+
= t('admin.releases_run_header')
36+
.panel-body
37+
= form_tag(admin_run_releases_path(@repo.name), id: 'releases_run_form') do
38+
.form-group
39+
= label_tag(t('admin.manual_run_pattern_label'))
40+
= text_field_tag(:pattern, 'all', class: 'form-control')
41+
42+
.form-group
43+
= label_tag(t('admin.releases_run_versions_label'))
44+
= text_field_tag(:versions, '', class: 'form-control')
45+
<p><i>For example: 3.0.0,4.0.0,5.0.0</i></p>
46+
47+
= button_tag(t('admin.manual_run_button'), class: 'btn btn-default')

config/locales/en.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,17 @@ en:
9595
commit_url: Click on a point to view and compare commits on GitHub
9696

9797
admin:
98-
wait_manual_run: 'Wait while selected runs are being queued...'
98+
commits_run_header: 'Run commits'
99+
releases_run_header: 'Run releases'
100+
wait_commits_run: 'Wait while selected runs are being queued...'
101+
wait_releases_run: 'Wait while selected versions are being queued...'
99102
manual_run_pattern_label: 'Pattern:'
100-
manual_run_count_label: 'Run last:'
103+
commits_run_count_label: 'Run last:'
104+
releases_run_versions_label: 'Versions:'
101105
manual_run_button: 'Run'
102106
dashboard: 'Dashboard'
103107
repositories: 'Repositories'
104108
groups:
105109
new: 'New group'
106110
edit: 'Edit group'
107-
title: 'Benchmark groups'
111+
title: 'Benchmark groups'

config/routes.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,6 @@
2929
get '' => 'dashboard#dashboard', as: :dashboard
3030
get 'repos/:repo_name' => 'repos#show', as: :repo
3131
post 'repos/:repo_name/run_commits' => 'repos#run_commits', as: :run_commits
32+
post 'repos/:repo_name/run_releases' => 'repos#run_releases', as: :run_releases
3233
end
3334
end

0 commit comments

Comments
 (0)