Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

MM-14334 Allow plugin setting help text to contain Markdown #2467

Merged
merged 1 commit into from
Mar 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions components/admin_console/__snapshots__/help_text.test.jsx.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`HelpText should render markdown text correctly 1`] = `
<span
dangerouslySetInnerHTML={
Object {
"__html": "This is <strong>HELP TEXT</strong>",
}
}
/>
`;

exports[`HelpText should render plain text correctly 1`] = `
<span>
This is help text
</span>
`;

exports[`HelpText should render translated markdown text correctly 1`] = `
<InjectIntl(FormattedMarkdownMessage)
defaultMessage="This is [{object}](https://example.com)"
id="help.text.markdown"
values={
Object {
"object": "a help link",
}
}
/>
`;

exports[`HelpText should render translated text correctly 1`] = `
<FormattedMessage
defaultMessage="This is {object}"
id="help.text"
values={
Object {
"object": "help text",
}
}
/>
`;
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,9 @@ exports[`components/admin_console/SchemaAdminSettings should match snapshot with
<AdminTextSetting
disabled={false}
helpText={
<FormattedMessage
defaultMessage="This is some help text for the text field."
id="help-text-a"
values={Object {}}
<HelpText
text="help-text-a"
textDefault="This is some help text for the text field."
/>
}
id="FirstSettings.settinga"
Expand All @@ -79,10 +78,9 @@ exports[`components/admin_console/SchemaAdminSettings should match snapshot with
/>
}
helpText={
<FormattedMessage
defaultMessage="This is some help text for the bool field."
id="help-text-b"
values={Object {}}
<HelpText
text="help-text-b"
textDefault="This is some help text for the bool field."
/>
}
id="FirstSettings.settingb"
Expand All @@ -102,10 +100,9 @@ exports[`components/admin_console/SchemaAdminSettings should match snapshot with
<DropdownSetting
disabled={false}
helpText={
<FormattedMessage
defaultMessage="This is some help text for the dropdown field."
id="help-text-c"
values={Object {}}
<HelpText
text="help-text-c"
textDefault="This is some help text for the dropdown field."
/>
}
id="FirstSettings.settingc"
Expand Down Expand Up @@ -135,10 +132,9 @@ exports[`components/admin_console/SchemaAdminSettings should match snapshot with
<RadioSetting
disabled={false}
helpText={
<FormattedMessage
defaultMessage="This is some help text for the radio field."
id="help-text-d"
values={Object {}}
<HelpText
text="help-text-d"
textDefault="This is some help text for the radio field."
/>
}
id="SecondSettings.settingd"
Expand Down Expand Up @@ -167,10 +163,9 @@ exports[`components/admin_console/SchemaAdminSettings should match snapshot with
<GeneratedSetting
disabled={false}
helpText={
<FormattedMessage
defaultMessage="This is some help text for the generated field."
id="help-text-e"
values={Object {}}
<HelpText
text="help-text-e"
textDefault="This is some help text for the generated field."
/>
}
id="SecondSettings.settinge"
Expand All @@ -192,10 +187,9 @@ exports[`components/admin_console/SchemaAdminSettings should match snapshot with
<UserAutocompleteSetting
disabled={false}
helpText={
<FormattedMessage
defaultMessage="This is some help text for the user autocomplete field."
id="help-text-f"
values={Object {}}
<HelpText
text="help-text-f"
textDefault="This is some help text for the user autocomplete field."
/>
}
id="SecondSettings.settingf"
Expand All @@ -208,10 +202,9 @@ exports[`components/admin_console/SchemaAdminSettings should match snapshot with
<AdminTextSetting
disabled={false}
helpText={
<FormattedMessage
defaultMessage="This is some help text for the number field."
id="help-text-g"
values={Object {}}
<HelpText
text="help-text-g"
textDefault="This is some help text for the number field."
/>
}
id="SecondSettings.settingg"
Expand All @@ -226,10 +219,9 @@ exports[`components/admin_console/SchemaAdminSettings should match snapshot with
<AdminTextSetting
disabled={false}
helpText={
<FormattedMessage
defaultMessage="This is some help text for the number field."
id="help-text-h"
values={Object {}}
<HelpText
text="help-text-h"
textDefault="This is some help text for the number field."
/>
}
id="SecondSettings.settingh"
Expand Down Expand Up @@ -260,10 +252,9 @@ exports[`components/admin_console/SchemaAdminSettings should match snapshot with
<DropdownSetting
disabled={false}
helpText={
<FormattedMessage
defaultMessage="This is some help text for the language field."
id="help-text-i"
values={Object {}}
<HelpText
text="help-text-i"
textDefault="This is some help text for the language field."
/>
}
id="SecondSettings.settingi"
Expand Down Expand Up @@ -361,10 +352,9 @@ exports[`components/admin_console/SchemaAdminSettings should match snapshot with
<MultiSelectSetting
disabled={false}
helpText={
<FormattedMessage
defaultMessage="This is some help text for the multiple-language field."
id="help-text-j"
values={Object {}}
<HelpText
text="help-text-j"
textDefault="This is some help text for the multiple-language field."
/>
}
id="SecondSettings.settingj"
Expand Down Expand Up @@ -486,10 +476,9 @@ exports[`components/admin_console/SchemaAdminSettings should match snapshot with
}
}
helpText={
<FormattedMessage
defaultMessage="This is some help text for the button field."
id="help-text-k"
values={Object {}}
<HelpText
text="help-text-k"
textDefault="This is some help text for the button field."
/>
}
includeDetailedError={true}
Expand All @@ -514,10 +503,9 @@ exports[`components/admin_console/SchemaAdminSettings should match snapshot with
/>
}
helpText={
<FormattedMessage
defaultMessage="This is some help text for the second bool field."
id="help-text-l"
values={Object {}}
<HelpText
text="help-text-l"
textDefault="This is some help text for the second bool field."
/>
}
id="FirstSettings.settingl"
Expand All @@ -537,10 +525,9 @@ exports[`components/admin_console/SchemaAdminSettings should match snapshot with
<ColorSetting
disabled={false}
helpText={
<FormattedMessage
defaultMessage="This is some help text for the color field."
id="help-text-m"
values={Object {}}
<HelpText
text="help-text-m"
textDefault="This is some help text for the color field."
/>
}
id="FirstSettings.settingm"
Expand Down Expand Up @@ -586,10 +573,9 @@ exports[`components/admin_console/SchemaAdminSettings should match snapshot with
/>
}
helpText={
<FormattedMessage
defaultMessage="This is some help text for the permissions field."
id="help-text-o"
values={Object {}}
<HelpText
text="help-text-o"
textDefault="This is some help text for the permissions field."
/>
}
id="settingo"
Expand Down
Loading