Skip to content

Commit a35015e

Browse files
utkarshgupta137krishnan-r
authored andcommitted
store: sort stages by id
1 parent 83d79df commit a35015e

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

src/components/job-table.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const StageItem = observer((props: { stageId: string }) => {
3838

3939
const StageTable = observer((props: { jobId: string }) => {
4040
const notebook = useNotebookStore();
41-
const stageIds = notebook.jobs[props.jobId].uniqueStageIds.slice(0).sort();
41+
const stageIds = notebook.jobs[props.jobId].uniqueStageIds;
4242
const rows = stageIds.map((stageId) => {
4343
return <StageItem stageId={stageId} key={stageId} />;
4444
});

src/store/notebook.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ export class NotebookStore {
8989
stage.name = data.stageInfos[stageId].name;
9090
job.uniqueStageIds.push(uniqueStageId);
9191
});
92+
job.uniqueStageIds.sort((a, b) => a.localeCompare(b, undefined, { numeric: true }));
9293

9394
if (job.name === 'null') {
9495
const lastStageId = Math.max.apply(null, data.stageIds);

0 commit comments

Comments
 (0)