@powerhousedao/network-admin 1.0.0-dev.3 → 1.0.0-staging.4
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/builders/actions.d.ts +14 -0
- package/dist/document-models/builders/actions.d.ts.map +1 -0
- package/dist/document-models/builders/actions.js +4 -0
- package/dist/document-models/builders/gen/actions.d.ts +4 -0
- package/dist/document-models/builders/gen/actions.d.ts.map +1 -0
- package/dist/document-models/builders/gen/actions.js +1 -0
- package/dist/document-models/builders/gen/builders/actions.d.ts +12 -0
- package/dist/document-models/builders/gen/builders/actions.d.ts.map +1 -0
- package/dist/document-models/builders/gen/builders/actions.js +1 -0
- package/dist/document-models/builders/gen/builders/creators.d.ts +5 -0
- package/dist/document-models/builders/gen/builders/creators.d.ts.map +1 -0
- package/dist/document-models/builders/gen/builders/creators.js +4 -0
- package/dist/document-models/builders/gen/builders/error.d.ts +2 -0
- package/dist/document-models/builders/gen/builders/error.d.ts.map +1 -0
- package/dist/document-models/builders/gen/builders/error.js +1 -0
- package/dist/document-models/builders/gen/builders/operations.d.ts +8 -0
- package/dist/document-models/builders/gen/builders/operations.d.ts.map +1 -0
- package/dist/document-models/builders/gen/builders/operations.js +1 -0
- package/dist/document-models/builders/gen/creators.d.ts +3 -0
- package/dist/document-models/builders/gen/creators.d.ts.map +1 -0
- package/dist/document-models/builders/gen/creators.js +2 -0
- package/dist/document-models/builders/gen/document-model.d.ts +3 -0
- package/dist/document-models/builders/gen/document-model.d.ts.map +1 -0
- package/dist/document-models/builders/gen/document-model.js +59 -0
- package/dist/document-models/builders/gen/document-schema.d.ts +44 -0
- package/dist/document-models/builders/gen/document-schema.d.ts.map +1 -0
- package/dist/document-models/builders/gen/document-schema.js +33 -0
- package/dist/document-models/builders/gen/document-type.d.ts +2 -0
- package/dist/document-models/builders/gen/document-type.d.ts.map +1 -0
- package/dist/document-models/builders/gen/document-type.js +1 -0
- package/dist/document-models/builders/gen/index.d.ts +12 -0
- package/dist/document-models/builders/gen/index.d.ts.map +1 -0
- package/dist/document-models/builders/gen/index.js +11 -0
- package/dist/document-models/builders/gen/ph-factories.d.ts +23 -0
- package/dist/document-models/builders/gen/ph-factories.d.ts.map +1 -0
- package/dist/document-models/builders/gen/ph-factories.js +47 -0
- package/dist/document-models/builders/gen/reducer.d.ts +3 -0
- package/dist/document-models/builders/gen/reducer.d.ts.map +1 -0
- package/dist/document-models/builders/gen/reducer.js +23 -0
- package/dist/document-models/builders/gen/schema/index.d.ts +3 -0
- package/dist/document-models/builders/gen/schema/index.d.ts.map +1 -0
- package/dist/document-models/builders/gen/schema/index.js +2 -0
- package/dist/document-models/builders/gen/schema/types.d.ts +158 -0
- package/dist/document-models/builders/gen/schema/types.d.ts.map +1 -0
- package/dist/document-models/builders/gen/schema/types.js +1 -0
- package/dist/document-models/builders/gen/schema/zod.d.ts +13 -0
- package/dist/document-models/builders/gen/schema/zod.d.ts.map +1 -0
- package/dist/document-models/builders/gen/schema/zod.js +21 -0
- package/dist/document-models/builders/gen/types.d.ts +12 -0
- package/dist/document-models/builders/gen/types.d.ts.map +1 -0
- package/dist/document-models/builders/gen/types.js +1 -0
- package/dist/document-models/builders/gen/utils.d.ts +15 -0
- package/dist/document-models/builders/gen/utils.d.ts.map +1 -0
- package/dist/document-models/builders/gen/utils.js +51 -0
- package/dist/document-models/builders/hooks.d.ts +14 -0
- package/dist/document-models/builders/hooks.d.ts.map +1 -0
- package/dist/document-models/builders/hooks.js +25 -0
- package/dist/document-models/builders/index.d.ts +6 -0
- package/dist/document-models/builders/index.d.ts.map +1 -0
- package/dist/document-models/builders/index.js +5 -0
- package/dist/document-models/builders/module.d.ts +5 -0
- package/dist/document-models/builders/module.d.ts.map +1 -0
- package/dist/document-models/builders/module.js +11 -0
- package/dist/document-models/builders/src/index.d.ts +2 -0
- package/dist/document-models/builders/src/index.d.ts.map +1 -0
- package/dist/document-models/builders/src/index.js +1 -0
- package/dist/document-models/builders/src/reducers/builders.d.ts +3 -0
- package/dist/document-models/builders/src/reducers/builders.d.ts.map +1 -0
- package/dist/document-models/builders/src/reducers/builders.js +8 -0
- package/dist/document-models/builders/src/tests/builders.test.d.ts +6 -0
- package/dist/document-models/builders/src/tests/builders.test.d.ts.map +1 -0
- package/dist/document-models/builders/src/tests/builders.test.js +29 -0
- package/dist/document-models/builders/src/tests/document-model.test.d.ts +10 -0
- package/dist/document-models/builders/src/tests/document-model.test.d.ts.map +1 -0
- package/dist/document-models/builders/src/tests/document-model.test.js +104 -0
- package/dist/document-models/builders/src/utils.d.ts +2 -0
- package/dist/document-models/builders/src/utils.d.ts.map +1 -0
- package/dist/document-models/builders/src/utils.js +1 -0
- package/dist/document-models/builders/tests/builders.test.d.ts +2 -0
- package/dist/document-models/builders/tests/builders.test.d.ts.map +1 -0
- package/dist/document-models/builders/tests/builders.test.js +25 -0
- package/dist/document-models/builders/tests/document-model.test.d.ts +10 -0
- package/dist/document-models/builders/tests/document-model.test.d.ts.map +1 -0
- package/dist/document-models/builders/tests/document-model.test.js +104 -0
- package/dist/document-models/builders/utils.d.ts +14 -0
- package/dist/document-models/builders/utils.d.ts.map +1 -0
- package/dist/document-models/builders/utils.js +7 -0
- package/dist/document-models/document-models.d.ts.map +1 -1
- package/dist/document-models/document-models.js +2 -0
- package/dist/document-models/index.d.ts +1 -0
- package/dist/document-models/index.d.ts.map +1 -1
- package/dist/document-models/index.js +1 -0
- 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/document-schema.d.ts +80 -0
- package/dist/document-models/network-profile/gen/document-schema.d.ts.map +1 -0
- package/dist/document-models/network-profile/gen/ph-factories.d.ts.map +1 -1
- package/dist/document-models/network-profile/gen/ph-factories.js +2 -0
- package/dist/document-models/network-profile/gen/reducer.d.ts +1 -0
- package/dist/document-models/network-profile/gen/reducer.d.ts.map +1 -1
- package/dist/document-models/network-profile/gen/schema/types.d.ts +6 -2
- 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 +8 -2
- package/dist/document-models/network-profile/gen/schema/zod.d.ts.map +1 -1
- package/dist/document-models/network-profile/gen/schema/zod.js +6 -2
- package/dist/document-models/network-profile/gen/utils.d.ts.map +1 -1
- package/dist/document-models/network-profile/gen/utils.js +3 -1
- 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/src/reducers/network-profile-management.d.ts +0 -1
- 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 +27 -18
- package/dist/document-models/network-profile/src/tests/document-model.test.d.ts +4 -0
- 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 +92 -6
- package/dist/document-models/network-profile/src/tests/network-profile-management.test.js +69 -115
- package/dist/document-models/payment-terms/actions.d.ts +1 -2
- package/dist/document-models/payment-terms/actions.d.ts.map +1 -1
- package/dist/document-models/payment-terms/gen/clauses/error.d.ts +1 -40
- package/dist/document-models/payment-terms/gen/clauses/error.d.ts.map +1 -1
- package/dist/document-models/payment-terms/gen/clauses/error.js +1 -32
- package/dist/document-models/payment-terms/gen/document-model.d.ts.map +1 -1
- package/dist/document-models/payment-terms/gen/document-model.js +89 -180
- package/dist/document-models/payment-terms/gen/document-schema.d.ts +95 -0
- package/dist/document-models/payment-terms/gen/document-schema.d.ts.map +1 -0
- package/dist/document-models/payment-terms/gen/milestones/error.d.ts +1 -26
- package/dist/document-models/payment-terms/gen/milestones/error.d.ts.map +1 -1
- package/dist/document-models/payment-terms/gen/milestones/error.js +1 -18
- package/dist/document-models/payment-terms/gen/ph-factories.d.ts.map +1 -1
- package/dist/document-models/payment-terms/gen/ph-factories.js +1 -2
- package/dist/document-models/payment-terms/gen/reducer.d.ts +1 -0
- package/dist/document-models/payment-terms/gen/reducer.d.ts.map +1 -1
- package/dist/document-models/payment-terms/gen/reducer.js +4 -9
- package/dist/document-models/payment-terms/gen/schema/types.d.ts +14 -29
- 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 +36 -12
- package/dist/document-models/payment-terms/gen/schema/zod.d.ts.map +1 -1
- package/dist/document-models/payment-terms/gen/schema/zod.js +29 -55
- package/dist/document-models/payment-terms/gen/terms/actions.d.ts +5 -9
- 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 +3 -4
- package/dist/document-models/payment-terms/gen/terms/creators.d.ts.map +1 -1
- package/dist/document-models/payment-terms/gen/terms/creators.js +2 -3
- package/dist/document-models/payment-terms/gen/terms/operations.d.ts +2 -3
- 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 +2 -3
- 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/src/reducers/clauses.d.ts +0 -1
- package/dist/document-models/payment-terms/src/reducers/clauses.d.ts.map +1 -1
- package/dist/document-models/payment-terms/src/reducers/clauses.js +13 -15
- package/dist/document-models/payment-terms/src/reducers/milestones.d.ts +0 -1
- package/dist/document-models/payment-terms/src/reducers/milestones.d.ts.map +1 -1
- package/dist/document-models/payment-terms/src/reducers/milestones.js +10 -12
- package/dist/document-models/payment-terms/src/reducers/terms.d.ts +0 -1
- package/dist/document-models/payment-terms/src/reducers/terms.d.ts.map +1 -1
- package/dist/document-models/payment-terms/src/reducers/terms.js +14 -24
- package/dist/document-models/payment-terms/src/tests/clauses.test.js +26 -21
- package/dist/document-models/payment-terms/src/tests/document-model.test.d.ts +4 -0
- 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 +92 -6
- package/dist/document-models/payment-terms/src/tests/milestones.test.js +22 -19
- package/dist/document-models/payment-terms/src/tests/terms.test.js +24 -29
- package/dist/document-models/payment-terms/tests/terms.test.js +5 -15
- package/dist/document-models/request-for-proposals/gen/document-model.js +4 -4
- package/dist/document-models/request-for-proposals/gen/document-schema.d.ts +83 -0
- package/dist/document-models/request-for-proposals/gen/document-schema.d.ts.map +1 -0
- 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 +6 -4
- package/dist/document-models/request-for-proposals/gen/reducer.d.ts +1 -0
- 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 +64 -9
- 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 +7 -5
- 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/src/reducers/contex-document.d.ts +0 -1
- 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 +3 -4
- package/dist/document-models/request-for-proposals/src/reducers/proposals.d.ts +0 -1
- 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 +4 -5
- package/dist/document-models/request-for-proposals/src/reducers/rfp-state.d.ts +0 -1
- 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 +2 -3
- package/dist/document-models/request-for-proposals/src/tests/contex-document.test.d.ts +2 -1
- 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 +24 -181
- package/dist/document-models/request-for-proposals/src/tests/document-model.test.d.ts +4 -0
- 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 +92 -6
- package/dist/document-models/request-for-proposals/src/tests/proposals.test.d.ts +2 -1
- 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 +33 -327
- package/dist/document-models/request-for-proposals/src/tests/rfp-state.test.d.ts +2 -1
- 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 +15 -240
- 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/document-schema.d.ts +71 -0
- package/dist/document-models/workstream/gen/document-schema.d.ts.map +1 -0
- package/dist/document-models/workstream/gen/reducer.d.ts +1 -0
- 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 +35 -5
- 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/src/reducers/proposals.d.ts +0 -1
- package/dist/document-models/workstream/src/reducers/proposals.d.ts.map +1 -1
- package/dist/document-models/workstream/src/reducers/proposals.js +83 -6
- package/dist/document-models/workstream/src/reducers/workstream.d.ts +0 -1
- package/dist/document-models/workstream/src/reducers/workstream.d.ts.map +1 -1
- package/dist/document-models/workstream/src/reducers/workstream.js +6 -7
- package/dist/document-models/workstream/src/tests/document-model.test.d.ts +4 -0
- 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 +89 -3
- package/dist/document-models/workstream/src/tests/proposals.test.js +26 -25
- package/dist/document-models/workstream/src/tests/workstream.test.js +34 -29
- package/dist/editors/builders/editor.d.ts +3 -0
- package/dist/editors/builders/editor.d.ts.map +1 -0
- package/dist/editors/builders/editor.js +285 -0
- package/dist/editors/builders/hooks/useRemoteBuilderProfiles.d.ts +20 -0
- package/dist/editors/builders/hooks/useRemoteBuilderProfiles.d.ts.map +1 -0
- package/dist/editors/builders/hooks/useRemoteBuilderProfiles.js +57 -0
- package/dist/editors/builders/module.d.ts +4 -0
- package/dist/editors/builders/module.d.ts.map +1 -0
- package/dist/editors/builders/module.js +10 -0
- package/dist/editors/builders/utils/graphql-client.d.ts +41 -0
- package/dist/editors/builders/utils/graphql-client.d.ts.map +1 -0
- package/dist/editors/builders/utils/graphql-client.js +189 -0
- package/dist/editors/editors.d.ts +3 -0
- package/dist/editors/editors.d.ts.map +1 -0
- package/dist/editors/editors.js +14 -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 +8 -12
- package/dist/editors/network-admin/components/DriveContents.d.ts +3 -0
- package/dist/editors/network-admin/components/DriveContents.d.ts.map +1 -0
- package/dist/editors/network-admin/components/DriveContents.js +10 -0
- 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 +53 -230
- package/dist/editors/network-admin/components/EmptyState.d.ts +3 -0
- package/dist/editors/network-admin/components/EmptyState.d.ts.map +1 -0
- package/dist/editors/network-admin/components/EmptyState.js +10 -0
- package/dist/editors/network-admin/components/Files.d.ts +3 -0
- package/dist/editors/network-admin/components/Files.d.ts.map +1 -0
- package/dist/editors/network-admin/components/Files.js +12 -0
- package/dist/editors/network-admin/components/FolderTree.d.ts +9 -1
- package/dist/editors/network-admin/components/FolderTree.d.ts.map +1 -1
- package/dist/editors/network-admin/components/FolderTree.js +216 -55
- package/dist/editors/network-admin/components/Folders.d.ts +3 -0
- package/dist/editors/network-admin/components/Folders.d.ts.map +1 -0
- package/dist/editors/network-admin/components/Folders.js +12 -0
- package/dist/editors/network-admin/components/NavigationBreadcrumbs.d.ts +3 -0
- package/dist/editors/network-admin/components/NavigationBreadcrumbs.d.ts.map +1 -0
- package/dist/editors/network-admin/components/NavigationBreadcrumbs.js +6 -0
- 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 +1 -0
- 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 +2 -1
- package/dist/editors/network-admin/editor.d.ts.map +1 -1
- package/dist/editors/network-admin/editor.js +4 -1
- package/dist/editors/network-admin/module.d.ts +4 -0
- package/dist/editors/network-admin/module.d.ts.map +1 -0
- package/dist/editors/network-admin/module.js +10 -0
- package/dist/editors/network-profile/components/EditName.d.ts +3 -0
- package/dist/editors/network-profile/components/EditName.d.ts.map +1 -0
- package/dist/editors/network-profile/components/EditName.js +31 -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 +45 -13
- package/dist/editors/network-profile/module.d.ts +4 -0
- package/dist/editors/network-profile/module.d.ts.map +1 -0
- package/dist/editors/network-profile/module.js +10 -0
- package/dist/editors/payment-terms/components/clauses-section.d.ts +12 -0
- package/dist/editors/payment-terms/components/clauses-section.d.ts.map +1 -0
- package/dist/editors/payment-terms/components/clauses-section.js +269 -0
- package/dist/editors/payment-terms/components/escrow-section.d.ts +13 -0
- package/dist/editors/payment-terms/components/escrow-section.d.ts.map +1 -0
- package/dist/editors/payment-terms/components/escrow-section.js +72 -0
- package/dist/editors/payment-terms/components/evaluation-section.d.ts +13 -0
- package/dist/editors/payment-terms/components/evaluation-section.d.ts.map +1 -0
- package/dist/editors/payment-terms/components/evaluation-section.js +94 -0
- package/dist/editors/payment-terms/components/header-section.d.ts +16 -0
- package/dist/editors/payment-terms/components/header-section.d.ts.map +1 -0
- package/dist/editors/payment-terms/components/header-section.js +67 -0
- package/dist/editors/payment-terms/components/milestones-section.d.ts +11 -0
- package/dist/editors/payment-terms/components/milestones-section.d.ts.map +1 -0
- package/dist/editors/payment-terms/components/milestones-section.js +236 -0
- package/dist/editors/payment-terms/components/parties-section.d.ts +11 -0
- package/dist/editors/payment-terms/components/parties-section.d.ts.map +1 -0
- package/dist/editors/payment-terms/components/parties-section.js +36 -0
- package/dist/editors/payment-terms/components/payment-config-section.d.ts +11 -0
- package/dist/editors/payment-terms/components/payment-config-section.d.ts.map +1 -0
- package/dist/editors/payment-terms/components/payment-config-section.js +68 -0
- package/dist/editors/payment-terms/components/time-materials-section.d.ts +11 -0
- package/dist/editors/payment-terms/components/time-materials-section.d.ts.map +1 -0
- package/dist/editors/payment-terms/components/time-materials-section.js +68 -0
- package/dist/editors/payment-terms/editor.d.ts +0 -2
- package/dist/editors/payment-terms/editor.d.ts.map +1 -1
- package/dist/editors/payment-terms/editor.js +39 -55
- package/dist/editors/payment-terms/module.d.ts +4 -0
- package/dist/editors/payment-terms/module.d.ts.map +1 -0
- package/dist/editors/payment-terms/module.js +10 -0
- package/dist/editors/request-for-proposals/components/EditName.d.ts +3 -0
- package/dist/editors/request-for-proposals/components/EditName.d.ts.map +1 -0
- package/dist/editors/request-for-proposals/components/EditName.js +31 -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/markdown-editor.d.ts.map +1 -1
- package/dist/editors/request-for-proposals/markdown-editor.js +3 -3
- package/dist/editors/request-for-proposals/module.d.ts +4 -0
- package/dist/editors/request-for-proposals/module.d.ts.map +1 -0
- package/dist/editors/request-for-proposals/module.js +10 -0
- package/dist/editors/workstream/editor.d.ts.map +1 -1
- package/dist/editors/workstream/editor.js +290 -165
- package/dist/editors/workstream/module.d.ts +4 -0
- package/dist/editors/workstream/module.d.ts.map +1 -0
- package/dist/editors/workstream/module.js +10 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -4
- package/dist/powerhouse.manifest.json +27 -6
- 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 +4 -1
- package/dist/processors/workstreams/index.d.ts +4 -2
- package/dist/processors/workstreams/index.d.ts.map +1 -1
- package/dist/processors/workstreams/index.js +102 -43
- package/dist/processors/workstreams/migrations.d.ts.map +1 -1
- package/dist/processors/workstreams/migrations.js +12 -15
- package/dist/scripts/sow-mirror/mirror_sow_state.js +119 -114
- package/dist/style.css +6046 -6846
- package/dist/subgraphs/{payment-terms → builders-addon}/index.d.ts +1 -1
- package/dist/subgraphs/builders-addon/index.d.ts.map +1 -0
- package/dist/subgraphs/{workstream → builders-addon}/index.js +2 -2
- package/dist/subgraphs/builders-addon/resolvers.d.ts.map +1 -0
- package/dist/subgraphs/builders-addon/resolvers.js +442 -0
- package/dist/subgraphs/builders-addon/schema.d.ts.map +1 -0
- package/dist/subgraphs/builders-addon/schema.js +294 -0
- package/dist/subgraphs/index.d.ts +1 -5
- package/dist/subgraphs/index.d.ts.map +1 -1
- package/dist/subgraphs/index.js +1 -5
- 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 +138 -8
- package/dist/subgraphs/networks/schema.d.ts.map +1 -1
- package/dist/subgraphs/networks/schema.js +66 -1
- package/dist/subgraphs/workstreams/index.d.ts +4 -1
- package/dist/subgraphs/workstreams/index.d.ts.map +1 -1
- package/dist/subgraphs/workstreams/index.js +6 -0
- package/dist/subgraphs/workstreams/resolvers.d.ts.map +1 -1
- package/dist/subgraphs/workstreams/resolvers.js +495 -30
- package/dist/subgraphs/workstreams/schema.d.ts.map +1 -1
- package/dist/subgraphs/workstreams/schema.js +228 -35
- package/dist/vite.config.d.ts.map +1 -1
- package/dist/vite.config.js +6 -1
- package/package.json +57 -56
- package/dist/document-models/workstream/src/tests/proposals-reducers.test.d.ts +0 -5
- package/dist/document-models/workstream/src/tests/proposals-reducers.test.d.ts.map +0 -1
- package/dist/document-models/workstream/src/tests/proposals-reducers.test.js +0 -318
- package/dist/document-models/workstream/src/tests/workstream-reducers.test.d.ts +0 -5
- package/dist/document-models/workstream/src/tests/workstream-reducers.test.d.ts.map +0 -1
- package/dist/document-models/workstream/src/tests/workstream-reducers.test.js +0 -210
- package/dist/editors/hooks/useNetworkProfileDocument.d.ts +0 -4
- package/dist/editors/hooks/useNetworkProfileDocument.d.ts.map +0 -1
- package/dist/editors/hooks/useNetworkProfileDocument.js +0 -8
- package/dist/editors/hooks/usePaymentTermsDocument.d.ts +0 -4
- package/dist/editors/hooks/usePaymentTermsDocument.d.ts.map +0 -1
- package/dist/editors/hooks/usePaymentTermsDocument.js +0 -8
- package/dist/editors/hooks/useRequestForProposalsDocument.d.ts +0 -4
- package/dist/editors/hooks/useRequestForProposalsDocument.d.ts.map +0 -1
- package/dist/editors/hooks/useRequestForProposalsDocument.js +0 -8
- package/dist/editors/hooks/useWorkstreamDocument.d.ts +0 -4
- package/dist/editors/hooks/useWorkstreamDocument.d.ts.map +0 -1
- package/dist/editors/hooks/useWorkstreamDocument.js +0 -8
- package/dist/editors/network-admin/index.d.ts +0 -3
- package/dist/editors/network-admin/index.d.ts.map +0 -1
- package/dist/editors/network-admin/index.js +0 -10
- package/dist/editors/network-profile/index.d.ts +0 -4
- package/dist/editors/network-profile/index.d.ts.map +0 -1
- package/dist/editors/network-profile/index.js +0 -10
- package/dist/editors/payment-terms/basic-terms-tab.d.ts +0 -10
- package/dist/editors/payment-terms/basic-terms-tab.d.ts.map +0 -1
- package/dist/editors/payment-terms/basic-terms-tab.js +0 -89
- package/dist/editors/payment-terms/clauses-tab.d.ts +0 -12
- package/dist/editors/payment-terms/clauses-tab.d.ts.map +0 -1
- package/dist/editors/payment-terms/clauses-tab.js +0 -213
- package/dist/editors/payment-terms/cost-materials-tab.d.ts +0 -10
- package/dist/editors/payment-terms/cost-materials-tab.d.ts.map +0 -1
- package/dist/editors/payment-terms/cost-materials-tab.js +0 -63
- package/dist/editors/payment-terms/escrow-tab.d.ts +0 -10
- package/dist/editors/payment-terms/escrow-tab.d.ts.map +0 -1
- package/dist/editors/payment-terms/escrow-tab.js +0 -57
- package/dist/editors/payment-terms/evaluation-tab.d.ts +0 -10
- package/dist/editors/payment-terms/evaluation-tab.d.ts.map +0 -1
- package/dist/editors/payment-terms/evaluation-tab.js +0 -63
- package/dist/editors/payment-terms/index.d.ts +0 -4
- package/dist/editors/payment-terms/index.d.ts.map +0 -1
- package/dist/editors/payment-terms/index.js +0 -10
- package/dist/editors/payment-terms/milestones-tab.d.ts +0 -10
- package/dist/editors/payment-terms/milestones-tab.d.ts.map +0 -1
- package/dist/editors/payment-terms/milestones-tab.js +0 -205
- package/dist/editors/payment-terms/retainer-tab.d.ts +0 -10
- package/dist/editors/payment-terms/retainer-tab.d.ts.map +0 -1
- package/dist/editors/payment-terms/retainer-tab.js +0 -91
- package/dist/editors/request-for-proposals/index.d.ts +0 -4
- package/dist/editors/request-for-proposals/index.d.ts.map +0 -1
- package/dist/editors/request-for-proposals/index.js +0 -10
- package/dist/editors/workstream/index.d.ts +0 -4
- package/dist/editors/workstream/index.d.ts.map +0 -1
- package/dist/editors/workstream/index.js +0 -10
- package/dist/editors/workstream/project-management-import.d.ts +0 -3
- package/dist/editors/workstream/project-management-import.d.ts.map +0 -1
- package/dist/editors/workstream/project-management-import.js +0 -5
- package/dist/subgraphs/network-profile/index.d.ts +0 -11
- package/dist/subgraphs/network-profile/index.d.ts.map +0 -1
- package/dist/subgraphs/network-profile/index.js +0 -11
- package/dist/subgraphs/network-profile/resolvers.d.ts.map +0 -1
- package/dist/subgraphs/network-profile/resolvers.js +0 -205
- package/dist/subgraphs/network-profile/schema.d.ts.map +0 -1
- package/dist/subgraphs/network-profile/schema.js +0 -139
- package/dist/subgraphs/payment-terms/index.d.ts.map +0 -1
- package/dist/subgraphs/payment-terms/index.js +0 -11
- package/dist/subgraphs/payment-terms/resolvers.d.ts +0 -3
- package/dist/subgraphs/payment-terms/resolvers.d.ts.map +0 -1
- package/dist/subgraphs/payment-terms/resolvers.js +0 -277
- package/dist/subgraphs/payment-terms/schema.d.ts +0 -3
- package/dist/subgraphs/payment-terms/schema.d.ts.map +0 -1
- package/dist/subgraphs/payment-terms/schema.js +0 -324
- package/dist/subgraphs/request-for-proposals/index.d.ts +0 -11
- package/dist/subgraphs/request-for-proposals/index.d.ts.map +0 -1
- package/dist/subgraphs/request-for-proposals/index.js +0 -11
- package/dist/subgraphs/request-for-proposals/resolvers.d.ts +0 -3
- package/dist/subgraphs/request-for-proposals/resolvers.d.ts.map +0 -1
- package/dist/subgraphs/request-for-proposals/resolvers.js +0 -145
- package/dist/subgraphs/request-for-proposals/schema.d.ts +0 -3
- package/dist/subgraphs/request-for-proposals/schema.d.ts.map +0 -1
- package/dist/subgraphs/request-for-proposals/schema.js +0 -232
- package/dist/subgraphs/workstream/index.d.ts +0 -11
- package/dist/subgraphs/workstream/index.d.ts.map +0 -1
- package/dist/subgraphs/workstream/resolvers.d.ts +0 -3
- package/dist/subgraphs/workstream/resolvers.d.ts.map +0 -1
- package/dist/subgraphs/workstream/resolvers.js +0 -181
- package/dist/subgraphs/workstream/schema.d.ts +0 -3
- package/dist/subgraphs/workstream/schema.d.ts.map +0 -1
- package/dist/subgraphs/workstream/schema.js +0 -206
- package/dist/vitest.config.d.ts +0 -3
- package/dist/vitest.config.d.ts.map +0 -1
- package/dist/vitest.config.js +0 -8
- /package/dist/subgraphs/{network-profile → builders-addon}/resolvers.d.ts +0 -0
- /package/dist/subgraphs/{network-profile → builders-addon}/schema.d.ts +0 -0
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import { TextInput, Select, OIDInput, PHIDInput, ObjectSetTable, buildEnumCellEditor, } from "@powerhousedao/document-engineering";
|
|
2
|
+
import { toast, ToastContainer } from "@powerhousedao/design-system/connect";
|
|
3
|
+
import { TextInput, Select, OIDInput, PHIDInput, ObjectSetTable, buildEnumCellEditor, Button, } from "@powerhousedao/document-engineering";
|
|
4
4
|
import { actions, } from "../../document-models/workstream/index.js";
|
|
5
5
|
import { actions as rfpActions, } from "../../document-models/request-for-proposals/index.js";
|
|
6
|
-
import { ScopeOfWork } from "
|
|
6
|
+
import { ScopeOfWork } from "@powerhousedao/project-management/document-models";
|
|
7
7
|
import { generateId } from "document-model/core";
|
|
8
|
-
import { useDocumentById,
|
|
8
|
+
import { useDocumentById, useSelectedDriveSafe, addDocument, useDocumentsInSelectedDrive, useParentFolderForSelectedNode, setSelectedNode, dispatchActions, } from "@powerhousedao/reactor-browser";
|
|
9
9
|
import { useEffect, useMemo, useState, useCallback } from "react";
|
|
10
|
-
import { useSelectedWorkstreamDocument } from "
|
|
11
|
-
import { DocumentToolbar } from "@powerhousedao/design-system";
|
|
10
|
+
import { useSelectedWorkstreamDocument } from "../../document-models/workstream/hooks.js";
|
|
11
|
+
import { DocumentToolbar } from "@powerhousedao/design-system/connect";
|
|
12
12
|
// Status options for the dropdown
|
|
13
13
|
const statusOptions = [
|
|
14
14
|
{ value: "RFP_DRAFT", label: "RFP Draft (RFP_DRAFT)" },
|
|
@@ -31,110 +31,107 @@ export default function Editor() {
|
|
|
31
31
|
const [doc, dispatch] = useSelectedWorkstreamDocument();
|
|
32
32
|
// Try to get dispatch from context or props
|
|
33
33
|
const [state, setState] = useState(doc.state.global);
|
|
34
|
+
const [clientInputValue, setClientInputValue] = useState(doc.state.global.client?.id || "");
|
|
34
35
|
useEffect(() => {
|
|
35
36
|
setState(doc.state.global);
|
|
36
37
|
}, [doc.state.global]);
|
|
37
|
-
|
|
38
|
-
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
setClientInputValue(state.client?.id || "");
|
|
40
|
+
}, [state.client?.id]);
|
|
41
|
+
const [selectedDrive] = useSelectedDriveSafe();
|
|
39
42
|
// Local state to track newly created document IDs
|
|
40
43
|
const [newlyCreatedSowId, setNewlyCreatedSowId] = useState(null);
|
|
41
44
|
const [newlyCreatedPaymentTermsId, setNewlyCreatedPaymentTermsId] = useState(null);
|
|
42
45
|
const [newlyCreatedRfpId, setNewlyCreatedRfpId] = useState(null);
|
|
43
|
-
// Get the parent folder node for the currently selected node
|
|
44
|
-
const parentFolder = useParentFolderForSelectedNode();
|
|
45
|
-
// Set the selected node to the parent folder node (close the editor)
|
|
46
|
-
function handleClose() {
|
|
47
|
-
setSelectedNode(parentFolder?.id);
|
|
48
|
-
}
|
|
49
46
|
// Loading states to prevent double-clicks
|
|
50
47
|
const [isCreatingRfp, setIsCreatingRfp] = useState(false);
|
|
51
48
|
const [isCreatingSow, setIsCreatingSow] = useState(false);
|
|
52
49
|
const [isCreatingPaymentTerms, setIsCreatingPaymentTerms] = useState(false);
|
|
53
|
-
const [document, dispatchAction] = useDocumentById(newNode?.id);
|
|
54
|
-
const updateRFPDocWithDispatch = () => {
|
|
55
|
-
dispatchAction(rfpActions.editRfp({
|
|
56
|
-
title: `RFP-${state.title || ""}`,
|
|
57
|
-
}));
|
|
58
|
-
};
|
|
59
|
-
const updateSOWDocWithDispatch = () => {
|
|
60
|
-
dispatchAction(ScopeOfWork.actions.editScopeOfWork({
|
|
61
|
-
title: `SOW-${state.title || ""}`,
|
|
62
|
-
}));
|
|
63
|
-
};
|
|
64
|
-
useEffect(() => {
|
|
65
|
-
if (newNode) {
|
|
66
|
-
if (newNode.documentType === "powerhouse/rfp") {
|
|
67
|
-
updateRFPDocWithDispatch();
|
|
68
|
-
}
|
|
69
|
-
else if (newNode.documentType === "powerhouse/scopeofwork") {
|
|
70
|
-
updateSOWDocWithDispatch();
|
|
71
|
-
}
|
|
72
|
-
setNewNode(null);
|
|
73
|
-
}
|
|
74
|
-
}, [newNode]);
|
|
75
50
|
const createRfpDocument = useCallback(async () => {
|
|
76
51
|
if (isCreatingRfp)
|
|
77
52
|
return null; // Prevent double-calls
|
|
78
53
|
setIsCreatingRfp(true);
|
|
54
|
+
// Store current document ID to restore selection after document creation
|
|
55
|
+
const currentDocId = doc.header.id;
|
|
79
56
|
try {
|
|
80
57
|
const createdNode = await addDocument(selectedDrive?.header.id || "", `RFP-${state.title || ""}`, "powerhouse/rfp", undefined, undefined, undefined, "request-for-proposals-editor");
|
|
81
58
|
console.log("Created RFP document", createdNode);
|
|
82
59
|
if (createdNode) {
|
|
83
|
-
|
|
60
|
+
await dispatchActions(rfpActions.editRfp({
|
|
61
|
+
title: `RFP-${state.title || ""}`,
|
|
62
|
+
}), createdNode.id);
|
|
84
63
|
}
|
|
64
|
+
// Restore selection to current workstream document to prevent navigation
|
|
65
|
+
setSelectedNode(currentDocId);
|
|
85
66
|
return createdNode;
|
|
86
67
|
}
|
|
87
68
|
catch (error) {
|
|
88
69
|
console.error("Failed to create RFP document:", error);
|
|
70
|
+
// Restore selection even on error
|
|
71
|
+
setSelectedNode(currentDocId);
|
|
89
72
|
return null;
|
|
90
73
|
}
|
|
91
74
|
finally {
|
|
92
75
|
setIsCreatingRfp(false);
|
|
93
76
|
}
|
|
94
|
-
}, [isCreatingRfp, selectedDrive?.header.id, state.title]);
|
|
77
|
+
}, [isCreatingRfp, selectedDrive?.header.id, state.title, doc.header.id]);
|
|
95
78
|
const createSowDocument = useCallback(async () => {
|
|
96
79
|
if (isCreatingSow)
|
|
97
80
|
return null; // Prevent double-calls
|
|
98
81
|
setIsCreatingSow(true);
|
|
82
|
+
// Store current document ID to restore selection after document creation
|
|
83
|
+
const currentDocId = doc.header.id;
|
|
99
84
|
try {
|
|
100
85
|
const createdNode = await addDocument(selectedDrive?.header.id || "", `SOW-${state.title || ""}`, "powerhouse/scopeofwork", undefined, undefined, undefined, "scope-of-work-editor");
|
|
101
86
|
console.log("Created SOW document", createdNode);
|
|
102
87
|
if (createdNode) {
|
|
103
|
-
|
|
88
|
+
await dispatchActions(ScopeOfWork.actions.editScopeOfWork({
|
|
89
|
+
title: `SOW-${state.title || ""}`,
|
|
90
|
+
}), createdNode.id);
|
|
104
91
|
}
|
|
92
|
+
// Restore selection to current workstream document to prevent navigation
|
|
93
|
+
setSelectedNode(currentDocId);
|
|
105
94
|
return createdNode;
|
|
106
95
|
}
|
|
107
96
|
catch (error) {
|
|
108
97
|
console.error("Failed to create SOW document:", error);
|
|
98
|
+
// Restore selection even on error
|
|
99
|
+
setSelectedNode(currentDocId);
|
|
109
100
|
return null;
|
|
110
101
|
}
|
|
111
102
|
finally {
|
|
112
103
|
setIsCreatingSow(false);
|
|
113
104
|
}
|
|
114
|
-
}, [isCreatingSow, selectedDrive?.header.id, state.title]);
|
|
105
|
+
}, [isCreatingSow, selectedDrive?.header.id, state.title, doc.header.id]);
|
|
115
106
|
const createPaymentTermsDocument = useCallback(async () => {
|
|
116
107
|
if (isCreatingPaymentTerms)
|
|
117
108
|
return null; // Prevent double-calls
|
|
118
109
|
setIsCreatingPaymentTerms(true);
|
|
110
|
+
// Store current document ID to restore selection after document creation
|
|
111
|
+
const currentDocId = doc.header.id;
|
|
119
112
|
try {
|
|
120
113
|
const createdNode = await addDocument(selectedDrive?.header.id || "", `Payment Terms-${state.title || ""}`, "payment-terms", undefined, undefined, undefined, "payment-terms-editor");
|
|
121
114
|
console.log("Created Payment Terms document", createdNode);
|
|
122
115
|
// Note: Payment Terms might not have actions to initialize, so we just create it
|
|
116
|
+
// Restore selection to current workstream document to prevent navigation
|
|
117
|
+
setSelectedNode(currentDocId);
|
|
123
118
|
return createdNode;
|
|
124
119
|
}
|
|
125
120
|
catch (error) {
|
|
126
121
|
console.error("Failed to create Payment Terms document:", error);
|
|
122
|
+
// Restore selection even on error
|
|
123
|
+
setSelectedNode(currentDocId);
|
|
127
124
|
return null;
|
|
128
125
|
}
|
|
129
126
|
finally {
|
|
130
127
|
setIsCreatingPaymentTerms(false);
|
|
131
128
|
}
|
|
132
|
-
}, [
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
129
|
+
}, [
|
|
130
|
+
isCreatingPaymentTerms,
|
|
131
|
+
selectedDrive?.header.id,
|
|
132
|
+
state.title,
|
|
133
|
+
doc.header.id,
|
|
134
|
+
]);
|
|
138
135
|
// Local state to track manual input values
|
|
139
136
|
const [manualAuthorInput, setManualAuthorInput] = useState("");
|
|
140
137
|
// Effect to clear local state when global state is updated
|
|
@@ -156,6 +153,11 @@ export default function Editor() {
|
|
|
156
153
|
}
|
|
157
154
|
}, [state.rfp?.id, newlyCreatedRfpId]);
|
|
158
155
|
const allDocuments = useDocumentsInSelectedDrive();
|
|
156
|
+
const getDocumentNameById = useCallback((documentId) => {
|
|
157
|
+
// Use allDocuments array instead of hooks to avoid violating Rules of Hooks
|
|
158
|
+
const document = allDocuments?.find((doc) => doc.header.id === documentId);
|
|
159
|
+
return document?.header.name || "";
|
|
160
|
+
}, [allDocuments]);
|
|
159
161
|
let rfpDocumentNode = undefined;
|
|
160
162
|
if (state.rfp?.id) {
|
|
161
163
|
rfpDocumentNode = allDocuments?.find((doc) => {
|
|
@@ -225,6 +227,17 @@ export default function Editor() {
|
|
|
225
227
|
path: "",
|
|
226
228
|
}));
|
|
227
229
|
};
|
|
230
|
+
const searchClientDocuments = (userInput) => {
|
|
231
|
+
const results = allDocuments?.filter((node) => node.header.documentType === "powerhouse/network-profile" &&
|
|
232
|
+
(!userInput ||
|
|
233
|
+
node.header.name.toLowerCase().includes(userInput.toLowerCase()) ||
|
|
234
|
+
node.header.id.toLowerCase().includes(userInput.toLowerCase())));
|
|
235
|
+
return results?.map((doc) => ({
|
|
236
|
+
value: doc.header.id,
|
|
237
|
+
title: doc.header.name,
|
|
238
|
+
path: "",
|
|
239
|
+
}));
|
|
240
|
+
};
|
|
228
241
|
const searchSowDocuments = (userInput) => {
|
|
229
242
|
const results = allDocuments?.filter((node) => node.header.documentType === "powerhouse/scopeofwork" &&
|
|
230
243
|
(!userInput ||
|
|
@@ -343,10 +356,23 @@ export default function Editor() {
|
|
|
343
356
|
return {
|
|
344
357
|
value: doc.header.id,
|
|
345
358
|
title: title || doc.header.name,
|
|
346
|
-
path:
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
359
|
+
path: "",
|
|
360
|
+
description: "",
|
|
361
|
+
};
|
|
362
|
+
}, [allDocuments]);
|
|
363
|
+
const getClientOptionById = useCallback((documentId) => {
|
|
364
|
+
if (!documentId)
|
|
365
|
+
return undefined;
|
|
366
|
+
const doc = allDocuments?.find((document) => {
|
|
367
|
+
return (document.header.documentType === "powerhouse/network-profile" &&
|
|
368
|
+
document.header.id === documentId);
|
|
369
|
+
});
|
|
370
|
+
if (!doc)
|
|
371
|
+
return undefined;
|
|
372
|
+
return {
|
|
373
|
+
value: doc.header.id,
|
|
374
|
+
title: doc.header.name,
|
|
375
|
+
path: "",
|
|
350
376
|
description: "",
|
|
351
377
|
};
|
|
352
378
|
}, [allDocuments]);
|
|
@@ -362,13 +388,11 @@ export default function Editor() {
|
|
|
362
388
|
return {
|
|
363
389
|
value: doc.header.id,
|
|
364
390
|
title: doc.header.name,
|
|
365
|
-
path:
|
|
366
|
-
text: doc.header.name,
|
|
367
|
-
url: doc.header.id,
|
|
368
|
-
},
|
|
391
|
+
path: "",
|
|
369
392
|
description: "",
|
|
370
393
|
};
|
|
371
394
|
}, [allDocuments]);
|
|
395
|
+
const clientInitialOption = useMemo(() => getClientOptionById(state.client?.id), [getClientOptionById, state.client?.id]);
|
|
372
396
|
const alternativeProposalsColumns = useMemo(() => [
|
|
373
397
|
{
|
|
374
398
|
field: "authorName",
|
|
@@ -404,7 +428,7 @@ export default function Editor() {
|
|
|
404
428
|
if (newValue !== context.row.sow) {
|
|
405
429
|
dispatch(actions.editAlternativeProposal({
|
|
406
430
|
id: context.row.id,
|
|
407
|
-
sowId: newValue,
|
|
431
|
+
sowId: newValue || null,
|
|
408
432
|
}));
|
|
409
433
|
return true;
|
|
410
434
|
}
|
|
@@ -413,14 +437,56 @@ export default function Editor() {
|
|
|
413
437
|
renderCellEditor: (value, onChange, context) => {
|
|
414
438
|
const currentValue = value || "";
|
|
415
439
|
const initialOption = getSowOptionById(currentValue);
|
|
440
|
+
let latestValue = currentValue;
|
|
441
|
+
const handleSave = (valueToSave) => {
|
|
442
|
+
// Use provided value or fallback to latest tracked value
|
|
443
|
+
const valueToUse = valueToSave !== undefined ? valueToSave : latestValue;
|
|
444
|
+
const normalizedValue = valueToUse || null;
|
|
445
|
+
const currentRowValue = context.row.sow || null;
|
|
446
|
+
if (normalizedValue !== currentRowValue) {
|
|
447
|
+
onChange(normalizedValue);
|
|
448
|
+
dispatch(actions.editAlternativeProposal({
|
|
449
|
+
id: context.row.id,
|
|
450
|
+
sowId: normalizedValue || null,
|
|
451
|
+
}));
|
|
452
|
+
}
|
|
453
|
+
};
|
|
416
454
|
return (_jsx(PHIDInput, { value: currentValue, onChange: (newValue) => {
|
|
455
|
+
latestValue = newValue || "";
|
|
417
456
|
onChange(newValue);
|
|
418
457
|
}, onBlur: (e) => {
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
458
|
+
// Use a small delay to ensure value is set after dropdown closes
|
|
459
|
+
setTimeout(() => {
|
|
460
|
+
const inputValue = e.target?.value || latestValue;
|
|
461
|
+
handleSave(inputValue);
|
|
462
|
+
}, 100);
|
|
463
|
+
}, onKeyDown: async (e) => {
|
|
464
|
+
if (e.key === "Enter") {
|
|
465
|
+
e.preventDefault();
|
|
466
|
+
e.stopPropagation();
|
|
467
|
+
const inputValue = e.target?.value || latestValue;
|
|
468
|
+
// Fetch the actual document value from search results instead of using raw input
|
|
469
|
+
if (inputValue) {
|
|
470
|
+
const searchResults = searchSowDocuments(inputValue) || [];
|
|
471
|
+
const foundDoc = searchResults.find((doc) => doc.value === inputValue ||
|
|
472
|
+
doc.title
|
|
473
|
+
.toLowerCase()
|
|
474
|
+
.includes(inputValue.toLowerCase())) || searchResults[0];
|
|
475
|
+
if (foundDoc) {
|
|
476
|
+
handleSave(foundDoc.value);
|
|
477
|
+
}
|
|
478
|
+
else {
|
|
479
|
+
// If no match found, clear the value
|
|
480
|
+
handleSave("");
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
else {
|
|
484
|
+
handleSave(""); // Clear if empty
|
|
485
|
+
}
|
|
486
|
+
// Blur the input to exit edit mode
|
|
487
|
+
setTimeout(() => {
|
|
488
|
+
e.target?.blur();
|
|
489
|
+
}, 0);
|
|
424
490
|
}
|
|
425
491
|
}, placeholder: "Search for SOW Document", className: "w-full", variant: "withValueTitleAndDescription", initialOptions: initialOption ? [initialOption] : undefined, fetchOptionsCallback: async (userInput) => {
|
|
426
492
|
const results = searchSowDocuments(userInput || "") || [];
|
|
@@ -430,10 +496,7 @@ export default function Editor() {
|
|
|
430
496
|
return results.map((doc) => ({
|
|
431
497
|
value: doc.value,
|
|
432
498
|
title: doc.title,
|
|
433
|
-
path:
|
|
434
|
-
text: doc.path,
|
|
435
|
-
url: doc.value,
|
|
436
|
-
},
|
|
499
|
+
path: "",
|
|
437
500
|
description: "",
|
|
438
501
|
}));
|
|
439
502
|
}, fetchSelectedOptionCallback: async (documentId) => {
|
|
@@ -444,10 +507,7 @@ export default function Editor() {
|
|
|
444
507
|
return {
|
|
445
508
|
value: doc.value,
|
|
446
509
|
title: doc.title,
|
|
447
|
-
path:
|
|
448
|
-
text: doc.path,
|
|
449
|
-
url: doc.value,
|
|
450
|
-
},
|
|
510
|
+
path: "",
|
|
451
511
|
description: "",
|
|
452
512
|
};
|
|
453
513
|
} }));
|
|
@@ -468,7 +528,7 @@ export default function Editor() {
|
|
|
468
528
|
if (newValue !== context.row.paymentTerms) {
|
|
469
529
|
dispatch(actions.editAlternativeProposal({
|
|
470
530
|
id: context.row.id,
|
|
471
|
-
paymentTermsId: newValue,
|
|
531
|
+
paymentTermsId: newValue || null,
|
|
472
532
|
}));
|
|
473
533
|
return true;
|
|
474
534
|
}
|
|
@@ -477,14 +537,56 @@ export default function Editor() {
|
|
|
477
537
|
renderCellEditor: (value, onChange, context) => {
|
|
478
538
|
const currentValue = value || "";
|
|
479
539
|
const initialOption = getPaymentTermsOptionById(currentValue);
|
|
540
|
+
let latestValue = currentValue;
|
|
541
|
+
const handleSave = (valueToSave) => {
|
|
542
|
+
// Use provided value or fallback to latest tracked value
|
|
543
|
+
const valueToUse = valueToSave !== undefined ? valueToSave : latestValue;
|
|
544
|
+
const normalizedValue = valueToUse || null;
|
|
545
|
+
const currentRowValue = context.row.paymentTerms || null;
|
|
546
|
+
if (normalizedValue !== currentRowValue) {
|
|
547
|
+
onChange(normalizedValue);
|
|
548
|
+
dispatch(actions.editAlternativeProposal({
|
|
549
|
+
id: context.row.id,
|
|
550
|
+
paymentTermsId: normalizedValue || null,
|
|
551
|
+
}));
|
|
552
|
+
}
|
|
553
|
+
};
|
|
480
554
|
return (_jsx(PHIDInput, { value: currentValue, onChange: (newValue) => {
|
|
555
|
+
latestValue = newValue || "";
|
|
481
556
|
onChange(newValue);
|
|
482
557
|
}, onBlur: (e) => {
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
558
|
+
// Use a small delay to ensure value is set after dropdown closes
|
|
559
|
+
setTimeout(() => {
|
|
560
|
+
const inputValue = e.target?.value || latestValue;
|
|
561
|
+
handleSave(inputValue);
|
|
562
|
+
}, 100);
|
|
563
|
+
}, onKeyDown: async (e) => {
|
|
564
|
+
if (e.key === "Enter") {
|
|
565
|
+
e.preventDefault();
|
|
566
|
+
e.stopPropagation();
|
|
567
|
+
const inputValue = e.target?.value || latestValue;
|
|
568
|
+
// Fetch the actual document value from search results instead of using raw input
|
|
569
|
+
if (inputValue) {
|
|
570
|
+
const searchResults = searchPaymentTermsDocuments(inputValue) || [];
|
|
571
|
+
const foundDoc = searchResults.find((doc) => doc.value === inputValue ||
|
|
572
|
+
doc.title
|
|
573
|
+
.toLowerCase()
|
|
574
|
+
.includes(inputValue.toLowerCase())) || searchResults[0];
|
|
575
|
+
if (foundDoc) {
|
|
576
|
+
handleSave(foundDoc.value);
|
|
577
|
+
}
|
|
578
|
+
else {
|
|
579
|
+
// If no match found, clear the value
|
|
580
|
+
handleSave("");
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
else {
|
|
584
|
+
handleSave(""); // Clear if empty
|
|
585
|
+
}
|
|
586
|
+
// Blur the input to exit edit mode
|
|
587
|
+
setTimeout(() => {
|
|
588
|
+
e.target?.blur();
|
|
589
|
+
}, 0);
|
|
488
590
|
}
|
|
489
591
|
}, placeholder: "Search for Payment Terms Document", className: "w-full", variant: "withValueTitleAndDescription", initialOptions: initialOption ? [initialOption] : undefined, fetchOptionsCallback: async (userInput) => {
|
|
490
592
|
const results = searchPaymentTermsDocuments(userInput || "") || [];
|
|
@@ -494,10 +596,7 @@ export default function Editor() {
|
|
|
494
596
|
return results.map((doc) => ({
|
|
495
597
|
value: doc.value,
|
|
496
598
|
title: doc.title,
|
|
497
|
-
path:
|
|
498
|
-
text: doc.path,
|
|
499
|
-
url: doc.value,
|
|
500
|
-
},
|
|
599
|
+
path: "",
|
|
501
600
|
description: "",
|
|
502
601
|
}));
|
|
503
602
|
}, fetchSelectedOptionCallback: async (documentId) => {
|
|
@@ -508,10 +607,7 @@ export default function Editor() {
|
|
|
508
607
|
return {
|
|
509
608
|
value: doc.value,
|
|
510
609
|
title: doc.title,
|
|
511
|
-
path:
|
|
512
|
-
text: doc.path,
|
|
513
|
-
url: doc.value,
|
|
514
|
-
},
|
|
610
|
+
path: "",
|
|
515
611
|
description: "",
|
|
516
612
|
};
|
|
517
613
|
} }));
|
|
@@ -561,6 +657,12 @@ export default function Editor() {
|
|
|
561
657
|
searchPaymentTermsDocuments,
|
|
562
658
|
searchSowDocuments,
|
|
563
659
|
]);
|
|
660
|
+
// Get the parent folder node for the currently selected node
|
|
661
|
+
const parentFolder = useParentFolderForSelectedNode();
|
|
662
|
+
// Set the selected node to the parent folder node (close the editor)
|
|
663
|
+
function handleClose() {
|
|
664
|
+
setSelectedNode(parentFolder?.id);
|
|
665
|
+
}
|
|
564
666
|
return (_jsxs("div", { className: "w-full bg-gray-50", children: [_jsx(DocumentToolbar, { document: doc, onClose: handleClose }), _jsxs("div", { className: "p-6 max-w-4xl mx-auto min-h-screen", children: [_jsx("div", { className: "bg-white rounded-lg p-6 mb-6 shadow-sm", children: _jsx("h1", { className: "text-3xl font-bold text-gray-900 mb-2", children: "Workstream" }) }), _jsx("div", { className: "bg-white rounded-lg p-6 mb-6 shadow-sm", children: _jsxs("div", { className: "flex flex-row gap-6", children: [_jsxs("div", { className: "flex-1", children: [_jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Code" }), _jsx(TextInput, { className: "w-full", defaultValue: state.code || "", onBlur: (e) => {
|
|
565
667
|
if (e.target.value !== state.code) {
|
|
566
668
|
handleWorkstreamChange("code", e.target.value);
|
|
@@ -569,11 +671,30 @@ export default function Editor() {
|
|
|
569
671
|
if (e.target.value !== state.title) {
|
|
570
672
|
handleWorkstreamChange("title", e.target.value);
|
|
571
673
|
}
|
|
572
|
-
}, placeholder: "Enter workstream title" })] }), _jsx("div", { className: "flex-1", children: _jsx(Select, { label: "Status", options: statusOptions, value: state.status, onChange: (value) => handleStatusChange(value) }) })] }) }), _jsxs("div", { className: "bg-white border border-gray-300 rounded-lg p-6 shadow-sm", children: [_jsx("h2", { className: "text-lg font-medium text-gray-900 mb-4", children: "Client" }), _jsxs("div", { className: "space-y-4", children: [_jsxs("div", { children: [_jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Client
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
674
|
+
}, placeholder: "Enter workstream title" })] }), _jsx("div", { className: "flex-1", children: _jsx(Select, { label: "Status", options: statusOptions, value: state.status, onChange: (value) => handleStatusChange(value) }) })] }) }), _jsxs("div", { className: "bg-white border border-gray-300 rounded-lg p-6 shadow-sm", children: [_jsx("h2", { className: "text-lg font-medium text-gray-900 mb-4", children: "Client" }), _jsxs("div", { className: "space-y-4 w-[350px]", children: [_jsxs("div", { children: [_jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Client" }), _jsx(PHIDInput, { value: clientInputValue, onChange: (newValue) => {
|
|
675
|
+
setClientInputValue(newValue || "");
|
|
676
|
+
}, onBlur: (e) => {
|
|
677
|
+
if (e.target.value !== (state.client?.id || "")) {
|
|
678
|
+
handleClientIdChange(e.target.value);
|
|
679
|
+
}
|
|
680
|
+
}, placeholder: "Search for Client Profile", className: "w-full", variant: "withValueTitleAndDescription", initialOptions: clientInitialOption ? [clientInitialOption] : undefined, fetchOptionsCallback: async (userInput) => {
|
|
681
|
+
const results = searchClientDocuments(userInput || "") || [];
|
|
682
|
+
if (results.length === 0) {
|
|
683
|
+
return Promise.reject(new Error("No client profiles found"));
|
|
684
|
+
}
|
|
685
|
+
return results.map((doc) => ({
|
|
686
|
+
value: doc.value,
|
|
687
|
+
title: doc.title,
|
|
688
|
+
path: "",
|
|
689
|
+
description: "",
|
|
690
|
+
}));
|
|
691
|
+
}, fetchSelectedOptionCallback: async (documentId) => {
|
|
692
|
+
const option = getClientOptionById(documentId);
|
|
693
|
+
if (!option) {
|
|
694
|
+
return Promise.reject(new Error("Client profile not found"));
|
|
695
|
+
}
|
|
696
|
+
return option;
|
|
697
|
+
} })] }), _jsxs("div", { children: [_jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Name" }), _jsx(TextInput, { className: "w-full", defaultValue: state.client?.name || "", onBlur: (e) => {
|
|
577
698
|
if (e.target.value !== state.client?.name) {
|
|
578
699
|
handleClientChange("name", e.target.value);
|
|
579
700
|
}
|
|
@@ -581,7 +702,7 @@ export default function Editor() {
|
|
|
581
702
|
if (e.target.value !== state.client?.icon) {
|
|
582
703
|
handleClientChange("icon", e.target.value);
|
|
583
704
|
}
|
|
584
|
-
}, placeholder: "Enter client icon URL" }), state.client?.icon ? (_jsx("img", { src: state.client?.icon, alt: "Client Icon", className: "w-10 h-10 object-cover" })) : ("")] })] })] })] })] }), _jsxs("div", { className: "bg-white rounded-lg p-6 mt-6 mb-6 shadow-sm", children: [_jsx("h1", { className: "text-2xl text-gray-900 mb-4", children: "Request for Proposal" }), _jsx("div", { className: "w-full flex flex-row items-center gap-8", children: _jsx("div", { className: "w-[350px]", children: _jsx(OIDInput, { name: "Request for Proposal", label: "RFP Document", placeholder: "Search for RFP Document", variant: "
|
|
705
|
+
}, placeholder: "Enter client icon URL" }), state.client?.icon ? (_jsx("img", { src: state.client?.icon, alt: "Client Icon", className: "w-10 h-10 object-cover" })) : ("")] })] })] })] })] }), _jsxs("div", { className: "bg-white rounded-lg p-6 mt-6 mb-6 shadow-sm", children: [_jsx("h1", { className: "text-2xl text-gray-900 mb-4", children: "Request for Proposal" }), _jsx("div", { className: "w-full flex flex-row items-center gap-8", children: _jsx("div", { className: "w-[350px]", children: _jsx(OIDInput, { name: "Request for Proposal", label: "RFP Document", placeholder: "Search for RFP Document", variant: "withValueAndTitle", value: newlyCreatedRfpId || state.rfp?.id || "", onBlur: (e) => {
|
|
585
706
|
if (e.target.value !== state.rfp?.id) {
|
|
586
707
|
dispatch(actions.setRequestForProposal({
|
|
587
708
|
rfpId: e.target.value,
|
|
@@ -598,10 +719,7 @@ export default function Editor() {
|
|
|
598
719
|
return results?.map((doc) => ({
|
|
599
720
|
value: doc.value, // unique document ID
|
|
600
721
|
title: doc.title, // document title or name
|
|
601
|
-
path:
|
|
602
|
-
text: doc.path,
|
|
603
|
-
url: doc.value,
|
|
604
|
-
}, // document path or location
|
|
722
|
+
path: "",
|
|
605
723
|
description: "", // document description or summary
|
|
606
724
|
icon: "File", // document icon
|
|
607
725
|
}));
|
|
@@ -616,10 +734,7 @@ export default function Editor() {
|
|
|
616
734
|
return {
|
|
617
735
|
value: doc.value,
|
|
618
736
|
title: doc.title,
|
|
619
|
-
path:
|
|
620
|
-
text: doc.path,
|
|
621
|
-
url: doc.title,
|
|
622
|
-
},
|
|
737
|
+
path: "",
|
|
623
738
|
description: "",
|
|
624
739
|
icon: "File",
|
|
625
740
|
};
|
|
@@ -627,25 +742,32 @@ export default function Editor() {
|
|
|
627
742
|
{
|
|
628
743
|
value: rfpDocument?.header.id || "",
|
|
629
744
|
title: rfpDocument?.document.title || "",
|
|
630
|
-
path:
|
|
631
|
-
text: rfpDocument?.document.title || "",
|
|
632
|
-
url: rfpDocument?.header.id || "",
|
|
633
|
-
},
|
|
745
|
+
path: "",
|
|
634
746
|
description: "",
|
|
635
747
|
icon: "File",
|
|
636
748
|
},
|
|
637
|
-
] }) }) }), !rfpDocument ? (_jsx("div", { className: "mt-4", children: _jsx(Button, { color: "light",
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
if (createdNode) {
|
|
642
|
-
// Set local state to immediately show the new RFP ID
|
|
643
|
-
setNewlyCreatedRfpId(createdNode.id);
|
|
644
|
-
dispatch(actions.setRequestForProposal({
|
|
645
|
-
rfpId: createdNode.id,
|
|
646
|
-
title: createdNode.name,
|
|
647
|
-
}));
|
|
749
|
+
] }) }) }), !rfpDocument ? (_jsx("div", { className: "mt-4", children: _jsx(Button, { type: "button", color: "light", size: "sm", className: "cursor-pointer hover:bg-gray-600 hover:text-white disabled:opacity-50 disabled:cursor-not-allowed", title: "Save Workstream", "aria-description": "Save Workstream", disabled: isCreatingRfp, onClick: (e) => {
|
|
750
|
+
if (e) {
|
|
751
|
+
e.preventDefault();
|
|
752
|
+
e.stopPropagation();
|
|
648
753
|
}
|
|
754
|
+
(async () => {
|
|
755
|
+
try {
|
|
756
|
+
const createdNode = await createRfpDocument();
|
|
757
|
+
if (createdNode) {
|
|
758
|
+
// Set local state to immediately show the new RFP ID
|
|
759
|
+
setNewlyCreatedRfpId(createdNode.id);
|
|
760
|
+
dispatch(actions.setRequestForProposal({
|
|
761
|
+
rfpId: createdNode.id,
|
|
762
|
+
title: createdNode.name,
|
|
763
|
+
}));
|
|
764
|
+
}
|
|
765
|
+
}
|
|
766
|
+
catch (error) {
|
|
767
|
+
console.error("Error creating RFP document:", error);
|
|
768
|
+
}
|
|
769
|
+
})();
|
|
770
|
+
return false;
|
|
649
771
|
}, children: isCreatingRfp ? "Creating..." : "Create RFP Document" }) })) : ("")] }), rfpDocument ? (_jsx("div", { children: state.initialProposal ? (_jsxs("div", { className: "bg-white rounded-lg p-6 mb-6 shadow-sm", children: [_jsx("h1", { className: "text-2xl text-gray-900 mb-4", children: "Initial Proposal" }), _jsxs("div", { className: "flex flex-row gap-4 mb-6", children: [_jsx("div", { className: "flex-1", children: _jsx(TextInput, { label: "Author", value: manualAuthorInput ||
|
|
650
772
|
state.initialProposal?.author?.name ||
|
|
651
773
|
"", onChange: (e) => {
|
|
@@ -676,7 +798,7 @@ export default function Editor() {
|
|
|
676
798
|
if (e.target.value !== state.initialProposal?.sow) {
|
|
677
799
|
dispatch(actions.editInitialProposal({
|
|
678
800
|
id: state.initialProposal?.id || "",
|
|
679
|
-
sowId: e.target.value,
|
|
801
|
+
sowId: e.target.value || null,
|
|
680
802
|
}));
|
|
681
803
|
}
|
|
682
804
|
},
|
|
@@ -689,10 +811,7 @@ export default function Editor() {
|
|
|
689
811
|
return results?.map((doc) => ({
|
|
690
812
|
value: doc.value, // unique document ID
|
|
691
813
|
title: doc.title, // document title or name
|
|
692
|
-
path:
|
|
693
|
-
text: doc.path,
|
|
694
|
-
url: doc.value,
|
|
695
|
-
}, // document path or location
|
|
814
|
+
path: "",
|
|
696
815
|
description: "", // document description or summary
|
|
697
816
|
icon: "File", // document icon
|
|
698
817
|
}));
|
|
@@ -706,10 +825,7 @@ export default function Editor() {
|
|
|
706
825
|
return {
|
|
707
826
|
value: doc.value,
|
|
708
827
|
title: doc.title,
|
|
709
|
-
path:
|
|
710
|
-
text: doc.path,
|
|
711
|
-
url: doc.title,
|
|
712
|
-
},
|
|
828
|
+
path: "",
|
|
713
829
|
description: "",
|
|
714
830
|
icon: "File",
|
|
715
831
|
};
|
|
@@ -719,32 +835,41 @@ export default function Editor() {
|
|
|
719
835
|
value: sowDocumentNode.header.id,
|
|
720
836
|
title: sowDocumentNode.state?.global?.title ||
|
|
721
837
|
sowDocumentNode.header.name,
|
|
722
|
-
path:
|
|
723
|
-
text: sowDocumentNode.header.name,
|
|
724
|
-
url: sowDocumentNode.header.id,
|
|
725
|
-
},
|
|
838
|
+
path: "",
|
|
726
839
|
description: "",
|
|
727
840
|
icon: "File",
|
|
728
841
|
},
|
|
729
842
|
]
|
|
730
|
-
: undefined }), _jsx("button", { className: "text-sm bg-gray-100 rounded-md mt-1 p-1 hover:bg-gray-200 disabled:opacity-50 disabled:cursor-not-allowed", disabled: isCreatingSow, onClick:
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
// Set local state to immediately show the new SOW ID
|
|
735
|
-
setNewlyCreatedSowId(createdNode.id);
|
|
736
|
-
dispatch(actions.editInitialProposal({
|
|
737
|
-
id: state.initialProposal?.id || "",
|
|
738
|
-
sowId: createdNode.id,
|
|
739
|
-
}));
|
|
843
|
+
: undefined }), _jsx("button", { type: "button", className: "text-sm bg-gray-100 rounded-md mt-1 p-1 hover:bg-gray-200 disabled:opacity-50 disabled:cursor-not-allowed", disabled: isCreatingSow, onClick: (e) => {
|
|
844
|
+
if (e) {
|
|
845
|
+
e.preventDefault();
|
|
846
|
+
e.stopPropagation();
|
|
740
847
|
}
|
|
848
|
+
(async () => {
|
|
849
|
+
try {
|
|
850
|
+
console.log("Creating sow");
|
|
851
|
+
const createdNode = await createSowDocument();
|
|
852
|
+
if (createdNode) {
|
|
853
|
+
// Set local state to immediately show the new SOW ID
|
|
854
|
+
setNewlyCreatedSowId(createdNode.id);
|
|
855
|
+
dispatch(actions.editInitialProposal({
|
|
856
|
+
id: state.initialProposal?.id || "",
|
|
857
|
+
sowId: createdNode.id,
|
|
858
|
+
}));
|
|
859
|
+
}
|
|
860
|
+
}
|
|
861
|
+
catch (error) {
|
|
862
|
+
console.error("Error creating SOW document:", error);
|
|
863
|
+
}
|
|
864
|
+
})();
|
|
865
|
+
return false;
|
|
741
866
|
}, children: isCreatingSow ? "Creating..." : "Create sow" })] }), _jsxs("div", { className: "flex-1", children: [_jsx(OIDInput, { name: "Payment Terms", label: "Payment Terms", placeholder: "Search for Payment Terms Document", variant: "withValueTitleAndDescription", value: newlyCreatedPaymentTermsId ||
|
|
742
867
|
state.initialProposal?.paymentTerms ||
|
|
743
868
|
"", onBlur: (e) => {
|
|
744
869
|
if (e.target.value !== state.initialProposal?.paymentTerms) {
|
|
745
870
|
dispatch(actions.editInitialProposal({
|
|
746
871
|
id: state.initialProposal?.id || "",
|
|
747
|
-
paymentTermsId: e.target.value,
|
|
872
|
+
paymentTermsId: e.target.value || null,
|
|
748
873
|
}));
|
|
749
874
|
}
|
|
750
875
|
},
|
|
@@ -757,10 +882,7 @@ export default function Editor() {
|
|
|
757
882
|
return results?.map((doc) => ({
|
|
758
883
|
value: doc.value, // unique document ID
|
|
759
884
|
title: doc.title, // document title or name
|
|
760
|
-
path:
|
|
761
|
-
text: doc.path,
|
|
762
|
-
url: doc.value,
|
|
763
|
-
}, // document path or location
|
|
885
|
+
path: "",
|
|
764
886
|
description: "", // document description or summary
|
|
765
887
|
icon: "File", // document icon
|
|
766
888
|
}));
|
|
@@ -774,10 +896,7 @@ export default function Editor() {
|
|
|
774
896
|
return {
|
|
775
897
|
value: doc.value,
|
|
776
898
|
title: doc.title,
|
|
777
|
-
path:
|
|
778
|
-
text: doc.path,
|
|
779
|
-
url: doc.title,
|
|
780
|
-
},
|
|
899
|
+
path: "",
|
|
781
900
|
description: "",
|
|
782
901
|
icon: "File",
|
|
783
902
|
};
|
|
@@ -786,34 +905,42 @@ export default function Editor() {
|
|
|
786
905
|
{
|
|
787
906
|
value: paymentTermsDocumentNode.header.id,
|
|
788
907
|
title: paymentTermsDocumentNode.header.name,
|
|
789
|
-
path:
|
|
790
|
-
text: paymentTermsDocumentNode.header.name,
|
|
791
|
-
url: paymentTermsDocumentNode.header.id,
|
|
792
|
-
},
|
|
908
|
+
path: "",
|
|
793
909
|
description: "",
|
|
794
910
|
icon: "File",
|
|
795
911
|
},
|
|
796
912
|
]
|
|
797
|
-
: undefined }), _jsx("button", { className: "text-sm bg-gray-100 rounded-md mt-1 p-1 hover:bg-gray-200 disabled:opacity-50 disabled:cursor-not-allowed", disabled: isCreatingPaymentTerms, onClick:
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
// Set local state to immediately show the new Payment Terms ID
|
|
802
|
-
setNewlyCreatedPaymentTermsId(createdNode.id);
|
|
803
|
-
dispatch(actions.editInitialProposal({
|
|
804
|
-
id: state.initialProposal?.id || "",
|
|
805
|
-
paymentTermsId: createdNode.id,
|
|
806
|
-
}));
|
|
913
|
+
: undefined }), _jsx("button", { type: "button", className: "text-sm bg-gray-100 rounded-md mt-1 p-1 hover:bg-gray-200 disabled:opacity-50 disabled:cursor-not-allowed", disabled: isCreatingPaymentTerms, onClick: (e) => {
|
|
914
|
+
if (e) {
|
|
915
|
+
e.preventDefault();
|
|
916
|
+
e.stopPropagation();
|
|
807
917
|
}
|
|
918
|
+
(async () => {
|
|
919
|
+
try {
|
|
920
|
+
console.log("Creating payment terms");
|
|
921
|
+
const createdNode = await createPaymentTermsDocument();
|
|
922
|
+
if (createdNode) {
|
|
923
|
+
// Set local state to immediately show the new Payment Terms ID
|
|
924
|
+
setNewlyCreatedPaymentTermsId(createdNode.id);
|
|
925
|
+
dispatch(actions.editInitialProposal({
|
|
926
|
+
id: state.initialProposal?.id || "",
|
|
927
|
+
paymentTermsId: createdNode.id,
|
|
928
|
+
}));
|
|
929
|
+
}
|
|
930
|
+
}
|
|
931
|
+
catch (error) {
|
|
932
|
+
console.error("Error creating Payment Terms document:", error);
|
|
933
|
+
}
|
|
934
|
+
})();
|
|
935
|
+
return false;
|
|
808
936
|
}, children: isCreatingPaymentTerms
|
|
809
937
|
? "Creating..."
|
|
810
938
|
: "Create Payment Terms" })] })] }), _jsxs("div", { children: [_jsx("h2", { className: "text-lg font-medium text-gray-900 mb-4", children: "Alternative Proposals" }), _jsx(ObjectSetTable, { columns: alternativeProposalsColumns, data: alternativeProposalsData, allowRowSelection: true, onDelete: (data) => {
|
|
811
939
|
if (data.length > 0) {
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
});
|
|
940
|
+
// Batch all deletion actions together
|
|
941
|
+
dispatch(data.map((d) => actions.removeAlternativeProposal({
|
|
942
|
+
id: d.id,
|
|
943
|
+
})));
|
|
817
944
|
}
|
|
818
945
|
}, onAdd: (data) => {
|
|
819
946
|
if (data.authorName) {
|
|
@@ -825,9 +952,7 @@ export default function Editor() {
|
|
|
825
952
|
},
|
|
826
953
|
}));
|
|
827
954
|
}
|
|
828
|
-
} })] })] })) : (_jsxs("div", { className: "bg-white rounded-lg p-6 mb-6 shadow-sm", children: [_jsx("h1", { className: "text-2xl text-gray-900 mb-4", children: "Initial Proposal" }), _jsx("div", { className: "mt-4", children: _jsx(Button, { color: "light",
|
|
829
|
-
// size="small"
|
|
830
|
-
className: "cursor-pointer hover:bg-gray-600 hover:text-white", title: "Create Initial Proposal", "aria-description": "Create Initial Proposal", onClick: () => {
|
|
955
|
+
} })] })] })) : (_jsxs("div", { className: "bg-white rounded-lg p-6 mb-6 shadow-sm", children: [_jsx("h1", { className: "text-2xl text-gray-900 mb-4", children: "Initial Proposal" }), _jsx("div", { className: "mt-4", children: _jsx(Button, { color: "light", size: "sm", className: "cursor-pointer hover:bg-gray-600 hover:text-white", title: "Create Initial Proposal", "aria-description": "Create Initial Proposal", onClick: () => {
|
|
831
956
|
console.log("Creating initial proposal");
|
|
832
957
|
dispatch(actions.editInitialProposal({
|
|
833
958
|
id: generateId(),
|