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

Only load admin CSS when showing settings page #345

Merged
merged 2 commits into from Mar 2, 2022

Conversation

tommcc
Copy link

@tommcc tommcc commented Oct 25, 2021

All Submissions:

Changes proposed in this Pull Request:

The styles-admin.css file currently loads even on the front-end pages of a site. Visitors should not be loading an extra request for admin-related styles, nor should unrelated admin pages.

This PR changes the enqueue of styles-admin.css to only happen when loading the settings page. While this CSS currently only affects the logging table, the naming suggests it could be used for any of the admin UI, which is only the settings page.

How to test the changes in this Pull Request:

  1. While logged out, load a page of your site.
  2. Open the Network tab of your browser's developer tools.
  3. You should not see styles-admin.css loading.
  4. Now, log in and go to the OpenID settings page.
  5. Looking back at the Network tab, you should now see styles-admin.css loading.

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully run tests with your changes locally?

Note: I wasn't able to get the tests running properly to inspect/add tests, but hopefully this change should be both easy to review and easy to test manually, which may not require automated tests. If not, I can work on troubleshooting the docker-compose error I was getting in trying to run tests.

Changelog entry

Enter a summary of all changes on this Pull Request. This will appear in the changelog if accepted.

Only load admin CSS when showing settings page.

@tommcc tommcc marked this pull request as ready for review October 25, 2021 03:08
@timnolte timnolte added the enhancement Issues & PRs related to new features. label Oct 25, 2021
@timnolte timnolte self-assigned this Dec 29, 2021
@timnolte timnolte added this to the 3.8.6 milestone Dec 29, 2021
@timnolte timnolte added the status: approved PRs that have been approved and ready to be merged. label Dec 29, 2021
@timnolte timnolte modified the milestones: 3.8.6, 3.9.0 Dec 29, 2021
@Avamander
Copy link

@timnolte could this be merged please?

@tommcc
Copy link
Author

tommcc commented Mar 1, 2022

@timnolte could this be merged please?

@daggerhart

@timnolte timnolte added this to To do in 3.9.0 Release via automation Mar 1, 2022
@timnolte
Copy link
Collaborator

timnolte commented Mar 1, 2022

@tommcc no need to bump the PR, if you see there have already been a number of PRs merged within that last week. It looks like this PR was tagged for the 3.9 release but didn't make it into the Project for some reason.

@tommcc
Copy link
Author

tommcc commented Mar 1, 2022

Apologies, I thought an additional approval was needed. Thanks for the update. 🙌

@timnolte timnolte moved this from To do to In progress in 3.9.0 Release Mar 2, 2022
@timnolte timnolte merged commit 5efb906 into oidc-wp:dev Mar 2, 2022
3.9.0 Release automation moved this from In progress to Done Mar 2, 2022
@tommcc tommcc deleted the limit-css-loading branch June 30, 2022 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Issues & PRs related to new features. status: approved PRs that have been approved and ready to be merged.
Projects
No open projects
3.9.0 Release
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants