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

CHG Frontend Cleanup #319

Closed
synoet opened this issue Dec 13, 2021 · 6 comments
Closed

CHG Frontend Cleanup #319

synoet opened this issue Dec 13, 2021 · 6 comments
Assignees
Labels

Comments

@synoet
Copy link
Collaborator

synoet commented Dec 13, 2021

The new web needs a nice scrubbing. lots of good stuff in there, but also some stuff that is outdated and some that should not be there.

@synoet synoet self-assigned this Dec 13, 2021
@PIG208
Copy link
Contributor

PIG208 commented Dec 13, 2021

There is also a bunch of console.log hanging around there:

pig208@PIG:~/Anubis$ git grep -n console.log
old-web/src/Components/Admin/Assignment/LateExceptionAddCard.jsx:51:    console.log(date);
old-web/src/Components/Admin/IDE/ManagementIDEDialog.jsx:132:  console.log(images);
old-web/src/Components/Public/Blog/BlogPost.jsx:102:          .catch(((error) => console.log('FETCH/ERROR', error)));
old-web/src/Components/Public/Blog/BlogPost.jsx:104:      .catch((error) => console.log('IMPORT/ERROR', error));
old-web/src/Components/Public/IDE/IDEDialog.jsx:137:  console.log('STOP');
old-web/src/Components/Public/Questions/QuestionsCard.jsx:87:  console.log(responses);
old-web/src/index.js:14:// to log results (for example: reportWebVitals(console.log))
theia/proxy/index.js:68:        console.log(`cluster_ip ${row?.cluster_address}`)
theia/proxy/index.js:70:          console.log(`caching cluster ip ${row.cluster_address}`)
theia/proxy/index.js:86:    console.log(req.method, (new Date()).toISOString(), url.pathname, url.query);
theia/proxy/index.js:227:console.log("starting at 0.0.0.0:5000");
theia/proxy/index.js:228:console.log(`SECRET_KEY = ${SECRET_KEY}`);
web/src/Components/Admin/Assignment/LateExceptionAddCard.jsx:51:    console.log(date);
web/src/Components/Public/Blog/BlogPost.jsx:102:          .catch(((error) => console.log('FETCH/ERROR', error)));
web/src/Components/Public/Blog/BlogPost.jsx:104:      .catch((error) => console.log('IMPORT/ERROR', error));
web/src/Components/Public/IDE/IDEDialog.jsx:137:  console.log('STOP');
web/src/Components/Public/Questions/QuestionsCard.jsx:87:  console.log(responses);
web/src/Pages/Public/Assignment/Assignment.jsx:55:      console.log(error);
web/src/Pages/Public/Assignment/Assignment.jsx:65:    }).catch((error) => console.log(error));
web/src/Pages/Public/Course/Course.jsx:31:      console.log(data?.course);
web/src/Pages/Public/Courses/Courses.jsx:46:      console.log(data.courses);
web/src/Pages/Public/Courses/Courses.jsx:60:  console.log(courses);
web/src/Pages/Public/Submission/Submission.jsx:107:  console.log(submission);
web/src/index.js:14:// to log results (for example: reportWebVitals(console.log))

@wabscale
Copy link
Collaborator

Yeah those log statements have been in the frontend from the beginning. Maybe we should use some wrapper or something that will only actually print stuff if it is running in the react-scripts server. Alternatively, do either of you have any libraries or anything that does this already?

@PIG208
Copy link
Contributor

PIG208 commented Dec 14, 2021

Adding a wrapper to check process.env.NODE_ENV === "production" should be enough. We can have a hook for this custom logger, but maybe not all those log messages should be kept.

@wabscale wabscale mentioned this issue Dec 16, 2021
36 tasks
@wabscale
Copy link
Collaborator

ab84111

@PIG208
Copy link
Contributor

PIG208 commented Dec 31, 2021

There are some leftovers in the following files:

old-web/src/Components/Public/Blog/BlogPost.jsx
web/src/Components/Public/Blog/BlogPost.jsx
web/src/Components/Public/IDE/IDEDialog.jsx

@wabscale
Copy link
Collaborator

The blog post ones are not debug lines and should stay. The web/src/Components/Public/IDE/IDEDialog.jsx I did miss.

@synoet synoet closed this as completed Mar 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants