move translations to CoreVM, move models to CoreVM for sentralization

This commit is contained in:
marlon-erler
2026-04-09 16:48:22 +00:00
parent 6204669ba3
commit 78672afc40
42 changed files with 1786 additions and 1322 deletions
+12 -5
View File
@@ -16,9 +16,12 @@ import { FilteredList } from "../Components/filteredList";
import TaskViewModel from "../../ViewModel/Pages/taskViewModel";
import { TaskViewModelToEntry } from "../Components/taskEntry";
import { allowDrop } from "../utility";
import { translations } from "../translations";
import CoreViewModel from "../../ViewModel/Global/coreViewModel";
export function BoardStatusGridPage(boardViewModel: BoardViewModel) {
export function BoardStatusGridPage(
coreViewModel: CoreViewModel,
boardViewModel: BoardViewModel,
) {
const statuses: React.ListState<string> = new React.ListState();
const sortedStatuses: React.State<string[]> =
createSortedPropertyValueState(statuses);
@@ -36,7 +39,7 @@ export function BoardStatusGridPage(boardViewModel: BoardViewModel) {
statusName: string,
) => {
const index = createPropertyValueIndexState(sortedStatuses, statusName);
return StatusNameCell(statusName, index, boardViewModel);
return StatusNameCell(coreViewModel, statusName, index, boardViewModel);
};
return (
@@ -63,6 +66,7 @@ export function BoardStatusGridPage(boardViewModel: BoardViewModel) {
);
return CategoryRow(
coreViewModel,
categoryName,
index,
statuses,
@@ -84,6 +88,7 @@ export function BoardStatusGridPage(boardViewModel: BoardViewModel) {
}
function StatusNameCell(
coreViewModel: CoreViewModel,
statusName: string,
index: React.State<number>,
boardViewModel: BoardViewModel,
@@ -118,7 +123,8 @@ function StatusNameCell(
<div class="property-input-wrapper">
<input
placeholder={
translations.chatPage.task.renameStatusInputPlaceholder
coreViewModel.translations.chatPage.task
.renameStatusInputPlaceholder
}
bind:value={viewModel.inputValue}
on:enter={viewModel.set}
@@ -142,6 +148,7 @@ function StatusNameCell(
}
function CategoryRow(
coreViewModel: CoreViewModel,
categoryName: string,
index: React.State<number>,
allStatuses: React.ListState<string>,
@@ -180,7 +187,7 @@ function CategoryRow(
<div class="property-input-wrapper">
<input
placeholder={
translations.chatPage.task
coreViewModel.translations.chatPage.task
.renameCategoryInputPlaceholder
}
bind:value={viewModel.inputValue}