diff --git a/rsconcept/frontend/src/components/Icons.tsx b/rsconcept/frontend/src/components/Icons.tsx index 9ce4274e..d70cd122 100644 --- a/rsconcept/frontend/src/components/Icons.tsx +++ b/rsconcept/frontend/src/components/Icons.tsx @@ -40,7 +40,7 @@ export { LuFolderEdit as IconFolderEdit } from 'react-icons/lu'; export { LuFolderOpen as IconFolderOpened } from 'react-icons/lu'; export { LuFolderClosed as IconFolderClosed } from 'react-icons/lu'; export { LuFolderDot as IconFolderEmpty } from 'react-icons/lu'; -export { LuLightbulb as IconHelp } from 'react-icons/lu'; +export { TbHelpOctagon as IconHelp } from 'react-icons/tb'; export { LuLightbulbOff as IconHelpOff } from 'react-icons/lu'; export { RiPushpinFill as IconPin } from 'react-icons/ri'; export { RiUnpinLine as IconUnpin } from 'react-icons/ri'; diff --git a/rsconcept/frontend/src/components/info/BadgeHelp.tsx b/rsconcept/frontend/src/components/info/BadgeHelp.tsx index 16bafee4..74ff106c 100644 --- a/rsconcept/frontend/src/components/info/BadgeHelp.tsx +++ b/rsconcept/frontend/src/components/info/BadgeHelp.tsx @@ -1,5 +1,3 @@ -import clsx from 'clsx'; - import TextURL from '@/components/ui/TextURL'; import Tooltip, { PlacesType } from '@/components/ui/Tooltip'; import { useConceptOptions } from '@/context/ConceptOptionsContext'; @@ -16,14 +14,14 @@ interface BadgeHelpProps extends CProps.Styling { place?: PlacesType; } -function BadgeHelp({ topic, padding, ...restProps }: BadgeHelpProps) { +function BadgeHelp({ topic, padding = 'p-1', ...restProps }: BadgeHelpProps) { const { showHelp } = useConceptOptions(); if (!showHelp) { return null; } return ( -
+
event.stopPropagation()}> diff --git a/rsconcept/frontend/src/components/select/PickConstituenta.tsx b/rsconcept/frontend/src/components/select/PickConstituenta.tsx index c8f610a4..b1080b07 100644 --- a/rsconcept/frontend/src/components/select/PickConstituenta.tsx +++ b/rsconcept/frontend/src/components/select/PickConstituenta.tsx @@ -92,7 +92,7 @@ function PickConstituenta({
setFilterText(newValue)} diff --git a/rsconcept/frontend/src/components/ui/Modal.tsx b/rsconcept/frontend/src/components/ui/Modal.tsx index a76e3317..cb8b7aae 100644 --- a/rsconcept/frontend/src/components/ui/Modal.tsx +++ b/rsconcept/frontend/src/components/ui/Modal.tsx @@ -5,10 +5,13 @@ import { motion } from 'framer-motion'; import { useRef } from 'react'; import useEscapeKey from '@/hooks/useEscapeKey'; +import { HelpTopic } from '@/models/miscellaneous'; import { animateModal } from '@/styling/animations'; +import { PARAMETER } from '@/utils/constants'; import { prepareTooltip } from '@/utils/labels'; import { IconClose } from '../Icons'; +import BadgeHelp from '../info/BadgeHelp'; import { CProps } from '../props'; import Button from './Button'; import MiniButton from './MiniButton'; @@ -27,21 +30,30 @@ export interface ModalProps extends CProps.Styling { beforeSubmit?: () => boolean; onSubmit?: () => void; onCancel?: () => void; + + helpTopic?: HelpTopic; + hideHelpWhen?: () => boolean; } function Modal({ + children, + header, + submitText = 'Продолжить', + submitInvalidTooltip, + + readonly, + canSubmit, + overflowVisible, + hideWindow, beforeSubmit, onSubmit, - readonly, onCancel, - canSubmit, - submitInvalidTooltip, className, - children, - overflowVisible, - submitText = 'Продолжить', + + helpTopic, + hideHelpWhen, ...restProps }: React.PropsWithChildren) { const ref = useRef(null); @@ -61,7 +73,7 @@ function Modal({ }; return ( -
+
+ {helpTopic && !hideHelpWhen?.() ? ( + + + + ) : null} {header ?

{header}

: null} diff --git a/rsconcept/frontend/src/dialogs/DlgConstituentaTemplate/DlgConstituentaTemplate.tsx b/rsconcept/frontend/src/dialogs/DlgConstituentaTemplate/DlgConstituentaTemplate.tsx index 29efa99c..32404eb5 100644 --- a/rsconcept/frontend/src/dialogs/DlgConstituentaTemplate/DlgConstituentaTemplate.tsx +++ b/rsconcept/frontend/src/dialogs/DlgConstituentaTemplate/DlgConstituentaTemplate.tsx @@ -4,9 +4,7 @@ import clsx from 'clsx'; import { useLayoutEffect, useMemo, useState } from 'react'; import { TabList, TabPanel, Tabs } from 'react-tabs'; -import BadgeHelp from '@/components/info/BadgeHelp'; import Modal, { ModalProps } from '@/components/ui/Modal'; -import Overlay from '@/components/ui/Overlay'; import TabLabel from '@/components/ui/TabLabel'; import AnimateFade from '@/components/wrap/AnimateFade'; import { useLibrary } from '@/context/LibraryContext'; @@ -15,7 +13,6 @@ import { HelpTopic } from '@/models/miscellaneous'; import { CstType, ICstCreateData, IRSForm } from '@/models/rsform'; import { generateAlias, validateNewAlias } from '@/models/rsformAPI'; import { inferTemplatedType, substituteTemplateArgs } from '@/models/rslangAPI'; -import { PARAMETER } from '@/utils/constants'; import { prompts } from '@/utils/labels'; import FormCreateCst from '../DlgCreateCst/FormCreateCst'; @@ -165,14 +162,8 @@ function DlgConstituentaTemplate({ hideWindow, schema, onCreate, insertAfter }: canSubmit={validated} beforeSubmit={handlePrompt} onSubmit={handleSubmit} + helpTopic={HelpTopic.RSL_TEMPLATES} > - - - - - - - { target: IOperation; @@ -34,15 +31,8 @@ function DlgDeleteOperation({ hideWindow, target, onSubmit }: DlgDeleteOperation canSubmit={true} onSubmit={handleSubmit} className={clsx('w-[35rem]', 'pb-3 px-6 cc-column', 'select-none')} + helpTopic={HelpTopic.CC_PROPAGATION} > - - - - activeTab !== TabID.SUBSTITUTION} > - - - - - - - - - - - -