feat(layout/observer): Add user preference for dark theme in LayoutObserver component. (#21255)

* feat(layout/observer): Add user preference for dark theme in `LayoutObserver` component.

* feat(docs/administration): Add support for default dark theme preference parameter

* refactor(settings): Remove dark theme setting from LayoutObserver and move it to Settings class.
This commit is contained in:
André Castro 2024-09-30 10:33:41 -03:00 committed by GitHub
parent f74a0657ba
commit 4b0cd2b522
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 10 additions and 1 deletions

View File

@ -3,6 +3,7 @@ import { isEmpty } from 'radash';
import LocalStorage from '/imports/ui/services/storage/local';
import SessionStorage from '/imports/ui/services/storage/session';
import { CHANGED_SETTINGS, DEFAULT_SETTINGS, SETTINGS } from './enums';
import getFromUserSettings from '/imports/ui/services/users-settings';
class Settings {
constructor(defaultValues = {}) {
@ -32,6 +33,13 @@ class Settings {
|| navigator.language
|| writableDefaultValues.application.locale;
const showDarkThemeDefault = getFromUserSettings(
'bbb_prefer_dark_theme',
window.meetingClientSettings.public.app.defaultSettings.application.darkTheme,
);
writableDefaultValues.application.darkTheme = showDarkThemeDefault;
this.setDefault(writableDefaultValues);
this.loadChanged();
}

View File

@ -1452,6 +1452,7 @@ The use of *more will include all shapes listed above.
| -------------------------------- | -------------------------------------------------------------------------------------------------------------------- | ------------- |
| `userdata-bbb_custom_style=` | URL encoded string with custom CSS | none |
| `userdata-bbb_custom_style_url=` | This parameter acts the same way as `userdata-bbb_custom_style` except that the CSS content comes from a hosted file | none |
| `userdata-bbb_prefer_dark_theme=` | This parameter makes the dark theme come in as default | false |
#### Layout parameters

View File

@ -112,7 +112,7 @@ Updated in 2.7:
Updated in 3.0:
- **create** - **Added parameters:** `allowOverrideClientSettingsOnCreateCall`, `loginURL`. Parameter `meetingLayout` supports a few new options: CAMERAS_ONLY, PARTICIPANTS_CHAT_ONLY, PRESENTATION_ONLY; **Added POST module:** `clientSettingsOverride`; **Added:** `disabledFeatures` options `infiniteWhiteboard`;
- **join** - **Added:** `enforceLayout`, `userdata-bbb_default_layout`, `userdata-bbb_skip_echotest_if_previous_device`. **Removed:** `defaultLayout` (replaced by `userdata-bbb_default_layout`) and removed support for all HTTP request methods except GET.
- **join** - **Added:** `enforceLayout`, `userdata-bbb_default_layout`, `userdata-bbb_skip_echotest_if_previous_device`, `bbb_prefer_dark_theme`. **Removed:** `defaultLayout` (replaced by `userdata-bbb_default_layout`) and removed support for all HTTP request methods except GET.
- **sendChatMessage** endpoint was first introduced.
- **enter** endpoint was removed. It was only used internally, never part of the api documentation.
- **html5client/check** endpoint was removed. It was used for checking the health of the server returning `{"html5clientStatus":"running"}`