Skip to content
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
@@ -1,4 +1,5 @@
import * as React from 'react';
import { getBadgeFromType } from '@console/shared';
import { ListPage } from '@console/internal/components/factory';
import { referenceForModel } from '@console/internal/module/k8s';
import { PipelineRunModel } from '../../models';
Expand All @@ -16,6 +17,7 @@ const PipelineRunsResourceList: React.FC<Omit<
kind={referenceForModel(PipelineRunModel)}
ListComponent={PipelineRunsList}
rowFilters={runFilters}
badge={getBadgeFromType(PipelineRunModel.badge)}
/>
);
};
Expand Down
4 changes: 2 additions & 2 deletions frontend/public/components/factory/list-page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { connect } from 'react-redux';
import { Link } from 'react-router-dom';
import { Button } from '@patternfly/react-core';

import { KEYBOARD_SHORTCUTS, getBadgeFromType } from '@console/shared';
import { KEYBOARD_SHORTCUTS } from '@console/shared';
import { filterList } from '../../actions/k8s';
import { CheckBoxes, storagePrefix } from '../row-filter';
import { ErrorPage404, ErrorBoundaryFallback } from '../error';
Expand Down Expand Up @@ -434,7 +434,7 @@ export const ListPage = withFallback((props) => {
showTitle={showTitle}
textFilter={textFilter}
title={title}
badge={badge || getBadgeFromType(ko.badge)}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not the best way to go with this solution... Please re-read the ticket @sahil143 - I posted a PR link to what Sam did to solve this issue... we should look to mirror that here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked on the viability of that solution, and it's not going to work for this use-case. We still cannot do this change, it breaks the usage of badges throughout the list pages.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Turns out there is a spot in the code that saves this chunk of code from needing to to this logic... and that's in the resource-list.tsx file

badge={badge}
/>
);
}, ErrorBoundaryFallback);
Expand Down