Skip to content

Commit

Permalink
Add customizable column to React HostsIndex page
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremylenz authored and stejskalleos committed May 30, 2024
1 parent ce383cc commit b706bfd
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions webpack/global_index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { registerReducer } from 'foremanReact/common/MountingService';
import { registerColumns } from 'foremanReact/components/HostsIndex/Columns/core';
import { translate as __ } from 'foremanReact/common/I18n';
import reducers from './src/reducers';
import { registerFills } from './src/Extends/Fills';
import { registerLegacy } from './legacy';
Expand All @@ -9,3 +11,22 @@ registerReducer('puppet', reducers);
registerFills();
// TODO: the checkForUnavailablePuppetclasses is very nasty
registerLegacy();

// register columns for React hosts index page
const puppetHostsIndexColumns = [
{
columnName: 'environment',
title: __('Puppet env'),
isSorted: true,
wrapper: hostDetails => hostDetails.environment_name,
weight: 2700,
},
];

puppetHostsIndexColumns.forEach(column => {
column.tableName = 'hosts';
column.categoryName = 'Puppet';
column.categoryKey = 'puppet';
});

registerColumns(puppetHostsIndexColumns);

0 comments on commit b706bfd

Please sign in to comment.