aboutsummaryrefslogtreecommitdiff
path: root/src/client/documents
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/documents')
-rw-r--r--src/client/documents/DocumentTypes.ts3
-rw-r--r--src/client/documents/Documents.ts74
2 files changed, 49 insertions, 28 deletions
diff --git a/src/client/documents/DocumentTypes.ts b/src/client/documents/DocumentTypes.ts
index cef44e999..a73d8ba59 100644
--- a/src/client/documents/DocumentTypes.ts
+++ b/src/client/documents/DocumentTypes.ts
@@ -44,8 +44,9 @@ export enum DocumentType {
SCRIPTDB = 'scriptdb', // database of scripts
GROUPDB = 'groupdb', // database of groups
+ JOURNAL = 'journal', // AARAV ADD JOURNAL
+ TASK = 'task', // AARAV ADD TASK
SCRAPBOOK = 'scrapbook',
- JOURNAL = 'journal', // AARAV ADD
}
export enum CollectionViewType {
// general collections
diff --git a/src/client/documents/Documents.ts b/src/client/documents/Documents.ts
index a4a668085..217967c52 100644
--- a/src/client/documents/Documents.ts
+++ b/src/client/documents/Documents.ts
@@ -11,7 +11,7 @@ import { List } from '../../fields/List';
import { RichTextField } from '../../fields/RichTextField';
import { SchemaHeaderField } from '../../fields/SchemaHeaderField';
import { ComputedField, ScriptField } from '../../fields/ScriptField';
-import { ScriptCast, StrCast } from '../../fields/Types';
+import { DocCast, ScriptCast, StrCast } from '../../fields/Types';
import { AudioField, CsvField, ImageField, PdfField, VideoField, WebField } from '../../fields/URLField';
import { SharingPermissions } from '../../fields/util';
import { PointData } from '../../pen-gestures/GestureTypes';
@@ -526,6 +526,16 @@ export class DocumentOptions {
ai_firefly_seed?: number;
ai_firefly_prompt?: string;
+ // AARAV ADD DOC OPTIONS -- TASK MANAGER
+
+ /** Task start date/time picker (metadata and default) */
+ startTime?: DateInfo | DateField = new DateInfo('start date and time', /*filterable*/ false);
+ /** Task end date/time picker (metadata and default) */
+ endTime?: DateInfo | DateField = new DateInfo('end date and time', /*filterable*/ false);
+ /** Treat this as an all-day task (metadata and default) */
+ allDay?: BoolInfo | boolean = new BoolInfo('all-day task', /*filterable*/ false);
+ /** Whether the task is completed */
+ completed?: BoolInfo | boolean = new BoolInfo('whether the task is completed', /*filterable*/ false);
/**
* JSON‐stringified slot configuration for ScrapbookBox
*/
@@ -584,6 +594,30 @@ export namespace Docs {
options: { acl: '' },
},
],
+
+ // AARAV ADD //
+ [
+ DocumentType.JOURNAL,
+ {
+ layout: { view: EmptyBox, dataField: 'text' },
+ options: {
+ title: 'Daily Journal',
+ acl_Guest: SharingPermissions.View,
+ },
+ },
+ ],
+
+ [
+ DocumentType.TASK,
+ {
+ layout: { view: EmptyBox, dataField: 'text' },
+ options: {
+ title: 'Task',
+ acl_Guest: SharingPermissions.View,
+ },
+ },
+ ],
+ // AARAV ADD //
]);
const suffix = 'Proto';
@@ -938,31 +972,6 @@ export namespace Docs {
// AARAV ADD //
export function DailyJournalDocument(text: string | RichTextField, options: DocumentOptions = {}, fieldKey: string = 'text') {
- // const getFormattedDate = () => {
- // const date = new Date().toLocaleDateString(undefined, {
- // weekday: 'long',
- // year: 'numeric',
- // month: 'long',
- // day: 'numeric',
- // });
- // return date;
- // };
-
- // const getDailyText = () => {
- // const placeholderText = 'Start writing here...';
- // const dateText = `${getFormattedDate()}`;
-
- // return RichTextField.textToRtfFormat(
- // [
- // { text: 'Journal Entry:', styles: { bold: true, color: 'black', fontSize: 20 } },
- // { text: dateText, styles: { italic: true, color: 'gray', fontSize: 15 } },
- // { text: placeholderText, styles: { fontSize: 14, color: 'gray' } },
- // ],
- // undefined,
- // placeholderText.length
- // );
- // };
-
return InstanceFromProto(
Prototypes.get(DocumentType.JOURNAL),
'',
@@ -975,7 +984,18 @@ export namespace Docs {
);
}
- // AARAV ADD //
+ export function TaskDocument(text = '', options: DocumentOptions = {}, fieldKey = 'text') {
+ return InstanceFromProto(
+ Prototypes.get(DocumentType.TASK),
+ '',
+ {
+ title: '',
+ ...options,
+ },
+ undefined,
+ fieldKey
+ );
+ }
export function LinkDocument(source: Doc, target: Doc, options: DocumentOptions = {}, id?: string) {
const linkDoc = InstanceFromProto(