Обходной лист (#12)
Tests / backend-test (push) Successful in 1m38s
Tests / frontend-test (push) Successful in 47s

Co-authored-by: gorbenko.pavel <gorbenko.pavel@tansu.kz>
Reviewed-on: http://git.tnsu.kz/gorbenko.pavel/tnsu-approval-route/pulls/12
This commit was merged in pull request #12.
This commit is contained in:
2026-08-17 05:43:52 +00:00
parent d076f4e98d
commit 48ede1420d
37 changed files with 1351 additions and 435 deletions
@@ -9,6 +9,10 @@ export interface IFormModalProps {
/** Текст ошибки: и валидации формы, и ответа бэкенда. */
error?: string;
isSaving: boolean;
/** Подпись кнопки подтверждения — по умолчанию «Сохранить» (см. копирование маршрута). */
submitLabel?: string;
/** Подпись той же кнопки во время запроса — по умолчанию «Сохранение...». */
savingLabel?: string;
onSubmit: () => void;
onClose: () => void;
children: React.ReactNode;
@@ -18,7 +22,16 @@ export interface IFormModalProps {
* Модальное окно формы: одинаковая обвязка «ошибка сверху, Отмена/Сохранить снизу»
* для всех справочников, чтобы экраны описывали только поля.
*/
export const FormModal: React.FC<IFormModalProps> = ({ title, error, isSaving, onSubmit, onClose, children }) => (
export const FormModal: React.FC<IFormModalProps> = ({
title,
error,
isSaving,
submitLabel = texts.common.save,
savingLabel = texts.common.saving,
onSubmit,
onClose,
children
}) => (
<Modal
title={title}
onClose={onClose}
@@ -26,7 +39,7 @@ export const FormModal: React.FC<IFormModalProps> = ({ title, error, isSaving, o
<>
<Button variant="secondary" onClick={onClose} disabled={isSaving}>{texts.common.cancel}</Button>
<Button variant="accent" icon="check" onClick={onSubmit} disabled={isSaving}>
{isSaving ? texts.common.saving : texts.common.save}
{isSaving ? savingLabel : submitLabel}
</Button>
</>
}