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

feat: Allow registering settings as Less config vars through Settings Extender #3011

Merged
merged 14 commits into from
Nov 1, 2021

Conversation

SychO9
Copy link
Member

@SychO9 SychO9 commented Aug 11, 2021

Fixes #2819

Changes proposed in this pull request:
This PR adds a registerLessConfigVar method to the settings extender that allows passing those settings values to the LESS code similarly to how they are serialized to the frontend. It also makes sure such settings always flushes the CSS cache when saving new values.

In the issue linked, the plan was to initially introduce this in a Theme extender so that, but the Settings extender make more sense, since all we want is to directly use settings as config vars.

Reviewers should focus on:
General code quality, anything I might've missed.

Confirmed

  • Frontend changes: tested on a local Flarum installation.
  • Backend changes: tests are green (run composer test).

@SychO9 SychO9 marked this pull request as draft August 26, 2021 22:48
@SychO9 SychO9 marked this pull request as ready for review August 27, 2021 08:25
src/Forum/ValidateCustomLess.php Outdated Show resolved Hide resolved
src/Frontend/FrontendServiceProvider.php Show resolved Hide resolved
tests/integration/extenders/SettingsTest.php Outdated Show resolved Hide resolved
src/Frontend/FrontendServiceProvider.php Outdated Show resolved Hide resolved
SychO9 and others added 2 commits August 27, 2021 17:37
Co-authored-by: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com>
[ci skip] [skip ci]
@SychO9 SychO9 mentioned this pull request Oct 26, 2021
8 tasks
# Conflicts:
#	src/Extend/Settings.php
#	src/Frontend/FrontendServiceProvider.php
#	tests/integration/extenders/SettingsTest.php
@SychO9 SychO9 changed the title [1.x] Allow registering settings as LESS config vars through Settings Extender feat: Allow registering settings as Less config vars through Settings Extender Nov 1, 2021
@SychO9 SychO9 merged commit d8e7aa5 into master Nov 1, 2021
@SychO9 SychO9 deleted the sm/2819-less-config-vars-settings branch November 1, 2021 14:41
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.

Less Configuration Variables
4 participants