Skip to content
Open
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
4 changes: 3 additions & 1 deletion Extensions/Signum.HtmlEditor/HtmlEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import { useController } from "./useController";
import { isEmpty } from "./Utils/editorState";
import { formatCode, formatHeading, formatList, formatQuote } from "./Utils/format";
import { $findMatchingParent, isHeadingActive, isListActive, isQuoteActive } from "./Utils/node";
import { useForceUpdate } from "../../Signum/React/Hooks";

export interface HtmlEditorProps {
binding: IBinding<string | null | undefined>;
Expand Down Expand Up @@ -69,6 +70,7 @@ const HtmlEditor: React.ForwardRefExoticComponent<HtmlEditorProps & React.RefAtt
...props }: HtmlEditorProps,
ref?: React.Ref<HtmlEditorController>
) {
const forceUpdate = useForceUpdate();
const id = React.useMemo(() => createUid(), []);
const editableId = "editable_" + id;
const { controller, nodes, builtinComponents } = useController({
Expand Down Expand Up @@ -133,7 +135,7 @@ const HtmlEditor: React.ForwardRefExoticComponent<HtmlEditorProps & React.RefAtt
}
ErrorBoundary={LexicalErrorBoundary}
/>
<EditorRefPlugin editorRef={controller.setRefs} />
<EditorRefPlugin editorRef={comp => { controller.setRefs(comp); if (comp) forceUpdate(); }} />
{builtinComponents.map(({ component: Component, props }) => <Component key={Component.name} {...props} />)}
</LexicalComposer>
</div>
Expand Down
4 changes: 3 additions & 1 deletion Extensions/Signum.Mailing/Templates/EmailTemplateLogic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -261,9 +261,11 @@ static void EmailTemplate_PreSaving(EmailTemplateEntity template, PreSavingConte
}
}

public static Func<Lite<EmailTemplateEntity>, EmailTemplateEntity> GetEmailTemplate = liteTemplate => EmailTemplatesLazy.Value.GetOrThrow(liteTemplate, "Email template {0} not in cache".FormatWith(liteTemplate));

public static IEnumerable<EmailMessageEntity> CreateEmailMessage(this Lite<EmailTemplateEntity> liteTemplate, ModifiableEntity? modifiableEntity = null, IEmailModel? model = null, CultureInfo? cultureInfo = null)
{
EmailTemplateEntity template = EmailTemplatesLazy.Value.GetOrThrow(liteTemplate, "Email template {0} not in cache".FormatWith(liteTemplate));
EmailTemplateEntity template = GetEmailTemplate(liteTemplate);

return CreateEmailMessage(template, modifiableEntity, ref model, cultureInfo);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ export function TranslatedInstance(p: { ins: TranslatedInstanceClient.Translated
<td className="leftCell">{c}</td>
<td className="monospaceCell">
{p.currentCulture == null || p.currentCulture == c ?
<TextArea style={{ height: "24px", width: "90%" }} minHeight="24px" value={pair?.translatedText ?? ""}
<TextArea style={{ height: "24px", width: "90%" }} autoResize={true} minHeight="24px" value={pair?.translatedText ?? ""}
onChange={handleChange}
onBlur={handleChange} /> :

Expand Down