import React from 'react';
import { addGlobalFill } from 'foremanReact/components/common/Fill/GlobalFill';
import { registerReducer } from 'foremanReact/common/MountingService';
import { translate as __ } from 'foremanReact/common/I18n';
import { registerColumns } from 'foremanReact/components/HostsIndex/Columns/core';
import componentRegistry from 'foremanReact/components/componentRegistry';
import { registerGetActions } from 'foremanReact/components/HostsIndex/TableRowActions/core';
import hostsIndexColumnExtensions from './ForemanColumnExtensions/index';
import hostTableRowActions from './components/extensions/Hosts/TableRowActions';
import SystemStatuses from './components/extensions/about';
import {
RegistrationCommands,
RegistrationActivationKeys,
} from './components/extensions/RegistrationCommands';
import ContentTab from './components/extensions/HostDetails/Tabs/ContentTab';
import ContentViewDetailsCard from './components/extensions/HostDetails/Cards/ContentViewDetailsCard/ContentViewDetailsCard';
import ErrataOverviewCard from './components/extensions/HostDetails/Cards/ErrataOverviewCard';
import InstalledProductsCard from './components/extensions/HostDetails/DetailsTabCards/InstalledProductsCard';
import RegistrationCard from './components/extensions/HostDetails/DetailsTabCards/RegistrationCard';
import HwPropertiesCard from './components/extensions/HostDetails/DetailsTabCards/HwPropertiesCard';
import TracesTab from './components/extensions/HostDetails/Tabs/TracesTab/TracesTab.js';
import extendReducer from './components/extensions/reducers';
import rootReducer from './redux/reducers';
import HostCollectionsCard from './components/extensions/HostDetails/Cards/HostCollectionsCard/HostCollectionsCard';
import { hostIsNotRegistered } from './components/extensions/HostDetails/hostDetailsHelpers';
import {
SystemPropertiesCardSubscription,
SystemPropertiesCardVirtualization,
SystemPropertiesCardTracer,
} from './components/extensions/HostDetails/DetailsTabCards/SystemPropertiesCardExtensions';
import HostDetailsActionsBar from './components/extensions/HostDetails/ActionsBar';
import HostsIndexActionsBar from './components/extensions/Hosts/ActionsBar';
import RecentCommunicationCardExtensions from './components/extensions/HostDetails/DetailsTabCards/RecentCommunicationCardExtensions';
import SystemPurposeCard from './components/extensions/HostDetails/Cards/SystemPurposeCard/SystemPurposeCard';
import BulkChangeHostCVModal from './components/extensions/Hosts/BulkActions/BulkChangeHostCVModal/index.js';
import BulkPackagesWizardModal from './components/extensions/Hosts/BulkActions/BulkPackagesWizard/index.js';
import BulkErrataWizardModal from './components/extensions/Hosts/BulkActions/BulkErrataWizard/index.js';
import ActivationKeysSearch from './components/ActivationKeysSearch';
registerReducer('katelloExtends', extendReducer);
registerReducer('katello', rootReducer);
addGlobalFill('aboutFooterSlot', '[katello]AboutSystemStatuses', , 100);
addGlobalFill('registrationAdvanced', '[katello]RegistrationCommands', , 100);
addGlobalFill('registrationGeneral', '[katello]RegistrationActivationKeys', , 100);
// Host details page tabs
addGlobalFill('host-details-page-tabs', 'Content', , 900, { title: __('Content'), hideTab: hostIsNotRegistered });
addGlobalFill('host-details-page-tabs', 'Traces', , 800, { title: __('Traces'), hideTab: hostIsNotRegistered });
// Overview tab cards & card extensions
addGlobalFill(
'host-overview-cards',
'Content view details',
,
3800,
);
addGlobalFill(
'host-overview-cards',
'Host collections',
,
2600,
);
addGlobalFill('host-overview-cards', 'Installable errata', , 3600);
addGlobalFill('host-overview-cards', 'System purpose', , 1400);
addGlobalFill('recent-communication-card-item', 'Recent communication', , 3000);
// Details tab cards & card extensions
addGlobalFill('host-tab-details-cards', 'Installed products', , 100);
addGlobalFill('host-tab-details-cards', 'Registration details', , 200);
addGlobalFill('host-details-tab-properties-1', 'Subscription UUID', );
addGlobalFill('host-details-tab-properties-2', 'Tracer', );
addGlobalFill('host-details-tab-properties-3', 'Virtualization', );
addGlobalFill(
'host-details-kebab',
'katello-host-details-kebab',
,
100,
);
addGlobalFill(
'hosts-index-kebab',
'katello-hosts-index-kebab',
,
100,
);
addGlobalFill('host-tab-details-cards', 'HW properties', , 200);
// Hosts Index page extensions
addGlobalFill('_all-hosts-modals', 'BulkChangeHostCVModal', , 100);
addGlobalFill('_all-hosts-modals', 'BulkPackagesWizardModal', , 200);
addGlobalFill('_all-hosts-modals', 'BulkErrataWizardModal', , 200);
registerColumns(hostsIndexColumnExtensions);
registerGetActions({
pluginName: 'katello',
getActionsFunc: hostTableRowActions,
tableName: 'hosts',
});
componentRegistry.register({
name: 'ActivationKeysSearch',
type: ActivationKeysSearch,
});