2024-07-23 12:43:30 +02:00
|
|
|
import * as React from "bloatless-react";
|
|
|
|
|
|
2024-07-23 15:41:03 +02:00
|
|
|
import BoardViewModel, {
|
|
|
|
|
BoardPageType,
|
|
|
|
|
} from "../../ViewModel/Pages/boardViewModel";
|
|
|
|
|
|
2024-07-23 13:09:46 +02:00
|
|
|
import { BoardSettingsModal } from "../Modals/boardSettingsModal";
|
2024-07-23 15:41:03 +02:00
|
|
|
import { BoardViewToggleButton } from "../Components/boardViewToggleButton";
|
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) {
|
2024-07-23 21:33:22 +02:00
|
|
|
boardViewModel.loadData();
|
|
|
|
|
|
2024-07-23 22:46:23 +02:00
|
|
|
const mainContent = React.createProxyState(
|
|
|
|
|
[boardViewModel.selectedPage],
|
|
|
|
|
() => {
|
|
|
|
|
switch (boardViewModel.selectedPage.value) {
|
|
|
|
|
default: {
|
|
|
|
|
return <div></div>;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
|
2024-07-23 13:09:46 +02:00
|
|
|
return (
|
|
|
|
|
<div class="pane">
|
|
|
|
|
<div class="toolbar">
|
2024-07-23 14:53:00 +02:00
|
|
|
<span>
|
|
|
|
|
<button
|
|
|
|
|
class="ghost"
|
|
|
|
|
aria-label={translations.chatPage.task.closeBoard}
|
|
|
|
|
on:click={boardViewModel.close}
|
|
|
|
|
>
|
|
|
|
|
<span class="icon">arrow_back</span>
|
|
|
|
|
</button>
|
|
|
|
|
<button
|
|
|
|
|
class="ghost"
|
|
|
|
|
aria-label={translations.chatPage.task.boardSettingsHeadline}
|
|
|
|
|
on:click={boardViewModel.showSettings}
|
|
|
|
|
>
|
|
|
|
|
<span class="icon">settings</span>
|
|
|
|
|
</button>
|
|
|
|
|
</span>
|
2024-07-23 15:25:16 +02:00
|
|
|
<span class="scroll-h ribbon">
|
2024-07-23 15:41:03 +02:00
|
|
|
{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
|
|
|
|
|
)}
|
2024-07-23 15:25:16 +02:00
|
|
|
</span>
|
|
|
|
|
<span>
|
|
|
|
|
<button
|
|
|
|
|
class="ghost"
|
|
|
|
|
aria-label={translations.chatPage.task.filterTasksButtonAudioLabel}
|
|
|
|
|
on:click={boardViewModel.showFilterModal}
|
|
|
|
|
>
|
|
|
|
|
<span class="icon">filter_alt</span>
|
|
|
|
|
</button>
|
|
|
|
|
<button
|
|
|
|
|
class="primary"
|
|
|
|
|
aria-label={translations.chatPage.task.createTaskButtonAudioLabel}
|
|
|
|
|
on:click={boardViewModel.showNewTaskModal}
|
|
|
|
|
>
|
|
|
|
|
<span class="icon">add</span>
|
|
|
|
|
</button>
|
|
|
|
|
</span>
|
2024-07-23 13:09:46 +02:00
|
|
|
</div>
|
2024-07-23 22:46:23 +02:00
|
|
|
<div class="content" children:set={mainContent}></div>
|
2024-07-23 13:09:46 +02:00
|
|
|
|
|
|
|
|
{BoardSettingsModal(boardViewModel)}
|
|
|
|
|
</div>
|
|
|
|
|
);
|
2024-07-23 12:43:30 +02:00
|
|
|
}
|