@things-factory/worklist 10.1.209 → 10.1.212
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-client/pages/todo/done-list-calendar-page.d.ts +16 -3
- package/dist-client/pages/todo/done-list-calendar-page.js +107 -19
- package/dist-client/pages/todo/done-list-calendar-page.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-client/work-calendar-sources.d.ts +24 -6
- package/dist-client/work-calendar-sources.js +18 -6
- package/dist-client/work-calendar-sources.js.map +1 -1
- package/package.json +9 -9
- package/translations/en.json +3 -0
- package/translations/es.json +3 -0
- package/translations/ja.json +3 -0
- package/translations/ko.json +3 -0
- package/translations/ms.json +3 -0
- package/translations/zh.json +3 -0
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* 「내 업무 달력」 answers "what must I do on which day". The to-dos and approvals are worklist's own; a meeting I am
|
|
5
5
|
* called to, a day my leave starts, are other modules' facts on the same day. A product registers a source for each:
|
|
6
6
|
* it reads only the caller's own entries, through doors of its own, and says where an entry opens. worklist places
|
|
7
|
-
* them with its own on the grid, in one order, under one per-day limit.
|
|
7
|
+
* them with its own on the grid, in one order, under one per-day limit, and gives each a chip to show or hide it.
|
|
8
8
|
*
|
|
9
9
|
* A source that fails is said as such on the calendar - never read as a day with nothing on it.
|
|
10
10
|
*/
|
|
@@ -15,8 +15,12 @@ export interface WorkCalendarEntry {
|
|
|
15
15
|
name: string;
|
|
16
16
|
/** When it falls - its time is shown, its day places it. */
|
|
17
17
|
date: string | Date;
|
|
18
|
-
/**
|
|
19
|
-
|
|
18
|
+
/**
|
|
19
|
+
* 0 - to act on that day (a due item, a meeting, my own leave) · 1 - arrived that day · 2 - over (done, cancelled) ·
|
|
20
|
+
* 3 - someone else's day (a colleague on leave): after everything of one's own, so a department's leave never pushes
|
|
21
|
+
* one's own work past the day's limit.
|
|
22
|
+
*/
|
|
23
|
+
rank: 0 | 1 | 2 | 3;
|
|
20
24
|
/** 0..3, the most urgent last - the colour of the entry. */
|
|
21
25
|
priority?: number;
|
|
22
26
|
/** Material Symbols name drawn before it. */
|
|
@@ -25,22 +29,36 @@ export interface WorkCalendarEntry {
|
|
|
25
29
|
href?: string;
|
|
26
30
|
/** What the entry's place means, for the tooltip - 「due this day」, 「meeting at 09:00」. */
|
|
27
31
|
note?: string;
|
|
32
|
+
/** The whole day - a day of leave, a payday: no time is drawn, as none was ever set. */
|
|
33
|
+
allDay?: boolean;
|
|
28
34
|
}
|
|
29
35
|
export interface WorkCalendarSource {
|
|
30
36
|
/** Unique - a second registration with the same key replaces the first. */
|
|
31
37
|
key: string;
|
|
38
|
+
/** What its filter chip says, in the reader's language - asked each time it is drawn. */
|
|
39
|
+
label(): string;
|
|
40
|
+
/**
|
|
41
|
+
* Whether the source has anything for this person at all - a department's leave for one who heads none does not.
|
|
42
|
+
* Asked once when the calendar opens; a source that does not apply gets no chip. Left out, it applies.
|
|
43
|
+
*/
|
|
44
|
+
applies?(): Promise<boolean>;
|
|
32
45
|
/** The caller's own entries that fall in [from, to). */
|
|
33
46
|
load(from: Date, to: Date): Promise<WorkCalendarEntry[]>;
|
|
34
47
|
}
|
|
35
48
|
export declare function registerWorkCalendarSource(source: WorkCalendarSource): void;
|
|
36
49
|
export declare function workCalendarSources(): WorkCalendarSource[];
|
|
37
50
|
/**
|
|
38
|
-
*
|
|
51
|
+
* The sources that have anything for this person - asked apart, so one that cannot answer is kept: its chip then says
|
|
52
|
+
* it was not read, rather than the calendar dropping it as if it had nothing.
|
|
53
|
+
*/
|
|
54
|
+
export declare function applyingSources(sources: WorkCalendarSource[]): Promise<WorkCalendarSource[]>;
|
|
55
|
+
/**
|
|
56
|
+
* Every source asked apart, for one window: one that fails leaves the others' entries, and `failed` names it - a
|
|
39
57
|
* calendar that read nothing from a source must not look like a week with nothing in it.
|
|
40
58
|
*/
|
|
41
|
-
export declare function loadWorkCalendar(loads: Promise<WorkCalendarEntry[]>[]): Promise<{
|
|
59
|
+
export declare function loadWorkCalendar(loads: [key: string, entries: Promise<WorkCalendarEntry[]>][]): Promise<{
|
|
42
60
|
entries: WorkCalendarEntry[];
|
|
43
|
-
failed:
|
|
61
|
+
failed: string[];
|
|
44
62
|
}>;
|
|
45
63
|
/**
|
|
46
64
|
* One day's entries in the order they are drawn, cut to the limit **after** ordering: what is to be done that day
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* 「내 업무 달력」 answers "what must I do on which day". The to-dos and approvals are worklist's own; a meeting I am
|
|
5
5
|
* called to, a day my leave starts, are other modules' facts on the same day. A product registers a source for each:
|
|
6
6
|
* it reads only the caller's own entries, through doors of its own, and says where an entry opens. worklist places
|
|
7
|
-
* them with its own on the grid, in one order, under one per-day limit.
|
|
7
|
+
* them with its own on the grid, in one order, under one per-day limit, and gives each a chip to show or hide it.
|
|
8
8
|
*
|
|
9
9
|
* A source that fails is said as such on the calendar - never read as a day with nothing on it.
|
|
10
10
|
*/
|
|
@@ -16,20 +16,32 @@ export function workCalendarSources() {
|
|
|
16
16
|
return [...SOURCES.values()];
|
|
17
17
|
}
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
19
|
+
* The sources that have anything for this person - asked apart, so one that cannot answer is kept: its chip then says
|
|
20
|
+
* it was not read, rather than the calendar dropping it as if it had nothing.
|
|
21
|
+
*/
|
|
22
|
+
export async function applyingSources(sources) {
|
|
23
|
+
const answers = await Promise.allSettled(sources.map(source => (source.applies ? source.applies() : Promise.resolve(true))));
|
|
24
|
+
return sources.filter((_, index) => {
|
|
25
|
+
const answer = answers[index];
|
|
26
|
+
return answer.status === 'rejected' || answer.value;
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Every source asked apart, for one window: one that fails leaves the others' entries, and `failed` names it - a
|
|
20
31
|
* calendar that read nothing from a source must not look like a week with nothing in it.
|
|
21
32
|
*/
|
|
22
33
|
export async function loadWorkCalendar(loads) {
|
|
23
34
|
const entries = [];
|
|
24
|
-
|
|
25
|
-
|
|
35
|
+
const failed = [];
|
|
36
|
+
const outcomes = await Promise.allSettled(loads.map(([, load]) => load));
|
|
37
|
+
outcomes.forEach((outcome, index) => {
|
|
26
38
|
if (outcome.status === 'fulfilled')
|
|
27
39
|
entries.push(...outcome.value);
|
|
28
40
|
else {
|
|
29
|
-
failed
|
|
41
|
+
failed.push(loads[index][0]);
|
|
30
42
|
console.error(outcome.reason);
|
|
31
43
|
}
|
|
32
|
-
}
|
|
44
|
+
});
|
|
33
45
|
return { entries, failed };
|
|
34
46
|
}
|
|
35
47
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"work-calendar-sources.js","sourceRoot":"","sources":["../client/work-calendar-sources.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;
|
|
1
|
+
{"version":3,"file":"work-calendar-sources.js","sourceRoot":"","sources":["../client/work-calendar-sources.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAyCH,MAAM,OAAO,GAAG,IAAI,GAAG,EAA8B,CAAA;AAErD,MAAM,UAAU,0BAA0B,CAAC,MAA0B;IACnE,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,CAAA;AACjC,CAAC;AAED,MAAM,UAAU,mBAAmB;IACjC,OAAO,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAAA;AAC9B,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,OAA6B;IACjE,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAA;IAC5H,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,K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I,IAAI,CAAC,CAAC,CAAC,QAAQ,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,IAAI,CAAC,CAAC,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC,CAAA;IACtI,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAA;IACtC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,EAAE,CAAA;AAC1D,CAAC","sourcesContent":["/**\n * What else a person's work calendar shows — **the calendar is worklist's, what goes on it is not all worklist's.**\n *\n * 「내 업무 달력」 answers \"what must I do on which day\". The to-dos and approvals are worklist's own; a meeting I am\n * called to, a day my leave starts, are other modules' facts on the same day. A product registers a source for each:\n * it reads only the caller's own entries, through doors of its own, and says where an entry opens. worklist places\n * them with its own on the grid, in one order, under one per-day limit, and gives each a chip to show or hide it.\n *\n * A source that fails is said as such on the calendar - never read as a day with nothing on it.\n */\n\nexport interface WorkCalendarEntry {\n /** Unique within its source. */\n id: string\n /** What the entry is, in a line. */\n name: string\n /** When it falls - its time is shown, its day places it. */\n date: string | Date\n /**\n * 0 - to act on that day (a due item, a meeting, my own leave) · 1 - arrived that day · 2 - over (done, cancelled) ·\n * 3 - someone else's day (a colleague on leave): after everything of one's own, so a department's leave never pushes\n * one's own work past the day's limit.\n */\n rank: 0 | 1 | 2 | 3\n /** 0..3, the most urgent last - the colour of the entry. */\n priority?: number\n /** Material Symbols name drawn before it. */\n icon?: string\n /** Where it opens - none when the person may not open it; the entry is then shown, not linked. */\n href?: string\n /** What the entry's place means, for the tooltip - 「due this day」, 「meeting at 09:00」. */\n note?: string\n /** The whole day - a day of leave, a payday: no time is drawn, as none was ever set. */\n allDay?: boolean\n}\n\nexport interface WorkCalendarSource {\n /** Unique - a second registration with the same key replaces the first. */\n key: string\n /** What its filter chip says, in the reader's language - asked each time it is drawn. */\n label(): string\n /**\n * Whether the source has anything for this person at all - a department's leave for one who heads none does not.\n * Asked once when the calendar opens; a source that does not apply gets no chip. Left out, it applies.\n */\n applies?(): Promise<boolean>\n /** The caller's own entries that fall in [from, to). */\n load(from: Date, to: Date): Promise<WorkCalendarEntry[]>\n}\n\nconst SOURCES = new Map<string, WorkCalendarSource>()\n\nexport function registerWorkCalendarSource(source: WorkCalendarSource): void {\n SOURCES.set(source.key, source)\n}\n\nexport function workCalendarSources(): WorkCalendarSource[] {\n return [...SOURCES.values()]\n}\n\n/**\n * The sources that have anything for this person - asked apart, so one that cannot answer is kept: its chip then says\n * it was not read, rather than the calendar dropping it as if it had nothing.\n */\nexport async function applyingSources(sources: WorkCalendarSource[]): Promise<WorkCalendarSource[]> {\n const answers = await Promise.allSettled(sources.map(source => (source.applies ? source.applies() : Promise.resolve(true))))\n return sources.filter((_, index) => {\n const answer = answers[index]\n return answer.status === 'rejected' || answer.value\n })\n}\n\n/**\n * Every source asked apart, for one window: one that fails leaves the others' entries, and `failed` names it - a\n * calendar that read nothing from a source must not look like a week with nothing in it.\n */\nexport async function loadWorkCalendar(loads: [key: string, entries: Promise<WorkCalendarEntry[]>][]): Promise<{ entries: WorkCalendarEntry[]; failed: string[] }> {\n const entries: WorkCalendarEntry[] = []\n const failed: string[] = []\n const outcomes = await Promise.allSettled(loads.map(([, load]) => load))\n outcomes.forEach((outcome, index) => {\n if (outcome.status === 'fulfilled') entries.push(...outcome.value)\n else {\n failed.push(loads[index][0])\n console.error(outcome.reason)\n }\n })\n return { entries, failed }\n}\n\n/**\n * One day's entries in the order they are drawn, cut to the limit **after** ordering: what is to be done that day\n * first, then what arrived that day, then what is over; within each the more urgent, then the earlier. `hidden` is\n * how many the limit left out - said as a number, never as more rows.\n */\nexport function entriesOfDay(entries: WorkCalendarEntry[], localDay: string, limit: number) {\n const ofTheDay = entries\n .filter(entry => new Date(entry.date).toLocaleDateString() == localDay)\n .sort((a, b) => a.rank - b.rank || (b.priority || 0) - (a.priority || 0) || new Date(a.date).getTime() - new Date(b.date).getTime())\n const shown = ofTheDay.slice(0, limit)\n return { shown, hidden: ofTheDay.length - shown.length }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@things-factory/worklist",
|
|
3
|
-
"version": "10.1.
|
|
3
|
+
"version": "10.1.212",
|
|
4
4
|
"main": "dist-server/index.js",
|
|
5
5
|
"browser": "dist-client/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -54,15 +54,15 @@
|
|
|
54
54
|
"@operato/moment-timezone-es": "^10.0.0",
|
|
55
55
|
"@operato/p13n": "^10.29.43",
|
|
56
56
|
"@operato/popup": "^10.29.43",
|
|
57
|
-
"@things-factory/attachment-base": "^10.1.
|
|
58
|
-
"@things-factory/auth-base": "^10.1.
|
|
59
|
-
"@things-factory/board-service": "^10.1.
|
|
57
|
+
"@things-factory/attachment-base": "^10.1.212",
|
|
58
|
+
"@things-factory/auth-base": "^10.1.212",
|
|
59
|
+
"@things-factory/board-service": "^10.1.212",
|
|
60
60
|
"@things-factory/context-ui": "^10.1.208",
|
|
61
|
-
"@things-factory/i18n-base": "^10.1.
|
|
62
|
-
"@things-factory/organization": "^10.1.
|
|
63
|
-
"@things-factory/personalization": "^10.1.
|
|
64
|
-
"@things-factory/scheduler-client": "^10.1.
|
|
61
|
+
"@things-factory/i18n-base": "^10.1.212",
|
|
62
|
+
"@things-factory/organization": "^10.1.212",
|
|
63
|
+
"@things-factory/personalization": "^10.1.212",
|
|
64
|
+
"@things-factory/scheduler-client": "^10.1.212",
|
|
65
65
|
"@things-factory/shell": "^10.1.208"
|
|
66
66
|
},
|
|
67
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "1e1cdb79fca2915580429af451b6cf1dae653a93"
|
|
68
68
|
}
|
package/translations/en.json
CHANGED
|
@@ -251,6 +251,9 @@
|
|
|
251
251
|
"text.approver-not-yet": "none yet",
|
|
252
252
|
"text.assign": "assign",
|
|
253
253
|
"text.calendar-not-loaded": "could not load the calendar. reload to try again.",
|
|
254
|
+
"text.calendar-kind-not-loaded": "not loaded",
|
|
255
|
+
"label.calendar-kinds": "what is shown",
|
|
256
|
+
"label.calendar-my-work": "to-dos and approvals",
|
|
254
257
|
"text.catalog-not-loaded": "could not load the activity catalog.",
|
|
255
258
|
"text.copy-failed": "could not copy",
|
|
256
259
|
"text.copy-payload": "copy this value as raw json",
|
package/translations/es.json
CHANGED
|
@@ -251,6 +251,9 @@
|
|
|
251
251
|
"text.approver-not-yet": "ninguno todavía",
|
|
252
252
|
"text.assign": "asignar",
|
|
253
253
|
"text.calendar-not-loaded": "no se pudo cargar el calendario. vuelva a cargar para reintentar.",
|
|
254
|
+
"text.calendar-kind-not-loaded": "no cargado",
|
|
255
|
+
"label.calendar-kinds": "lo que se muestra",
|
|
256
|
+
"label.calendar-my-work": "tareas y aprobaciones",
|
|
254
257
|
"text.catalog-not-loaded": "no se pudo cargar el catálogo de actividades.",
|
|
255
258
|
"text.copy-failed": "no se pudo copiar",
|
|
256
259
|
"text.copy-payload": "copiar este valor como JSON sin procesar",
|
package/translations/ja.json
CHANGED
|
@@ -251,6 +251,9 @@
|
|
|
251
251
|
"text.approver-not-yet": "未定",
|
|
252
252
|
"text.assign": "割当",
|
|
253
253
|
"text.calendar-not-loaded": "カレンダーを読み込めませんでした。再読み込みしてもう一度お試しください。",
|
|
254
|
+
"text.calendar-kind-not-loaded": "読み込めず",
|
|
255
|
+
"label.calendar-kinds": "表示するもの",
|
|
256
|
+
"label.calendar-my-work": "やること・決裁",
|
|
254
257
|
"text.catalog-not-loaded": "業務カタログを読み込めませんでした。",
|
|
255
258
|
"text.copy-failed": "コピーできません",
|
|
256
259
|
"text.copy-payload": "この値を原文(JSON)でコピーします",
|
package/translations/ko.json
CHANGED
|
@@ -251,6 +251,9 @@
|
|
|
251
251
|
"text.approver-not-yet": "아직 없음",
|
|
252
252
|
"text.assign": "할당",
|
|
253
253
|
"text.calendar-not-loaded": "달력을 불러오지 못했습니다. 새로고침한 뒤 다시 시도하십시오.",
|
|
254
|
+
"text.calendar-kind-not-loaded": "못 불러옴",
|
|
255
|
+
"label.calendar-kinds": "보이는 것",
|
|
256
|
+
"label.calendar-my-work": "할 일·결재",
|
|
254
257
|
"text.catalog-not-loaded": "업무 카탈로그를 불러오지 못했습니다.",
|
|
255
258
|
"text.copy-failed": "복사할 수 없습니다",
|
|
256
259
|
"text.copy-payload": "이 값을 원문(JSON)으로 복사합니다",
|
package/translations/ms.json
CHANGED
|
@@ -251,6 +251,9 @@
|
|
|
251
251
|
"text.approver-not-yet": "belum ada",
|
|
252
252
|
"text.assign": "berikan",
|
|
253
253
|
"text.calendar-not-loaded": "kalendar tidak dapat dimuatkan. muat semula untuk mencuba lagi.",
|
|
254
|
+
"text.calendar-kind-not-loaded": "tidak dimuatkan",
|
|
255
|
+
"label.calendar-kinds": "yang ditunjukkan",
|
|
256
|
+
"label.calendar-my-work": "tugasan dan kelulusan",
|
|
254
257
|
"text.catalog-not-loaded": "katalog kerja tidak dapat dimuatkan.",
|
|
255
258
|
"text.copy-failed": "tidak dapat menyalin",
|
|
256
259
|
"text.copy-payload": "salin nilai ini sebagai json asal",
|
package/translations/zh.json
CHANGED
|
@@ -251,6 +251,9 @@
|
|
|
251
251
|
"text.approver-not-yet": "尚未确定",
|
|
252
252
|
"text.assign": "分配",
|
|
253
253
|
"text.calendar-not-loaded": "无法加载日历。请刷新后重试。",
|
|
254
|
+
"text.calendar-kind-not-loaded": "未加载",
|
|
255
|
+
"label.calendar-kinds": "显示内容",
|
|
256
|
+
"label.calendar-my-work": "待办与审批",
|
|
254
257
|
"text.catalog-not-loaded": "无法加载业务目录。",
|
|
255
258
|
"text.copy-failed": "无法复制",
|
|
256
259
|
"text.copy-payload": "以原始 JSON 复制此值",
|