Fix data exports UI and scope format
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (push) Has been cancelled
tests / ui (push) Has been cancelled

This commit is contained in:
Codex Agent
2026-01-06 12:59:38 +01:00
parent e82a10cb8b
commit a3538f6470
5 changed files with 96 additions and 4 deletions

View File

@@ -0,0 +1,22 @@
import { describe, expect, it } from 'vitest';
import { hasInProgressExports } from './dataExports';
describe('dataExports helpers', () => {
it('detects in-progress exports', () => {
const result = hasInProgressExports([
{ id: 1, status: 'pending' } as any,
{ id: 2, status: 'ready' } as any,
]);
expect(result).toBe(true);
});
it('returns false when exports are terminal', () => {
const result = hasInProgressExports([
{ id: 1, status: 'ready' } as any,
{ id: 2, status: 'failed' } as any,
]);
expect(result).toBe(false);
});
});

View File

@@ -0,0 +1,5 @@
import type { DataExportSummary } from '../../api';
export function hasInProgressExports(exports: DataExportSummary[]): boolean {
return exports.some((entry) => entry.status === 'pending' || entry.status === 'processing');
}