From 02bb6bf34a904d2a0597ccd05a4c387dbe2a2f95 Mon Sep 17 00:00:00 2001 From: Ben Stoltz Date: Fri, 8 Dec 2023 09:40:07 -0500 Subject: [PATCH] feat: initiative/project description fields are rich text (#1355) * feat: initiative/project description fields are rich text * feat: fix tests --- .../src/initiatives/_internal/InitiativeUiSchemaEdit.ts | 4 +++- .../common/src/projects/_internal/ProjectUiSchemaEdit.ts | 4 +++- .../initiatives/_internal/InitiativeUiSchemaEdit.test.ts | 8 ++++++-- .../test/projects/_internal/ProjectUiSchemaEdit.test.ts | 8 ++++++-- 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/packages/common/src/initiatives/_internal/InitiativeUiSchemaEdit.ts b/packages/common/src/initiatives/_internal/InitiativeUiSchemaEdit.ts index d300b8a76e0..17793ed0c9d 100644 --- a/packages/common/src/initiatives/_internal/InitiativeUiSchemaEdit.ts +++ b/packages/common/src/initiatives/_internal/InitiativeUiSchemaEdit.ts @@ -74,11 +74,13 @@ export const buildUiSchema = async ( scope: "/properties/description", type: "Control", options: { - control: "hub-field-input-input", + control: "hub-field-input-rich-text", type: "textarea", helperText: { labelKey: `${i18nScope}.fields.description.helperText`, }, + toolbar: + "heading,|,bold,italic,blockQuote,removeFormat,link,|,bulletedList,numberedList,alignment,outdent,indent,|,undo,redo", }, }, { diff --git a/packages/common/src/projects/_internal/ProjectUiSchemaEdit.ts b/packages/common/src/projects/_internal/ProjectUiSchemaEdit.ts index 85d89cc88a4..a6652d825b0 100644 --- a/packages/common/src/projects/_internal/ProjectUiSchemaEdit.ts +++ b/packages/common/src/projects/_internal/ProjectUiSchemaEdit.ts @@ -74,11 +74,13 @@ export const buildUiSchema = async ( scope: "/properties/description", type: "Control", options: { - control: "hub-field-input-input", + control: "hub-field-input-rich-text", type: "textarea", helperText: { labelKey: `${i18nScope}.fields.description.helperText`, }, + toolbar: + "heading,|,bold,italic,blockQuote,removeFormat,link,|,bulletedList,numberedList,alignment,outdent,indent,|,undo,redo", }, }, { diff --git a/packages/common/test/initiatives/_internal/InitiativeUiSchemaEdit.test.ts b/packages/common/test/initiatives/_internal/InitiativeUiSchemaEdit.test.ts index 4cceb73d6f5..732de5cc7aa 100644 --- a/packages/common/test/initiatives/_internal/InitiativeUiSchemaEdit.test.ts +++ b/packages/common/test/initiatives/_internal/InitiativeUiSchemaEdit.test.ts @@ -92,11 +92,13 @@ describe("buildUiSchema: initiative edit", () => { scope: "/properties/description", type: "Control", options: { - control: "hub-field-input-input", + control: "hub-field-input-rich-text", type: "textarea", helperText: { labelKey: "some.scope.fields.description.helperText", }, + toolbar: + "heading,|,bold,italic,blockQuote,removeFormat,link,|,bulletedList,numberedList,alignment,outdent,indent,|,undo,redo", }, }, { @@ -378,11 +380,13 @@ describe("buildUiSchema: initiative edit", () => { scope: "/properties/description", type: "Control", options: { - control: "hub-field-input-input", + control: "hub-field-input-rich-text", type: "textarea", helperText: { labelKey: "some.scope.fields.description.helperText", }, + toolbar: + "heading,|,bold,italic,blockQuote,removeFormat,link,|,bulletedList,numberedList,alignment,outdent,indent,|,undo,redo", }, }, { diff --git a/packages/common/test/projects/_internal/ProjectUiSchemaEdit.test.ts b/packages/common/test/projects/_internal/ProjectUiSchemaEdit.test.ts index e42c774eded..c60011e3c37 100644 --- a/packages/common/test/projects/_internal/ProjectUiSchemaEdit.test.ts +++ b/packages/common/test/projects/_internal/ProjectUiSchemaEdit.test.ts @@ -91,11 +91,13 @@ describe("buildUiSchema: project edit", () => { scope: "/properties/description", type: "Control", options: { - control: "hub-field-input-input", + control: "hub-field-input-rich-text", type: "textarea", helperText: { labelKey: "some.scope.fields.description.helperText", }, + toolbar: + "heading,|,bold,italic,blockQuote,removeFormat,link,|,bulletedList,numberedList,alignment,outdent,indent,|,undo,redo", }, }, { @@ -363,11 +365,13 @@ describe("buildUiSchema: project edit", () => { scope: "/properties/description", type: "Control", options: { - control: "hub-field-input-input", + control: "hub-field-input-rich-text", type: "textarea", helperText: { labelKey: "some.scope.fields.description.helperText", }, + toolbar: + "heading,|,bold,italic,blockQuote,removeFormat,link,|,bulletedList,numberedList,alignment,outdent,indent,|,undo,redo", }, }, {