summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSunil Shetye2020-09-03 22:57:09 +0530
committerSunil Shetye2021-04-11 21:23:03 +0530
commit0a7734221d74e10ba70c5b0e722a94667ac5336d (patch)
treebac40b28b13988aedecaf6b6bdf44924cfa78c54
parent0a49fd7f973b2d939cc02780bb97223449c0f418 (diff)
downloadCommon-Interface-Project-0a7734221d74e10ba70c5b0e722a94667ac5336d.tar.gz
Common-Interface-Project-0a7734221d74e10ba70c5b0e722a94667ac5336d.tar.bz2
Common-Interface-Project-0a7734221d74e10ba70c5b0e722a94667ac5336d.zip
order blocks by name
-rw-r--r--blocks/blocks/xcosblocks/views.py2
-rw-r--r--blocks/eda-frontend/src/App.js2
-rw-r--r--blocks/eda-frontend/src/components/SchematicEditor/Helper/ComponentDrag.js2
-rw-r--r--blocks/eda-frontend/src/components/SchematicEditor/Helper/SchematicEditor.css11
-rw-r--r--blocks/eda-frontend/src/components/SchematicEditor/Helper/SvgParser.js2
-rw-r--r--blocks/eda-frontend/src/components/SchematicEditor/SideComp.js4
-rw-r--r--blocks/eda-frontend/src/pages/SchematicEditor.js (renamed from blocks/eda-frontend/src/pages/SchematiEditor.js)2
7 files changed, 12 insertions, 13 deletions
diff --git a/blocks/blocks/xcosblocks/views.py b/blocks/blocks/xcosblocks/views.py
index 4a8f87a4..69e636c8 100644
--- a/blocks/blocks/xcosblocks/views.py
+++ b/blocks/blocks/xcosblocks/views.py
@@ -41,7 +41,7 @@ class BlockViewSet(ReadOnlyModelViewSet):
"""
Listing All Block Details
"""
- queryset = Block.objects.all()
+ queryset = Block.objects.all().order_by('name')
serializer_class = BlockSerializer
filter_backends = [
DjangoFilterBackend
diff --git a/blocks/eda-frontend/src/App.js b/blocks/eda-frontend/src/App.js
index 7f612234..52989137 100644
--- a/blocks/eda-frontend/src/App.js
+++ b/blocks/eda-frontend/src/App.js
@@ -7,7 +7,7 @@ import Navbar from './components/Shared/Navbar'
import Home from './pages/Home'
import Login from './pages/Login'
import NotFound from './pages/NotFound'
-import SchematicEditor from './pages/SchematiEditor'
+import SchematicEditor from './pages/SchematicEditor'
import Simulator from './pages/Simulator'
import Gallery from './pages/Gallery'
diff --git a/blocks/eda-frontend/src/components/SchematicEditor/Helper/ComponentDrag.js b/blocks/eda-frontend/src/components/SchematicEditor/Helper/ComponentDrag.js
index 4155c2ee..7990c1ce 100644
--- a/blocks/eda-frontend/src/components/SchematicEditor/Helper/ComponentDrag.js
+++ b/blocks/eda-frontend/src/components/SchematicEditor/Helper/ComponentDrag.js
@@ -7,8 +7,6 @@ import * as actions from '../../../redux/actions/actions'
import store from '../../../redux/store'
import dot from '../../../static/dot.gif'
-// import ClipBoardFunct from './ClipBoard.js'
-// import NetlistInfoFunct from './NetlistInfo.js'
import ToolbarTools from './ToolbarTools.js'
import KeyboardShorcuts from './KeyboardShorcuts.js'
import { SideBar } from './SideBar.js'
diff --git a/blocks/eda-frontend/src/components/SchematicEditor/Helper/SchematicEditor.css b/blocks/eda-frontend/src/components/SchematicEditor/Helper/SchematicEditor.css
index b3924826..7cd992c0 100644
--- a/blocks/eda-frontend/src/components/SchematicEditor/Helper/SchematicEditor.css
+++ b/blocks/eda-frontend/src/components/SchematicEditor/Helper/SchematicEditor.css
@@ -1,15 +1,16 @@
/* Sidebar Components */
.compImage {
- width: 72px;
- height: 72px;
+ width: auto;
+ height: auto;
+ max-height: 48px;
margin-left: auto;
- padding: 2px;
+ padding: 3px;
}
.compImage:hover {
background-color: #f4f6f8;
border-radius: 5px;
- transform: scale(1.5);
+ transform: scale(1.2);
padding: 3px;
box-shadow: 0px 0px 41px 17px rgba(207,218,225,0.68);
}
@@ -96,4 +97,4 @@ html {
/* Optional: show position indicator in red */
::-webkit-scrollbar-thumb {
background: grey;
-} \ No newline at end of file
+}
diff --git a/blocks/eda-frontend/src/components/SchematicEditor/Helper/SvgParser.js b/blocks/eda-frontend/src/components/SchematicEditor/Helper/SvgParser.js
index 9f36f1cf..89b74acd 100644
--- a/blocks/eda-frontend/src/components/SchematicEditor/Helper/SvgParser.js
+++ b/blocks/eda-frontend/src/components/SchematicEditor/Helper/SvgParser.js
@@ -61,7 +61,7 @@ export function getSvgMetadata (graph, parent, evt, target, x, y, component) {
// initialize information from the svg meta
// plots pinnumbers and component labels.
- var path = '../' + component.svg_path
+ var path = 'http://localhost:8000/static/' + component.block_image_path
fetch(path)
.then(function (response) {
diff --git a/blocks/eda-frontend/src/components/SchematicEditor/SideComp.js b/blocks/eda-frontend/src/components/SchematicEditor/SideComp.js
index 5e5c2b77..1a0f0b18 100644
--- a/blocks/eda-frontend/src/components/SchematicEditor/SideComp.js
+++ b/blocks/eda-frontend/src/components/SchematicEditor/SideComp.js
@@ -41,7 +41,7 @@ export default function SideComp ({ component }) {
<Tooltip title={component.name} arrow>
{/* Display Image thumbnail in left side pane */}
- <img ref={imageRef} className='compImage' src={'../' + component.svg_path} alt="Logo" aria-describedby={id} onClick={handleClick} />
+ <img ref={imageRef} className='compImage' src={'http://localhost:8000/static/' + component.block_image_path} alt="Logo" aria-describedby={id} onClick={handleClick} />
</Tooltip>
{/* Popover to display component information on single click */}
@@ -68,7 +68,7 @@ export default function SideComp ({ component }) {
{
component.categories !== '' &&
<ListItemText>
- <b>Categories:</b> {component.categories}
+ <b>Categories:</b> {component.categories.map((c) => <li>{c}</li>)}
</ListItemText>
}
diff --git a/blocks/eda-frontend/src/pages/SchematiEditor.js b/blocks/eda-frontend/src/pages/SchematicEditor.js
index 8c4dbe02..cf86452f 100644
--- a/blocks/eda-frontend/src/pages/SchematiEditor.js
+++ b/blocks/eda-frontend/src/pages/SchematicEditor.js
@@ -26,7 +26,7 @@ const useStyles = makeStyles((theme) => ({
}
}))
-export default function SchematiEditor (props) {
+export default function SchematicEditor (props) {
const classes = useStyles()
const compRef = React.createRef()
const gridRef = React.createRef()