mirror of
https://github.com/zadam/trilium.git
synced 2025-11-15 10:58:58 +01:00
feat(board/relation): display note titles
This commit is contained in:
parent
47f7968dc4
commit
ad6d61f1f7
@ -12,6 +12,7 @@ import Card, { CARD_CLIPBOARD_TYPE, CardDragData } from "./card";
|
||||
import { JSX } from "preact/jsx-runtime";
|
||||
import froca from "../../../services/froca";
|
||||
import { DragData, TREE_CLIPBOARD_TYPE } from "../../note_tree";
|
||||
import NoteLink from "../../react/NoteLink";
|
||||
|
||||
interface DragContext {
|
||||
column: string;
|
||||
@ -27,12 +28,14 @@ export default function Column({
|
||||
api,
|
||||
onColumnHover,
|
||||
isAnyColumnDragging,
|
||||
isInRelationMode
|
||||
}: {
|
||||
columnItems?: { note: FNote, branch: FBranch }[];
|
||||
isDraggingColumn: boolean,
|
||||
api: BoardApi,
|
||||
onColumnHover?: (index: number, mouseX: number, rect: DOMRect) => void,
|
||||
isAnyColumnDragging?: boolean
|
||||
isAnyColumnDragging?: boolean,
|
||||
isInRelationMode: boolean
|
||||
} & DragContext) {
|
||||
const [ isVisible, setVisible ] = useState(true);
|
||||
const { columnNameToEdit, setColumnNameToEdit, dropTarget, draggedCard, dropPosition } = useContext(BoardViewContext)!;
|
||||
@ -103,7 +106,11 @@ export default function Column({
|
||||
>
|
||||
{!isEditing ? (
|
||||
<>
|
||||
<span className="title">{column}</span>
|
||||
<span className="title">
|
||||
{isInRelationMode
|
||||
? <NoteLink notePath={column} showNoteIcon />
|
||||
: column}
|
||||
</span>
|
||||
<span className="counter-badge">{columnItems?.length ?? 0}</span>
|
||||
<div className="spacer" />
|
||||
<span
|
||||
|
||||
@ -53,6 +53,11 @@
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.board-view-container .board-column h3 a {
|
||||
text-decoration: none;
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
.board-view-container .board-column h3 .counter-badge {
|
||||
background-color: var(--muted-text-color);
|
||||
color: var(--main-background-color);
|
||||
|
||||
@ -46,6 +46,7 @@ export default function BoardView({ note: parentNote, noteIds, viewConfig, saveC
|
||||
const [ includeArchived ] = useNoteLabelBoolean(parentNote, "includeArchived");
|
||||
const [ byColumn, setByColumn ] = useState<ColumnMap>();
|
||||
const [ columns, setColumns ] = useState<string[]>();
|
||||
const [ isInRelationMode, setIsRelationMode ] = useState(false);
|
||||
const [ draggedCard, setDraggedCard ] = useState<{ noteId: string, branchId: string, fromColumn: string, index: number } | null>(null);
|
||||
const [ dropTarget, setDropTarget ] = useState<string | null>(null);
|
||||
const [ dropPosition, setDropPosition ] = useState<{ column: string, index: number } | null>(null);
|
||||
@ -78,8 +79,9 @@ export default function BoardView({ note: parentNote, noteIds, viewConfig, saveC
|
||||
]);
|
||||
|
||||
function refresh() {
|
||||
getBoardData(parentNote, statusAttribute, viewConfig ?? {}, includeArchived).then(({ byColumn, newPersistedData }) => {
|
||||
getBoardData(parentNote, statusAttribute, viewConfig ?? {}, includeArchived).then(({ byColumn, newPersistedData, isInRelationMode }) => {
|
||||
setByColumn(byColumn);
|
||||
setIsRelationMode(isInRelationMode);
|
||||
|
||||
if (newPersistedData) {
|
||||
viewConfig = { ...newPersistedData };
|
||||
@ -171,6 +173,7 @@ export default function BoardView({ note: parentNote, noteIds, viewConfig, saveC
|
||||
<div className="column-drop-placeholder show" />
|
||||
)}
|
||||
<Column
|
||||
isInRelationMode={isInRelationMode}
|
||||
api={api}
|
||||
column={column}
|
||||
columnIndex={index}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user