diff options
author | Sunil Shetye | 2021-08-26 22:11:05 +0530 |
---|---|---|
committer | Sunil Shetye | 2021-10-01 11:37:01 +0530 |
commit | e64a4dc9e7201b3a4efaec65491904d215ee5f8b (patch) | |
tree | b109b188797f2e0a20abd38ddf056c920eed199c | |
parent | 62981892cb519f5d181662654730f32d438c455e (diff) | |
download | Common-Interface-Project-e64a4dc9e7201b3a4efaec65491904d215ee5f8b.tar.gz Common-Interface-Project-e64a4dc9e7201b3a4efaec65491904d215ee5f8b.tar.bz2 Common-Interface-Project-e64a4dc9e7201b3a4efaec65491904d215ee5f8b.zip |
replace Schematic/Diagram and Component/Block with env variable
14 files changed, 54 insertions, 28 deletions
diff --git a/blocks/eda-frontend/.env b/blocks/eda-frontend/.env index 146d529f..a0646cdf 100644 --- a/blocks/eda-frontend/.env +++ b/blocks/eda-frontend/.env @@ -5,5 +5,9 @@ REACT_APP_BLOCK_NAME=Block REACT_APP_BLOCKS_NAME=Blocks REACT_APP_CATEGORY_NAME=Category REACT_APP_CATEGORIES_NAME=Categories +REACT_APP_SMALL_DIAGRAM_NAME=diagram +REACT_APP_DIAGRAM_NAME=Diagram +REACT_APP_SMALL_DIAGRAMS_NAME=diagrams +REACT_APP_DIAGRAMS_NAME=Diagrams REACT_APP_BLOCK_SCALE=1 REACT_APP_PORT_SIZE=8 diff --git a/blocks/eda-frontend/src/components/Dashboard/DashboardHome.js b/blocks/eda-frontend/src/components/Dashboard/DashboardHome.js index d9909cff..5649d5b6 100644 --- a/blocks/eda-frontend/src/components/Dashboard/DashboardHome.js +++ b/blocks/eda-frontend/src/components/Dashboard/DashboardHome.js @@ -29,6 +29,7 @@ const useStyles = makeStyles((theme) => ({ function MainCard () { const classes = useStyles() const auth = useSelector(state => state.authReducer) + const button = 'My ' + process.env.REACT_APP_DIAGRAMS_NAME return ( <Card className={classes.mainHead}> @@ -47,7 +48,7 @@ function MainCard () { color="primary" size="small" > - My Schematics + {button} </Button> </CardActions> </Card> @@ -57,6 +58,7 @@ function MainCard () { export default function DashboardHome () { const classes = useStyles() const auth = useSelector(state => state.authReducer) + const typography = 'Track your ' + process.env.REACT_APP_SMALL_DIAGRAMS_NAME + ' status here...' return ( <> @@ -76,7 +78,7 @@ export default function DashboardHome () { <Grid item xs={12}> <Card style={{ padding: '7px 15px' }} className={classes.mainHead}> <Typography variant="subtitle1" gutterBottom> - Hey {auth.user.username} , Track your schematics status here... + Hey {auth.user.username} , {typography} </Typography> </Card> </Grid> diff --git a/blocks/eda-frontend/src/components/Dashboard/DashboardSidebar.js b/blocks/eda-frontend/src/components/Dashboard/DashboardSidebar.js index e56a52f6..34d58b5f 100644 --- a/blocks/eda-frontend/src/components/Dashboard/DashboardSidebar.js +++ b/blocks/eda-frontend/src/components/Dashboard/DashboardSidebar.js @@ -58,6 +58,8 @@ export default function DashSidebar (props) { dispatch(fetchSchematics()) }, [dispatch]) + const button = 'My ' + process.env.REACT_APP_DIAGRAMS_NAME + const placeholder = 'Find your ' + process.env.REACT_APP_SMALL_DIAGRAM_NAME + '...' return ( <> <Hidden smDown> @@ -109,14 +111,14 @@ export default function DashSidebar (props) { className={classes.sideItem} button > - <ListItemText primary='My Schematics'/> + <ListItemText primary={button}/> </ListItem> {/* List name of saved schematics */} <List className={classes.nestedSearch} > <InputBase className={classes.input} - placeholder="Find your schematic..." + placeholder={placeholder} /> </List> <div className={classes.nested} > diff --git a/blocks/eda-frontend/src/components/Dashboard/ProgressPanel.js b/blocks/eda-frontend/src/components/Dashboard/ProgressPanel.js index e9674a1d..564bc035 100644 --- a/blocks/eda-frontend/src/components/Dashboard/ProgressPanel.js +++ b/blocks/eda-frontend/src/components/Dashboard/ProgressPanel.js @@ -65,6 +65,8 @@ export default function ProgressPanel () { dispatch(fetchSchematics()) }, [dispatch]) + const tab = 'Recent ' + process.env.REACT_APP_DIAGRAMS_NAME + const typography = 'You have not created any ' + process.env.REACT_APP_SMALL_DIAGRAM_NAME return ( <div className={classes.root}> <AppBar position="static"> @@ -75,9 +77,7 @@ export default function ProgressPanel () { scrollButtons="auto" aria-label="scrollable auto tabs example" > - <Tab label="Recent Schematics" {...a11yProps(0)} /> - {/* <Tab label="Under Reviewer" {...a11yProps(1)} /> - <Tab label="Under Domain Expert" {...a11yProps(2)} /> */} + <Tab label={tab} {...a11yProps(0)} /> </Tabs> </AppBar> @@ -103,7 +103,7 @@ export default function ProgressPanel () { )} </Grid> : <Typography variant="button" display="block" gutterBottom> - You have not created any schematic , Create your first one now... + {typography} , Create your first one now... </Typography> } </TabPanel> diff --git a/blocks/eda-frontend/src/components/Dashboard/SchematicsList.js b/blocks/eda-frontend/src/components/Dashboard/SchematicsList.js index ab6830a0..fa17d2b5 100644 --- a/blocks/eda-frontend/src/components/Dashboard/SchematicsList.js +++ b/blocks/eda-frontend/src/components/Dashboard/SchematicsList.js @@ -29,15 +29,17 @@ const useStyles = makeStyles({ // Card displaying user my schematics page header. function MainCard () { const classes = useStyles() + const typography1 = 'All ' + process.env.REACT_APP_SMALL_DIAGRAMS_NAME + ' are listed below' + const typography2 = 'My ' + process.env.REACT_APP_DIAGRAMS_NAME return ( <Card className={classes.mainHead}> <CardContent> <Typography className={classes.title} gutterBottom> - All schematics are Listed Below + {typography1} </Typography> <Typography variant="h5" component="h2"> - My Schematics + {typography2} </Typography> </CardContent> <CardActions> @@ -70,6 +72,7 @@ export default function SchematicsList () { dispatch(fetchSchematics()) }, [dispatch]) + const typography1 = "You don't have any saved " + process.env.REACT_APP_SMALL_DIAGRAMS_NAME + '...' return ( <> <Grid @@ -101,7 +104,7 @@ export default function SchematicsList () { : <Grid item xs={12}> <Card style={{ padding: '7px 15px' }} className={classes.mainHead}> <Typography variant="subtitle1" gutterBottom> - Hey {auth.user.username} , You dont have any saved schematics... + Hey {auth.user.username} , {typography1} </Typography> </Card> </Grid> diff --git a/blocks/eda-frontend/src/components/SchematicEditor/Header.js b/blocks/eda-frontend/src/components/SchematicEditor/Header.js index 9685fbb0..388a0bda 100644 --- a/blocks/eda-frontend/src/components/SchematicEditor/Header.js +++ b/blocks/eda-frontend/src/components/SchematicEditor/Header.js @@ -192,6 +192,8 @@ function Header () { const link = process.env.REACT_APP_NAME const altImage = process.env.REACT_APP_NAME + ' logo' + const typography1 = 'Share Your ' + process.env.REACT_APP_DIAGRAM_NAME + const typography2 = 'My ' + process.env.REACT_APP_DIAGRAMS_NAME return ( <Toolbar variant="dense" color="default"> <SimpleSnackbar open={snacOpen} close={handleSnacClose} message={message} /> @@ -255,7 +257,7 @@ function Header () { aria-labelledby="share-dialog-title" aria-describedby="share-dialog-description" > - <DialogTitle id="share-dialog-title">{'Share Your Schematic'}</DialogTitle> + <DialogTitle id="share-dialog-title">{typography1}</DialogTitle> <DialogContent> <DialogContentText id="share-dialog-description"> <FormControlLabel @@ -344,7 +346,7 @@ function Header () { to="/dashboard/schematics" onClick={handleClose} > - My Schematics + {typography2} </MenuItem> <MenuItem onClick={() => { store.dispatch(logout(history)) diff --git a/blocks/eda-frontend/src/components/SchematicEditor/Helper/ToolbarTools.js b/blocks/eda-frontend/src/components/SchematicEditor/Helper/ToolbarTools.js index f3f42c09..cbe43684 100644 --- a/blocks/eda-frontend/src/components/SchematicEditor/Helper/ToolbarTools.js +++ b/blocks/eda-frontend/src/components/SchematicEditor/Helper/ToolbarTools.js @@ -137,7 +137,7 @@ export function PrintPreview () { header.style.borderBottom = '1px solid blue' header.style.top = '0px' - mxUtils.write(footer, 'Made with Diagram Editor - ' + pageNumber + ' - ' + process.env.REACT_APP_NAME + ' on Cloud') + mxUtils.write(footer, 'Made with ' + process.env.REACT_APP_DIAGRAM_NAME + ' Editor - ' + pageNumber + ' - ' + process.env.REACT_APP_NAME + ' on Cloud') footer.style.borderTop = '1px solid blue' footer.style.bottom = '0px' @@ -152,6 +152,7 @@ export function PrintPreview () { // ERC CHECK FOR SCHEMATIC export function ErcCheck () { + const NoAddition = 'No ' + process.env.REACT_APP_BLOCK_NAME + ' added'; var list = graph.getModel().cells // mapping the grid var vertexCount = 0 var errorCount = 0 @@ -180,7 +181,7 @@ export function ErcCheck () { } if (vertexCount === 0) { - alert('No Component added') + alert(NoAddition) ++errorCount } else if (PinNC !== 0) { alert('Pins not connected') @@ -193,6 +194,7 @@ export function ErcCheck () { } } function ErcCheckNets () { + const NoAddition = 'No ' + process.env.REACT_APP_BLOCK_NAME + ' added'; var list = graph.getModel().cells // mapping the grid var vertexCount = 0 var errorCount = 0 @@ -218,7 +220,7 @@ function ErcCheckNets () { } } if (vertexCount === 0) { - alert('No Component added') + alert(NoAddition) ++errorCount return false } else if (PinNC !== 0) { diff --git a/blocks/eda-frontend/src/components/SchematicEditor/PropertiesSidebar.js b/blocks/eda-frontend/src/components/SchematicEditor/PropertiesSidebar.js index 4b3800f2..ac4c588a 100644 --- a/blocks/eda-frontend/src/components/SchematicEditor/PropertiesSidebar.js +++ b/blocks/eda-frontend/src/components/SchematicEditor/PropertiesSidebar.js @@ -130,6 +130,9 @@ export default function PropertiesSidebar ({ gridRef, outlineRef }) { dispatch(setSchDescription(evt.target.value)) } + const typography1 = process.env.REACT_APP_DIAGRAM_NAME + ' Description' + const typography2 = 'Add ' + process.env.REACT_APP_DIAGRAM_NAME + ' Description' + const typography3 = process.env.REACT_APP_BLOCKS_NAME + ' Position' return ( <> <Hidden mdDown> @@ -145,7 +148,7 @@ export default function PropertiesSidebar ({ gridRef, outlineRef }) { {/* Display component position box */} <ListItem> - <ListItemText primary="Components Position" /> + <ListItemText primary={typography3} /> </ListItem> <ListItem style={{ padding: '0px' }} divider> <div className="outline-container" ref={outlineRef} id="outlineContainer" /> @@ -153,10 +156,10 @@ export default function PropertiesSidebar ({ gridRef, outlineRef }) { {/* Input form field for schematic description */} <ListItem> - <ListItemText primary="Schematic Description" /> + <ListItemText primary={typography1} /> </ListItem> <ListItem style={{ padding: '0px 7px 7px 7px' }} divider> - <TextareaAutosize id='Description' label='Description' value={ schSave.description === '' ? description || '' : schSave.description } onChange={getInputValues} rowsMin={6} aria-label='Description' placeholder={'Add Schematic Description'} style={{ width: '100%', minWidth: '234px', maxHeight: '250px' }} /> + <TextareaAutosize id='Description' label='Description' value={ schSave.description === '' ? description || '' : schSave.description } onChange={getInputValues} rowsMin={6} aria-label='Description' placeholder={typography2} style={{ width: '100%', minWidth: '234px', maxHeight: '250px' }} /> </ListItem> </div> </List> diff --git a/blocks/eda-frontend/src/components/SchematicEditor/SimulationScreen.js b/blocks/eda-frontend/src/components/SchematicEditor/SimulationScreen.js index b87a4ced..5db2803f 100644 --- a/blocks/eda-frontend/src/components/SchematicEditor/SimulationScreen.js +++ b/blocks/eda-frontend/src/components/SchematicEditor/SimulationScreen.js @@ -80,6 +80,8 @@ export default function SimulationScreen ({ open, close, isResult }) { setPrecision(evt.target.value) } + const typography1 = 'SOMETHING WENT WRONG. Please Check The Simulation Parameters.' + const typography2 = 'SOMETHING WENT WRONG. Please Check The Simulation Parameters And ' + process.env.REACT_APP_DIAGRAM_NAME + '.' return ( <div> <Dialog fullScreen open={open} onClose={close} TransitionComponent={Transition} PaperProps={{ @@ -247,7 +249,7 @@ export default function SimulationScreen ({ open, close, isResult }) { /> </Paper> </Grid> - : (result.isGraph === 'true') ? <span>SOMETHING WENT WRONG PLEASE CHECK THE SIMULATION PARAMETERS.</span> : <span></span> + : (result.isGraph === 'true') ? <span>{typography1}</span> : <span></span> } {/* Display text result */} @@ -356,7 +358,7 @@ export default function SimulationScreen ({ open, close, isResult }) { : <Grid item xs={12} sm={12}> <Paper className={classes.paper}> <Typography variant="h6" align="center" gutterBottom> - SOMETHING WENT WRONG PLEASE CHECK THE SIMULATION PARAMETERS AND SCHEMATIC DIAGRAM. {/* Error handling message in case of null result */} + {typography2} {/* Error handling message in case of null result */} </Typography> </Paper> </Grid> diff --git a/blocks/eda-frontend/src/components/SchematicEditor/ToolbarExtension.js b/blocks/eda-frontend/src/components/SchematicEditor/ToolbarExtension.js index 5ed1451d..25724859 100644 --- a/blocks/eda-frontend/src/components/SchematicEditor/ToolbarExtension.js +++ b/blocks/eda-frontend/src/components/SchematicEditor/ToolbarExtension.js @@ -53,6 +53,7 @@ export function NetlistModal ({ open, close, netlist }) { var blob = new Blob([netlist], { type: 'text/plain;charset=utf-8' }) FileSaver.saveAs(blob, `${titleA}_${name}_on_Cloud.cir`) } + const typography2 = 'Current netlist for given ' + process.env.REACT_APP_SMALL_DIAGRAM_NAME + '...' return ( <Dialog open={open} @@ -65,7 +66,7 @@ export function NetlistModal ({ open, close, netlist }) { <DialogTitle id="generate-netlist-title">{'Netlist Generator'}</DialogTitle> <DialogContent dividers> <DialogContentText id="generate-netlist-description"> - Current Netlist for given schematic...<br /><br /> + {typography2}<br /><br /> <TextareaAutosize aria-label="empty textarea" rowsMin={20} rowsMax={50} style={{ minWidth: '500px' }} value={netlist} /> </DialogContentText> </DialogContent> @@ -394,6 +395,8 @@ export function OpenSchDialog (props) { const dispatch = useDispatch() + const title = 'Open ' + process.env.REACT_APP_DIAGRAM_NAME + const typography1 = "You don't have any saved " + process.env.REACT_APP_SMALL_DIAGRAMS_NAME + '...' return ( <Dialog open={open} @@ -405,7 +408,7 @@ export function OpenSchDialog (props) { aria-describedby="open-dialog-description" > <DialogTitle id="open-dialog-title" onClose={close}> - <Typography component="span" variant="h3">{'Open Schematic'}</Typography> + <Typography component="span" variant="h3">{title}</Typography> </DialogTitle> <DialogContent dividers> <DialogContentText id="open-dialog-description" > @@ -462,7 +465,7 @@ export function OpenSchDialog (props) { {/* Listing Saved Schematics */} {schematics.length === 0 ? <Typography variant="subtitle1" gutterBottom> - Hey {auth.user.username} , You dont have any saved schematics... + Hey {auth.user.username} , {typography1} </Typography> : <TableContainer component={Paper} style={{ maxHeight: '45vh' }}> <Table stickyHeader size="small" aria-label="simple table"> diff --git a/blocks/eda-frontend/src/components/Shared/Navbar.js b/blocks/eda-frontend/src/components/Shared/Navbar.js index 12e3e549..a9880f88 100644 --- a/blocks/eda-frontend/src/components/Shared/Navbar.js +++ b/blocks/eda-frontend/src/components/Shared/Navbar.js @@ -58,6 +58,7 @@ export function Header () { const link = process.env.REACT_APP_NAME const altImage = process.env.REACT_APP_NAME + ' logo' + const typography = 'My ' + process.env.REACT_APP_DIAGRAMS_NAME return ( <> {/* Display logo */} @@ -219,7 +220,7 @@ export function Header () { to="/dashboard/schematics" onClick={handleClose} > - My Schematics + {typography} </MenuItem> <MenuItem onClick={() => { store.dispatch(logout(history)) diff --git a/blocks/eda-frontend/src/pages/Gallery.js b/blocks/eda-frontend/src/pages/Gallery.js index 57925f63..16936cab 100644 --- a/blocks/eda-frontend/src/pages/Gallery.js +++ b/blocks/eda-frontend/src/pages/Gallery.js @@ -96,6 +96,7 @@ function MainCard () { const classes = useStyles() const typography = process.env.REACT_APP_NAME + ' Gallery' + const diagramTypography = 'Sample ' + process.env.REACT_APP_SMALL_DIAGRAMS_NAME + ' are listed below...' return ( <Card className={classes.mainHead}> <CardContent> @@ -103,7 +104,7 @@ function MainCard () { {typography} </Typography> <Typography className={classes.title} align="center" gutterBottom> - Sample schematics are listed below... + {diagramTypography} </Typography> </CardContent> </Card> diff --git a/blocks/eda-frontend/src/pages/Home.js b/blocks/eda-frontend/src/pages/Home.js index 26a7d0f8..df149db3 100644 --- a/blocks/eda-frontend/src/pages/Home.js +++ b/blocks/eda-frontend/src/pages/Home.js @@ -23,6 +23,7 @@ export default function Home () { const typography1 = process.env.REACT_APP_NAME + ' on Cloud' const typography2 = 'Online ' + process.env.REACT_APP_NAME + ' Simulator' + const typography3 = process.env.REACT_APP_DIAGRAM_NAME + ' Editor' return ( <Container maxWidth="sm" component="main" className={classes.header}> <center> @@ -53,7 +54,7 @@ export default function Home () { size="large" color="primary" > - Diagram Editor + {typography3} </Button> </Typography> </Container> diff --git a/blocks/eda-frontend/src/pages/SchematicEditor.js b/blocks/eda-frontend/src/pages/SchematicEditor.js index d29e9f89..0864844a 100644 --- a/blocks/eda-frontend/src/pages/SchematicEditor.js +++ b/blocks/eda-frontend/src/pages/SchematicEditor.js @@ -38,7 +38,7 @@ export default function SchematicEditor (props) { } useEffect(() => { - document.title = 'Diagram Editor - ' + process.env.REACT_APP_NAME + document.title = process.env.REACT_APP_DIAGRAM_NAME + ' Editor - ' + process.env.REACT_APP_NAME var container = gridRef.current var sidebar = compRef.current var outline = outlineRef.current |