@powerhousedao/network-admin 0.0.34 → 0.0.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (302) hide show
  1. package/dist/document-models/index.d.ts.map +1 -1
  2. package/dist/document-models/index.js +1 -0
  3. package/dist/document-models/network-profile/gen/document-model.d.ts +2 -2
  4. package/dist/document-models/network-profile/gen/document-model.d.ts.map +1 -1
  5. package/dist/document-models/network-profile/gen/index.d.ts +0 -2
  6. package/dist/document-models/network-profile/gen/index.d.ts.map +1 -1
  7. package/dist/document-models/network-profile/gen/index.js +0 -1
  8. package/dist/document-models/network-profile/gen/network-profile-management/actions.js +1 -1
  9. package/dist/document-models/network-profile/gen/network-profile-management/creators.js +2 -1
  10. package/dist/document-models/network-profile/gen/network-profile-management/operations.js +3 -1
  11. package/dist/document-models/network-profile/gen/ph-factories.d.ts +6 -10
  12. package/dist/document-models/network-profile/gen/ph-factories.d.ts.map +1 -1
  13. package/dist/document-models/network-profile/gen/ph-factories.js +1 -4
  14. package/dist/document-models/network-profile/gen/reducer.d.ts +2 -2
  15. package/dist/document-models/network-profile/gen/reducer.d.ts.map +1 -1
  16. package/dist/document-models/network-profile/gen/reducer.js +1 -4
  17. package/dist/document-models/network-profile/gen/types.d.ts +9 -6
  18. package/dist/document-models/network-profile/gen/types.d.ts.map +1 -1
  19. package/dist/document-models/network-profile/gen/types.js +1 -0
  20. package/dist/document-models/network-profile/gen/utils.d.ts +9 -19
  21. package/dist/document-models/network-profile/gen/utils.d.ts.map +1 -1
  22. package/dist/document-models/network-profile/gen/utils.js +26 -34
  23. package/dist/document-models/network-profile/index.d.ts +10 -4
  24. package/dist/document-models/network-profile/index.d.ts.map +1 -1
  25. package/dist/document-models/network-profile/index.js +4 -3
  26. package/dist/document-models/network-profile/src/reducers/network-profile-management.js +11 -11
  27. package/dist/document-models/network-profile/src/tests/document-model.test.js +1 -1
  28. package/dist/document-models/network-profile/src/tests/network-profile-management.test.js +1 -0
  29. package/dist/document-models/payment-terms/gen/clauses/actions.js +1 -1
  30. package/dist/document-models/payment-terms/gen/clauses/creators.js +2 -1
  31. package/dist/document-models/payment-terms/gen/clauses/operations.js +3 -1
  32. package/dist/document-models/payment-terms/gen/document-model.d.ts +2 -2
  33. package/dist/document-models/payment-terms/gen/document-model.d.ts.map +1 -1
  34. package/dist/document-models/payment-terms/gen/index.d.ts +0 -2
  35. package/dist/document-models/payment-terms/gen/index.d.ts.map +1 -1
  36. package/dist/document-models/payment-terms/gen/index.js +0 -1
  37. package/dist/document-models/payment-terms/gen/milestones/actions.js +1 -1
  38. package/dist/document-models/payment-terms/gen/milestones/creators.js +2 -1
  39. package/dist/document-models/payment-terms/gen/milestones/operations.js +3 -1
  40. package/dist/document-models/payment-terms/gen/ph-factories.d.ts +6 -10
  41. package/dist/document-models/payment-terms/gen/ph-factories.d.ts.map +1 -1
  42. package/dist/document-models/payment-terms/gen/ph-factories.js +1 -4
  43. package/dist/document-models/payment-terms/gen/reducer.d.ts +2 -2
  44. package/dist/document-models/payment-terms/gen/reducer.d.ts.map +1 -1
  45. package/dist/document-models/payment-terms/gen/reducer.js +1 -4
  46. package/dist/document-models/payment-terms/gen/terms/actions.js +1 -1
  47. package/dist/document-models/payment-terms/gen/terms/creators.js +2 -1
  48. package/dist/document-models/payment-terms/gen/terms/operations.js +3 -1
  49. package/dist/document-models/payment-terms/gen/types.d.ts +9 -6
  50. package/dist/document-models/payment-terms/gen/types.d.ts.map +1 -1
  51. package/dist/document-models/payment-terms/gen/types.js +1 -0
  52. package/dist/document-models/payment-terms/gen/utils.d.ts +9 -19
  53. package/dist/document-models/payment-terms/gen/utils.d.ts.map +1 -1
  54. package/dist/document-models/payment-terms/gen/utils.js +26 -34
  55. package/dist/document-models/payment-terms/index.d.ts +10 -4
  56. package/dist/document-models/payment-terms/index.d.ts.map +1 -1
  57. package/dist/document-models/payment-terms/index.js +4 -3
  58. package/dist/document-models/payment-terms/src/tests/document-model.test.js +1 -1
  59. package/dist/document-models/request-for-proposals/gen/contex-document/actions.js +1 -1
  60. package/dist/document-models/request-for-proposals/gen/contex-document/creators.js +2 -1
  61. package/dist/document-models/request-for-proposals/gen/contex-document/operations.js +3 -1
  62. package/dist/document-models/request-for-proposals/gen/document-model.d.ts +2 -2
  63. package/dist/document-models/request-for-proposals/gen/document-model.d.ts.map +1 -1
  64. package/dist/document-models/request-for-proposals/gen/index.d.ts +0 -2
  65. package/dist/document-models/request-for-proposals/gen/index.d.ts.map +1 -1
  66. package/dist/document-models/request-for-proposals/gen/index.js +0 -1
  67. package/dist/document-models/request-for-proposals/gen/ph-factories.d.ts +6 -10
  68. package/dist/document-models/request-for-proposals/gen/ph-factories.d.ts.map +1 -1
  69. package/dist/document-models/request-for-proposals/gen/ph-factories.js +4 -7
  70. package/dist/document-models/request-for-proposals/gen/proposals/actions.js +1 -1
  71. package/dist/document-models/request-for-proposals/gen/proposals/creators.js +2 -1
  72. package/dist/document-models/request-for-proposals/gen/proposals/operations.js +3 -1
  73. package/dist/document-models/request-for-proposals/gen/reducer.d.ts +2 -2
  74. package/dist/document-models/request-for-proposals/gen/reducer.d.ts.map +1 -1
  75. package/dist/document-models/request-for-proposals/gen/reducer.js +1 -4
  76. package/dist/document-models/request-for-proposals/gen/rfp-state/actions.js +1 -1
  77. package/dist/document-models/request-for-proposals/gen/rfp-state/creators.js +2 -1
  78. package/dist/document-models/request-for-proposals/gen/rfp-state/operations.js +3 -1
  79. package/dist/document-models/request-for-proposals/gen/types.d.ts +9 -6
  80. package/dist/document-models/request-for-proposals/gen/types.d.ts.map +1 -1
  81. package/dist/document-models/request-for-proposals/gen/types.js +1 -0
  82. package/dist/document-models/request-for-proposals/gen/utils.d.ts +9 -19
  83. package/dist/document-models/request-for-proposals/gen/utils.d.ts.map +1 -1
  84. package/dist/document-models/request-for-proposals/gen/utils.js +28 -36
  85. package/dist/document-models/request-for-proposals/index.d.ts +10 -4
  86. package/dist/document-models/request-for-proposals/index.d.ts.map +1 -1
  87. package/dist/document-models/request-for-proposals/index.js +4 -3
  88. package/dist/document-models/request-for-proposals/src/tests/contex-document.test.js +1 -0
  89. package/dist/document-models/request-for-proposals/src/tests/document-model.test.js +1 -1
  90. package/dist/document-models/request-for-proposals/src/tests/proposals.test.js +1 -0
  91. package/dist/document-models/request-for-proposals/src/tests/rfp-state.test.js +1 -0
  92. package/dist/document-models/workstream/gen/document-model.d.ts +2 -2
  93. package/dist/document-models/workstream/gen/document-model.d.ts.map +1 -1
  94. package/dist/document-models/workstream/gen/index.d.ts +0 -2
  95. package/dist/document-models/workstream/gen/index.d.ts.map +1 -1
  96. package/dist/document-models/workstream/gen/index.js +0 -1
  97. package/dist/document-models/workstream/gen/ph-factories.d.ts +6 -10
  98. package/dist/document-models/workstream/gen/ph-factories.d.ts.map +1 -1
  99. package/dist/document-models/workstream/gen/ph-factories.js +1 -4
  100. package/dist/document-models/workstream/gen/proposals/actions.js +1 -1
  101. package/dist/document-models/workstream/gen/proposals/creators.js +2 -1
  102. package/dist/document-models/workstream/gen/proposals/operations.js +3 -1
  103. package/dist/document-models/workstream/gen/reducer.d.ts +2 -2
  104. package/dist/document-models/workstream/gen/reducer.d.ts.map +1 -1
  105. package/dist/document-models/workstream/gen/reducer.js +1 -4
  106. package/dist/document-models/workstream/gen/types.d.ts +9 -6
  107. package/dist/document-models/workstream/gen/types.d.ts.map +1 -1
  108. package/dist/document-models/workstream/gen/types.js +1 -0
  109. package/dist/document-models/workstream/gen/utils.d.ts +9 -19
  110. package/dist/document-models/workstream/gen/utils.d.ts.map +1 -1
  111. package/dist/document-models/workstream/gen/utils.js +26 -34
  112. package/dist/document-models/workstream/gen/workstream/actions.js +1 -1
  113. package/dist/document-models/workstream/gen/workstream/creators.js +2 -1
  114. package/dist/document-models/workstream/gen/workstream/operations.js +3 -1
  115. package/dist/document-models/workstream/index.d.ts +10 -4
  116. package/dist/document-models/workstream/index.d.ts.map +1 -1
  117. package/dist/document-models/workstream/index.js +4 -3
  118. package/dist/document-models/workstream/src/tests/document-model.test.js +1 -1
  119. package/dist/document-models/workstream/src/tests/proposals-reducers.test.js +2 -0
  120. package/dist/document-models/workstream/src/tests/workstream-reducers.test.js +2 -0
  121. package/dist/editors/index.d.ts +1 -1
  122. package/dist/editors/index.d.ts.map +1 -1
  123. package/dist/editors/index.js +2 -1
  124. package/dist/editors/network-admin/components/CreateDocument.d.ts +6 -0
  125. package/dist/editors/network-admin/components/CreateDocument.d.ts.map +1 -0
  126. package/dist/editors/network-admin/components/CreateDocument.js +22 -0
  127. package/dist/editors/network-admin/components/DriveExplorer.d.ts +3 -4
  128. package/dist/editors/network-admin/components/DriveExplorer.d.ts.map +1 -1
  129. package/dist/editors/network-admin/components/DriveExplorer.js +34 -43
  130. package/dist/editors/network-admin/components/FolderTree.d.ts +6 -0
  131. package/dist/editors/network-admin/components/FolderTree.d.ts.map +1 -0
  132. package/dist/editors/network-admin/components/FolderTree.js +65 -0
  133. package/dist/editors/network-admin/components/icons/PaymentIcon.d.ts +1 -1
  134. package/dist/editors/network-admin/components/icons/PaymentIcon.d.ts.map +1 -1
  135. package/dist/editors/network-admin/components/icons/RfpIcon.d.ts +1 -1
  136. package/dist/editors/network-admin/components/icons/RfpIcon.d.ts.map +1 -1
  137. package/dist/editors/network-admin/components/icons/SowIcon.d.ts +1 -1
  138. package/dist/editors/network-admin/components/icons/SowIcon.d.ts.map +1 -1
  139. package/dist/editors/network-admin/components/icons/WorkstreamIcon.d.ts +1 -1
  140. package/dist/editors/network-admin/components/icons/WorkstreamIcon.d.ts.map +1 -1
  141. package/dist/editors/network-admin/config.d.ts +3 -0
  142. package/dist/editors/network-admin/config.d.ts.map +1 -0
  143. package/dist/editors/network-admin/config.js +11 -0
  144. package/dist/editors/network-admin/editor.d.ts +2 -3
  145. package/dist/editors/network-admin/editor.d.ts.map +1 -1
  146. package/dist/editors/network-admin/editor.js +7 -2
  147. package/dist/editors/network-admin/index.d.ts +2 -2
  148. package/dist/editors/network-admin/index.d.ts.map +1 -1
  149. package/dist/editors/network-admin/index.js +2 -14
  150. package/dist/editors/network-profile/editor.d.ts.map +1 -1
  151. package/dist/editors/network-profile/editor.js +37 -29
  152. package/dist/editors/network-profile/index.d.ts.map +1 -1
  153. package/dist/editors/network-profile/index.js +1 -3
  154. package/dist/editors/payment-terms/basic-terms-tab.d.ts +1 -1
  155. package/dist/editors/payment-terms/basic-terms-tab.d.ts.map +1 -1
  156. package/dist/editors/payment-terms/basic-terms-tab.js +6 -5
  157. package/dist/editors/payment-terms/clauses-tab.d.ts +2 -2
  158. package/dist/editors/payment-terms/clauses-tab.d.ts.map +1 -1
  159. package/dist/editors/payment-terms/clauses-tab.js +31 -26
  160. package/dist/editors/payment-terms/cost-materials-tab.d.ts +1 -1
  161. package/dist/editors/payment-terms/cost-materials-tab.d.ts.map +1 -1
  162. package/dist/editors/payment-terms/cost-materials-tab.js +5 -4
  163. package/dist/editors/payment-terms/editor.d.ts.map +1 -1
  164. package/dist/editors/payment-terms/editor.js +10 -2
  165. package/dist/editors/payment-terms/escrow-tab.d.ts +1 -1
  166. package/dist/editors/payment-terms/escrow-tab.d.ts.map +1 -1
  167. package/dist/editors/payment-terms/escrow-tab.js +4 -3
  168. package/dist/editors/payment-terms/evaluation-tab.d.ts +1 -1
  169. package/dist/editors/payment-terms/evaluation-tab.d.ts.map +1 -1
  170. package/dist/editors/payment-terms/evaluation-tab.js +5 -4
  171. package/dist/editors/payment-terms/index.d.ts.map +1 -1
  172. package/dist/editors/payment-terms/index.js +1 -3
  173. package/dist/editors/payment-terms/milestones-tab.d.ts +1 -1
  174. package/dist/editors/payment-terms/milestones-tab.d.ts.map +1 -1
  175. package/dist/editors/payment-terms/milestones-tab.js +8 -6
  176. package/dist/editors/payment-terms/retainer-tab.d.ts +1 -1
  177. package/dist/editors/payment-terms/retainer-tab.d.ts.map +1 -1
  178. package/dist/editors/payment-terms/retainer-tab.js +5 -4
  179. package/dist/editors/request-for-proposals/editor.d.ts.map +1 -1
  180. package/dist/editors/request-for-proposals/editor.js +58 -48
  181. package/dist/editors/request-for-proposals/index.d.ts.map +1 -1
  182. package/dist/editors/request-for-proposals/index.js +1 -3
  183. package/dist/editors/workstream/editor.d.ts.map +1 -1
  184. package/dist/editors/workstream/editor.js +288 -258
  185. package/dist/editors/workstream/index.d.ts.map +1 -1
  186. package/dist/editors/workstream/index.js +1 -3
  187. package/dist/editors/workstream/project-management-import.d.ts +3 -0
  188. package/dist/editors/workstream/project-management-import.d.ts.map +1 -0
  189. package/dist/editors/workstream/project-management-import.js +5 -0
  190. package/dist/index.d.ts +3 -3
  191. package/dist/index.d.ts.map +1 -1
  192. package/dist/powerhouse.manifest.json +9 -83
  193. package/dist/processors/factory.d.ts +1 -1
  194. package/dist/processors/factory.d.ts.map +1 -1
  195. package/dist/processors/factory.js +2 -0
  196. package/dist/processors/index.js +1 -0
  197. package/dist/processors/workstreams/factory.d.ts +1 -1
  198. package/dist/processors/workstreams/factory.d.ts.map +1 -1
  199. package/dist/processors/workstreams/factory.js +3 -0
  200. package/dist/processors/workstreams/index.d.ts +2 -2
  201. package/dist/processors/workstreams/index.d.ts.map +1 -1
  202. package/dist/processors/workstreams/index.js +6 -2
  203. package/dist/processors/workstreams/migrations.d.ts +1 -1
  204. package/dist/processors/workstreams/migrations.d.ts.map +1 -1
  205. package/dist/processors/workstreams/migrations.js +2 -1
  206. package/dist/scripts/sow-mirror/mirror_sow_state.js +4 -4
  207. package/dist/style.css +1969 -18106
  208. package/dist/subgraphs/index.js +1 -0
  209. package/dist/subgraphs/network-profile/index.d.ts +2 -2
  210. package/dist/subgraphs/network-profile/index.d.ts.map +1 -1
  211. package/dist/subgraphs/network-profile/index.js +2 -2
  212. package/dist/subgraphs/network-profile/resolvers.d.ts +2 -2
  213. package/dist/subgraphs/network-profile/resolvers.d.ts.map +1 -1
  214. package/dist/subgraphs/network-profile/resolvers.js +1 -0
  215. package/dist/subgraphs/networks/index.d.ts +2 -2
  216. package/dist/subgraphs/networks/index.d.ts.map +1 -1
  217. package/dist/subgraphs/networks/index.js +2 -2
  218. package/dist/subgraphs/networks/resolvers.d.ts +2 -2
  219. package/dist/subgraphs/networks/resolvers.d.ts.map +1 -1
  220. package/dist/subgraphs/networks/resolvers.js +1 -0
  221. package/dist/subgraphs/payment-terms/index.d.ts +2 -2
  222. package/dist/subgraphs/payment-terms/index.d.ts.map +1 -1
  223. package/dist/subgraphs/payment-terms/index.js +2 -2
  224. package/dist/subgraphs/payment-terms/resolvers.d.ts +2 -2
  225. package/dist/subgraphs/payment-terms/resolvers.d.ts.map +1 -1
  226. package/dist/subgraphs/payment-terms/resolvers.js +1 -0
  227. package/dist/subgraphs/request-for-proposals/index.d.ts +2 -2
  228. package/dist/subgraphs/request-for-proposals/index.d.ts.map +1 -1
  229. package/dist/subgraphs/request-for-proposals/index.js +2 -2
  230. package/dist/subgraphs/request-for-proposals/resolvers.d.ts +2 -2
  231. package/dist/subgraphs/request-for-proposals/resolvers.d.ts.map +1 -1
  232. package/dist/subgraphs/request-for-proposals/resolvers.js +1 -0
  233. package/dist/subgraphs/workstream/index.d.ts +2 -2
  234. package/dist/subgraphs/workstream/index.d.ts.map +1 -1
  235. package/dist/subgraphs/workstream/index.js +2 -2
  236. package/dist/subgraphs/workstream/resolvers.d.ts +2 -2
  237. package/dist/subgraphs/workstream/resolvers.d.ts.map +1 -1
  238. package/dist/subgraphs/workstream/resolvers.js +1 -0
  239. package/dist/subgraphs/workstreams/index.d.ts +2 -2
  240. package/dist/subgraphs/workstreams/index.d.ts.map +1 -1
  241. package/dist/subgraphs/workstreams/index.js +2 -2
  242. package/dist/subgraphs/workstreams/resolvers.d.ts +2 -2
  243. package/dist/subgraphs/workstreams/resolvers.d.ts.map +1 -1
  244. package/dist/subgraphs/workstreams/resolvers.js +3 -0
  245. package/dist/vite.config.d.ts +3 -0
  246. package/dist/vite.config.d.ts.map +1 -0
  247. package/dist/vite.config.js +11 -0
  248. package/package.json +56 -37
  249. package/dist/document-models/network-profile/gen/network-profile-management/object.d.ts +0 -17
  250. package/dist/document-models/network-profile/gen/network-profile-management/object.d.ts.map +0 -1
  251. package/dist/document-models/network-profile/gen/network-profile-management/object.js +0 -37
  252. package/dist/document-models/network-profile/gen/object.d.ts +0 -15
  253. package/dist/document-models/network-profile/gen/object.d.ts.map +0 -1
  254. package/dist/document-models/network-profile/gen/object.js +0 -25
  255. package/dist/document-models/network-profile/ph-factories.d.ts +0 -27
  256. package/dist/document-models/network-profile/ph-factories.d.ts.map +0 -1
  257. package/dist/document-models/network-profile/ph-factories.js +0 -60
  258. package/dist/document-models/payment-terms/gen/clauses/object.d.ts +0 -12
  259. package/dist/document-models/payment-terms/gen/clauses/object.d.ts.map +0 -1
  260. package/dist/document-models/payment-terms/gen/clauses/object.js +0 -22
  261. package/dist/document-models/payment-terms/gen/milestones/object.d.ts +0 -11
  262. package/dist/document-models/payment-terms/gen/milestones/object.d.ts.map +0 -1
  263. package/dist/document-models/payment-terms/gen/milestones/object.js +0 -19
  264. package/dist/document-models/payment-terms/gen/object.d.ts +0 -19
  265. package/dist/document-models/payment-terms/gen/object.d.ts.map +0 -1
  266. package/dist/document-models/payment-terms/gen/object.js +0 -33
  267. package/dist/document-models/payment-terms/gen/terms/object.d.ts +0 -12
  268. package/dist/document-models/payment-terms/gen/terms/object.d.ts.map +0 -1
  269. package/dist/document-models/payment-terms/gen/terms/object.js +0 -22
  270. package/dist/document-models/payment-terms/ph-factories.d.ts +0 -27
  271. package/dist/document-models/payment-terms/ph-factories.d.ts.map +0 -1
  272. package/dist/document-models/payment-terms/ph-factories.js +0 -62
  273. package/dist/document-models/request-for-proposals/gen/contex-document/object.d.ts +0 -8
  274. package/dist/document-models/request-for-proposals/gen/contex-document/object.d.ts.map +0 -1
  275. package/dist/document-models/request-for-proposals/gen/contex-document/object.js +0 -10
  276. package/dist/document-models/request-for-proposals/gen/object.d.ts +0 -19
  277. package/dist/document-models/request-for-proposals/gen/object.d.ts.map +0 -1
  278. package/dist/document-models/request-for-proposals/gen/object.js +0 -33
  279. package/dist/document-models/request-for-proposals/gen/proposals/object.d.ts +0 -9
  280. package/dist/document-models/request-for-proposals/gen/proposals/object.d.ts.map +0 -1
  281. package/dist/document-models/request-for-proposals/gen/proposals/object.js +0 -13
  282. package/dist/document-models/request-for-proposals/gen/rfp-state/object.d.ts +0 -7
  283. package/dist/document-models/request-for-proposals/gen/rfp-state/object.d.ts.map +0 -1
  284. package/dist/document-models/request-for-proposals/gen/rfp-state/object.js +0 -7
  285. package/dist/document-models/request-for-proposals/ph-factories.d.ts +0 -27
  286. package/dist/document-models/request-for-proposals/ph-factories.d.ts.map +0 -1
  287. package/dist/document-models/request-for-proposals/ph-factories.js +0 -67
  288. package/dist/document-models/workstream/gen/object.d.ts +0 -17
  289. package/dist/document-models/workstream/gen/object.d.ts.map +0 -1
  290. package/dist/document-models/workstream/gen/object.js +0 -27
  291. package/dist/document-models/workstream/gen/proposals/object.d.ts +0 -10
  292. package/dist/document-models/workstream/gen/proposals/object.d.ts.map +0 -1
  293. package/dist/document-models/workstream/gen/proposals/object.js +0 -16
  294. package/dist/document-models/workstream/gen/workstream/object.d.ts +0 -11
  295. package/dist/document-models/workstream/gen/workstream/object.d.ts.map +0 -1
  296. package/dist/document-models/workstream/gen/workstream/object.js +0 -19
  297. package/dist/document-models/workstream/ph-factories.d.ts +0 -27
  298. package/dist/document-models/workstream/ph-factories.d.ts.map +0 -1
  299. package/dist/document-models/workstream/ph-factories.js +0 -59
  300. package/dist/editors/network-admin/utils/withDropZone.d.ts +0 -4
  301. package/dist/editors/network-admin/utils/withDropZone.d.ts.map +0 -1
  302. package/dist/editors/network-admin/utils/withDropZone.js +0 -19
@@ -3,11 +3,12 @@ import { Button, toast, ToastContainer } from "@powerhousedao/design-system";
3
3
  import { TextInput, Select, OIDInput, PHIDInput, ObjectSetTable, buildEnumCellEditor, } from "@powerhousedao/document-engineering";
4
4
  import { actions, } from "../../document-models/workstream/index.js";
5
5
  import { actions as rfpActions, } from "../../document-models/request-for-proposals/index.js";
6
- import { ScopeOfWork } from "@powerhousedao/project-management/document-models";
7
- import { generateId } from "document-model";
8
- import { useDocumentById, useSelectedDrive, addDocument, useSelectedDriveDocuments, dispatchActions, } from "@powerhousedao/reactor-browser";
6
+ import { ScopeOfWork } from "./project-management-import.js";
7
+ import { generateId } from "document-model/core";
8
+ import { useDocumentById, useSelectedDrive, addDocument, useDocumentsInSelectedDrive, useParentFolderForSelectedNode, setSelectedNode, } from "@powerhousedao/reactor-browser";
9
9
  import { useEffect, useMemo, useState, useCallback } from "react";
10
10
  import { useSelectedWorkstreamDocument } from "../hooks/useWorkstreamDocument.js";
11
+ import { DocumentToolbar } from "@powerhousedao/design-system";
11
12
  // Status options for the dropdown
12
13
  const statusOptions = [
13
14
  { value: "RFP_DRAFT", label: "RFP Draft (RFP_DRAFT)" },
@@ -34,14 +35,43 @@ export default function Editor() {
34
35
  setState(doc.state.global);
35
36
  }, [doc.state.global]);
36
37
  const [selectedDrive] = useSelectedDrive();
38
+ const [newNode, setNewNode] = useState(null);
37
39
  // Local state to track newly created document IDs
38
40
  const [newlyCreatedSowId, setNewlyCreatedSowId] = useState(null);
39
41
  const [newlyCreatedPaymentTermsId, setNewlyCreatedPaymentTermsId] = useState(null);
40
42
  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
+ }
41
49
  // Loading states to prevent double-clicks
42
50
  const [isCreatingRfp, setIsCreatingRfp] = useState(false);
43
51
  const [isCreatingSow, setIsCreatingSow] = useState(false);
44
52
  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]);
45
75
  const createRfpDocument = useCallback(async () => {
46
76
  if (isCreatingRfp)
47
77
  return null; // Prevent double-calls
@@ -50,9 +80,7 @@ export default function Editor() {
50
80
  const createdNode = await addDocument(selectedDrive?.header.id || "", `RFP-${state.title || ""}`, "powerhouse/rfp", undefined, undefined, undefined, "request-for-proposals-editor");
51
81
  console.log("Created RFP document", createdNode);
52
82
  if (createdNode) {
53
- await dispatchActions(rfpActions.editRfp({
54
- title: `RFP-${state.title || ""}`,
55
- }), createdNode.id);
83
+ setNewNode(createdNode);
56
84
  }
57
85
  return createdNode;
58
86
  }
@@ -72,9 +100,7 @@ export default function Editor() {
72
100
  const createdNode = await addDocument(selectedDrive?.header.id || "", `SOW-${state.title || ""}`, "powerhouse/scopeofwork", undefined, undefined, undefined, "scope-of-work-editor");
73
101
  console.log("Created SOW document", createdNode);
74
102
  if (createdNode) {
75
- await dispatchActions(ScopeOfWork.actions.editScopeOfWork({
76
- title: `SOW-${state.title || ""}`,
77
- }), createdNode.id);
103
+ setNewNode(createdNode);
78
104
  }
79
105
  return createdNode;
80
106
  }
@@ -129,7 +155,7 @@ export default function Editor() {
129
155
  setNewlyCreatedRfpId(null);
130
156
  }
131
157
  }, [state.rfp?.id, newlyCreatedRfpId]);
132
- const allDocuments = useSelectedDriveDocuments();
158
+ const allDocuments = useDocumentsInSelectedDrive();
133
159
  let rfpDocumentNode = undefined;
134
160
  if (state.rfp?.id) {
135
161
  rfpDocumentNode = allDocuments?.find((doc) => {
@@ -264,7 +290,7 @@ export default function Editor() {
264
290
  return;
265
291
  }
266
292
  const clientId = state.client?.id || generateId();
267
- let clientInfoUpdate = {
293
+ const clientInfoUpdate = {
268
294
  clientId,
269
295
  };
270
296
  if (field === "name") {
@@ -535,272 +561,276 @@ export default function Editor() {
535
561
  searchPaymentTermsDocuments,
536
562
  searchSowDocuments,
537
563
  ]);
538
- return (_jsx("div", { className: "w-full bg-gray-50", children: _jsxs("div", { className: "p-6 max-w-4xl mx-auto min-h-screen", children: [_jsx("div", { className: "bg-white rounded-lg p-6 mb-6 shadow-sm", children: _jsx("h1", { className: "text-3xl font-bold text-gray-900 mb-2", children: "Workstream" }) }), _jsx("div", { className: "bg-white rounded-lg p-6 mb-6 shadow-sm", children: _jsxs("div", { className: "flex flex-row gap-6", children: [_jsxs("div", { className: "flex-1", children: [_jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Code" }), _jsx(TextInput, { className: "w-full", defaultValue: state.code || "", onBlur: (e) => {
539
- if (e.target.value !== state.code) {
540
- handleWorkstreamChange("code", e.target.value);
564
+ 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
+ if (e.target.value !== state.code) {
566
+ handleWorkstreamChange("code", e.target.value);
567
+ }
568
+ }, placeholder: "Enter workstream code" })] }), _jsxs("div", { className: "flex-1", children: [_jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Title" }), _jsx(TextInput, { className: "w-full", defaultValue: state.title || "", onBlur: (e) => {
569
+ if (e.target.value !== state.title) {
570
+ handleWorkstreamChange("title", e.target.value);
571
+ }
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 ID" }), _jsxs("div", { className: "flex items-center space-x-2", children: [_jsx("div", { className: "flex-shrink-0", children: _jsx("svg", { className: "w-5 h-5 text-gray-400", fill: "currentColor", viewBox: "0 0 20 20", children: _jsx("path", { fillRule: "evenodd", d: "M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z", clipRule: "evenodd" }) }) }), _jsx(TextInput, { className: "flex-1", defaultValue: state.client?.id || "", onBlur: (e) => {
573
+ if (e.target.value !== state.client?.id) {
574
+ handleClientIdChange(e.target.value);
575
+ }
576
+ }, placeholder: "Enter client ID" }), _jsx("div", { className: "flex-shrink-0", children: _jsx("svg", { className: "w-5 h-5 text-gray-400", fill: "currentColor", viewBox: "0 0 20 20", children: _jsx("path", { fillRule: "evenodd", d: "M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z", clipRule: "evenodd" }) }) })] })] }), _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
+ if (e.target.value !== state.client?.name) {
578
+ handleClientChange("name", e.target.value);
579
+ }
580
+ }, placeholder: "Enter client name" })] }), _jsxs("div", { children: [_jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Icon" }), _jsxs("div", { className: "flex items-center space-x-2", children: [_jsx("div", { className: "flex-shrink-0", children: _jsx("svg", { className: "w-5 h-5 text-gray-400", fill: "currentColor", viewBox: "0 0 20 20", children: _jsx("path", { fillRule: "evenodd", d: "M4.083 9h1.946c.089-1.546.383-2.97.837-4.118A6.004 6.004 0 004.083 9zM10 2a8 8 0 100 16 8 8 0 000-16zm0 2c-.076 0-.232.032-.465.262-.238.234-.497.623-.737 1.182-.389.907-.673 2.142-.766 3.556h3.936c-.093-1.414-.377-2.649-.766-3.556-.24-.56-.5-.948-.737-1.182C10.232 4.032 10.076 4 10 4zm3.971 5c-.089-1.546-.383-2.97-.837-4.118A6.004 6.004 0 0115.917 9h-1.946zm-2.003 2H8.032c.093 1.414.377 2.649.766 3.556.24.56.5.948.737 1.182.233.23.389.262.465.262.076 0 .232-.032.465-.262.238-.234.498-.623.737-1.182.389-.907.673-2.142.766-3.556zm1.166 4.118c.454-1.147.748-2.572.837-4.118h1.946a6.004 6.004 0 01-2.783 4.118zm-6.268 0C6.412 13.97 6.118 12.546 6.03 11H4.083a6.004 6.004 0 002.783 4.118z", clipRule: "evenodd" }) }) }), _jsxs("div", { className: "flex items-center space-x-2", children: [_jsx(TextInput, { className: "flex-1", defaultValue: state.client?.icon || "", onBlur: (e) => {
581
+ if (e.target.value !== state.client?.icon) {
582
+ handleClientChange("icon", e.target.value);
583
+ }
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: "withValueTitleAndDescription", value: newlyCreatedRfpId || state.rfp?.id || "", onBlur: (e) => {
585
+ if (e.target.value !== state.rfp?.id) {
586
+ dispatch(actions.setRequestForProposal({
587
+ rfpId: e.target.value,
588
+ title: rfpDocument?.document.title || "",
589
+ }));
541
590
  }
542
- }, placeholder: "Enter workstream code" })] }), _jsxs("div", { className: "flex-1", children: [_jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Title" }), _jsx(TextInput, { className: "w-full", defaultValue: state.title || "", onBlur: (e) => {
543
- if (e.target.value !== state.title) {
544
- handleWorkstreamChange("title", e.target.value);
591
+ },
592
+ // search options as the user types
593
+ fetchOptionsCallback: async (userInput) => {
594
+ const results = searchRfpDocuments(userInput || "") || [];
595
+ if (results?.length === 0) {
596
+ return Promise.reject(new Error("No RFP documents found"));
545
597
  }
546
- }, 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 ID" }), _jsxs("div", { className: "flex items-center space-x-2", children: [_jsx("div", { className: "flex-shrink-0", children: _jsx("svg", { className: "w-5 h-5 text-gray-400", fill: "currentColor", viewBox: "0 0 20 20", children: _jsx("path", { fillRule: "evenodd", d: "M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z", clipRule: "evenodd" }) }) }), _jsx(TextInput, { className: "flex-1", defaultValue: state.client?.id || "", onBlur: (e) => {
547
- if (e.target.value !== state.client?.id) {
548
- handleClientIdChange(e.target.value);
549
- }
550
- }, placeholder: "Enter client ID" }), _jsx("div", { className: "flex-shrink-0", children: _jsx("svg", { className: "w-5 h-5 text-gray-400", fill: "currentColor", viewBox: "0 0 20 20", children: _jsx("path", { fillRule: "evenodd", d: "M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z", clipRule: "evenodd" }) }) })] })] }), _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) => {
551
- if (e.target.value !== state.client?.name) {
552
- handleClientChange("name", e.target.value);
553
- }
554
- }, placeholder: "Enter client name" })] }), _jsxs("div", { children: [_jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Icon" }), _jsxs("div", { className: "flex items-center space-x-2", children: [_jsx("div", { className: "flex-shrink-0", children: _jsx("svg", { className: "w-5 h-5 text-gray-400", fill: "currentColor", viewBox: "0 0 20 20", children: _jsx("path", { fillRule: "evenodd", d: "M4.083 9h1.946c.089-1.546.383-2.97.837-4.118A6.004 6.004 0 004.083 9zM10 2a8 8 0 100 16 8 8 0 000-16zm0 2c-.076 0-.232.032-.465.262-.238.234-.497.623-.737 1.182-.389.907-.673 2.142-.766 3.556h3.936c-.093-1.414-.377-2.649-.766-3.556-.24-.56-.5-.948-.737-1.182C10.232 4.032 10.076 4 10 4zm3.971 5c-.089-1.546-.383-2.97-.837-4.118A6.004 6.004 0 0115.917 9h-1.946zm-2.003 2H8.032c.093 1.414.377 2.649.766 3.556.24.56.5.948.737 1.182.233.23.389.262.465.262.076 0 .232-.032.465-.262.238-.234.498-.623.737-1.182.389-.907.673-2.142.766-3.556zm1.166 4.118c.454-1.147.748-2.572.837-4.118h1.946a6.004 6.004 0 01-2.783 4.118zm-6.268 0C6.412 13.97 6.118 12.546 6.03 11H4.083a6.004 6.004 0 002.783 4.118z", clipRule: "evenodd" }) }) }), _jsxs("div", { className: "flex items-center space-x-2", children: [_jsx(TextInput, { className: "flex-1", defaultValue: state.client?.icon || "", onBlur: (e) => {
555
- if (e.target.value !== state.client?.icon) {
556
- handleClientChange("icon", e.target.value);
557
- }
558
- }, placeholder: "Enter client icon URL" }), state.client?.icon ? (_jsx("img", { src: state.client?.icon, alt: "Client Icon", className: "w-10 h-10 object-cover" })) : ("")] })] })] })] })] }), _jsxs("div", { className: "bg-white rounded-lg p-6 mt-6 mb-6 shadow-sm", children: [_jsx("h1", { className: "text-2xl text-gray-900 mb-4", children: "Request for Proposal" }), _jsx("div", { className: "w-full flex flex-row items-center gap-8", children: _jsx("div", { className: "w-[350px]", children: _jsx(OIDInput, { name: "Request for Proposal", label: "RFP Document", placeholder: "Search for RFP Document", variant: "withValueTitleAndDescription", value: newlyCreatedRfpId || state.rfp?.id || "", onBlur: (e) => {
559
- if (e.target.value !== state.rfp?.id) {
560
- dispatch(actions.setRequestForProposal({
561
- rfpId: e.target.value,
598
+ return results?.map((doc) => ({
599
+ value: doc.value, // unique document ID
600
+ title: doc.title, // document title or name
601
+ path: {
602
+ text: doc.path,
603
+ url: doc.value,
604
+ }, // document path or location
605
+ description: "", // document description or summary
606
+ icon: "File", // document icon
607
+ }));
608
+ },
609
+ // get details of a specific option by its ID/value
610
+ fetchSelectedOptionCallback: async (documentId) => {
611
+ console.log("fetching selected option", documentId);
612
+ const doc = searchRfpDocuments(documentId)?.[0];
613
+ if (!doc) {
614
+ return Promise.reject(new Error("RFP document not found"));
615
+ }
616
+ return {
617
+ value: doc.value,
618
+ title: doc.title,
619
+ path: {
620
+ text: doc.path,
621
+ url: doc.title,
622
+ },
623
+ description: "",
624
+ icon: "File",
625
+ };
626
+ }, initialOptions: [
627
+ {
628
+ value: rfpDocument?.header.id || "",
562
629
  title: rfpDocument?.document.title || "",
630
+ path: {
631
+ text: rfpDocument?.document.title || "",
632
+ url: rfpDocument?.header.id || "",
633
+ },
634
+ description: "",
635
+ icon: "File",
636
+ },
637
+ ] }) }) }), !rfpDocument ? (_jsx("div", { className: "mt-4", children: _jsx(Button, { color: "light",
638
+ // size="sm"
639
+ 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: async () => {
640
+ const createdNode = await createRfpDocument();
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,
563
647
  }));
564
648
  }
565
- },
566
- // search options as the user types
567
- fetchOptionsCallback: async (userInput) => {
568
- const results = searchRfpDocuments(userInput || "") || [];
569
- if (results?.length === 0) {
570
- return Promise.reject(new Error("No RFP documents found"));
571
- }
572
- return results?.map((doc) => ({
573
- value: doc.value, // unique document ID
574
- title: doc.title, // document title or name
575
- path: {
576
- text: doc.path,
577
- url: doc.value,
578
- }, // document path or location
579
- description: "", // document description or summary
580
- icon: "File", // document icon
581
- }));
582
- },
583
- // get details of a specific option by its ID/value
584
- fetchSelectedOptionCallback: async (documentId) => {
585
- console.log("fetching selected option", documentId);
586
- const doc = searchRfpDocuments(documentId)?.[0];
587
- if (!doc) {
588
- return Promise.reject(new Error("RFP document not found"));
589
- }
590
- return {
591
- value: doc.value,
592
- title: doc.title,
593
- path: {
594
- text: doc.path,
595
- url: doc.title,
596
- },
597
- description: "",
598
- icon: "File",
599
- };
600
- }, initialOptions: [
601
- {
602
- value: rfpDocument?.header.id || "",
603
- title: rfpDocument?.document.title || "",
604
- path: {
605
- text: rfpDocument?.document.title || "",
606
- url: rfpDocument?.header.id || "",
607
- },
608
- description: "",
609
- icon: "File",
610
- },
611
- ] }) }) }), !rfpDocument ? (_jsx("div", { className: "mt-4", children: _jsx(Button, { color: "light", size: "small", 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: async () => {
612
- const createdNode = await createRfpDocument();
613
- if (createdNode) {
614
- // Set local state to immediately show the new RFP ID
615
- setNewlyCreatedRfpId(createdNode.id);
616
- dispatch(actions.setRequestForProposal({
617
- rfpId: createdNode.id,
618
- title: createdNode.name,
619
- }));
620
- }
621
- }, 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 ||
622
- state.initialProposal?.author?.name ||
623
- "", onChange: (e) => {
624
- setManualAuthorInput(e.target.value);
625
- }, onBlur: (e) => {
626
- if (e.target.value !== state.initialProposal?.author?.name) {
627
- dispatch(actions.editInitialProposal({
628
- id: state.initialProposal?.id || "",
629
- proposalAuthor: {
630
- id: generateId(),
631
- name: e.target.value,
632
- },
633
- }));
634
- }
635
- } }) }), _jsx("div", { className: "flex-1", children: _jsx(Select, { label: "Status", options: [
636
- { value: "DRAFT", label: "Draft" },
637
- { value: "SUBMITTED", label: "Submitted" },
638
- { value: "ACCEPTED", label: "Accepted" },
639
- { value: "REJECTED", label: "Rejected" },
640
- ], value: state.initialProposal.status || "DRAFT", onChange: (value) => {
641
- if (value !== state.initialProposal?.status) {
642
- dispatch(actions.editInitialProposal({
643
- id: state.initialProposal?.id || "",
644
- status: value,
645
- }));
646
- }
647
- } }) })] }), _jsxs("div", { className: "flex flex-row gap-4 mb-6", children: [_jsxs("div", { className: "flex-1", children: [_jsx(OIDInput, { name: "Scope of Work", label: "Scope Of Work", placeholder: "Search for SOW Document", variant: "withValueTitleAndDescription", value: newlyCreatedSowId || state.initialProposal?.sow || "", onBlur: (e) => {
648
- if (e.target.value !== state.initialProposal?.sow) {
649
+ }, 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
+ state.initialProposal?.author?.name ||
651
+ "", onChange: (e) => {
652
+ setManualAuthorInput(e.target.value);
653
+ }, onBlur: (e) => {
654
+ if (e.target.value !== state.initialProposal?.author?.name) {
649
655
  dispatch(actions.editInitialProposal({
650
656
  id: state.initialProposal?.id || "",
651
- sowId: e.target.value,
657
+ proposalAuthor: {
658
+ id: generateId(),
659
+ name: e.target.value,
660
+ },
652
661
  }));
653
662
  }
654
- },
655
- // search options as the user types
656
- fetchOptionsCallback: async (userInput) => {
657
- const results = searchSowDocuments(userInput || "") || [];
658
- if (results?.length === 0) {
659
- return Promise.reject(new Error("No SOW documents found"));
660
- }
661
- return results?.map((doc) => ({
662
- value: doc.value, // unique document ID
663
- title: doc.title, // document title or name
664
- path: {
665
- text: doc.path,
666
- url: doc.value,
667
- }, // document path or location
668
- description: "", // document description or summary
669
- icon: "File", // document icon
670
- }));
671
- },
672
- // get details of a specific option by its ID/value
673
- fetchSelectedOptionCallback: async (documentId) => {
674
- const doc = searchSowDocuments(documentId)?.[0];
675
- if (!doc) {
676
- return Promise.reject(new Error("SOW document not found"));
663
+ } }) }), _jsx("div", { className: "flex-1", children: _jsx(Select, { label: "Status", options: [
664
+ { value: "DRAFT", label: "Draft" },
665
+ { value: "SUBMITTED", label: "Submitted" },
666
+ { value: "ACCEPTED", label: "Accepted" },
667
+ { value: "REJECTED", label: "Rejected" },
668
+ ], value: state.initialProposal.status || "DRAFT", onChange: (value) => {
669
+ if (value !== state.initialProposal?.status) {
670
+ dispatch(actions.editInitialProposal({
671
+ id: state.initialProposal?.id || "",
672
+ status: value,
673
+ }));
677
674
  }
678
- return {
679
- value: doc.value,
680
- title: doc.title,
681
- path: {
682
- text: doc.path,
683
- url: doc.title,
684
- },
685
- description: "",
686
- icon: "File",
687
- };
688
- }, initialOptions: sowDocumentNode
689
- ? [
690
- {
691
- value: sowDocumentNode.header.id,
692
- title: sowDocumentNode.state?.global?.title ||
693
- sowDocumentNode.header.name,
675
+ } }) })] }), _jsxs("div", { className: "flex flex-row gap-4 mb-6", children: [_jsxs("div", { className: "flex-1", children: [_jsx(OIDInput, { name: "Scope of Work", label: "Scope Of Work", placeholder: "Search for SOW Document", variant: "withValueTitleAndDescription", value: newlyCreatedSowId || state.initialProposal?.sow || "", onBlur: (e) => {
676
+ if (e.target.value !== state.initialProposal?.sow) {
677
+ dispatch(actions.editInitialProposal({
678
+ id: state.initialProposal?.id || "",
679
+ sowId: e.target.value,
680
+ }));
681
+ }
682
+ },
683
+ // search options as the user types
684
+ fetchOptionsCallback: async (userInput) => {
685
+ const results = searchSowDocuments(userInput || "") || [];
686
+ if (results?.length === 0) {
687
+ return Promise.reject(new Error("No SOW documents found"));
688
+ }
689
+ return results?.map((doc) => ({
690
+ value: doc.value, // unique document ID
691
+ title: doc.title, // document title or name
694
692
  path: {
695
- text: sowDocumentNode.header.name,
696
- url: sowDocumentNode.header.id,
693
+ text: doc.path,
694
+ url: doc.value,
695
+ }, // document path or location
696
+ description: "", // document description or summary
697
+ icon: "File", // document icon
698
+ }));
699
+ },
700
+ // get details of a specific option by its ID/value
701
+ fetchSelectedOptionCallback: async (documentId) => {
702
+ const doc = searchSowDocuments(documentId)?.[0];
703
+ if (!doc) {
704
+ return Promise.reject(new Error("SOW document not found"));
705
+ }
706
+ return {
707
+ value: doc.value,
708
+ title: doc.title,
709
+ path: {
710
+ text: doc.path,
711
+ url: doc.title,
697
712
  },
698
713
  description: "",
699
714
  icon: "File",
700
- },
701
- ]
702
- : 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: async () => {
703
- console.log("Creating sow");
704
- const createdNode = await createSowDocument();
705
- if (createdNode) {
706
- // Set local state to immediately show the new SOW ID
707
- setNewlyCreatedSowId(createdNode.id);
708
- dispatch(actions.editInitialProposal({
709
- id: state.initialProposal?.id || "",
710
- sowId: createdNode.id,
711
- }));
712
- }
713
- }, 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 ||
714
- state.initialProposal?.paymentTerms ||
715
- "", onBlur: (e) => {
716
- if (e.target.value !== state.initialProposal?.paymentTerms) {
717
- dispatch(actions.editInitialProposal({
718
- id: state.initialProposal?.id || "",
719
- paymentTermsId: e.target.value,
715
+ };
716
+ }, initialOptions: sowDocumentNode
717
+ ? [
718
+ {
719
+ value: sowDocumentNode.header.id,
720
+ title: sowDocumentNode.state?.global?.title ||
721
+ sowDocumentNode.header.name,
722
+ path: {
723
+ text: sowDocumentNode.header.name,
724
+ url: sowDocumentNode.header.id,
725
+ },
726
+ description: "",
727
+ icon: "File",
728
+ },
729
+ ]
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: async () => {
731
+ console.log("Creating sow");
732
+ const createdNode = await createSowDocument();
733
+ if (createdNode) {
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
+ }));
740
+ }
741
+ }, 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
+ state.initialProposal?.paymentTerms ||
743
+ "", onBlur: (e) => {
744
+ if (e.target.value !== state.initialProposal?.paymentTerms) {
745
+ dispatch(actions.editInitialProposal({
746
+ id: state.initialProposal?.id || "",
747
+ paymentTermsId: e.target.value,
748
+ }));
749
+ }
750
+ },
751
+ // search options as the user types
752
+ fetchOptionsCallback: async (userInput) => {
753
+ const results = searchPaymentTermsDocuments(userInput || "") || [];
754
+ if (results?.length === 0) {
755
+ return Promise.reject(new Error("No Payment Terms documents found"));
756
+ }
757
+ return results?.map((doc) => ({
758
+ value: doc.value, // unique document ID
759
+ title: doc.title, // document title or name
760
+ path: {
761
+ text: doc.path,
762
+ url: doc.value,
763
+ }, // document path or location
764
+ description: "", // document description or summary
765
+ icon: "File", // document icon
720
766
  }));
721
- }
722
- },
723
- // search options as the user types
724
- fetchOptionsCallback: async (userInput) => {
725
- const results = searchPaymentTermsDocuments(userInput || "") || [];
726
- if (results?.length === 0) {
727
- return Promise.reject(new Error("No Payment Terms documents found"));
728
- }
729
- return results?.map((doc) => ({
730
- value: doc.value, // unique document ID
731
- title: doc.title, // document title or name
732
- path: {
733
- text: doc.path,
734
- url: doc.value,
735
- }, // document path or location
736
- description: "", // document description or summary
737
- icon: "File", // document icon
738
- }));
739
- },
740
- // get details of a specific option by its ID/value
741
- fetchSelectedOptionCallback: async (documentId) => {
742
- const doc = searchPaymentTermsDocuments(documentId)?.[0];
743
- if (!doc) {
744
- return Promise.reject(new Error("Payment Terms document not found"));
745
- }
746
- return {
747
- value: doc.value,
748
- title: doc.title,
749
- path: {
750
- text: doc.path,
751
- url: doc.title,
752
- },
753
- description: "",
754
- icon: "File",
755
- };
756
- }, initialOptions: paymentTermsDocumentNode
757
- ? [
758
- {
759
- value: paymentTermsDocumentNode.header.id,
760
- title: paymentTermsDocumentNode.header.name,
767
+ },
768
+ // get details of a specific option by its ID/value
769
+ fetchSelectedOptionCallback: async (documentId) => {
770
+ const doc = searchPaymentTermsDocuments(documentId)?.[0];
771
+ if (!doc) {
772
+ return Promise.reject(new Error("Payment Terms document not found"));
773
+ }
774
+ return {
775
+ value: doc.value,
776
+ title: doc.title,
761
777
  path: {
762
- text: paymentTermsDocumentNode.header.name,
763
- url: paymentTermsDocumentNode.header.id,
778
+ text: doc.path,
779
+ url: doc.title,
764
780
  },
765
781
  description: "",
766
782
  icon: "File",
767
- },
768
- ]
769
- : 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: async () => {
770
- console.log("Creating payment terms");
771
- const createdNode = await createPaymentTermsDocument();
772
- if (createdNode) {
773
- // Set local state to immediately show the new Payment Terms ID
774
- setNewlyCreatedPaymentTermsId(createdNode.id);
775
- dispatch(actions.editInitialProposal({
776
- id: state.initialProposal?.id || "",
777
- paymentTermsId: createdNode.id,
783
+ };
784
+ }, initialOptions: paymentTermsDocumentNode
785
+ ? [
786
+ {
787
+ value: paymentTermsDocumentNode.header.id,
788
+ title: paymentTermsDocumentNode.header.name,
789
+ path: {
790
+ text: paymentTermsDocumentNode.header.name,
791
+ url: paymentTermsDocumentNode.header.id,
792
+ },
793
+ description: "",
794
+ icon: "File",
795
+ },
796
+ ]
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: async () => {
798
+ console.log("Creating payment terms");
799
+ const createdNode = await createPaymentTermsDocument();
800
+ if (createdNode) {
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
+ }));
807
+ }
808
+ }, children: isCreatingPaymentTerms
809
+ ? "Creating..."
810
+ : "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
+ if (data.length > 0) {
812
+ data.forEach((d) => {
813
+ dispatch(actions.removeAlternativeProposal({
814
+ id: d.id,
778
815
  }));
779
- }
780
- }, children: isCreatingPaymentTerms
781
- ? "Creating..."
782
- : "Create Payment Terms" })] })] }), _jsxs("div", { children: [_jsx("h2", { className: "text-lg font-medium text-gray-900 mb-4", children: "Alternative Proposals" }), _jsx(ObjectSetTable, { columns: alternativeProposalsColumns, data: alternativeProposalsData, allowRowSelection: true, onDelete: (data) => {
783
- if (data.length > 0) {
784
- data.forEach((d) => {
785
- dispatch(actions.removeAlternativeProposal({
786
- id: d.id,
787
- }));
788
- });
789
- }
790
- }, onAdd: (data) => {
791
- if (data.authorName) {
792
- dispatch(actions.addAlternativeProposal({
793
- id: generateId(),
794
- proposalAuthor: {
816
+ });
817
+ }
818
+ }, onAdd: (data) => {
819
+ if (data.authorName) {
820
+ dispatch(actions.addAlternativeProposal({
795
821
  id: generateId(),
796
- name: data.authorName,
797
- },
798
- }));
799
- }
800
- } })] })] })) : (_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: "small", className: "cursor-pointer hover:bg-gray-600 hover:text-white", title: "Create Initial Proposal", "aria-description": "Create Initial Proposal", onClick: () => {
801
- console.log("Creating initial proposal");
802
- dispatch(actions.editInitialProposal({
803
- id: generateId(),
804
- }));
805
- }, children: "Create Initial Proposal" }) })] })) })) : null, _jsx(ToastContainer, {})] }) }));
822
+ proposalAuthor: {
823
+ id: generateId(),
824
+ name: data.authorName,
825
+ },
826
+ }));
827
+ }
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: () => {
831
+ console.log("Creating initial proposal");
832
+ dispatch(actions.editInitialProposal({
833
+ id: generateId(),
834
+ }));
835
+ }, children: "Create Initial Proposal" }) })] })) })) : null, _jsx(ToastContainer, {})] })] }));
806
836
  }