Merge pull request #5208 from matrix-org/travis/ui-func/base
Introduce a concept of UI features, using it for URL previews at first
This commit is contained in:
commit
88115b4f46
7 changed files with 108 additions and 6 deletions
|
@ -32,6 +32,8 @@ import UseSystemFontController from './controllers/UseSystemFontController';
|
|||
import { SettingLevel } from "./SettingLevel";
|
||||
import SettingController from "./controllers/SettingController";
|
||||
import { RightPanelPhases } from "../stores/RightPanelStorePhases";
|
||||
import UIFeatureController from "./controllers/UIFeatureController";
|
||||
import { UIFeature } from "./UIFeature";
|
||||
|
||||
// These are just a bunch of helper arrays to avoid copy/pasting a bunch of times
|
||||
const LEVELS_ROOM_SETTINGS = [
|
||||
|
@ -69,6 +71,10 @@ const LEVELS_DEVICE_ONLY_SETTINGS_WITH_CONFIG = [
|
|||
SettingLevel.DEVICE,
|
||||
SettingLevel.CONFIG,
|
||||
];
|
||||
const LEVELS_UI_FEATURE = [
|
||||
SettingLevel.CONFIG,
|
||||
// in future we might have a .well-known level or something
|
||||
];
|
||||
|
||||
export interface ISetting {
|
||||
// Must be set to true for features. Default is 'false'.
|
||||
|
@ -442,6 +448,7 @@ export const SETTINGS: {[setting: string]: ISetting} = {
|
|||
"room": _td("Enable URL previews by default for participants in this room"),
|
||||
},
|
||||
default: true,
|
||||
controller: new UIFeatureController(UIFeature.URLPreviews),
|
||||
},
|
||||
"urlPreviewsEnabled_e2ee": {
|
||||
supportedLevels: [SettingLevel.ROOM_DEVICE, SettingLevel.ROOM_ACCOUNT],
|
||||
|
@ -449,6 +456,7 @@ export const SETTINGS: {[setting: string]: ISetting} = {
|
|||
"room-account": _td("Enable URL previews for this room (only affects you)"),
|
||||
},
|
||||
default: false,
|
||||
controller: new UIFeatureController(UIFeature.URLPreviews),
|
||||
},
|
||||
"roomColor": {
|
||||
supportedLevels: LEVELS_ROOM_SETTINGS_WITH_ROOM,
|
||||
|
@ -606,4 +614,8 @@ export const SETTINGS: {[setting: string]: ISetting} = {
|
|||
supportedLevels: LEVELS_ROOM_OR_ACCOUNT,
|
||||
default: {},
|
||||
},
|
||||
[UIFeature.URLPreviews]: {
|
||||
supportedLevels: LEVELS_UI_FEATURE,
|
||||
default: true,
|
||||
},
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue