mirror of
https://github.com/umami-software/umami.git
synced 2026-02-22 05:25:36 +01:00
Add personal dashboard flow and per-component website selection
Some checks are pending
Node.js CI / build (push) Waiting to run
Some checks are pending
Node.js CI / build (push) Waiting to run
This introduces a user-scoped dashboard with board-style view/edit pages while keeping it unavailable in team context, and moves website targeting to component config so dashboard components can each select their own website.
This commit is contained in:
parent
2633697585
commit
631cc46f7f
73 changed files with 418 additions and 88 deletions
|
|
@ -8,7 +8,7 @@ import { GripHorizontal, Plus } from '@/components/icons';
|
|||
import { BoardEditRow } from './BoardEditRow';
|
||||
import { BUTTON_ROW_HEIGHT, MAX_ROW_HEIGHT, MIN_ROW_HEIGHT } from './boardConstants';
|
||||
|
||||
export function BoardEditBody() {
|
||||
export function BoardEditBody({ requiresBoardWebsite = true }: { requiresBoardWebsite?: boolean }) {
|
||||
const { board, updateBoard, registerLayoutGetter } = useBoard();
|
||||
const rowGroupRef = useRef<GroupImperativeHandle>(null);
|
||||
const columnGroupRefs = useRef<Map<string, GroupImperativeHandle>>(new Map());
|
||||
|
|
@ -103,6 +103,7 @@ export function BoardEditBody() {
|
|||
};
|
||||
|
||||
const websiteId = board?.parameters?.websiteId;
|
||||
const canEdit = requiresBoardWebsite ? !!websiteId : true;
|
||||
const rows = board?.parameters?.rows ?? [];
|
||||
const minHeight = (rows.length || 1) * MAX_ROW_HEIGHT + BUTTON_ROW_HEIGHT;
|
||||
|
||||
|
|
@ -122,7 +123,7 @@ export function BoardEditBody() {
|
|||
rowId={row.id}
|
||||
rowIndex={index}
|
||||
rowCount={rows.length}
|
||||
canEdit={!!websiteId}
|
||||
canEdit={canEdit}
|
||||
onRemove={handleRemoveRow}
|
||||
onMoveUp={handleMoveRowUp}
|
||||
onMoveDown={handleMoveRowDown}
|
||||
|
|
@ -157,7 +158,7 @@ export function BoardEditBody() {
|
|||
)}
|
||||
</Fragment>
|
||||
))}
|
||||
{!!websiteId && (
|
||||
{canEdit && (
|
||||
<Panel minSize={BUTTON_ROW_HEIGHT}>
|
||||
<Row padding="3">
|
||||
<TooltipTrigger delay={0}>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue