From 65f79293e07c6c7a52dae04b7959c2e3191568bd Mon Sep 17 00:00:00 2001 From: Sunil Shetye Date: Tue, 4 Feb 2025 16:27:01 +0530 Subject: also show count of how many diagrams are there --- blocks/.dockerignore | 4 +++ blocks/eda-frontend/.eslintrc.json | 3 +++ blocks/eda-frontend/src/pages/Gallery.js | 43 ++++++++++++++++---------------- 3 files changed, 29 insertions(+), 21 deletions(-) diff --git a/blocks/.dockerignore b/blocks/.dockerignore index 452b361b..35440ba6 100644 --- a/blocks/.dockerignore +++ b/blocks/.dockerignore @@ -28,4 +28,8 @@ blocks/xcosblocks/xcosblocks.py file_storage/* !file_storage/uploads file_storage/uploads/* +media/* +!media/saves +!media/uploads +media/saves/* media/uploads/* diff --git a/blocks/eda-frontend/.eslintrc.json b/blocks/eda-frontend/.eslintrc.json index 12f6c7cd..60be150e 100644 --- a/blocks/eda-frontend/.eslintrc.json +++ b/blocks/eda-frontend/.eslintrc.json @@ -26,6 +26,9 @@ "plugins": [ "react" ], + "rules": { + "space-before-function-paren": ["error", "always"] + }, "settings": { "react": { "version": "detect" diff --git a/blocks/eda-frontend/src/pages/Gallery.js b/blocks/eda-frontend/src/pages/Gallery.js index b448c241..fde1d8b2 100644 --- a/blocks/eda-frontend/src/pages/Gallery.js +++ b/blocks/eda-frontend/src/pages/Gallery.js @@ -278,28 +278,29 @@ export default function Gallery () { {/* Display a message or blank gallery */} - {finalfilteredSchematics.length === 0 - ? ( - - - {'No ' + process.env.REACT_APP_SMALL_DIAGRAMS_NAME + ' to display. '} - { - selectedBookId === '' - ? 'Please select a book.' - : selectedBookId === 'all' - ? 'Please try another search term.' - : 'Please select another book or try another search term.' - } - + + + { + finalfilteredSchematics.length === 0 + ? `No ${process.env.REACT_APP_SMALL_DIAGRAMS_NAME} to display. ${selectedBookId === '' + ? 'Please select a book.' + : selectedBookId === 'all' + ? 'Please try another search term.' + : 'Please select another book or try another search term.' + }` + : `${finalfilteredSchematics.length} ${finalfilteredSchematics.length !== 1 + ? `${process.env.REACT_APP_SMALL_DIAGRAMS_NAME}` + : `${process.env.REACT_APP_SMALL_DIAGRAM_NAME}`}` + } + + + + { + finalfilteredSchematics.map((sch) => ( + + - ) - : ( - finalfilteredSchematics.map((sch) => ( - - - - )) - ) + )) } -- cgit