2024-07-25 04:12:30 +02:00
|
|
|
import { BoardStatusGridPage } from "./boardStatusGridPage";
|
2026-04-18 11:55:01 +00:00
|
|
|
import { BoardKanbanPage } from "./boardKanbanPage";
|
|
|
|
|
import { ViewController } from "../viewController";
|
2024-07-24 13:31:28 +02:00
|
|
|
import { TaskSettingsModal } from "../Modals/taskSettingsModal";
|
2026-04-18 11:55:01 +00:00
|
|
|
import { SearchModal } from "../Modals/searchModal";
|
|
|
|
|
import { BoardSettingsModal } from "../Modals/boardSettingsModal";
|
2024-07-24 13:31:28 +02:00
|
|
|
import { TaskViewModelToEntry } from "../Components/taskEntry";
|
2026-04-18 11:55:01 +00:00
|
|
|
import { BoardViewToggleButton } from "../Components/boardViewToggleButton";
|
2026-09-23 00:09:09 +02:00
|
|
|
import * as React from "../../react";
|
2026-04-18 11:55:01 +00:00
|
|
|
import BoardViewModel, {
|
|
|
|
|
BoardPageTypes,
|
|
|
|
|
} from "../../ViewModel/Pages/boardViewModel";
|
2026-04-09 16:48:22 +00:00
|
|
|
import CoreViewModel from "../../ViewModel/Global/coreViewModel";
|
2026-08-30 22:24:55 +02:00
|
|
|
import * as Utility from "../../Model/Utility/utility";
|
2024-07-23 12:43:30 +02:00
|
|
|
|
2026-04-09 16:48:22 +00:00
|
|
|
export function BoardPage(
|
|
|
|
|
coreViewModel: CoreViewModel,
|
|
|
|
|
boardViewModel: BoardViewModel,
|
|
|
|
|
) {
|
2026-04-01 08:29:39 +00:00
|
|
|
boardViewModel.loadData();
|
2024-07-23 21:33:22 +02:00
|
|
|
|
2026-04-01 08:29:39 +00:00
|
|
|
// main content
|
2026-04-13 22:11:49 +00:00
|
|
|
const persistenceId = boardViewModel.boardInfo.fileId;
|
2026-04-15 12:47:10 +00:00
|
|
|
const pages = ViewController.boardPages.setState(persistenceId, () =>
|
2026-04-14 09:20:44 +00:00
|
|
|
React.createProxyState([boardViewModel.selectedPage], () => {
|
2026-04-01 08:29:39 +00:00
|
|
|
switch (boardViewModel.selectedPage.value) {
|
2026-04-08 14:02:12 +00:00
|
|
|
case BoardPageTypes.Kanban: {
|
2026-04-09 16:48:22 +00:00
|
|
|
return BoardKanbanPage(coreViewModel, boardViewModel);
|
2026-04-01 08:29:39 +00:00
|
|
|
}
|
2026-04-08 14:02:12 +00:00
|
|
|
case BoardPageTypes.StatusGrid: {
|
2026-04-09 16:48:22 +00:00
|
|
|
return BoardStatusGridPage(coreViewModel, boardViewModel);
|
2026-04-01 08:29:39 +00:00
|
|
|
}
|
|
|
|
|
default: {
|
|
|
|
|
return (
|
|
|
|
|
<div
|
|
|
|
|
class="task-grid"
|
|
|
|
|
children:append={[
|
|
|
|
|
boardViewModel.filteredTaskViewModels,
|
|
|
|
|
TaskViewModelToEntry,
|
|
|
|
|
]}
|
|
|
|
|
></div>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
2026-04-14 09:20:44 +00:00
|
|
|
}),
|
|
|
|
|
);
|
2024-07-23 22:46:23 +02:00
|
|
|
|
2026-09-05 02:26:10 +02:00
|
|
|
const wrapper = (
|
|
|
|
|
<div class="content main-content" children:set={pages}></div>
|
|
|
|
|
);
|
2026-09-24 16:15:35 +02:00
|
|
|
Utility.implementPinchZoom(wrapper, boardViewModel.pinchToZoomData);
|
2026-08-30 23:34:45 +02:00
|
|
|
|
2026-04-01 08:29:39 +00:00
|
|
|
// task modal
|
|
|
|
|
const taskSettingsModal = React.createProxyState(
|
2026-09-05 02:26:10 +02:00
|
|
|
[boardViewModel.selectedTaskViewModel],
|
|
|
|
|
() => {
|
|
|
|
|
if (boardViewModel.selectedTaskViewModel.value == undefined) {
|
|
|
|
|
return <div></div>;
|
|
|
|
|
} else {
|
|
|
|
|
ViewController.setFocusWithDelay();
|
2026-04-01 08:53:50 +00:00
|
|
|
|
2026-09-05 02:26:10 +02:00
|
|
|
return TaskSettingsModal(
|
|
|
|
|
coreViewModel,
|
|
|
|
|
boardViewModel.selectedTaskViewModel.value,
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
},
|
2026-04-01 08:29:39 +00:00
|
|
|
);
|
2024-07-24 13:31:28 +02:00
|
|
|
|
2026-04-01 08:29:39 +00:00
|
|
|
return (
|
2026-09-05 02:26:10 +02:00
|
|
|
<div class="pane">
|
|
|
|
|
<div class="toolbar">
|
|
|
|
|
<span>
|
|
|
|
|
<button
|
|
|
|
|
class="ghost board-close-button"
|
|
|
|
|
aria-label={
|
|
|
|
|
coreViewModel.translations.chatPage.task
|
|
|
|
|
.closeBoardButtonAudioLabel
|
|
|
|
|
}
|
|
|
|
|
on:click={boardViewModel.close}
|
|
|
|
|
>
|
|
|
|
|
<span class="icon">arrow_back</span>
|
|
|
|
|
</button>
|
|
|
|
|
<button
|
|
|
|
|
class="ghost board-toggle-button inset-outline"
|
|
|
|
|
aria-label={
|
|
|
|
|
coreViewModel.translations.chatPage.task
|
|
|
|
|
.toggleBoardButtonAudioLabel
|
|
|
|
|
}
|
|
|
|
|
on:click={
|
|
|
|
|
boardViewModel.taskPageViewModel.toggleBoardList
|
|
|
|
|
}
|
|
|
|
|
toggle:selected={
|
|
|
|
|
boardViewModel.taskPageViewModel.isShowingBoadList
|
|
|
|
|
}
|
|
|
|
|
>
|
|
|
|
|
<span class="icon">dock_to_right</span>
|
|
|
|
|
</button>
|
|
|
|
|
<button
|
|
|
|
|
class="ghost"
|
|
|
|
|
aria-label={
|
|
|
|
|
coreViewModel.translations.chatPage.task
|
|
|
|
|
.boardSettingsHeadline
|
|
|
|
|
}
|
|
|
|
|
on:click={boardViewModel.showSettings}
|
|
|
|
|
>
|
|
|
|
|
<span class="icon">settings</span>
|
|
|
|
|
</button>
|
|
|
|
|
</span>
|
|
|
|
|
<span class="scroll-h ribbon">
|
|
|
|
|
{BoardViewToggleButton(
|
|
|
|
|
coreViewModel.translations.chatPage.task
|
|
|
|
|
.listViewButtonAudioLabel,
|
|
|
|
|
"view_list",
|
|
|
|
|
BoardPageTypes.List,
|
|
|
|
|
boardViewModel,
|
|
|
|
|
)}
|
|
|
|
|
{BoardViewToggleButton(
|
|
|
|
|
coreViewModel.translations.chatPage.task
|
|
|
|
|
.kanbanViewButtonAudioLabel,
|
|
|
|
|
"view_kanban",
|
|
|
|
|
BoardPageTypes.Kanban,
|
|
|
|
|
boardViewModel,
|
|
|
|
|
)}
|
|
|
|
|
{BoardViewToggleButton(
|
|
|
|
|
coreViewModel.translations.chatPage.task
|
|
|
|
|
.statusViewButtonAudioLabel,
|
|
|
|
|
"grid_view",
|
|
|
|
|
BoardPageTypes.StatusGrid,
|
|
|
|
|
boardViewModel,
|
|
|
|
|
)}
|
|
|
|
|
</span>
|
|
|
|
|
<span>
|
|
|
|
|
<button
|
|
|
|
|
class="ghost inset-outline"
|
|
|
|
|
aria-label={
|
|
|
|
|
coreViewModel.translations.chatPage.task
|
|
|
|
|
.filterTasksButtonAudioLabel
|
|
|
|
|
}
|
|
|
|
|
on:click={boardViewModel.showFilterModal}
|
|
|
|
|
toggle:selected={boardViewModel.isFilterActive}
|
|
|
|
|
>
|
|
|
|
|
<span class="icon">filter_alt</span>
|
|
|
|
|
</button>
|
|
|
|
|
<button
|
|
|
|
|
class="ghost"
|
|
|
|
|
aria-label={
|
|
|
|
|
coreViewModel.translations.chatPage.task
|
|
|
|
|
.createTaskButtonAudioLabel
|
|
|
|
|
}
|
|
|
|
|
on:click={boardViewModel.createTask}
|
|
|
|
|
>
|
|
|
|
|
<span class="icon">add</span>
|
|
|
|
|
</button>
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
2026-08-30 22:24:55 +02:00
|
|
|
|
2026-09-05 02:26:10 +02:00
|
|
|
{wrapper}
|
2024-07-23 13:09:46 +02:00
|
|
|
|
2026-09-05 02:26:10 +02:00
|
|
|
{BoardSettingsModal(coreViewModel, boardViewModel)}
|
|
|
|
|
{SearchModal(
|
|
|
|
|
coreViewModel,
|
|
|
|
|
boardViewModel.searchViewModel,
|
|
|
|
|
coreViewModel.translations.chatPage.task.filterTasksHeadline,
|
|
|
|
|
boardViewModel.isPresentingFilterModal,
|
|
|
|
|
)}
|
|
|
|
|
<div children:set={taskSettingsModal}></div>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
2024-07-23 12:43:30 +02:00
|
|
|
}
|