diff --git a/frontend/public/LogoCarbonteam.ico b/frontend/public/LogoCarbonteam.ico new file mode 100644 index 00000000..f7f203ef Binary files /dev/null and b/frontend/public/LogoCarbonteam.ico differ diff --git a/frontend/public/favicon.ico b/frontend/public/favicon.ico deleted file mode 100644 index 07c27748..00000000 Binary files a/frontend/public/favicon.ico and /dev/null differ diff --git a/frontend/public/index.html b/frontend/public/index.html index 1c45ceb7..e1b66545 100644 --- a/frontend/public/index.html +++ b/frontend/public/index.html @@ -2,39 +2,42 @@ - + - + + manifest.json provides metadata used when your web app is installed on a + user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/ + --> - Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will - work correctly both with client-side routing and a non-root public URL. - Learn how to configure a non-root public URL by running `npm run build`. - --> - Dashboard Kit + Carbon Footprint Visualization +
+ This HTML file is a template. + If you open it directly in the browser, you will see an empty page. + + You can add webfonts, meta tags, or analytics to this file. + The build step will place the bundled scripts into the tag. + + To begin the development, run `npm start` or `yarn start`. + To create a production bundle, use `npm run build` or `yarn build`. + --> + diff --git a/frontend/src/assets/dummyImages/Logo2.png b/frontend/src/assets/dummyImages/Logo2.png new file mode 100644 index 00000000..1866a2b1 Binary files /dev/null and b/frontend/src/assets/dummyImages/Logo2.png differ diff --git a/frontend/src/assets/icons/icon-arrow.js b/frontend/src/assets/icons/icon-arrow.js index d3b7374a..343f2bcf 100644 --- a/frontend/src/assets/icons/icon-arrow.js +++ b/frontend/src/assets/icons/icon-arrow.js @@ -1,7 +1,7 @@ import React from 'react'; export default (props) => ( - + diff --git a/frontend/src/assets/icons/icon-building.js b/frontend/src/assets/icons/icon-building.js index 821d220c..fff2ecf0 100644 --- a/frontend/src/assets/icons/icon-building.js +++ b/frontend/src/assets/icons/icon-building.js @@ -2,7 +2,7 @@ import React from 'react'; export default (props) => ( - + diff --git a/frontend/src/assets/icons/icon-circle.js b/frontend/src/assets/icons/icon-circle.js new file mode 100644 index 00000000..ca5dd787 --- /dev/null +++ b/frontend/src/assets/icons/icon-circle.js @@ -0,0 +1,8 @@ + +import React from 'react'; + +export default (props) => ( + + + +) \ No newline at end of file diff --git a/frontend/src/assets/icons/icon-home.js b/frontend/src/assets/icons/icon-home.js index 3110436b..e2d5a6c3 100644 --- a/frontend/src/assets/icons/icon-home.js +++ b/frontend/src/assets/icons/icon-home.js @@ -2,7 +2,7 @@ import React from "react"; export default (props) => ( - + diff --git a/frontend/src/assets/icons/icon-logout.js b/frontend/src/assets/icons/icon-logout.js index 57818366..f82961dc 100644 --- a/frontend/src/assets/icons/icon-logout.js +++ b/frontend/src/assets/icons/icon-logout.js @@ -1,7 +1,7 @@ import React from 'react'; export default (props) => ( - + ( - + diff --git a/frontend/src/assets/icons/icon-power.js b/frontend/src/assets/icons/icon-power.js index 35c8f824..5c33981d 100644 --- a/frontend/src/assets/icons/icon-power.js +++ b/frontend/src/assets/icons/icon-power.js @@ -3,7 +3,7 @@ import React from 'react'; export default (props) => ( - + diff --git a/frontend/src/assets/icons/icon-settings.js b/frontend/src/assets/icons/icon-settings.js index fb82b698..acedfca3 100644 --- a/frontend/src/assets/icons/icon-settings.js +++ b/frontend/src/assets/icons/icon-settings.js @@ -1,7 +1,7 @@ import React from 'react'; export default (props) => ( - + diff --git a/frontend/src/assets/icons/icon-transmission.js b/frontend/src/assets/icons/icon-transmission.js index b5cda91f..cbf63803 100644 --- a/frontend/src/assets/icons/icon-transmission.js +++ b/frontend/src/assets/icons/icon-transmission.js @@ -3,7 +3,7 @@ import React from 'react'; export default (props) => ( - + + + +) \ No newline at end of file diff --git a/frontend/src/assets/icons/index.js b/frontend/src/assets/icons/index.js index 2af03812..09da347d 100644 --- a/frontend/src/assets/icons/index.js +++ b/frontend/src/assets/icons/index.js @@ -23,6 +23,8 @@ import IconArrow from './icon-arrow'; import IconBrowse from './icon-browse'; import IconBuilding from './icon-building'; import IconArrowDown from './icon-arrow-down'; +import IconCircle from './icon-circle' +import IconUser from './icon-user' export { IconCheckboxOff, @@ -49,5 +51,7 @@ export { IconArrow, IconBrowse, IconBuilding, - IconArrowDown + IconArrowDown, + IconCircle, + IconUser }; diff --git a/frontend/src/components/cards/MiniCardComponent.js b/frontend/src/components/cards/MiniCardComponent.js index 0e365add..2ca58e88 100644 --- a/frontend/src/components/cards/MiniCardComponent.js +++ b/frontend/src/components/cards/MiniCardComponent.js @@ -1,21 +1,22 @@ import React from 'react'; import { Column } from 'simple-flexbox'; import { createUseStyles, useTheme } from 'react-jss'; - +import theme from 'resources/theme'; //reconfiguration of the dropdown boxes const useStyles = createUseStyles((theme) => ({ container: { backgroundColor: '#FFFFFF', - border: `1px solid ${theme.color.lightGrayishBlue2}`, + border: `3px solid ${theme.color.lightGrayishBlue2}`, borderRadius: 4, cursor: 'pointer', - maxWidth: 205, - maxHeight:160, - marginTop:50, - padding: '8px 16px 8px 16px', + maxWidth: 350, + minWidth:210, // resizing the card min width + maxHeight:150, + // marginTop:50, + // padding: '8px 16px 8px 16px', '&:hover': { - borderColor: theme.color.lightBlue, + borderColor: theme.uniformStyle.color.tableHeaderColor , '&:nth-child(n) > span': { color: theme.color.lightBlue } @@ -30,8 +31,8 @@ const useStyles = createUseStyles((theme) => ({ }, value: { color: theme.color.veryDarkGrayishBlue, - fontWeight: 'bold', - fontSize: 20, + fontWeight: 'inherit', + fontSize: 14, letterSpacing: '1px', lineHeight: '50px', textAlign: 'center' @@ -47,12 +48,10 @@ function MiniCardComponent({ className = '', title, value, path }) { return ( {/* Resize the image on the cards (product images) */} -
- {/* define the image path */} - +
+ {/* define the image path */} +
- {title} - {value} ); diff --git a/frontend/src/components/details/CanvasComponent.jsx b/frontend/src/components/details/CanvasComponent.jsx index 3eeb39b7..5ca5832a 100644 --- a/frontend/src/components/details/CanvasComponent.jsx +++ b/frontend/src/components/details/CanvasComponent.jsx @@ -2,7 +2,7 @@ in this main component come all the canvas page components such as diagrams and tables -@author parham, 08.05 +@author parham, 08.05, Irem Toroslu */ import React, { Component } from 'react'; @@ -11,25 +11,30 @@ import ColumnChart from './ColumnChartComponent'; import Table from './TableComponent' import './canvas.css'; import {Container, Row, Col } from 'react-grid-system'; +import theme from 'resources/theme'; + class CanvasPage extends Component { render() { return ( - + - -

Material Composition

+ +

Material Composition

- -

Results of the impact assessment

+ +

Results of the impact assessment

- -

Impact categories

+ +

Impact categories

diff --git a/frontend/src/components/details/ColumnChartComponent.jsx b/frontend/src/components/details/ColumnChartComponent.jsx index cdcde63d..69644f7c 100644 --- a/frontend/src/components/details/ColumnChartComponent.jsx +++ b/frontend/src/components/details/ColumnChartComponent.jsx @@ -1,11 +1,12 @@ /** * Column Chart * - * @author Julian Oelhaf + * @author Julian Oelhaf, Irem Toroslu */ import React, { Component } from 'react'; import ReactApexChart from 'react-apexcharts'; import {getResultsImpactAssessment} from 'interface/projectInterface'; +import theme from 'resources/theme'; const ColumnChartComponent = () => { const series = [{ @@ -20,11 +21,15 @@ const ColumnChartComponent = () => { type: 'bar', height: '150' }, + plotOptions: { bar: { - color: '#00308F', columnWidth: '60%', } + + }, + fill: { + colors: [theme.uniformStyle.color.barChartColor] }, dataLabels: { enabled: false, @@ -39,7 +44,13 @@ const ColumnChartComponent = () => { labels: { formatter: function (y) { return y.toFixed(0) + "%"; - } + }, + style: { + fontSize: theme.typography.chartItemstitle.fontSize, + fontWeight: theme.typography.chartItemstitle.fontWeight + } + + } }, xaxis: { @@ -47,7 +58,11 @@ const ColumnChartComponent = () => { 'Materials', 'Manufacturing and Transport', 'Operation 30a (75% load)', 'End of Life' ], labels: { - rotate: -90 + rotate: -90, + style: { + fontSize: theme.typography.chartItemstitle.fontSize, + fontWeight: theme.typography.chartItemstitle.fontWeight + } } } }; @@ -57,7 +72,7 @@ const ColumnChartComponent = () => { return (
- +
); diff --git a/frontend/src/components/details/DetailsComponent.js b/frontend/src/components/details/DetailsComponent.js index 190908d0..1165db52 100644 --- a/frontend/src/components/details/DetailsComponent.js +++ b/frontend/src/components/details/DetailsComponent.js @@ -3,20 +3,63 @@ * canvas page and variable drop down list * * @author parham, 08.05 - */ + * */ import React, {Component, useContext} from 'react'; import Canvas from './CanvasComponent'; import SelectVariable from './SelectVariableComponent'; import {PrivateSectionContext} from "hooks/PrivateSectionContext"; +import { useTheme, createUseStyles } from 'react-jss'; +const useStyles = createUseStyles((theme) => ({ + + container: { + display: 'flex' + + }, + textcontent: { + ...theme.typography.textcontent, + textAlign: 'left', + '@media (max-width: 768px)': { + display: 'none', + + + + } + }, + + subtitle: { + ...theme.typography.title, + '@media (max-width: 1080px)': { + marginLeft: -50, + + }, + '@media (max-width: 468px)': { + fontSize: 50, + + } + }, + title: { + ...theme.typography.title, + '@media (max-width: 1080px)': { + marginLeft: 80, + + }, + '@media (max-width: 468px)': { + fontSize: 50, + + } + } + })); function DetailInfo() { const [ selectedProducts, setSelectedProducts ] = useContext(PrivateSectionContext); + const theme = useTheme(); + const classes = useStyles({ theme }); return ( -

The chosen Model is {selectedProducts[0].modelName}

- - +

The chosen Model is {selectedProducts[0].modelName}

+
+
); } diff --git a/frontend/src/components/details/PieChartComponent.jsx b/frontend/src/components/details/PieChartComponent.jsx index 683cc517..7665ebe2 100644 --- a/frontend/src/components/details/PieChartComponent.jsx +++ b/frontend/src/components/details/PieChartComponent.jsx @@ -1,11 +1,12 @@ /** * Pie Chart Diagram * - * @author parham, Julian + * @author parham, Julian, Irem Toroslu */ import React, { Component } from 'react'; import ReactApexChart from 'react-apexcharts'; import { getMaterialComposition} from 'interface/projectInterface'; +import theme from 'resources/theme'; const PieChartDiagramComponent = () => { //const series = [17, 13, 3, 2, 1, 42, 21]; @@ -17,7 +18,12 @@ const PieChartDiagramComponent = () => { chart: { type: 'donut' }, - labels: [ + legend: { + fontSize: theme.typography.chartItemstitle.fontSize, + fontWeight:theme.typography.chartItemstitle.fontWeight + }, + labels: + [ 'Transformer oil', 'Steel', 'Pressboard', @@ -26,9 +32,19 @@ const PieChartDiagramComponent = () => { 'Silicon steel', 'Copper' ], - colors: ['#040f13', '#0b2d39', '#165a72', '#2596be', '#3ba1c5', '#00308F', '#d3eaf2'], + colors: [theme.color.TransformerOil, theme.color.Steel, theme.color.Pressboard, theme.color.StainlessSteel, theme.color.Alminium, theme.color.SiliconSteel, theme.color.Copper], fill: { - type: 'gradient' + type: 'gradient', + gradient: { + shade: 'dark', + type: "horizontal", + shadeIntensity: 0.5, + gradientToColors: undefined, // optional, if not defined - uses the shades of same color in series + inverseColors: true, + opacityFrom: 1, + opacityTo: 1, + stops: [0, 50, 100], + colorStops: []} }, responsive: [ { @@ -39,6 +55,7 @@ const PieChartDiagramComponent = () => { }, legend: { position: 'bottom' + } } } @@ -48,7 +65,6 @@ const PieChartDiagramComponent = () => { return (
-
); diff --git a/frontend/src/components/details/SelectVariableComponent.jsx b/frontend/src/components/details/SelectVariableComponent.jsx index 20544f95..339ab4e1 100644 --- a/frontend/src/components/details/SelectVariableComponent.jsx +++ b/frontend/src/components/details/SelectVariableComponent.jsx @@ -4,6 +4,7 @@ a drop down component for selecting variable @author parham, 08.05 */ import React, { Component } from 'react'; +import theme from 'resources/theme'; class SelectVariableComponent extends Component { /* @@ -37,10 +38,10 @@ class SelectVariableComponent extends Component {
Pick your desire variable:
- - -
); diff --git a/frontend/src/components/details/TableComponent.jsx b/frontend/src/components/details/TableComponent.jsx index 96ddf7b9..5e5e6125 100644 --- a/frontend/src/components/details/TableComponent.jsx +++ b/frontend/src/components/details/TableComponent.jsx @@ -1,4 +1,6 @@ import React, { Component } from 'react'; +import { Container } from 'react-grid-system'; +import theme from 'resources/theme'; class DetailTable extends Component { state = { @@ -76,14 +78,16 @@ class DetailTable extends Component { }; render() { return ( -
+ // TODO:left margin value needed to be fixed + + {/* TODO: dynamic display of product and model */} -
Large Power Transformer
-
3 Phase GSU transformer
+
Large Power Transformer
+
3 Phase GSU transformer
- + {this.state.headers.map((item) => ( ))} @@ -101,7 +105,7 @@ class DetailTable extends Component { ))}
{item.value}
-
+ ); } } diff --git a/frontend/src/components/header/HeaderComponent.js b/frontend/src/components/header/HeaderComponent.js index f64ec187..0c7a8080 100644 --- a/frontend/src/components/header/HeaderComponent.js +++ b/frontend/src/components/header/HeaderComponent.js @@ -2,10 +2,10 @@ import React, { useContext } from 'react'; import { string } from 'prop-types'; import { useHistory } from 'react-router-dom'; import { Row } from 'simple-flexbox'; -import { createUseStyles, useTheme } from 'react-jss'; +import { createUseStyles, ThemeProvider, useTheme } from 'react-jss'; import { SidebarContext } from 'hooks/useSidebar'; import SLUGS from 'resources/slugs'; -import { IconBell, IconBrowse, IconLogin, IconSearch } from 'assets/icons'; +import { IconBell, IconUser, IconSearch, IconLogin, IconArrow, IconBurger, IconBrowse } from 'assets/icons'; import DropdownComponent from 'components/dropdown'; import {PrivateSectionContext} from 'hooks/PrivateSectionContext'; @@ -22,38 +22,68 @@ const useStyles = createUseStyles((theme) => ({ } }, container: { - height: 40 + height: 50, + widht:200, + color:theme.uniformStyle.color.highlightingColor, // header title color + + }, name: { ...theme.typography.itemTitle, textAlign: 'right', '@media (max-width: 768px)': { - display: 'none' + display: 'none', + + } }, separator: { borderLeft: `1px solid ${theme.color.lightGrayishBlue2}`, - marginLeft: 32, - marginRight: 32, - height: 32, - width: 2, + marginLeft: 50, + marginRight: 90, + height: 30, + width: 3, '@media (max-width: 768px)': { marginLeft: 14, marginRight: 0 } }, + icontitle: { + ...theme.typography.icontitle, + marginLeft:-60, + '@media (max-width: 1080px)': { + // marginLeft:50 + }, + '@media (max-width: 468px)': { + fontSize: 50, + + } + }, + subtitle: { + ...theme.typography.title, + '@media (max-width: 1080px)': { + marginLeft: 0, + + }, + '@media (max-width: 468px)': { + fontSize: 50, + + } + }, title: { ...theme.typography.title, '@media (max-width: 1080px)': { - marginLeft: 50 + marginLeft: 80, + }, '@media (max-width: 468px)': { - fontSize: 20 + fontSize: 50, + } }, iconStyles: { cursor: 'pointer', - marginLeft: 25, + marginLeft:0, '@media (max-width: 768px)': { marginLeft: 12 } @@ -61,21 +91,27 @@ const useStyles = createUseStyles((theme) => ({ })); /** - * The Header Component is a shared component between all pages. It is capable to display - * a title that changes when the selection in the SidebarComponent changes. + * The Header Component is a shared component between all pages. It displays + * the related header title of the selected section in the SidebarComponent changes. * - * @returns The visualization of exactly that. + * @author Irem Toroslu + * @returns the header title, subtitles related to the selected section in the SidebarComponent. It also displays the user name in the header bar as well. */ function HeaderComponent() { + const { push } = useHistory(); const { currentItem } = useContext(SidebarContext); // get the current Path selected in the Sidebar const [ selectedProducts, setSelectedProducts ] = useContext(PrivateSectionContext); const theme = useTheme(); const classes = useStyles({ theme }); - + let title; let subtitle; + let subsubtitle; + + switch (true) { + case currentItem === SLUGS.dashboard: title = 'My Dashboard'; break; @@ -91,10 +127,12 @@ function HeaderComponent() { case currentItem === SLUGS.industrialApplications: title = 'Industrial Applications'; case currentItem === SLUGS.details: - title = 'Details: ' + (selectedProducts[0].productName === undefined ? 'Please select a model first' : selectedProducts[0].productName); + title='Details ' + subtitle = ' Selected product ' ; + subsubtitle =(selectedProducts[0].productName === undefined ? ' Please select a model first' : " " + selectedProducts[0].productName); break; case currentItem === SLUGS.generation + '/products': - title = 'Products'; + title = 'Product Catagory'; break; case currentItem === SLUGS.generation + '/solutions': title = 'Solutions'; @@ -109,76 +147,30 @@ function HeaderComponent() { title = ''; } + function UseArrow(selected) { + + if (title === 'Details ' && !(selected === undefined)) { + return ; + } + return null; + + } function onSettingsClick() { push(SLUGS.settings); } return ( - - {title} - -
- -
+ + {title}{subtitle}{subsubtitle} + + +
- } - options={[ - { - label: 'Notification #1', - onClick: () => console.log('Notification #1') - }, - { - label: 'Notification #2', - onClick: () => console.log('Notification #2') - }, - { - label: 'Notification #3', - onClick: () => console.log('Notification #3') - }, - { - label: 'Notification #4', - onClick: () => console.log('Notification #4') - } - ]} - position={{ - top: 42, - right: -14 - }} - /> +
-
- User Name - - - - {/* avatar */} - - - - - } - options={[ - { - label: 'Settings', - onClick: onSettingsClick - }, - { - label: 'Logout', - onClick: () => console.log('logout') - } - ]} - position={{ - top: 52, - right: -6 - }} - /> +
user name
+ +
); diff --git a/frontend/src/components/login/Registration.js b/frontend/src/components/login/Registration.js index 451bbffe..b2cf7e52 100644 --- a/frontend/src/components/login/Registration.js +++ b/frontend/src/components/login/Registration.js @@ -1,5 +1,5 @@ /** Setting up registration/signup page - * author : @mani + * @author Mani Anand * */ import React from 'react'; diff --git a/frontend/src/components/productGrid/LabelComponent.js b/frontend/src/components/productGrid/LabelComponent.js new file mode 100644 index 00000000..e837313d --- /dev/null +++ b/frontend/src/components/productGrid/LabelComponent.js @@ -0,0 +1,19 @@ +import React, {useContext} from 'react'; +import theme from 'resources/theme'; + +/** + * Displaying a label. + * + * @author Mani + * @author Martin Wagner + */ + +function LabelComponent({productName}) { + return ( + + {productName} + + ); +} + +export default LabelComponent; diff --git a/frontend/src/components/productGrid/ModelDropdownComponent.js b/frontend/src/components/productGrid/ModelDropdownComponent.js index a2a7636a..6503becf 100644 --- a/frontend/src/components/productGrid/ModelDropdownComponent.js +++ b/frontend/src/components/productGrid/ModelDropdownComponent.js @@ -3,14 +3,17 @@ import React, { useContext, useState } from 'react'; import { IconArrowDown } from 'assets/icons'; import {getModels} from 'interface/simaProInterface' import {PrivateSectionContext} from 'hooks/PrivateSectionContext'; +import { Component } from 'react'; +import {Container, Row, Col } from 'react-grid-system'; +import theme from 'resources/theme'; + -//TODO: When only one model is available, => How to do that then? Should a click on the image link in that case? /** * This component creates the dropdownboxes for the related products * * @returns the model properties of the related product depending on the model values from getModels func from interface/simaProInterface - * @author parham, Martin Wagner, Irem + * @author parham, Martin Wagner, Irem Toroslu, Mani Anand */ const ModelDropdownComponent = (props) => { @@ -22,16 +25,17 @@ const ModelDropdownComponent = (props) => { // set the initial values for the dropdown list derived from getModels const variables = getModels(productID); const [ selected, setSelected ] = useState('Select a model'); - - return ( -
- - + + + + ); - }; + }; + + export default ModelDropdownComponent; diff --git a/frontend/src/components/productGrid/ProductGridComponent.js b/frontend/src/components/productGrid/ProductGridComponent.js index 5dac45c8..72d0a202 100644 --- a/frontend/src/components/productGrid/ProductGridComponent.js +++ b/frontend/src/components/productGrid/ProductGridComponent.js @@ -1,13 +1,3 @@ -/** - * The Componenet creates new cards for the product items using the minicard components form 'components/cards/MiniCardComponent' - * it displays all the related products images attached to each card in a certain category. - * Also stores the product and model properties and pass this values to the detail page once clicking on the image - * /** - * - * @returns the product and model properties - * @author Irem - */ - import React, {useContext} from 'react'; import {Column, Row} from 'simple-flexbox'; import {createUseStyles} from 'react-jss'; @@ -17,54 +7,70 @@ import ProductDropdown from './ModelDropdownComponent' import SLUGS from 'resources/slugs'; import {Link} from 'react-router-dom'; import {PrivateSectionContext} from 'hooks/PrivateSectionContext'; +import { Component } from 'react'; +import LabelComponent from './LabelComponent' +/** + * The Componenet creates new cards for the product items using the minicard components form 'components/cards/MiniCardComponent' + * it displays all the related products images attached to each card in a certain category. + * Also stores the product and model properties and pass this values to the detail page once clicking on the image + * /** + * + * @returns the product and model properties + * @author Irem Toroslu, Martin Wagner, Mani Anand + */ -function ProductGridComponent() { - const [ selectedProducts, setSelectedProducts ] = useContext(PrivateSectionContext); - const NewSelectedProducts = - [{ +function ProductGridComponent() { + const [selectedProducts, setSelectedProducts] = useContext(PrivateSectionContext); + const NewSelectedProducts = [ + { productID: selectedProducts.productID, productName: selectedProducts.productName, modelID: selectedProducts.modelID, modelName: selectedProducts.modelName - }] - + } + ]; const products = getProducts(); const classes = useStyles(); return ( - - {products.map((product, index) => - + {products.map((product, index) => ( + { // Save selection to ContextProvider NewSelectedProducts[0].productID = product.productID; NewSelectedProducts[0].productName = product.productName; }} - to={{ // Link to the next page - pathname: SLUGS.details, - }}> - + - + + - )} + ))} - ); } @@ -72,43 +78,22 @@ function ProductGridComponent() { // Card component style properties const useStyles = createUseStyles({ - cardsContainer: { - marginRight: -30, - marginTop: -30 - }, cardRow: { - marginTop: 30, + marginTop:-50, '@media (max-width: 768px)': { - marginTop: 0 + // marginTop: 30 } }, miniCardContainer: { - flexGrow: 1, - marginRight: 30, + marginRight: 30, + marginLeft:30, + marginTop:30, '@media (max-width: 768px)': { marginTop: 30, maxWidth: 'none', maxHeight:160 } - }, - todayTrends: { - marginTop: 30 - }, - lastRow: { - marginTop: 30 - }, - unresolvedTickets: { - marginRight: 30, - '@media (max-width: 1024px)': { - marginRight: 0 - } - }, - tasks: { - marginTop: 0, - '@media (max-width: 1024px)': { - marginTop: 30 - } } }); -export default ProductGridComponent; +export default ProductGridComponent; \ No newline at end of file diff --git a/frontend/src/components/sidebar/MenuComponent.js b/frontend/src/components/sidebar/MenuComponent.js index c84168bb..e6bb6d08 100644 --- a/frontend/src/components/sidebar/MenuComponent.js +++ b/frontend/src/components/sidebar/MenuComponent.js @@ -6,8 +6,8 @@ const getMenuStyles = ({ theme }) => ({ bmBurgerButton: { position: 'absolute', width: 26, - height: 20, - left: 30, + height: 10, + left: 20, top: 40, zIndex: 19 }, @@ -25,11 +25,11 @@ const getMenuStyles = ({ theme }) => ({ bmMenuWrap: { position: 'fixed', height: '100%', - width: 260, + width: 200, zIndex: 30 }, bmMenu: { - background: '#262625' // left side bar backgroundcolor + background: theme.uniformStyle.color.secondaryBackgroundColor // left side bar backgroundcolor }, bmItem: { outline: 'none', diff --git a/frontend/src/components/sidebar/MenuItemComponent.js b/frontend/src/components/sidebar/MenuItemComponent.js index 50459181..6bc87546 100644 --- a/frontend/src/components/sidebar/MenuItemComponent.js +++ b/frontend/src/components/sidebar/MenuItemComponent.js @@ -11,12 +11,12 @@ const useStyles = createUseStyles({ }, container: { display: 'flex', - height: 56, + height: 40, cursor: 'pointer', '&:hover': { backgroundColor: ({ theme }) => theme.color.paleBlueTransparent }, - paddingLeft: ({ level }) => 32 * level, + paddingLeft: ({ level }) => 16 * level, transition: 'all 0.2s ease-in-out' }, leftBar: { @@ -24,11 +24,12 @@ const useStyles = createUseStyles({ level > 1 ? 'none' : `3px solid ${theme.color.darkGrayishBlue}` }, title: { - fontSize: 15, // left bar titles - lineHeight: '25px', + fontSize: ({ theme }) => theme.typography.icontitle.fontSize , // left bar titles + lineHeight: '20px', letterSpacing: '0.2px', - color: ({ theme, isActive }) =>(isActive ? '#00b300' : '#b5b4b9'), //(isActive ? theme.color.paleBlue : theme.color.grayishBlue), - marginLeft: 20 + color: ({ theme, isActive }) =>(isActive ? theme.uniformStyle.color.highlightingColor : theme.uniformStyle.color.secondaryFontColor), //(isActive ? theme.color.paleBlue : theme.color.grayishBlue), + marginLeft: 10, + fontWeight:'inherit' } }); @@ -48,7 +49,7 @@ function MenuItemComponent({ children, icon: Icon, id, items = [], level = 1, on const classes = useStyles({ theme, level, isActive }); const classNameColumn = isActive ? classes.leftBar : ''; const classNameContainer = [classes.container, isActive && classes.activeContainer].join(' '); - const iconColor = isActive ? '#00b300' : 'white';//theme.color.paleBlue : theme.color.grayishBlue2; + const iconColor = isActive ? theme.uniformStyle.color.highlightingColor : theme.uniformStyle.color.primaryIconColor; function onItemClicked(e) { if (onClick) { diff --git a/frontend/src/components/sidebar/SidebarComponent.js b/frontend/src/components/sidebar/SidebarComponent.js index 54d86b98..cb59b7e5 100644 --- a/frontend/src/components/sidebar/SidebarComponent.js +++ b/frontend/src/components/sidebar/SidebarComponent.js @@ -1,10 +1,3 @@ -/** - * The SidebarComponent consists out of the functionality and the Look and Feel of the Left-Side-Navigationbar - * - * @author Irem - * @author Martin Wagner - */ - import React from 'react'; import { createUseStyles, useTheme } from 'react-jss'; import { useHistory } from 'react-router-dom'; @@ -18,13 +11,20 @@ import { IconArrow, IconTransmission, IconBrowse, - IconBuilding + IconBuilding, + IconCircle } from 'assets/icons'; import { convertSlugToUrl } from 'resources/utilities'; import Menu from './MenuComponent'; import MenuItem from './MenuItemComponent'; import logo from 'assets/logo/LogoCarbonteam.png'; +/** + * The SidebarComponent consists out of the functionality and the Look and Feel of the Left-Side-Navigationbar + * + * @author Irem Toroslu, Martin Wagner + */ + const useStyles = createUseStyles({ separator: { @@ -78,8 +78,8 @@ function SidebarComponent() { return ( -
- +
+
onClick(SLUGS.generation + SLUGS.products)} /> onClick(SLUGS.generation + SLUGS.solutions)} /> onClick(SLUGS.generation + SLUGS.services)} /> @@ -137,21 +137,21 @@ function SidebarComponent() { id={SLUGS.transmission + SLUGS.products} title='Products' level={3} - icon={IconArrow} + icon={IconCircle} onClick={() => onClick(SLUGS.transmission + SLUGS.products)} /> onClick(SLUGS.transmission + SLUGS.solutions)} /> onClick(SLUGS.transmission + SLUGS.services)} /> @@ -167,21 +167,21 @@ function SidebarComponent() { id={SLUGS.industrialApplications + SLUGS.products} title='Products' level={3} - icon={IconArrow} + icon={IconCircle} onClick={() => onClick(SLUGS.industrialApplications + SLUGS.products)} /> onClick(SLUGS.industrialApplications + SLUGS.solutions)} /> onClick(SLUGS.industrialApplications + SLUGS.services)} /> diff --git a/frontend/src/index.css b/frontend/src/index.css index 604c4b1b..91dc9d22 100644 --- a/frontend/src/index.css +++ b/frontend/src/index.css @@ -76,6 +76,7 @@ select { animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; + } } diff --git a/frontend/src/interface/projectInterface.js b/frontend/src/interface/projectInterface.js index dd5f5035..db16ccaa 100644 --- a/frontend/src/interface/projectInterface.js +++ b/frontend/src/interface/projectInterface.js @@ -6,14 +6,15 @@ import logo from 'assets/logo/LogoCarbonteam.png' import logo_1 from 'assets/dummyImages/Image_1.PNG' -import logo_2 from 'assets/dummyImages/Image_2.PNG' +import logo_3 from 'assets/dummyImages/Logo2.png' +import { number } from 'prop-types'; /** * should get all the Products from the backend (soon) //TODO: declare and write. * @returns */ export function getProducts() { - return ([logo,logo_1,logo_2,logo_1,logo_2,logo_1]); + return ([logo_3,logo_1,logo_3,logo_1,logo_3,logo_1]); } /** diff --git a/frontend/src/interface/simaProInterface.js b/frontend/src/interface/simaProInterface.js index 53de2552..7d22e0f8 100644 --- a/frontend/src/interface/simaProInterface.js +++ b/frontend/src/interface/simaProInterface.js @@ -7,7 +7,7 @@ import logo from 'assets/logo/LogoCarbonteam.png' import logo_1 from 'assets/dummyImages/Image_1.PNG' -import logo_2 from 'assets/dummyImages/Image_2.PNG' +import logo_2 from 'assets/dummyImages/Logo2.png' import { categories } from './categories'; /** diff --git a/frontend/src/resources/theme.js b/frontend/src/resources/theme.js index af3b6fe8..63a2e402 100644 --- a/frontend/src/resources/theme.js +++ b/frontend/src/resources/theme.js @@ -1,37 +1,74 @@ /** * The theme provides cross component UI like Colors and Fonts. + * @author Irem Toroslu + * @author Martin Wagner */ const color = { brightBlue: '#3498db', + white:'white', darkGrayishBlue: '#8b8d94', + whitish: '#b5b4b9', + white:'#000000', + darkGray: '#262625', darkRed: '#a90000', grayishBlue: '#A4A6B3', grayishBlue2: '#9fa2b4', grayishBlue3: '#bdc3c7', + limeGreen: '#00b300', + blueGray:'#33b3a6',//687f8c016064018788019799 lightBlue: '#3751FF', lightGrayishBlue: '#F7F8FC', // background color lightGrayishBlue2: '#DFE0EB', paleBlue: '#DDE2FF', + darkBlue:'#008caf', paleBlueTransparent: 'rgba(221, 226, 255, 0.08)', - veryDarkGrayishBlue: '#373a47' + veryDarkGrayishBlue: '#373a47', + lightgreen: '#66a103', + lightblueGray:'#2e9db0', + lightGreenGray:'#9dccca', + GreenGray:'#88b598', + darkGreenGray:'#94b0a5', + darkskyblue:'#01a1c1', + Copper:'#BF6016', + Alminium:'#6093AC', + SiliconSteel:'#0c6c84', + TransformerOil: '#FACA0F', + StainlessSteel:'#caccce', + Pressboard:'#C38888', + Steel:'#8C9BA1', + lightGreenishBlue:' #7dbec7' + + }; const typography = { cardTitle: { fontWeight: 'bold', - fontSize: 19, + fontSize: 15, lineHeight: '24px', letterSpacing: '0.4px' }, - smallSubtitle: { - fontSize: 12, + icontitle: { + fontSize: 16, lineHeight: '16px', letterSpacing: '0.1px' }, + smallSubtitle: { + fontSize: 18, + lineHeight: '16px', + letterSpacing: '0.1px', + fontWeight:'inherit' + }, + secondSmallSubtitle:{ + fontSize: 16, + lineHeight: '16px', + letterSpacing: '0.1px', + fontWeight:'inherit' + }, link: { fontWeight: '600', - fontSize: 14, + fontSize: 15, lineHeight: '20px', letterSpacing: '0.2px', color: color.lightBlue, @@ -44,20 +81,68 @@ const typography = { }, itemTitle: { fontWeight: 600, - fontSize: 14, + fontSize: 15, lineHeight: '20px', letterSpacing: 0.2 }, title: { - fontWeight: 'bold', + fontWeight: 'inherit', fontSize: 24, lineHeight: '30px', letterSpacing: 0.3 + }, + subtitle: { + fontWeight: 'inherit', + fontSize: 20, + lineHeight: '30px', + letterSpacing: 0.3 + }, + textcontent: { + fontWeight: 'inherit', + fontSize: 18, + lineHeight: '16px', + letterSpacing: 0.3 + }, + chartItemstitle: { + fontWeight: 'inherit', + fontSize: 12, + lineHeight: '30px', + letterSpacing: 0.3 + }, + buttontitle: { + fontWeight: 'inherit', + fontSize: 12, + lineHeight: '30px', + letterSpacing: 0.3 + }, + buttonSendtitle: { + fontWeight: 'inherit', + fontSize: 14, + lineHeight: '30px', + letterSpacing: 0.3 } }; +/** + * Defining uniform Colors. + */ +const uniformStyle = { + color: { + primaryFontColor: color.darkGrayishBlue, + primaryIconColor: 'white', + secondaryFontColor: color.whitish, + highlightingColor: color.limeGreen, + primaryBackgroundColor: color.white, + secondaryBackgroundColor: color.darkGray, + barChartColor: color.darkBlue , + tableHeaderColor: color.GreenGray, + sendButtonColor: color.lightGreenishBlue + } +} + export default { // https://www.colorhexa.com/A4A6B3 color, - typography + typography, + uniformStyle }; diff --git a/frontend/src/routes/PrivateRoutes.js b/frontend/src/routes/PrivateRoutes.js index ebb43f0d..3001ee9b 100644 --- a/frontend/src/routes/PrivateRoutes.js +++ b/frontend/src/routes/PrivateRoutes.js @@ -4,7 +4,7 @@ * on the right handside canvas. * * @author Martin Wagner - * @author Irem + * @author Irem Toroslu */ import React, { Suspense, lazy } from 'react'; @@ -12,32 +12,67 @@ import { Redirect, Route, Switch } from 'react-router-dom'; import SLUGS from 'resources/slugs'; import LoadingComponent from 'components/loading'; import DetailsComponent from 'components/details/DetailsComponent'; +import { useTheme, createUseStyles } from 'react-jss'; const ProductSolutionsServices = lazy(() => import('./dynamicPaths/ProductSolutionsServicesComponent') ); // importing required components const DashboardComponent = lazy(() => import('../components/dashboard')); +const useStyles = createUseStyles((theme) => ({ + container: { + display: 'flex' + }, + textcontent: { + ...theme.typography.textcontent, + textAlign: 'left', + '@media (max-width: 768px)': { + display: 'none', + } + }, + subtitle: { + ...theme.typography.title, + marginLeft:15, + '@media (max-width: 1080px)': { + marginLeft: -50, + }, + '@media (max-width: 468px)': { + fontSize: 50, + } + }, + title: { + ...theme.typography.title, + marginLeft:15, + '@media (max-width: 1080px)': { + marginLeft: 80, + }, + '@media (max-width: 468px)': { + fontSize: 50, + } + } + })); /** * Defining new Routes using private routes function * linking Components to the selected Menuitem in the "Sidebar component" */ function PrivateRoutes() { + const theme = useTheme(); + const classes = useStyles({ theme }); return ( }> -
categories
} /> +
categories
} />
Short info about Generation category
} + render={() =>
Short info about Generation category
} />
Short info about Transmission category
} + render={() =>
Short info about Transmission category
} />
Short info about Industrial Applications
} + render={() =>
Short info about Industrial Applications
} /> } + render={() => } /> -
settings
} /> +
settings
} />
diff --git a/frontend/src/routes/PrivateSection.js b/frontend/src/routes/PrivateSection.js index 65804710..75dd88f3 100644 --- a/frontend/src/routes/PrivateSection.js +++ b/frontend/src/routes/PrivateSection.js @@ -17,14 +17,15 @@ const useStyles = createUseStyles({ minHeight: 850 }, mainBlock: { - marginLeft: 255, - padding: 30, + marginLeft: 200, + // paddingLeft: 30, '@media (max-width: 1080px)': { marginLeft: 0 } }, contentBlock: { - marginTop: 54 + marginTop: 54, + marginLeft:0 } }); diff --git a/frontend/src/routes/dynamicPaths/ProductSolutionsServicesComponent.js b/frontend/src/routes/dynamicPaths/ProductSolutionsServicesComponent.js index 50f16ca0..069e4512 100644 --- a/frontend/src/routes/dynamicPaths/ProductSolutionsServicesComponent.js +++ b/frontend/src/routes/dynamicPaths/ProductSolutionsServicesComponent.js @@ -1,7 +1,39 @@ import React from 'react'; import { useParams } from 'react-router-dom'; +import { Column, Row } from 'simple-flexbox'; import ProductGridComponent from 'components/productGrid'; +import { useTheme, createUseStyles } from 'react-jss'; +const useStyles = createUseStyles((theme) => ({ + container: { + display: 'flex' + }, + textcontent: { + ...theme.typography.textcontent, + textAlign: 'left', + '@media (max-width: 768px)': { + display: 'none', + } + }, + subtitle: { + ...theme.typography.title, + '@media (max-width: 1080px)': { + marginLeft: -50, + }, + '@media (max-width: 468px)': { + fontSize: 50, + } + }, + title: { + ...theme.typography.title, + '@media (max-width: 1080px)': { + marginLeft: 80, + }, + '@media (max-width: 468px)': { + fontSize: 50, + } + } +})); /** * This component differenciates between the three different possible subcategories. @@ -11,16 +43,20 @@ import ProductGridComponent from 'components/productGrid'; */ export default function ProductSolutionsServicesComponent() { const { type } = useParams(); + const theme = useTheme(); + const classes = useStyles({ theme }); return ( - <> -

At this location the component which shows all the products / models will be implemented

- {type === 'products' &&
This is where all the products of the selected category could be shown.
} - {type === 'solutions' &&
This is where all the solutions of the selected category could be shown.
} - {type === 'services' &&
This is where all the services of the selected category could be shown.
} + + - + + {/* {type === 'products' &&
All the products
This is where all the products of the selected category could be shown.
} + {type === 'solutions' &&
This is where all the solutions of the selected category could be shown.
} + {type === 'services' &&
This is where all the services of the selected category could be shown.
} */} +
+
- +
); -} \ No newline at end of file +} diff --git a/frontend/src/routes/scenarios/productGrid/Productdropdown.js b/frontend/src/routes/scenarios/productGrid/Productdropdown.js new file mode 100644 index 00000000..7e0370e5 --- /dev/null +++ b/frontend/src/routes/scenarios/productGrid/Productdropdown.js @@ -0,0 +1,59 @@ + +import React, { useContext, useState } from 'react'; +import { IconArrowDown } from 'assets/icons'; +import {getModels, getProducts} from 'interface/simaProInterface' +import {PrivateSectionContext} from 'resources/PrivateSectionContext'; +import iconBellNew from 'assets/icons/icon-bell-new'; + + +/** + * This component creates the dropdownboxes for the related products + * + * @returns the model properties of the related product depending on the model values from getModels func from interface/simaProInterface + * @author parham, Martin Wagner, Irem Toroslu + */ + +const SelectModelVariable = (props) => { + const productID = props.productID; + const productName = props.productName; + + + const [ selectedProducts, setSelectedProducts ] = useContext(PrivateSectionContext); + // set the initial values for the dropdown list derived from getModels + const variables = getModels(productID); + const [ selected, setSelected ] = useState('Select a model'); + + return ( + + ); + }; + +export default SelectModelVariable;