Create a dedicated page to view and manage all exported files.
Description
Add a new "Exports" page in the sidebar that displays a history of all exported files with management capabilities.
Requirements
New Page
Export History Table
Data Storage
Actions
UI Features
i18n Support
Technical Notes
i18n Keys
{
"exports": {
"title": "Historique des exports",
"columns": {
"date": "Date",
"types": "Types",
"format": "Format",
"records": "Enregistrements",
"path": "Chemin",
"actions": "Actions"
},
"actions": {
"openFile": "Ouvrir le fichier",
"openFolder": "Ouvrir le dossier",
"delete": "Supprimer"
},
"filter": {
"search": "Rechercher...",
"format": "Format",
"type": "Type",
"all": "Tous"
},
"empty": {
"title": "Aucun export",
"description": "Vos exports apparaitront ici"
},
"confirmDelete": {
"title": "Supprimer l'export ?",
"description": "Cette action est irreversible. Le fichier ne sera pas supprime.",
"confirm": "Supprimer",
"cancel": "Annuler"
},
"badge": {
"employees": "employes",
"attachments": "pieces jointes",
"media": "medias"
}
}
}
Database Schema (if using DB)
// src/core/db/schema/exports.ts
import { timestampsWithSoftDelete } from './utils';
export const exports = pgTable('exports', {
id: serial('id').primaryKey(),
types: json('types').$type<'employees' | 'attachments' | 'media'>[],
format: varchar('format', { length: 10 }),
recordCount: integer('record_count'),
filePath: text('file_path'),
createdAt: timestamp('created_at').defaultNow(),
...timestampsWithSoftDelete,
});
Alternative: JSON File Storage
// src/core/lib/export-history.ts
type ExportRecord = {
id: string;
timestamp: string;
types: ('employees' | 'attachments' | 'media')[];
format: 'csv' | 'xlsx' | 'pdf';
recordCount: number;
filePath: string;
};
const getHistoryPath = () => path.join(app.getPath('userData'), 'exports-history.json');
const loadHistory = (): ExportRecord[] => {
const filePath = getHistoryPath();
if (!fs.existsSync(filePath)) return [];
return JSON.parse(fs.readFileSync(filePath, 'utf-8'));
};
const saveRecord = (record: ExportRecord) => {
const history = loadHistory();
history.unshift(record);
const trimmed = history.slice(0, 100);
fs.writeFileSync(getHistoryPath(), JSON.stringify(trimmed, null, 2));
};
const deleteRecord = (id: string) => {
const history = loadHistory();
const filtered = history.filter(r => r.id !== id);
fs.writeFileSync(getHistoryPath(), JSON.stringify(filtered, null, 2));
};
Priority
Effort
Related
Create a dedicated page to view and manage all exported files.
Description
Add a new "Exports" page in the sidebar that displays a history of all exported files with management capabilities.
Requirements
New Page
/exportsrouteExport History Table
Data Storage
Actions
UI Features
i18n Support
Technical Notes
i18n Keys
{ "exports": { "title": "Historique des exports", "columns": { "date": "Date", "types": "Types", "format": "Format", "records": "Enregistrements", "path": "Chemin", "actions": "Actions" }, "actions": { "openFile": "Ouvrir le fichier", "openFolder": "Ouvrir le dossier", "delete": "Supprimer" }, "filter": { "search": "Rechercher...", "format": "Format", "type": "Type", "all": "Tous" }, "empty": { "title": "Aucun export", "description": "Vos exports apparaitront ici" }, "confirmDelete": { "title": "Supprimer l'export ?", "description": "Cette action est irreversible. Le fichier ne sera pas supprime.", "confirm": "Supprimer", "cancel": "Annuler" }, "badge": { "employees": "employes", "attachments": "pieces jointes", "media": "medias" } } }Database Schema (if using DB)
Alternative: JSON File Storage
Priority
Effort
Related