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 package drf-redesign which styles the rest framework browsable API #5786

Merged
merged 0 commits into from
Nov 15, 2024

Conversation

DeanElliott96
Copy link
Contributor

@DeanElliott96 DeanElliott96 commented Nov 12, 2024

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

  • Has this branch been rebased on top of the current main branch?
  • Is the CircleCI build passing?

Before:
Screenshot 2024-11-12 at 16 58 13

After Dark:
Screenshot 2024-11-13 at 16 45 31

After Light:
Screenshot 2024-11-13 at 16 45 27

@DeanElliott96 DeanElliott96 self-assigned this Nov 12, 2024
@DeanElliott96 DeanElliott96 force-pushed the feature/TET-878-drf-bootstrap-3-replacement branch 2 times, most recently from 1f40654 to 9b68d89 Compare November 14, 2024 12:28
Copy link

codecov bot commented Nov 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.47%. Comparing base (7f3d486) to head (bcdaf99).
Report is 5 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

@DeanElliott96 DeanElliott96 marked this pull request as ready for review November 14, 2024 12:46
@DeanElliott96 DeanElliott96 requested a review from a team as a code owner November 14, 2024 12:46
@DeanElliott96 DeanElliott96 marked this pull request as draft November 14, 2024 16:41
@DeanElliott96 DeanElliott96 marked this pull request as ready for review November 15, 2024 15:07
@DeanElliott96 DeanElliott96 force-pushed the feature/TET-878-drf-bootstrap-3-replacement branch 3 times, most recently from 454aea7 to bcdaf99 Compare November 15, 2024 15:12
@DeanElliott96 DeanElliott96 merged this pull request into main Nov 15, 2024
7 checks passed
@DeanElliott96 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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants