From 77ca6aedb3ce2cc3232a4d64e53c341f0c9afca8 Mon Sep 17 00:00:00 2001 From: Jan Prochazka Date: Thu, 9 Dec 2021 13:58:31 +0100 Subject: [PATCH] archive widgets design --- packages/api/src/controllers/archive.js | 3 +- .../web/src/widgets/ArchiveFilesList.svelte | 53 ++++++++++++++++++- .../web/src/widgets/ArchiveFolderList.svelte | 2 + 3 files changed, 56 insertions(+), 2 deletions(-) diff --git a/packages/api/src/controllers/archive.js b/packages/api/src/controllers/archive.js index 89c5d9bf..371f1bd6 100644 --- a/packages/api/src/controllers/archive.js +++ b/packages/api/src/controllers/archive.js @@ -115,7 +115,8 @@ module.exports = { saveFreeTable_meta: 'post', async saveFreeTable({ folder, file, data }) { - saveFreeTableData(path.join(resolveArchiveFolder(folder), `${file}.jsonl`), data); + await saveFreeTableData(path.join(resolveArchiveFolder(folder), `${file}.jsonl`), data); + socket.emitChanged(`archive-files-changed-${folder}`); return true; }, diff --git a/packages/web/src/widgets/ArchiveFilesList.svelte b/packages/web/src/widgets/ArchiveFilesList.svelte index cca2340a..f4db5d3b 100644 --- a/packages/web/src/widgets/ArchiveFilesList.svelte +++ b/packages/web/src/widgets/ArchiveFilesList.svelte @@ -11,18 +11,27 @@ - Refresh + + + + + + + runCommand('new.archiveFolder')} title="Add new archive folder">