mirror of
https://github.com/umami-software/umami.git
synced 2026-02-18 03:25:40 +01:00
Add default row/column for new boards and prevent removing last column.
Some checks are pending
Node.js CI / build (push) Waiting to run
Some checks are pending
Node.js CI / build (push) Waiting to run
- New boards now start with one row containing one column - Hide remove column button when only one column remains in a row Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
385bdd6734
commit
6367d94552
2 changed files with 26 additions and 15 deletions
|
|
@ -221,7 +221,11 @@ function BoardRow({
|
|||
{columns?.map((column, index) => (
|
||||
<Fragment key={column.id}>
|
||||
<Panel id={column.id} minSize={MIN_COLUMN_WIDTH} defaultSize={column.size}>
|
||||
<BoardColumn {...column} onRemove={handleRemoveColumn} />
|
||||
<BoardColumn
|
||||
{...column}
|
||||
onRemove={handleRemoveColumn}
|
||||
canRemove={columns?.length > 1}
|
||||
/>
|
||||
</Panel>
|
||||
{index < columns?.length - 1 && <Separator />}
|
||||
</Fragment>
|
||||
|
|
@ -276,10 +280,12 @@ function BoardColumn({
|
|||
id,
|
||||
component,
|
||||
onRemove,
|
||||
canRemove = true,
|
||||
}: {
|
||||
id: string;
|
||||
component?: ReactElement;
|
||||
onRemove?: (id: string) => void;
|
||||
canRemove?: boolean;
|
||||
}) {
|
||||
const handleAddComponent = () => {};
|
||||
|
||||
|
|
@ -294,16 +300,18 @@ function BoardColumn({
|
|||
backgroundColor="3"
|
||||
position="relative"
|
||||
>
|
||||
<Box position="absolute" top="10px" right="20px" zIndex={100}>
|
||||
<TooltipTrigger delay={0}>
|
||||
<Button variant="quiet" onPress={() => onRemove?.(id)}>
|
||||
<Icon size="sm">
|
||||
<X />
|
||||
</Icon>
|
||||
</Button>
|
||||
<Tooltip>Remove column</Tooltip>
|
||||
</TooltipTrigger>
|
||||
</Box>
|
||||
{canRemove && (
|
||||
<Box position="absolute" top="10px" right="20px" zIndex={100}>
|
||||
<TooltipTrigger delay={0}>
|
||||
<Button variant="quiet" onPress={() => onRemove?.(id)}>
|
||||
<Icon size="sm">
|
||||
<X />
|
||||
</Icon>
|
||||
</Button>
|
||||
<Tooltip>Remove column</Tooltip>
|
||||
</TooltipTrigger>
|
||||
</Box>
|
||||
)}
|
||||
<Button variant="outline" onPress={handleAddComponent}>
|
||||
<Icon>
|
||||
<Plus />
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue