-
Notifications
You must be signed in to change notification settings - Fork 2
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
Implementation of #18 #42
Conversation
deleting css file making pie chart diagram compatible for small screen sizes
handling the compare button
converting DetailComponent to a class component storing an compare state passing compare state to canvas dividing canvas to two canvases if the state is true
rendering the second drop down inside Selectvariable component
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be very nice if you could uniform the names of your components. Since you will only implement one Component in one file, the filename and the component name should be the same to avoid confusion.
Why do you have .jsx and .js files? @gandompm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than the few comments I left, it looks good 😄
onSecondDropDownSelectedHandler = (name) => { | ||
const secondVariable = name; | ||
this.setState({ secondVariable }); | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this for? If It belongs to the compared model, then we should better differentiate between the two variables. Maybe Divide the area where the variables can be selected also into two columns?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know what you are saying and it is true. that way looks better.
but where should we put the commit button?
but please don't hesitate to change the UI later. I will also change the UI of your components.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but where should we put the commit button?
mhmm that's a good question. I will think about it, maybe we could put it in the middle? between the variables?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It wouldn't look good that way, I think
return ( | ||
<div> | ||
Pick your desire variable: | ||
<div className='w3-dropdown-hover w3-margin-left w3-margin-right w3-margin-top'> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ScoutAtlas and I were wondering what these classNames do, can you please explain? ._.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, do you remember that I said I use a CSS framework called "W3.css".
the attributions of the CSS frameworks should be defined there.
for example, here it means that this is a type of drop-down class and the other 3 defines obviously the margin.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you for clarifying
I also found some bugs when trying to resize the screen, one pie chart covers the other one. Maybe the Chart needs to be wrapped to prevent that 🤔 |
you are right. I also found it confusing. I will refactor them soon. |
I only create .jsx files since it also allows React to show more useful error and warning messages. |
Ja, I have also noticed. but It is now better than the previous release. should fix it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for refactoring! 😃
state = { | ||
compareCanvas: false | ||
}; | ||
render() { | ||
/* | ||
we should later on find a way to make this line also compatible with class component | ||
*/ | ||
//const [selectedProducts, setSelectedProducts] = useContext(PrivateSectionContext); | ||
|
||
/* | ||
the default canvas has to be divided into two canvases | ||
an extra drom down button for second variable should be rendered | ||
the compare button should be disabled | ||
*/ | ||
let handleCompareButton = () => { | ||
const compareCanvas = true; | ||
/* | ||
now all components such as | ||
canvas component should be notified | ||
by setting the compareCanvas state to true | ||
*/ | ||
this.setState({ compareCanvas }); | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you could do this also by using a context Provider in the function, then you wouldn't have to declare all these functions. 🤔
If you use "should" in a documentation comment somewhere, since you mean it is not yet there, you could add a "TODO:" beforehand so that we can easily find all areas that "should" still be worked on further somewhere in the near future😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you are right about the "TODO:". thanks for the hint.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
by "all functions", you mean "setState()" ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes! exactly :)
So ... does that mean we should only use .jsx files? Because for some reason they don't work that good in Visual Studio Code for me. For some reason I can Ctrl + Click on any component that is in a .js file, to easily navigate, but it doesn't work for me with .jsx files. Do you have any Extensions installed to better work with .jsx files? |
When accessing the DetailsPage I still get this: |
Passing the selected product (and Model) to the DetailsComponent through props.
Distributing the new UI to frontend-dev-#18 Co-authored-by: Irem Toroslu <irem.toroslu@fau.de> Co-authored-by: Mani Anand <mani.anand@fau.de>
panel and chart components reconfigured
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good. Some small suggested code tweaks are appended.
minWidth:210, // resizing the card min width | ||
maxHeight:150, | ||
// marginTop:50, | ||
// padding: '8px 16px 8px 16px', | ||
'&:hover': { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might be the hover we have been looking for @IremToroslu !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could be :) let's try that out !
Co-authored-by: Martin Wagner <martin.wagner@fau.de>
Co-authored-by: Martin Wagner <martin.wagner@fau.de>
Co-authored-by: Martin Wagner <martin.wagner@fau.de>
Authors updated and cleaning up the code
since I do not have so much experience in this field, I can't tell you a reason that we should use 100% .jsx instead of .js. |
if we need to compare two variables
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:)
Co-authored-by: Irem Toroslu <irem.toroslu@fau.de>
#18