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

Implement git manager link #1351

Merged
merged 2 commits into from
Apr 8, 2024
Merged

Conversation

mikaelGusse
Copy link
Contributor

@mikaelGusse mikaelGusse commented Mar 25, 2024

Description

What?

Add a link to the teacher view's gitmanager tab which allows the user to easily go to the gitmanager page and automatically log in.

Why?

Makes it easier to debug issues regarding courses and streamlines the process of logging in to the gitmanager site

How?

Added a link to the page that user javascript to fetch the correct url to the gitmanager instance and also gets the auth token through the A+ api which is passed using a HTTP POST request.

Fixes #1027

Testing

Remember to add or update unit tests for new features and changes.

What type of test did you run?

  • Accessibility test using the WAVE extension.
  • Django unit tests.
  • Selenium tests.
  • Other test. (Add a description below)
  • Manual testing.

Added the change into test-plus and checked that it truly logs the user into gitmanager.

Did you test the changes in

  • Chrome
  • Firefox
  • This pull request cannot be tested in the browser.

Think of what is affected by these changes and could become broken

Translation

Programming style

  • Did you follow our style guides?
  • Did you use Python type hinting in all functions that you added or edited? (type hints for function parameters and return values)

Have you updated the README or other relevant documentation?

  • documents inside the doc directory.
  • README.md.
  • Aplus Manual.
  • Other documentation (mention below which documentation).

Is it Done?

  • Reviewer has finished the code review
  • After the review, the developer has made changes accordingly
  • Customer/Teacher has accepted the implementation of the feature

Clean up your git commit history before submitting the pull request!

Copy link
Contributor

@murhum1 murhum1 left a comment

Choose a reason for hiding this comment

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

Thanks! I added a couple of small changes:

  • Removed csrf cookie fetch; we can just inject {{ csrf_token }} since we're using a Django template. The cookie approach would only be required if we were using a separate JS library to render HTML.
  • Removed the global GITMANAGER_URL context-processor, and instead added the url to this specific context with self.note()
  • Small indentation / variable name changes

@murhum1 murhum1 merged commit 3b0f56f into apluslms:master Apr 8, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Add a gitmanager link with automatic JWT auth to the A+ edit course section
2 participants