MM-53107 Add setting to limit the max number of markdown nodes (#24414)

* MM-53107 Add setting to limit the max number of markdown nodes

* Add extra validation for a couple config fields

* Add new setting to telemetry
Этот коммит содержится в:
Harrison Healey
2023-08-31 14:36:24 -04:00
коммит произвёл GitHub
родитель 47b51ff696
Коммит f2fcf3d839
7 изменённых файлов: 44 добавлений и 2 удалений

Просмотреть файл

@@ -3056,6 +3056,15 @@ const AdminDefinition = {
key: 'DisplaySettings.CustomURLSchemes',
isDisabled: it.not(it.userHasWritePermissionOnResource(RESOURCE_KEYS.SITE.POSTS)),
},
{
type: Constants.SettingsTypes.TYPE_NUMBER,
key: 'DisplaySettings.MaxMarkdownNodes',
label: t('admin.customization.maxMarkdownNodesTitle'),
label_default: 'Max Markdown Nodes:',
help_text: t('admin.customization.maxMarkdownNodesDesc'),
help_text_default: 'When rendering Markdown text in the mobile app, controls the maximum number of Markdown elements (eg. emojis, links, table cells, etc) that can be in a single piece of text. If set to 0, a default limit will be used.',
isDisabled: it.not(it.userHasWritePermissionOnResource(RESOURCE_KEYS.SITE.POSTS)),
},
{
type: Constants.SettingsTypes.TYPE_TEXT,
key: 'ServiceSettings.GoogleDeveloperKey',

Просмотреть файл

@@ -447,7 +447,7 @@ export default class SchemaAdminSettings extends React.PureComponent {
inputType = 'textarea';
}
let value = this.state[setting.key] || '';
let value = this.state[setting.key] ?? '';
if (setting.dynamic_value) {
value = setting.dynamic_value(value, this.props.config, this.state, this.props.license);
}

Просмотреть файл

@@ -667,6 +667,8 @@
"admin.customization.enableSVGsTitle": "Enable SVGs:",
"admin.customization.iosAppDownloadLinkDesc": "Add a link to download the iOS app. Users who access the site on a mobile web browser will be prompted with a page giving them the option to download the app. Leave this field blank to prevent the page from appearing.",
"admin.customization.iosAppDownloadLinkTitle": "iOS App Download Link:",
"admin.customization.maxMarkdownNodesDesc": "When rendering Markdown text in the mobile app, controls the maximum number of Markdown elements (eg. emojis, links, table cells, etc) that can be in a single piece of text. If set to 0, a default limit will be used.",
"admin.customization.maxMarkdownNodesTitle": "Maximum Markdown Nodes:",
"admin.customization.restrictLinkPreviewsDesc": "Link previews and image link previews will not be shown for the above list of comma-separated domains.",
"admin.customization.restrictLinkPreviewsExample": "E.g.: \"internal.mycompany.com, images.example.com\"",
"admin.customization.restrictLinkPreviewsTitle": "Disable website link previews from these domains:",