@powerhousedao/network-admin 0.0.23 → 0.0.24
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/editors/hooks/useNetworkProfileDocument.d.ts +4 -0
- package/dist/editors/hooks/useNetworkProfileDocument.d.ts.map +1 -0
- package/dist/editors/hooks/useNetworkProfileDocument.js +8 -0
- package/dist/editors/hooks/usePaymentTermsDocument.d.ts +4 -0
- package/dist/editors/hooks/usePaymentTermsDocument.d.ts.map +1 -0
- package/dist/editors/hooks/usePaymentTermsDocument.js +8 -0
- package/dist/editors/hooks/useRequestForProposalsDocument.d.ts +4 -0
- package/dist/editors/hooks/useRequestForProposalsDocument.d.ts.map +1 -0
- package/dist/editors/hooks/useRequestForProposalsDocument.js +8 -0
- package/dist/editors/hooks/useWorkstreamDocument.d.ts +4 -0
- package/dist/editors/hooks/useWorkstreamDocument.d.ts.map +1 -0
- package/dist/editors/hooks/useWorkstreamDocument.js +8 -0
- package/dist/editors/network-admin/components/DriveExplorer.d.ts +3 -1
- package/dist/editors/network-admin/components/DriveExplorer.d.ts.map +1 -1
- package/dist/editors/network-admin/components/DriveExplorer.js +83 -114
- package/dist/editors/network-admin/editor.d.ts +3 -14
- package/dist/editors/network-admin/editor.d.ts.map +1 -1
- package/dist/editors/network-admin/editor.js +2 -24
- package/dist/editors/network-admin/index.d.ts +0 -1
- package/dist/editors/network-admin/index.d.ts.map +1 -1
- package/dist/editors/network-admin/index.js +1 -2
- package/dist/editors/network-profile/editor.d.ts +1 -1
- package/dist/editors/network-profile/editor.d.ts.map +1 -1
- package/dist/editors/network-profile/editor.js +4 -4
- package/dist/editors/payment-terms/basic-terms-tab.d.ts +5 -3
- package/dist/editors/payment-terms/basic-terms-tab.d.ts.map +1 -1
- package/dist/editors/payment-terms/basic-terms-tab.js +18 -14
- package/dist/editors/payment-terms/clauses-tab.d.ts +4 -2
- package/dist/editors/payment-terms/clauses-tab.d.ts.map +1 -1
- package/dist/editors/payment-terms/cost-materials-tab.d.ts +5 -3
- package/dist/editors/payment-terms/cost-materials-tab.d.ts.map +1 -1
- package/dist/editors/payment-terms/cost-materials-tab.js +24 -15
- package/dist/editors/payment-terms/editor.d.ts +1 -1
- package/dist/editors/payment-terms/editor.d.ts.map +1 -1
- package/dist/editors/payment-terms/editor.js +5 -5
- package/dist/editors/payment-terms/escrow-tab.d.ts +4 -2
- package/dist/editors/payment-terms/escrow-tab.d.ts.map +1 -1
- package/dist/editors/payment-terms/escrow-tab.js +4 -4
- package/dist/editors/payment-terms/evaluation-tab.d.ts +4 -2
- package/dist/editors/payment-terms/evaluation-tab.d.ts.map +1 -1
- package/dist/editors/payment-terms/index.d.ts.map +1 -1
- package/dist/editors/payment-terms/milestones-tab.d.ts +5 -4
- package/dist/editors/payment-terms/milestones-tab.d.ts.map +1 -1
- package/dist/editors/payment-terms/milestones-tab.js +31 -21
- package/dist/editors/payment-terms/retainer-tab.d.ts +4 -2
- package/dist/editors/payment-terms/retainer-tab.d.ts.map +1 -1
- package/dist/editors/payment-terms/retainer-tab.js +18 -10
- package/dist/editors/request-for-proposals/editor.d.ts +1 -1
- package/dist/editors/request-for-proposals/editor.d.ts.map +1 -1
- package/dist/editors/request-for-proposals/editor.js +3 -3
- package/dist/editors/workstream/editor.d.ts +1 -1
- package/dist/editors/workstream/editor.d.ts.map +1 -1
- package/dist/editors/workstream/editor.js +70 -76
- package/dist/style.css +0 -35
- package/package.json +2 -2
- package/dist/editors/network-admin/components/EditorContainer.d.ts +0 -13
- package/dist/editors/network-admin/components/EditorContainer.d.ts.map +0 -1
- package/dist/editors/network-admin/components/EditorContainer.js +0 -99
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { NetworkProfileDocument } from "../../document-models/network-profile/index.js";
|
|
2
|
+
export declare function useNetworkProfileDocument(documentId: string | null | undefined): never[] | [NetworkProfileDocument, import("@powerhousedao/reactor-browser").DocumentDispatch<import("../../document-models/network-profile/gen/actions.js").NetworkProfileNetworkProfileManagementAction>];
|
|
3
|
+
export declare function useSelectedNetworkProfileDocument(): never[] | [NetworkProfileDocument, import("@powerhousedao/reactor-browser").DocumentDispatch<import("../../document-models/network-profile/gen/actions.js").NetworkProfileNetworkProfileManagementAction>];
|
|
4
|
+
//# sourceMappingURL=useNetworkProfileDocument.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useNetworkProfileDocument.d.ts","sourceRoot":"","sources":["../../../editors/hooks/useNetworkProfileDocument.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAEV,sBAAsB,EACvB,MAAM,gDAAgD,CAAC;AAExD,wBAAgB,yBAAyB,CACvC,UAAU,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,8MAMtC;AAED,wBAAgB,iCAAiC,+MAGhD"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { useDocumentOfType, useSelectedDocumentId, } from "@powerhousedao/reactor-browser";
|
|
2
|
+
export function useNetworkProfileDocument(documentId) {
|
|
3
|
+
return useDocumentOfType(documentId, "powerhouse/network-profile");
|
|
4
|
+
}
|
|
5
|
+
export function useSelectedNetworkProfileDocument() {
|
|
6
|
+
const selectedDocumentId = useSelectedDocumentId();
|
|
7
|
+
return useNetworkProfileDocument(selectedDocumentId);
|
|
8
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { PaymentTermsAction, PaymentTermsDocument } from "../../document-models/payment-terms/index.js";
|
|
2
|
+
export declare function usePaymentTermsDocument(documentId: string | null | undefined): never[] | [PaymentTermsDocument, import("@powerhousedao/reactor-browser").DocumentDispatch<PaymentTermsAction>];
|
|
3
|
+
export declare function useSelectedPaymentTermsDocument(): never[] | [PaymentTermsDocument, import("@powerhousedao/reactor-browser").DocumentDispatch<PaymentTermsAction>];
|
|
4
|
+
//# sourceMappingURL=usePaymentTermsDocument.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePaymentTermsDocument.d.ts","sourceRoot":"","sources":["../../../editors/hooks/usePaymentTermsDocument.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,kBAAkB,EAClB,oBAAoB,EACrB,MAAM,8CAA8C,CAAC;AAEtD,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,mHAMtC;AAED,wBAAgB,+BAA+B,oHAG9C"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { useDocumentOfType, useSelectedDocumentId, } from "@powerhousedao/reactor-browser";
|
|
2
|
+
export function usePaymentTermsDocument(documentId) {
|
|
3
|
+
return useDocumentOfType(documentId, "payment-terms");
|
|
4
|
+
}
|
|
5
|
+
export function useSelectedPaymentTermsDocument() {
|
|
6
|
+
const selectedDocumentId = useSelectedDocumentId();
|
|
7
|
+
return usePaymentTermsDocument(selectedDocumentId);
|
|
8
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { RequestForProposalsAction, RequestForProposalsDocument } from "../../document-models/request-for-proposals/index.js";
|
|
2
|
+
export declare function useRequestForProposalsDocument(documentId: string | null | undefined): never[] | [RequestForProposalsDocument, import("@powerhousedao/reactor-browser").DocumentDispatch<RequestForProposalsAction>];
|
|
3
|
+
export declare function useSelectedRequestForProposalsDocument(): never[] | [RequestForProposalsDocument, import("@powerhousedao/reactor-browser").DocumentDispatch<RequestForProposalsAction>];
|
|
4
|
+
//# sourceMappingURL=useRequestForProposalsDocument.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRequestForProposalsDocument.d.ts","sourceRoot":"","sources":["../../../editors/hooks/useRequestForProposalsDocument.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,yBAAyB,EACzB,2BAA2B,EAC5B,MAAM,sDAAsD,CAAC;AAE9D,wBAAgB,8BAA8B,CAC5C,UAAU,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,iIAMtC;AAED,wBAAgB,sCAAsC,kIAGrD"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { useDocumentOfType, useSelectedDocumentId, } from "@powerhousedao/reactor-browser";
|
|
2
|
+
export function useRequestForProposalsDocument(documentId) {
|
|
3
|
+
return useDocumentOfType(documentId, "powerhouse/rfp");
|
|
4
|
+
}
|
|
5
|
+
export function useSelectedRequestForProposalsDocument() {
|
|
6
|
+
const selectedDocumentId = useSelectedDocumentId();
|
|
7
|
+
return useRequestForProposalsDocument(selectedDocumentId);
|
|
8
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { WorkstreamAction, WorkstreamDocument } from "../../document-models/workstream/index.js";
|
|
2
|
+
export declare function useWorkstreamDocument(documentId: string | null | undefined): never[] | [WorkstreamDocument, import("@powerhousedao/reactor-browser").DocumentDispatch<WorkstreamAction>];
|
|
3
|
+
export declare function useSelectedWorkstreamDocument(): never[] | [WorkstreamDocument, import("@powerhousedao/reactor-browser").DocumentDispatch<WorkstreamAction>];
|
|
4
|
+
//# sourceMappingURL=useWorkstreamDocument.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useWorkstreamDocument.d.ts","sourceRoot":"","sources":["../../../editors/hooks/useWorkstreamDocument.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,gBAAgB,EAChB,kBAAkB,EACnB,MAAM,2CAA2C,CAAC;AAEnD,wBAAgB,qBAAqB,CACnC,UAAU,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,+GAMtC;AAED,wBAAgB,6BAA6B,gHAG5C"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { useDocumentOfType, useSelectedDocumentId, } from "@powerhousedao/reactor-browser";
|
|
2
|
+
export function useWorkstreamDocument(documentId) {
|
|
3
|
+
return useDocumentOfType(documentId, "powerhouse/workstream");
|
|
4
|
+
}
|
|
5
|
+
export function useSelectedWorkstreamDocument() {
|
|
6
|
+
const selectedDocumentId = useSelectedDocumentId();
|
|
7
|
+
return useWorkstreamDocument(selectedDocumentId);
|
|
8
|
+
}
|
|
@@ -2,5 +2,7 @@
|
|
|
2
2
|
* Main drive explorer component with sidebar navigation and content area.
|
|
3
3
|
* Layout: Left sidebar (folder tree) + Right content area (files/folders + document editor)
|
|
4
4
|
*/
|
|
5
|
-
export declare function DriveExplorer(props:
|
|
5
|
+
export declare function DriveExplorer(props: {
|
|
6
|
+
children?: any;
|
|
7
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
6
8
|
//# sourceMappingURL=DriveExplorer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DriveExplorer.d.ts","sourceRoot":"","sources":["../../../../editors/network-admin/components/DriveExplorer.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DriveExplorer.d.ts","sourceRoot":"","sources":["../../../../editors/network-admin/components/DriveExplorer.tsx"],"names":[],"mappings":"AA6CA;;;GAGG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE;IAAE,QAAQ,CAAC,EAAE,GAAG,CAAA;CAAE,2CAskBtD"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Button, CreateDocumentModal } from "@powerhousedao/design-system";
|
|
3
3
|
import { Sidebar, SidebarProvider, } from "@powerhousedao/document-engineering";
|
|
4
|
-
import { addDocument, setSelectedNode, useAllFolderNodes, useFileChildNodes, useSelectedDrive, useSelectedFolder, dispatchActions, useSelectedDocument, useSelectedDriveDocuments, showDeleteNodeModal,
|
|
4
|
+
import { addDocument, setSelectedNode, useAllFolderNodes, useFileChildNodes, useSelectedDrive, useSelectedFolder, dispatchActions, useSelectedDocument, useSelectedDriveDocuments, showDeleteNodeModal, useNodeActions, } from "@powerhousedao/reactor-browser";
|
|
5
5
|
import { useCallback, useRef, useState, useMemo, useEffect } from "react";
|
|
6
|
-
import { EditorContainer } from "./EditorContainer.js";
|
|
7
6
|
import { editWorkstream } from "../../../document-models/workstream/gen/creators.js";
|
|
8
7
|
import { PaymentIcon } from "./icons/PaymentIcon.js";
|
|
9
8
|
import { RfpIcon } from "./icons/RfpIcon.js";
|
|
@@ -26,8 +25,6 @@ const WorkstreamStatusEnums = [
|
|
|
26
25
|
*/
|
|
27
26
|
export function DriveExplorer(props) {
|
|
28
27
|
// === DOCUMENT EDITOR STATE ===
|
|
29
|
-
// Customize document opening/closing behavior here
|
|
30
|
-
const [activeDocumentId, setActiveDocumentId] = useState();
|
|
31
28
|
const [activeSidebarNodeId, setActiveSidebarNodeId] = useState("workstreams");
|
|
32
29
|
const [openModal, setOpenModal] = useState(false);
|
|
33
30
|
const [selectedRootNode, setSelectedRootNode] = useState("workstreams");
|
|
@@ -38,7 +35,6 @@ export function DriveExplorer(props) {
|
|
|
38
35
|
const [selectedDrive] = useSelectedDrive(); // Currently selected drive
|
|
39
36
|
const selectedFolder = useSelectedFolder(); // Currently selected folder
|
|
40
37
|
const allDocuments = useSelectedDriveDocuments();
|
|
41
|
-
const selectedDriveId = useSelectedDriveId();
|
|
42
38
|
const { onRenameNode } = useNodeActions();
|
|
43
39
|
// Listen to global selected document state (for external editors like Scope of Work)
|
|
44
40
|
const [globalSelectedDocument] = useSelectedDocument();
|
|
@@ -50,30 +46,22 @@ export function DriveExplorer(props) {
|
|
|
50
46
|
doc.header.documentType === "powerhouse/scopeofwork" ||
|
|
51
47
|
doc.header.documentType === "powerhouse/rfp" ||
|
|
52
48
|
doc.header.documentType === "payment-terms");
|
|
49
|
+
//check if network profile doc is created, set isNetworkProfileCreated to true
|
|
50
|
+
const isNetworkProfileCreated = networkAdminDocuments?.some((doc) => doc.header.documentType === "powerhouse/network-profile") || false;
|
|
53
51
|
// Sync global selected document with local activeDocumentId
|
|
54
|
-
// This makes setSelectedNode() trigger the EditorContainer to open
|
|
55
52
|
useEffect(() => {
|
|
56
53
|
if (globalSelectedDocument?.header?.id) {
|
|
57
|
-
setActiveDocumentId(globalSelectedDocument.header.id);
|
|
58
54
|
// Also update the sidebar node ID to match
|
|
59
55
|
setActiveSidebarNodeId(`editor-${globalSelectedDocument.header.id}`);
|
|
60
56
|
}
|
|
61
57
|
}, [globalSelectedDocument]);
|
|
62
58
|
// Check if current active document is a Scope of Work (should show in full view)
|
|
63
|
-
const
|
|
64
|
-
const isScopeOfWorkFullView = activeDoc?.header.documentType === "powerhouse/scopeofwork";
|
|
65
|
-
// check if workstream doc is created, set isWorkstreamCreated to true
|
|
66
|
-
const isWorkstreamCreated = networkAdminDocuments?.some((doc) => doc.header.documentType === "powerhouse/workstream") || false;
|
|
67
|
-
//check if network profile doc is created, set isNetworkProfileCreated to true
|
|
68
|
-
const isNetworkProfileCreated = networkAdminDocuments?.some((doc) => doc.header.documentType === "powerhouse/network-profile") || false;
|
|
59
|
+
const isScopeOfWorkFullView = globalSelectedDocument?.header.documentType === "powerhouse/scopeofwork";
|
|
69
60
|
// Convert network admin documents to SidebarNode format
|
|
70
61
|
const sidebarNodes = useMemo(() => {
|
|
71
62
|
// Group documents by type
|
|
72
|
-
const workstreamDocs = networkAdminDocuments?.filter((doc) => doc.header.documentType === "powerhouse/workstream")
|
|
73
|
-
const
|
|
74
|
-
const rfpDocs = networkAdminDocuments?.filter((doc) => doc.header.documentType === "powerhouse/rfp") || [];
|
|
75
|
-
const paymentTermsDocs = networkAdminDocuments?.filter((doc) => doc.header.documentType === "payment-terms") || [];
|
|
76
|
-
const networkProfileDocs = networkAdminDocuments?.filter((doc) => doc.header.documentType === "powerhouse/network-profile") || [];
|
|
63
|
+
const workstreamDocs = (networkAdminDocuments?.filter((doc) => doc.header.documentType === "powerhouse/workstream") ?? []);
|
|
64
|
+
const networkProfileDocs = (networkAdminDocuments?.filter((doc) => doc.header.documentType === "powerhouse/network-profile") ?? []);
|
|
77
65
|
const workstreamsNode = {
|
|
78
66
|
id: "workstreams",
|
|
79
67
|
title: "Workstreams",
|
|
@@ -87,82 +75,71 @@ export function DriveExplorer(props) {
|
|
|
87
75
|
return {
|
|
88
76
|
id: `workstream-status-${status}`,
|
|
89
77
|
title: statusTitle +
|
|
90
|
-
(workstreamDocs.filter((doc) => doc.state
|
|
91
|
-
? ` (${workstreamDocs.filter((doc) => doc.state
|
|
78
|
+
(workstreamDocs.filter((doc) => doc.state.global.status === status).length > 0
|
|
79
|
+
? ` (${workstreamDocs.filter((doc) => doc.state.global.status === status).length})`
|
|
92
80
|
: ""),
|
|
93
|
-
children:
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
id: `editor-${doc.header.id}`,
|
|
121
|
-
title: `${doc.state?.global?.code ? doc.state?.global?.code + " - " : ""}${doc.state?.global?.title || doc.header.name}`,
|
|
122
|
-
icon: _jsx(WorkstreamIcon, { className: "w-5 h-5" }),
|
|
123
|
-
children: wstrChildDocs.map((childDoc) => {
|
|
124
|
-
let dynamicTitle = childDoc?.header.documentType === "powerhouse/rfp"
|
|
125
|
-
? `Request For Proposal`
|
|
126
|
-
: `${childDoc.state?.global?.code ? childDoc.state?.global?.code + " - " : ""}${childDoc.state?.global?.title || childDoc.header.name}`;
|
|
127
|
-
return {
|
|
128
|
-
id: `editor-${childDoc.header.id}`,
|
|
129
|
-
title: dynamicTitle,
|
|
81
|
+
children: workstreamDocs
|
|
82
|
+
.filter((doc) => doc.state.global.status === status)
|
|
83
|
+
.map((doc) => {
|
|
84
|
+
let sow = null;
|
|
85
|
+
let paymentTerms = null;
|
|
86
|
+
let rfp = null;
|
|
87
|
+
if (doc.state.global.initialProposal) {
|
|
88
|
+
sow = doc.state.global.initialProposal.sow;
|
|
89
|
+
paymentTerms = doc.state.global.initialProposal.paymentTerms;
|
|
90
|
+
}
|
|
91
|
+
if (doc.state.global.rfp) {
|
|
92
|
+
rfp = doc.state.global.rfp.id;
|
|
93
|
+
}
|
|
94
|
+
const sowDoc = allDocuments?.find((doc) => doc.header.id === sow);
|
|
95
|
+
const rfpDoc = allDocuments?.find((doc) => doc.header.id === rfp);
|
|
96
|
+
const pmtDoc = allDocuments?.find((doc) => doc.header.id === paymentTerms);
|
|
97
|
+
// get alternative proposals
|
|
98
|
+
const alternativeProposals = doc.state.global.alternativeProposals;
|
|
99
|
+
const returnableChildren = {
|
|
100
|
+
id: `editor-${doc.header.id}`,
|
|
101
|
+
title: `${doc.state.global.code ? doc.state.global.code + " - " : ""}${doc.state.global.title || doc.header.name}`,
|
|
102
|
+
icon: _jsx(WorkstreamIcon, { className: "w-5 h-5" }),
|
|
103
|
+
children: rfpDoc
|
|
104
|
+
? [
|
|
105
|
+
{
|
|
106
|
+
id: `editor-${rfpDoc.header.id}`,
|
|
107
|
+
title: "Request For Proposal",
|
|
130
108
|
icon: _jsx(RfpIcon, { className: "w-5 h-5" }),
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
109
|
+
},
|
|
110
|
+
]
|
|
111
|
+
: [],
|
|
112
|
+
};
|
|
113
|
+
// if sowDoc or pmtDoc is included in the wstrChildDocs, then add a child with the title "Initial Proposal"
|
|
114
|
+
const children = [];
|
|
115
|
+
if (sowDoc) {
|
|
116
|
+
children.push({
|
|
117
|
+
id: `editor-${sowDoc.header.id}`,
|
|
118
|
+
title: "Scope of Work",
|
|
119
|
+
icon: _jsx(SowIcon, { className: "w-5 h-5" }),
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
if (pmtDoc) {
|
|
123
|
+
children.push({
|
|
124
|
+
id: `editor-${pmtDoc.header.id}`,
|
|
125
|
+
title: "Payment Terms",
|
|
126
|
+
icon: _jsx(PaymentIcon, { className: "w-5 h-5" }),
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
if (children.length) {
|
|
130
|
+
returnableChildren.children = [
|
|
131
|
+
...(returnableChildren.children ?? []),
|
|
132
|
+
{
|
|
140
133
|
id: "initial-proposal",
|
|
141
134
|
title: "Initial Proposal",
|
|
142
|
-
children:
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
"powerhouse/scopeofwork"
|
|
151
|
-
? "Scope of Work"
|
|
152
|
-
: childDoc.header.documentType === "payment-terms"
|
|
153
|
-
? "Payment Terms"
|
|
154
|
-
: null;
|
|
155
|
-
return {
|
|
156
|
-
id: `editor-${childDoc.header.id}`,
|
|
157
|
-
title: dynamicTitle,
|
|
158
|
-
icon: childDoc.header.documentType ===
|
|
159
|
-
"powerhouse/scopeofwork" ? (_jsx(SowIcon, { className: "w-5 h-5" })) : (_jsx(PaymentIcon, { className: "w-5 h-5" })),
|
|
160
|
-
};
|
|
161
|
-
}),
|
|
162
|
-
});
|
|
163
|
-
}
|
|
164
|
-
if (alternativeProposals.length > 0) {
|
|
165
|
-
returnableChildren.children.push({
|
|
135
|
+
children: children,
|
|
136
|
+
},
|
|
137
|
+
];
|
|
138
|
+
}
|
|
139
|
+
if (alternativeProposals.length > 0) {
|
|
140
|
+
returnableChildren.children = [
|
|
141
|
+
...(returnableChildren.children ?? []),
|
|
142
|
+
{
|
|
166
143
|
id: "alternative-proposals",
|
|
167
144
|
title: `Alternative Proposals (${alternativeProposals.length})`,
|
|
168
145
|
children: alternativeProposals.map((proposal) => {
|
|
@@ -178,13 +155,13 @@ export function DriveExplorer(props) {
|
|
|
178
155
|
id: `alternative-proposal-${proposal.id}`,
|
|
179
156
|
title: `${proposal.author.name}`,
|
|
180
157
|
children: proposalChildDocs.map((childDoc) => {
|
|
181
|
-
|
|
158
|
+
const dynamicTitle = childDoc.header.documentType ===
|
|
182
159
|
"powerhouse/scopeofwork"
|
|
183
160
|
? "Scope of Work"
|
|
184
161
|
: childDoc.header.documentType ===
|
|
185
162
|
"payment-terms"
|
|
186
163
|
? "Payment Terms"
|
|
187
|
-
:
|
|
164
|
+
: "";
|
|
188
165
|
return {
|
|
189
166
|
id: `editor-${childDoc.header.id}`,
|
|
190
167
|
title: dynamicTitle,
|
|
@@ -194,11 +171,11 @@ export function DriveExplorer(props) {
|
|
|
194
171
|
}),
|
|
195
172
|
};
|
|
196
173
|
}),
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
174
|
+
},
|
|
175
|
+
];
|
|
176
|
+
}
|
|
177
|
+
return returnableChildren;
|
|
178
|
+
}),
|
|
202
179
|
};
|
|
203
180
|
}),
|
|
204
181
|
],
|
|
@@ -210,7 +187,7 @@ export function DriveExplorer(props) {
|
|
|
210
187
|
// Add network profile documents
|
|
211
188
|
...networkProfileDocs.map((doc) => ({
|
|
212
189
|
id: `editor-${doc.header.id}`,
|
|
213
|
-
title: doc.state
|
|
190
|
+
title: doc.state.global.name || doc.header.name,
|
|
214
191
|
})),
|
|
215
192
|
],
|
|
216
193
|
};
|
|
@@ -239,26 +216,20 @@ export function DriveExplorer(props) {
|
|
|
239
216
|
// Always update the active sidebar node ID
|
|
240
217
|
setActiveSidebarNodeId(newNode.id);
|
|
241
218
|
if (newNode.id === "workstreams") {
|
|
242
|
-
|
|
219
|
+
setSelectedNode(undefined);
|
|
243
220
|
setSelectedRootNode("workstreams");
|
|
244
221
|
}
|
|
245
222
|
else if (newNode.id === "network-information") {
|
|
246
|
-
|
|
223
|
+
setSelectedNode(undefined);
|
|
247
224
|
setSelectedRootNode("network-information");
|
|
248
225
|
// Handle network information display
|
|
249
226
|
}
|
|
250
227
|
else if (newNode.id.startsWith("editor-")) {
|
|
251
228
|
// Extract file ID from editor-{file.id} format
|
|
252
229
|
const fileId = newNode.id.replace("editor-", "");
|
|
253
|
-
|
|
230
|
+
setSelectedNode(fileId);
|
|
254
231
|
}
|
|
255
|
-
}, [
|
|
256
|
-
allFolders,
|
|
257
|
-
fileChildren,
|
|
258
|
-
setSelectedNode,
|
|
259
|
-
setActiveDocumentId,
|
|
260
|
-
sidebarNodes,
|
|
261
|
-
]);
|
|
232
|
+
}, [allFolders, fileChildren, setSelectedNode, sidebarNodes]);
|
|
262
233
|
// === EVENT HANDLERS ===
|
|
263
234
|
// Display function that switches views based on active node ID
|
|
264
235
|
const displayActiveNode = (activeNodeId) => {
|
|
@@ -375,14 +346,12 @@ export function DriveExplorer(props) {
|
|
|
375
346
|
modalDocumentType,
|
|
376
347
|
]);
|
|
377
348
|
// === RENDER ===
|
|
378
|
-
return (_jsx(SidebarProvider, { nodes: sidebarNodes, children: isScopeOfWorkFullView &&
|
|
379
|
-
setActiveDocumentId(undefined);
|
|
380
|
-
setSelectedNode(undefined); // Clear global selection
|
|
381
|
-
}, hideToolbar: false, activeDocumentId: activeDocumentId, setActiveDocumentId: setActiveDocumentId, setActiveSidebarNodeId: setActiveSidebarNodeId }) })) : (
|
|
349
|
+
return (_jsx(SidebarProvider, { nodes: sidebarNodes, children: isScopeOfWorkFullView && props.children ? (_jsx("div", { className: "h-full w-full", children: props.children })) : (
|
|
382
350
|
/* === NORMAL VIEW WITH SIDEBAR === */
|
|
383
351
|
_jsxs("div", { className: "flex h-full", children: [_jsx(Sidebar, { nodes: sidebarNodes, activeNodeId: activeSidebarNodeId, onActiveNodeChange: (node) => handleActiveNodeChange(node.id), sidebarTitle: "Network Admin", showSearchBar: true, allowPinning: true, resizable: true, initialWidth: 300, maxWidth: 500, enableMacros: 4, handleOnTitleClick: () => {
|
|
384
|
-
|
|
352
|
+
setSelectedNode(undefined);
|
|
385
353
|
setActiveSidebarNodeId("workstreams");
|
|
386
354
|
setSelectedRootNode("workstreams");
|
|
387
|
-
} }), _jsx("div", { className: "flex-1 overflow-y-auto", children: _jsx("div", { className: "h-full", children:
|
|
355
|
+
} }), _jsx("div", { className: "flex-1 overflow-y-auto", children: _jsx("div", { className: "h-full", children: props.children ||
|
|
356
|
+
displayActiveNode(selectedFolder?.id || selectedRootNode) }) }), _jsx(CreateDocumentModal, { onContinue: onCreateDocument, onOpenChange: (open) => setOpenModal(open), open: openModal })] })) }));
|
|
388
357
|
}
|
|
@@ -1,15 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
document?: any;
|
|
5
|
-
};
|
|
6
|
-
/**
|
|
7
|
-
* Base editor component that renders the drive explorer interface.
|
|
8
|
-
* Customize document opening behavior and drive-level actions here.
|
|
9
|
-
*/
|
|
10
|
-
export declare function BaseEditor(props: IProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
/**
|
|
12
|
-
* Main editor entry point with required providers.
|
|
13
|
-
*/
|
|
14
|
-
export default function Editor(props: IProps): import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
export declare const Editor: import("react").ComponentType<{
|
|
2
|
+
children?: any;
|
|
3
|
+
}>;
|
|
15
4
|
//# sourceMappingURL=editor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../../../editors/network-admin/editor.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../../../editors/network-admin/editor.tsx"],"names":[],"mappings":"AAGA,eAAO,MAAM,MAAM;;EAA8B,CAAC"}
|
|
@@ -1,25 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { WagmiContext } from "@powerhousedao/design-system";
|
|
3
|
-
import { AnalyticsProvider, useAppConfig, } from "@powerhousedao/reactor-browser";
|
|
1
|
+
import { withDropZone } from "@powerhousedao/design-system";
|
|
4
2
|
import { DriveExplorer } from "./components/DriveExplorer.js";
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Base editor component that renders the drive explorer interface.
|
|
8
|
-
* Customize document opening behavior and drive-level actions here.
|
|
9
|
-
*/
|
|
10
|
-
export function BaseEditor(props) {
|
|
11
|
-
const { context, document } = props;
|
|
12
|
-
return (_jsx("div", { style: { height: "100%" }, children: _jsx(DriveExplorer, { document: document, context: context }) }));
|
|
13
|
-
}
|
|
14
|
-
// Wrap base editor with drop zone functionality
|
|
15
|
-
const BaseEditorWithDropZone = withDropZone(BaseEditor);
|
|
16
|
-
/**
|
|
17
|
-
* Main editor entry point with required providers.
|
|
18
|
-
*/
|
|
19
|
-
export default function Editor(props) {
|
|
20
|
-
const appConfig = useAppConfig();
|
|
21
|
-
const analyticsDatabaseName = appConfig?.analyticsDatabaseName;
|
|
22
|
-
return (
|
|
23
|
-
// Required context providers for drive functionality
|
|
24
|
-
_jsx(WagmiContext, { children: _jsx(AnalyticsProvider, { databaseName: analyticsDatabaseName, children: _jsx(BaseEditorWithDropZone, { ...props }) }) }));
|
|
25
|
-
}
|
|
3
|
+
export const Editor = withDropZone(DriveExplorer);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../editors/network-admin/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAGxE,eAAO,MAAM,MAAM,EAAE,iBAoBpB,CAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../editors/network-admin/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAGxE,eAAO,MAAM,MAAM,EAAE,iBAoBpB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { EditorProps } from "document-model";
|
|
2
2
|
export type IProps = EditorProps;
|
|
3
|
-
export default function Editor(
|
|
3
|
+
export default function Editor(): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
//# sourceMappingURL=editor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../../../editors/network-profile/editor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../../../editors/network-profile/editor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAelD,MAAM,MAAM,MAAM,GAAG,WAAW,CAAC;AA8MjC,MAAM,CAAC,OAAO,UAAU,MAAM,4CA4O7B"}
|
|
@@ -2,8 +2,8 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
2
2
|
import { TextInput, Textarea, Select, Icon, } from "@powerhousedao/document-engineering";
|
|
3
3
|
import { toast, ToastContainer } from "@powerhousedao/design-system";
|
|
4
4
|
import { actions, } from "../../document-models/network-profile/index.js";
|
|
5
|
-
import { useDocumentById } from "@powerhousedao/reactor-browser";
|
|
6
5
|
import { useCallback, useState, useEffect } from "react";
|
|
6
|
+
import { useSelectedNetworkProfileDocument } from "../hooks/useNetworkProfileDocument.js";
|
|
7
7
|
// Category options for the dropdown
|
|
8
8
|
const categoryOptions = [
|
|
9
9
|
{ value: "DEFI", label: "DeFi" },
|
|
@@ -70,10 +70,10 @@ function ImageUrlInput({ label, value, onChange, placeholder, fileSize = "200KB"
|
|
|
70
70
|
}
|
|
71
71
|
}, placeholder: placeholder || "Enter image URL" }) })] })] }), _jsx(ImageModal, { isOpen: isModalOpen, onClose: () => setIsModalOpen(false), imageUrl: value, imageAlt: `${label} full size` })] }));
|
|
72
72
|
}
|
|
73
|
-
export default function Editor(
|
|
73
|
+
export default function Editor() {
|
|
74
74
|
// Getting dispatch from selected document
|
|
75
|
-
const [doc, dispatch] =
|
|
76
|
-
const state = doc
|
|
75
|
+
const [doc, dispatch] = useSelectedNetworkProfileDocument();
|
|
76
|
+
const state = doc.state.global;
|
|
77
77
|
// Handle field changes
|
|
78
78
|
const handleFieldChange = useCallback((field, value) => {
|
|
79
79
|
if (!dispatch) {
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { PaymentTermsState } from "../../document-models/payment-terms/gen/types.js";
|
|
2
|
+
import type { PaymentTermsAction } from "../../document-models/payment-terms/gen/actions.js";
|
|
3
|
+
import { actions as paymentTermsActions } from "../../document-models/payment-terms/index.js";
|
|
2
4
|
export interface BasicTermsTabProps {
|
|
3
5
|
state: PaymentTermsState;
|
|
4
|
-
dispatch: (action:
|
|
5
|
-
actions:
|
|
6
|
+
dispatch: (action: PaymentTermsAction) => void;
|
|
7
|
+
actions: typeof paymentTermsActions;
|
|
6
8
|
}
|
|
7
|
-
export declare function BasicTermsTab({ state, dispatch, actions }: BasicTermsTabProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare function BasicTermsTab({ state, dispatch, actions, }: BasicTermsTabProps): import("react/jsx-runtime").JSX.Element;
|
|
8
10
|
//# sourceMappingURL=basic-terms-tab.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"basic-terms-tab.d.ts","sourceRoot":"","sources":["../../../editors/payment-terms/basic-terms-tab.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,iBAAiB,EAIlB,MAAM,kDAAkD,CAAC;
|
|
1
|
+
{"version":3,"file":"basic-terms-tab.d.ts","sourceRoot":"","sources":["../../../editors/payment-terms/basic-terms-tab.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,iBAAiB,EAIlB,MAAM,kDAAkD,CAAC;AAC1D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oDAAoD,CAAC;AAC7F,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,8CAA8C,CAAC;AAE9F,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,iBAAiB,CAAC;IACzB,QAAQ,EAAE,CAAC,MAAM,EAAE,kBAAkB,KAAK,IAAI,CAAC;IAC/C,OAAO,EAAE,OAAO,mBAAmB,CAAC;CACrC;AAED,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,QAAQ,EACR,OAAO,GACR,EAAE,kBAAkB,2CA4SpB"}
|