Skip to content

Commit

Permalink
remove streams column from config table
Browse files Browse the repository at this point in the history
  • Loading branch information
neptunian committed Jul 6, 2020
1 parent e92f8b9 commit 4862574
Showing 1 changed file with 0 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import { useCapabilities, useLink } from '../../../../../hooks';
import { useConfigRefresh } from '../../hooks';

interface InMemoryPackageConfig extends PackageConfig {
streams: { total: number; enabled: number };
inputTypes: string[];
packageName?: string;
packageTitle?: string;
Expand Down Expand Up @@ -72,30 +71,11 @@ export const PackageConfigsTable: React.FunctionComponent<Props> = ({
}

const dsInputTypes: string[] = [];
const streams = packageConfig.inputs.reduce(
(streamSummary, input) => {
if (!inputTypesValues.includes(input.type)) {
inputTypesValues.push(input.type);
}
if (!dsInputTypes.includes(input.type)) {
dsInputTypes.push(input.type);
}

streamSummary.total += input.streams.length;
streamSummary.enabled += input.enabled
? input.streams.filter((stream) => stream.enabled).length
: 0;

return streamSummary;
},
{ total: 0, enabled: 0 }
);

dsInputTypes.sort(stringSortAscending);

return {
...packageConfig,
streams,
inputTypes: dsInputTypes,
packageName: packageConfig.package?.name ?? '',
packageTitle: packageConfig.package?.title ?? '',
Expand Down Expand Up @@ -175,23 +155,6 @@ export const PackageConfigsTable: React.FunctionComponent<Props> = ({
return namespace ? <EuiBadge color="hollow">{namespace}</EuiBadge> : '';
},
},
{
field: 'streams',
name: i18n.translate(
'xpack.ingestManager.configDetails.packageConfigsTable.streamsCountColumnTitle',
{
defaultMessage: 'Streams',
}
),
render: (streams: InMemoryPackageConfig['streams']) => {
return (
<>
<EuiTextColor>{streams.enabled}</EuiTextColor>
<EuiTextColor color="subdued">&nbsp;/ {streams.total}</EuiTextColor>
</>
);
},
},
{
name: i18n.translate(
'xpack.ingestManager.configDetails.packageConfigsTable.actionsColumnTitle',
Expand Down

0 comments on commit 4862574

Please sign in to comment.