From e3b20551d50f7004c07fae4118b91e46d693cf17 Mon Sep 17 00:00:00 2001 From: Ivan <8611739+IRBorisov@users.noreply.github.com> Date: Tue, 29 Jul 2025 15:28:30 +0300 Subject: [PATCH] F: Wire crucial attribute for frontend --- .../apps/library/tests/s_views/t_versions.py | 5 +- .../src/components/control/text-button.tsx | 37 ++++++++++++ .../src/components/control/text-url.tsx | 2 +- .../features/help/items/ui/help-rseditor.tsx | 4 +- .../side-panel/toolbar-schema.tsx | 2 + .../src/features/rsform/backend/types.ts | 5 +- .../src/features/rsform/models/rsform.ts | 1 + .../editor-constituenta.tsx | 2 +- .../editor-constituenta/form-constituenta.tsx | 59 +++++++++---------- .../editor-rsexpression/status-bar.tsx | 8 +-- .../rsform/pages/rsform-page/rsedit-state.tsx | 2 + rsconcept/frontend/src/styling/utilities.css | 6 ++ 12 files changed, 90 insertions(+), 43 deletions(-) create mode 100644 rsconcept/frontend/src/components/control/text-button.tsx diff --git a/rsconcept/backend/apps/library/tests/s_views/t_versions.py b/rsconcept/backend/apps/library/tests/s_views/t_versions.py index 5dab6978..25508aaa 100644 --- a/rsconcept/backend/apps/library/tests/s_views/t_versions.py +++ b/rsconcept/backend/apps/library/tests/s_views/t_versions.py @@ -84,15 +84,18 @@ class TestVersionViews(EndpointTester): alias='A1', cst_type='axiom', definition_formal='X1=X1', - order=1 + order=1, + crucial=True ) version_id = self._create_version({'version': '1.0.0', 'description': 'test'}) a1.definition_formal = 'X1=X2' + a1.crucial = False a1.save() response = self.executeOK(schema=self.owned_id, version=version_id) loaded_a1 = response.data['items'][1] self.assertEqual(loaded_a1['definition_formal'], 'X1=X1') + self.assertEqual(loaded_a1['crucial'], True) self.assertEqual(loaded_a1['parse']['status'], 'verified') diff --git a/rsconcept/frontend/src/components/control/text-button.tsx b/rsconcept/frontend/src/components/control/text-button.tsx new file mode 100644 index 00000000..b941caba --- /dev/null +++ b/rsconcept/frontend/src/components/control/text-button.tsx @@ -0,0 +1,37 @@ +import { globalIDs } from '@/utils/constants'; + +import { type Button as ButtonStyle } from '../props'; +import { cn } from '../utils'; + +interface TextButtonProps extends ButtonStyle { + /** Text to display second. */ + text: string; +} + +/** + * Customizable `button` with text, transparent background and no additional styling. + */ +export function TextButton({ text, title, titleHtml, hideTitle, className, ...restProps }: TextButtonProps) { + return ( + + ); +} diff --git a/rsconcept/frontend/src/components/control/text-url.tsx b/rsconcept/frontend/src/components/control/text-url.tsx index b4d11e62..05b5916b 100644 --- a/rsconcept/frontend/src/components/control/text-url.tsx +++ b/rsconcept/frontend/src/components/control/text-url.tsx @@ -30,7 +30,7 @@ export function TextURL({ text, href, title, color = 'text-primary', onClick }: ); } else if (onClick) { return ( - ); diff --git a/rsconcept/frontend/src/features/help/items/ui/help-rseditor.tsx b/rsconcept/frontend/src/features/help/items/ui/help-rseditor.tsx index f142f02c..4f1e29a4 100644 --- a/rsconcept/frontend/src/features/help/items/ui/help-rseditor.tsx +++ b/rsconcept/frontend/src/features/help/items/ui/help-rseditor.tsx @@ -2,7 +2,6 @@ import { IconChild, IconClone, IconDestroy, - IconEdit, IconFilter, IconGraphSelection, IconKeyboard, @@ -114,8 +113,7 @@ export function HelpRSEditor() {

Термин и Текстовое определение