Skip to content
Snippets Groups Projects

Redirecting a request to head TA/lecturer

What does this mr do?

Closes #628

This MR adds the option for TAs to forward requests to all head TAs and lecturers (but not simple TAs) without choosing the specific head TA/lecturer. Then the forwarded request is visible only to [and can only be picked up by] head TAs and lecturers.

Screenshots

after

We now have a new option in the forwarding dropdown: after_1

A simple TA does not see that forwarded request: after_2

A teacher does though: after_3

Request indicates that it was forwarded to head TAs/teachers: after_4

Does this MR meet the acceptance criteria?

  • I have added a changelog entry to reflect the significant changes I made.
  • Tests were created to test the feature.
  • I have updated the documentation accordingly.
  • I adhere to the style guide.
Edited by Rūta Giedrytė

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Henry Page
    • Resolved by Rūta Giedrytė

      Generally looks good. I have a question about the constant switching between string literals and enums. This can cause bugs down the line if we are not careful about how we maintain the mappings. It would be better if we keep everything as an enum. Is there motivation as to why keeping it separate as a string would be good? The main issue I have with how it is implemented right now is that there are custom string literals scattered everywhere.

      Let's use the existing RequestStatus as an example:

      1.) They are inherently serialisable, which means when you send a websocketmessage, you don't have to specify an explicit conversion.

      public class RequestCreatedMessage extends View<LabRequest> implements LabRequestMessage {
      	private static final long serialVersionUID = -3558345410667448241L;
      
      	private Long id;
              ...
      
      	private RequestStatus status;

      2.) You can persist them using the actual value name in JPA by using @Enumerated(EnumType.STRING)

      see: https://www.baeldung.com/java-enums-jpa-postgresql#:~:text=When%20using%20Java%20enums%20with,be%20stored%20in%20the%20database.&text=By%20default%2C%20JPA%20stores%20the,position%20of%20the%20enum%20constant.

      	@NotNull
      	@Enumerated(EnumType.STRING)
      	private RequestType type;

      Furthermore, if we wanted to define custom values for our enum function (not that we would want to in this case), we can do something like this without having to update every other string literal in our code.

      https://stackoverflow.com/questions/60500739/storing-enum-custom-values-with-jpa

      What this does change though is that in cases where its not actually being forwarded, you MAY need some sort of default value in the enum to reflect this. I say may because I don't actually know if its required.

      Edited by Henry Page
  • Henry Page
  • Henry Page
  • Henry Page
  • Henry Page
  • Henry Page
  • Henry Page
  • Henry Page
  • Henry Page requested changes

    requested changes

  • Henry Page added 1 deleted label and removed 1 deleted label

    added 1 deleted label and removed 1 deleted label

  • added 1 commit

    • 50186c26 - implemented feedback excluding tests

    Compare with previous version

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading