Skip to content
Open
Show file tree
Hide file tree
Changes from 2 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
21 changes: 0 additions & 21 deletions app/controllers/katello/concerns/hosts_controller_extensions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ module HostsControllerExtensions
module Overrides
def action_permission
case params[:action]
when 'content_hosts'
'view'
when 'change_content_source'
'edit'
else
Expand Down Expand Up @@ -56,25 +54,6 @@ def submit_multiple_destroy
redirect_to(foreman_tasks_task_path(task.id))
end

def content_hosts
respond_to do |format|
format.csv do
@hosts = resource_base_with_search.where(organization_id: params[:organization_id])
.preload(:subscription_facet, :host_statuses, :operatingsystem,
:applicable_rpms, :content_view_environments)
csv_response(@hosts,
[:name, 'content_facet.installable_security_errata_count',
'content_facet.installable_bugfix_errata_count', 'content_facet.installable_enhancement_errata_count',
'content_facet.upgradable_rpm_count', :operatingsystem, :content_view_environment_names,
'subscription_facet.registered_at', 'subscription_facet.last_checkin'],
['Name', 'Installable Updates - Security',
'Installable Updates - Bug Fixes', 'Installable Updates - Enhancements',
'Installable Updates - Package Count', 'OS', 'Content View Environments',
'Registered', 'Last Checkin'])
end
end
end

def change_content_source_data
hosts = params[:search].presence ? ::Host.search_for(params[:search]) : ::Host.where(id: params[:host_ids])
content_hosts = []
Expand Down
2 changes: 1 addition & 1 deletion app/helpers/katello/errata_mailer_helper.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Katello
module ErrataMailerHelper
def content_host_errata_path(host)
"#{Setting[:foreman_url]}/content_hosts/#{host.id}/errata"
"#{Setting[:foreman_url]}#{Rails.application.routes.url_helpers.host_details_page_path(host.name)}#/Content/errata"
end

def content_view_environment_errata_path(content_view, environment)
Expand Down
12 changes: 0 additions & 12 deletions app/helpers/katello/hosts_and_hostgroups_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -307,18 +307,6 @@ def os_updated_kickstart_options(host = nil)
view_options
end

def content_host_overview_button(host)
return [] unless host.content_facet || host.subscription_facet
[{
:button => link_to(
_('Content'),
"/content_hosts/#{host.id}",
:title => _("Host content and subscription details"),
:class => 'btn btn-default'),
:priority => 900,
}]
end

def hosts_change_content_source
[{ action: [_('Change Content Source'), '/change_host_content_source', false], priority: 100 }]
end
Expand Down
27 changes: 27 additions & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,33 @@
end

get '/katello/providers/redhat_provider', to: redirect('/redhat_repositories')
get '/content_hosts', to: redirect(Rails.application.routes.url_helpers.new_hosts_index_page_path)

# Redirect legacy content host detail pages to new host details
# Note: :id can be either hostname or database ID (friendly-id gem)
constraints(id: /[^\/]+/) do
get '/content_hosts/:id', to: redirect { |params, _|
# The friendly-id gem allows both name and ID to work, so just pass through
host_identifier = params[:id]
Rails.application.routes.url_helpers.host_details_page_path(host_identifier)
}
get '/content_hosts/:id/:tab', to: redirect { |params, _|
host_identifier = params[:id]
tab_map = {
'errata' => 'errata',
'packages' => 'packages',
'debs' => 'debs',
'module-streams' => 'module-streams',
}
top_level_tab_map = {
'traces' => 'Traces',
}
fragment = tab_map[params[:tab]].present? ? "#/Content/#{tab_map[params[:tab]]}" : ''
fragment = "#/#{top_level_tab_map[params[:tab]]}" if top_level_tab_map[params[:tab]].present?
"#{Rails.application.routes.url_helpers.host_details_page_path(host_identifier)}#{fragment}"
}
end

match '/redhat_repositories' => 'react#index', :via => [:get]

match '/subscriptions' => 'react#index', :via => [:get]
Expand Down
4 changes: 0 additions & 4 deletions config/routes/overrides.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ def matches?(request)

match "/api/v2/organizations/:id", via: :delete, to: proc { [404, {}, [override_message]] }

resources :hosts, :only => [] do
get :content_hosts, :on => :collection
end

resources :smart_proxies, :only => [] do
member do
get :pulp_storage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,7 @@
<tr bst-table-row ng-repeat="host in table.rows"
ng-controller="ContentHostStatusController">
<td bst-table-cell>
<span ng-switch="newHostDetailsUI">
<a ng-switch-when="true" ng-href="/new/hosts/{{host.name}}">{{ host.display_name }}</a>
<a ng-switch-when="false" ui-sref="content-host.info({hostId: host.id})">{{ host.display_name }}</a>
</span>
<a ng-href="/new/hosts/{{host.name}}">{{ host.display_name }}</a>
</td>
<td bst-table-cell>{{ host.content_facet_attributes.lifecycle_environment.name }}</td>
<td bst-table-cell>{{ host.content_facet_attributes.content_view.name || "" }}</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ var BASTION_MODULES = [
'Bastion.subscriptions',
'Bastion.sync-plans',
'Bastion.http-proxies',
'Bastion.host-collections',
'Bastion.content-hosts',
'Bastion.host-collections',
'Bastion.tasks',
'Bastion.settings'
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
//= require "bastion_katello/common/common.module.js"
//= require_tree "./common"

//= require "bastion_katello/content-hosts/content-hosts.module.js"
//= require_tree "./content-hosts"

//= require "bastion_katello/hosts/hosts.module.js"
//= require_tree "./hosts"

Expand Down Expand Up @@ -102,6 +99,9 @@

//= require "bastion_katello/dates/dates.module.js"

//= require "bastion_katello/content-hosts/content-hosts.module.js"
//= require_tree "./content-hosts"

//= require "bastion_katello/i18n/translations.js"

//= require "bastion_katello/bastion-katello-bootstrap.js"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ angular.module('Bastion.content-hosts').controller('ContentHostsBulkEnvironmentM
$scope.performAction = function () {
HostBulkAction.environmentContentView(actionParams(), function (task) {
$scope.ok();
$state.go('content-hosts.bulk-task', {taskId: task.id});
$state.go('tasks.details', {taskId: task.id});
}, function (response) {
angular.forEach(response.data.errors, function (error) {
Notification.setErrorMessage(error);
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ angular.module('Bastion.content-hosts').controller('ContentHostsBulkSubscription
success = function (response) {
$scope.contentNutupane.invalidate();
$scope.ok();
$scope.transitionTo('content-hosts.bulk-task', {taskId: response.id});
$scope.transitionTo('tasks.details', {taskId: response.id});
};

error = function (response) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ angular.module('Bastion.content-hosts').controller('ContentHostsBulkSystemPurpos
$scope.performAction = function () {
HostBulkAction.systemPurpose(actionParams(), function (task) {
$scope.ok();
$scope.transitionTo('content-hosts.bulk-task', {taskId: task.id});
$scope.transitionTo('tasks.details', {taskId: task.id});
}, function (response) {
angular.forEach(response.data.errors, function (error) {
Notification.setErrorMessage(error);
Expand Down
Loading
Loading