Skip to content
This repository has been archived by the owner on Jan 3, 2020. It is now read-only.

Commit

Permalink
Make readonly text translatable
Browse files Browse the repository at this point in the history
  • Loading branch information
Andries-Smit committed Jan 4, 2019
1 parent e60c594 commit 6ae9923
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/components/RichText.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export class RichText extends Component<RichTextProps> {
{
className: classNames("widget-rich-text", this.props.className, {
"has-error": !!this.props.alertMessage,
"notranslate": !this.props.translatable,
"notranslate": !this.props.translatable || this.props.readOnlyStyle !== "text",
[ RichText.getReadOnlyClasses(this.props.readOnlyStyle) ]: this.props.readOnly,
"buttons-hidden": this.props.editorOption === "custom" && this.props.customOptions.length === 0,
"ql-snow": this.props.readOnly && this.props.readOnlyStyle === "text"
Expand Down
2 changes: 1 addition & 1 deletion src/components/RichTextContainer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export default class RichTextContainer extends Component<RichTextContainerProps,
className: this.props.class,
style: parseStyle(this.props.style),
sanitizeContent: this.props.sanitizeContent,
translatable: this.props.editable === "never",
translatable: this.props.editable === "never" || this.props.readOnly,
value: this.state.value,
onChange: !readOnly ? this.handleOnChange : undefined,
onBlur: !readOnly ? this.executeOnChangeAction : undefined,
Expand Down
2 changes: 1 addition & 1 deletion src/components/__tests__/RichText.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ describe("RichText", () => {

textEditor = shallowRenderTextEditor(richTextProps);
expect(textEditor).toBeElement(
createElement("div", { className: "widget-rich-text has-error" },
createElement("div", { className: "widget-rich-text notranslate has-error" },
createElement("div", {
style: { whiteSpace: "pre-wrap" },
dangerouslySetInnerHTML: undefined
Expand Down
2 changes: 1 addition & 1 deletion src/package.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<package xmlns="http://www.mendix.com/package/1.0/">
<clientModule name="RichText" version="1.3.0" xmlns="http://www.mendix.com/clientModule/1.0/">
<clientModule name="RichText" version="1.3.1" xmlns="http://www.mendix.com/clientModule/1.0/">
<widgetFiles>
<widgetFile path="RichText.xml"/>
</widgetFiles>
Expand Down

0 comments on commit 6ae9923

Please sign in to comment.