Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Embedded Ansible repository unsused attributes #5848

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,12 @@ ManageIQ.angular.app.controller('repositoryFormController', ['repositoryId', 'mi
vm.repositoryModel = {
name: '',
description: '',
scm_type: 'git',
scm_url: '',
authentication_id: null,
scm_branch: '',
scm_clean: false,
scm_delete_on_update: false,
scm_update_on_launch: false,
};

vm.attributes = ['name', 'description', 'scm_type', 'scm_url', 'authentication_id', 'scm_branch', 'scm_clean', 'scm_delete_on_update', 'scm_update_on_launch'];
vm.attributes = ['name', 'description', 'scm_url', 'authentication_id', 'scm_branch'];
vm.model = 'repositoryModel';

ManageIQ.angular.scope = vm;
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/mixins/embedded_ansible_refresh_mixin.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Mixins
module EmbeddedAnsibleRefreshMixin
def embedded_ansible_refresh(objects = nil)
objects = [ManageIQ::Providers::EmbeddedAnsible::AutomationManager.first] if objects.nil?
objects = [ManageIQ::Providers::EmbeddedAnsible::AutomationManager.in_my_region.first] if objects.nil?
begin
EmsRefresh.queue_refresh_task(objects)
add_flash(_("Embedded Ansible refresh has been successfully initiated"))
Expand Down
18 changes: 1 addition & 17 deletions app/helpers/ansible_repository_helper/textual_summary.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def textual_group_relationships
end

def textual_group_options
TextualGroup.new(_("Repository Options"), %i[scm_type scm_url scm_branch scm_clean scm_delete_on_update scm_update_on_launch])
TextualGroup.new(_("Repository Options"), %i[scm_url scm_branch])
end

def textual_group_smart_management
Expand Down Expand Up @@ -59,27 +59,11 @@ def textual_credential
h
end

def textual_scm_type
{:label => _('SCM Type'), :title => _("Show Credential's SCM type"), :value => @record.scm_type}
end

def textual_scm_url
{:label => _('SCM URL'), :title => _("Show Credential's SCM URL"), :value => @record.scm_url}
end

def textual_scm_branch
{:label => _('SCM Branch'), :title => _("Show Credential's SCM branch"), :value => @record.scm_branch}
end

def textual_scm_clean
{:label => _('SCM Clean'), :title => _("Show Credential's SCM clean flag"), :value => @record.scm_clean}
end

def textual_scm_delete_on_update
{:label => _('SCM Delete on Update'), :title => _("Show Credential's SCM delete on update flag"), :value => @record.scm_delete_on_update}
end

def textual_scm_update_on_launch
{:label => _('SCM Update on Launch'), :title => _("Show Credential's SCM update on launch flag"), :value => @record.scm_update_on_launch}
end
end
25 changes: 0 additions & 25 deletions app/views/ansible_repository/_repository_form.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,6 @@
"id" => "description",
'ng-disabled' => 'vm.repositoryModel.manager_resource === null',
'ng-model' => "vm.repositoryModel.description"}
.form-group
%label.col-md-2.control-label
= _('SCM type')
.col-md-8
= select_tag('scm_type',
options_for_select([[_("GIT"), "git"]], 'git'),
"ng-model" => "vm.repositoryModel.scm_type",
:disabled => true,
'miq-select' => true)
.form-group{"ng-class" => "{'has-error': angularForm.scm_url.$error.required || angularForm.scm_url.$error.urlValidation}"}
%label.col-md-2.control-label
= _('URL')
Expand Down Expand Up @@ -75,22 +66,6 @@
"id" => "scm_branch",
'ng-disabled' => 'vm.repositoryModel.manager_resource === null',
'ng-model' => "vm.repositoryModel.scm_branch"}
.form-group
%label.col-md-2.control-label
= _('SCM Update Options')
.col-md-8
%div
%label
= check_box_tag("clean", "1", false, 'ng-model' => "vm.repositoryModel.scm_clean", 'ng-disabled' => 'vm.repositoryModel.manager_resource === null')
= _('Clean')
%div
%label
= check_box_tag("scm_delete_on_update", "1", false, 'ng-model' => 'vm.repositoryModel.scm_delete_on_update', 'ng-disabled' => 'vm.repositoryModel.manager_resource === null')
= _('Delete on Update')
%div
%label
= check_box_tag("scm_update_on_launch", "1", false, 'ng-model' => 'vm.repositoryModel.scm_update_on_launch', 'ng-disabled' => 'vm.repositoryModel.manager_resource === null')
= _('Update on Launch')
= render :partial => 'layouts/angular/generic_form_buttons'
:javascript
ManageIQ.angular.app.value('repositoryId', '#{@id}');
Expand Down
13 changes: 2 additions & 11 deletions spec/helpers/ansible_repository_helper/textual_summary_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,13 @@
textual_provider
textual_playbooks
textual_credential
textual_scm_type
textual_scm_url
textual_scm_branch
textual_scm_clean
textual_scm_delete_on_update
textual_scm_update_on_launch)
textual_scm_branch)

include_examples "method_exists", all_methods

include_examples "textual_group", "Properties", %i(name description created updated status)
include_examples "textual_group", "Relationships", %i(provider playbooks credential)
include_examples "textual_group", "Repository Options", %i(
scm_type scm_url
scm_branch scm_clean
scm_delete_on_update
scm_update_on_launch
), "options"
include_examples "textual_group", "Repository Options", %i(scm_url scm_branch), "options"
include_examples "textual_group_smart_management"
end
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,13 @@ describe('repositoryFormController', function() {
scm_url: 'https://github.com/ManageIQ',
authentication_id: null,
scm_branch: 'master',
scm_clean: false,
scm_delete_on_update: false,
scm_update_on_launch: false,
};
var newRepository = {
name: '',
description: '',
scm_type: 'git',
scm_url: '',
authentication_id: null,
scm_branch: '',
scm_clean: false,
scm_delete_on_update: false,
scm_update_on_launch: false,
};

beforeEach(module('ManageIQ'));
Expand Down