Skip to content

Commit 44b7b5f

Browse files
committed
fix sorting by last updated field and remove unused unused topology-link SCSS
Signed-off-by: Atif Ali <atali@redhat.com>
1 parent 0225cc7 commit 44b7b5f

File tree

3 files changed

+12
-13
lines changed

3 files changed

+12
-13
lines changed

src/gitops/components/project/ProjectList.tsx

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ const ProjectList: React.FC<ProjectListTabProps> = ({
198198
hideFavoriteButton={false}
199199
>
200200
<ListPageCreate groupVersionKind={modelToRef(AppProjectModel)}>
201-
{t('Create App Project')}
201+
{t('Create AppProject')}
202202
</ListPageCreate>
203203
</ListPageHeader>
204204
)}
@@ -288,10 +288,16 @@ export const sortData = (
288288
aValue = a.metadata?.labels || {};
289289
bValue = b.metadata?.labels || {};
290290
break;
291-
case 'last-updated':
292-
aValue = getLastUpdateTimestamp(a);
293-
bValue = getLastUpdateTimestamp(b);
291+
case 'last-updated': {
292+
const aTimestamp = getLastUpdateTimestamp(a);
293+
const bTimestamp = getLastUpdateTimestamp(b);
294+
aValue = new Date(aTimestamp || 0).getTime();
295+
bValue = new Date(bTimestamp || 0).getTime();
296+
// Handle NaN values (invalid dates) - treat as 0 (epoch)
297+
if (isNaN(aValue)) aValue = 0;
298+
if (isNaN(bValue)) bValue = 0;
294299
break;
300+
}
295301
default:
296302
return 0;
297303
}
@@ -362,7 +368,7 @@ export const useColumnsDV = (
362368
props: {
363369
'aria-label': 'last updated',
364370
className: 'pf-m-width-18',
365-
sort: getSortParams(3 + i),
371+
sort: getSortParams(showNamespace ? 5 : 4),
366372
},
367373
},
368374
{

src/gitops/components/project/hooks/useProjectActionsProvider.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export const useProjectActionsProvider: UseProjectActionsProvider = (project) =>
5858
{
5959
id: 'gitops-action-edit-project',
6060
disabled: !project?.metadata?.namespace || !project?.metadata?.name,
61-
label: t('Edit App Project'),
61+
label: t('Edit AppProject'),
6262
accessReview: {
6363
group: AppProjectModel.apiGroup,
6464
verb: 'update' as K8sVerb,
Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +0,0 @@
1-
.project-list-page {
2-
&__topology-link {
3-
margin-left: var(--pf-v5-global--spacer--md);
4-
}
5-
}
6-
7-

0 commit comments

Comments
 (0)