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

Question SPA #30

Merged
merged 56 commits into from
Sep 28, 2024
Merged

Question SPA #30

merged 56 commits into from
Sep 28, 2024

Conversation

limcaaarl
Copy link

@limcaaarl limcaaarl commented Sep 22, 2024

Description

  • Added table view for the question data.
  • Dialogs and popups are implemented for adding/editing questions.
  • CRUD operations are currently implemented for client side only.

Checklist

  • Frontend
  • REST API calls
  • Update error messages
  • Allow addition of new topic

@limcaaarl limcaaarl linked an issue Sep 22, 2024 that may be closed by this pull request
Copy link

@samuelim01 samuelim01 left a comment

Choose a reason for hiding this comment

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

Looks pretty sick, other than the minor comments LGTM, just need to hook it with the question service endpoints.

frontend/src/app/questions/questions.component.spec.ts Outdated Show resolved Hide resolved
frontend/src/app/questions/questions.component.ts Outdated Show resolved Hide resolved
frontend/src/styles.css Outdated Show resolved Hide resolved
frontend/src/styles.css Outdated Show resolved Hide resolved
Copy link

@samuelim01 samuelim01 left a comment

Choose a reason for hiding this comment

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

woops missed two minor details

frontend/src/app/questions/questions.component.html Outdated Show resolved Hide resolved
frontend/src/app/questions/questions.component.ts Outdated Show resolved Hide resolved
- Update toast message for successful delete
- Add spaces between multiple topics
- Update .css to use .min
- Remove redundant console logs
Copy link

@McNaBry McNaBry left a comment

Choose a reason for hiding this comment

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

image

I can add a question with no topic even though it is stated to be required. I can achieve this by selecting one or more topics, then clearing the input. Pressing "save" then submits the question with no topic.

@McNaBry
Copy link

McNaBry commented Sep 27, 2024

Can I also ask if question.service.ts can be moved outside of the question folder into a shared services folder? I think it might be required by other pages like matching where the list of possible topics have to be fetched from the DB.

@limcaaarl
Copy link
Author

image

I can add a question with no topic even though it is stated to be required. I can achieve this by selecting one or more topics, then clearing the input. Pressing "save" then submits the question with no topic.

Thanks for pointing this one out. Fixed it 👍

@limcaaarl
Copy link
Author

Can I also ask if question.service.ts can be moved outside of the question folder into a shared services folder? I think it might be required by other pages like matching where the list of possible topics have to be fetched from the DB.

I think this is still accessible by other pages since our frontend will be deployed as one. But if this improves the project structure, I can move it. What do the others think?

@samuelim01
Copy link

Can I also ask if question.service.ts can be moved outside of the question folder into a shared services folder? I think it might be required by other pages like matching where the list of possible topics have to be fetched from the DB.

I think this is still accessible by other pages since our frontend will be deployed as one. But if this improves the project structure, I can move it. What do the others think?

I think we should move into src/_services/ or something along those lines as services are going to be used by many different components, so it would preferable for project structure.

Copy link

@samuelim01 samuelim01 left a comment

Choose a reason for hiding this comment

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

Just a few minor things!

frontend/src/app/questions/questions.component.html Outdated Show resolved Hide resolved
frontend/src/app/questions/questions.component.html Outdated Show resolved Hide resolved
frontend/src/app/questions/questions.component.html Outdated Show resolved Hide resolved
frontend/src/app/questions/questions.component.ts Outdated Show resolved Hide resolved
@limcaaarl
Copy link
Author

Can I also ask if question.service.ts can be moved outside of the question folder into a shared services folder? I think it might be required by other pages like matching where the list of possible topics have to be fetched from the DB.

I think this is still accessible by other pages since our frontend will be deployed as one. But if this improves the project structure, I can move it. What do the others think?

I think we should move into src/_services/ or something along those lines as services are going to be used by many different components, so it would preferable for project structure.

Aite I'll move it to src/_services/ 👍

Copy link

@samuelim01 samuelim01 left a comment

Choose a reason for hiding this comment

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

LGTM, just a few minor code quality comments

frontend/src/app/questions/question-dialog.component.html Outdated Show resolved Hide resolved
frontend/src/app/questions/question-dialog.component.ts Outdated Show resolved Hide resolved
frontend/src/app/questions/question-dialog.component.html Outdated Show resolved Hide resolved
samuelim01 and others added 5 commits September 28, 2024 00:21
Upon adding a new topic,
* Immediately adds the topic instead of the user having to press the new topic checkbox
* Clear the search filter box since there would be no other results
- Removed some of the @input in question-dialog
- Updated ngIf to @if
- Updated dialog box cancel button to use EventEmitter instead
- Fixed the issue where line break is not being shown
  in the description table
- Fixed the issue where question becomes undefined
  after an error response is received, causing the
  form to be not prefilled upon clicking edit button
@limcaaarl limcaaarl merged commit 0db5a22 into main Sep 28, 2024
2 checks passed
@samuelim01 samuelim01 deleted the question-spa-frontend branch September 29, 2024 03:45
@limcaaarl limcaaarl self-assigned this Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Question SPA
3 participants