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

Add lock routes #3421

Open
wants to merge 49 commits into
base: master
Choose a base branch
from
Open

Conversation

G-Ambatte
Copy link
Collaborator

@G-Ambatte G-Ambatte commented Apr 21, 2024

This PR contributes towards Issue #3326.

This PR adds the following routes to the Admin API:

  • /admin/lock : GET returns the number of documents in the collection that have the lock.locked property set to true.
  • /admin/lock/:id : POST takes a brew ID and a JSON lock object; updates the identified brew with the properties of the lock object.
  • /admin/unlock/:id : PUT takes a brew ID; removes the lock from the identified brew
  • /admin/lock/reviews : GET returns a collection of documents that has the lock.locked set to true and lock.reviewRequested exists.
  • /admin/lock/review/request/:id : PUT updates the identified brew's lock object with a reviewRequested property (current date/time). NON-ADMIN ROUTE
  • /admin/lock/review/remove/:id : PUT updates the identified brew's lock object to remove the reviewRequested property without removing the entire lock.

@G-Ambatte G-Ambatte mentioned this pull request Apr 21, 2024
4 tasks
@G-Ambatte G-Ambatte self-assigned this Apr 21, 2024
@G-Ambatte G-Ambatte added the sub-epic Sub-task of an Epic label Apr 21, 2024
@G-Ambatte G-Ambatte temporarily deployed to homebrewery-pr-3421 May 11, 2024 11:59 Inactive
@5e-Cleric
Copy link
Member

5e-Cleric commented May 11, 2024

We could use two columns in the lock tab there

Attaching screenshot for reference

image

@G-Ambatte
Copy link
Collaborator Author

Still working on functionality, visibility will come next.

@G-Ambatte G-Ambatte temporarily deployed to homebrewery-pr-3421 May 16, 2024 05:19 Inactive
@G-Ambatte G-Ambatte temporarily deployed to homebrewery-pr-3421 May 29, 2024 12:03 Inactive
@G-Ambatte G-Ambatte temporarily deployed to homebrewery-pr-3421 June 6, 2024 11:07 Inactive
@G-Ambatte G-Ambatte temporarily deployed to homebrewery-pr-3421 June 8, 2024 00:06 Inactive
@G-Ambatte G-Ambatte temporarily deployed to homebrewery-pr-3421 June 8, 2024 03:54 Inactive
@G-Ambatte G-Ambatte temporarily deployed to homebrewery-pr-3421 June 8, 2024 04:08 Inactive
@G-Ambatte G-Ambatte temporarily deployed to homebrewery-pr-3421 June 8, 2024 04:36 Inactive
@G-Ambatte G-Ambatte temporarily deployed to homebrewery-pr-3421 June 8, 2024 06:55 Inactive
@G-Ambatte
Copy link
Collaborator Author

On opening a locked brew for editing:
image

On clicking "REQUEST REVIEW":
image

On the new "LOCKS" tab of the Admin page:

  • Lock Count:
    image
    Clicking "REFRESH" causes the lock count function to run and update the total.

  • Brews Awaiting Review:
    image
    Clicking the button causes the locks with review function to run and update the table. Clicking a row in the table causes the Share ID to be copied to the clipboard (NYI: words explaining this on the page).

  • Lock Brew:
    image
    The four fields are required, attempting to submit a lock with an empty field results in the following:
    image
    The information on the right are suggested codes (from this Github comment and information about the messages

  • Unlock Brew:
    image
    Entering the Share ID of a locked brew and clicking the button results in the lock being removed from that brew, if one exists.

  • Clear Review Request
    image
    Entering the Share ID of a locked brew and clicking the button results in the review request being removed from a locked brew. Possibly this should also have an option to update the editMessage to advise the user why their changes are insufficient to have the lock completely removed.

@G-Ambatte G-Ambatte marked this pull request as ready for review June 8, 2024 07:13
@G-Ambatte G-Ambatte temporarily deployed to homebrewery-pr-3421 June 8, 2024 08:00 Inactive
@G-Ambatte G-Ambatte temporarily deployed to homebrewery-pr-3421 June 8, 2024 08:02 Inactive
@G-Ambatte
Copy link
Collaborator Author

Still need to implement some feedback from the Lock Brew method, to indicate success or failure. Otherwise I think most of the functionality is in a good place, although the styling could probably still use some improvement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sub-epic Sub-task of an Epic
Projects
Status: Next Priority
Development

Successfully merging this pull request may close these issues.

None yet

3 participants