@powerhousedao/network-admin 0.0.64 → 1.0.0-dev.2
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/document-models/document-models.d.ts.map +1 -1
- package/dist/document-models/document-models.js +0 -2
- package/dist/document-models/index.d.ts +0 -1
- package/dist/document-models/index.d.ts.map +1 -1
- package/dist/document-models/index.js +0 -1
- package/dist/document-models/network-profile/gen/document-model.d.ts.map +1 -1
- package/dist/document-models/network-profile/gen/document-model.js +84 -84
- package/dist/document-models/network-profile/gen/ph-factories.d.ts.map +1 -1
- package/dist/document-models/network-profile/gen/ph-factories.js +0 -2
- package/dist/document-models/network-profile/gen/reducer.d.ts +0 -1
- package/dist/document-models/network-profile/gen/reducer.d.ts.map +1 -1
- package/dist/document-models/network-profile/gen/schema/types.d.ts +2 -6
- package/dist/document-models/network-profile/gen/schema/types.d.ts.map +1 -1
- package/dist/document-models/network-profile/gen/schema/zod.d.ts +2 -8
- package/dist/document-models/network-profile/gen/schema/zod.d.ts.map +1 -1
- package/dist/document-models/network-profile/gen/schema/zod.js +2 -6
- package/dist/document-models/network-profile/gen/utils.d.ts.map +1 -1
- package/dist/document-models/network-profile/gen/utils.js +1 -3
- package/dist/document-models/network-profile/hooks.d.ts +2 -2
- package/dist/document-models/network-profile/hooks.d.ts.map +1 -1
- package/dist/document-models/network-profile/module.d.ts +1 -1
- package/dist/document-models/network-profile/module.d.ts.map +1 -1
- package/dist/document-models/network-profile/module.js +1 -1
- package/dist/document-models/network-profile/src/reducers/network-profile-management.d.ts +1 -0
- package/dist/document-models/network-profile/src/reducers/network-profile-management.d.ts.map +1 -1
- package/dist/document-models/network-profile/src/reducers/network-profile-management.js +18 -27
- package/dist/document-models/network-profile/src/tests/document-model.test.d.ts +0 -4
- package/dist/document-models/network-profile/src/tests/document-model.test.d.ts.map +1 -1
- package/dist/document-models/network-profile/src/tests/document-model.test.js +6 -92
- package/dist/document-models/network-profile/src/tests/network-profile-management.test.js +115 -69
- package/dist/document-models/payment-terms/actions.d.ts +2 -1
- package/dist/document-models/payment-terms/actions.d.ts.map +1 -1
- package/dist/document-models/payment-terms/gen/clauses/error.d.ts +40 -1
- package/dist/document-models/payment-terms/gen/clauses/error.d.ts.map +1 -1
- package/dist/document-models/payment-terms/gen/clauses/error.js +32 -1
- package/dist/document-models/payment-terms/gen/document-model.d.ts.map +1 -1
- package/dist/document-models/payment-terms/gen/document-model.js +180 -89
- package/dist/document-models/payment-terms/gen/milestones/error.d.ts +26 -1
- package/dist/document-models/payment-terms/gen/milestones/error.d.ts.map +1 -1
- package/dist/document-models/payment-terms/gen/milestones/error.js +18 -1
- package/dist/document-models/payment-terms/gen/ph-factories.d.ts.map +1 -1
- package/dist/document-models/payment-terms/gen/ph-factories.js +2 -1
- package/dist/document-models/payment-terms/gen/reducer.d.ts +0 -1
- package/dist/document-models/payment-terms/gen/reducer.d.ts.map +1 -1
- package/dist/document-models/payment-terms/gen/reducer.js +9 -4
- package/dist/document-models/payment-terms/gen/schema/types.d.ts +29 -14
- package/dist/document-models/payment-terms/gen/schema/types.d.ts.map +1 -1
- package/dist/document-models/payment-terms/gen/schema/zod.d.ts +12 -36
- package/dist/document-models/payment-terms/gen/schema/zod.d.ts.map +1 -1
- package/dist/document-models/payment-terms/gen/schema/zod.js +55 -29
- package/dist/document-models/payment-terms/gen/terms/actions.d.ts +9 -5
- package/dist/document-models/payment-terms/gen/terms/actions.d.ts.map +1 -1
- package/dist/document-models/payment-terms/gen/terms/creators.d.ts +4 -3
- package/dist/document-models/payment-terms/gen/terms/creators.d.ts.map +1 -1
- package/dist/document-models/payment-terms/gen/terms/creators.js +3 -2
- package/dist/document-models/payment-terms/gen/terms/operations.d.ts +3 -2
- package/dist/document-models/payment-terms/gen/terms/operations.d.ts.map +1 -1
- package/dist/document-models/payment-terms/gen/utils.d.ts.map +1 -1
- package/dist/document-models/payment-terms/gen/utils.js +3 -2
- package/dist/document-models/payment-terms/hooks.d.ts +2 -2
- package/dist/document-models/payment-terms/hooks.d.ts.map +1 -1
- package/dist/document-models/payment-terms/module.d.ts +1 -1
- package/dist/document-models/payment-terms/module.d.ts.map +1 -1
- package/dist/document-models/payment-terms/module.js +1 -1
- package/dist/document-models/payment-terms/src/reducers/clauses.d.ts +1 -0
- package/dist/document-models/payment-terms/src/reducers/clauses.d.ts.map +1 -1
- package/dist/document-models/payment-terms/src/reducers/clauses.js +15 -13
- package/dist/document-models/payment-terms/src/reducers/milestones.d.ts +1 -0
- package/dist/document-models/payment-terms/src/reducers/milestones.d.ts.map +1 -1
- package/dist/document-models/payment-terms/src/reducers/milestones.js +12 -10
- package/dist/document-models/payment-terms/src/reducers/terms.d.ts +1 -0
- package/dist/document-models/payment-terms/src/reducers/terms.d.ts.map +1 -1
- package/dist/document-models/payment-terms/src/reducers/terms.js +24 -14
- package/dist/document-models/payment-terms/src/tests/clauses.test.js +21 -26
- package/dist/document-models/payment-terms/src/tests/document-model.test.d.ts +0 -4
- package/dist/document-models/payment-terms/src/tests/document-model.test.d.ts.map +1 -1
- package/dist/document-models/payment-terms/src/tests/document-model.test.js +6 -92
- package/dist/document-models/payment-terms/src/tests/milestones.test.js +19 -22
- package/dist/document-models/payment-terms/src/tests/terms.test.js +29 -24
- package/dist/document-models/payment-terms/tests/terms.test.js +15 -5
- package/dist/document-models/request-for-proposals/gen/document-model.js +4 -4
- package/dist/document-models/request-for-proposals/gen/ph-factories.d.ts.map +1 -1
- package/dist/document-models/request-for-proposals/gen/ph-factories.js +4 -6
- package/dist/document-models/request-for-proposals/gen/reducer.d.ts +0 -1
- package/dist/document-models/request-for-proposals/gen/reducer.d.ts.map +1 -1
- package/dist/document-models/request-for-proposals/gen/schema/zod.d.ts +9 -64
- package/dist/document-models/request-for-proposals/gen/schema/zod.d.ts.map +1 -1
- package/dist/document-models/request-for-proposals/gen/utils.d.ts.map +1 -1
- package/dist/document-models/request-for-proposals/gen/utils.js +5 -7
- package/dist/document-models/request-for-proposals/hooks.d.ts +2 -2
- package/dist/document-models/request-for-proposals/hooks.d.ts.map +1 -1
- package/dist/document-models/request-for-proposals/module.d.ts +1 -1
- package/dist/document-models/request-for-proposals/module.d.ts.map +1 -1
- package/dist/document-models/request-for-proposals/module.js +1 -1
- package/dist/document-models/request-for-proposals/src/reducers/contex-document.d.ts +1 -0
- package/dist/document-models/request-for-proposals/src/reducers/contex-document.d.ts.map +1 -1
- package/dist/document-models/request-for-proposals/src/reducers/contex-document.js +4 -3
- package/dist/document-models/request-for-proposals/src/reducers/proposals.d.ts +1 -0
- package/dist/document-models/request-for-proposals/src/reducers/proposals.d.ts.map +1 -1
- package/dist/document-models/request-for-proposals/src/reducers/proposals.js +5 -4
- package/dist/document-models/request-for-proposals/src/reducers/rfp-state.d.ts +1 -0
- package/dist/document-models/request-for-proposals/src/reducers/rfp-state.d.ts.map +1 -1
- package/dist/document-models/request-for-proposals/src/reducers/rfp-state.js +3 -2
- package/dist/document-models/request-for-proposals/src/tests/contex-document.test.d.ts +1 -2
- package/dist/document-models/request-for-proposals/src/tests/contex-document.test.d.ts.map +1 -1
- package/dist/document-models/request-for-proposals/src/tests/contex-document.test.js +181 -24
- package/dist/document-models/request-for-proposals/src/tests/document-model.test.d.ts +0 -4
- package/dist/document-models/request-for-proposals/src/tests/document-model.test.d.ts.map +1 -1
- package/dist/document-models/request-for-proposals/src/tests/document-model.test.js +6 -92
- package/dist/document-models/request-for-proposals/src/tests/proposals.test.d.ts +1 -2
- package/dist/document-models/request-for-proposals/src/tests/proposals.test.d.ts.map +1 -1
- package/dist/document-models/request-for-proposals/src/tests/proposals.test.js +327 -33
- package/dist/document-models/request-for-proposals/src/tests/rfp-state.test.d.ts +1 -2
- package/dist/document-models/request-for-proposals/src/tests/rfp-state.test.d.ts.map +1 -1
- package/dist/document-models/request-for-proposals/src/tests/rfp-state.test.js +240 -15
- package/dist/document-models/workstream/gen/document-model.d.ts.map +1 -1
- package/dist/document-models/workstream/gen/document-model.js +16 -16
- package/dist/document-models/workstream/gen/reducer.d.ts +0 -1
- package/dist/document-models/workstream/gen/reducer.d.ts.map +1 -1
- package/dist/document-models/workstream/gen/schema/types.d.ts +1 -1
- package/dist/document-models/workstream/gen/schema/types.d.ts.map +1 -1
- package/dist/document-models/workstream/gen/schema/zod.d.ts +5 -35
- package/dist/document-models/workstream/gen/schema/zod.d.ts.map +1 -1
- package/dist/document-models/workstream/gen/utils.js +1 -1
- package/dist/document-models/workstream/hooks.d.ts +2 -2
- package/dist/document-models/workstream/hooks.d.ts.map +1 -1
- package/dist/document-models/workstream/module.d.ts +1 -1
- package/dist/document-models/workstream/module.d.ts.map +1 -1
- package/dist/document-models/workstream/module.js +1 -1
- package/dist/document-models/workstream/src/reducers/proposals.d.ts +1 -0
- package/dist/document-models/workstream/src/reducers/proposals.d.ts.map +1 -1
- package/dist/document-models/workstream/src/reducers/proposals.js +6 -83
- package/dist/document-models/workstream/src/reducers/workstream.d.ts +1 -0
- package/dist/document-models/workstream/src/reducers/workstream.d.ts.map +1 -1
- package/dist/document-models/workstream/src/reducers/workstream.js +7 -6
- package/dist/document-models/workstream/src/tests/document-model.test.d.ts +0 -4
- package/dist/document-models/workstream/src/tests/document-model.test.d.ts.map +1 -1
- package/dist/document-models/workstream/src/tests/document-model.test.js +3 -89
- package/dist/document-models/workstream/src/tests/proposals-reducers.test.d.ts +5 -0
- package/dist/document-models/workstream/src/tests/proposals-reducers.test.d.ts.map +1 -0
- package/dist/document-models/workstream/src/tests/proposals-reducers.test.js +318 -0
- package/dist/document-models/workstream/src/tests/proposals.test.js +25 -26
- package/dist/document-models/workstream/src/tests/workstream-reducers.test.d.ts +5 -0
- package/dist/document-models/workstream/src/tests/workstream-reducers.test.d.ts.map +1 -0
- package/dist/document-models/workstream/src/tests/workstream-reducers.test.js +210 -0
- package/dist/document-models/workstream/src/tests/workstream.test.js +29 -34
- 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/index.d.ts +6 -6
- package/dist/editors/index.d.ts.map +1 -1
- package/dist/editors/index.js +6 -6
- package/dist/editors/network-admin/components/CreateDocument.d.ts.map +1 -1
- package/dist/editors/network-admin/components/CreateDocument.js +12 -8
- package/dist/editors/network-admin/components/DriveExplorer.d.ts +1 -1
- package/dist/editors/network-admin/components/DriveExplorer.d.ts.map +1 -1
- package/dist/editors/network-admin/components/DriveExplorer.js +230 -53
- package/dist/editors/network-admin/components/FolderTree.d.ts +1 -9
- package/dist/editors/network-admin/components/FolderTree.d.ts.map +1 -1
- package/dist/editors/network-admin/components/FolderTree.js +55 -216
- package/dist/editors/network-admin/components/icons/PaymentIcon.d.ts.map +1 -1
- package/dist/editors/network-admin/components/icons/RfpIcon.d.ts.map +1 -1
- package/dist/editors/network-admin/components/icons/SowIcon.d.ts.map +1 -1
- package/dist/editors/network-admin/components/icons/WorkstreamIcon.d.ts.map +1 -1
- package/dist/editors/network-admin/config.d.ts +0 -1
- package/dist/editors/network-admin/config.d.ts.map +1 -1
- package/dist/editors/network-admin/config.js +1 -1
- package/dist/editors/network-admin/editor.d.ts +1 -2
- package/dist/editors/network-admin/editor.d.ts.map +1 -1
- package/dist/editors/network-admin/editor.js +1 -4
- package/dist/editors/network-admin/index.d.ts +3 -0
- package/dist/editors/network-admin/index.d.ts.map +1 -0
- package/dist/editors/network-admin/index.js +10 -0
- 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 +13 -45
- package/dist/editors/network-profile/index.d.ts +4 -0
- package/dist/editors/network-profile/index.d.ts.map +1 -0
- package/dist/editors/network-profile/index.js +10 -0
- package/dist/editors/payment-terms/basic-terms-tab.d.ts +10 -0
- package/dist/editors/payment-terms/basic-terms-tab.d.ts.map +1 -0
- package/dist/editors/payment-terms/basic-terms-tab.js +89 -0
- package/dist/editors/payment-terms/clauses-tab.d.ts +12 -0
- package/dist/editors/payment-terms/clauses-tab.d.ts.map +1 -0
- package/dist/editors/payment-terms/clauses-tab.js +213 -0
- package/dist/editors/payment-terms/cost-materials-tab.d.ts +10 -0
- package/dist/editors/payment-terms/cost-materials-tab.d.ts.map +1 -0
- package/dist/editors/payment-terms/cost-materials-tab.js +63 -0
- package/dist/editors/payment-terms/editor.d.ts +2 -0
- package/dist/editors/payment-terms/editor.d.ts.map +1 -1
- package/dist/editors/payment-terms/editor.js +55 -39
- package/dist/editors/payment-terms/escrow-tab.d.ts +10 -0
- package/dist/editors/payment-terms/escrow-tab.d.ts.map +1 -0
- package/dist/editors/payment-terms/escrow-tab.js +57 -0
- package/dist/editors/payment-terms/evaluation-tab.d.ts +10 -0
- package/dist/editors/payment-terms/evaluation-tab.d.ts.map +1 -0
- package/dist/editors/payment-terms/evaluation-tab.js +63 -0
- package/dist/editors/payment-terms/index.d.ts +4 -0
- package/dist/editors/payment-terms/index.d.ts.map +1 -0
- package/dist/editors/payment-terms/index.js +10 -0
- package/dist/editors/payment-terms/milestones-tab.d.ts +10 -0
- package/dist/editors/payment-terms/milestones-tab.d.ts.map +1 -0
- package/dist/editors/payment-terms/milestones-tab.js +205 -0
- package/dist/editors/payment-terms/retainer-tab.d.ts +10 -0
- package/dist/editors/payment-terms/retainer-tab.d.ts.map +1 -0
- package/dist/editors/payment-terms/retainer-tab.js +91 -0
- package/dist/editors/request-for-proposals/editor.d.ts.map +1 -1
- package/dist/editors/request-for-proposals/editor.js +4 -4
- package/dist/editors/request-for-proposals/index.d.ts +4 -0
- package/dist/editors/request-for-proposals/index.d.ts.map +1 -0
- package/dist/editors/request-for-proposals/index.js +10 -0
- package/dist/editors/request-for-proposals/markdown-editor.d.ts.map +1 -1
- package/dist/editors/request-for-proposals/markdown-editor.js +3 -3
- package/dist/editors/workstream/editor.d.ts.map +1 -1
- package/dist/editors/workstream/editor.js +165 -290
- package/dist/editors/workstream/index.d.ts +4 -0
- package/dist/editors/workstream/index.d.ts.map +1 -0
- package/dist/editors/workstream/index.js +10 -0
- package/dist/editors/workstream/project-management-import.d.ts +3 -0
- package/dist/editors/workstream/project-management-import.d.ts.map +1 -0
- package/dist/editors/workstream/project-management-import.js +5 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -2
- package/dist/powerhouse.manifest.json +6 -27
- package/dist/processors/factory.d.ts +1 -1
- package/dist/processors/factory.d.ts.map +1 -1
- package/dist/processors/factory.js +1 -1
- package/dist/processors/index.d.ts +1 -1
- package/dist/processors/index.d.ts.map +1 -1
- package/dist/processors/index.js +1 -1
- package/dist/processors/workstreams/factory.d.ts.map +1 -1
- package/dist/processors/workstreams/factory.js +1 -4
- package/dist/processors/workstreams/index.d.ts +2 -4
- package/dist/processors/workstreams/index.d.ts.map +1 -1
- package/dist/processors/workstreams/index.js +43 -102
- package/dist/processors/workstreams/migrations.d.ts.map +1 -1
- package/dist/processors/workstreams/migrations.js +15 -12
- package/dist/scripts/sow-mirror/mirror_sow_state.js +114 -119
- package/dist/style.css +6885 -6085
- package/dist/subgraphs/index.d.ts +5 -1
- package/dist/subgraphs/index.d.ts.map +1 -1
- package/dist/subgraphs/index.js +5 -1
- package/dist/subgraphs/network-profile/index.d.ts +11 -0
- package/dist/subgraphs/network-profile/index.d.ts.map +1 -0
- package/dist/subgraphs/network-profile/index.js +11 -0
- package/dist/subgraphs/network-profile/resolvers.d.ts.map +1 -0
- package/dist/subgraphs/network-profile/resolvers.js +205 -0
- package/dist/subgraphs/network-profile/schema.d.ts.map +1 -0
- package/dist/subgraphs/network-profile/schema.js +139 -0
- package/dist/subgraphs/networks/resolvers.d.ts +2 -2
- package/dist/subgraphs/networks/resolvers.d.ts.map +1 -1
- package/dist/subgraphs/networks/resolvers.js +8 -138
- package/dist/subgraphs/networks/schema.d.ts.map +1 -1
- package/dist/subgraphs/networks/schema.js +1 -66
- package/dist/subgraphs/{builders-addon → payment-terms}/index.d.ts +1 -1
- package/dist/subgraphs/payment-terms/index.d.ts.map +1 -0
- package/dist/subgraphs/{builders-addon → payment-terms}/index.js +2 -2
- package/dist/subgraphs/payment-terms/resolvers.d.ts +3 -0
- package/dist/subgraphs/payment-terms/resolvers.d.ts.map +1 -0
- package/dist/subgraphs/payment-terms/resolvers.js +277 -0
- package/dist/subgraphs/payment-terms/schema.d.ts +3 -0
- package/dist/subgraphs/payment-terms/schema.d.ts.map +1 -0
- package/dist/subgraphs/payment-terms/schema.js +324 -0
- package/dist/subgraphs/request-for-proposals/index.d.ts +11 -0
- package/dist/subgraphs/request-for-proposals/index.d.ts.map +1 -0
- package/dist/subgraphs/request-for-proposals/index.js +11 -0
- package/dist/subgraphs/request-for-proposals/resolvers.d.ts +3 -0
- package/dist/subgraphs/request-for-proposals/resolvers.d.ts.map +1 -0
- package/dist/subgraphs/request-for-proposals/resolvers.js +145 -0
- package/dist/subgraphs/request-for-proposals/schema.d.ts +3 -0
- package/dist/subgraphs/request-for-proposals/schema.d.ts.map +1 -0
- package/dist/subgraphs/request-for-proposals/schema.js +232 -0
- package/dist/subgraphs/workstream/index.d.ts +11 -0
- package/dist/subgraphs/workstream/index.d.ts.map +1 -0
- package/dist/subgraphs/workstream/index.js +11 -0
- package/dist/subgraphs/workstream/resolvers.d.ts +3 -0
- package/dist/subgraphs/workstream/resolvers.d.ts.map +1 -0
- package/dist/subgraphs/workstream/resolvers.js +181 -0
- package/dist/subgraphs/workstream/schema.d.ts +3 -0
- package/dist/subgraphs/workstream/schema.d.ts.map +1 -0
- package/dist/subgraphs/workstream/schema.js +206 -0
- package/dist/subgraphs/workstreams/index.d.ts +1 -4
- package/dist/subgraphs/workstreams/index.d.ts.map +1 -1
- package/dist/subgraphs/workstreams/index.js +0 -6
- package/dist/subgraphs/workstreams/resolvers.d.ts.map +1 -1
- package/dist/subgraphs/workstreams/resolvers.js +30 -495
- package/dist/subgraphs/workstreams/schema.d.ts.map +1 -1
- package/dist/subgraphs/workstreams/schema.js +35 -228
- package/dist/vite.config.d.ts.map +1 -1
- package/dist/vite.config.js +1 -6
- package/dist/vitest.config.d.ts +3 -0
- package/dist/vitest.config.d.ts.map +1 -0
- package/dist/vitest.config.js +8 -0
- package/package.json +90 -56
- package/dist/document-models/builders/actions.d.ts +0 -14
- package/dist/document-models/builders/actions.d.ts.map +0 -1
- package/dist/document-models/builders/actions.js +0 -4
- package/dist/document-models/builders/gen/actions.d.ts +0 -4
- package/dist/document-models/builders/gen/actions.d.ts.map +0 -1
- package/dist/document-models/builders/gen/actions.js +0 -1
- package/dist/document-models/builders/gen/builders/actions.d.ts +0 -12
- package/dist/document-models/builders/gen/builders/actions.d.ts.map +0 -1
- package/dist/document-models/builders/gen/builders/actions.js +0 -1
- package/dist/document-models/builders/gen/builders/creators.d.ts +0 -5
- package/dist/document-models/builders/gen/builders/creators.d.ts.map +0 -1
- package/dist/document-models/builders/gen/builders/creators.js +0 -4
- package/dist/document-models/builders/gen/builders/error.d.ts +0 -2
- package/dist/document-models/builders/gen/builders/error.d.ts.map +0 -1
- package/dist/document-models/builders/gen/builders/error.js +0 -1
- package/dist/document-models/builders/gen/builders/operations.d.ts +0 -8
- package/dist/document-models/builders/gen/builders/operations.d.ts.map +0 -1
- package/dist/document-models/builders/gen/builders/operations.js +0 -1
- package/dist/document-models/builders/gen/creators.d.ts +0 -3
- package/dist/document-models/builders/gen/creators.d.ts.map +0 -1
- package/dist/document-models/builders/gen/creators.js +0 -2
- package/dist/document-models/builders/gen/document-model.d.ts +0 -3
- package/dist/document-models/builders/gen/document-model.d.ts.map +0 -1
- package/dist/document-models/builders/gen/document-model.js +0 -59
- package/dist/document-models/builders/gen/document-schema.d.ts +0 -44
- package/dist/document-models/builders/gen/document-schema.d.ts.map +0 -1
- package/dist/document-models/builders/gen/document-schema.js +0 -33
- package/dist/document-models/builders/gen/document-type.d.ts +0 -2
- package/dist/document-models/builders/gen/document-type.d.ts.map +0 -1
- package/dist/document-models/builders/gen/document-type.js +0 -1
- package/dist/document-models/builders/gen/index.d.ts +0 -12
- package/dist/document-models/builders/gen/index.d.ts.map +0 -1
- package/dist/document-models/builders/gen/index.js +0 -11
- package/dist/document-models/builders/gen/ph-factories.d.ts +0 -23
- package/dist/document-models/builders/gen/ph-factories.d.ts.map +0 -1
- package/dist/document-models/builders/gen/ph-factories.js +0 -47
- package/dist/document-models/builders/gen/reducer.d.ts +0 -3
- package/dist/document-models/builders/gen/reducer.d.ts.map +0 -1
- package/dist/document-models/builders/gen/reducer.js +0 -23
- package/dist/document-models/builders/gen/schema/index.d.ts +0 -3
- package/dist/document-models/builders/gen/schema/index.d.ts.map +0 -1
- package/dist/document-models/builders/gen/schema/index.js +0 -2
- package/dist/document-models/builders/gen/schema/types.d.ts +0 -158
- package/dist/document-models/builders/gen/schema/types.d.ts.map +0 -1
- package/dist/document-models/builders/gen/schema/types.js +0 -1
- package/dist/document-models/builders/gen/schema/zod.d.ts +0 -13
- package/dist/document-models/builders/gen/schema/zod.d.ts.map +0 -1
- package/dist/document-models/builders/gen/schema/zod.js +0 -21
- package/dist/document-models/builders/gen/types.d.ts +0 -12
- package/dist/document-models/builders/gen/types.d.ts.map +0 -1
- package/dist/document-models/builders/gen/types.js +0 -1
- package/dist/document-models/builders/gen/utils.d.ts +0 -15
- package/dist/document-models/builders/gen/utils.d.ts.map +0 -1
- package/dist/document-models/builders/gen/utils.js +0 -51
- package/dist/document-models/builders/hooks.d.ts +0 -14
- package/dist/document-models/builders/hooks.d.ts.map +0 -1
- package/dist/document-models/builders/hooks.js +0 -25
- package/dist/document-models/builders/index.d.ts +0 -6
- package/dist/document-models/builders/index.d.ts.map +0 -1
- package/dist/document-models/builders/index.js +0 -5
- package/dist/document-models/builders/module.d.ts +0 -5
- package/dist/document-models/builders/module.d.ts.map +0 -1
- package/dist/document-models/builders/module.js +0 -11
- package/dist/document-models/builders/src/index.d.ts +0 -2
- package/dist/document-models/builders/src/index.d.ts.map +0 -1
- package/dist/document-models/builders/src/index.js +0 -1
- package/dist/document-models/builders/src/reducers/builders.d.ts +0 -3
- package/dist/document-models/builders/src/reducers/builders.d.ts.map +0 -1
- package/dist/document-models/builders/src/reducers/builders.js +0 -8
- package/dist/document-models/builders/src/tests/builders.test.d.ts +0 -6
- package/dist/document-models/builders/src/tests/builders.test.d.ts.map +0 -1
- package/dist/document-models/builders/src/tests/builders.test.js +0 -29
- package/dist/document-models/builders/src/tests/document-model.test.d.ts +0 -10
- package/dist/document-models/builders/src/tests/document-model.test.d.ts.map +0 -1
- package/dist/document-models/builders/src/tests/document-model.test.js +0 -104
- package/dist/document-models/builders/src/utils.d.ts +0 -2
- package/dist/document-models/builders/src/utils.d.ts.map +0 -1
- package/dist/document-models/builders/src/utils.js +0 -1
- package/dist/document-models/builders/tests/builders.test.d.ts +0 -2
- package/dist/document-models/builders/tests/builders.test.d.ts.map +0 -1
- package/dist/document-models/builders/tests/builders.test.js +0 -25
- package/dist/document-models/builders/tests/document-model.test.d.ts +0 -10
- package/dist/document-models/builders/tests/document-model.test.d.ts.map +0 -1
- package/dist/document-models/builders/tests/document-model.test.js +0 -104
- package/dist/document-models/builders/utils.d.ts +0 -14
- package/dist/document-models/builders/utils.d.ts.map +0 -1
- package/dist/document-models/builders/utils.js +0 -7
- package/dist/document-models/network-profile/gen/document-schema.d.ts +0 -80
- package/dist/document-models/network-profile/gen/document-schema.d.ts.map +0 -1
- package/dist/document-models/payment-terms/gen/document-schema.d.ts +0 -95
- package/dist/document-models/payment-terms/gen/document-schema.d.ts.map +0 -1
- package/dist/document-models/request-for-proposals/gen/document-schema.d.ts +0 -83
- package/dist/document-models/request-for-proposals/gen/document-schema.d.ts.map +0 -1
- package/dist/document-models/workstream/gen/document-schema.d.ts +0 -71
- package/dist/document-models/workstream/gen/document-schema.d.ts.map +0 -1
- package/dist/editors/builders/editor.d.ts +0 -3
- package/dist/editors/builders/editor.d.ts.map +0 -1
- package/dist/editors/builders/editor.js +0 -285
- package/dist/editors/builders/hooks/useRemoteBuilderProfiles.d.ts +0 -20
- package/dist/editors/builders/hooks/useRemoteBuilderProfiles.d.ts.map +0 -1
- package/dist/editors/builders/hooks/useRemoteBuilderProfiles.js +0 -57
- package/dist/editors/builders/module.d.ts +0 -4
- package/dist/editors/builders/module.d.ts.map +0 -1
- package/dist/editors/builders/module.js +0 -10
- package/dist/editors/builders/utils/graphql-client.d.ts +0 -41
- package/dist/editors/builders/utils/graphql-client.d.ts.map +0 -1
- package/dist/editors/builders/utils/graphql-client.js +0 -189
- package/dist/editors/editors.d.ts +0 -3
- package/dist/editors/editors.d.ts.map +0 -1
- package/dist/editors/editors.js +0 -14
- package/dist/editors/network-admin/components/DriveContents.d.ts +0 -3
- package/dist/editors/network-admin/components/DriveContents.d.ts.map +0 -1
- package/dist/editors/network-admin/components/DriveContents.js +0 -10
- package/dist/editors/network-admin/components/EmptyState.d.ts +0 -3
- package/dist/editors/network-admin/components/EmptyState.d.ts.map +0 -1
- package/dist/editors/network-admin/components/EmptyState.js +0 -10
- package/dist/editors/network-admin/components/Files.d.ts +0 -3
- package/dist/editors/network-admin/components/Files.d.ts.map +0 -1
- package/dist/editors/network-admin/components/Files.js +0 -12
- package/dist/editors/network-admin/components/Folders.d.ts +0 -3
- package/dist/editors/network-admin/components/Folders.d.ts.map +0 -1
- package/dist/editors/network-admin/components/Folders.js +0 -12
- package/dist/editors/network-admin/components/NavigationBreadcrumbs.d.ts +0 -3
- package/dist/editors/network-admin/components/NavigationBreadcrumbs.d.ts.map +0 -1
- package/dist/editors/network-admin/components/NavigationBreadcrumbs.js +0 -6
- package/dist/editors/network-admin/module.d.ts +0 -4
- package/dist/editors/network-admin/module.d.ts.map +0 -1
- package/dist/editors/network-admin/module.js +0 -10
- package/dist/editors/network-profile/components/EditName.d.ts +0 -3
- package/dist/editors/network-profile/components/EditName.d.ts.map +0 -1
- package/dist/editors/network-profile/components/EditName.js +0 -31
- package/dist/editors/network-profile/module.d.ts +0 -4
- package/dist/editors/network-profile/module.d.ts.map +0 -1
- package/dist/editors/network-profile/module.js +0 -10
- package/dist/editors/payment-terms/components/clauses-section.d.ts +0 -12
- package/dist/editors/payment-terms/components/clauses-section.d.ts.map +0 -1
- package/dist/editors/payment-terms/components/clauses-section.js +0 -269
- package/dist/editors/payment-terms/components/escrow-section.d.ts +0 -13
- package/dist/editors/payment-terms/components/escrow-section.d.ts.map +0 -1
- package/dist/editors/payment-terms/components/escrow-section.js +0 -72
- package/dist/editors/payment-terms/components/evaluation-section.d.ts +0 -13
- package/dist/editors/payment-terms/components/evaluation-section.d.ts.map +0 -1
- package/dist/editors/payment-terms/components/evaluation-section.js +0 -94
- package/dist/editors/payment-terms/components/header-section.d.ts +0 -16
- package/dist/editors/payment-terms/components/header-section.d.ts.map +0 -1
- package/dist/editors/payment-terms/components/header-section.js +0 -67
- package/dist/editors/payment-terms/components/milestones-section.d.ts +0 -11
- package/dist/editors/payment-terms/components/milestones-section.d.ts.map +0 -1
- package/dist/editors/payment-terms/components/milestones-section.js +0 -236
- package/dist/editors/payment-terms/components/parties-section.d.ts +0 -11
- package/dist/editors/payment-terms/components/parties-section.d.ts.map +0 -1
- package/dist/editors/payment-terms/components/parties-section.js +0 -36
- package/dist/editors/payment-terms/components/payment-config-section.d.ts +0 -11
- package/dist/editors/payment-terms/components/payment-config-section.d.ts.map +0 -1
- package/dist/editors/payment-terms/components/payment-config-section.js +0 -68
- package/dist/editors/payment-terms/components/time-materials-section.d.ts +0 -11
- package/dist/editors/payment-terms/components/time-materials-section.d.ts.map +0 -1
- package/dist/editors/payment-terms/components/time-materials-section.js +0 -68
- package/dist/editors/payment-terms/module.d.ts +0 -4
- package/dist/editors/payment-terms/module.d.ts.map +0 -1
- package/dist/editors/payment-terms/module.js +0 -10
- package/dist/editors/request-for-proposals/components/EditName.d.ts +0 -3
- package/dist/editors/request-for-proposals/components/EditName.d.ts.map +0 -1
- package/dist/editors/request-for-proposals/components/EditName.js +0 -31
- package/dist/editors/request-for-proposals/module.d.ts +0 -4
- package/dist/editors/request-for-proposals/module.d.ts.map +0 -1
- package/dist/editors/request-for-proposals/module.js +0 -10
- package/dist/editors/workstream/module.d.ts +0 -4
- package/dist/editors/workstream/module.d.ts.map +0 -1
- package/dist/editors/workstream/module.js +0 -10
- package/dist/subgraphs/builders-addon/index.d.ts.map +0 -1
- package/dist/subgraphs/builders-addon/resolvers.d.ts.map +0 -1
- package/dist/subgraphs/builders-addon/resolvers.js +0 -376
- package/dist/subgraphs/builders-addon/schema.d.ts.map +0 -1
- package/dist/subgraphs/builders-addon/schema.js +0 -209
- /package/dist/subgraphs/{builders-addon → network-profile}/resolvers.d.ts +0 -0
- /package/dist/subgraphs/{builders-addon → network-profile}/schema.d.ts +0 -0
|
@@ -1,17 +1,33 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useState, useEffect, useCallback, useRef } from "react";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { useState, useEffect, useMemo, useCallback, useRef } from "react";
|
|
3
|
+
import { Sidebar, SidebarProvider, Button, } from "@powerhousedao/document-engineering";
|
|
4
|
+
import { setSelectedNode, isFileNodeKind, isFolderNodeKind, useNodesInSelectedDriveOrFolder, useSelectedDrive, useSelectedFolder, useUserPermissions, useDocumentsInSelectedDrive, useFileNodesInSelectedDrive, useNodeActions, useSelectedDocument, showDeleteNodeModal, addDocument, showCreateDocumentModal, } from "@powerhousedao/reactor-browser";
|
|
5
|
+
import {} from "document-drive";
|
|
6
6
|
import {} from "document-model";
|
|
7
|
+
import { PaymentIcon } from "./icons/PaymentIcon.js";
|
|
8
|
+
import { RfpIcon } from "./icons/RfpIcon.js";
|
|
9
|
+
import { SowIcon } from "./icons/SowIcon.js";
|
|
7
10
|
import { WorkstreamIcon } from "./icons/WorkstreamIcon.js";
|
|
8
|
-
import {
|
|
11
|
+
import { Earth } from "lucide-react";
|
|
12
|
+
import { CreateDocument } from "./CreateDocument.js";
|
|
9
13
|
import { FolderTree } from "./FolderTree.js";
|
|
14
|
+
const WorkstreamStatusEnums = [
|
|
15
|
+
"RFP_DRAFT",
|
|
16
|
+
"PREWORK_RFC",
|
|
17
|
+
"RFP_CANCELLED",
|
|
18
|
+
"OPEN_FOR_PROPOSALS",
|
|
19
|
+
"PROPOSAL_SUBMITTED",
|
|
20
|
+
"NOT_AWARDED",
|
|
21
|
+
"AWARDED",
|
|
22
|
+
"IN_PROGRESS",
|
|
23
|
+
"FINISHED",
|
|
24
|
+
];
|
|
10
25
|
/**
|
|
11
26
|
* Main drive explorer component with sidebar navigation and content area.
|
|
12
27
|
* Layout: Left sidebar (folder tree) + Right content area (files/folders + document editor)
|
|
13
28
|
*/
|
|
14
|
-
export function DriveExplorer(
|
|
29
|
+
export function DriveExplorer(props) {
|
|
30
|
+
const { children } = props;
|
|
15
31
|
const { isAllowedToCreateDocuments } = useUserPermissions();
|
|
16
32
|
// === DOCUMENT EDITOR STATE ===
|
|
17
33
|
const [activeSidebarNodeId, setActiveSidebarNodeId] = useState("workstreams");
|
|
@@ -21,19 +37,18 @@ export function DriveExplorer({ children }) {
|
|
|
21
37
|
const selectedDocumentModel = useRef(null);
|
|
22
38
|
// === STATE MANAGEMENT HOOKS ===
|
|
23
39
|
// Core state hooks for drive navigation
|
|
24
|
-
const [selectedDrive] =
|
|
40
|
+
const [selectedDrive] = useSelectedDrive(); // Currently selected drive
|
|
25
41
|
const selectedFolder = useSelectedFolder(); // Currently selected folder
|
|
26
42
|
const allDocuments = useDocumentsInSelectedDrive();
|
|
27
43
|
const fileChildren = useFileNodesInSelectedDrive();
|
|
28
44
|
const { onRenameNode } = useNodeActions();
|
|
29
45
|
// Listen to global selected document state (for external editors like Scope of Work)
|
|
30
|
-
const [globalSelectedDocument] =
|
|
46
|
+
const [globalSelectedDocument] = useSelectedDocument();
|
|
31
47
|
const networkAdminDocuments = allDocuments?.filter((doc) => doc.header.documentType === "powerhouse/network-profile" ||
|
|
32
48
|
doc.header.documentType === "powerhouse/workstream" ||
|
|
33
49
|
doc.header.documentType === "powerhouse/scopeofwork" ||
|
|
34
50
|
doc.header.documentType === "powerhouse/rfp" ||
|
|
35
|
-
doc.header.documentType === "payment-terms"
|
|
36
|
-
doc.header.documentType === "powerhouse/builders");
|
|
51
|
+
doc.header.documentType === "payment-terms");
|
|
37
52
|
//check if network profile doc is created, set isNetworkProfileCreated to true
|
|
38
53
|
const isNetworkProfileCreated = networkAdminDocuments?.some((doc) => doc.header.documentType === "powerhouse/network-profile") || false;
|
|
39
54
|
// Sync global selected document with local activeDocumentId
|
|
@@ -45,11 +60,186 @@ export function DriveExplorer({ children }) {
|
|
|
45
60
|
}, [globalSelectedDocument]);
|
|
46
61
|
// Check if current active document is a Scope of Work (should show in full view)
|
|
47
62
|
const isScopeOfWorkFullView = globalSelectedDocument?.header.documentType === "powerhouse/scopeofwork";
|
|
63
|
+
// Convert network admin documents to SidebarNode format
|
|
64
|
+
const sidebarNodes = useMemo(() => {
|
|
65
|
+
// Group documents by type
|
|
66
|
+
const workstreamDocs = (networkAdminDocuments?.filter((doc) => doc.header.documentType === "powerhouse/workstream") ?? []);
|
|
67
|
+
const networkProfileDocs = (networkAdminDocuments?.filter((doc) => doc.header.documentType === "powerhouse/network-profile") ?? []);
|
|
68
|
+
const workstreamsNode = {
|
|
69
|
+
id: "workstreams",
|
|
70
|
+
title: "Workstreams",
|
|
71
|
+
children: [
|
|
72
|
+
...WorkstreamStatusEnums.map((status) => {
|
|
73
|
+
const statusTitle = status
|
|
74
|
+
.toLowerCase()
|
|
75
|
+
.split("_")
|
|
76
|
+
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
|
|
77
|
+
.join(" ");
|
|
78
|
+
return {
|
|
79
|
+
id: `workstream-status-${status}`,
|
|
80
|
+
title: statusTitle +
|
|
81
|
+
(workstreamDocs.filter((doc) => doc.state.global.status === status).length > 0
|
|
82
|
+
? ` (${workstreamDocs.filter((doc) => doc.state.global.status === status).length})`
|
|
83
|
+
: ""),
|
|
84
|
+
children: workstreamDocs
|
|
85
|
+
.filter((doc) => doc.state.global.status === status)
|
|
86
|
+
.map((doc) => {
|
|
87
|
+
let sow = null;
|
|
88
|
+
let paymentTerms = null;
|
|
89
|
+
let rfp = null;
|
|
90
|
+
if (doc.state.global.initialProposal) {
|
|
91
|
+
sow = doc.state.global.initialProposal.sow;
|
|
92
|
+
paymentTerms = doc.state.global.initialProposal.paymentTerms;
|
|
93
|
+
}
|
|
94
|
+
if (doc.state.global.rfp) {
|
|
95
|
+
rfp = doc.state.global.rfp.id;
|
|
96
|
+
}
|
|
97
|
+
const sowDoc = allDocuments?.find((doc) => doc.header.id === sow);
|
|
98
|
+
const rfpDoc = allDocuments?.find((doc) => doc.header.id === rfp);
|
|
99
|
+
const pmtDoc = allDocuments?.find((doc) => doc.header.id === paymentTerms);
|
|
100
|
+
// get alternative proposals
|
|
101
|
+
const alternativeProposals = doc.state.global.alternativeProposals;
|
|
102
|
+
const returnableChildren = {
|
|
103
|
+
id: `editor-${doc.header.id}`,
|
|
104
|
+
title: `${doc.state.global.code ? doc.state.global.code + " - " : ""}${doc.state.global.title || doc.header.name}`,
|
|
105
|
+
icon: _jsx(WorkstreamIcon, { className: "w-5 h-5" }),
|
|
106
|
+
children: rfpDoc
|
|
107
|
+
? [
|
|
108
|
+
{
|
|
109
|
+
id: `editor-${rfpDoc.header.id}`,
|
|
110
|
+
title: "Request For Proposal",
|
|
111
|
+
icon: _jsx(RfpIcon, { className: "w-5 h-5" }),
|
|
112
|
+
},
|
|
113
|
+
]
|
|
114
|
+
: [],
|
|
115
|
+
};
|
|
116
|
+
// if sowDoc or pmtDoc is included in the wstrChildDocs, then add a child with the title "Initial Proposal"
|
|
117
|
+
const children = [];
|
|
118
|
+
if (sowDoc) {
|
|
119
|
+
children.push({
|
|
120
|
+
id: `editor-${sowDoc.header.id}`,
|
|
121
|
+
title: "Scope of Work",
|
|
122
|
+
icon: _jsx(SowIcon, { className: "w-5 h-5" }),
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
if (pmtDoc) {
|
|
126
|
+
children.push({
|
|
127
|
+
id: `editor-${pmtDoc.header.id}`,
|
|
128
|
+
title: "Payment Terms",
|
|
129
|
+
icon: _jsx(PaymentIcon, { className: "w-5 h-5" }),
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
if (children.length) {
|
|
133
|
+
returnableChildren.children = [
|
|
134
|
+
...(returnableChildren.children ?? []),
|
|
135
|
+
{
|
|
136
|
+
id: "initial-proposal",
|
|
137
|
+
title: "Initial Proposal",
|
|
138
|
+
children: children,
|
|
139
|
+
},
|
|
140
|
+
];
|
|
141
|
+
}
|
|
142
|
+
if (alternativeProposals.length > 0) {
|
|
143
|
+
returnableChildren.children = [
|
|
144
|
+
...(returnableChildren.children ?? []),
|
|
145
|
+
{
|
|
146
|
+
id: "alternative-proposals",
|
|
147
|
+
title: `Alternative Proposals (${alternativeProposals.length})`,
|
|
148
|
+
children: alternativeProposals.map((proposal) => {
|
|
149
|
+
// Find documents for this specific proposal
|
|
150
|
+
const proposalSowDoc = allDocuments?.find((doc) => doc.header.id === proposal.sow);
|
|
151
|
+
const proposalPaymentTermsDoc = allDocuments?.find((doc) => doc.header.id === proposal.paymentTerms);
|
|
152
|
+
// Filter to only include documents that exist
|
|
153
|
+
const proposalChildDocs = [
|
|
154
|
+
proposalSowDoc,
|
|
155
|
+
proposalPaymentTermsDoc,
|
|
156
|
+
].filter((doc) => doc !== undefined && doc !== null);
|
|
157
|
+
return {
|
|
158
|
+
id: `alternative-proposal-${proposal.id}`,
|
|
159
|
+
title: `${proposal.author.name}`,
|
|
160
|
+
children: proposalChildDocs.map((childDoc) => {
|
|
161
|
+
const dynamicTitle = childDoc.header.documentType ===
|
|
162
|
+
"powerhouse/scopeofwork"
|
|
163
|
+
? "Scope of Work"
|
|
164
|
+
: childDoc.header.documentType ===
|
|
165
|
+
"payment-terms"
|
|
166
|
+
? "Payment Terms"
|
|
167
|
+
: "";
|
|
168
|
+
return {
|
|
169
|
+
id: `editor-${childDoc.header.id}`,
|
|
170
|
+
title: dynamicTitle,
|
|
171
|
+
icon: childDoc.header.documentType ===
|
|
172
|
+
"powerhouse/scopeofwork" ? (_jsx(SowIcon, { className: "w-5 h-5" })) : (_jsx(PaymentIcon, { className: "w-5 h-5" })),
|
|
173
|
+
};
|
|
174
|
+
}),
|
|
175
|
+
};
|
|
176
|
+
}),
|
|
177
|
+
},
|
|
178
|
+
];
|
|
179
|
+
}
|
|
180
|
+
return returnableChildren;
|
|
181
|
+
}),
|
|
182
|
+
};
|
|
183
|
+
}),
|
|
184
|
+
],
|
|
185
|
+
};
|
|
186
|
+
const networkInfoNode = {
|
|
187
|
+
id: "network-information",
|
|
188
|
+
title: "Network Information",
|
|
189
|
+
children: [
|
|
190
|
+
// Add network profile documents
|
|
191
|
+
...networkProfileDocs.map((doc) => ({
|
|
192
|
+
id: `editor-${doc.header.id}`,
|
|
193
|
+
title: "Network Profile",
|
|
194
|
+
icon: _jsx(Earth, { className: "w-5 h-5" }),
|
|
195
|
+
})),
|
|
196
|
+
],
|
|
197
|
+
};
|
|
198
|
+
return [workstreamsNode, networkInfoNode];
|
|
199
|
+
}, [networkAdminDocuments]);
|
|
200
|
+
// Handle sidebar node selection
|
|
201
|
+
const handleActiveNodeChange = useCallback((nodeId) => {
|
|
202
|
+
console.log("nodeId", nodeId);
|
|
203
|
+
// Find the node by ID
|
|
204
|
+
const findNodeById = (nodes, id) => {
|
|
205
|
+
for (const node of nodes) {
|
|
206
|
+
if (node.id === id) {
|
|
207
|
+
return node;
|
|
208
|
+
}
|
|
209
|
+
if (node.children) {
|
|
210
|
+
const found = findNodeById(node.children, id);
|
|
211
|
+
if (found)
|
|
212
|
+
return found;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
return null;
|
|
216
|
+
};
|
|
217
|
+
const newNode = findNodeById(sidebarNodes, nodeId);
|
|
218
|
+
if (!newNode)
|
|
219
|
+
return;
|
|
220
|
+
// Always update the active sidebar node ID
|
|
221
|
+
setActiveSidebarNodeId(newNode.id);
|
|
222
|
+
if (newNode.id === "workstreams") {
|
|
223
|
+
setSelectedNode(undefined);
|
|
224
|
+
setSelectedRootNode("workstreams");
|
|
225
|
+
}
|
|
226
|
+
else if (newNode.id === "network-information") {
|
|
227
|
+
setSelectedNode(undefined);
|
|
228
|
+
setSelectedRootNode("network-information");
|
|
229
|
+
// Handle network information display
|
|
230
|
+
}
|
|
231
|
+
else if (newNode.id.startsWith("editor-")) {
|
|
232
|
+
// Extract file ID from editor-{file.id} format
|
|
233
|
+
const fileId = newNode.id.replace("editor-", "");
|
|
234
|
+
setSelectedNode(fileId);
|
|
235
|
+
}
|
|
236
|
+
}, [setSelectedNode, sidebarNodes]);
|
|
48
237
|
// === EVENT HANDLERS ===
|
|
49
238
|
// Display function that switches views based on active node ID
|
|
50
239
|
const displayActiveNode = (activeNodeId) => {
|
|
51
240
|
// Determine the type of node and extract the actual ID
|
|
52
241
|
let nodeType = "unknown";
|
|
242
|
+
let actualId = activeNodeId;
|
|
53
243
|
if (activeNodeId === "workstreams") {
|
|
54
244
|
nodeType = "workstreams";
|
|
55
245
|
}
|
|
@@ -58,23 +248,25 @@ export function DriveExplorer({ children }) {
|
|
|
58
248
|
}
|
|
59
249
|
else if (activeNodeId.startsWith("editor-")) {
|
|
60
250
|
nodeType = "file";
|
|
251
|
+
actualId = activeNodeId.replace("editor-", "");
|
|
61
252
|
}
|
|
62
253
|
const networkProfileDoc = networkAdminDocuments?.find((doc) => doc.header.documentType === "powerhouse/network-profile");
|
|
63
254
|
switch (nodeType) {
|
|
64
255
|
case "workstreams":
|
|
65
|
-
return (_jsx("div", { className: "w-full h-full p-6 overflow-auto", children: _jsxs("div", { className: "max-w-7xl mx-auto", children: [_jsxs("div", { className: "space-y-6 flex flex-col items-center justify-center mb-10", children: [_jsx("h1", { className: "text-2xl font-bold", children: "Welcome to the Network Admin" }), isNetworkProfileCreated &&
|
|
66
|
-
networkProfileDoc?.state.global.logo && (_jsxs("div", { className: "bg-white rounded-lg shadow-md border border-gray-300 p-4 max-w-lg mx-auto text-sm", children: [_jsxs("div", { className: "flex items-start justify-between gap-4", children: [networkProfileDoc?.state.global.logo ? (_jsx("img", { src: networkProfileDoc?.state.global.logo, alt: "Network Profile Logo", className: "mb-4 max-w-64 max-h-12 w-auto h-auto object-contain flex-shrink-0" })) : (_jsx("div", {})), _jsx("div", { className: "flex flex-wrap gap-2 justify-end flex-shrink-0", children: networkProfileDoc?.state.global.category.map((category) => (_jsx("span", { className: `inline-flex items-center justify-center rounded-md w-fit whitespace-nowrap shrink-0 border-2 px-2 py-0 text-sm font-extrabold ${category.toLowerCase() === "oss"
|
|
256
|
+
return (_jsx("div", { className: "w-full h-full p-6 overflow-auto", children: _jsxs("div", { className: "max-w-7xl mx-auto", children: [_jsxs("div", { className: "space-y-6 flex flex-col items-center justify-center mb-10", children: [_jsx("h1", { className: "text-2xl font-bold", children: "Welcome to the Network Admin" }), isNetworkProfileCreated && (_jsxs("div", { className: "bg-white rounded-lg shadow-md border border-gray-300 p-4 max-w-lg mx-auto text-sm", children: [_jsxs("div", { className: "flex items-start justify-between gap-4", children: [networkProfileDoc?.state.global.logo ? (_jsx("img", { src: networkProfileDoc?.state.global.logo, alt: "Network Profile Logo", className: "mb-4 max-w-32 max-h-32 sm:max-w-48 sm:max-h-48 md:max-w-64 md:max-h-64 w-auto h-auto object-contain flex-shrink-0" })) : (_jsx("div", {})), _jsx("div", { className: "flex flex-wrap gap-2 justify-end flex-shrink-0", children: networkProfileDoc?.state.global.category.map((category) => (_jsx("span", { className: `inline-flex items-center justify-center rounded-md w-fit whitespace-nowrap shrink-0 border-2 px-2 py-0 text-sm font-extrabold ${category.toLowerCase() === "oss"
|
|
67
257
|
? "bg-purple-600/30 text-purple-600 border-purple-600/70"
|
|
68
258
|
: category.toLowerCase() === "defi"
|
|
69
259
|
? "bg-blue-600/30 text-blue-600 border-blue-600/70"
|
|
70
260
|
: "bg-gray-500/30 text-gray-500 border-gray-500/70"}`, children: category }, category))) })] }), _jsx("p", { className: "mt-4", children: networkProfileDoc?.state.global.description })] })), _jsxs("div", { className: "flex flex-wrap gap-3 justify-center", children: [_jsx(Button, { color: "dark" // Customize button appearance
|
|
71
261
|
, size: "sm", className: "cursor-pointer hover:bg-gray-600 hover:text-white", title: "Create Workstream Document", "aria-description": "Create Workstream Document", onClick: () => {
|
|
72
|
-
setModalDocumentType("powerhouse/workstream");
|
|
73
|
-
setOpenModal(true);
|
|
262
|
+
// setModalDocumentType("powerhouse/workstream");
|
|
263
|
+
// setOpenModal(true);
|
|
264
|
+
showCreateDocumentModal("powerhouse/workstream");
|
|
74
265
|
}, disabled: !isNetworkProfileCreated, children: _jsxs("span", { className: "flex items-center gap-2", children: [_jsx(WorkstreamIcon, { className: "w-7 h-7 text-white" }), "Create Workstream Document"] }) }), _jsx(Button, { color: "dark" // Customize button appearance
|
|
75
266
|
, size: "sm", className: "cursor-pointer hover:bg-gray-600 hover:text-white", title: "Create Network Profile Document", "aria-description": "Create Network Profile Document", onClick: () => {
|
|
76
|
-
setModalDocumentType("powerhouse/network-profile");
|
|
77
|
-
setOpenModal(true);
|
|
267
|
+
// setModalDocumentType("powerhouse/network-profile");
|
|
268
|
+
// setOpenModal(true);
|
|
269
|
+
showCreateDocumentModal("powerhouse/network-profile");
|
|
78
270
|
}, disabled: isNetworkProfileCreated, children: _jsx("span", { className: "flex items-center gap-2", children: "Create Network Profile Document" }) })] })] }), networkAdminDocuments && networkAdminDocuments.length > 0 && (_jsxs("div", { className: "w-full", children: [_jsx("h3", { className: "mb-4 text-lg font-medium text-gray-700", children: "\uD83D\uDCC4 Documents" }), _jsx("div", { className: "overflow-x-auto rounded-lg border border-gray-200 shadow-sm", children: _jsxs("table", { className: "w-full bg-white", children: [_jsx("thead", { className: "bg-gray-50", children: _jsxs("tr", { children: [_jsx("th", { className: "px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider w-1/4", children: "Name" }), _jsx("th", { className: "px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider w-1/4", children: "Type" }), _jsx("th", { className: "px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider w-1/4", children: "Actions" })] }) }), _jsx("tbody", { className: "bg-white divide-y divide-gray-200", children: networkAdminDocuments.map((document) => {
|
|
79
271
|
// Find the corresponding file node for actions
|
|
80
272
|
const fileNode = fileChildren?.find((file) => file.id === document.header.id);
|
|
@@ -125,20 +317,24 @@ export function DriveExplorer({ children }) {
|
|
|
125
317
|
return;
|
|
126
318
|
}
|
|
127
319
|
if (documentType === "powerhouse/workstream") {
|
|
128
|
-
const networkProfileDoc = networkAdminDocuments?.find(
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
320
|
+
// const networkProfileDoc = networkAdminDocuments?.find(
|
|
321
|
+
// (doc) => doc.header.documentType === "powerhouse/network-profile"
|
|
322
|
+
// ) as NetworkProfileDocument | undefined;
|
|
323
|
+
// const actionsToDispatch = [
|
|
324
|
+
// editWorkstream({ title: fileName }),
|
|
325
|
+
// editClientInfo({
|
|
326
|
+
// clientId: networkProfileDoc?.header.id || "",
|
|
327
|
+
// name: networkProfileDoc?.state.global.name || "",
|
|
328
|
+
// icon: networkProfileDoc?.state.global.icon || "",
|
|
329
|
+
// }),
|
|
330
|
+
// ];
|
|
331
|
+
// await dispatchActions(actionsToDispatch, node.id);
|
|
138
332
|
}
|
|
139
333
|
selectedDocumentModel.current = null;
|
|
140
334
|
console.log("Created document node", node);
|
|
141
335
|
if (node) {
|
|
336
|
+
// Customize: Auto-open created document by uncommenting below
|
|
337
|
+
// setActiveDocumentId(node.id);
|
|
142
338
|
// Refresh the sidebar by triggering a re-render
|
|
143
339
|
// Set the root node based on the document type that was created
|
|
144
340
|
if (documentType === "powerhouse/network-profile") {
|
|
@@ -152,33 +348,14 @@ export function DriveExplorer({ children }) {
|
|
|
152
348
|
catch (error) {
|
|
153
349
|
console.error("Failed to create document:", error);
|
|
154
350
|
}
|
|
155
|
-
}, [selectedDrive?.header.id, modalDocumentType
|
|
156
|
-
// Create builders document
|
|
157
|
-
const createBuildersDocument = useCallback(async () => {
|
|
158
|
-
try {
|
|
159
|
-
const isCreated = allDocuments?.some((doc) => doc.header.documentType === "powerhouse/builders");
|
|
160
|
-
if (isCreated) {
|
|
161
|
-
return;
|
|
162
|
-
}
|
|
163
|
-
else {
|
|
164
|
-
console.log("Creating builders document");
|
|
165
|
-
const node = await addDocument(selectedDrive?.header.id || "", "Builders", "powerhouse/builders", undefined, // creating in root folder
|
|
166
|
-
undefined, undefined, "builders-editor");
|
|
167
|
-
if (!node?.id) {
|
|
168
|
-
console.error("Error creating builders document");
|
|
169
|
-
return;
|
|
170
|
-
}
|
|
171
|
-
return node;
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
catch (error) {
|
|
175
|
-
console.error("Failed to create builders document:", error);
|
|
176
|
-
return null;
|
|
177
|
-
}
|
|
178
|
-
}, [selectedDrive?.header.id, allDocuments]);
|
|
351
|
+
}, [selectedDrive?.header.id, modalDocumentType]);
|
|
179
352
|
// === RENDER ===
|
|
180
|
-
return (_jsx(
|
|
353
|
+
return (_jsx(SidebarProvider, { nodes: sidebarNodes, children: isScopeOfWorkFullView && props.children ? (_jsx("div", { className: "h-full w-full", children: props.children })) : (
|
|
181
354
|
/* === NORMAL VIEW WITH SIDEBAR === */
|
|
182
|
-
_jsxs("div", { className: "flex h-full", children: [_jsx(
|
|
183
|
-
|
|
355
|
+
_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: () => {
|
|
356
|
+
setSelectedNode(undefined);
|
|
357
|
+
setActiveSidebarNodeId("workstreams");
|
|
358
|
+
setSelectedRootNode("workstreams");
|
|
359
|
+
} }), _jsx("div", { className: "flex-1 overflow-y-auto", children: _jsx("div", { className: "h-full", children: props.children ||
|
|
360
|
+
displayActiveNode(selectedFolder?.id || selectedRootNode) }) })] })) }));
|
|
184
361
|
}
|
|
@@ -1,14 +1,6 @@
|
|
|
1
|
-
import type { FileNode } from "document-drive";
|
|
2
|
-
interface FolderTreeProps {
|
|
3
|
-
activeSidebarNodeId: string;
|
|
4
|
-
setActiveSidebarNodeId: (id: string) => void;
|
|
5
|
-
setSelectedRootNode: (node: string) => void;
|
|
6
|
-
createBuildersDocument: () => Promise<FileNode | null | undefined>;
|
|
7
|
-
}
|
|
8
1
|
/**
|
|
9
2
|
* Hierarchical folder tree navigation component using Sidebar from document-engineering.
|
|
10
3
|
* Displays folders and files in a tree structure with expand/collapse functionality, search, and resize support.
|
|
11
4
|
*/
|
|
12
|
-
export declare function FolderTree(
|
|
13
|
-
export {};
|
|
5
|
+
export declare function FolderTree(): import("react/jsx-runtime").JSX.Element;
|
|
14
6
|
//# sourceMappingURL=FolderTree.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FolderTree.d.ts","sourceRoot":"","sources":["../../../../editors/network-admin/components/FolderTree.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FolderTree.d.ts","sourceRoot":"","sources":["../../../../editors/network-admin/components/FolderTree.tsx"],"names":[],"mappings":"AAyDA;;;GAGG;AACH,wBAAgB,UAAU,4CA0CzB"}
|