@haiiro/docuflow 0.0.1 → 0.0.3

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.
Files changed (136) hide show
  1. package/{.twenty/output/manifest.json → manifest.json} +9 -9
  2. package/package.json +15 -3
  3. package/{.twenty/output/src → src}/front-components/docflow-documents.front-component.mjs +24 -24
  4. package/src/front-components/docflow-documents.front-component.tsx +21 -6
  5. package/{.twenty/output/src → src}/front-components/docflow-processes.front-component.mjs +18 -18
  6. package/{.twenty/output/src → src}/front-components/docflow-tasks.front-component.mjs +18 -18
  7. package/{.twenty/output/src → src}/front-components/process-steps.front-component.mjs +19 -19
  8. package/src/front-components/process-steps.front-component.tsx +6 -1
  9. package/{.twenty/output/src → src}/front-components/task-form.front-component.mjs +24 -24
  10. package/{.twenty/output/src → src}/logic-functions/launch-process.logic-function.mjs +14 -0
  11. package/src/logic-functions/launch-process.logic-function.ts +5 -0
  12. package/{.twenty/output/src → src}/logic-functions/save-launch-fields.logic-function.mjs +14 -0
  13. package/src/logic-functions/save-launch-fields.logic-function.ts +5 -0
  14. package/.gitignore +0 -43
  15. package/.nvmrc +0 -1
  16. package/.oxlintrc.json +0 -37
  17. package/.twenty/output/README.md +0 -128
  18. package/.twenty/output/package.json +0 -49
  19. package/.twenty/output/public/cover.svg +0 -15
  20. package/.twenty/output/public/logo.svg +0 -9
  21. package/.twenty/output/src/front-components/docflow-documents.front-component.tsx +0 -516
  22. package/.twenty/output/src/front-components/docflow-processes.front-component.tsx +0 -266
  23. package/.twenty/output/src/front-components/docflow-tasks.front-component.tsx +0 -303
  24. package/.twenty/output/src/front-components/process-steps.front-component.tsx +0 -286
  25. package/.twenty/output/src/front-components/task-form.front-component.tsx +0 -29
  26. package/.twenty/output/src/logic-functions/bitrix-app.logic-function.ts +0 -143
  27. package/.twenty/output/src/logic-functions/bitrix-event.logic-function.ts +0 -54
  28. package/.twenty/output/src/logic-functions/bitrix-install.logic-function.ts +0 -81
  29. package/.twenty/output/src/logic-functions/capture-file.logic-function.ts +0 -32
  30. package/.twenty/output/src/logic-functions/complete-task.logic-function.ts +0 -46
  31. package/.twenty/output/src/logic-functions/hand-out-form-step.logic-function.ts +0 -30
  32. package/.twenty/output/src/logic-functions/health-check.ts +0 -31
  33. package/.twenty/output/src/logic-functions/launch-parameters-step.logic-function.ts +0 -33
  34. package/.twenty/output/src/logic-functions/launch-process.logic-function.ts +0 -96
  35. package/.twenty/output/src/logic-functions/notify-bitrix-assignee.logic-function.ts +0 -85
  36. package/.twenty/output/src/logic-functions/on-attachment-created.logic-function.ts +0 -67
  37. package/.twenty/output/src/logic-functions/on-task-updated.logic-function.ts +0 -71
  38. package/.twenty/output/src/logic-functions/on-workflow-run-updated.logic-function.ts +0 -70
  39. package/.twenty/output/src/logic-functions/save-launch-fields.logic-function.ts +0 -73
  40. package/.twenty/output/src/logic-functions/save-step-settings.logic-function.ts +0 -90
  41. package/.twenty/output/src/logic-functions/save-task-form.logic-function.ts +0 -62
  42. package/.twenty/output/yarn.lock +0 -3292
  43. package/.yarn/install-state.gz +0 -0
  44. package/.yarnrc.yml +0 -1
  45. package/dist/tsconfig.spec.tsbuildinfo +0 -1
  46. package/src/__tests__/api-and-bitrix.test.ts +0 -89
  47. package/src/__tests__/form-fields.test.ts +0 -73
  48. package/src/__tests__/launch-parameters.test.ts +0 -75
  49. package/src/__tests__/step-settings.test.ts +0 -39
  50. package/src/__tests__/workflow-run.test.ts +0 -113
  51. package/src/application-config.ts +0 -58
  52. package/src/fields/company-documents.field.ts +0 -29
  53. package/src/fields/document-author.field.ts +0 -32
  54. package/src/fields/document-counterparty.field.ts +0 -32
  55. package/src/fields/document-folder-child-folders.field.ts +0 -23
  56. package/src/fields/document-folder-documents.field.ts +0 -24
  57. package/src/fields/document-folder-parent-folder.field.ts +0 -31
  58. package/src/fields/document-folder.field.ts +0 -32
  59. package/src/fields/document-responsible.field.ts +0 -32
  60. package/src/fields/member-authored-documents.field.ts +0 -29
  61. package/src/fields/member-responsible-documents.field.ts +0 -29
  62. package/src/fields/task-form-schema.field.ts +0 -21
  63. package/src/fields/task-form-values.field.ts +0 -21
  64. package/src/fields/task-instruction.field.ts +0 -21
  65. package/src/fields/task-section.field.ts +0 -36
  66. package/src/fields/task-workflow-run-id.field.ts +0 -21
  67. package/src/fields/task-workflow-step-id.field.ts +0 -21
  68. package/src/fields/task-workflow-thread-id.field.ts +0 -21
  69. package/src/fields/workflow-launch-fields.field.ts +0 -21
  70. package/src/fields/workflow-section.field.ts +0 -36
  71. package/src/front/api.ts +0 -56
  72. package/src/front/format.ts +0 -60
  73. package/src/front/hooks/use-async.ts +0 -54
  74. package/src/front/hooks/use-workspace-members.ts +0 -22
  75. package/src/front/types.ts +0 -48
  76. package/src/front/ui/components.tsx +0 -436
  77. package/src/front/ui/form-field-inputs.tsx +0 -187
  78. package/src/front/ui/form-fields-builder.tsx +0 -183
  79. package/src/front/ui/task-work-panel.tsx +0 -218
  80. package/src/navigation-menu-items/docflow.navigation-menu-item.ts +0 -15
  81. package/src/objects/document-folder.object.ts +0 -80
  82. package/src/objects/document.object.ts +0 -312
  83. package/src/page-layouts/docflow.page-layout.ts +0 -86
  84. package/src/page-layouts/task-docflow.page-layout-tab.ts +0 -36
  85. package/src/page-layouts/workflow-steps.page-layout-tab.ts +0 -37
  86. package/src/roles/default-role.ts +0 -21
  87. package/src/roles/docflow-member.role.ts +0 -23
  88. package/src/server/bitrix-page.ts +0 -52
  89. package/src/server/bitrix-portal.ts +0 -67
  90. package/src/server/document-capture.ts +0 -102
  91. package/src/server/http-response.ts +0 -18
  92. package/src/server/launch-step.ts +0 -166
  93. package/src/server/process-tasks.ts +0 -116
  94. package/src/server/records.ts +0 -132
  95. package/src/server/task-completion.ts +0 -100
  96. package/src/server/workflow-engine.ts +0 -105
  97. package/src/shared/api/core-graphql.util.ts +0 -98
  98. package/src/shared/api/object-summaries.ts +0 -79
  99. package/src/shared/api/rest-filter.util.ts +0 -37
  100. package/src/shared/api/rest-response.util.ts +0 -43
  101. package/src/shared/bitrix/bitrix-client.ts +0 -114
  102. package/src/shared/bitrix/bitrix.type.ts +0 -25
  103. package/src/shared/bitrix/bitrix.util.ts +0 -139
  104. package/src/shared/docflow.constants.ts +0 -31
  105. package/src/shared/documents/attachment-target.util.ts +0 -64
  106. package/src/shared/engine.ts +0 -11
  107. package/src/shared/form/form-field-builder.util.ts +0 -122
  108. package/src/shared/form/form-field.type.ts +0 -23
  109. package/src/shared/form/form-fields.util.ts +0 -138
  110. package/src/shared/form/step-settings.util.ts +0 -104
  111. package/src/shared/workflow/launch-step.util.ts +0 -56
  112. package/src/shared/workflow/run-target-record.util.ts +0 -70
  113. package/src/shared/workflow/workflow-run.type.ts +0 -35
  114. package/src/shared/workflow/workflow-run.util.ts +0 -174
  115. package/src/universal-identifiers.ts +0 -199
  116. package/src/views/all-document-folders.view.ts +0 -50
  117. package/src/views/all-documents.view.ts +0 -91
  118. package/src/views/documents-by-status.view.ts +0 -76
  119. package/tsconfig.json +0 -37
  120. package/tsconfig.spec.json +0 -9
  121. package/vitest.unit.config.ts +0 -14
  122. /package/{.twenty/output/front-component-shared-dependencies.mjs → front-component-shared-dependencies.mjs} +0 -0
  123. /package/{.twenty/output/src → src}/logic-functions/bitrix-app.logic-function.mjs +0 -0
  124. /package/{.twenty/output/src → src}/logic-functions/bitrix-event.logic-function.mjs +0 -0
  125. /package/{.twenty/output/src → src}/logic-functions/bitrix-install.logic-function.mjs +0 -0
  126. /package/{.twenty/output/src → src}/logic-functions/capture-file.logic-function.mjs +0 -0
  127. /package/{.twenty/output/src → src}/logic-functions/complete-task.logic-function.mjs +0 -0
  128. /package/{.twenty/output/src → src}/logic-functions/hand-out-form-step.logic-function.mjs +0 -0
  129. /package/{.twenty/output/src → src}/logic-functions/health-check.mjs +0 -0
  130. /package/{.twenty/output/src → src}/logic-functions/launch-parameters-step.logic-function.mjs +0 -0
  131. /package/{.twenty/output/src → src}/logic-functions/notify-bitrix-assignee.logic-function.mjs +0 -0
  132. /package/{.twenty/output/src → src}/logic-functions/on-attachment-created.logic-function.mjs +0 -0
  133. /package/{.twenty/output/src → src}/logic-functions/on-task-updated.logic-function.mjs +0 -0
  134. /package/{.twenty/output/src → src}/logic-functions/on-workflow-run-updated.logic-function.mjs +0 -0
  135. /package/{.twenty/output/src → src}/logic-functions/save-step-settings.logic-function.mjs +0 -0
  136. /package/{.twenty/output/src → src}/logic-functions/save-task-form.logic-function.mjs +0 -0
@@ -1,183 +0,0 @@
1
- import { useState } from 'react';
2
- import { Button } from 'twenty-ui/primitives/input';
3
- import { useTheme } from 'twenty-ui/theme';
4
-
5
- import { CheckboxField, Message, SelectField, TextField, VariableChip } from 'src/front/ui/components';
6
- import { FormFieldInputs } from 'src/front/ui/form-field-inputs';
7
- import { type FormField } from 'src/shared/form/form-field.type';
8
- import {
9
- applyBuilderFieldKind,
10
- BUILDER_FIELD_KINDS,
11
- type BuilderFieldKind,
12
- buildNewBuilderField,
13
- buildUniqueFieldName,
14
- getBuilderFieldKind,
15
- setFieldRequired,
16
- } from 'src/shared/form/form-field-builder.util';
17
- import { isFormFieldRequired } from 'src/shared/form/form-fields.util';
18
-
19
- // Fields are built here instead of written as JSON. A field keeps its name
20
- // once saved: later steps of a process read it as {{step.name}}, so renaming
21
- // the label must not break them. A new field takes its name from the label.
22
- export const FormFieldsBuilder = ({
23
- fields,
24
- onChange,
25
- variablePrefix,
26
- disabled = false,
27
- }: {
28
- fields: FormField[];
29
- onChange: (fields: FormField[]) => void;
30
- variablePrefix?: string;
31
- disabled?: boolean;
32
- }) => {
33
- const theme = useTheme();
34
- const [savedFieldIds] = useState(() => new Set(fields.map(({ id }) => id)));
35
- const [isPreviewShown, setIsPreviewShown] = useState(false);
36
-
37
- const updateField = (fieldId: string, update: (field: FormField) => FormField) =>
38
- onChange(fields.map((field) => (field.id === fieldId ? update(field) : field)));
39
-
40
- const renameField = (field: FormField, label: string): FormField =>
41
- savedFieldIds.has(field.id) || label.trim().length === 0
42
- ? { ...field, label }
43
- : {
44
- ...field,
45
- label,
46
- name: buildUniqueFieldName(
47
- label,
48
- fields.filter(({ id }) => id !== field.id).map(({ name }) => name),
49
- ),
50
- };
51
-
52
- const moveField = (index: number, offset: -1 | 1) => {
53
- const target = index + offset;
54
-
55
- if (target < 0 || target >= fields.length) {
56
- return;
57
- }
58
-
59
- const reordered = [...fields];
60
-
61
- [reordered[index], reordered[target]] = [reordered[target], reordered[index]];
62
- onChange(reordered);
63
- };
64
-
65
- return (
66
- <div style={{ display: 'flex', flexDirection: 'column', gap: theme.spacing[2] }}>
67
- {fields.length === 0 && <Message tone="hint">Полей нет.</Message>}
68
- {fields.map((field, index) => {
69
- const kind = getBuilderFieldKind(field);
70
-
71
- return (
72
- <div
73
- key={field.id}
74
- style={{
75
- background: theme.background.transparent.lighter,
76
- borderRadius: theme.border.radius.md,
77
- display: 'flex',
78
- flexDirection: 'column',
79
- gap: theme.spacing[2],
80
- padding: theme.spacing[2],
81
- }}
82
- >
83
- <div style={{ display: 'flex', flexWrap: 'wrap', gap: theme.spacing[2] }}>
84
- <div style={{ flex: '2 1 180px' }}>
85
- <TextField
86
- label="Название"
87
- placeholder="Например, Сумма договора"
88
- value={field.label}
89
- disabled={disabled}
90
- onChange={(label) => updateField(field.id, (current) => renameField(current, label))}
91
- />
92
- </div>
93
- <div style={{ flex: '1 1 120px' }}>
94
- {kind !== undefined ? (
95
- <SelectField<BuilderFieldKind>
96
- label="Тип"
97
- value={kind}
98
- disabled={disabled}
99
- options={BUILDER_FIELD_KINDS.map(({ value, label }) => ({ value, label }))}
100
- onChange={(nextKind) =>
101
- updateField(field.id, (current) => applyBuilderFieldKind(current, nextKind))
102
- }
103
- />
104
- ) : (
105
- <TextField label="Тип" value={field.type} disabled onChange={() => undefined} />
106
- )}
107
- </div>
108
- </div>
109
- <div style={{ alignItems: 'center', display: 'flex', flexWrap: 'wrap', gap: theme.spacing[2] }}>
110
- <CheckboxField
111
- label="Обязательное"
112
- checked={isFormFieldRequired(field)}
113
- disabled={disabled}
114
- onChange={(isRequired) =>
115
- updateField(field.id, (current) => setFieldRequired(current, isRequired))
116
- }
117
- />
118
- {variablePrefix !== undefined && (
119
- <VariableChip>{`{{${variablePrefix}.${field.name}}}`}</VariableChip>
120
- )}
121
- <div style={{ display: 'flex', gap: theme.spacing[1], marginLeft: 'auto' }}>
122
- <Button
123
- variant="ghost"
124
- size="sm"
125
- title="Выше"
126
- aria-label={`Поднять поле ${field.label}`}
127
- disabled={disabled || index === 0}
128
- onClick={() => moveField(index, -1)}
129
- >
130
- ↑
131
- </Button>
132
- <Button
133
- variant="ghost"
134
- size="sm"
135
- title="Ниже"
136
- aria-label={`Опустить поле ${field.label}`}
137
- disabled={disabled || index === fields.length - 1}
138
- onClick={() => moveField(index, 1)}
139
- >
140
- ↓
141
- </Button>
142
- <Button
143
- variant="ghost"
144
- size="sm"
145
- disabled={disabled}
146
- onClick={() => onChange(fields.filter(({ id }) => id !== field.id))}
147
- >
148
- Удалить
149
- </Button>
150
- </div>
151
- </div>
152
- </div>
153
- );
154
- })}
155
- <div style={{ display: 'flex', flexWrap: 'wrap', gap: theme.spacing[2] }}>
156
- <Button
157
- variant="outline"
158
- size="sm"
159
- disabled={disabled}
160
- onClick={() => onChange([...fields, buildNewBuilderField(fields, () => crypto.randomUUID())])}
161
- >
162
- Добавить поле
163
- </Button>
164
- {fields.length > 0 && (
165
- <Button variant="ghost" size="sm" onClick={() => setIsPreviewShown((current) => !current)}>
166
- {isPreviewShown ? 'Скрыть предпросмотр' : 'Как увидит исполнитель'}
167
- </Button>
168
- )}
169
- </div>
170
- {isPreviewShown && fields.length > 0 && (
171
- <div
172
- style={{
173
- borderRadius: theme.border.radius.md,
174
- boxShadow: `inset 0 0 0 1px ${theme.border.color.light}`,
175
- padding: theme.spacing[3],
176
- }}
177
- >
178
- <FormFieldInputs fields={fields} values={{}} disabled onChange={() => undefined} />
179
- </div>
180
- )}
181
- </div>
182
- );
183
- };
@@ -1,218 +0,0 @@
1
- import { useState } from 'react';
2
- import { enqueueSnackbar } from 'twenty-sdk/front-component';
3
- import { Button } from 'twenty-ui/primitives/input';
4
- import { Tag } from 'twenty-ui/primitives/data-display';
5
- import { useTheme } from 'twenty-ui/theme';
6
-
7
- import { callAppRoute, getErrorMessage, getRecord } from 'src/front/api';
8
- import { formatDate, formatMemberName, isOverdue, TASK_STATUS_LABELS } from 'src/front/format';
9
- import { useAsync } from 'src/front/hooks/use-async';
10
- import { useWorkspaceMembers } from 'src/front/hooks/use-workspace-members';
11
- import { type DocflowTask } from 'src/front/types';
12
- import { Details, Message, SectionTitle } from 'src/front/ui/components';
13
- import { FormFieldInputs } from 'src/front/ui/form-field-inputs';
14
- import { FormFieldsBuilder } from 'src/front/ui/form-fields-builder';
15
- import { TASK_DONE_STATUS } from 'src/shared/docflow.constants';
16
- import { type FormField, type FormValues } from 'src/shared/form/form-field.type';
17
- import { getFormFieldsError, parseFormFields, parseFormValues } from 'src/shared/form/form-fields.util';
18
-
19
- // The one-off fields of a task: the author builds them, the worker fills them.
20
- const TaskFieldsEditor = ({
21
- initialFields,
22
- onSave,
23
- onCancel,
24
- }: {
25
- initialFields: FormField[];
26
- onSave: (fields: FormField[]) => Promise<void>;
27
- onCancel: () => void;
28
- }) => {
29
- const theme = useTheme();
30
- const [fields, setFields] = useState(initialFields);
31
- const [isSaving, setIsSaving] = useState(false);
32
- const [errorMessage, setErrorMessage] = useState<string | undefined>();
33
-
34
- const save = async () => {
35
- const fieldsError = getFormFieldsError(fields);
36
-
37
- if (fieldsError !== undefined) {
38
- setErrorMessage(fieldsError);
39
-
40
- return;
41
- }
42
-
43
- setIsSaving(true);
44
- setErrorMessage(undefined);
45
- await onSave(fields).finally(() => setIsSaving(false));
46
- };
47
-
48
- return (
49
- <div style={{ display: 'flex', flexDirection: 'column', gap: theme.spacing[2] }}>
50
- <FormFieldsBuilder fields={fields} onChange={setFields} disabled={isSaving} />
51
- {errorMessage !== undefined && <Message tone="danger">{errorMessage}</Message>}
52
- <div style={{ display: 'flex', flexWrap: 'wrap', gap: theme.spacing[2] }}>
53
- <Button variant="solid" size="sm" loading={isSaving} onClick={() => void save()}>
54
- Сохранить поля
55
- </Button>
56
- <Button variant="ghost" size="sm" onClick={onCancel}>
57
- Отмена
58
- </Button>
59
- </div>
60
- </div>
61
- );
62
- };
63
-
64
- export const TaskWorkPanel = ({
65
- taskId,
66
- onChanged,
67
- }: {
68
- taskId: string;
69
- onChanged?: () => void;
70
- }) => {
71
- const theme = useTheme();
72
- const { members } = useWorkspaceMembers();
73
- const { data: task, loading, error, reload } = useAsync(
74
- () => getRecord<DocflowTask>('tasks', taskId),
75
- [taskId],
76
- );
77
- const [draftValues, setDraftValues] = useState<FormValues | undefined>();
78
- const [isEditingFields, setIsEditingFields] = useState(false);
79
- const [isBusy, setIsBusy] = useState(false);
80
- const [errorMessage, setErrorMessage] = useState<string | undefined>();
81
-
82
- if (task === undefined) {
83
- return loading ? (
84
- <Message>Загрузка…</Message>
85
- ) : (
86
- <Message tone="danger">{getErrorMessage(error, 'Задание не найдено или нет доступа.')}</Message>
87
- );
88
- }
89
-
90
- const fields = parseFormFields(task.smbFormSchema);
91
- const values = draftValues ?? parseFormValues(task.smbFormValues);
92
- const isProcessTask = typeof task.smbWorkflowThreadId === 'string' && task.smbWorkflowThreadId.length > 0;
93
- const isDone = task.status === TASK_DONE_STATUS;
94
- const assignee = members.find((member) => member.id === task.assigneeId);
95
-
96
- const runAction = async (action: () => Promise<unknown>, successMessage: string, failureMessage: string) => {
97
- setIsBusy(true);
98
- setErrorMessage(undefined);
99
-
100
- try {
101
- await action();
102
- await enqueueSnackbar({ message: successMessage, variant: 'success' });
103
- setDraftValues(undefined);
104
- await reload();
105
- onChanged?.();
106
- } catch (actionError) {
107
- setErrorMessage(getErrorMessage(actionError, failureMessage));
108
- } finally {
109
- setIsBusy(false);
110
- }
111
- };
112
-
113
- return (
114
- <div style={{ display: 'flex', flexDirection: 'column', gap: theme.spacing[3] }}>
115
- <strong style={{ fontSize: theme.font.size.lg }}>{task.title?.trim() || 'Без названия'}</strong>
116
- <Details
117
- rows={[
118
- {
119
- label: 'Статус',
120
- value: <Tag color={isDone ? 'green' : 'gray'}>{TASK_STATUS_LABELS[task.status ?? ''] ?? task.status ?? 'Без статуса'}</Tag>,
121
- },
122
- { label: 'Исполнитель', value: formatMemberName(assignee) },
123
- {
124
- label: 'Срок',
125
- value: task.dueAt && (
126
- <span style={{ color: isOverdue(task.dueAt, task.status, new Date()) ? theme.font.color.danger : undefined }}>
127
- {formatDate(task.dueAt)}
128
- </span>
129
- ),
130
- },
131
- { label: 'Процесс', value: isProcessTask ? 'Задание шага процесса' : undefined },
132
- ]}
133
- />
134
- {typeof task.smbInstruction === 'string' && task.smbInstruction.trim().length > 0 && (
135
- <section
136
- aria-label="Инструкция"
137
- style={{
138
- background: theme.background.transparent.lighter,
139
- borderRadius: theme.border.radius.md,
140
- padding: theme.spacing[3],
141
- whiteSpace: 'pre-wrap',
142
- }}
143
- >
144
- <div style={{ color: theme.font.color.tertiary, fontSize: theme.font.size.sm, marginBottom: theme.spacing[1] }}>
145
- Инструкция
146
- </div>
147
- {task.smbInstruction}
148
- </section>
149
- )}
150
- <SectionTitle
151
- action={
152
- !isProcessTask &&
153
- !isEditingFields &&
154
- !isDone && (
155
- <Button variant="ghost" size="sm" onClick={() => setIsEditingFields(true)}>
156
- {fields.length > 0 ? 'Изменить поля' : 'Добавить поля'}
157
- </Button>
158
- )
159
- }
160
- >
161
- {isProcessTask ? 'Поля задаёт шаг процесса' : 'Поля задания'}
162
- </SectionTitle>
163
- {isEditingFields ? (
164
- <TaskFieldsEditor
165
- initialFields={fields}
166
- onCancel={() => setIsEditingFields(false)}
167
- onSave={(nextFields) =>
168
- runAction(
169
- async () => {
170
- await callAppRoute('/docflow/tasks/form', { taskId, fields: nextFields });
171
- setIsEditingFields(false);
172
- },
173
- 'Поля сохранены',
174
- 'Не удалось сохранить поля',
175
- )
176
- }
177
- />
178
- ) : (
179
- <FormFieldInputs fields={fields} values={values} disabled={isBusy || isDone} onChange={setDraftValues} />
180
- )}
181
- {errorMessage !== undefined && <Message tone="danger">{errorMessage}</Message>}
182
- <div style={{ display: 'flex', flexWrap: 'wrap', gap: theme.spacing[2] }}>
183
- {!isDone && (
184
- <Button
185
- variant="solid"
186
- size="sm"
187
- loading={isBusy}
188
- onClick={() =>
189
- runAction(
190
- () => callAppRoute('/docflow/tasks/complete', { taskId, values }),
191
- 'Задание выполнено',
192
- 'Не удалось выполнить задание',
193
- )
194
- }
195
- >
196
- Выполнить
197
- </Button>
198
- )}
199
- {!isDone && draftValues !== undefined && (
200
- <Button
201
- variant="outline"
202
- size="sm"
203
- disabled={isBusy}
204
- onClick={() =>
205
- runAction(
206
- () => callAppRoute('/docflow/tasks/form', { taskId, values }),
207
- 'Сохранено',
208
- 'Не удалось сохранить',
209
- )
210
- }
211
- >
212
- Сохранить
213
- </Button>
214
- )}
215
- </div>
216
- </div>
217
- );
218
- };
@@ -1,15 +0,0 @@
1
- import { defineNavigationMenuItem, NavigationMenuItemType } from 'twenty-sdk/define';
2
-
3
- import {
4
- DOCFLOW_NAVIGATION_MENU_ITEM_UNIVERSAL_IDENTIFIER,
5
- DOCFLOW_PAGE_LAYOUT_UNIVERSAL_IDENTIFIER,
6
- } from 'src/universal-identifiers';
7
-
8
- export default defineNavigationMenuItem({
9
- universalIdentifier: DOCFLOW_NAVIGATION_MENU_ITEM_UNIVERSAL_IDENTIFIER,
10
- name: 'Документооборот',
11
- icon: 'IconFiles',
12
- position: 0,
13
- type: NavigationMenuItemType.PAGE_LAYOUT,
14
- pageLayoutUniversalIdentifier: DOCFLOW_PAGE_LAYOUT_UNIVERSAL_IDENTIFIER,
15
- });
@@ -1,80 +0,0 @@
1
- import { defineObject, FieldType } from 'twenty-sdk/define';
2
-
3
- import {
4
- DOCUMENT_FOLDER_COLOR_UNIVERSAL_IDENTIFIER,
5
- DOCUMENT_FOLDER_NAME_UNIVERSAL_IDENTIFIER,
6
- DOCUMENT_FOLDER_OBJECT_UNIVERSAL_IDENTIFIER,
7
- } from 'src/universal-identifiers';
8
-
9
- export default defineObject({
10
- universalIdentifier: DOCUMENT_FOLDER_OBJECT_UNIVERSAL_IDENTIFIER,
11
- nameSingular: 'smbDocumentFolder',
12
- namePlural: 'smbDocumentFolders',
13
- labelSingular: 'Папка документов',
14
- labelPlural: 'Папки документов',
15
- description: 'Папка в дереве документов компании',
16
- icon: 'IconFolder',
17
- labelIdentifierFieldMetadataUniversalIdentifier:
18
- DOCUMENT_FOLDER_NAME_UNIVERSAL_IDENTIFIER,
19
- fields: [
20
- {
21
- universalIdentifier: DOCUMENT_FOLDER_NAME_UNIVERSAL_IDENTIFIER,
22
- type: FieldType.TEXT,
23
- label: 'Название',
24
- icon: 'IconAbc',
25
- name: 'name',
26
- },
27
- {
28
- universalIdentifier: DOCUMENT_FOLDER_COLOR_UNIVERSAL_IDENTIFIER,
29
- type: FieldType.SELECT,
30
- label: 'Цвет',
31
- icon: 'IconPalette',
32
- name: 'color',
33
- defaultValue: "'GRAY'",
34
- options: [
35
- {
36
- id: 'cc211c98-25aa-4152-bf3a-683a94802991',
37
- value: 'GRAY',
38
- label: 'Серый',
39
- position: 0,
40
- color: 'gray',
41
- },
42
- {
43
- id: '24d4e509-a5dd-4919-acaf-63b9eca5991b',
44
- value: 'BLUE',
45
- label: 'Синий',
46
- position: 1,
47
- color: 'blue',
48
- },
49
- {
50
- id: 'e1a9b896-ded0-4153-ae31-275539e0f914',
51
- value: 'GREEN',
52
- label: 'Зелёный',
53
- position: 2,
54
- color: 'green',
55
- },
56
- {
57
- id: '6932e1d5-8ad4-4a87-bb1e-b2f4f9a5bb37',
58
- value: 'ORANGE',
59
- label: 'Оранжевый',
60
- position: 3,
61
- color: 'orange',
62
- },
63
- {
64
- id: '220fc4db-37fd-47ce-9754-133a6a7e3eeb',
65
- value: 'RED',
66
- label: 'Красный',
67
- position: 4,
68
- color: 'red',
69
- },
70
- {
71
- id: '2516ec8c-9e1d-4eeb-993f-1791c908e35b',
72
- value: 'PURPLE',
73
- label: 'Фиолетовый',
74
- position: 5,
75
- color: 'purple',
76
- },
77
- ],
78
- },
79
- ],
80
- });