-
Notifications
You must be signed in to change notification settings - Fork 10
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 package drf-redesign which styles the rest framework browsable API #5786
Merged
DeanElliott96
merged 0 commits into
main
from
feature/TET-878-drf-bootstrap-3-replacement
Nov 15, 2024
Merged
Add package drf-redesign which styles the rest framework browsable API #5786
DeanElliott96
merged 0 commits into
main
from
feature/TET-878-drf-bootstrap-3-replacement
Nov 15, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
datahub/drf_browsable_api/templates/rest_framework/drf_redesign_api.html
Fixed
Show resolved
Hide resolved
datahub/drf_browsable_api/templates/rest_framework/drf_redesign_api.html
Fixed
Show resolved
Hide resolved
DeanElliott96
commented
Nov 13, 2024
DeanElliott96
force-pushed
the
feature/TET-878-drf-bootstrap-3-replacement
branch
2 times, most recently
from
November 14, 2024 12:28
1f40654
to
9b68d89
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5786 +/- ##
=======================================
Coverage 96.47% 96.47%
=======================================
Files 1037 1037
Lines 24625 24625
Branches 1637 1637
=======================================
Hits 23758 23758
Misses 710 710
Partials 157 157 ☔ View full report in Codecov by Sentry. |
baarkerlounger
approved these changes
Nov 14, 2024
DeanElliott96
commented
Nov 15, 2024
DeanElliott96
force-pushed
the
feature/TET-878-drf-bootstrap-3-replacement
branch
3 times, most recently
from
November 15, 2024 15:12
454aea7
to
bcdaf99
Compare
baarkerlounger
approved these changes
Nov 15, 2024
samuele-mattiuzzo
approved these changes
Nov 15, 2024
DeanElliott96
deleted the
feature/TET-878-drf-bootstrap-3-replacement
branch
November 15, 2024 15:42
Aadam-Ali
pushed a commit
that referenced
this pull request
Nov 20, 2024
…-replacement Add package drf-redesign which styles the rest framework browsable API
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of change
Rest framework uses bootstrap3 and our security audit raised bootstrap3 as having vulnerabilities. This new package uses bootstrap5 instead and will act as a replacement until DRF updates.
I've added Bootstrap5 and drf_redesign package dependencies so we can self host and don't require any CDNs.
This file
api.html
is a direct copy from the drf_redesign package. The changes made are to remove the CDNs and rest_framework bootstrap imports. Also some changes to the nav to remove links to the package and DRF.The collectstatic command has also been updated to ignore files from rest_framework as rest_framework has copies of bootstrap3 which we do not want to be collected and served from our API.
Extra reading if you want:
The Bootstrap issue was raised in the DRF github and the owner has pushed back. You can view the reasons here: Update docs_theme to boostrap V5.x by mostafaei2002 · Pull Request #9404 · encode/django-rest-framework
Checklist
main
branch?Before:
After Dark:
After Light: