From 8861ec537814c6dded22d607f8fcda96d310b425 Mon Sep 17 00:00:00 2001 From: IRBorisov <8611739+IRBorisov@users.noreply.github.com> Date: Sat, 22 Jul 2023 03:18:48 +0300 Subject: [PATCH] Improve Consistuenta editing experience --- .../src/components/Common/SubmitButton.tsx | 8 +- rsconcept/frontend/src/components/Icons.tsx | 8 + .../pages/RSFormPage/ConstituentEditor.tsx | 64 ++++-- .../pages/RSFormPage/ConstituentsSideList.tsx | 42 +++- .../pages/RSFormPage/ConstituentsTable.tsx | 2 +- .../src/pages/RSFormPage/ExpressionEditor.tsx | 154 +++++++++---- .../src/pages/RSFormPage/RSFormCard.tsx | 9 +- .../src/pages/RSFormPage/RSLocalButton.tsx | 25 +++ .../{RSEditButton.tsx => RSTokenButton.tsx} | 10 +- .../src/pages/RSFormPage/TablistTools.tsx | 4 +- .../src/pages/RSFormPage/textEditing.ts | 212 ++++++++++++++++++ rsconcept/frontend/src/utils/staticUI.ts | 54 ++--- rsconcept/frontend/src/utils/textEditing.ts | 118 ---------- 13 files changed, 473 insertions(+), 237 deletions(-) create mode 100644 rsconcept/frontend/src/pages/RSFormPage/RSLocalButton.tsx rename rsconcept/frontend/src/pages/RSFormPage/{RSEditButton.tsx => RSTokenButton.tsx} (75%) create mode 100644 rsconcept/frontend/src/pages/RSFormPage/textEditing.ts delete mode 100644 rsconcept/frontend/src/utils/textEditing.ts diff --git a/rsconcept/frontend/src/components/Common/SubmitButton.tsx b/rsconcept/frontend/src/components/Common/SubmitButton.tsx index 7bd1a150..689b2cf3 100644 --- a/rsconcept/frontend/src/components/Common/SubmitButton.tsx +++ b/rsconcept/frontend/src/components/Common/SubmitButton.tsx @@ -2,15 +2,17 @@ interface SubmitButtonProps { text: string loading?: boolean disabled?: boolean + icon?: React.ReactNode } -function SubmitButton({text='ОК', disabled, loading=false}: SubmitButtonProps) { +function SubmitButton({text='ОК', icon, disabled, loading=false}: SubmitButtonProps) { return ( ) } diff --git a/rsconcept/frontend/src/components/Icons.tsx b/rsconcept/frontend/src/components/Icons.tsx index 3cb0068e..70efa8bf 100644 --- a/rsconcept/frontend/src/components/Icons.tsx +++ b/rsconcept/frontend/src/components/Icons.tsx @@ -274,4 +274,12 @@ export function ArrowsRotateIcon(props: IconProps) { ); +} + +export function SaveIcon(props: IconProps) { + return ( + + + + ); } \ No newline at end of file diff --git a/rsconcept/frontend/src/pages/RSFormPage/ConstituentEditor.tsx b/rsconcept/frontend/src/pages/RSFormPage/ConstituentEditor.tsx index 30b6f190..d8ee6b2a 100644 --- a/rsconcept/frontend/src/pages/RSFormPage/ConstituentEditor.tsx +++ b/rsconcept/frontend/src/pages/RSFormPage/ConstituentEditor.tsx @@ -7,6 +7,7 @@ import ExpressionEditor from './ExpressionEditor'; import SubmitButton from '../../components/Common/SubmitButton'; import { getCstTypeLabel } from '../../utils/staticUI'; import ConstituentsSideList from './ConstituentsSideList'; +import { SaveIcon } from '../../components/Icons'; function ConstituentEditor() { const { @@ -78,27 +79,38 @@ function ConstituentEditor() { return (
-
- - - {alias} - - - - {type} - +
+
+ + + {alias} + + + + {type} + +
+
+ +