From dca7a68175ccf3f0a4e406ba203aa68dc6957727 Mon Sep 17 00:00:00 2001 From: Aleix Date: Tue, 15 Nov 2022 09:28:20 +0100 Subject: [PATCH] Use editor component in the description field of a workshop (#694) * Use editor component in the description field of a workshop * fixup! Use editor component in the description field of a workshop * Increase hash size to avoid collisions --- .../ui/src/app/Catalog/CatalogItemForm.tsx | 25 +++++++++++++------ catalog/ui/src/app/Services/service-utils.ts | 2 +- .../app/Workshops/WorkshopsItemDetails.tsx | 4 +-- .../app/Workshops/WorkshopsItemServices.tsx | 2 +- .../ui/src/app/components/Editor/Editor.tsx | 18 ++++++++++--- .../app/components/Editor/EditorViewer.tsx | 17 +++++++++++-- catalog/ui/webpack.common.js | 4 +-- catalog/ui/webpack.prod.js | 4 +-- 8 files changed, 55 insertions(+), 21 deletions(-) diff --git a/catalog/ui/src/app/Catalog/CatalogItemForm.tsx b/catalog/ui/src/app/Catalog/CatalogItemForm.tsx index c682ef867..2ee96bdeb 100644 --- a/catalog/ui/src/app/Catalog/CatalogItemForm.tsx +++ b/catalog/ui/src/app/Catalog/CatalogItemForm.tsx @@ -1,6 +1,7 @@ import React, { useEffect, useMemo, useReducer, useState } from 'react'; import { useNavigate, useParams } from 'react-router-dom'; import parseDuration from 'parse-duration'; +import { EditorState } from 'lexical/LexicalEditorState'; import { ActionList, ActionListItem, @@ -19,7 +20,6 @@ import { SelectOption, SelectVariant, Switch, - TextArea, TextInput, Title, Tooltip, @@ -43,6 +43,7 @@ import { CatalogItem } from '@app/types'; import { ErrorBoundary } from 'react-error-boundary'; import { displayName, isLabDeveloper, randomString } from '@app/util'; import DateTimePicker from '@app/components/DateTimePicker'; +import Editor from '@app/components/Editor/Editor'; import useSession from '@app/utils/useSession'; import useDebounce from '@app/utils/useDebounce'; import PatientNumberInput from '@app/components/PatientNumberInput'; @@ -418,16 +419,24 @@ const CatalogItemFormData: React.FC<{ namespace: string; catalogItemName: string
-