Skip to content

Commit 73e6657

Browse files
committed
refactor(37943): fix layout
1 parent 83fe6d3 commit 73e6657

File tree

3 files changed

+52
-48
lines changed

3 files changed

+52
-48
lines changed

hivemq-edge-frontend/src/modules/Workspace/components/filters/DrawerFilterToolbox.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ const DrawerFilterToolbox: FC<DrawerFilterToolboxProps> = ({ onClearFilters, onA
133133
}
134134

135135
return (
136-
<ButtonGroup variant="outline" isAttached size="sm" m={1} data-testid="toolbox-filter">
136+
<ButtonGroup variant="outline" isAttached size="sm" data-testid="toolbox-filter">
137137
<Button
138138
size="sm"
139139
leftIcon={<Icon as={GoSidebarExpand} boxSize="24px" />}

hivemq-edge-frontend/src/modules/Workspace/components/layout/ApplyLayoutButton.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ const ApplyLayoutButton: FC = () => {
8585
onClick={handleApplyLayout}
8686
isLoading={isApplying}
8787
loadingText={t('workspace.autoLayout.apply.loading')}
88+
minWidth="unset"
8889
>
8990
{t('workspace.autoLayout.apply.label')}
9091
</Button>

hivemq-edge-frontend/src/modules/Workspace/components/layout/LayoutPresetsManager.tsx

Lines changed: 50 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import {
3333
Text,
3434
useToast,
3535
Tooltip,
36+
Portal,
3637
} from '@chakra-ui/react'
3738
import { LuBookmark, LuSave, LuTrash2 } from 'react-icons/lu'
3839
import { v4 as uuidv4 } from 'uuid'
@@ -128,53 +129,55 @@ const LayoutPresetsManager: FC = () => {
128129
aria-label={t('workspace.autoLayout.presets.aria-label')}
129130
/>
130131
</Tooltip>
131-
<MenuList>
132-
<MenuItem icon={<Icon as={LuSave} />} onClick={onOpen}>
133-
{t('workspace.autoLayout.presets.actions.save')}
134-
</MenuItem>
135-
136-
{layoutConfig.presets.length > 0 && (
137-
<>
138-
<MenuDivider />
139-
<Text fontSize="xs" fontWeight="bold" px={3} py={1} color="gray.500">
140-
{t('workspace.autoLayout.presets.list.title')}
141-
</Text>
142-
143-
{layoutConfig.presets.map((preset) => (
144-
<HStack key={preset.id} spacing={0} _hover={{ bg: 'gray.50', _dark: { bg: 'gray.700' } }}>
145-
<MenuItem flex={1} onClick={() => handleLoadPreset(preset.id)}>
146-
<VStack align="start" spacing={0}>
147-
<Text fontSize="sm">{preset.name}</Text>
148-
<Text fontSize="xs" color="gray.500">
149-
{new Date(preset.createdAt).toLocaleDateString()}
150-
</Text>
151-
</VStack>
152-
</MenuItem>
153-
<IconButton
154-
icon={<Icon as={LuTrash2} />}
155-
size="xs"
156-
variant="ghost"
157-
colorScheme="red"
158-
aria-label={t('workspace.autoLayout.presets.actions.delete')}
159-
onClick={(e) => {
160-
e.stopPropagation()
161-
handleDeletePreset(preset.id)
162-
}}
163-
/>
164-
</HStack>
165-
))}
166-
</>
167-
)}
168-
169-
{layoutConfig.presets.length === 0 && (
170-
<>
171-
<MenuDivider />
172-
<Text fontSize="xs" px={3} py={2} color="gray.500">
173-
{t('workspace.autoLayout.presets.list.empty')}
174-
</Text>
175-
</>
176-
)}
177-
</MenuList>
132+
<Portal>
133+
<MenuList>
134+
<MenuItem icon={<Icon as={LuSave} />} onClick={onOpen}>
135+
{t('workspace.autoLayout.presets.actions.save')}
136+
</MenuItem>
137+
138+
{layoutConfig.presets.length > 0 && (
139+
<>
140+
<MenuDivider />
141+
<Text fontSize="xs" fontWeight="bold" px={3} py={1} color="gray.500">
142+
{t('workspace.autoLayout.presets.list.title')}
143+
</Text>
144+
145+
{layoutConfig.presets.map((preset) => (
146+
<HStack key={preset.id} spacing={0} _hover={{ bg: 'gray.50', _dark: { bg: 'gray.700' } }}>
147+
<MenuItem flex={1} onClick={() => handleLoadPreset(preset.id)}>
148+
<VStack align="start" spacing={0}>
149+
<Text fontSize="sm">{preset.name}</Text>
150+
<Text fontSize="xs" color="gray.500">
151+
{new Date(preset.createdAt).toLocaleDateString()}
152+
</Text>
153+
</VStack>
154+
</MenuItem>
155+
<IconButton
156+
icon={<Icon as={LuTrash2} />}
157+
size="xs"
158+
variant="ghost"
159+
colorScheme="red"
160+
aria-label={t('workspace.autoLayout.presets.actions.delete')}
161+
onClick={(e) => {
162+
e.stopPropagation()
163+
handleDeletePreset(preset.id)
164+
}}
165+
/>
166+
</HStack>
167+
))}
168+
</>
169+
)}
170+
171+
{layoutConfig.presets.length === 0 && (
172+
<>
173+
<MenuDivider />
174+
<Text fontSize="xs" px={3} py={2} color="gray.500">
175+
{t('workspace.autoLayout.presets.list.empty')}
176+
</Text>
177+
</>
178+
)}
179+
</MenuList>
180+
</Portal>
178181
</Menu>
179182

180183
<Modal isOpen={isOpen} onClose={onClose}>

0 commit comments

Comments
 (0)