Skip to content

Commit ad82dbb

Browse files
Fix capitalization
1 parent 5a1838a commit ad82dbb

File tree

4 files changed

+14
-19
lines changed

4 files changed

+14
-19
lines changed

app/controllers/miq_ae_class_controller.rb

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2820,11 +2820,6 @@ def git_refresh
28202820
@branch_names = git_repo.git_branches.collect(&:name)
28212821
@tag_names = git_repo.git_tags.collect(&:name)
28222822
@ref_type = MiqAeDomain.find(params[:id]).ref_type
2823-
if @ref_type == "tag"
2824-
@ref_type = "Tag"
2825-
elsif @ref_type == "branch"
2826-
@ref_type = "Branch"
2827-
end
28282823
@ref_name = MiqAeDomain.find(params[:id]).ref
28292824
@git_repo_id = git_repo.id
28302825
@right_cell_text = _("Refreshing branch/tag for Git-based Domain")

app/javascript/oldjs/automate_import_export.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -216,18 +216,18 @@ window.Automate = {
216216
},
217217

218218
setUpDefaultGitBranchOrTagValue(refType, refName) {
219-
if (refType === 'Branch') {
220-
$('select.git-branch-or-tag').val('Branch');
221-
$('select.git-branch-or-tag-select').val('Branch');
219+
if (refType === 'branch') {
220+
$('select.git-branch-or-tag').val('branch');
221+
$('select.git-branch-or-tag-select').val('branch');
222222

223223
$('select.git-branches').val(refName);
224224
$('select.git-branches').selectpicker('refresh');
225225

226226
$('.git-branch-group').show();
227227
$('.git-tag-group').hide();
228228
} else {
229-
$('select.git-branch-or-tag').val('Tag');
230-
$('select.git-branch-or-tag-select').val('Tag');
229+
$('select.git-branch-or-tag').val('tag');
230+
$('select.git-branch-or-tag-select').val('tag');
231231

232232
$('select.git-tags').val(refName);
233233
$('select.git-tags').selectpicker('refresh');
@@ -247,11 +247,11 @@ window.Automate = {
247247

248248
$('.git-branch-or-tag-select').on('change', function(event) {
249249
event.preventDefault();
250-
if ($(event.currentTarget).val() === 'Branch') {
250+
if ($(event.currentTarget).val() === 'branch') {
251251
$('.git-branch-group').show();
252252
$('.git-tag-group').hide();
253253
$('.git-branch-or-tag').val($('select.git-branches').val());
254-
} else if ($(event.currentTarget).val() === 'Tag') {
254+
} else if ($(event.currentTarget).val() === 'tag') {
255255
$('.git-branch-group').hide();
256256
$('.git-tag-group').show();
257257
$('.git-branch-or-tag').val($('select.git-tags').val());

app/views/miq_ae_class/_git_domain_refresh.html.haml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
= render :partial => "layouts/flash_msg"
2-
- ref_type = @ref_type || "Branch"
2+
- ref_type = @ref_type || "branch"
33
- ref_name = @ref_name || "origin/master"
44
%form#form_div
55
= hidden_field_tag(:git_repo_id, @git_repo_id, :class => "hidden-git-repo-id")
@@ -11,7 +11,7 @@
1111
= _("Branch/Tag")
1212
.col-md-8
1313
= select_tag("branch_or_tag_select",
14-
options_for_select(%w(Branch Tag)),
14+
options_for_select([["#{_('Branch')}", 'branch'], ["#{_('Tag')}", 'tag']]),
1515
:class => "git-branch-or-tag-select selectpicker")
1616

1717
.form-group.git-branch-group

spec/javascripts/automate_import_export_spec.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ describe('Automate', function() {
8484
beforeEach(function() {
8585
var html = '';
8686
html += '<select class="git-branch-or-tag-select">';
87-
html += ' <option value="Branch">Branch</option>';
88-
html += ' <option value="Tag">Tag</option>';
87+
html += ' <option value="branch">Branch</option>';
88+
html += ' <option value="tag">Tag</option>';
8989
html += '</select>';
9090
html += '<div class="git-branch-group"></div>';
9191
html += '<div class="git-tag-group"></div>';
@@ -108,9 +108,9 @@ describe('Automate', function() {
108108
});
109109

110110
describe('when the git-branch-or-select field changes', function() {
111-
describe('when "Branch" is selected', function() {
111+
describe('when "branch" is selected', function() {
112112
beforeEach(function() {
113-
$('.git-branch-or-tag-select').val("Branch");
113+
$('.git-branch-or-tag-select').val("branch");
114114
$('.git-branch-or-tag-select').change();
115115
});
116116

@@ -133,7 +133,7 @@ describe('Automate', function() {
133133

134134
describe('when "Tag" is selected', function() {
135135
beforeEach(function() {
136-
$('.git-branch-or-tag-select').val("Tag");
136+
$('.git-branch-or-tag-select').val("tag");
137137
$('.git-branch-or-tag-select').change();
138138
});
139139

0 commit comments

Comments
 (0)