prepare calendar view
This commit is contained in:
Vendored
+23
-1
@@ -516,6 +516,7 @@
|
||||
viewNotes: "Notes",
|
||||
viewKanban: "Kanban",
|
||||
viewStatus: "Status",
|
||||
viewCalendar: "Calendar",
|
||||
noObjects: "No objects",
|
||||
objectTitle: "Object title",
|
||||
objectTitlePlaceholder: "My object",
|
||||
@@ -622,6 +623,7 @@
|
||||
viewNotes: "Notas",
|
||||
viewKanban: "Kanban",
|
||||
viewStatus: "Estado",
|
||||
viewCalendar: "Calendario",
|
||||
noObjects: "Sin objetos",
|
||||
objectTitle: "T\xEDtulo",
|
||||
objectTitlePlaceholder: "Mi objeto",
|
||||
@@ -726,6 +728,7 @@
|
||||
viewNotes: "Notizen",
|
||||
viewKanban: "Kanban",
|
||||
viewStatus: "Status",
|
||||
viewCalendar: "Kalender",
|
||||
noObjects: "Keine Objekte",
|
||||
objectTitle: "Titel",
|
||||
objectTitlePlaceholder: "Mein Objekt",
|
||||
@@ -2063,12 +2066,29 @@
|
||||
);
|
||||
}
|
||||
|
||||
// src/Views/Objects/calendarView.tsx
|
||||
function CalendarView(chat, messageObjects, selectedObject, isShowingObjectModal) {
|
||||
const notes = new ListState();
|
||||
messageObjects.handleAddition((messageObject) => {
|
||||
const latest = chat.getMostRecentContent(messageObject);
|
||||
if (!latest) return;
|
||||
if (!latest.date) return;
|
||||
notes.add(messageObject);
|
||||
messageObjects.handleRemoval(
|
||||
messageObject,
|
||||
() => notes.remove(messageObject)
|
||||
);
|
||||
});
|
||||
return /* @__PURE__ */ createElement("div", { class: "width-100 height-100 scroll-v padding" }, ObjectGridView(chat, notes, selectedObject, isShowingObjectModal));
|
||||
}
|
||||
|
||||
// src/Views/Objects/objectPane.tsx
|
||||
var viewTypes = {
|
||||
all: [translation.viewAll, "grid_view"],
|
||||
notes: [translation.viewNotes, icons.noteContent],
|
||||
kanban: [translation.viewKanban, "view_kanban"],
|
||||
status: [translation.viewStatus, icons.status]
|
||||
status: [translation.viewStatus, icons.status],
|
||||
calendar: [translation.viewCalendar, icons.date]
|
||||
};
|
||||
function ObjectPane(chat) {
|
||||
const isShowingObjectModal = new State(false);
|
||||
@@ -2168,6 +2188,8 @@
|
||||
return KanbanView;
|
||||
case "status":
|
||||
return StatusView;
|
||||
case "calendar":
|
||||
return CalendarView;
|
||||
default:
|
||||
return AllObjectsView;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
import * as React from "bloatless-react";
|
||||
|
||||
import { Chat, MessageObject } from "../../Model/chatModel";
|
||||
|
||||
import { ObjectGridView } from "./objectGridView";
|
||||
|
||||
export function CalendarView(
|
||||
chat: Chat,
|
||||
messageObjects: React.MapState<MessageObject>,
|
||||
selectedObject: React.State<MessageObject | undefined>,
|
||||
isShowingObjectModal: React.State<boolean>
|
||||
) {
|
||||
const notes = new React.ListState<MessageObject>();
|
||||
messageObjects.handleAddition((messageObject) => {
|
||||
const latest = chat.getMostRecentContent(messageObject);
|
||||
if (!latest) return;
|
||||
if (!latest.date) return;
|
||||
|
||||
notes.add(messageObject);
|
||||
messageObjects.handleRemoval(messageObject, () =>
|
||||
notes.remove(messageObject)
|
||||
);
|
||||
});
|
||||
|
||||
return <div class="width-100 height-100 scroll-v padding">
|
||||
{ObjectGridView(chat, notes, selectedObject, isShowingObjectModal)}
|
||||
</div>;
|
||||
}
|
||||
@@ -12,12 +12,14 @@ import { icons } from "../../icons";
|
||||
import { translation } from "../../translations";
|
||||
import { previousObjectSearches } from "../../Model/model";
|
||||
import { stringToOptionTag } from "../../utility";
|
||||
import { CalendarView } from "./calendarView";
|
||||
|
||||
export const viewTypes = {
|
||||
all: [translation.viewAll, "grid_view"],
|
||||
notes: [translation.viewNotes, icons.noteContent],
|
||||
kanban: [translation.viewKanban, "view_kanban"],
|
||||
status: [translation.viewStatus, icons.status],
|
||||
calendar: [translation.viewCalendar, icons.date],
|
||||
};
|
||||
|
||||
export function ObjectPane(chat: Chat) {
|
||||
@@ -143,6 +145,8 @@ export function ObjectPane(chat: Chat) {
|
||||
return KanbanView;
|
||||
case "status":
|
||||
return StatusView;
|
||||
case "calendar":
|
||||
return CalendarView;
|
||||
default:
|
||||
return AllObjectsView;
|
||||
}
|
||||
|
||||
@@ -114,6 +114,7 @@ const englishTranslations = {
|
||||
viewNotes: "Notes",
|
||||
viewKanban: "Kanban",
|
||||
viewStatus: "Status",
|
||||
viewCalendar: "Calendar",
|
||||
|
||||
noObjects: "No objects",
|
||||
|
||||
@@ -254,6 +255,7 @@ const allTranslations: { [key: string]: typeof englishTranslations } = {
|
||||
viewNotes: "Notas",
|
||||
viewKanban: "Kanban",
|
||||
viewStatus: "Estado",
|
||||
viewCalendar: "Calendario",
|
||||
|
||||
noObjects: "Sin objetos",
|
||||
|
||||
@@ -391,6 +393,7 @@ const allTranslations: { [key: string]: typeof englishTranslations } = {
|
||||
viewNotes: "Notizen",
|
||||
viewKanban: "Kanban",
|
||||
viewStatus: "Status",
|
||||
viewCalendar: "Kalender",
|
||||
|
||||
noObjects: "Keine Objekte",
|
||||
|
||||
|
||||
Reference in New Issue
Block a user