Merge branch 'groups-note-plain' into 'develop'

Use note_plain on group edit page

See merge request soapbox-pub/soapbox!2482
environments/review-develop-3zknud/deployments/3283
marcin mikołajczak 2023-04-29 13:35:59 +00:00
commit 696e97bb19
2 zmienionych plików z 6 dodań i 3 usunięć

Wyświetl plik

@ -44,7 +44,7 @@ const EditGroup: React.FC<IEditGroup> = ({ params: { groupId } }) => {
const header = useImageField({ maxPixels: 1920 * 1080, preview: nonDefaultHeader(group?.header) });
const displayName = useTextField(group?.display_name);
const note = useTextField(group?.note);
const note = useTextField(group?.note_plain);
const maxName = Number(instance.configuration.getIn(['groups', 'max_characters_name']));
const maxNote = Number(instance.configuration.getIn(['groups', 'max_characters_description']));

Wyświetl plik

@ -29,6 +29,9 @@ const groupSchema = z.object({
note: z.string().transform(note => note === '<p></p>' ? '' : note).catch(''),
relationship: groupRelationshipSchema.nullable().catch(null), // Dummy field to be overwritten later
slug: z.string().catch(''), // TruthSocial
source: z.object({
note: z.string(),
}).optional(), // TruthSocial
statuses_visibility: z.string().catch('public'),
tags: z.array(groupTagSchema).catch([]),
uri: z.string().catch(''),
@ -43,10 +46,10 @@ const groupSchema = z.object({
...group,
display_name_html: emojify(escapeTextContentForBrowser(group.display_name), customEmojiMap),
note_emojified: emojify(group.note, customEmojiMap),
note_plain: unescapeHTML(group.note),
note_plain: group.source?.note || unescapeHTML(group.note),
};
});
type Group = z.infer<typeof groupSchema>;
export { groupSchema, type Group };
export { groupSchema, type Group };