From 6bb2452705aa6536ad299e67f02828690e9b944e Mon Sep 17 00:00:00 2001 From: Erik Michelson Date: Sun, 24 Mar 2024 01:04:34 +0100 Subject: [PATCH] feat(sidebar): add media browser Signed-off-by: Erik Michelson --- frontend/locales/en.json | 9 ++ .../deletion-modal.spec.tsx.snap | 42 --------- .../common/modals/deletion-modal.spec.tsx | 14 +-- .../common/modals/deletion-modal.tsx | 9 +- .../editor-page/sidebar/sidebar.tsx | 6 ++ .../delete-note-modal.tsx | 5 +- .../media-browser-empty.tsx | 22 +++++ .../media-browser-sidebar-menu.tsx | 79 ++++++++++++++++ .../media-entry-deletion-modal.tsx | 46 +++++++++ .../media-entry.tsx | 93 +++++++++++++++++++ .../components/editor-page/sidebar/types.ts | 1 + 11 files changed, 265 insertions(+), 61 deletions(-) create mode 100644 frontend/src/components/editor-page/sidebar/specific-sidebar-entries/media-browser-sidebar-menu/media-browser-empty.tsx create mode 100644 frontend/src/components/editor-page/sidebar/specific-sidebar-entries/media-browser-sidebar-menu/media-browser-sidebar-menu.tsx create mode 100644 frontend/src/components/editor-page/sidebar/specific-sidebar-entries/media-browser-sidebar-menu/media-entry-deletion-modal.tsx create mode 100644 frontend/src/components/editor-page/sidebar/specific-sidebar-entries/media-browser-sidebar-menu/media-entry.tsx diff --git a/frontend/locales/en.json b/frontend/locales/en.json index b9085859d..44bc1e5e3 100644 --- a/frontend/locales/en.json +++ b/frontend/locales/en.json @@ -395,6 +395,14 @@ "contributors": "Count of contributors", "wordCount": "Count of words" }, + "mediaBrowser": { + "title": "Media", + "deleteMedia": "Delete uploaded file", + "confirmDeletion": "Do you really want to delete this file?", + "errorDeleting": "The uploaded file could not be deleted.", + "mediaDeleted": "The uploaded file has been deleted.", + "noMediaUploads": "There are no media files uploaded to this note yet" + }, "modal": { "snippetImport": { "title": "Import from Snippet", @@ -553,6 +561,7 @@ "loading": "Loading ...", "continue": "Continue", "back": "Back", + "success": "Success", "errorWhileLoading": "An unexpected error occurred while loading '{{name}}'.\nCheck the browser console for more information.\nReport this error only if it comes up again.", "errorOccurred": "An error occurred", "readForMoreInfo": "Read here for more information", diff --git a/frontend/src/components/common/modals/__snapshots__/deletion-modal.spec.tsx.snap b/frontend/src/components/common/modals/__snapshots__/deletion-modal.spec.tsx.snap index d17361f43..b84f09096 100644 --- a/frontend/src/components/common/modals/__snapshots__/deletion-modal.spec.tsx.snap +++ b/frontend/src/components/common/modals/__snapshots__/deletion-modal.spec.tsx.snap @@ -1,47 +1,5 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`DeletionModal disables deletion when user is not owner 1`] = ` - -`; - exports[`DeletionModal renders correctly with deletionButtonI18nKey 1`] = `