Skip to content

Commit

Permalink
Address PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
rebeccaalpert committed Jun 5, 2019
1 parent 8cfd14b commit d0f30cf
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ describe(ClusterServiceVersionRow.displayName, () => {

expect(col.find(ResourceKebab).props().resource).toEqual(testClusterServiceVersion);
expect(col.find(ResourceKebab).props().kind).toEqual(referenceForModel(ClusterServiceVersionModel));
expect(col.find(ResourceKebab).props().actions.length).toEqual(2);
expect(col.find(ResourceKebab).props().actions.length).toEqual(1);
});

it('renders clickable column for app logo and name', () => {
Expand Down Expand Up @@ -88,7 +88,7 @@ describe(ClusterServiceVersionRow.displayName, () => {
it('renders column for app status', () => {
const col = wrapper.find('.row').childAt(3);

expect(col.childAt(0).text()).toEqual(` ${CSVConditionReason.CSVReasonInstallSuccessful}`);
expect(col.childAt(0).text()).toEqual(CSVConditionReason.CSVReasonInstallSuccessful);
});

it('renders "disabling" status if CSV has `deletionTimestamp`', () => {
Expand Down
6 changes: 0 additions & 6 deletions frontend/public/components/factory/list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,6 @@ const listFilters = {
}
return filters.selected.has(resource.kind);
},
'clusterserviceversion-status': (filters, csv) => {
if (!filters || !filters.selected || !filters.selected.size) {
return true;
}
return filters.selected.has(_.get(csv.status, 'reason')) || !_.includes(filters.all, _.get(csv.status, 'reason'));
},

'packagemanifest-name': (filter, pkg) => fuzzyCaseInsensitive(filter, (pkg.status.defaultChannel
? pkg.status.channels.find(ch => ch.name === pkg.status.defaultChannel)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Link, match as RouterMatch } from 'react-router-dom';
import * as _ from 'lodash-es';
import { connect } from 'react-redux';
import { Alert } from 'patternfly-react';
import * as classNames from 'classnames';

import { ProvidedAPIsPage, ProvidedAPIPage } from './clusterserviceversion-resource';
import { DetailsPage, ListHeader, ColHead, List, ListPage } from '../factory';
Expand Down Expand Up @@ -53,9 +54,10 @@ export const ClusterServiceVersionRow = withFallback<ClusterServiceVersionRowPro
const route = `/k8s/ns/${obj.metadata.namespace}/${ClusterServiceVersionModel.plural}/${obj.metadata.name}`;

const statusString = _.get(obj, 'status.reason', ClusterServiceVersionPhase.CSVPhaseUnknown);
const showSuccessIcon = statusString === 'Copied' || statusString === 'InstallSucceeded';
const installStatus = obj.status && obj.status.phase !== ClusterServiceVersionPhase.CSVPhaseFailed
? <span>{(statusString === 'Copied' || statusString === 'InstallSucceeded') && <i aria-hidden="true" className="pficon pficon-ok" />} {statusString}</span>
: <span className="co-error"><i className="fa fa-times-circle co-icon-space-r" /> Failed</span>;
? <span className={classNames(showSuccessIcon && 'co-icon-and-text')}>{showSuccessIcon && <i aria-hidden="true" className="pficon pficon-ok co-icon-and-text__icon" />}{statusString}</span>
: <span className="co-error co-icon-and-text"><i className="fa fa-times-circle co-icon-space-r co-icon-and-text__icon" /> Failed</span>;

return <div className="row co-resource-list__item">
<div className="col-lg-3 col-md-4 col-sm-4 col-xs-6" style={{display: 'flex', alignItems: 'center'}}>
Expand Down

0 comments on commit d0f30cf

Please sign in to comment.