M: Minor UI improvements

This commit is contained in:
Ivan 2025-08-26 13:59:16 +03:00
parent c634ae9700
commit 9f1aa2b4a8
6 changed files with 21 additions and 12 deletions

View File

@ -48,6 +48,10 @@ export function ToolbarSearch({ className, total, filtered }: ToolbarSearchProps
return items.some(item => item.owner === userID); return items.some(item => item.owner === userID);
} }
function handleSelectUser(userID: number | null) {
setFilterUser(userID);
}
return ( return (
<div className={cn('flex gap-3 border-b text-sm bg-input items-center', className)}> <div className={cn('flex gap-3 border-b text-sm bg-input items-center', className)}>
<div className='ml-3 min-w-18 sm:min-w-30 select-none whitespace-nowrap'> <div className='ml-3 min-w-18 sm:min-w-30 select-none whitespace-nowrap'>
@ -73,7 +77,7 @@ export function ToolbarSearch({ className, total, filtered }: ToolbarSearchProps
icon={<IconUserSearch size='1.25rem' className={userActive ? 'icon-green' : 'icon-primary'} />} icon={<IconUserSearch size='1.25rem' className={userActive ? 'icon-green' : 'icon-primary'} />}
onClick={userMenu.toggle} onClick={userMenu.toggle}
/> />
<Dropdown isOpen={userMenu.isOpen}> <Dropdown isOpen={userMenu.isOpen} margin='mt-1'>
<DropdownButton <DropdownButton
text='Я - Владелец' text='Я - Владелец'
title='Фильтровать схемы, в которых текущий пользователь является владельцем' title='Фильтровать схемы, в которых текущий пользователь является владельцем'
@ -93,7 +97,7 @@ export function ToolbarSearch({ className, total, filtered }: ToolbarSearchProps
className='min-w-60 mx-1 mb-1 cc-hover-bg select-none' className='min-w-60 mx-1 mb-1 cc-hover-bg select-none'
filter={filterNonEmptyUsers} filter={filterNonEmptyUsers}
value={filterUser} value={filterUser}
onChange={setFilterUser} onChange={handleSelectUser}
/> />
</Dropdown> </Dropdown>
</div> </div>

View File

@ -27,7 +27,7 @@ export function SelectParent({ fullWidth, ...restProps }: SelectParentProps) {
size='2rem' size='2rem'
className='text-primary min-w-8' className='text-primary min-w-8'
data-tooltip-id={globalIDs.tooltip} data-tooltip-id={globalIDs.tooltip}
data-tooltip-content='Родительский блок содержания' data-tooltip-content='Родительский блок'
/> />
<SelectBlock className={fullWidth ? 'grow' : 'w-70'} {...restProps} /> <SelectBlock className={fullWidth ? 'grow' : 'w-70'} {...restProps} />
</div> </div>

View File

@ -74,11 +74,11 @@ export function DlgCreateSchema() {
return ( return (
<ModalForm <ModalForm
header='Создание операции: Пустая КС' header='Создание операции: Новая схема'
submitText='Создать' submitText='Создать'
canSubmit={isValid} canSubmit={isValid}
onSubmit={event => void handleSubmit(onSubmit)(event)} onSubmit={event => void handleSubmit(onSubmit)(event)}
className='w-180 px-6 cc-column' className='w-180 px-6 pb-3 cc-column'
helpTopic={HelpTopic.CC_OSS} helpTopic={HelpTopic.CC_OSS}
> >
<TextInput <TextInput
@ -88,7 +88,7 @@ export function DlgCreateSchema() {
error={errors.item_data?.title} error={errors.item_data?.title}
/> />
<div className='flex gap-6'> <div className='flex gap-6'>
<div className='grid gap-1'> <div className='flex flex-col justify-between gap-3'>
<TextInput <TextInput
id='operation_alias' // id='operation_alias' //
label='Сокращение' label='Сокращение'
@ -113,7 +113,7 @@ export function DlgCreateSchema() {
id='operation_comment' // id='operation_comment' //
label='Описание' label='Описание'
noResize noResize
rows={3} rows={4}
{...register('item_data.description')} {...register('item_data.description')}
/> />
</div> </div>

View File

@ -102,7 +102,7 @@ export function DlgImportSchema() {
submitText='Создать' submitText='Создать'
canSubmit={isValid} canSubmit={isValid}
onSubmit={event => void handleSubmit(onSubmit)(event)} onSubmit={event => void handleSubmit(onSubmit)(event)}
className='w-180 px-6 cc-column' className='w-180 px-6 pb-3 cc-column'
helpTopic={HelpTopic.CC_OSS} helpTopic={HelpTopic.CC_OSS}
> >
<Controller <Controller
@ -132,7 +132,7 @@ export function DlgImportSchema() {
error={errors.item_data?.title} error={errors.item_data?.title}
/> />
<div className='flex gap-6'> <div className='flex gap-6'>
<div className='grid gap-1'> <div className='flex flex-col gap-3 justify-between'>
<TextInput <TextInput
id='operation_alias' // id='operation_alias' //
label='Сокращение' label='Сокращение'
@ -157,7 +157,7 @@ export function DlgImportSchema() {
<TextArea <TextArea
id='operation_comment' // id='operation_comment' //
label='Описание' label='Описание'
rows={3} rows={4}
disabled={!clone_source} disabled={!clone_source}
{...register('item_data.description')} {...register('item_data.description')}
/> />

View File

@ -334,7 +334,12 @@ export function OssFlow() {
} }
return ( return (
<div tabIndex={-1} className='relative' onMouseMove={showCoordinates ? handleMouseMove : undefined}> <div
tabIndex={-1}
className='relative'
onMouseMove={showCoordinates ? handleMouseMove : undefined}
onKeyDown={handleKeyDown}
>
{showCoordinates ? <CoordinateDisplay mouseCoords={mouseCoords} className='absolute top-1 right-2' /> : null} {showCoordinates ? <CoordinateDisplay mouseCoords={mouseCoords} className='absolute top-1 right-2' /> : null}
<ContextMenu isOpen={isContextMenuOpen} onHide={hideContextMenu} {...menuProps} /> <ContextMenu isOpen={isContextMenuOpen} onHide={hideContextMenu} {...menuProps} />
@ -356,7 +361,6 @@ export function OssFlow() {
{...flowOptions} {...flowOptions}
className={clsx(!containMovement && 'cursor-relocate')} className={clsx(!containMovement && 'cursor-relocate')}
height={mainHeight} height={mainHeight}
onKeyDown={handleKeyDown}
nodes={nodes} nodes={nodes}
edges={edges} edges={edges}
onNodesChange={onNodesChange} onNodesChange={onNodesChange}

View File

@ -43,6 +43,7 @@ export function SelectUser({ filter, noAnonymous, placeholder = 'Выбор по
<ComboBox <ComboBox
items={sorted} items={sorted}
placeholder={placeholder} placeholder={placeholder}
clearable={true}
idFunc={user => String(user)} idFunc={user => String(user)}
labelValueFunc={user => getUserLabel(user)} labelValueFunc={user => getUserLabel(user)}
labelOptionFunc={user => getUserLabel(user)} labelOptionFunc={user => getUserLabel(user)}