Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updating release branch with sprint 10 changes #133

Merged
merged 45 commits into from
Jun 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
3886ab1
Merge pull request #120 from amosproj/main
gandompm Jun 16, 2021
efc416e
Configured button on the details page back to product
manifau Jun 17, 2021
ea57814
Restructured the back button
IremToroslu Jun 17, 2021
e15e704
documentation of the reconfiguration of goback
IremToroslu Jun 17, 2021
d355315
reconfiguration of the back button
IremToroslu Jun 17, 2021
80a95e1
Adding co-author & checking git push notification
manifau Jun 17, 2021
0f067e6
Merge branch 'dev-#100' of https://github.com/amosproj/amos-ss2021-ca…
manifau Jun 17, 2021
34fad88
fixed the navbar componant
IremToroslu Jun 18, 2021
a682606
navbar on the baseline senario fixed
IremToroslu Jun 18, 2021
42a04dd
navbar size and icon sizes fixed
IremToroslu Jun 18, 2021
5ea9bb9
reconfiguration of navbar and close icons
IremToroslu Jun 18, 2021
0d38331
Added functionality to close buttons
ScoutAtlas Jun 18, 2021
a31d6aa
reconfiguration of navbar and icons
IremToroslu Jun 18, 2021
796be1e
Added comments to DetailsComponent
ScoutAtlas Jun 18, 2021
143c7cd
fixed borderless Navbarstyling
Waldleufer Jun 18, 2021
341a0a5
Fixing a typo
Waldleufer Jun 18, 2021
954dfbf
Changing Backgroundcolor of navbar
Waldleufer Jun 18, 2021
7348cd2
Doing the ScenarioComponent styling properly
Waldleufer Jun 18, 2021
e4a429c
Removing unnecessary "Pdf"
Waldleufer Jun 18, 2021
a0deead
navbar button icons reconfigured
IremToroslu Jun 18, 2021
610c0f7
Added a missing className
Waldleufer Jun 18, 2021
d204d53
Removed unused Divider
Waldleufer Jun 18, 2021
523d079
Renaming key prop of TableComponent
Waldleufer Jun 18, 2021
af11809
Updated propType of icon in MenuItemComponent
Waldleufer Jun 18, 2021
98af3d2
Adding PropTypes to important components
Waldleufer Jun 18, 2021
4f9fa6c
Configuring the category page
manifau Jun 18, 2021
9a8fce3
Adding propTypes to all Components with props
Waldleufer Jun 18, 2021
68116d1
Making changes on the reviewed code
manifau Jun 18, 2021
43c4084
Catagory photos animation changed
IremToroslu Jun 21, 2021
36a51dd
details page navbar buttons reconfigured
IremToroslu Jun 21, 2021
2ef2e8a
cancel/close button reconfigured on details page
IremToroslu Jun 21, 2021
74dba56
Tweaked NavBar Styling
Waldleufer Jun 22, 2021
c33bc9e
Adding Hover Colors to Navbar Buttons
Waldleufer Jun 22, 2021
1aba6fc
Merge pull request #124 from amosproj/dev-#100
Waldleufer Jun 22, 2021
602625e
Merge branch 'dev' into dev-#101
Waldleufer Jun 22, 2021
7926a1e
Merge pull request #123 from amosproj/dev-#101
Waldleufer Jun 22, 2021
c93821c
Configured the recover password page
manifau Jun 22, 2021
4f6359f
Changes made on the naming convention of the func
manifau Jun 22, 2021
1467987
Updating filename
manifau Jun 22, 2021
13aaf84
Renaming the file
manifau Jun 22, 2021
044a6ee
Icons and Texts in Buttons -> row
Waldleufer Jun 22, 2021
0d3be12
Merge pull request #130 from amosproj/dev-#101
Waldleufer Jun 22, 2021
c2e4991
Merge pull request #129 from amosproj/dev-#11
Waldleufer Jun 23, 2021
69d1240
Merge pull request #132 from amosproj/dev
gandompm Jun 23, 2021
172680f
Weekly deliverables
MichaelScheiderer Jun 23, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
Binary file added deliverables/2021-06-23 Kanban Board.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 6 additions & 1 deletion frontend/src/components/cards/MiniCardComponent.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import PropTypes from 'prop-types';
import React from 'react';
import { Col, Container, Row } from 'react-grid-system';

Expand All @@ -7,7 +8,7 @@ import { Col, Container, Row } from 'react-grid-system';
* @param {*} props: The classname and the path that should be used.
* @returns
*/
function MiniCardComponent({ title, path }) {
function MiniCardComponent({ path }) {
return (
<Container fluid className='MiniCardImageContainer'>
<Col justify='center'>
Expand All @@ -23,4 +24,8 @@ function MiniCardComponent({ title, path }) {
);
}

MiniCardComponent.propTypes = {
path: PropTypes.string
};

export default MiniCardComponent;
110 changes: 81 additions & 29 deletions frontend/src/components/details/DetailsComponent.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import PropTypes from 'prop-types';
import React, { Component } from 'react';
import ScenarioComponent from './ScenarioComponent';
import { jsPDF } from 'jspdf';
Expand All @@ -11,31 +12,56 @@ import './navbar.css';
* canvas page and variable drop down list
*
* @param props the recently selected model of a product.
* @author Parham Gandomkar, Martin Wagner, Irem Toroslu, Julian Oelhaf
*/
class DetailsComponent extends Component {
/* State consists of three variable one for each of the possible state
* baselineScenario: only display the baseline scenario
* modifiedScenario: only display the modified scenario
* state at the beginng: only baseline scenario
*/
state = {
baselineScenario: true,
modifiedScenario: false,
loadComparePage: false
};

render() {
/*
the default canvas has to be divided into two canvases
an extra drop down button for second variable should be rendered
the compare button should be disabled
* compare buttons exist only when a single scenario is displayed
* clicking the button should switch state to the show compare page state
*/
let handleCompareButton = () => {
const baselineScenario = false;
const modifiedScenario = false;
const loadComparePage = true;
/*
now all components such as
canvas component should be notified
by setting the compareCanvas state to true
*/
this.setState({ loadComparePage });
this.setState({ baselineScenario, modifiedScenario, loadComparePage });
};
/*
* in the compare page each scenario has a close button
* that button should close that scenario and only display the other one
* so the close button of the modified scenario will hide the modified scenario and only display the baseline scenario
*/
let handleCloseModifiedButton = () => {
const baselineScenario = true;
const modifiedScenario = false;
const loadComparePage = false;
this.setState({ baselineScenario, modifiedScenario, loadComparePage });
};

/*
* in the compare page each scenario has a close button
* that button should close that scenario and only display the other one
* so the close button of the baselin scenario will hide the baselin scenario and only display the modified scenario
*/
let handleCloseBaselineButton = () => {
const baselineScenario = false;
const modifiedScenario = true;
const loadComparePage = false;
this.setState({ baselineScenario, modifiedScenario, loadComparePage });
};

let handleExportPdfButton = () => {
// geting the element that should be exported
// getting the element that should be exported
var div = document.getElementById('capture');

// converting html to an image and then exporting it by pdf
Expand Down Expand Up @@ -63,52 +89,67 @@ class DetailsComponent extends Component {
};
const { selectedProduct } = this.props;

// The styling of the Container, Row and Col can not be moved to css, as the css has a lower priority than the react-grid-system default.
const noPaddingStyle = {
padding: 0,
margin: 0
};

// postCalculationRequest(selectedProduct.productID);

if (!this.state.loadComparePage) {
if (this.state.baselineScenario) {
// if state equals baseline scenario only
return (
<Container id='capture' fluid style={noPaddingStyle}>
<Row style={noPaddingStyle}>
<Col style={noPaddingStyle}>
<Container className='ScenarioContainer' id='capture' fluid>
<Row>
<Col>
<ScenarioComponent
loadComparePage={this.state.loadComparePage}
onCompareClick={handleCompareButton}
onExportClicked={handleExportPdfButton}
onExportClick={handleExportPdfButton}
scenarioName={scenarioNames.baseline}
selectedProduct={selectedProduct}
/>
</Col>
</Row>
</Container>
);
} else {
} else if (this.state.modifiedScenario) {
// if state equals modified scenario only
return (
<Container id='capture' fluid={true} style={noPaddingStyle}>
<Row gutterWidth={0} style={noPaddingStyle}>
<Col xs={6} sm={6} md={6} lg={6} style={{ paddingRight: 3 }}>
<Container className='ScenarioContainer' id='capture' fluid>
<Row>
<Col>
<ScenarioComponent
loadComparePage={this.state.loadComparePage}
onCompareClick={handleCompareButton}
onExportClick={handleExportPdfButton}
scenarioName={scenarioNames.modified}
selectedProduct={selectedProduct}
/>
</Col>
</Row>
</Container>
);
} else if (this.state.loadComparePage) {
// if state equals compare scenario
return (
<Container className='ScenarioContainer' id='capture' fluid>
<Row gutterWidth={0}>
<Col className='CompareColLeft' xs={6} sm={6} md={6} lg={6}>
<ScenarioComponent
loadComparePage={this.state.loadComparePage}
onCompareClick={handleCompareButton}
onExportClick={handleExportPdfButton}
onCloseClick={handleCloseBaselineButton}
scenarioName={scenarioNames.baseline}
selectedProduct={selectedProduct}
onExportClicked={handleExportPdfButton}
/>
</Col>

{/* Spacing between the two columns is specified by paddingLeft */}
<Col xs={6} sm={6} md={6} lg={6} style={{ paddingLeft: 3 }}>
<Col className='CompareColRight' xs={6} sm={6} md={6} lg={6}>
<ScenarioComponent
loadComparePage={this.state.loadComparePage}
onCompareClick={handleCompareButton}
onExportClick={handleExportPdfButton}
onCloseClick={handleCloseModifiedButton}
scenarioName={scenarioNames.modified}
selectedProduct={selectedProduct}
onExportClicked={handleExportPdfButton}
/>
</Col>
</Row>
Expand All @@ -118,4 +159,15 @@ class DetailsComponent extends Component {
}
}

DetailsComponent.propTypes = {
selectedProduct: PropTypes.shape({
categories: PropTypes.array, // [(categories.generation, categories.transmission)],
modelID: PropTypes.string, // 'none',
modelName: PropTypes.string, // 'please select a Product',
productID: PropTypes.string, // 'dummydum-13b0-4e09-9fb4-50398483ecfd'
productImage: PropTypes.string, //ImagePath?
productName: PropTypes.string //'please select a Product'
})
};

export default DetailsComponent;
10 changes: 9 additions & 1 deletion frontend/src/components/details/MobileTableComponent.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
getImpactCategoriesTableHeaders,
getImpactCategoriesTableData
} from 'interface/projectInterface';
import PropTypes from 'prop-types';

/**
* Mobile version of the TableComponent. Restructures the Table to be displayable on a mobile screen.
Expand All @@ -15,7 +16,7 @@ class MobileTableComponent extends Component {
rows: getImpactCategoriesTableData(this.props.modelId)
};
render() {
const idKey = this.props.key;
const idKey = this.props.tableKey;
return (
<Container fluid={true}>
{/* dynamic display of product and model */}
Expand Down Expand Up @@ -92,4 +93,11 @@ class MobileTableComponent extends Component {
}
}

MobileTableComponent.propTypes = {
modelId: PropTypes.string.isRequired,
productName: PropTypes.string.isRequired,
modelName: PropTypes.string.isRequired,
tableKey: PropTypes.string.isRequired
};

export default MobileTableComponent;
66 changes: 44 additions & 22 deletions frontend/src/components/details/NavbarComponent.js
Original file line number Diff line number Diff line change
@@ -1,51 +1,73 @@
import PropTypes from 'prop-types';
import React from 'react';
import slugs from 'resources/slugs';
import { Link } from 'react-router-dom';
import { useHistory } from 'react-router-dom';

/**
* a divider Pannel for seperating search compoents and result components
* and also providing the comparison feature by compare button
*
* @author Parham Gandomkar, Irem Toroslu, Julian Oelhaf
* @author Parham Gandomkar, Irem Toroslu, Julian Oelhaf, Mani Anand
*/

const NavbarComponent = (props) => {
const history = useHistory();
if (!props.loadComparePage) {
return (
<div className='navbar w3-row' vertical='center' horizontal='space-between'>
<Link to={{ pathname: slugs.categories }}>
<btn className='w3-col l1 m1 s1 w3-center'>
<div className='navbar' vertical='center' horizontal='space-between'>
{/* used the history.goback() function to go one step backward where it stores the previous steps including the prevs stage of clicking items on the sidebar */}

<div className='BackButton'>
<Link onClick={() => history.goBack()}>
<i class='fa fa-chevron-left' aria-hidden='true' />
</btn>
</Link>
<b className='w3-col l6 m6 s4'>{props.scenarioName}</b>
</Link>
</div>
<div className='NavbarTitle'>
<b>{props.scenarioName}</b>
</div>

<Link to={{ pathname: slugs.details }} onClick={props.onExportClicked}>
<pdfbtn className='w3-col l3 m3 s4'>
<i className='fa fa-file-pdf-o w3-margin-right' aria-hidden='true'></i>
Export Pdf
</pdfbtn>
<Link to={{ pathname: slugs.details }} onClick={props.onExportClick}>
<div className='Pdfbtn'>
<i className='fa fa-file-pdf-o ' aria-hidden='true' />
Export
</div>
</Link>
<Link to={{ pathname: slugs.details }} onClick={props.onCompareClick}>
<addbtn className='w3-col l2 m2 s2 w3-right'>
<div className='Addbtn'>
<i className='fa fa-fw fa-plus-circle' /> Add
</addbtn>
</div>
</Link>
</div>
);
} else {
return (
<div className='navbar w3-row' vertical='center' horizontal='space-between'>
<b className='w3-col l7 m7 s6'>{props.scenarioName}</b>
<Link to={{ pathname: slugs.details }} onClick={props.onExportClicked}>
<pdfbtn className='w3-col l5 m5 s6 w3-right'>
<i className='fa fa-file-pdf-o w3-margin-right' aria-hidden='true'></i>
Export Pdf
</pdfbtn>
<div className='navbar'>
<div className='NavbarTitle'>
<b>{props.scenarioName}</b>
</div>
<Link to={{ pathname: slugs.details }} onClick={props.onExportClick}>
<div className='Pdfbtn'>
<i className='fa fa-file-pdf-o ' aria-hidden='true'></i>
Export
</div>
</Link>

<Link to={{ pathname: slugs.details }} onClick={props.onCloseClick}>
<div className='Closebtn '>
<i className='fa fa-times-circle-o' aria-hidden='true'></i>
</div>
</Link>
</div>
);
}
};

NavbarComponent.propTypes = {
loadComparePage: PropTypes.bool.isRequired,
onCloseClick: PropTypes.func,
onCompareClick: PropTypes.func,
onExportClick: PropTypes.func.isRequired,
scenarioName: PropTypes.string.isRequired
};

export default NavbarComponent;
7 changes: 7 additions & 0 deletions frontend/src/components/details/PanelComponent.jsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import PropTypes from 'prop-types';
import React from 'react';
import slugs from 'resources/slugs';

Expand Down Expand Up @@ -26,4 +27,10 @@ const PanelComponent = (props) => {
);
};

PanelComponent.propTypes = {
onCompareClick: PropTypes.func,
onExportClicked: PropTypes.func,
scenarioName: PropTypes.string
};

export default PanelComponent;
Loading