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

Integrate GET Questions in Frontend #882

Conversation

TejasNasre
Copy link
Contributor

Closes: #784

Brief description of what is fixed or changed

We have get all questions in the the backend and also the questions has the upvote and downvote so i integrated in the frontend and added the UI for the question cards.

Types of changes

  • As soon as someone visits on Q&A page, there should be the GET Questions call.
  • The upvote functionality is integrated in frontend and downvote Also.

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes does not break the current system and it passes all the current test cases.

Screenshots

2024-05-15.13-13-58.1.mp4

questioncard

Other Information

Please clear the test questions from mongodb database.

Copy link

welcome bot commented May 15, 2024

Thank you and congrats🎉 for opening this pull request!💖

Please make sure you have followed our Contributing Guidelines.🙌 We will test out your code and reply in a bit with some pointers and requests.💿 There may be some errors, but don't worry! We'll work through them with you! 👍🎉😄 If you haven't filled the template out, Please do so!🚀
Feel free to join our Slack Community.💖 We have different channels for active discussions.✨ Hope you have a great time there!😄

Copy link
Member

@Kajol-Kumari Kajol-Kumari left a comment

Choose a reason for hiding this comment

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

Please make the following changes -

  1. Add loader while the api call is happening, you can check other sections for reference
  2. Show the toast message of success/failure of the api call

@TejasNasre
Copy link
Contributor Author

Yeah I added the loader in the question section by doing conditional rendering but its not showing and the toast message will get on upvote or when the user gets on the q&a page please specify.

@Kajol-Kumari
Copy link
Member

@TejasNasre

For pt #1 please see the attached screenshot, i am not seeing the loader when get questions api call is happening.
For pt #2 We should see toast for all the api calls, getQuestions, upvotes and downvotes as well, so that user remains informed of anything wrong happening during the api call

Screen.Recording.2024-05-15.at.3.45.29.PM.mov

@TejasNasre
Copy link
Contributor Author

Fix : Integrate-GET-Questions-in-Frontend

Type Of Changes

  • loader when get questions api call is happening
  • toast for all the api calls, getQuestions, upvotes and downvotes as well
  • upvote and downvote both working

Screen Video

2024-05-15.20-02-54.mp4


useEffect(() => {
getQues();
setToastMessage("Fetching Questions...");
Copy link
Member

Choose a reason for hiding this comment

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

we shouldn't be showing this toast message while fetching the data. Just loader animation while fetching is fine. Please check https://github.com/HITK-TECH-Community/Community-Website/blob/main/frontend/src/pages/ContactUs/ContactUs.jsx#L323-L328 this section for reference. For every api call, there can be success/failure and the toast should be showing success message in green if api is successful or failure message in red with error message. in your pr i don't see the failure scenario being handled. Please go through the code i shared here, it will give you the idea of toast implementation

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok i am working on this and removing the toast message on the loading.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Kajol-Kumari Please Check Out Now.

Copy link
Member

@Kajol-Kumari Kajol-Kumari left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@Kajol-Kumari Kajol-Kumari added level3 New features, major bug fixing. gssoc GSSoC'24 Label labels May 15, 2024
@Kajol-Kumari Kajol-Kumari merged commit 2134ca7 into HITK-TECH-Community:main May 15, 2024
6 checks passed
Copy link

welcome bot commented May 15, 2024

Congrats on merging your first pull request! 🙌 🎉 ⚡️ Now that you've merged your first pull request, you're the perfect person to help someone else out with this challenging first step.😄🙌
Feel free to join our Slack Community.💖 We have different channels for active discussions.✨ Hope you have a great time there!😄

@Kajol-Kumari
Copy link
Member

Kajol-Kumari commented May 15, 2024

@TejasNasre let me know asap if you are willing to work on 885 this issue?

@TejasNasre
Copy link
Contributor Author

who is answering the questions.

@Kajol-Kumari
Copy link
Member

who is answering the questions.

It can be answered by anyone but will appear only after admin's approval. As far as i remember that was implemented, let me check this its been a while i have checked this codebase

@Kajol-Kumari
Copy link
Member

seems like api does exist but need a little tweak to have a flag isAdminApproved so will keep this integration on hold till the time the api gets fixed :)

@TejasNasre
Copy link
Contributor Author

I want your help - i recently worked on others repo and i raised some issue and they got merged but today in my forked repo i discard the commits unconditionally and the merge code is there on main but when I checked the PR all commits are deleted and some PR did not get merged yet and there commits also get deleted so I will get points on GSSOC and what if I delete the fork repo and then then rebase it.

@Kajol-Kumari
Copy link
Member

the points are only one the basis of labels assigned to the merged prs so yes, you will get the points for those prs

@TejasNasre
Copy link
Contributor Author

What if I delete the fork repo for this project and then rebase code and I got merged one PR so I will get points?

@Kajol-Kumari
Copy link
Member

all merged prs with correct label will give you required points

@TejasNasre
Copy link
Contributor Author

Thanks @Kajol-Kumari For Helping

@TejasNasre
Copy link
Contributor Author

Can you please label level 3 to those issues you assigned to me 🥺 it would be great for me.

@Kajol-Kumari
Copy link
Member

Hey @TejasNasre i am assigning the levels based on the complexity of the issues only, if the required changes comes to be more than my expectation, i would be happy to revise the levels :)

@TejasNasre
Copy link
Contributor Author

Ok Thank 👍🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gssoc GSSoC'24 Label level3 New features, major bug fixing.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Frontend] Integrate GET Questions in Frontend
2 participants