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

Transfer groundControl from staff to admin route #3043

Merged
merged 11 commits into from
Sep 24, 2024

Conversation

josh1248
Copy link
Contributor

@josh1248 josh1248 commented Sep 1, 2024

Description

Addresses #3031 by re-routing ground control from a staff to an admin route.
P.S.: still figuring out the backend. Will further changes be required?

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • Code quality improvements

How to test

  • Enter the test environment as an admin, and see that you are able to enter ground control normally.

  • Copy the ground control route (should be '/groundcontrol')

  • Switch the test environment to be a staff

  • Check that the ground control button is now missing.

  • Paste the ground control route. A 404 route should be expected.

  • Go to src/commons/navigationBar/AcademyNavigationBar and change the ground control route into a staff route.

  • Log in as staff. Manually append '/groundcontrol' to the URL to get to the ground control screen.

  • Attempt to delete an assessment, or mass publish an assessment through the ground control panel.

  • A 403 Forbidden error should show up.

  • Other functions, such as unpublishing or publishing of a single submission in the gradings table, should still be possible.

Checklist

  • I have tested this code - I have manually tested the website to check if I broke any frontend-backend links.
  • I have updated the documentation

@josh1248 josh1248 requested a review from RichDom2185 September 1, 2024 16:52
@coveralls
Copy link

coveralls commented Sep 1, 2024

Pull Request Test Coverage Report for Build 11008345446

Details

  • 0 of 2 (0.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 31.449%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/pages/academy/academyRoutes.tsx 0 2 0.0%
Totals Coverage Status
Change from base Build 11007946528: 0.0%
Covered Lines: 4852
Relevant Lines: 14547

💛 - Coveralls

Copy link
Member

@RichDom2185 RichDom2185 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@RichDom2185
Copy link
Member

Waiting for the BE PR before merging.

* GET /courses/{courseId}/admin/users/{studentCourseRegId}/goals
* GET /courses/{courseId}/staff/users/{studentCourseRegId}/goals
Copy link
Member

Choose a reason for hiding this comment

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

Let's not do this. /admin doesn't refer to the role; it refers to (course) administration.

It's a sub-resources belonging to the REST resource which is the course itself.

The role check is transparent (i.e. unknown to) the frontend; you shouldn't be able to tell based on the endpoint what are the checks.

@josh1248
Copy link
Contributor Author

josh1248 commented Sep 8, 2024

@RichDom2185 backend PR is ready now. I have replaced all non-dangerous routes to use a "/staff" instead of "/admin" URL to connect to the backend. I have also changed the routes in the backend directly. All seems good, but I am not sure if I have advertently broken some frontend-backend link. Any automated way to test it?

@RichDom2185
Copy link
Member

Any automated way to test it?

@josh1248 not really, I think best to just not touch it. Refer to my comments above.

Basically your endpoints paths should be related to your resource.

E.g. GET /users/{id}/name

or something like that

Copy link
Member

@RichDom2185 RichDom2185 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@RichDom2185 RichDom2185 enabled auto-merge (squash) September 24, 2024 06:37
@RichDom2185 RichDom2185 merged commit 4924ee4 into source-academy:master Sep 24, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants