Skip to content

Commit 95772c7

Browse files
committed
Fixes from #15489
1 parent c6dcd37 commit 95772c7

File tree

3 files changed

+32
-37
lines changed

3 files changed

+32
-37
lines changed

frontend/packages/console-app/src/components/data-view/ResourceDataView.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ export const ResourceDataView = <
144144
);
145145
}
146146

147-
if (!hideNameLabelFilters && !hideLabelFilter) {
147+
if (!hideNameLabelFilters && !hideLabelFilter && loaded) {
148148
basicFilters.push(
149149
<DataViewLabelFilter key="label" filterId="label" title={t('public~Label')} data={data} />,
150150
);
@@ -156,7 +156,7 @@ export const ResourceDataView = <
156156

157157
// Can't use data in the deps array as it will recompute the filters and will cause the selected category to reset
158158
// eslint-disable-next-line react-hooks/exhaustive-deps
159-
}, [additionalFilterNodes, t]);
159+
}, [additionalFilterNodes, t, loaded]);
160160

161161
return mock ? (
162162
<EmptyBox label={label} />

frontend/packages/console-app/src/components/data-view/useResourceDataViewData.tsx

Lines changed: 28 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -76,42 +76,35 @@ export const useResourceDataViewData = <
7676

7777
const dataViewColumns = React.useMemo<ResourceDataViewColumn<TData>[]>(
7878
() =>
79-
activeColumns.map(
80-
(
81-
{ id, title, sort, props: { classes, isStickyColumn, stickyMinWidth, modifier } },
82-
index,
83-
) => {
84-
const headerProps: ThProps = {
85-
className: classes,
86-
isStickyColumn,
87-
stickyMinWidth,
88-
modifier,
79+
activeColumns.map(({ id, title, sort, props }, index) => {
80+
const headerProps: ThProps = {
81+
...props,
82+
dataLabel: title,
83+
};
84+
85+
if (sort) {
86+
headerProps.sort = {
87+
columnIndex: index,
88+
sortBy: {
89+
index: 0,
90+
direction: SortByDirection.asc,
91+
defaultDirection: SortByDirection.asc,
92+
},
8993
};
90-
91-
if (sort) {
92-
headerProps.sort = {
93-
columnIndex: index,
94-
sortBy: {
95-
index: 0,
96-
direction: SortByDirection.asc,
97-
defaultDirection: SortByDirection.asc,
98-
},
99-
};
100-
}
101-
102-
return {
103-
id,
104-
title,
105-
sortFunction: sort,
106-
props: headerProps,
107-
cell: title ? (
108-
<span>{title}</span>
109-
) : (
110-
<span className="pf-v6-u-screen-reader">{t('public~Actions')}</span>
111-
),
112-
};
113-
},
114-
),
94+
}
95+
96+
return {
97+
id,
98+
title,
99+
sortFunction: sort,
100+
props: headerProps,
101+
cell: title ? (
102+
<span>{title}</span>
103+
) : (
104+
<span className="pf-v6-u-screen-reader">{t('public~Actions')}</span>
105+
),
106+
};
107+
}),
115108
[activeColumns, t],
116109
);
117110

frontend/public/components/workload-table.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,7 @@ export const useWorkloadColumns = <T extends K8sResourceKind>(): TableColumn<T>[
239239
sort: 'metadata.labels',
240240
props: {
241241
modifier: 'nowrap',
242+
width: 20,
242243
},
243244
},
244245
{
@@ -247,6 +248,7 @@ export const useWorkloadColumns = <T extends K8sResourceKind>(): TableColumn<T>[
247248
sort: 'spec.selector',
248249
props: {
249250
modifier: 'nowrap',
251+
width: 20,
250252
},
251253
},
252254
{

0 commit comments

Comments
 (0)