Skip to content

Commit 57a8824

Browse files
authored
Merge pull request #4623 from dlabrecq/integrations
Unassign integration error
2 parents a49f3ea + dc866fc commit 57a8824

File tree

2 files changed

+3
-18
lines changed

2 files changed

+3
-18
lines changed

apps/koku-ui-hccm/src/routes/settings/costModels/costModel/sourceTable.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ class SourceTableBase extends React.Component<SourceTableProps, SourceTableState
8686
<Table
8787
onDeleteText={intl.formatMessage(messages.costModelsSourceDelete)}
8888
onDelete={item => {
89-
this.setState({ dialogSource: item[0] });
89+
this.setState({ dialogSource: item?.[0] });
9090
setDialogOpen({ name: 'deleteSource', isOpen: true });
9191
}}
9292
onAdd={() => setDialogOpen({ name: 'addSource', isOpen: true })}

apps/koku-ui-hccm/src/routes/settings/costModels/costModel/table.tsx

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,32 +25,21 @@ interface TableBaseProps extends WrappedComponentProps {
2525
current: CostModel;
2626
}
2727

28-
interface PaginationQuery {
29-
page: number;
30-
perPage: number;
31-
}
32-
3328
interface TableBaseState {
3429
query: { name: string[] };
3530
currentFilter: string;
3631
filter: string;
37-
pagination: PaginationQuery;
3832
}
3933

4034
class TableBase extends React.Component<TableBaseProps, TableBaseState> {
4135
protected defaultState: TableBaseState = {
4236
query: { name: [] },
4337
currentFilter: '',
4438
filter: '',
45-
pagination: { page: 1, perPage: 10 },
4639
};
4740
public state: TableBaseState = { ...this.defaultState };
4841

4942
public render() {
50-
const {
51-
pagination: { page, perPage },
52-
} = this.state;
53-
5443
const { current, intl, isWritePermission, onAdd, rows } = this.props;
5544

5645
const filteredRows = rows
@@ -61,7 +50,6 @@ class TableBase extends React.Component<TableBaseProps, TableBaseState> {
6150
return this.state.query.name.every(fName => uuid.includes(fName));
6251
})
6352
.map(uuid => [uuid]);
64-
const res = filteredRows.slice((page - 1) * perPage, page * perPage);
6553

6654
// Note: Removed pagination props because the /cost-models/{cost_model_uuid}/ API does not support pagination
6755
// See https://issues.redhat.com/browse/COST-2097
@@ -79,12 +67,10 @@ class TableBase extends React.Component<TableBaseProps, TableBaseState> {
7967
filter={{
8068
onClearAll: () =>
8169
this.setState({
82-
pagination: { ...this.state.pagination, page: 1 },
8370
query: { name: [] },
8471
}),
8572
onRemove: (_category, chip) => {
8673
this.setState({
87-
pagination: { ...this.state.pagination, page: 1 },
8874
query: removeMultiValueQuery(this.state.query)('name', chip),
8975
});
9076
},
@@ -102,17 +88,16 @@ class TableBase extends React.Component<TableBaseProps, TableBaseState> {
10288
query: addMultiValueQuery(this.state.query)('name', this.state.currentFilter),
10389
currentFilter: '',
10490
filter: this.state.currentFilter,
105-
pagination: { ...this.state.pagination, page: 1 },
10691
});
10792
},
10893
value: this.state.currentFilter,
10994
placeholder: intl.formatMessage(messages.costModelsFilterPlaceholder),
11095
}}
11196
/>
112-
{res.length > 0 && (
97+
{filteredRows.length > 0 && (
11398
<SourcesTable
11499
showDeleteDialog={(rowId: number) => {
115-
this.props.onDelete(res[rowId]);
100+
this.props.onDelete(filteredRows[rowId]);
116101
}}
117102
showOperatorVersion={getSourceType(current.source_type) === 'OCP'}
118103
/>

0 commit comments

Comments
 (0)