2024-07-23 12:43:30 +02:00
|
|
|
import * as React from "bloatless-react";
|
|
|
|
|
|
2024-07-23 15:41:03 +02:00
|
|
|
import BoardViewModel, {
|
2026-04-01 08:29:39 +00:00
|
|
|
BoardPageType,
|
2024-07-23 15:41:03 +02:00
|
|
|
} from "../../ViewModel/Pages/boardViewModel";
|
|
|
|
|
|
2024-07-25 01:38:11 +02:00
|
|
|
import { BoardKanbanPage } from "./boardKanbanPage";
|
2024-07-23 13:09:46 +02:00
|
|
|
import { BoardSettingsModal } from "../Modals/boardSettingsModal";
|
2024-07-25 04:12:30 +02:00
|
|
|
import { BoardStatusGridPage } from "./boardStatusGridPage";
|
2024-07-23 15:41:03 +02:00
|
|
|
import { BoardViewToggleButton } from "../Components/boardViewToggleButton";
|
2024-07-25 15:31:27 +02:00
|
|
|
import { SearchModal } from "../Modals/searchModal";
|
2024-07-24 13:31:28 +02:00
|
|
|
import { TaskSettingsModal } from "../Modals/taskSettingsModal";
|
|
|
|
|
import { TaskViewModelToEntry } from "../Components/taskEntry";
|
2024-07-23 13:09:46 +02:00
|
|
|
import { translations } from "../translations";
|
2024-07-23 12:43:30 +02:00
|
|
|
|
|
|
|
|
export function BoardPage(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
|
|
|
|
|
const mainContent = React.createProxyState(
|
|
|
|
|
[boardViewModel.selectedPage],
|
|
|
|
|
() => {
|
|
|
|
|
switch (boardViewModel.selectedPage.value) {
|
|
|
|
|
case BoardPageType.Kanban: {
|
|
|
|
|
return BoardKanbanPage(boardViewModel);
|
|
|
|
|
}
|
|
|
|
|
case BoardPageType.StatusGrid: {
|
|
|
|
|
return BoardStatusGridPage(boardViewModel);
|
|
|
|
|
}
|
|
|
|
|
default: {
|
|
|
|
|
return (
|
|
|
|
|
<div
|
|
|
|
|
class="task-grid"
|
|
|
|
|
children:append={[
|
|
|
|
|
boardViewModel.filteredTaskViewModels,
|
|
|
|
|
TaskViewModelToEntry,
|
|
|
|
|
]}
|
|
|
|
|
></div>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
);
|
2024-07-23 22:46:23 +02:00
|
|
|
|
2026-04-01 08:29:39 +00:00
|
|
|
// task modal
|
|
|
|
|
const taskSettingsModal = React.createProxyState(
|
|
|
|
|
[boardViewModel.selectedTaskViewModel],
|
|
|
|
|
() => {
|
|
|
|
|
if (boardViewModel.selectedTaskViewModel.value == undefined) {
|
|
|
|
|
return <div></div>;
|
|
|
|
|
} else {
|
|
|
|
|
return TaskSettingsModal(
|
|
|
|
|
boardViewModel.selectedTaskViewModel.value,
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
);
|
2024-07-24 13:31:28 +02:00
|
|
|
|
2026-04-01 08:29:39 +00:00
|
|
|
return (
|
|
|
|
|
<div class="pane">
|
|
|
|
|
<div class="toolbar">
|
|
|
|
|
<span>
|
|
|
|
|
<button
|
|
|
|
|
class="ghost board-close-button"
|
|
|
|
|
aria-label={
|
|
|
|
|
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={
|
|
|
|
|
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={
|
|
|
|
|
translations.chatPage.task.boardSettingsHeadline
|
|
|
|
|
}
|
|
|
|
|
on:click={boardViewModel.showSettings}
|
|
|
|
|
>
|
|
|
|
|
<span class="icon">settings</span>
|
|
|
|
|
</button>
|
|
|
|
|
</span>
|
|
|
|
|
<span class="scroll-h ribbon">
|
|
|
|
|
{BoardViewToggleButton(
|
|
|
|
|
translations.chatPage.task.listViewButtonAudioLabel,
|
|
|
|
|
"view_list",
|
|
|
|
|
BoardPageType.List,
|
|
|
|
|
boardViewModel,
|
|
|
|
|
)}
|
|
|
|
|
{BoardViewToggleButton(
|
|
|
|
|
translations.chatPage.task.kanbanViewButtonAudioLabel,
|
|
|
|
|
"view_kanban",
|
|
|
|
|
BoardPageType.Kanban,
|
|
|
|
|
boardViewModel,
|
|
|
|
|
)}
|
|
|
|
|
{BoardViewToggleButton(
|
|
|
|
|
translations.chatPage.task.statusViewButtonAudioLabel,
|
|
|
|
|
"grid_view",
|
|
|
|
|
BoardPageType.StatusGrid,
|
|
|
|
|
boardViewModel,
|
|
|
|
|
)}
|
|
|
|
|
</span>
|
|
|
|
|
<span>
|
|
|
|
|
<button
|
|
|
|
|
class="ghost"
|
|
|
|
|
aria-label={
|
|
|
|
|
translations.chatPage.task
|
|
|
|
|
.filterTasksButtonAudioLabel
|
|
|
|
|
}
|
|
|
|
|
on:click={boardViewModel.showFilterModal}
|
|
|
|
|
>
|
|
|
|
|
<span class="icon">filter_alt</span>
|
|
|
|
|
</button>
|
|
|
|
|
<button
|
|
|
|
|
class="ghost"
|
|
|
|
|
aria-label={
|
|
|
|
|
translations.chatPage.task
|
|
|
|
|
.createTaskButtonAudioLabel
|
|
|
|
|
}
|
|
|
|
|
on:click={boardViewModel.createTask}
|
|
|
|
|
>
|
|
|
|
|
<span class="icon">add</span>
|
|
|
|
|
</button>
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="content main-content" children:set={mainContent}></div>
|
2024-07-23 13:09:46 +02:00
|
|
|
|
2026-04-01 08:29:39 +00:00
|
|
|
{BoardSettingsModal(boardViewModel)}
|
|
|
|
|
{SearchModal(
|
|
|
|
|
boardViewModel.searchViewModel,
|
|
|
|
|
translations.chatPage.task.filterTasksHeadline,
|
|
|
|
|
TaskViewModelToEntry,
|
|
|
|
|
boardViewModel.isPresentingFilterModal,
|
|
|
|
|
)}
|
|
|
|
|
<div children:set={taskSettingsModal}></div>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
2024-07-23 12:43:30 +02:00
|
|
|
}
|