mirror of
https://github.com/zadam/trilium.git
synced 2025-10-21 15:49:00 +02:00
refactor(book/table): clean up
This commit is contained in:
parent
fb32d26479
commit
66761a69d3
@ -16,7 +16,7 @@ type GridLabelType = 'text' | 'number' | 'boolean' | 'date' | 'dateString' | 'ob
|
|||||||
|
|
||||||
export function buildData(parentNote: FNote, notes: FNote[]) {
|
export function buildData(parentNote: FNote, notes: FNote[]) {
|
||||||
const info = getPromotedAttributeInformation(parentNote);
|
const info = getPromotedAttributeInformation(parentNote);
|
||||||
const columnDefs = buildColumnDefinitions(parentNote, info);
|
const columnDefs = buildColumnDefinitions(info);
|
||||||
const rowData = buildRowDefinitions(notes, info);
|
const rowData = buildRowDefinitions(notes, info);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@ -25,7 +25,7 @@ export function buildData(parentNote: FNote, notes: FNote[]) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function buildColumnDefinitions(parentNote: FNote, info: PromotedAttributeInformation[]) {
|
export function buildColumnDefinitions(info: PromotedAttributeInformation[]) {
|
||||||
const columnDefs: GridOptions<Data>["columnDefs"] = [
|
const columnDefs: GridOptions<Data>["columnDefs"] = [
|
||||||
{
|
{
|
||||||
field: "title"
|
field: "title"
|
||||||
@ -46,7 +46,6 @@ export function buildColumnDefinitions(parentNote: FNote, info: PromotedAttribut
|
|||||||
function getPromotedAttributeInformation(parentNote: FNote) {
|
function getPromotedAttributeInformation(parentNote: FNote) {
|
||||||
const info: PromotedAttributeInformation[] = [];
|
const info: PromotedAttributeInformation[] = [];
|
||||||
for (const promotedAttribute of parentNote.getPromotedDefinitionAttributes()) {
|
for (const promotedAttribute of parentNote.getPromotedDefinitionAttributes()) {
|
||||||
console.log(promotedAttribute);
|
|
||||||
if (promotedAttribute.type !== "label") {
|
if (promotedAttribute.type !== "label") {
|
||||||
console.warn("Relations are not supported for now");
|
console.warn("Relations are not supported for now");
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user