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

feat: Implement Matching flow and update Question CRUD #82

Merged
merged 46 commits into from
Oct 20, 2024

Conversation

HollaG
Copy link

@HollaG HollaG commented Oct 20, 2024

Description

This PR implements the matching workflow for the frontend, as well as an enhanced add-question page.

  1. Matching
    Added /session/create page with relevant states:
  • searching
  • match found
  • failed to find match
  1. Add-question page
  • Add Rich Text editor for support of formatting
  • Updated code input to be styled like a code input

Additional information

This PR should be merged AFTER #81.
This PR contains #81 due to merge conflict reasons.

pzl111 and others added 30 commits October 11, 2024 16:29
Out of the three new added fields for question, only solution code is compulsory, template code and link are not compulsory.
to be changed once backend updates the fetch categories endpoint to return a fixed set of categories
- Created websocket server for matching service
- Added client-sent events:
   - "connection": User connects to websocket server
   - "disconnect": User disconnects from websocket server
   - "create-match": User request for a match with another user with match criteria
   - "cancel-match": User cancels a current matching request
- Added server-sent events:
   - "connect": Server successfully connected with user
   - "disconnect": Server disconnected with user
   - "finding-match": Server trying to find a match with other users
   - "found-match": Server found a match for this user, returns match object
   - "no-match": Server could not find a match within the timeout
   - "disconnect-while-match": User was disconnected with server while finding a match
HollaG and others added 7 commits October 20, 2024 14:53
fixed the following issues:
- cursor moving to last line when editing in the wysiwyg editor
- undo button causing content in wysiwyg editor to be cleared
- ensure dummy categories used instead of fetched categories (for now, to be replaced once backend sends over fixed categories with id)
- change test code to code editor instead of text area
- create question page by default show one test case (to be filled by user)
@HollaG HollaG added f2.MatchingService Issues related to the F2 Matching Service f3.QuestionService Issues related to the F3 Question Service labels Oct 20, 2024
@HollaG HollaG added this to the D4 milestone Oct 20, 2024
@HollaG HollaG changed the title Frontend dev feat: Implement Matching flow and update Question CRUD Oct 20, 2024
Copy link

@georgetayqy georgetayqy left a comment

Choose a reason for hiding this comment

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

LGTM

@georgetayqy georgetayqy merged commit 53efce3 into staging Oct 20, 2024
8 of 9 checks passed
georgetayqy added a commit that referenced this pull request Oct 20, 2024
* chore: sanitise inputs

* feat(question-service)!: add solution and template code in schema

* chore: standardise API response

* fix: Standardise API response

* fix: add statusCode in response

* fix: Change request body format

* chore: Add test route for health checks

* fix: empty templateCode or solutionCode

* feat(question-service)!: add link attribute in question

* fix: fetching of data after backend api standardisation

* nit: fixed minor code usage issues

* fix: create/update questions not working (missing field)

* fix: compile error

* feat: Implement Matching Service (#81)

* feat(matching-service)!: Implement matching service backend
- Created websocket server for matching service
- Added client-sent events:
   - "connection": User connects to websocket server
   - "disconnect": User disconnects from websocket server
   - "create-match": User request for a match with another user with match criteria
   - "cancel-match": User cancels a current matching request
- Added server-sent events:
   - "connect": Server successfully connected with user
   - "disconnect": Server disconnected with user
   - "finding-match": Server trying to find a match with other users
   - "found-match": Server found a match for this user, returns match object
   - "no-match": Server could not find a match within the timeout
   - "disconnect-while-match": User was disconnected with server while finding a match

* fix: Handle errors and emit error event to frontend

* fix: Reduce timeout duration, add TTL to user entries in DB

* feat: Priority based queue from the number of categories selected

* fix: Update docker-compose

* chore: create .dockerignore files

* Revert "chore: create .dockerignore files"

This reverts commit f5309fb.

* fix: fix wrong Dockerfile command

---------

Co-authored-by: George Tay <[email protected]>

* feat: Implement Matching flow and update Question CRUD (#82)

* chore: Commit frontend mockup for matching service

* feat(matching-service)!: Create matching service backend

* fix: losing navigation state when refreshing

* fix: navbar doesn't align

* feat: match service up till failure

* fix: add template code input + remove required for link

Out of the three new added fields for question, only solution code is compulsory, template code and link are not compulsory.

* nit: improve UI and componentization

* feat: matching up till success state

* nit: cleanup ui

* feat: light/dark mode toggle

* fix: code editor for templateCode and solutionCode

* wip: questionlist

* feat: view specific question page

* chore: add rich text editor for question description

* fix: add templateCode field for Question

* fix: rich text editor for description + minor fix for code editor

* fix: only open link if it exists

* fix: submit html description on creating question

* fix: rename description object variable names

* nit: clean up navbar and add dark mode

* feat: update homepage

* nit: remove console.log

* fix: fix categories displayed

to be changed once backend updates the fetch categories endpoint to return a fixed set of categories

* feat(matching-service)!: Implement matching service backend
- Created websocket server for matching service
- Added client-sent events:
   - "connection": User connects to websocket server
   - "disconnect": User disconnects from websocket server
   - "create-match": User request for a match with another user with match criteria
   - "cancel-match": User cancels a current matching request
- Added server-sent events:
   - "connect": Server successfully connected with user
   - "disconnect": Server disconnected with user
   - "finding-match": Server trying to find a match with other users
   - "found-match": Server found a match for this user, returns match object
   - "no-match": Server could not find a match within the timeout
   - "disconnect-while-match": User was disconnected with server while finding a match

* chore: create startup script

* chore: update package

* fix: Handle errors and emit error event to frontend

* fix: Reduce timeout duration, add TTL to user entries in DB

* feat: Priority based queue from the number of categories selected

* fix: Update docker-compose

* fix: forgot to merge

* fix: rich text editor bug

* fix: question CRUD minor changes ang bug fixes

fixed the following issues:
- cursor moving to last line when editing in the wysiwyg editor
- undo button causing content in wysiwyg editor to be cleared
- ensure dummy categories used instead of fetched categories (for now, to be replaced once backend sends over fixed categories with id)
- change test code to code editor instead of text area
- create question page by default show one test case (to be filled by user)

* fix: make question link required

* fix: build errors

* chore: remove temp frontend for matching service

---------

Co-authored-by: pzl111 <[email protected]>
Co-authored-by: Lim Pei En <[email protected]>

---------

Co-authored-by: elaineshijie <[email protected]>
Co-authored-by: pzl111 <[email protected]>
Co-authored-by: pzl111 <[email protected]>
Co-authored-by: elaineshijie <[email protected]>
Co-authored-by: Lim Pei En <[email protected]>
Co-authored-by: hollag <[email protected]>
Co-authored-by: Marcus Soh <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
f2.MatchingService Issues related to the F2 Matching Service f3.QuestionService Issues related to the F3 Question Service
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants