@powerhousedao/network-admin 0.0.10 → 0.0.11

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.
@@ -1 +1 @@
1
- {"version":3,"file":"DriveExplorer.d.ts","sourceRoot":"","sources":["../../../../editors/network-admin/components/DriveExplorer.tsx"],"names":[],"mappings":"AAwCA;;;GAGG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,GAAG,2CAklCvC"}
1
+ {"version":3,"file":"DriveExplorer.d.ts","sourceRoot":"","sources":["../../../../editors/network-admin/components/DriveExplorer.tsx"],"names":[],"mappings":"AAwCA;;;GAGG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,GAAG,2CAkmCvC"}
@@ -4,7 +4,7 @@ import { addDocument, setSelectedNode, useAllFolderNodes, useDocumentModelModule
4
4
  import { twMerge } from "tailwind-merge";
5
5
  import { useCallback, useRef, useState, useMemo } from "react";
6
6
  import { EditorContainer } from "./EditorContainer.js";
7
- import { getNewDocumentObject } from "../utils.js";
7
+ import { createDocument as createNewWorkstreamDocument } from "../../../document-models/workstream/gen/utils.js";
8
8
  import { IsolatedSidebarProvider } from "./IsolatedSidebarProvider.js";
9
9
  import { IsolatedSidebar } from "./IsolatedSidebar.js";
10
10
  /**
@@ -453,7 +453,22 @@ export function DriveExplorer(props) {
453
453
  console.log("Created workstream folder:", folder);
454
454
  setLastCreatedFolder(folder);
455
455
  }
456
- const node = await addDocument(selectedDrive?.header.id || "", fileName, documentType, folder?.id, getNewDocumentObject(fileName, documentType), undefined, editorType);
456
+ const createdDocument = createNewWorkstreamDocument({
457
+ global: {
458
+ code: "",
459
+ title: fileName,
460
+ status: "RFP_DRAFT",
461
+ client: null,
462
+ rfp: null,
463
+ initialProposal: null,
464
+ alternativeProposals: [],
465
+ sow: null,
466
+ paymentTerms: null,
467
+ paymentRequests: [],
468
+ },
469
+ local: {},
470
+ });
471
+ const node = await addDocument(selectedDrive?.header.id || "", fileName, documentType, folder?.id, createdDocument, undefined, editorType);
457
472
  selectedDocumentModel.current = null;
458
473
  console.log("Created document node", node);
459
474
  if (node) {
@@ -1 +1 @@
1
- {"version":3,"file":"EditorContainer.d.ts","sourceRoot":"","sources":["../../../../editors/network-admin/components/EditorContainer.tsx"],"names":[],"mappings":"AAsBA;;;;GAIG;AACH,eAAO,MAAM,eAAe,GAAI,OAAO;IACrC,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,gBAAgB,EAAE,MAAM,CAAC;IACzB,mBAAmB,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CAC3C,4CAwKA,CAAC"}
1
+ {"version":3,"file":"EditorContainer.d.ts","sourceRoot":"","sources":["../../../../editors/network-admin/components/EditorContainer.tsx"],"names":[],"mappings":"AAwBA;;;;GAIG;AACH,eAAO,MAAM,eAAe,GAAI,OAAO;IACrC,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,gBAAgB,EAAE,MAAM,CAAC;IACzB,mBAAmB,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CAC3C,4CA6NA,CAAC"}
@@ -3,7 +3,9 @@ import { getRevisionFromDate, useTimelineItems } from "@powerhousedao/common";
3
3
  import { DocumentToolbar, RevisionHistory, } from "@powerhousedao/design-system";
4
4
  import { exportFile, useEditorModuleById, useSelectedDrive, useDocumentById, addDocument, useNodes, useFallbackEditorModule, } from "@powerhousedao/reactor-browser";
5
5
  import { Suspense, useCallback, useState } from "react";
6
- import { getNewDocumentObject } from "../utils.js";
6
+ import { createDocument as createNewRFPDocument } from "../../../document-models/request-for-proposals/gen/utils.js";
7
+ import { ScopeOfWork } from "@powerhousedao/project-management/document-models";
8
+ import { createDocument as createNewPaymentTermsDocument } from "../../../document-models/payment-terms/gen/utils.js";
7
9
  /**
8
10
  * Document editor container that wraps individual document editors.
9
11
  * Handles document loading, toolbar, revision history, and dynamic editor loading.
@@ -23,7 +25,30 @@ export const EditorContainer = (props) => {
23
25
  const rfpDocName = `RFP-${(selectedDocument?.state).global?.title || "Untitled"}`;
24
26
  const rfpDocCode = `RFP-${(selectedDocument?.state).global?.code || ""}`;
25
27
  try {
26
- const createdNode = await addDocument(selectedDrive?.header.id || "", rfpDocName, "powerhouse/rfp", folderId, getNewDocumentObject(rfpDocName, "powerhouse/rfp", rfpDocCode), undefined, "request-for-proposals-editor");
28
+ const createdDocument = createNewRFPDocument({
29
+ global: {
30
+ issuer: "",
31
+ title: rfpDocName,
32
+ code: rfpDocCode,
33
+ summary: "",
34
+ briefing: "",
35
+ rfpCommenter: [],
36
+ eligibilityCriteria: "",
37
+ evaluationCriteria: "",
38
+ budgetRange: {
39
+ min: null,
40
+ max: null,
41
+ currency: null,
42
+ },
43
+ contextDocuments: [],
44
+ status: "DRAFT",
45
+ proposals: [],
46
+ deadline: null,
47
+ tags: null,
48
+ },
49
+ local: {},
50
+ });
51
+ const createdNode = await addDocument(selectedDrive?.header.id || "", rfpDocName, "powerhouse/rfp", folderId, createdDocument, undefined, "request-for-proposals-editor");
27
52
  return createdNode;
28
53
  }
29
54
  catch (error) {
@@ -34,7 +59,19 @@ export const EditorContainer = (props) => {
34
59
  const createSowDocument = useCallback(async () => {
35
60
  const sowDocName = `SOW-${(selectedDocument?.state).global?.title || "Untitled"}`;
36
61
  try {
37
- const createdNode = await addDocument(selectedDrive?.header.id || "", sowDocName, "powerhouse/scopeofwork", folderId, getNewDocumentObject(sowDocName, "powerhouse/scopeofwork"), undefined, "scope-of-work-editor");
62
+ const createdDocument = ScopeOfWork.utils.createDocument({
63
+ global: {
64
+ title: sowDocName,
65
+ description: "",
66
+ status: "DRAFT",
67
+ deliverables: [],
68
+ projects: [],
69
+ roadmaps: [],
70
+ contributors: [],
71
+ },
72
+ local: {},
73
+ });
74
+ const createdNode = await addDocument(selectedDrive?.header.id || "", sowDocName, "powerhouse/scopeofwork", folderId, createdDocument, undefined, "scope-of-work-editor");
38
75
  return createdNode;
39
76
  }
40
77
  catch (error) {
@@ -45,7 +82,25 @@ export const EditorContainer = (props) => {
45
82
  const createPaymentTermsDocument = useCallback(async () => {
46
83
  const paymentTermsDocName = `Payment Terms-${(selectedDocument?.state).global?.title || "Untitled"}`;
47
84
  try {
48
- const createdNode = await addDocument(selectedDrive?.header.id || "", paymentTermsDocName, "payment-terms", folderId, getNewDocumentObject(paymentTermsDocName, "payment-terms"), undefined, "payment-terms-editor");
85
+ const createdDocument = createNewPaymentTermsDocument({
86
+ global: {
87
+ status: "DRAFT",
88
+ proposer: "",
89
+ payer: "",
90
+ currency: "USD",
91
+ paymentModel: "MILESTONE",
92
+ totalAmount: null,
93
+ milestoneSchedule: [],
94
+ costAndMaterials: null,
95
+ retainerDetails: null,
96
+ escrowDetails: null,
97
+ evaluation: null,
98
+ bonusClauses: [],
99
+ penaltyClauses: [],
100
+ },
101
+ local: {},
102
+ });
103
+ const createdNode = await addDocument(selectedDrive?.header.id || "", paymentTermsDocName, "payment-terms", folderId, createdDocument, undefined, "payment-terms-editor");
49
104
  return createdNode;
50
105
  }
51
106
  catch (error) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@powerhousedao/network-admin",
3
3
  "description": "Network Admin package for Powerhouse",
4
- "version": "0.0.10",
4
+ "version": "0.0.11",
5
5
  "license": "AGPL-3.0-only",
6
6
  "type": "module",
7
7
  "files": [