sort kanban items by priority
This commit is contained in:
Vendored
+9
-5
@@ -1478,7 +1478,10 @@
|
|||||||
const boardTitle = latest.categoryName;
|
const boardTitle = latest.categoryName;
|
||||||
if (!boards.value.has(boardTitle))
|
if (!boards.value.has(boardTitle))
|
||||||
boards.set(boardTitle, { title: boardTitle, items: [] });
|
boards.set(boardTitle, { title: boardTitle, items: [] });
|
||||||
boards.value.get(boardTitle)?.items.push(messageObject);
|
boards.value.get(boardTitle)?.items.push({
|
||||||
|
priority: latest.priority ?? 0,
|
||||||
|
messageObject
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
const content = createProxyState(
|
const content = createProxyState(
|
||||||
@@ -1497,7 +1500,8 @@
|
|||||||
() => editingBoardTitle.value == kanbanBoard.title || editingBoardTitle.value == ""
|
() => editingBoardTitle.value == kanbanBoard.title || editingBoardTitle.value == ""
|
||||||
);
|
);
|
||||||
function renameBoard() {
|
function renameBoard() {
|
||||||
kanbanBoard.items.forEach((messageObject) => {
|
kanbanBoard.items.forEach((kanbanBoardItem) => {
|
||||||
|
const { messageObject } = kanbanBoardItem;
|
||||||
const latest = chat.getMostRecentContent(messageObject);
|
const latest = chat.getMostRecentContent(messageObject);
|
||||||
latest.categoryName = editingBoardTitle.value;
|
latest.categoryName = editingBoardTitle.value;
|
||||||
chat.addObjectAndSend(messageObject);
|
chat.addObjectAndSend(messageObject);
|
||||||
@@ -1536,10 +1540,10 @@
|
|||||||
/* @__PURE__ */ createElement("span", { class: "icon" }, "edit")
|
/* @__PURE__ */ createElement("span", { class: "icon" }, "edit")
|
||||||
)),
|
)),
|
||||||
/* @__PURE__ */ createElement("hr", null),
|
/* @__PURE__ */ createElement("hr", null),
|
||||||
/* @__PURE__ */ createElement("div", { class: "flex-column gap padding-bottom" }, ...kanbanBoard.items.map(
|
/* @__PURE__ */ createElement("div", { class: "flex-column gap padding-bottom" }, ...kanbanBoard.items.sort((a, b) => b.priority - a.priority).map(
|
||||||
(messageObject) => ObjectEntryView(
|
(kanbanBoardItem) => ObjectEntryView(
|
||||||
chat,
|
chat,
|
||||||
messageObject,
|
kanbanBoardItem.messageObject,
|
||||||
selectedObject,
|
selectedObject,
|
||||||
isShowingObjectModal
|
isShowingObjectModal
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -9,7 +9,12 @@ import { translation } from "../../translations";
|
|||||||
|
|
||||||
interface KanbanBoard {
|
interface KanbanBoard {
|
||||||
title: string;
|
title: string;
|
||||||
items: MessageObject[];
|
items: KanbanBoardItem[];
|
||||||
|
}
|
||||||
|
|
||||||
|
interface KanbanBoardItem {
|
||||||
|
priority: number;
|
||||||
|
messageObject: MessageObject;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function KanbanView(
|
export function KanbanView(
|
||||||
@@ -30,7 +35,10 @@ export function KanbanView(
|
|||||||
if (!boards.value.has(boardTitle))
|
if (!boards.value.has(boardTitle))
|
||||||
boards.set(boardTitle, { title: boardTitle, items: [] });
|
boards.set(boardTitle, { title: boardTitle, items: [] });
|
||||||
|
|
||||||
boards.value.get(boardTitle)?.items.push(messageObject);
|
boards.value.get(boardTitle)?.items.push({
|
||||||
|
priority: latest.priority ?? 0,
|
||||||
|
messageObject,
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -69,7 +77,8 @@ function KanbanBoardView(
|
|||||||
);
|
);
|
||||||
|
|
||||||
function renameBoard() {
|
function renameBoard() {
|
||||||
kanbanBoard.items.forEach((messageObject) => {
|
kanbanBoard.items.forEach((kanbanBoardItem) => {
|
||||||
|
const { messageObject } = kanbanBoardItem;
|
||||||
const latest = chat.getMostRecentContent(messageObject);
|
const latest = chat.getMostRecentContent(messageObject);
|
||||||
latest.categoryName = editingBoardTitle.value;
|
latest.categoryName = editingBoardTitle.value;
|
||||||
chat.addObjectAndSend(messageObject);
|
chat.addObjectAndSend(messageObject);
|
||||||
@@ -117,10 +126,12 @@ function KanbanBoardView(
|
|||||||
</div>
|
</div>
|
||||||
<hr></hr>
|
<hr></hr>
|
||||||
<div class="flex-column gap padding-bottom">
|
<div class="flex-column gap padding-bottom">
|
||||||
{...kanbanBoard.items.map((messageObject) =>
|
{...kanbanBoard.items
|
||||||
|
.sort((a, b) => b.priority - a.priority)
|
||||||
|
.map((kanbanBoardItem) =>
|
||||||
ObjectEntryView(
|
ObjectEntryView(
|
||||||
chat,
|
chat,
|
||||||
messageObject,
|
kanbanBoardItem.messageObject,
|
||||||
selectedObject,
|
selectedObject,
|
||||||
isShowingObjectModal
|
isShowingObjectModal
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user