@powerhousedao/vetra 4.1.0-dev.82 → 4.1.0-dev.83

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 (60) hide show
  1. package/dist/document-models/app-module/src/reducers/base-operations.d.ts.map +1 -1
  2. package/dist/document-models/app-module/src/reducers/base-operations.js +5 -1
  3. package/dist/document-models/app-module/src/tests/base-operations.test.js +157 -30
  4. package/dist/document-models/app-module/src/tests/dnd-operations.test.js +38 -7
  5. package/dist/document-models/app-module/src/tests/document-model.test.js +80 -8
  6. package/dist/document-models/document-editor/src/reducers/base-operations.d.ts.map +1 -1
  7. package/dist/document-models/document-editor/src/reducers/base-operations.js +10 -1
  8. package/dist/document-models/document-editor/src/tests/base-operations.test.js +137 -23
  9. package/dist/document-models/document-editor/src/tests/document-model.test.js +91 -8
  10. package/dist/document-models/processor-module/src/reducers/base-operations.d.ts.map +1 -1
  11. package/dist/document-models/processor-module/src/reducers/base-operations.js +15 -2
  12. package/dist/document-models/processor-module/src/tests/base-operations.test.js +153 -33
  13. package/dist/document-models/processor-module/src/tests/document-model.test.js +96 -8
  14. package/dist/document-models/subgraph-module/src/reducers/base-operations.d.ts.map +1 -1
  15. package/dist/document-models/subgraph-module/src/reducers/base-operations.js +5 -1
  16. package/dist/document-models/subgraph-module/src/tests/base-operations.test.js +33 -12
  17. package/dist/document-models/subgraph-module/src/tests/document-model.test.js +25 -8
  18. package/dist/document-models/vetra-package/src/reducers/base-operations.d.ts.map +1 -1
  19. package/dist/document-models/vetra-package/src/reducers/base-operations.js +5 -0
  20. package/dist/document-models/vetra-package/src/tests/base-operations.test.js +171 -75
  21. package/dist/document-models/vetra-package/src/tests/document-model.test.js +101 -8
  22. package/dist/editors/app-editor/components/AppEditorForm.d.ts.map +1 -1
  23. package/dist/editors/app-editor/components/AppEditorForm.js +2 -2
  24. package/dist/editors/app-editor/editor.test.d.ts +2 -0
  25. package/dist/editors/app-editor/editor.test.d.ts.map +1 -0
  26. package/dist/editors/app-editor/editor.test.js +422 -0
  27. package/dist/editors/document-editor/components/DocumentEditorForm.d.ts.map +1 -1
  28. package/dist/editors/document-editor/components/DocumentEditorForm.js +1 -1
  29. package/dist/editors/document-editor/editor.test.d.ts +2 -0
  30. package/dist/editors/document-editor/editor.test.d.ts.map +1 -0
  31. package/dist/editors/document-editor/editor.test.js +374 -0
  32. package/dist/editors/processor-editor/components/ProcessorEditorForm.d.ts.map +1 -1
  33. package/dist/editors/processor-editor/components/ProcessorEditorForm.js +1 -1
  34. package/dist/editors/processor-editor/editor.test.d.ts +2 -0
  35. package/dist/editors/processor-editor/editor.test.d.ts.map +1 -0
  36. package/dist/editors/processor-editor/editor.test.js +459 -0
  37. package/dist/editors/subgraph-editor/components/SubgraphEditorForm.d.ts.map +1 -1
  38. package/dist/editors/subgraph-editor/components/SubgraphEditorForm.js +3 -3
  39. package/dist/editors/subgraph-editor/editor.test.d.ts +2 -0
  40. package/dist/editors/subgraph-editor/editor.test.d.ts.map +1 -0
  41. package/dist/editors/subgraph-editor/editor.test.js +201 -0
  42. package/dist/editors/vetra-package/components/MetaForm.d.ts.map +1 -1
  43. package/dist/editors/vetra-package/components/MetaForm.js +3 -3
  44. package/dist/editors/vetra-package/editor.test.d.ts +2 -0
  45. package/dist/editors/vetra-package/editor.test.d.ts.map +1 -0
  46. package/dist/editors/vetra-package/editor.test.js +330 -0
  47. package/dist/processors/codegen/__tests__/codegen-processor-e2e.test.d.ts +2 -0
  48. package/dist/processors/codegen/__tests__/codegen-processor-e2e.test.d.ts.map +1 -0
  49. package/dist/processors/codegen/__tests__/codegen-processor-e2e.test.js +615 -0
  50. package/dist/processors/codegen/__tests__/factory.test.d.ts +2 -0
  51. package/dist/processors/codegen/__tests__/factory.test.d.ts.map +1 -0
  52. package/dist/processors/codegen/__tests__/factory.test.js +190 -0
  53. package/dist/setupTests.d.ts +2 -0
  54. package/dist/setupTests.d.ts.map +1 -0
  55. package/dist/setupTests.js +1 -0
  56. package/dist/style.css +9 -0
  57. package/dist/tsconfig.tsbuildinfo +1 -1
  58. package/dist/vitest.config.d.ts.map +1 -1
  59. package/dist/vitest.config.js +9 -0
  60. package/package.json +19 -14
@@ -0,0 +1,374 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { render, screen, waitFor } from "@testing-library/react";
3
+ import { userEvent } from "@testing-library/user-event";
4
+ import { beforeEach, describe, expect, it, vi } from "vitest";
5
+ import { useSelectedDocumentEditorDocument } from "../hooks/useVetraDocument.js";
6
+ import { Editor } from "./editor.js";
7
+ vi.mock("../hooks/useVetraDocument.js", () => ({
8
+ useSelectedDocumentEditorDocument: vi.fn(),
9
+ }));
10
+ vi.mock("../hooks/useAvailableDocumentTypes.js", () => ({
11
+ useAvailableDocumentTypes: vi.fn(() => [
12
+ "powerhouse/document-model",
13
+ "powerhouse/budget-statement",
14
+ "powerhouse/project-tracker",
15
+ ]),
16
+ }));
17
+ describe("DocumentEditor Editor", () => {
18
+ let mockDispatch;
19
+ beforeEach(() => {
20
+ mockDispatch = vi.fn();
21
+ vi.mocked(useSelectedDocumentEditorDocument).mockReturnValue([
22
+ {
23
+ state: {
24
+ global: {
25
+ name: "",
26
+ status: "DRAFT",
27
+ documentTypes: [],
28
+ },
29
+ },
30
+ },
31
+ mockDispatch,
32
+ ]);
33
+ });
34
+ describe("Core Rendering", () => {
35
+ it("should render all main form sections and labels", () => {
36
+ render(_jsx(Editor, {}));
37
+ expect(screen.getByText("Editor Configuration")).toBeInTheDocument();
38
+ expect(screen.getByText("Editor Name")).toBeInTheDocument();
39
+ expect(screen.getByText("Supported Document Types")).toBeInTheDocument();
40
+ expect(screen.getByText("Confirm")).toBeInTheDocument();
41
+ });
42
+ it("should display existing editor data when document has values", () => {
43
+ vi.mocked(useSelectedDocumentEditorDocument).mockReturnValue([
44
+ {
45
+ state: {
46
+ global: {
47
+ name: "test-editor",
48
+ status: "DRAFT",
49
+ documentTypes: [
50
+ { id: "dt-1", documentType: "powerhouse/document-model" },
51
+ ],
52
+ },
53
+ },
54
+ },
55
+ mockDispatch,
56
+ ]);
57
+ render(_jsx(Editor, {}));
58
+ expect(screen.getByDisplayValue("test-editor")).toBeInTheDocument();
59
+ // Check that the document type appears in the list (not just in dropdown)
60
+ const documentTypeElements = screen.getAllByText("powerhouse/document-model");
61
+ expect(documentTypeElements.length).toBeGreaterThan(0);
62
+ });
63
+ });
64
+ describe("Editor Name Input", () => {
65
+ it("should dispatch setEditorName when name changes (debounced)", async () => {
66
+ const user = userEvent.setup();
67
+ render(_jsx(Editor, {}));
68
+ const nameInput = screen.getByLabelText("Editor Name");
69
+ await user.type(nameInput, "new-editor");
70
+ await waitFor(() => {
71
+ expect(mockDispatch).toHaveBeenCalledWith(expect.objectContaining({
72
+ type: "SET_EDITOR_NAME",
73
+ input: { name: "new-editor" },
74
+ }));
75
+ }, { timeout: 500 });
76
+ });
77
+ it("should dispatch when clearing a non-empty field", async () => {
78
+ vi.mocked(useSelectedDocumentEditorDocument).mockReturnValue([
79
+ {
80
+ state: {
81
+ global: {
82
+ name: "existing-editor",
83
+ status: "DRAFT",
84
+ documentTypes: [],
85
+ },
86
+ },
87
+ },
88
+ mockDispatch,
89
+ ]);
90
+ const user = userEvent.setup();
91
+ render(_jsx(Editor, {}));
92
+ const nameInput = screen.getByLabelText("Editor Name");
93
+ await user.clear(nameInput);
94
+ await waitFor(() => {
95
+ expect(mockDispatch).toHaveBeenCalledWith(expect.objectContaining({
96
+ type: "SET_EDITOR_NAME",
97
+ input: { name: "" },
98
+ }));
99
+ }, { timeout: 500 });
100
+ });
101
+ it("should NOT dispatch when typing identical value without clearing", async () => {
102
+ vi.mocked(useSelectedDocumentEditorDocument).mockReturnValue([
103
+ {
104
+ state: {
105
+ global: {
106
+ name: "test",
107
+ status: "DRAFT",
108
+ documentTypes: [],
109
+ },
110
+ },
111
+ },
112
+ mockDispatch,
113
+ ]);
114
+ const user = userEvent.setup();
115
+ render(_jsx(Editor, {}));
116
+ const nameInput = screen.getByLabelText("Editor Name");
117
+ // Simulate user selecting all text and typing the same value
118
+ await user.tripleClick(nameInput); // Select all
119
+ await user.type(nameInput, "test");
120
+ await waitFor(() => {
121
+ expect(mockDispatch).not.toHaveBeenCalled();
122
+ });
123
+ });
124
+ it("should NOT dispatch when both old and new values are empty", async () => {
125
+ const user = userEvent.setup();
126
+ render(_jsx(Editor, {}));
127
+ const nameInput = screen.getByLabelText("Editor Name");
128
+ await user.click(nameInput);
129
+ await user.tab();
130
+ await waitFor(() => {
131
+ expect(mockDispatch).not.toHaveBeenCalled();
132
+ });
133
+ });
134
+ });
135
+ describe("Document Types Management", () => {
136
+ it("should add document type from dropdown", async () => {
137
+ const user = userEvent.setup();
138
+ render(_jsx(Editor, {}));
139
+ const select = screen.getByLabelText("Supported Document Types");
140
+ await user.selectOptions(select, "powerhouse/document-model");
141
+ expect(mockDispatch).toHaveBeenCalledWith(expect.objectContaining({
142
+ type: "ADD_DOCUMENT_TYPE",
143
+ input: expect.objectContaining({
144
+ documentType: "powerhouse/document-model",
145
+ id: expect.any(String),
146
+ }),
147
+ }));
148
+ });
149
+ it("should replace existing document type when adding new one", async () => {
150
+ vi.mocked(useSelectedDocumentEditorDocument).mockReturnValue([
151
+ {
152
+ state: {
153
+ global: {
154
+ name: "test-editor",
155
+ status: "DRAFT",
156
+ documentTypes: [
157
+ { id: "dt-1", documentType: "powerhouse/document-model" },
158
+ ],
159
+ },
160
+ },
161
+ },
162
+ mockDispatch,
163
+ ]);
164
+ const user = userEvent.setup();
165
+ render(_jsx(Editor, {}));
166
+ const select = screen.getByLabelText("Supported Document Types");
167
+ await user.selectOptions(select, "powerhouse/budget-statement");
168
+ // Should first remove the existing type
169
+ expect(mockDispatch).toHaveBeenCalledWith(expect.objectContaining({
170
+ type: "REMOVE_DOCUMENT_TYPE",
171
+ input: { id: "dt-1" },
172
+ }));
173
+ // Then add the new type
174
+ expect(mockDispatch).toHaveBeenCalledWith(expect.objectContaining({
175
+ type: "ADD_DOCUMENT_TYPE",
176
+ input: expect.objectContaining({
177
+ documentType: "powerhouse/budget-statement",
178
+ id: expect.any(String),
179
+ }),
180
+ }));
181
+ });
182
+ it("should remove document type", async () => {
183
+ vi.mocked(useSelectedDocumentEditorDocument).mockReturnValue([
184
+ {
185
+ state: {
186
+ global: {
187
+ name: "test-editor",
188
+ status: "DRAFT",
189
+ documentTypes: [
190
+ { id: "dt-1", documentType: "powerhouse/document-model" },
191
+ ],
192
+ },
193
+ },
194
+ },
195
+ mockDispatch,
196
+ ]);
197
+ const user = userEvent.setup();
198
+ render(_jsx(Editor, {}));
199
+ // Get all instances of the document type text (dropdown + list)
200
+ const documentModelElements = screen.getAllByText("powerhouse/document-model");
201
+ // The second one should be in the list (first is in dropdown)
202
+ const listItem = documentModelElements[1];
203
+ const removeButton = listItem.parentElement?.querySelector("button");
204
+ if (removeButton) {
205
+ await user.click(removeButton);
206
+ }
207
+ expect(mockDispatch).toHaveBeenCalledWith(expect.objectContaining({
208
+ type: "REMOVE_DOCUMENT_TYPE",
209
+ input: { id: "dt-1" },
210
+ }));
211
+ });
212
+ it("should display existing document type", () => {
213
+ vi.mocked(useSelectedDocumentEditorDocument).mockReturnValue([
214
+ {
215
+ state: {
216
+ global: {
217
+ name: "test-editor",
218
+ status: "DRAFT",
219
+ documentTypes: [
220
+ { id: "dt-1", documentType: "powerhouse/document-model" },
221
+ ],
222
+ },
223
+ },
224
+ },
225
+ mockDispatch,
226
+ ]);
227
+ render(_jsx(Editor, {}));
228
+ // Check that the document type appears (it will be in both dropdown and list)
229
+ const documentTypeElements = screen.getAllByText("powerhouse/document-model");
230
+ expect(documentTypeElements.length).toBeGreaterThan(0);
231
+ });
232
+ it("should show available document types in dropdown", () => {
233
+ render(_jsx(Editor, {}));
234
+ const select = screen.getByLabelText("Supported Document Types");
235
+ const options = Array.from(select.querySelectorAll("option")).map((opt) => opt.value);
236
+ expect(options).toContain("powerhouse/document-model");
237
+ expect(options).toContain("powerhouse/budget-statement");
238
+ expect(options).toContain("powerhouse/project-tracker");
239
+ });
240
+ });
241
+ describe("Confirm Button", () => {
242
+ it("should dispatch setEditorStatus when confirm clicked", async () => {
243
+ vi.mocked(useSelectedDocumentEditorDocument).mockReturnValue([
244
+ {
245
+ state: {
246
+ global: {
247
+ name: "test-editor",
248
+ status: "DRAFT",
249
+ documentTypes: [
250
+ { id: "dt-1", documentType: "powerhouse/document-model" },
251
+ ],
252
+ },
253
+ },
254
+ },
255
+ mockDispatch,
256
+ ]);
257
+ const user = userEvent.setup();
258
+ render(_jsx(Editor, {}));
259
+ const confirmButton = screen.getByText("Confirm");
260
+ await user.click(confirmButton);
261
+ expect(mockDispatch).toHaveBeenCalledWith(expect.objectContaining({
262
+ type: "SET_EDITOR_STATUS",
263
+ input: { status: "CONFIRMED" },
264
+ }));
265
+ });
266
+ it("should be disabled when editor name is empty", () => {
267
+ vi.mocked(useSelectedDocumentEditorDocument).mockReturnValue([
268
+ {
269
+ state: {
270
+ global: {
271
+ name: "",
272
+ status: "DRAFT",
273
+ documentTypes: [
274
+ { id: "dt-1", documentType: "powerhouse/document-model" },
275
+ ],
276
+ },
277
+ },
278
+ },
279
+ mockDispatch,
280
+ ]);
281
+ render(_jsx(Editor, {}));
282
+ const confirmButton = screen.getByText("Confirm");
283
+ expect(confirmButton).toBeDisabled();
284
+ });
285
+ it("should be disabled when no document types selected", () => {
286
+ vi.mocked(useSelectedDocumentEditorDocument).mockReturnValue([
287
+ {
288
+ state: {
289
+ global: {
290
+ name: "test-editor",
291
+ status: "DRAFT",
292
+ documentTypes: [],
293
+ },
294
+ },
295
+ },
296
+ mockDispatch,
297
+ ]);
298
+ render(_jsx(Editor, {}));
299
+ const confirmButton = screen.getByText("Confirm");
300
+ expect(confirmButton).toBeDisabled();
301
+ });
302
+ it("should be hidden when status is CONFIRMED", () => {
303
+ vi.mocked(useSelectedDocumentEditorDocument).mockReturnValue([
304
+ {
305
+ state: {
306
+ global: {
307
+ name: "test-editor",
308
+ status: "CONFIRMED",
309
+ documentTypes: [
310
+ { id: "dt-1", documentType: "powerhouse/document-model" },
311
+ ],
312
+ },
313
+ },
314
+ },
315
+ mockDispatch,
316
+ ]);
317
+ render(_jsx(Editor, {}));
318
+ const confirmButton = screen.queryByText("Confirm");
319
+ expect(confirmButton).not.toBeInTheDocument();
320
+ });
321
+ });
322
+ describe("Read-only Mode", () => {
323
+ it("should disable form fields when status is CONFIRMED", () => {
324
+ vi.mocked(useSelectedDocumentEditorDocument).mockReturnValue([
325
+ {
326
+ state: {
327
+ global: {
328
+ name: "test-editor",
329
+ status: "CONFIRMED",
330
+ documentTypes: [
331
+ { id: "dt-1", documentType: "powerhouse/document-model" },
332
+ ],
333
+ },
334
+ },
335
+ },
336
+ mockDispatch,
337
+ ]);
338
+ render(_jsx(Editor, {}));
339
+ const nameInput = screen.getByLabelText("Editor Name");
340
+ expect(nameInput).toBeDisabled();
341
+ // Document types dropdown should not be visible in read-only mode
342
+ const select = screen.queryByLabelText("Supported Document Types");
343
+ expect(select).not.toBeInTheDocument();
344
+ // Remove button should not be visible
345
+ const removeButtons = screen.queryAllByText("×");
346
+ expect(removeButtons).toHaveLength(0);
347
+ });
348
+ it("should enable form fields when status is DRAFT", () => {
349
+ vi.mocked(useSelectedDocumentEditorDocument).mockReturnValue([
350
+ {
351
+ state: {
352
+ global: {
353
+ name: "test-editor",
354
+ status: "DRAFT",
355
+ documentTypes: [
356
+ { id: "dt-1", documentType: "powerhouse/document-model" },
357
+ ],
358
+ },
359
+ },
360
+ },
361
+ mockDispatch,
362
+ ]);
363
+ render(_jsx(Editor, {}));
364
+ const nameInput = screen.getByLabelText("Editor Name");
365
+ expect(nameInput).not.toBeDisabled();
366
+ // Document types dropdown should be visible
367
+ const select = screen.getByLabelText("Supported Document Types");
368
+ expect(select).toBeInTheDocument();
369
+ // Remove button should be visible
370
+ const removeButtons = screen.queryAllByText("×");
371
+ expect(removeButtons.length).toBeGreaterThan(0);
372
+ });
373
+ });
374
+ });
@@ -1 +1 @@
1
- {"version":3,"file":"ProcessorEditorForm.d.ts","sourceRoot":"","sources":["../../../../editors/processor-editor/components/ProcessorEditorForm.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oDAAoD,CAAC;AAI3F,MAAM,WAAW,wBAAwB;IACvC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,gBAAgB,EAAE,CAAC;IACnC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,iBAAiB,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/D,oBAAoB,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5C,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB;AAED,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CAyLlE,CAAC"}
1
+ {"version":3,"file":"ProcessorEditorForm.d.ts","sourceRoot":"","sources":["../../../../editors/processor-editor/components/ProcessorEditorForm.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oDAAoD,CAAC;AAI3F,MAAM,WAAW,wBAAwB;IACvC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,gBAAgB,EAAE,CAAC;IACnC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,iBAAiB,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/D,oBAAoB,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5C,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB;AAED,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CAqMlE,CAAC"}
@@ -42,7 +42,7 @@ export const ProcessorEditorForm = ({ processorName: initialProcessorName = "",
42
42
  onRemoveDocumentType?.(id);
43
43
  };
44
44
  const canConfirm = processorName.trim() && processorType && documentTypes.length > 0;
45
- return (_jsxs("div", { className: "space-y-6 bg-white p-6", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("h2", { className: "text-lg font-medium text-gray-900", children: "Processor Configuration" }), _jsx(StatusPill, { status: status === "CONFIRMED" ? "confirmed" : "draft", label: status === "CONFIRMED" ? "Confirmed" : "Draft" })] }), _jsxs("div", { children: [_jsx("label", { className: "mb-2 block text-sm font-medium text-gray-700", children: "Processor Name" }), _jsx("input", { type: "text", value: processorName, onChange: (e) => setProcessorName(e.target.value), disabled: isReadOnly, className: `w-full rounded-md border border-gray-300 px-3 py-2 focus:border-transparent focus:outline-none focus:ring-2 focus:ring-blue-500 ${isReadOnly ? "cursor-not-allowed bg-gray-100" : ""}`, placeholder: "Enter processor name" })] }), _jsxs("div", { children: [_jsx("label", { className: "mb-2 block text-sm font-medium text-gray-700", children: "Type" }), _jsxs("select", { value: processorType, onChange: (e) => setProcessorType(e.target.value), disabled: isReadOnly, className: `w-full rounded-md border border-gray-300 px-3 py-2 focus:border-transparent focus:outline-none focus:ring-2 focus:ring-blue-500 ${isReadOnly ? "cursor-not-allowed bg-gray-100" : ""}`, children: [_jsx("option", { value: "", children: "Select type..." }), _jsx("option", { value: "analytics", children: "Analytics" }), _jsx("option", { value: "relational", children: "Relational Database" })] })] }), _jsxs("div", { children: [_jsx("label", { className: "mb-2 block text-sm font-medium text-gray-700", children: "Document Types" }), _jsxs("div", { className: "space-y-2", children: [!isReadOnly && availableDocumentTypes.length > 0 && (_jsxs("select", { value: selectedDocumentType, onChange: (e) => {
45
+ return (_jsxs("div", { className: "space-y-6 bg-white p-6", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("h2", { className: "text-lg font-medium text-gray-900", children: "Processor Configuration" }), _jsx(StatusPill, { status: status === "CONFIRMED" ? "confirmed" : "draft", label: status === "CONFIRMED" ? "Confirmed" : "Draft" })] }), _jsxs("div", { children: [_jsx("label", { htmlFor: "processor-name", className: "mb-2 block text-sm font-medium text-gray-700", children: "Processor Name" }), _jsx("input", { id: "processor-name", type: "text", value: processorName, onChange: (e) => setProcessorName(e.target.value), disabled: isReadOnly, className: `w-full rounded-md border border-gray-300 px-3 py-2 focus:border-transparent focus:outline-none focus:ring-2 focus:ring-blue-500 ${isReadOnly ? "cursor-not-allowed bg-gray-100" : ""}`, placeholder: "Enter processor name" })] }), _jsxs("div", { children: [_jsx("label", { htmlFor: "processor-type", className: "mb-2 block text-sm font-medium text-gray-700", children: "Type" }), _jsxs("select", { id: "processor-type", value: processorType, onChange: (e) => setProcessorType(e.target.value), disabled: isReadOnly, className: `w-full rounded-md border border-gray-300 px-3 py-2 focus:border-transparent focus:outline-none focus:ring-2 focus:ring-blue-500 ${isReadOnly ? "cursor-not-allowed bg-gray-100" : ""}`, children: [_jsx("option", { value: "", children: "Select type..." }), _jsx("option", { value: "analytics", children: "Analytics" }), _jsx("option", { value: "relational", children: "Relational Database" })] })] }), _jsxs("div", { children: [_jsx("label", { htmlFor: "document-types", className: "mb-2 block text-sm font-medium text-gray-700", children: "Document Types" }), _jsxs("div", { className: "space-y-2", children: [!isReadOnly && availableDocumentTypes.length > 0 && (_jsxs("select", { id: "document-types", value: selectedDocumentType, onChange: (e) => {
46
46
  const selectedValue = e.target.value;
47
47
  if (selectedValue &&
48
48
  !documentTypes.some((dt) => dt.documentType === selectedValue)) {
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=editor.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editor.test.d.ts","sourceRoot":"","sources":["../../../editors/processor-editor/editor.test.tsx"],"names":[],"mappings":""}