@ehfuse/taskbox 0.10.30 → 0.10.31
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/drawers/TaskDetailBody.d.ts +7 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.esm.js +15 -15
- package/dist/index.esm.js.map +4 -4
- package/dist/index.js +27 -27
- package/dist/index.js.map +4 -4
- package/dist/sections/TaskContributionSection.d.ts +21 -0
- package/dist/state/useTaskDetailForm.d.ts +4 -2
- package/dist/types/item.d.ts +6 -0
- package/dist/utils/taskContribution.d.ts +30 -0
- package/package.json +1 -1
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 상세 드로어의 "기여도" 섹션(0.10.31) — 관여자(책임자 · 참조자)마다 몫(%)을 적는다. 합은 100% 여야 저장된다.
|
|
3
|
+
* 소비처가 조직 설정으로 켠 업무에만 선다(TaskDetailBody 의 contributionEnabled — 일정 · 공지 · 글에는 없다).
|
|
4
|
+
*
|
|
5
|
+
* 값은 상세 폼(useTaskDetailForm)의 "contributions.<계정 seq>" 칸이다 — 한 사람의 몫을 고치면 그 줄과 합계만 다시 그린다.
|
|
6
|
+
* 칸을 벗어날 때(Enter · blur) 합이 100 이면 바로 저장하고, 아니면 저장하지 않고 합계를 빨갛게 둔다
|
|
7
|
+
* (99% 인 채로 저장되면 월별 집계가 어긋난다 — 서버도 받지 않는다).
|
|
8
|
+
*/
|
|
9
|
+
import type { TaskBoxContribution } from "../types";
|
|
10
|
+
import { type TaskDetailForm } from "../state/useTaskDetailForm";
|
|
11
|
+
import { type TaskContributionParticipant } from "../utils/taskContribution";
|
|
12
|
+
/** 기여도 섹션 props. */
|
|
13
|
+
export interface TaskContributionSectionProps {
|
|
14
|
+
form: TaskDetailForm;
|
|
15
|
+
participants: TaskContributionParticipant[];
|
|
16
|
+
readOnly: boolean;
|
|
17
|
+
avatarSrcByName?: Map<string, string>;
|
|
18
|
+
onSave: (contributions: TaskBoxContribution[]) => void;
|
|
19
|
+
}
|
|
20
|
+
/** 기여도 섹션. */
|
|
21
|
+
export declare function TaskContributionSection({ form, participants, readOnly, avatarSrcByName, onSave }: TaskContributionSectionProps): import("react").JSX.Element;
|
|
@@ -34,14 +34,16 @@ export interface TaskDetailFormValues {
|
|
|
34
34
|
bug_where: string;
|
|
35
35
|
bug_version: string;
|
|
36
36
|
resolution: string;
|
|
37
|
+
/** 기여도(0.10.31) — 계정 seq → % 글. 줄마다 "contributions.<seq>" 경로만 구독해 한 사람의 몫을 고치면 그 줄만 다시 그린다. */
|
|
38
|
+
contributions: Record<string, string>;
|
|
37
39
|
}
|
|
38
40
|
/** 상세 폼이 맡는 업무 칸 — 본문 memo 비교는 이 칸들을 보지 않는다(옛 사전알림 칸 reminder 는 reminders 로 읽힌다). */
|
|
39
|
-
export declare const TASK_DETAIL_FORM_FIELDS: readonly ["title", "status", "priority", "start_date", "due_date", "reminders", "tab_key", "label_keys", "note", "event_time", "event_place", "event_address", "story_points", "sprint_seq", "bug_repro", "bug_device", "bug_where", "bug_version", "resolution"];
|
|
41
|
+
export declare const TASK_DETAIL_FORM_FIELDS: readonly ["title", "status", "priority", "start_date", "due_date", "reminders", "tab_key", "label_keys", "note", "event_time", "event_place", "event_address", "story_points", "sprint_seq", "bug_repro", "bug_device", "bug_where", "bug_version", "resolution", "contributions"];
|
|
40
42
|
/** 상세 폼 인스턴스 타입이다. */
|
|
41
43
|
export type TaskDetailForm = UseGlobalFormReturn<TaskDetailFormValues>;
|
|
42
44
|
/** 업무에서 상세 폼 값을 뽑는다(빈 값은 칸마다 같은 꼴로 — 비교가 undefined/"" 차이로 흔들리지 않게). */
|
|
43
45
|
export declare function taskToDetailFormValues(task: TaskBoxItem): TaskDetailFormValues;
|
|
44
|
-
/** 값 비교 — 배열(라벨 · 사전알림)은
|
|
46
|
+
/** 값 비교 — 배열(라벨 · 사전알림)은 내용으로, 평평한 객체(기여도 seq → %)는 키 · 값으로 본다. */
|
|
45
47
|
export declare function sameDetailValue(a: unknown, b: unknown): boolean;
|
|
46
48
|
/** 상세 폼 묶음 — 본문의 칸들이 컨텍스트로 받는다(모두 인스턴스 동안 같은 참조다). */
|
|
47
49
|
export interface TaskDetailFormHandle {
|
package/dist/types/item.d.ts
CHANGED
|
@@ -81,6 +81,11 @@ export type TaskBoxReminder = "none" | "min30_before" | "hour1_before" | "hour2_
|
|
|
81
81
|
/** 업무함 목록 한 건이다. */
|
|
82
82
|
/** 공개 범위다 — involved=비공개(관여자만)/group=부서공개/all=전체공개. */
|
|
83
83
|
export type TaskBoxVisibility = "involved" | "group" | "all";
|
|
84
|
+
/** 업무 기여도 한 줄(0.10.31) — 관여자 계정과 그 몫(0~100 정수 %). */
|
|
85
|
+
export interface TaskBoxContribution {
|
|
86
|
+
account_seq: number;
|
|
87
|
+
percent: number;
|
|
88
|
+
}
|
|
84
89
|
/** 반복 주기다(업무·일정 — 빈 값=반복 없음). */
|
|
85
90
|
export type TaskBoxRepeatRule = "daily" | "weekly" | "monthly" | "yearly";
|
|
86
91
|
export interface TaskBoxItem {
|
|
@@ -145,6 +150,7 @@ export interface TaskBoxItem {
|
|
|
145
150
|
icon_color?: string;
|
|
146
151
|
estimated_time?: string;
|
|
147
152
|
checklist?: TaskBoxChecklistItem[];
|
|
153
|
+
contributions?: TaskBoxContribution[];
|
|
148
154
|
attachments?: TaskBoxAttachment[];
|
|
149
155
|
comments?: TaskBoxComment[];
|
|
150
156
|
comment_count?: number;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 업무 기여도(0.10.31) — 관여자(책임자 + 참조자)마다 몫(%)을 적고 합은 100 이다.
|
|
3
|
+
* 소비처가 조직 설정으로 켠 업무에만 상세 드로어의 "기여도" 섹션이 선다(TaskDetailBody 의 contributionEnabled).
|
|
4
|
+
*
|
|
5
|
+
* 아직 나누지 않은 업무(빈 목록)는 기본값으로 보인다 — 책임자 100%, 책임자가 없으면 참조자끼리 똑같이.
|
|
6
|
+
* 저장한 뒤 관여자가 바뀌면 남은 사람의 값은 두고 새 사람은 0 이다(합이 어긋나면 섹션이 빨갛게 알린다).
|
|
7
|
+
* 서버 집계(월별 기여도)도 같은 기본값 규칙을 쓴다(taskham as/app/routes/taskbox/services/contribution.ts).
|
|
8
|
+
*/
|
|
9
|
+
import type { TaskBoxContribution, TaskBoxItem } from "../types";
|
|
10
|
+
/** 기여도를 나누는 사람 한 명. */
|
|
11
|
+
export interface TaskContributionParticipant {
|
|
12
|
+
account_seq: number;
|
|
13
|
+
name: string;
|
|
14
|
+
role: "manager" | "receiver";
|
|
15
|
+
}
|
|
16
|
+
/** 기여도 대상 — 책임자가 앞, 그다음 참조자(계정이 이어진 사람만 — 샘플 · 외부 이름만 있는 칸은 뺀다). */
|
|
17
|
+
export declare function getContributionParticipants(task: TaskBoxItem): TaskContributionParticipant[];
|
|
18
|
+
/** 100 을 n 명에게 똑같이 — 나머지는 앞사람부터 1 씩(3명이면 34 · 33 · 33). */
|
|
19
|
+
export declare function splitContributionEvenly(count: number): number[];
|
|
20
|
+
/**
|
|
21
|
+
* 지금 보일 몫 — 저장한 값이 있으면 그것(목록에 없는 새 관여자는 0), 없으면 기본값.
|
|
22
|
+
* 키는 계정 seq 문자열이고 값은 % 글이다(상세 폼이 칸마다 점 경로로 구독한다 — "contributions.12").
|
|
23
|
+
*/
|
|
24
|
+
export declare function resolveContributionValues(task: TaskBoxItem): Record<string, string>;
|
|
25
|
+
/** 몫 글 하나를 0~100 정수로 읽는다(틀리면 null). */
|
|
26
|
+
export declare function parseContributionPercent(raw: string): number | null;
|
|
27
|
+
/** 합계(틀린 글은 0 으로 센다). */
|
|
28
|
+
export declare function sumContributionValues(values: Record<string, string>, participants: TaskContributionParticipant[]): number;
|
|
29
|
+
/** 저장할 꼴로 바꾼다(관여자 차례). */
|
|
30
|
+
export declare function toContributionList(values: Record<string, string>, participants: TaskContributionParticipant[]): TaskBoxContribution[];
|
package/package.json
CHANGED