summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSunil Shetye2025-02-04 16:27:01 +0530
committerSunil Shetye2025-02-04 18:27:54 +0530
commit65f79293e07c6c7a52dae04b7959c2e3191568bd (patch)
tree51c8e73c513d2ca75ba89e6310eceba15e7889ee
parent8efa64ab54c116b14c4bac5d23ec56e037c57742 (diff)
downloadCommon-Interface-Project-65f79293e07c6c7a52dae04b7959c2e3191568bd.tar.gz
Common-Interface-Project-65f79293e07c6c7a52dae04b7959c2e3191568bd.tar.bz2
Common-Interface-Project-65f79293e07c6c7a52dae04b7959c2e3191568bd.zip
also show count of how many diagrams are there
-rw-r--r--blocks/.dockerignore4
-rw-r--r--blocks/eda-frontend/.eslintrc.json3
-rw-r--r--blocks/eda-frontend/src/pages/Gallery.js43
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 () {
</Grid>
{/* Display a message or blank gallery */}
- {finalfilteredSchematics.length === 0
- ? (
- <Grid item xs={12}>
- <Typography variant='h6' align='center' color='textSecondary'>
- {'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.'
- }
- </Typography>
+ <Grid item xs={12}>
+ <Typography variant='h6' align='center' color='textSecondary'>
+ {
+ 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}`}`
+ }
+ </Typography>
+ </Grid>
+
+ {
+ finalfilteredSchematics.map((sch) => (
+ <Grid item xs={12} sm={6} lg={4} key={sch.save_id}>
+ <SchematicCard sch={sch} />
</Grid>
- )
- : (
- finalfilteredSchematics.map((sch) => (
- <Grid item xs={12} sm={6} lg={4} key={sch.save_id}>
- <SchematicCard sch={sch} />
- </Grid>
- ))
- )
+ ))
}
</Grid>
</Container>