diff --git a/rsconcept/frontend/src/components/Common/Form.tsx b/rsconcept/frontend/src/components/Common/Form.tsx index 8290359d..490bcb93 100644 --- a/rsconcept/frontend/src/components/Common/Form.tsx +++ b/rsconcept/frontend/src/components/Common/Form.tsx @@ -1,5 +1,5 @@ interface FormProps { - title: string + title?: string dimensions?: string onSubmit: (event: React.FormEvent) => void children: React.ReactNode diff --git a/rsconcept/frontend/src/components/Help/HelpConstituenta.tsx b/rsconcept/frontend/src/components/Help/HelpConstituenta.tsx index 629f27b2..8151c50d 100644 --- a/rsconcept/frontend/src/components/Help/HelpConstituenta.tsx +++ b/rsconcept/frontend/src/components/Help/HelpConstituenta.tsx @@ -3,20 +3,20 @@ import InfoCstStatus from './InfoCstStatus'; function HelpConstituenta() { return ( -
+

Подсказки

-

Изменения сохраняются ПОСЛЕ нажатия на соответствующую кнопку снизу или по центру

-

Формальное определение - обратите внимание на кнопки снизу
Горячие клавиши указаны в подсказках при наведении

-

Поля Термин и Определение - Ctrl + Пробел открывает диалог редактирования отсылок
Перед открытием диалога переместите текстовый курсор на заменяемое слово или ссылку

-

Список конституент справа - обратите внимание на настройки фильтрации

-

- слева от ввода текста настраивается набор атрибутов конституенты

-

- справа от ввода текста настраивается список конституент, которые фильтруются

+

Сохранить изменения: Ctrl + S или клик по кнопке Сохранить

+

Формальное определение: обратите внимание на кнопки снизу
Горячие клавиши указаны в подсказках при наведении

+

Поля Термин и Определение: Ctrl + Пробел открывает диалог редактирования отсылок
Перед открытием диалога переместите текстовый курсор на заменяемое слово или ссылку

+

Список конституент справа: обратите внимание на настройки фильтрации

+

- первая настройка - атрибуты конституенты

+

- вторая настройка - принцип отбора конституент по графу термов

- текущая конституента выделена цветом строки

- двойной клик / Alt + клик - выбор редактируемой конституенты

-

- при наведении на ID конституенты отображаются ее атрибуты

+

- при наведении на имя конституенты отображаются ее атрибуты

- столбец "Описание" содержит один из непустых текстовых атрибутов

- +
); diff --git a/rsconcept/frontend/src/components/Help/HelpRSFormMeta.tsx b/rsconcept/frontend/src/components/Help/HelpRSFormMeta.tsx index 1cb5f2b2..9d19e8f7 100644 --- a/rsconcept/frontend/src/components/Help/HelpRSFormMeta.tsx +++ b/rsconcept/frontend/src/components/Help/HelpRSFormMeta.tsx @@ -2,6 +2,7 @@ function HelpRSFormMeta() { return (

Паспорт схемы

+

Сохранить изменения: Ctrl + S или клик по кнопке Сохранить

Владелец - пользователь, обладающий правом редактирования

Для общедоступных схем владельцем может стать любой пользователь

Для неизменных схем правом редактирования обладают только администраторы

diff --git a/rsconcept/frontend/src/components/Help/InfoCstClass.tsx b/rsconcept/frontend/src/components/Help/InfoCstClass.tsx index 9c9b94d5..b30468b7 100644 --- a/rsconcept/frontend/src/components/Help/InfoCstClass.tsx +++ b/rsconcept/frontend/src/components/Help/InfoCstClass.tsx @@ -19,7 +19,7 @@ function InfoCstClass({ title }: InfoCstClassProps) { return (

{labelCstClass(cclass)} diff --git a/rsconcept/frontend/src/components/Help/InfoCstStatus.tsx b/rsconcept/frontend/src/components/Help/InfoCstStatus.tsx index 41429fad..9cc47787 100644 --- a/rsconcept/frontend/src/components/Help/InfoCstStatus.tsx +++ b/rsconcept/frontend/src/components/Help/InfoCstStatus.tsx @@ -21,7 +21,7 @@ function InfoCstStatus({ title }: InfoCstStatusProps) { return (

{labelExpressionStatus(status)} diff --git a/rsconcept/frontend/src/components/RSInput/index.tsx b/rsconcept/frontend/src/components/RSInput/index.tsx index a5bf1cb9..7ad1d681 100644 --- a/rsconcept/frontend/src/components/RSInput/index.tsx +++ b/rsconcept/frontend/src/components/RSInput/index.tsx @@ -104,29 +104,24 @@ function RSInput({ if (event.key === '*') { text.insertToken(TokenID.DECART); event.preventDefault(); - return; - } - if (event.code === 'KeyB') { + } else if (event.code === 'KeyB') { text.insertChar('ℬ'); event.preventDefault(); - return; + } else if (event.code === 'KeyZ') { + text.insertChar('Z'); + event.preventDefault(); } - } - - if (event.altKey) { - if (!text.processAltKey(event.code, event.shiftKey)) { - return; + } else if (event.altKey) { + if (text.processAltKey(event.code, event.shiftKey)) { + event.preventDefault(); } } else if (!event.ctrlKey) { const newSymbol = getSymbolSubstitute(event.code, event.shiftKey); - if (!newSymbol) { - return; + if (newSymbol) { + text.replaceWith(newSymbol); + event.preventDefault(); } - text.replaceWith(newSymbol); - } else { - return; } - event.preventDefault(); }, [thisRef]); return ( diff --git a/rsconcept/frontend/src/pages/LoginPage.tsx b/rsconcept/frontend/src/pages/LoginPage.tsx index eb219726..07a6dd9e 100644 --- a/rsconcept/frontend/src/pages/LoginPage.tsx +++ b/rsconcept/frontend/src/pages/LoginPage.tsx @@ -66,7 +66,7 @@ function LoginPage() { } return ( -

+
{ user &&

{`Вы вошли в систему как ${user.username}`}

@@ -87,10 +87,13 @@ function LoginPage() {
} { !user &&
+ Концепт Портал setPassword(event.target.value)} /> -
+
activeCst && isEditable, [activeCst, isEditable]); @@ -77,7 +78,7 @@ function EditorConstituenta({ setExpression(activeCst.definition_formal || ''); setTypification(activeCst ? labelCstTypification(activeCst) : 'N/A'); } - }, [activeCst, onOpenEdit, schema]); + }, [activeCst, onOpenEdit, schema, toggleReset]); function handleSubmit(event?: React.FormEvent) { if (event) { @@ -150,8 +151,17 @@ function EditorConstituenta({ onRenameCst(data); } + function handleInput(event: React.KeyboardEvent) { + if (event.ctrlKey && event.code === 'KeyS') { + if (isModified) { + handleSubmit(); + } + event.preventDefault(); + } + } + return ( -
+
@@ -184,6 +194,12 @@ function EditorConstituenta({ icon={} onClick={() => handleSubmit()} /> + setToggleReset(prev => !prev)} + icon={} + /> setExpression(newValue)} setTypification={setTypification} diff --git a/rsconcept/frontend/src/pages/RSFormPage/EditorRSExpression.tsx b/rsconcept/frontend/src/pages/RSFormPage/EditorRSExpression.tsx index bc078f58..5a2b3ca3 100644 --- a/rsconcept/frontend/src/pages/RSFormPage/EditorRSExpression.tsx +++ b/rsconcept/frontend/src/pages/RSFormPage/EditorRSExpression.tsx @@ -24,6 +24,7 @@ interface EditorRSExpressionProps { activeCst?: IConstituenta label: string disabled?: boolean + toggleReset?: boolean placeholder?: string onShowAST: (expression: string, ast: SyntaxTree) => void setTypification: (typificaiton: string) => void @@ -32,7 +33,7 @@ interface EditorRSExpressionProps { } function EditorRSExpression({ - activeCst, disabled, value, onShowAST, + activeCst, disabled, value, onShowAST, toggleReset, setTypification, onChange, ...props }: EditorRSExpressionProps) { const { schema } = useRSForm(); @@ -44,7 +45,7 @@ function EditorRSExpression({ useLayoutEffect(() => { setIsModified(false); resetParse(); - }, [activeCst, resetParse]); + }, [activeCst, resetParse, toggleReset]); function handleChange(newvalue: string) { onChange(newvalue); diff --git a/rsconcept/frontend/src/pages/RSFormPage/EditorRSForm.tsx b/rsconcept/frontend/src/pages/RSFormPage/EditorRSForm.tsx index f7ef19f9..1e02a5c2 100644 --- a/rsconcept/frontend/src/pages/RSFormPage/EditorRSForm.tsx +++ b/rsconcept/frontend/src/pages/RSFormPage/EditorRSForm.tsx @@ -69,8 +69,10 @@ function EditorRSForm({ onDestroy, onClaim, onShare, isModified, setIsModified, } }, [schema]); - const handleSubmit = (event: React.FormEvent) => { - event.preventDefault(); + const handleSubmit = (event?: React.FormEvent) => { + if (event) { + event.preventDefault(); + } const data: IRSFormCreateData = { item_type: LibraryItemType.RSFORM, title: title, @@ -82,8 +84,17 @@ function EditorRSForm({ onDestroy, onClaim, onShare, isModified, setIsModified, update(data, () => toast.success('Изменения сохранены')); }; + function handleInput(event: React.KeyboardEvent) { + if (event.ctrlKey && event.code === 'KeyS') { + if (isModified) { + handleSubmit(); + } + event.preventDefault(); + } + } + return ( -
+
setOldPassword(event.target.value)} /> { setNewPassword(event.target.value); @@ -80,6 +82,7 @@ function EditorPassword() { { setNewPasswordRepeat(event.target.value); diff --git a/rsconcept/frontend/src/pages/UserProfilePage/EditorProfile.tsx b/rsconcept/frontend/src/pages/UserProfilePage/EditorProfile.tsx index 1de38658..5e93062b 100644 --- a/rsconcept/frontend/src/pages/UserProfilePage/EditorProfile.tsx +++ b/rsconcept/frontend/src/pages/UserProfilePage/EditorProfile.tsx @@ -55,17 +55,27 @@ function EditorProfile() { setUsername(event.target.value)} /> setFirstName(event.target.value)} /> - setLastName(event.target.value)}/> - setEmail(event.target.value)}/> + setLastName(event.target.value)} + /> + setEmail(event.target.value)} + />