Skip to content

Commit

Permalink
Events are in correct order in workbench status progress
Browse files Browse the repository at this point in the history
  • Loading branch information
pnaik1 committed Sep 26, 2024
1 parent d5938bf commit 65d13c8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,10 @@ const StartServerModal: React.FC<StartServerModalProps> = ({ open, spawnInProgre
<List isPlain isBordered tabIndex={0}>
{events
.slice()
.reverse()
.toSorted(
(a, b) =>

Check warning on line 224 in frontend/src/pages/notebookController/screens/server/StartServerModal.tsx

View check run for this annotation

Codecov / codecov/patch

frontend/src/pages/notebookController/screens/server/StartServerModal.tsx#L224

Added line #L224 was not covered by tests
new Date(getEventTimestamp(b)).getTime() - new Date(getEventTimestamp(a)).getTime(),
)
.map((event, index) => (
<ListItem key={`notebook-event-${event.metadata.uid ?? index}`}>
{`${getEventTimestamp(event)} [${event.type}] ${event.message}`}
Expand Down
8 changes: 6 additions & 2 deletions frontend/src/pages/projects/notebook/StartNotebookModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { EventStatus, NotebookStatus } from '~/types';
import { EventKind } from '~/k8sTypes';
import NotebookRouteLink from './NotebookRouteLink';
import { NotebookState } from './types';
import { getEventFullMessage } from './utils';
import { getEventFullMessage, getEventTimestamp } from './utils';

type StartNotebookModalProps = {
isOpen: boolean;
Expand Down Expand Up @@ -164,7 +164,11 @@ const StartNotebookModal: React.FC<StartNotebookModalProps> = ({
<List isPlain isBordered data-id="event-logs">
{events
.slice()
.reverse()
.toSorted(
(a, b) =>
new Date(getEventTimestamp(b)).getTime() -

Check warning on line 169 in frontend/src/pages/projects/notebook/StartNotebookModal.tsx

View check run for this annotation

Codecov / codecov/patch

frontend/src/pages/projects/notebook/StartNotebookModal.tsx#L168-L169

Added lines #L168 - L169 were not covered by tests
new Date(getEventTimestamp(a)).getTime(),
)
.map((event, index) => (
<ListItem key={`notebook-event-${event.metadata.uid ?? index}`}>
{getEventFullMessage(event)}
Expand Down

0 comments on commit 65d13c8

Please sign in to comment.