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

Implementation of #18 #42

Merged
merged 27 commits into from
May 18, 2021
Merged

Implementation of #18 #42

merged 27 commits into from
May 18, 2021

Conversation

Waldleufer
Copy link
Collaborator

#18

gandompm added 7 commits May 13, 2021 11:36
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
Copy link
Collaborator Author

@Waldleufer Waldleufer left a 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.

@Waldleufer
Copy link
Collaborator Author

Why do you have .jsx and .js files? @gandompm

Copy link
Collaborator Author

@Waldleufer Waldleufer left a 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 😄

frontend/src/components/details/CanvasComponent.jsx Outdated Show resolved Hide resolved
Comment on lines +36 to +39
onSecondDropDownSelectedHandler = (name) => {
const secondVariable = name;
this.setState({ secondVariable });
};
Copy link
Collaborator Author

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?

Copy link
Collaborator

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.

Copy link
Collaborator Author

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?

Copy link
Collaborator

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'>
Copy link
Collaborator Author

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? ._.

Copy link
Collaborator

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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you for clarifying ☺️

frontend/src/components/details/PieChartComponent.jsx Outdated Show resolved Hide resolved
@Waldleufer
Copy link
Collaborator Author

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 🤔

@gandompm
Copy link
Collaborator

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.

you are right. I also found it confusing. I will refactor them soon.

@gandompm
Copy link
Collaborator

Why do you have .jsx and .js files? @gandompm

I only create .jsx files since it also allows React to show more useful error and warning messages.
those files are created by @ScoutAtlas

@gandompm
Copy link
Collaborator

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 🤔

Ja, I have also noticed. but It is now better than the previous release. should fix it.

Copy link
Collaborator Author

@Waldleufer Waldleufer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for refactoring! 😃

Comment on lines 15 to 37
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 });
};
Copy link
Collaborator Author

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😉

Copy link
Collaborator

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.

Copy link
Collaborator

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()" ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes! exactly :)

frontend/src/components/details/DetailsComponent.js Outdated Show resolved Hide resolved
@Waldleufer
Copy link
Collaborator Author

Why do you have .jsx and .js files? @gandompm

I only create .jsx files since it also allows React to show more useful error and warning messages.
those files are created by @ScoutAtlas

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?

@Waldleufer Waldleufer mentioned this pull request May 14, 2021
5 tasks
@Waldleufer
Copy link
Collaborator Author

When accessing the DetailsPage I still get this:
image
🤔 @gandompm do you have an Idea where maybe two components use the same key?

Waldleufer and others added 8 commits May 16, 2021 09:43
Passing the selected product (and Model) to the DetailsComponent through
props.
Collapsing empty tags


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
Copy link
Collaborator Author

@Waldleufer Waldleufer left a 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': {
Copy link
Collaborator Author

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 !

Copy link
Collaborator

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 !

frontend/src/components/productGrid/LabelComponent.js Outdated Show resolved Hide resolved
frontend/src/routes/PrivateRoutes.js Outdated Show resolved Hide resolved
Co-authored-by: Martin Wagner <martin.wagner@fau.de>
IremToroslu and others added 3 commits May 18, 2021 14:00
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
@gandompm
Copy link
Collaborator

Why do you have .jsx and .js files? @gandompm

I only create .jsx files since it also allows React to show more useful error and warning messages.
those files are created by @ScoutAtlas

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?

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.
but ja for that reason that I mentioned, I would prefer to use .jsx. however, I don't see any problem if we use .jsx and .js in the project.
I don't have any clue about the problem. another extension that I have installed is "Simple React Snippets" by Burke Holland, which has nothing to do with that issue.

Copy link
Collaborator Author

@Waldleufer Waldleufer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:)

Waldleufer and others added 2 commits May 18, 2021 21:21
Co-authored-by: Irem Toroslu <irem.toroslu@fau.de>
@Waldleufer Waldleufer marked this pull request as ready for review May 18, 2021 19:35
@Waldleufer Waldleufer changed the base branch from backend-dev to frontend-dev May 18, 2021 19:35
@Waldleufer Waldleufer merged commit 1404383 into frontend-dev May 18, 2021
@Waldleufer Waldleufer deleted the frontend-dev-#18 branch May 18, 2021 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants