@powerhousedao/network-admin 0.0.28 → 0.0.30

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 (74) hide show
  1. package/dist/document-models/index.d.ts.map +1 -1
  2. package/dist/document-models/request-for-proposals/gen/document-model.js +36 -36
  3. package/dist/document-models/request-for-proposals/gen/object.d.ts.map +1 -1
  4. package/dist/document-models/request-for-proposals/gen/object.js +1 -1
  5. package/dist/document-models/request-for-proposals/gen/ph-factories.js +1 -1
  6. package/dist/document-models/request-for-proposals/gen/utils.js +3 -3
  7. package/dist/document-models/request-for-proposals/src/reducers/rfp-state.d.ts.map +1 -1
  8. package/dist/document-models/request-for-proposals/src/reducers/rfp-state.js +7 -5
  9. package/dist/document-models/workstream/gen/document-model.d.ts.map +1 -1
  10. package/dist/document-models/workstream/gen/document-model.js +52 -52
  11. package/dist/document-models/workstream/gen/object.d.ts.map +1 -1
  12. package/dist/document-models/workstream/gen/object.js +1 -1
  13. package/dist/document-models/workstream/gen/schema/types.d.ts +1 -1
  14. package/dist/document-models/workstream/gen/schema/types.d.ts.map +1 -1
  15. package/dist/document-models/workstream/gen/utils.js +2 -2
  16. package/dist/editors/index.d.ts.map +1 -1
  17. package/dist/editors/network-admin/components/DriveExplorer.d.ts.map +1 -1
  18. package/dist/editors/network-admin/components/DriveExplorer.js +23 -5
  19. package/dist/editors/network-profile/editor.js +1 -1
  20. package/dist/editors/request-for-proposals/editor.d.ts.map +1 -1
  21. package/dist/editors/request-for-proposals/editor.js +61 -13
  22. package/dist/editors/workstream/editor.d.ts.map +1 -1
  23. package/dist/editors/workstream/editor.js +167 -13
  24. package/dist/powerhouse.manifest.json +8 -1
  25. package/dist/processors/factory.d.ts +8 -0
  26. package/dist/processors/factory.d.ts.map +1 -0
  27. package/dist/processors/factory.js +22 -0
  28. package/dist/processors/index.d.ts +3 -0
  29. package/dist/processors/index.d.ts.map +1 -1
  30. package/dist/processors/index.js +3 -1
  31. package/dist/processors/workstreams/factory.d.ts +4 -0
  32. package/dist/processors/workstreams/factory.d.ts.map +1 -0
  33. package/dist/processors/workstreams/factory.js +22 -0
  34. package/dist/processors/workstreams/index.d.ts +14 -0
  35. package/dist/processors/workstreams/index.d.ts.map +1 -0
  36. package/dist/processors/workstreams/index.js +196 -0
  37. package/dist/processors/workstreams/migrations.d.ts +4 -0
  38. package/dist/processors/workstreams/migrations.d.ts.map +1 -0
  39. package/dist/processors/workstreams/migrations.js +40 -0
  40. package/dist/processors/workstreams/schema.d.ts +19 -0
  41. package/dist/processors/workstreams/schema.d.ts.map +1 -0
  42. package/dist/processors/workstreams/schema.js +1 -0
  43. package/dist/scripts/sow-mirror/mirror_sow_state.d.ts +3 -0
  44. package/dist/scripts/sow-mirror/mirror_sow_state.d.ts.map +1 -0
  45. package/dist/scripts/sow-mirror/mirror_sow_state.js +441 -0
  46. package/dist/style.css +134 -1
  47. package/dist/subgraphs/index.d.ts +2 -0
  48. package/dist/subgraphs/index.d.ts.map +1 -1
  49. package/dist/subgraphs/index.js +2 -0
  50. package/dist/subgraphs/networks/index.d.ts +11 -0
  51. package/dist/subgraphs/networks/index.d.ts.map +1 -0
  52. package/dist/subgraphs/networks/index.js +11 -0
  53. package/dist/subgraphs/networks/resolvers.d.ts +3 -0
  54. package/dist/subgraphs/networks/resolvers.d.ts.map +1 -0
  55. package/dist/subgraphs/networks/resolvers.js +41 -0
  56. package/dist/subgraphs/networks/schema.d.ts +3 -0
  57. package/dist/subgraphs/networks/schema.d.ts.map +1 -0
  58. package/dist/subgraphs/networks/schema.js +39 -0
  59. package/dist/subgraphs/request-for-proposals/index.d.ts.map +1 -1
  60. package/dist/subgraphs/workstream/index.d.ts.map +1 -1
  61. package/dist/subgraphs/workstream/schema.js +1 -1
  62. package/dist/subgraphs/workstreams/index.d.ts +11 -0
  63. package/dist/subgraphs/workstreams/index.d.ts.map +1 -0
  64. package/dist/subgraphs/workstreams/index.js +11 -0
  65. package/dist/subgraphs/workstreams/resolvers.d.ts +3 -0
  66. package/dist/subgraphs/workstreams/resolvers.d.ts.map +1 -0
  67. package/dist/subgraphs/workstreams/resolvers.js +377 -0
  68. package/dist/subgraphs/workstreams/schema.d.ts +3 -0
  69. package/dist/subgraphs/workstreams/schema.d.ts.map +1 -0
  70. package/dist/subgraphs/workstreams/schema.js +326 -0
  71. package/package.json +3 -2
  72. package/dist/editors/hooks/useBuilderProfileDocument.d.ts +0 -3
  73. package/dist/editors/hooks/useBuilderProfileDocument.d.ts.map +0 -1
  74. package/dist/editors/hooks/useBuilderProfileDocument.js +0 -8
@@ -1,6 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { actions, } from "../../document-models/request-for-proposals/index.js";
3
- import { DatePicker, Select, TextInput, } from "@powerhousedao/document-engineering";
3
+ import { DatePicker, Select, TextInput, NumberInput, } from "@powerhousedao/document-engineering";
4
+ import { toast, ToastContainer } from "@powerhousedao/design-system";
4
5
  import { MarkdownEditor } from "./markdown-editor.js";
5
6
  import { useSelectedRequestForProposalsDocument } from "../hooks/useRequestForProposalsDocument.js";
6
7
  const statusOptions = [
@@ -15,16 +16,63 @@ const statusOptions = [
15
16
  export default function Editor() {
16
17
  const [doc, dispatch] = useSelectedRequestForProposalsDocument();
17
18
  const state = doc?.state.global;
18
- return (_jsx("div", { className: "w-full bg-gray-50", children: _jsxs("div", { className: "p-6 max-w-4xl mx-auto min-h-screen", children: [_jsx("div", { className: "bg-white rounded-lg p-6 mb-6 shadow-sm", children: _jsx("h1", { className: "text-3xl font-bold text-gray-900 mb-2", children: "Request for Proposals" }) }), _jsx("div", { className: "bg-white rounded-lg p-6 mb-6 shadow-sm", children: _jsxs("div", { className: "flex flex-row gap-6", children: [_jsxs("div", { className: "flex-1", children: [_jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Code" }), _jsx(TextInput, { className: "w-full", defaultValue: state.code || "", onBlur: (e) => {
19
- if (e.target.value !== state.code) {
20
- dispatch(actions.editRfp({ code: e.target.value }));
21
- }
22
- }, placeholder: "Enter rfp code" })] }), _jsxs("div", { className: "flex-1", children: [_jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Title" }), _jsx(TextInput, { className: "w-full", defaultValue: state.title || "", onBlur: (e) => {
23
- if (e.target.value !== state.title) {
24
- dispatch(actions.editRfp({ title: e.target.value }));
25
- }
26
- }, placeholder: "Enter rfp title" })] }), _jsx("div", { className: "w-[150px]", children: _jsx(Select, { label: "Status", options: statusOptions, value: state.status, onChange: (value) => dispatch(actions.editRfp({ status: value })) }) })] }) }), _jsx("div", { className: "bg-white rounded-lg p-6 mb-6 shadow-sm", children: _jsx(MarkdownEditor, { height: 200, label: "Summary", value: state.summary ?? "", onChange: () => { }, onBlur: (value) => dispatch(actions.editRfp({ summary: value })) }) }), _jsxs("div", { className: "bg-white rounded-lg p-6 mb-6 shadow-sm", children: [_jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Submission Deadline" }), _jsx("div", { className: "w-[250px]", children: _jsx(DatePicker, { value: state.deadline ? new Date(state.deadline) : undefined, onChange: (e) => {
27
- const date = e.target.value ? new Date(e.target.value) : null;
28
- dispatch(actions.editRfp({ deadline: date?.toISOString() }));
29
- }, name: "submission-deadline", placeholder: "Select submission deadline" }) })] }), _jsx("div", { className: "bg-white rounded-lg p-6 mb-6 shadow-sm", children: _jsx(MarkdownEditor, { height: 200, label: "Eligibility Criteria", value: state.eligibilityCriteria ?? "", onChange: () => { }, onBlur: (value) => dispatch(actions.editRfp({ eligibilityCriteria: value })) }) }), _jsx("div", { className: "bg-white rounded-lg p-6 mb-6 shadow-sm", children: _jsx(MarkdownEditor, { height: 200, label: "Evaluation Criteria", value: state.evaluationCriteria ?? "", onChange: () => { }, onBlur: (value) => dispatch(actions.editRfp({ evaluationCriteria: value })) }) })] }) }));
19
+ // Validation function for budget range
20
+ const validateBudgetRange = (min, max) => {
21
+ if (min !== null && max !== null && min >= max) {
22
+ toast("Minimum budget must be less than maximum budget", {
23
+ type: "error",
24
+ });
25
+ return false;
26
+ }
27
+ return true;
28
+ };
29
+ return (_jsxs("div", { className: "w-full bg-gray-50", children: [_jsxs("div", { className: "p-6 max-w-4xl mx-auto min-h-screen", children: [_jsx("div", { className: "bg-white rounded-lg p-6 mb-6 shadow-sm", children: _jsx("h1", { className: "text-3xl font-bold text-gray-900 mb-2", children: "Request for Proposals" }) }), _jsx("div", { className: "bg-white rounded-lg p-6 mb-6 shadow-sm", children: _jsxs("div", { className: "flex flex-row gap-6", children: [_jsxs("div", { className: "flex-1", children: [_jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Code" }), _jsx(TextInput, { className: "w-full", defaultValue: state.code || "", onBlur: (e) => {
30
+ if (e.target.value !== state.code) {
31
+ dispatch(actions.editRfp({ code: e.target.value }));
32
+ }
33
+ }, placeholder: "Enter rfp code" })] }), _jsxs("div", { className: "flex-1", children: [_jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Title" }), _jsx(TextInput, { className: "w-full", defaultValue: state.title || "", onBlur: (e) => {
34
+ if (e.target.value !== state.title) {
35
+ dispatch(actions.editRfp({ title: e.target.value }));
36
+ }
37
+ }, placeholder: "Enter rfp title" })] }), _jsx("div", { className: "w-[150px]", children: _jsx(Select, { label: "Status", options: statusOptions, value: state.status, onChange: (value) => dispatch(actions.editRfp({ status: value })) }) })] }) }), _jsx("div", { className: "bg-white rounded-lg p-6 mb-6 shadow-sm", children: _jsx(MarkdownEditor, { height: 200, label: "Summary", value: state.summary ?? "", onChange: () => { }, onBlur: (value) => dispatch(actions.editRfp({ summary: value })) }) }), _jsxs("div", { className: "flex flex-row justify-between bg-white rounded-lg p-6 mb-6 shadow-sm", children: [_jsxs("div", { children: [_jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Submission Deadline" }), _jsx("div", { className: "w-[250px]", children: _jsx(DatePicker, { value: state.deadline ? new Date(state.deadline) : undefined, onChange: (e) => {
38
+ const date = e.target.value ? new Date(e.target.value) : null;
39
+ dispatch(actions.editRfp({ deadline: date?.toISOString() }));
40
+ }, name: "submission-deadline", placeholder: "Select submission deadline" }) })] }), _jsxs("div", { children: [_jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Budget Range" }), _jsxs("div", { className: "flex flex-row gap-2", children: [_jsx(NumberInput, { name: "minimum-budget", defaultValue: state.budgetRange?.min || undefined, onBlur: (e) => {
41
+ const newMin = Number(e.target.value);
42
+ if (newMin !== Number(state.budgetRange?.min)) {
43
+ // Validate before dispatching
44
+ if (validateBudgetRange(newMin, state.budgetRange?.max || null)) {
45
+ dispatch(actions.editRfp({
46
+ budgetRange: { min: newMin },
47
+ }));
48
+ }
49
+ }
50
+ }, placeholder: "Minimum budget", className: "w-[140px]" }), _jsx("span", { className: "text-gray-500", children: "-" }), _jsx(NumberInput, { name: "maximum-budget", defaultValue: state.budgetRange?.max || undefined, onBlur: (e) => {
51
+ const newMax = Number(e.target.value);
52
+ if (newMax !== Number(state.budgetRange?.max)) {
53
+ // Validate before dispatching
54
+ if (validateBudgetRange(state.budgetRange?.min || null, newMax)) {
55
+ dispatch(actions.editRfp({
56
+ budgetRange: { max: newMax },
57
+ }));
58
+ }
59
+ }
60
+ }, placeholder: "Maximum budget", className: "w-[140px]" }), _jsx(Select, { placeholder: "Currency", options: [
61
+ "USD",
62
+ "EUR",
63
+ "GBP",
64
+ "JPY",
65
+ "CHF",
66
+ "CNY",
67
+ "DKK",
68
+ "USDC",
69
+ "USDS",
70
+ "DAI",
71
+ ].map((currency) => ({ label: currency, value: currency })), value: state.budgetRange?.currency || "", onChange: (value) => {
72
+ if (value !== state.budgetRange?.currency) {
73
+ dispatch(actions.editRfp({
74
+ budgetRange: { currency: value },
75
+ }));
76
+ }
77
+ }, className: "w-[115px]" })] })] })] }), _jsx("div", { className: "bg-white rounded-lg p-6 mb-6 shadow-sm", children: _jsx(MarkdownEditor, { height: 200, label: "Eligibility Criteria", value: state.eligibilityCriteria ?? "", onChange: () => { }, onBlur: (value) => dispatch(actions.editRfp({ eligibilityCriteria: value })) }) }), _jsx("div", { className: "bg-white rounded-lg p-6 mb-6 shadow-sm", children: _jsx(MarkdownEditor, { height: 200, label: "Evaluation Criteria", value: state.evaluationCriteria ?? "", onChange: () => { }, onBlur: (value) => dispatch(actions.editRfp({ evaluationCriteria: value })) }) })] }), _jsx(ToastContainer, { position: "bottom-right", autoClose: 5000, hideProgressBar: false, newestOnTop: false, closeOnClick: true, rtl: false, pauseOnFocusLoss: true, draggable: true, pauseOnHover: true, theme: "light" })] }));
30
78
  }
@@ -1 +1 @@
1
- {"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../../../editors/workstream/editor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,WAAW,EAGZ,MAAM,gBAAgB,CAAC;AAmCxB,MAAM,MAAM,MAAM,GAAG,WAAW,CAAC;AAsBjC,MAAM,CAAC,OAAO,UAAU,MAAM,4CA8jC7B"}
1
+ {"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../../../editors/workstream/editor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,WAAW,EAGZ,MAAM,gBAAgB,CAAC;AAqCxB,MAAM,MAAM,MAAM,GAAG,WAAW,CAAC;AAsBjC,MAAM,CAAC,OAAO,UAAU,MAAM,4CA2xC7B"}
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Button, toast, ToastContainer } from "@powerhousedao/design-system";
3
- import { TextInput, Select, OIDInput, ObjectSetTable, buildEnumCellEditor, } from "@powerhousedao/document-engineering";
3
+ import { TextInput, Select, OIDInput, PHIDInput, ObjectSetTable, buildEnumCellEditor, } from "@powerhousedao/document-engineering";
4
4
  import { actions, } from "../../document-models/workstream/index.js";
5
5
  import { actions as rfpActions, } from "../../document-models/request-for-proposals/index.js";
6
6
  import { ScopeOfWork } from "@powerhousedao/project-management/document-models";
@@ -104,6 +104,11 @@ export default function Editor() {
104
104
  setIsCreatingPaymentTerms(false);
105
105
  }
106
106
  }, [isCreatingPaymentTerms, selectedDrive?.header.id, state.title]);
107
+ const getDocumentNameById = useCallback((documentId) => {
108
+ const document = useDocumentById(documentId);
109
+ const [documentData] = document || [];
110
+ return documentData?.header.name || "";
111
+ }, [useDocumentById]);
107
112
  // Local state to track manual input values
108
113
  const [manualAuthorInput, setManualAuthorInput] = useState("");
109
114
  // Effect to clear local state when global state is updated
@@ -259,10 +264,18 @@ export default function Editor() {
259
264
  return;
260
265
  }
261
266
  const clientId = state.client?.id || generateId();
262
- const action = actions.editClientInfo({
267
+ let clientInfoUpdate = {
263
268
  clientId,
264
- [field]: value || undefined,
265
- });
269
+ };
270
+ if (field === "name") {
271
+ clientInfoUpdate.name = value === "" ? "" : value || undefined;
272
+ clientInfoUpdate.icon = state.client?.icon || undefined;
273
+ }
274
+ else if (field === "icon") {
275
+ clientInfoUpdate.icon = value === "" ? "" : value || undefined;
276
+ clientInfoUpdate.name = state.client?.name || undefined;
277
+ }
278
+ const action = actions.editClientInfo(clientInfoUpdate);
266
279
  dispatch(action);
267
280
  };
268
281
  // Handle client ID change
@@ -291,6 +304,45 @@ export default function Editor() {
291
304
  },
292
305
  ]);
293
306
  }, [state.alternativeProposals]);
307
+ const getSowOptionById = useCallback((documentId) => {
308
+ if (!documentId)
309
+ return undefined;
310
+ const doc = allDocuments?.find((document) => {
311
+ return (document.header.documentType === "powerhouse/scopeofwork" &&
312
+ document.header.id === documentId);
313
+ });
314
+ if (!doc)
315
+ return undefined;
316
+ const title = doc.state?.global?.title;
317
+ return {
318
+ value: doc.header.id,
319
+ title: title || doc.header.name,
320
+ path: {
321
+ text: doc.header.name,
322
+ url: doc.header.id,
323
+ },
324
+ description: "",
325
+ };
326
+ }, [allDocuments]);
327
+ const getPaymentTermsOptionById = useCallback((documentId) => {
328
+ if (!documentId)
329
+ return undefined;
330
+ const doc = allDocuments?.find((document) => {
331
+ return (document.header.documentType === "payment-terms" &&
332
+ document.header.id === documentId);
333
+ });
334
+ if (!doc)
335
+ return undefined;
336
+ return {
337
+ value: doc.header.id,
338
+ title: doc.header.name,
339
+ path: {
340
+ text: doc.header.name,
341
+ url: doc.header.id,
342
+ },
343
+ description: "",
344
+ };
345
+ }, [allDocuments]);
294
346
  const alternativeProposalsColumns = useMemo(() => [
295
347
  {
296
348
  field: "authorName",
@@ -319,7 +371,7 @@ export default function Editor() {
319
371
  {
320
372
  field: "sow",
321
373
  title: "SOW",
322
- type: "oid",
374
+ type: "phid",
323
375
  editable: true,
324
376
  align: "center",
325
377
  onSave: (newValue, context) => {
@@ -332,11 +384,58 @@ export default function Editor() {
332
384
  }
333
385
  return false;
334
386
  },
387
+ renderCellEditor: (value, onChange, context) => {
388
+ const currentValue = value || "";
389
+ const initialOption = getSowOptionById(currentValue);
390
+ return (_jsx(PHIDInput, { value: currentValue, onChange: (newValue) => {
391
+ onChange(newValue);
392
+ }, onBlur: (e) => {
393
+ if (e.target.value !== context.row.sow) {
394
+ dispatch(actions.editAlternativeProposal({
395
+ id: context.row.id,
396
+ sowId: e.target.value,
397
+ }));
398
+ }
399
+ }, placeholder: "Search for SOW Document", className: "w-full", variant: "withValueTitleAndDescription", initialOptions: initialOption ? [initialOption] : undefined, fetchOptionsCallback: async (userInput) => {
400
+ const results = searchSowDocuments(userInput || "") || [];
401
+ if (results.length === 0) {
402
+ return Promise.reject(new Error("No SOW documents found"));
403
+ }
404
+ return results.map((doc) => ({
405
+ value: doc.value,
406
+ title: doc.title,
407
+ path: {
408
+ text: doc.path,
409
+ url: doc.value,
410
+ },
411
+ description: "",
412
+ }));
413
+ }, fetchSelectedOptionCallback: async (documentId) => {
414
+ const doc = searchSowDocuments(documentId)?.[0];
415
+ if (!doc) {
416
+ return Promise.reject(new Error("SOW document not found"));
417
+ }
418
+ return {
419
+ value: doc.value,
420
+ title: doc.title,
421
+ path: {
422
+ text: doc.path,
423
+ url: doc.value,
424
+ },
425
+ description: "",
426
+ };
427
+ } }));
428
+ },
429
+ renderCell: (value) => {
430
+ if (!value)
431
+ return null;
432
+ return _jsx("div", { className: "text-left", children: getDocumentNameById(value) });
433
+ },
335
434
  },
336
435
  {
337
436
  field: "paymentTerms",
338
437
  title: "Payment Terms",
339
- type: "oid",
438
+ type: "phid",
340
439
  editable: true,
341
440
  align: "center",
342
441
  onSave: (newValue, context) => {
@@ -349,6 +448,53 @@ export default function Editor() {
349
448
  }
350
449
  return false;
351
450
  },
451
+ renderCellEditor: (value, onChange, context) => {
452
+ const currentValue = value || "";
453
+ const initialOption = getPaymentTermsOptionById(currentValue);
454
+ return (_jsx(PHIDInput, { value: currentValue, onChange: (newValue) => {
455
+ onChange(newValue);
456
+ }, onBlur: (e) => {
457
+ if (e.target.value !== context.row.paymentTerms) {
458
+ dispatch(actions.editAlternativeProposal({
459
+ id: context.row.id,
460
+ paymentTermsId: e.target.value,
461
+ }));
462
+ }
463
+ }, placeholder: "Search for Payment Terms Document", className: "w-full", variant: "withValueTitleAndDescription", initialOptions: initialOption ? [initialOption] : undefined, fetchOptionsCallback: async (userInput) => {
464
+ const results = searchPaymentTermsDocuments(userInput || "") || [];
465
+ if (results.length === 0) {
466
+ return Promise.reject(new Error("No Payment Terms documents found"));
467
+ }
468
+ return results.map((doc) => ({
469
+ value: doc.value,
470
+ title: doc.title,
471
+ path: {
472
+ text: doc.path,
473
+ url: doc.value,
474
+ },
475
+ description: "",
476
+ }));
477
+ }, fetchSelectedOptionCallback: async (documentId) => {
478
+ const doc = searchPaymentTermsDocuments(documentId)?.[0];
479
+ if (!doc) {
480
+ return Promise.reject(new Error("Payment Terms document not found"));
481
+ }
482
+ return {
483
+ value: doc.value,
484
+ title: doc.title,
485
+ path: {
486
+ text: doc.path,
487
+ url: doc.value,
488
+ },
489
+ description: "",
490
+ };
491
+ } }));
492
+ },
493
+ renderCell: (value) => {
494
+ if (!value)
495
+ return null;
496
+ return _jsx("div", { className: "text-left", children: getDocumentNameById(value) });
497
+ },
352
498
  },
353
499
  {
354
500
  field: "status",
@@ -382,7 +528,13 @@ export default function Editor() {
382
528
  return (_jsx("div", { className: `text-center ${statusStyles[value]}`, children: value }));
383
529
  },
384
530
  },
385
- ], []);
531
+ ], [
532
+ dispatch,
533
+ getPaymentTermsOptionById,
534
+ getSowOptionById,
535
+ searchPaymentTermsDocuments,
536
+ searchSowDocuments,
537
+ ]);
386
538
  return (_jsx("div", { className: "w-full bg-gray-50", children: _jsxs("div", { className: "p-6 max-w-4xl mx-auto min-h-screen", children: [_jsx("div", { className: "bg-white rounded-lg p-6 mb-6 shadow-sm", children: _jsx("h1", { className: "text-3xl font-bold text-gray-900 mb-2", children: "Workstream" }) }), _jsx("div", { className: "bg-white rounded-lg p-6 mb-6 shadow-sm", children: _jsxs("div", { className: "flex flex-row gap-6", children: [_jsxs("div", { className: "flex-1", children: [_jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Code" }), _jsx(TextInput, { className: "w-full", defaultValue: state.code || "", onBlur: (e) => {
387
539
  if (e.target.value !== state.code) {
388
540
  handleWorkstreamChange("code", e.target.value);
@@ -399,11 +551,11 @@ export default function Editor() {
399
551
  if (e.target.value !== state.client?.name) {
400
552
  handleClientChange("name", e.target.value);
401
553
  }
402
- }, placeholder: "Enter client name" })] }), _jsxs("div", { children: [_jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Icon" }), _jsxs("div", { className: "flex items-center space-x-2", children: [_jsx("div", { className: "flex-shrink-0", children: _jsx("svg", { className: "w-5 h-5 text-gray-400", fill: "currentColor", viewBox: "0 0 20 20", children: _jsx("path", { fillRule: "evenodd", d: "M4.083 9h1.946c.089-1.546.383-2.97.837-4.118A6.004 6.004 0 004.083 9zM10 2a8 8 0 100 16 8 8 0 000-16zm0 2c-.076 0-.232.032-.465.262-.238.234-.497.623-.737 1.182-.389.907-.673 2.142-.766 3.556h3.936c-.093-1.414-.377-2.649-.766-3.556-.24-.56-.5-.948-.737-1.182C10.232 4.032 10.076 4 10 4zm3.971 5c-.089-1.546-.383-2.97-.837-4.118A6.004 6.004 0 0115.917 9h-1.946zm-2.003 2H8.032c.093 1.414.377 2.649.766 3.556.24.56.5.948.737 1.182.233.23.389.262.465.262.076 0 .232-.032.465-.262.238-.234.498-.623.737-1.182.389-.907.673-2.142.766-3.556zm1.166 4.118c.454-1.147.748-2.572.837-4.118h1.946a6.004 6.004 0 01-2.783 4.118zm-6.268 0C6.412 13.97 6.118 12.546 6.03 11H4.083a6.004 6.004 0 002.783 4.118z", clipRule: "evenodd" }) }) }), _jsx(TextInput, { className: "flex-1", defaultValue: state.client?.icon || "", onBlur: (e) => {
403
- if (e.target.value !== state.client?.icon) {
404
- handleClientChange("icon", e.target.value);
405
- }
406
- }, placeholder: "Enter client icon URL" })] })] })] })] }), _jsxs("div", { className: "bg-white rounded-lg p-6 mt-6 mb-6 shadow-sm", children: [_jsx("h1", { className: "text-2xl text-gray-900 mb-4", children: "Request for Proposal" }), _jsx("div", { className: "w-full flex flex-row items-center gap-8", children: _jsx("div", { className: "w-[350px]", children: _jsx(OIDInput, { name: "Request for Proposal", label: "RFP Document", placeholder: "Search for RFP Document", variant: "withValueTitleAndDescription", value: newlyCreatedRfpId || state.rfp?.id || "", onBlur: (e) => {
554
+ }, placeholder: "Enter client name" })] }), _jsxs("div", { children: [_jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Icon" }), _jsxs("div", { className: "flex items-center space-x-2", children: [_jsx("div", { className: "flex-shrink-0", children: _jsx("svg", { className: "w-5 h-5 text-gray-400", fill: "currentColor", viewBox: "0 0 20 20", children: _jsx("path", { fillRule: "evenodd", d: "M4.083 9h1.946c.089-1.546.383-2.97.837-4.118A6.004 6.004 0 004.083 9zM10 2a8 8 0 100 16 8 8 0 000-16zm0 2c-.076 0-.232.032-.465.262-.238.234-.497.623-.737 1.182-.389.907-.673 2.142-.766 3.556h3.936c-.093-1.414-.377-2.649-.766-3.556-.24-.56-.5-.948-.737-1.182C10.232 4.032 10.076 4 10 4zm3.971 5c-.089-1.546-.383-2.97-.837-4.118A6.004 6.004 0 0115.917 9h-1.946zm-2.003 2H8.032c.093 1.414.377 2.649.766 3.556.24.56.5.948.737 1.182.233.23.389.262.465.262.076 0 .232-.032.465-.262.238-.234.498-.623.737-1.182.389-.907.673-2.142.766-3.556zm1.166 4.118c.454-1.147.748-2.572.837-4.118h1.946a6.004 6.004 0 01-2.783 4.118zm-6.268 0C6.412 13.97 6.118 12.546 6.03 11H4.083a6.004 6.004 0 002.783 4.118z", clipRule: "evenodd" }) }) }), _jsxs("div", { className: "flex items-center space-x-2", children: [_jsx(TextInput, { className: "flex-1", defaultValue: state.client?.icon || "", onBlur: (e) => {
555
+ if (e.target.value !== state.client?.icon) {
556
+ handleClientChange("icon", e.target.value);
557
+ }
558
+ }, placeholder: "Enter client icon URL" }), state.client?.icon ? (_jsx("img", { src: state.client?.icon, alt: "Client Icon", className: "w-10 h-10 object-cover" })) : ("")] })] })] })] })] }), _jsxs("div", { className: "bg-white rounded-lg p-6 mt-6 mb-6 shadow-sm", children: [_jsx("h1", { className: "text-2xl text-gray-900 mb-4", children: "Request for Proposal" }), _jsx("div", { className: "w-full flex flex-row items-center gap-8", children: _jsx("div", { className: "w-[350px]", children: _jsx(OIDInput, { name: "Request for Proposal", label: "RFP Document", placeholder: "Search for RFP Document", variant: "withValueTitleAndDescription", value: newlyCreatedRfpId || state.rfp?.id || "", onBlur: (e) => {
407
559
  if (e.target.value !== state.rfp?.id) {
408
560
  dispatch(actions.setRequestForProposal({
409
561
  rfpId: e.target.value,
@@ -625,7 +777,9 @@ export default function Editor() {
625
777
  paymentTermsId: createdNode.id,
626
778
  }));
627
779
  }
628
- }, children: isCreatingPaymentTerms ? "Creating..." : "Create Payment Terms" })] })] }), _jsxs("div", { children: [_jsx("h2", { className: "text-lg font-medium text-gray-900 mb-4", children: "Alternative Proposals" }), _jsx(ObjectSetTable, { columns: alternativeProposalsColumns, data: alternativeProposalsData, allowRowSelection: true, onDelete: (data) => {
780
+ }, children: isCreatingPaymentTerms
781
+ ? "Creating..."
782
+ : "Create Payment Terms" })] })] }), _jsxs("div", { children: [_jsx("h2", { className: "text-lg font-medium text-gray-900 mb-4", children: "Alternative Proposals" }), _jsx(ObjectSetTable, { columns: alternativeProposalsColumns, data: alternativeProposalsData, allowRowSelection: true, onDelete: (data) => {
629
783
  if (data.length > 0) {
630
784
  data.forEach((d) => {
631
785
  dispatch(actions.removeAlternativeProposal({
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "network-admin",
3
- "description": "A place to handle all network related info",
3
+ "description": "A place to handle all network related info.",
4
4
  "category": "Project Management",
5
5
  "publisher": {
6
6
  "name": "Powerhouse",
@@ -56,6 +56,13 @@
56
56
  "documentTypes": [
57
57
  "powerhouse/network-profile"
58
58
  ]
59
+ },
60
+ {
61
+ "id": "builder-profile-editor",
62
+ "name": "Builder Profile Editor",
63
+ "documentTypes": [
64
+ "powerhouse/builder-profile"
65
+ ]
59
66
  }
60
67
  ],
61
68
  "apps": [
@@ -0,0 +1,8 @@
1
+ /**
2
+ * This file aggregates all processor factories
3
+ * Auto-generated by codegen - DO NOT EDIT MANUALLY
4
+ */
5
+ import { type ProcessorRecord, type IProcessorHostModule } from "document-drive/processors/types";
6
+ import { type PHDocumentHeader } from "document-model";
7
+ export declare const processorFactory: (module: IProcessorHostModule) => (driveHeader: PHDocumentHeader) => Promise<ProcessorRecord[]>;
8
+ //# sourceMappingURL=factory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../processors/factory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,oBAAoB,EAE1B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAKvD,eAAO,MAAM,gBAAgB,GAAI,QAAQ,oBAAoB,MAQ7C,aAAa,gBAAgB,KAAG,OAAO,CAAC,eAAe,EAAE,CAWxE,CAAC"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * This file aggregates all processor factories
3
+ * Auto-generated by codegen - DO NOT EDIT MANUALLY
4
+ */
5
+ // Import processor factories here as they are generated
6
+ import { workstreamsProcessorFactory } from "./workstreams/factory.js";
7
+ export const processorFactory = (module) => {
8
+ // Initialize all processor factories once with the module
9
+ const factories = [];
10
+ // Add processors here as they are generated
11
+ factories.push(workstreamsProcessorFactory(module));
12
+ // Return the inner function that will be called for each drive
13
+ return async (driveHeader) => {
14
+ const processors = [];
15
+ // Call each cached factory with the driveHeader
16
+ for (const factory of factories) {
17
+ const factoryProcessors = await factory(driveHeader);
18
+ processors.push(...factoryProcessors);
19
+ }
20
+ return processors;
21
+ };
22
+ };
@@ -1,2 +1,5 @@
1
1
  export {};
2
+ export * as WorkstreamsProcessor from "./workstreams/index.js";
3
+ export { processorFactory } from "./factory.js";
4
+ export { workstreamsProcessorFactory } from "./workstreams/factory.js";
2
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../processors/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../processors/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAG,CAAC;AACX,OAAO,KAAK,oBAAoB,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAC"}
@@ -1 +1,3 @@
1
- export {};
1
+ export * as WorkstreamsProcessor from "./workstreams/index.js";
2
+ export { processorFactory } from "./factory.js";
3
+ export { workstreamsProcessorFactory } from "./workstreams/factory.js";
@@ -0,0 +1,4 @@
1
+ import { type ProcessorRecord, type IProcessorHostModule } from "document-drive/processors/types";
2
+ import { type PHDocumentHeader } from "document-model";
3
+ export declare const workstreamsProcessorFactory: (module: IProcessorHostModule) => (driveHeader: PHDocumentHeader) => Promise<ProcessorRecord[]>;
4
+ //# sourceMappingURL=factory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../processors/workstreams/factory.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,oBAAoB,EAC1B,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAGvD,eAAO,MAAM,2BAA2B,GACrC,QAAQ,oBAAoB,MACtB,aAAa,gBAAgB,KAAG,OAAO,CAAC,eAAe,EAAE,CA0B/D,CAAC"}
@@ -0,0 +1,22 @@
1
+ import { WorkstreamsProcessor } from "./index.js";
2
+ export const workstreamsProcessorFactory = (module) => async (driveHeader) => {
3
+ // Create a namespace for the processor and the provided drive id
4
+ const namespace = WorkstreamsProcessor.getNamespace(driveHeader.id);
5
+ // Create a namespaced db for the processor
6
+ const store = await module.relationalDb.createNamespace(namespace);
7
+ // Create a filter for the processor
8
+ const filter = {
9
+ branch: ["main"],
10
+ documentId: ["*"],
11
+ documentType: ["powerhouse/workstream", "powerhouse/network-profile", "powerhouse/scopeofwork"],
12
+ scope: ["global"],
13
+ };
14
+ // Create the processor
15
+ const processor = new WorkstreamsProcessor(namespace, filter, store);
16
+ return [
17
+ {
18
+ processor,
19
+ filter,
20
+ },
21
+ ];
22
+ };
@@ -0,0 +1,14 @@
1
+ import { RelationalDbProcessor } from "document-drive/processors/relational";
2
+ import { type InternalTransmitterUpdate, type InternalOperationUpdate } from "document-drive/server/listener/transmitter/internal";
3
+ import { type DB } from "./schema.js";
4
+ export declare class WorkstreamsProcessor extends RelationalDbProcessor<DB> {
5
+ static getNamespace(driveId: string): string;
6
+ initAndUpgrade(): Promise<void>;
7
+ onStrands(strands: InternalTransmitterUpdate[]): Promise<void>;
8
+ onDisconnect(): Promise<void>;
9
+ setWorkstream: (strand: InternalTransmitterUpdate) => Promise<void>;
10
+ updateInitialProposalInWorkstream: (strand: InternalTransmitterUpdate, operation: InternalOperationUpdate) => Promise<void>;
11
+ updateNetworkInWorkstream: (strand: InternalTransmitterUpdate, operation: InternalOperationUpdate) => Promise<void>;
12
+ updateWorkstream: (strand: InternalTransmitterUpdate, operation: InternalOperationUpdate) => Promise<void>;
13
+ }
14
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../processors/workstreams/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAC7E,OAAO,EAAE,KAAK,yBAAyB,EAAE,KAAK,uBAAuB,EAAE,MAAM,qDAAqD,CAAC;AAEnI,OAAO,EAAE,KAAK,EAAE,EAAE,MAAM,aAAa,CAAC;AAGtC,qBAAa,oBAAqB,SAAQ,qBAAqB,CAAC,EAAE,CAAC;WACjD,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM;IAKtC,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;IAI/B,SAAS,CACtB,OAAO,EAAE,yBAAyB,EAAE,GACnC,OAAO,CAAC,IAAI,CAAC;IAwCV,YAAY;IAelB,aAAa,GAAU,QAAQ,yBAAyB,mBA8BvD;IAED,iCAAiC,GAAU,QAAQ,yBAAyB,EAAE,WAAW,uBAAuB,mBA2C/G;IAED,yBAAyB,GAAU,QAAQ,yBAAyB,EAAE,WAAW,uBAAuB,mBAwCvG;IAED,gBAAgB,GAAU,QAAQ,yBAAyB,EAAE,WAAW,uBAAuB,mBAyC9F;CACF"}