@solidxai/core-ui 0.1.12-beta.2 → 0.1.12-beta.5

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 (423) hide show
  1. package/dist/components/auth/AuthLayout.d.ts.map +1 -1
  2. package/dist/components/auth/AuthLayout.js +7 -3
  3. package/dist/components/auth/AuthLayout.js.map +1 -1
  4. package/dist/components/auth/AuthLayout.tsx +9 -2
  5. package/dist/components/auth/AuthSettingsContext.js +1 -1
  6. package/dist/components/auth/AuthSettingsContext.js.map +1 -1
  7. package/dist/components/auth/AuthSettingsContext.tsx +1 -1
  8. package/dist/components/core/chatter/SolidChatterHeader.d.ts.map +1 -1
  9. package/dist/components/core/chatter/SolidChatterHeader.js +18 -4
  10. package/dist/components/core/chatter/SolidChatterHeader.js.map +1 -1
  11. package/dist/components/core/chatter/SolidChatterHeader.tsx +17 -3
  12. package/dist/components/core/common/SolidGenericImport/SolidImportTransaction.d.ts.map +1 -1
  13. package/dist/components/core/common/SolidGenericImport/SolidImportTransaction.js +12 -2
  14. package/dist/components/core/common/SolidGenericImport/SolidImportTransaction.js.map +1 -1
  15. package/dist/components/core/common/SolidGenericImport/SolidImportTransaction.tsx +12 -1
  16. package/dist/components/core/extension/solid-core/metadata/MetadataExplorerFormWidget.d.ts +2 -0
  17. package/dist/components/core/extension/solid-core/metadata/MetadataExplorerFormWidget.d.ts.map +1 -1
  18. package/dist/components/core/extension/solid-core/metadata/MetadataExplorerFormWidget.js +4 -2
  19. package/dist/components/core/extension/solid-core/metadata/MetadataExplorerFormWidget.js.map +1 -1
  20. package/dist/components/core/extension/solid-core/metadata/MetadataExplorerFormWidget.tsx +11 -3
  21. package/dist/components/core/json/SolidJsonEditor.css +7 -0
  22. package/dist/components/core/list/SolidDataTable.js +1 -1
  23. package/dist/components/core/list/SolidDataTable.js.map +1 -1
  24. package/dist/components/core/list/SolidDataTable.tsx +1 -1
  25. package/dist/components/core/list/SolidListView.d.ts.map +1 -1
  26. package/dist/components/core/list/SolidListView.js +58 -58
  27. package/dist/components/core/list/SolidListView.js.map +1 -1
  28. package/dist/components/core/list/SolidListView.tsx +5 -4
  29. package/dist/components/core/module/CreateModule.css +60 -6
  30. package/dist/components/core/module/CreateModule.d.ts.map +1 -1
  31. package/dist/components/core/module/CreateModule.js +2 -2
  32. package/dist/components/core/module/CreateModule.js.map +1 -1
  33. package/dist/components/core/module/CreateModule.tsx +56 -37
  34. package/dist/components/layout/AdminTopHeader.js +1 -1
  35. package/dist/components/layout/AdminTopHeader.js.map +1 -1
  36. package/dist/components/layout/AdminTopHeader.tsx +2 -2
  37. package/dist/helpers/modelViewPersistence.d.ts.map +1 -1
  38. package/dist/helpers/modelViewPersistence.js +3 -2
  39. package/dist/helpers/modelViewPersistence.js.map +1 -1
  40. package/dist/helpers/modelViewPersistence.ts +3 -2
  41. package/dist/helpers/modulePackageResumeState.d.ts +6 -0
  42. package/dist/helpers/modulePackageResumeState.d.ts.map +1 -0
  43. package/dist/helpers/modulePackageResumeState.js +46 -0
  44. package/dist/helpers/modulePackageResumeState.js.map +1 -0
  45. package/dist/helpers/modulePackageResumeState.ts +57 -0
  46. package/dist/redux/api/datasourceIntrospectionApi.d.ts +42 -1
  47. package/dist/redux/api/datasourceIntrospectionApi.d.ts.map +1 -1
  48. package/dist/redux/api/datasourceIntrospectionApi.js +34 -1
  49. package/dist/redux/api/datasourceIntrospectionApi.js.map +1 -1
  50. package/dist/redux/api/datasourceIntrospectionApi.ts +60 -0
  51. package/dist/redux/store/defaultStoreConfig.d.ts +11 -0
  52. package/dist/redux/store/defaultStoreConfig.d.ts.map +1 -1
  53. package/dist/resources/shadcn-base.css +70 -16
  54. package/dist/resources/solid-custom.css +3 -86
  55. package/dist/resources/solid-tailwind-generated.css +1 -1
  56. package/dist/resources/themes/solid-dark-purple/theme-variables.css +226 -0
  57. package/dist/resources/themes/solid-dark-purple/theme.css +1 -185
  58. package/dist/resources/themes/solid-light-purple/theme-variables.css +237 -0
  59. package/dist/resources/themes/solid-light-purple/theme.css +1 -206
  60. package/dist/routes/pages/admin/core/DatasourceIntrospectionPage.css +384 -31
  61. package/dist/routes/pages/admin/core/DatasourceIntrospectionPage.d.ts.map +1 -1
  62. package/dist/routes/pages/admin/core/DatasourceIntrospectionPage.js +577 -150
  63. package/dist/routes/pages/admin/core/DatasourceIntrospectionPage.js.map +1 -1
  64. package/dist/routes/pages/admin/core/DatasourceIntrospectionPage.tsx +1088 -423
  65. package/package.json +2 -1
  66. package/dist/components/auth/SolidOTPVerify.d.ts +0 -3
  67. package/dist/components/auth/SolidOTPVerify.d.ts.map +0 -1
  68. package/dist/components/auth/SolidOTPVerify.js +0 -67
  69. package/dist/components/auth/SolidOTPVerify.js.map +0 -1
  70. package/dist/components/auth/SolidOTPVerify.tsx +0 -133
  71. package/dist/components/common/AuthBanner.d.ts +0 -3
  72. package/dist/components/common/AuthBanner.d.ts.map +0 -1
  73. package/dist/components/common/AuthBanner.js +0 -15
  74. package/dist/components/common/AuthBanner.js.map +0 -1
  75. package/dist/components/common/AuthBanner.tsx +0 -41
  76. package/dist/components/common/SingleSelectAutoCompleteField.d.ts +0 -2
  77. package/dist/components/common/SingleSelectAutoCompleteField.d.ts.map +0 -1
  78. package/dist/components/common/SingleSelectAutoCompleteField.js +0 -92
  79. package/dist/components/common/SingleSelectAutoCompleteField.js.map +0 -1
  80. package/dist/components/common/SingleSelectAutoCompleteField.tsx +0 -73
  81. package/dist/components/common/SolidExportStepper.d.ts +0 -12
  82. package/dist/components/common/SolidExportStepper.d.ts.map +0 -1
  83. package/dist/components/common/SolidExportStepper.js +0 -30
  84. package/dist/components/common/SolidExportStepper.js.map +0 -1
  85. package/dist/components/common/SolidExportStepper.tsx +0 -135
  86. package/dist/components/core/common/LoadDynamicJsxComponent.d.ts +0 -2
  87. package/dist/components/core/common/LoadDynamicJsxComponent.d.ts.map +0 -1
  88. package/dist/components/core/common/LoadDynamicJsxComponent.js +0 -50
  89. package/dist/components/core/common/LoadDynamicJsxComponent.js.map +0 -1
  90. package/dist/components/core/common/LoadDynamicJsxComponent.tsx +0 -70
  91. package/dist/components/core/common/SolidGenericImport/SolidImportWrapper.d.ts +0 -2
  92. package/dist/components/core/common/SolidGenericImport/SolidImportWrapper.d.ts.map +0 -1
  93. package/dist/components/core/common/SolidGenericImport/SolidImportWrapper.js +0 -16
  94. package/dist/components/core/common/SolidGenericImport/SolidImportWrapper.js.map +0 -1
  95. package/dist/components/core/common/SolidGenericImport/SolidImportWrapper.tsx +0 -29
  96. package/dist/components/core/dashboard/DashboardFilter.d.ts +0 -13
  97. package/dist/components/core/dashboard/DashboardFilter.d.ts.map +0 -1
  98. package/dist/components/core/dashboard/DashboardFilter.js +0 -299
  99. package/dist/components/core/dashboard/DashboardFilter.js.map +0 -1
  100. package/dist/components/core/dashboard/DashboardFilter.tsx +0 -348
  101. package/dist/components/core/dashboard/PrimeDataTableWrapper.d.ts +0 -3
  102. package/dist/components/core/dashboard/PrimeDataTableWrapper.d.ts.map +0 -1
  103. package/dist/components/core/dashboard/PrimeDataTableWrapper.js +0 -21
  104. package/dist/components/core/dashboard/PrimeDataTableWrapper.js.map +0 -1
  105. package/dist/components/core/dashboard/PrimeDataTableWrapper.tsx +0 -40
  106. package/dist/components/core/dashboard/SolidDashboard.d.ts +0 -28
  107. package/dist/components/core/dashboard/SolidDashboard.d.ts.map +0 -1
  108. package/dist/components/core/dashboard/SolidDashboard.js +0 -183
  109. package/dist/components/core/dashboard/SolidDashboard.js.map +0 -1
  110. package/dist/components/core/dashboard/SolidDashboard.module.css +0 -83
  111. package/dist/components/core/dashboard/SolidDashboard.tsx +0 -263
  112. package/dist/components/core/dashboard/SolidDashboardBody.d.ts +0 -24
  113. package/dist/components/core/dashboard/SolidDashboardBody.d.ts.map +0 -1
  114. package/dist/components/core/dashboard/SolidDashboardBody.js +0 -162
  115. package/dist/components/core/dashboard/SolidDashboardBody.js.map +0 -1
  116. package/dist/components/core/dashboard/SolidDashboardBody.tsx +0 -168
  117. package/dist/components/core/dashboard/SolidDashboardFilterRequired.d.ts +0 -2
  118. package/dist/components/core/dashboard/SolidDashboardFilterRequired.d.ts.map +0 -1
  119. package/dist/components/core/dashboard/SolidDashboardFilterRequired.js +0 -11
  120. package/dist/components/core/dashboard/SolidDashboardFilterRequired.js.map +0 -1
  121. package/dist/components/core/dashboard/SolidDashboardFilterRequired.tsx +0 -28
  122. package/dist/components/core/dashboard/SolidDashboardHeader.d.ts +0 -3
  123. package/dist/components/core/dashboard/SolidDashboardHeader.d.ts.map +0 -1
  124. package/dist/components/core/dashboard/SolidDashboardHeader.js +0 -6
  125. package/dist/components/core/dashboard/SolidDashboardHeader.js.map +0 -1
  126. package/dist/components/core/dashboard/SolidDashboardHeader.tsx +0 -10
  127. package/dist/components/core/dashboard/SolidDashboardLoading.d.ts +0 -2
  128. package/dist/components/core/dashboard/SolidDashboardLoading.d.ts.map +0 -1
  129. package/dist/components/core/dashboard/SolidDashboardLoading.js +0 -10
  130. package/dist/components/core/dashboard/SolidDashboardLoading.js.map +0 -1
  131. package/dist/components/core/dashboard/SolidDashboardLoading.tsx +0 -61
  132. package/dist/components/core/dashboard/SolidDashboardNotAvailable.d.ts +0 -3
  133. package/dist/components/core/dashboard/SolidDashboardNotAvailable.d.ts.map +0 -1
  134. package/dist/components/core/dashboard/SolidDashboardNotAvailable.js +0 -12
  135. package/dist/components/core/dashboard/SolidDashboardNotAvailable.js.map +0 -1
  136. package/dist/components/core/dashboard/SolidDashboardNotAvailable.tsx +0 -32
  137. package/dist/components/core/dashboard/SolidDashboardRenderError.d.ts +0 -2
  138. package/dist/components/core/dashboard/SolidDashboardRenderError.d.ts.map +0 -1
  139. package/dist/components/core/dashboard/SolidDashboardRenderError.js +0 -11
  140. package/dist/components/core/dashboard/SolidDashboardRenderError.js.map +0 -1
  141. package/dist/components/core/dashboard/SolidDashboardRenderError.tsx +0 -28
  142. package/dist/components/core/dashboard/SolidDashboardVariable.d.ts +0 -19
  143. package/dist/components/core/dashboard/SolidDashboardVariable.d.ts.map +0 -1
  144. package/dist/components/core/dashboard/SolidDashboardVariable.js +0 -171
  145. package/dist/components/core/dashboard/SolidDashboardVariable.js.map +0 -1
  146. package/dist/components/core/dashboard/SolidDashboardVariable.tsx +0 -259
  147. package/dist/components/core/dashboard/SolidQuestionRenderer.d.ts +0 -9
  148. package/dist/components/core/dashboard/SolidQuestionRenderer.d.ts.map +0 -1
  149. package/dist/components/core/dashboard/SolidQuestionRenderer.js +0 -42
  150. package/dist/components/core/dashboard/SolidQuestionRenderer.js.map +0 -1
  151. package/dist/components/core/dashboard/SolidQuestionRenderer.tsx +0 -99
  152. package/dist/components/core/dashboard/chart-renderers/ChartJsRenderer.d.ts +0 -9
  153. package/dist/components/core/dashboard/chart-renderers/ChartJsRenderer.d.ts.map +0 -1
  154. package/dist/components/core/dashboard/chart-renderers/ChartJsRenderer.js +0 -35
  155. package/dist/components/core/dashboard/chart-renderers/ChartJsRenderer.js.map +0 -1
  156. package/dist/components/core/dashboard/chart-renderers/ChartJsRenderer.tsx +0 -48
  157. package/dist/components/core/dashboard/chart-renderers/PrimeReactDatatableRenderer.d.ts +0 -7
  158. package/dist/components/core/dashboard/chart-renderers/PrimeReactDatatableRenderer.d.ts.map +0 -1
  159. package/dist/components/core/dashboard/chart-renderers/PrimeReactDatatableRenderer.js +0 -22
  160. package/dist/components/core/dashboard/chart-renderers/PrimeReactDatatableRenderer.js.map +0 -1
  161. package/dist/components/core/dashboard/chart-renderers/PrimeReactDatatableRenderer.tsx +0 -51
  162. package/dist/components/core/dashboard/chart-renderers/init-chartjs.d.ts +0 -2
  163. package/dist/components/core/dashboard/chart-renderers/init-chartjs.d.ts.map +0 -1
  164. package/dist/components/core/dashboard/chart-renderers/init-chartjs.js +0 -4
  165. package/dist/components/core/dashboard/chart-renderers/init-chartjs.js.map +0 -1
  166. package/dist/components/core/dashboard/chart-renderers/init-chartjs.ts +0 -25
  167. package/dist/components/core/dashboard/dashboard-utils.d.ts +0 -2
  168. package/dist/components/core/dashboard/dashboard-utils.d.ts.map +0 -1
  169. package/dist/components/core/dashboard/dashboard-utils.js +0 -38
  170. package/dist/components/core/dashboard/dashboard-utils.js.map +0 -1
  171. package/dist/components/core/dashboard/dashboard-utils.ts +0 -39
  172. package/dist/components/core/extension/solid-core/dashboard/dashboardFormViewChangeHandler.d.ts +0 -10
  173. package/dist/components/core/extension/solid-core/dashboard/dashboardFormViewChangeHandler.d.ts.map +0 -1
  174. package/dist/components/core/extension/solid-core/dashboard/dashboardFormViewChangeHandler.js +0 -16
  175. package/dist/components/core/extension/solid-core/dashboard/dashboardFormViewChangeHandler.js.map +0 -1
  176. package/dist/components/core/extension/solid-core/dashboard/dashboardFormViewChangeHandler.ts +0 -19
  177. package/dist/components/core/extension/solid-core/dashboard/dashboardQuestionFieldChangeHandler.d.ts +0 -8
  178. package/dist/components/core/extension/solid-core/dashboard/dashboardQuestionFieldChangeHandler.d.ts.map +0 -1
  179. package/dist/components/core/extension/solid-core/dashboard/dashboardQuestionFieldChangeHandler.js +0 -64
  180. package/dist/components/core/extension/solid-core/dashboard/dashboardQuestionFieldChangeHandler.js.map +0 -1
  181. package/dist/components/core/extension/solid-core/dashboard/dashboardQuestionFieldChangeHandler.ts +0 -30
  182. package/dist/components/core/extension/solid-core/dashboard/dashboardQuestionOnFormLoadHandler.d.ts +0 -8
  183. package/dist/components/core/extension/solid-core/dashboard/dashboardQuestionOnFormLoadHandler.d.ts.map +0 -1
  184. package/dist/components/core/extension/solid-core/dashboard/dashboardQuestionOnFormLoadHandler.js +0 -62
  185. package/dist/components/core/extension/solid-core/dashboard/dashboardQuestionOnFormLoadHandler.js.map +0 -1
  186. package/dist/components/core/extension/solid-core/dashboard/dashboardQuestionOnFormLoadHandler.ts +0 -29
  187. package/dist/components/core/extension/solid-core/dashboardQuestion/ChartFormPreviewWidget.d.ts +0 -4
  188. package/dist/components/core/extension/solid-core/dashboardQuestion/ChartFormPreviewWidget.d.ts.map +0 -1
  189. package/dist/components/core/extension/solid-core/dashboardQuestion/ChartFormPreviewWidget.js +0 -23
  190. package/dist/components/core/extension/solid-core/dashboardQuestion/ChartFormPreviewWidget.js.map +0 -1
  191. package/dist/components/core/extension/solid-core/dashboardQuestion/ChartFormPreviewWidget.tsx +0 -36
  192. package/dist/components/core/form/fields/widgets/SolidChatterMessageCoModelEntityIdFormViewWidget.d.ts +0 -3
  193. package/dist/components/core/form/fields/widgets/SolidChatterMessageCoModelEntityIdFormViewWidget.d.ts.map +0 -1
  194. package/dist/components/core/form/fields/widgets/SolidChatterMessageCoModelEntityIdFormViewWidget.js +0 -92
  195. package/dist/components/core/form/fields/widgets/SolidChatterMessageCoModelEntityIdFormViewWidget.js.map +0 -1
  196. package/dist/components/core/form/fields/widgets/SolidChatterMessageCoModelEntityIdFormViewWidget.tsx +0 -68
  197. package/dist/components/core/form/fields/widgets/SolidLovTypeChangeFormEditWidget.d.ts +0 -3
  198. package/dist/components/core/form/fields/widgets/SolidLovTypeChangeFormEditWidget.d.ts.map +0 -1
  199. package/dist/components/core/form/fields/widgets/SolidLovTypeChangeFormEditWidget.js +0 -111
  200. package/dist/components/core/form/fields/widgets/SolidLovTypeChangeFormEditWidget.js.map +0 -1
  201. package/dist/components/core/form/fields/widgets/SolidLovTypeChangeFormEditWidget.tsx +0 -122
  202. package/dist/components/core/kanban/SolidKanbanViewFields.d.ts +0 -12
  203. package/dist/components/core/kanban/SolidKanbanViewFields.d.ts.map +0 -1
  204. package/dist/components/core/kanban/SolidKanbanViewFields.js +0 -145
  205. package/dist/components/core/kanban/SolidKanbanViewFields.js.map +0 -1
  206. package/dist/components/core/kanban/SolidKanbanViewFields.tsx +0 -164
  207. package/dist/components/core/kanban/SolidManyToOneFilterElement.d.ts +0 -2
  208. package/dist/components/core/kanban/SolidManyToOneFilterElement.d.ts.map +0 -1
  209. package/dist/components/core/kanban/SolidManyToOneFilterElement.js +0 -87
  210. package/dist/components/core/kanban/SolidManyToOneFilterElement.js.map +0 -1
  211. package/dist/components/core/kanban/SolidManyToOneFilterElement.tsx +0 -59
  212. package/dist/components/core/kanban/SolidSelectionDynamicFilterElement.d.ts +0 -2
  213. package/dist/components/core/kanban/SolidSelectionDynamicFilterElement.d.ts.map +0 -1
  214. package/dist/components/core/kanban/SolidSelectionDynamicFilterElement.js +0 -73
  215. package/dist/components/core/kanban/SolidSelectionDynamicFilterElement.js.map +0 -1
  216. package/dist/components/core/kanban/SolidSelectionDynamicFilterElement.tsx +0 -50
  217. package/dist/components/core/kanban/SolidSelectionStaticFilterElement.d.ts +0 -2
  218. package/dist/components/core/kanban/SolidSelectionStaticFilterElement.d.ts.map +0 -1
  219. package/dist/components/core/kanban/SolidSelectionStaticFilterElement.js +0 -20
  220. package/dist/components/core/kanban/SolidSelectionStaticFilterElement.js.map +0 -1
  221. package/dist/components/core/kanban/SolidSelectionStaticFilterElement.tsx +0 -32
  222. package/dist/components/core/kanban/SolidVarInputsFilterElement.d.ts +0 -12
  223. package/dist/components/core/kanban/SolidVarInputsFilterElement.d.ts.map +0 -1
  224. package/dist/components/core/kanban/SolidVarInputsFilterElement.js +0 -81
  225. package/dist/components/core/kanban/SolidVarInputsFilterElement.js.map +0 -1
  226. package/dist/components/core/kanban/SolidVarInputsFilterElement.tsx +0 -184
  227. package/dist/components/core/kanban/kanban-fields/SolidBigintKanbanField.d.ts +0 -4
  228. package/dist/components/core/kanban/kanban-fields/SolidBigintKanbanField.d.ts.map +0 -1
  229. package/dist/components/core/kanban/kanban-fields/SolidBigintKanbanField.js +0 -7
  230. package/dist/components/core/kanban/kanban-fields/SolidBigintKanbanField.js.map +0 -1
  231. package/dist/components/core/kanban/kanban-fields/SolidBigintKanbanField.tsx +0 -9
  232. package/dist/components/core/kanban/kanban-fields/SolidBooleanKanbanField.d.ts +0 -4
  233. package/dist/components/core/kanban/kanban-fields/SolidBooleanKanbanField.d.ts.map +0 -1
  234. package/dist/components/core/kanban/kanban-fields/SolidBooleanKanbanField.js +0 -8
  235. package/dist/components/core/kanban/kanban-fields/SolidBooleanKanbanField.js.map +0 -1
  236. package/dist/components/core/kanban/kanban-fields/SolidBooleanKanbanField.tsx +0 -16
  237. package/dist/components/core/kanban/kanban-fields/SolidComputedKanbanField.d.ts +0 -4
  238. package/dist/components/core/kanban/kanban-fields/SolidComputedKanbanField.d.ts.map +0 -1
  239. package/dist/components/core/kanban/kanban-fields/SolidComputedKanbanField.js +0 -21
  240. package/dist/components/core/kanban/kanban-fields/SolidComputedKanbanField.js.map +0 -1
  241. package/dist/components/core/kanban/kanban-fields/SolidComputedKanbanField.tsx +0 -23
  242. package/dist/components/core/kanban/kanban-fields/SolidDateKanbanField.d.ts +0 -4
  243. package/dist/components/core/kanban/kanban-fields/SolidDateKanbanField.d.ts.map +0 -1
  244. package/dist/components/core/kanban/kanban-fields/SolidDateKanbanField.js +0 -8
  245. package/dist/components/core/kanban/kanban-fields/SolidDateKanbanField.js.map +0 -1
  246. package/dist/components/core/kanban/kanban-fields/SolidDateKanbanField.tsx +0 -14
  247. package/dist/components/core/kanban/kanban-fields/SolidDatetimeKanbanField.d.ts +0 -4
  248. package/dist/components/core/kanban/kanban-fields/SolidDatetimeKanbanField.d.ts.map +0 -1
  249. package/dist/components/core/kanban/kanban-fields/SolidDatetimeKanbanField.js +0 -8
  250. package/dist/components/core/kanban/kanban-fields/SolidDatetimeKanbanField.js.map +0 -1
  251. package/dist/components/core/kanban/kanban-fields/SolidDatetimeKanbanField.tsx +0 -13
  252. package/dist/components/core/kanban/kanban-fields/SolidDecimalKanbanField.d.ts +0 -4
  253. package/dist/components/core/kanban/kanban-fields/SolidDecimalKanbanField.d.ts.map +0 -1
  254. package/dist/components/core/kanban/kanban-fields/SolidDecimalKanbanField.js +0 -7
  255. package/dist/components/core/kanban/kanban-fields/SolidDecimalKanbanField.js.map +0 -1
  256. package/dist/components/core/kanban/kanban-fields/SolidDecimalKanbanField.tsx +0 -9
  257. package/dist/components/core/kanban/kanban-fields/SolidExternalIdKanbanField.d.ts +0 -4
  258. package/dist/components/core/kanban/kanban-fields/SolidExternalIdKanbanField.d.ts.map +0 -1
  259. package/dist/components/core/kanban/kanban-fields/SolidExternalIdKanbanField.js +0 -8
  260. package/dist/components/core/kanban/kanban-fields/SolidExternalIdKanbanField.js.map +0 -1
  261. package/dist/components/core/kanban/kanban-fields/SolidExternalIdKanbanField.tsx +0 -12
  262. package/dist/components/core/kanban/kanban-fields/SolidFloatKanbanField.d.ts +0 -4
  263. package/dist/components/core/kanban/kanban-fields/SolidFloatKanbanField.d.ts.map +0 -1
  264. package/dist/components/core/kanban/kanban-fields/SolidFloatKanbanField.js +0 -7
  265. package/dist/components/core/kanban/kanban-fields/SolidFloatKanbanField.js.map +0 -1
  266. package/dist/components/core/kanban/kanban-fields/SolidFloatKanbanField.tsx +0 -9
  267. package/dist/components/core/kanban/kanban-fields/SolidIdKanbanField.d.ts +0 -4
  268. package/dist/components/core/kanban/kanban-fields/SolidIdKanbanField.d.ts.map +0 -1
  269. package/dist/components/core/kanban/kanban-fields/SolidIdKanbanField.js +0 -8
  270. package/dist/components/core/kanban/kanban-fields/SolidIdKanbanField.js.map +0 -1
  271. package/dist/components/core/kanban/kanban-fields/SolidIdKanbanField.tsx +0 -14
  272. package/dist/components/core/kanban/kanban-fields/SolidIntKanbanField.d.ts +0 -4
  273. package/dist/components/core/kanban/kanban-fields/SolidIntKanbanField.d.ts.map +0 -1
  274. package/dist/components/core/kanban/kanban-fields/SolidIntKanbanField.js +0 -16
  275. package/dist/components/core/kanban/kanban-fields/SolidIntKanbanField.js.map +0 -1
  276. package/dist/components/core/kanban/kanban-fields/SolidIntKanbanField.tsx +0 -20
  277. package/dist/components/core/kanban/kanban-fields/SolidLongTextKanbanField.d.ts +0 -4
  278. package/dist/components/core/kanban/kanban-fields/SolidLongTextKanbanField.d.ts.map +0 -1
  279. package/dist/components/core/kanban/kanban-fields/SolidLongTextKanbanField.js +0 -7
  280. package/dist/components/core/kanban/kanban-fields/SolidLongTextKanbanField.js.map +0 -1
  281. package/dist/components/core/kanban/kanban-fields/SolidLongTextKanbanField.tsx +0 -9
  282. package/dist/components/core/kanban/kanban-fields/SolidMediaMultipleKanbanField.d.ts +0 -4
  283. package/dist/components/core/kanban/kanban-fields/SolidMediaMultipleKanbanField.d.ts.map +0 -1
  284. package/dist/components/core/kanban/kanban-fields/SolidMediaMultipleKanbanField.js +0 -56
  285. package/dist/components/core/kanban/kanban-fields/SolidMediaMultipleKanbanField.js.map +0 -1
  286. package/dist/components/core/kanban/kanban-fields/SolidMediaMultipleKanbanField.tsx +0 -140
  287. package/dist/components/core/kanban/kanban-fields/SolidMediaSingleKanbanField.d.ts +0 -4
  288. package/dist/components/core/kanban/kanban-fields/SolidMediaSingleKanbanField.d.ts.map +0 -1
  289. package/dist/components/core/kanban/kanban-fields/SolidMediaSingleKanbanField.js +0 -42
  290. package/dist/components/core/kanban/kanban-fields/SolidMediaSingleKanbanField.js.map +0 -1
  291. package/dist/components/core/kanban/kanban-fields/SolidMediaSingleKanbanField.tsx +0 -164
  292. package/dist/components/core/kanban/kanban-fields/SolidRelationKanbanField.d.ts +0 -4
  293. package/dist/components/core/kanban/kanban-fields/SolidRelationKanbanField.d.ts.map +0 -1
  294. package/dist/components/core/kanban/kanban-fields/SolidRelationKanbanField.js +0 -11
  295. package/dist/components/core/kanban/kanban-fields/SolidRelationKanbanField.js.map +0 -1
  296. package/dist/components/core/kanban/kanban-fields/SolidRelationKanbanField.tsx +0 -13
  297. package/dist/components/core/kanban/kanban-fields/SolidRichTextKanbanField.d.ts +0 -4
  298. package/dist/components/core/kanban/kanban-fields/SolidRichTextKanbanField.d.ts.map +0 -1
  299. package/dist/components/core/kanban/kanban-fields/SolidRichTextKanbanField.js +0 -7
  300. package/dist/components/core/kanban/kanban-fields/SolidRichTextKanbanField.js.map +0 -1
  301. package/dist/components/core/kanban/kanban-fields/SolidRichTextKanbanField.tsx +0 -9
  302. package/dist/components/core/kanban/kanban-fields/SolidSelectionDynamicKanbanField.d.ts +0 -4
  303. package/dist/components/core/kanban/kanban-fields/SolidSelectionDynamicKanbanField.d.ts.map +0 -1
  304. package/dist/components/core/kanban/kanban-fields/SolidSelectionDynamicKanbanField.js +0 -8
  305. package/dist/components/core/kanban/kanban-fields/SolidSelectionDynamicKanbanField.js.map +0 -1
  306. package/dist/components/core/kanban/kanban-fields/SolidSelectionDynamicKanbanField.tsx +0 -14
  307. package/dist/components/core/kanban/kanban-fields/SolidSelectionStaticKanbanField.d.ts +0 -4
  308. package/dist/components/core/kanban/kanban-fields/SolidSelectionStaticKanbanField.d.ts.map +0 -1
  309. package/dist/components/core/kanban/kanban-fields/SolidSelectionStaticKanbanField.js +0 -8
  310. package/dist/components/core/kanban/kanban-fields/SolidSelectionStaticKanbanField.js.map +0 -1
  311. package/dist/components/core/kanban/kanban-fields/SolidSelectionStaticKanbanField.tsx +0 -14
  312. package/dist/components/core/kanban/kanban-fields/SolidShortTextKanbanField.d.ts +0 -4
  313. package/dist/components/core/kanban/kanban-fields/SolidShortTextKanbanField.d.ts.map +0 -1
  314. package/dist/components/core/kanban/kanban-fields/SolidShortTextKanbanField.js +0 -37
  315. package/dist/components/core/kanban/kanban-fields/SolidShortTextKanbanField.js.map +0 -1
  316. package/dist/components/core/kanban/kanban-fields/SolidShortTextKanbanField.tsx +0 -121
  317. package/dist/components/core/kanban/kanban-fields/SolidTimeKanbanField.d.ts +0 -4
  318. package/dist/components/core/kanban/kanban-fields/SolidTimeKanbanField.d.ts.map +0 -1
  319. package/dist/components/core/kanban/kanban-fields/SolidTimeKanbanField.js +0 -8
  320. package/dist/components/core/kanban/kanban-fields/SolidTimeKanbanField.js.map +0 -1
  321. package/dist/components/core/kanban/kanban-fields/SolidTimeKanbanField.tsx +0 -12
  322. package/dist/components/core/kanban/kanban-fields/SolidUuidKanbanField.d.ts +0 -4
  323. package/dist/components/core/kanban/kanban-fields/SolidUuidKanbanField.d.ts.map +0 -1
  324. package/dist/components/core/kanban/kanban-fields/SolidUuidKanbanField.js +0 -8
  325. package/dist/components/core/kanban/kanban-fields/SolidUuidKanbanField.js.map +0 -1
  326. package/dist/components/core/kanban/kanban-fields/SolidUuidKanbanField.tsx +0 -13
  327. package/dist/components/core/kanban/kanban-fields/relations/SolidRelationManyToOneKanbanField.d.ts +0 -4
  328. package/dist/components/core/kanban/kanban-fields/relations/SolidRelationManyToOneKanbanField.d.ts.map +0 -1
  329. package/dist/components/core/kanban/kanban-fields/relations/SolidRelationManyToOneKanbanField.js +0 -7
  330. package/dist/components/core/kanban/kanban-fields/relations/SolidRelationManyToOneKanbanField.js.map +0 -1
  331. package/dist/components/core/kanban/kanban-fields/relations/SolidRelationManyToOneKanbanField.tsx +0 -16
  332. package/dist/components/core/list/SolidListViewRowButtonContextMenu.d.ts +0 -2
  333. package/dist/components/core/list/SolidListViewRowButtonContextMenu.d.ts.map +0 -1
  334. package/dist/components/core/list/SolidListViewRowButtonContextMenu.js +0 -39
  335. package/dist/components/core/list/SolidListViewRowButtonContextMenu.js.map +0 -1
  336. package/dist/components/core/list/SolidListViewRowButtonContextMenu.tsx +0 -40
  337. package/dist/components/core/list/SolidVarInputsFilterElement.d.ts +0 -12
  338. package/dist/components/core/list/SolidVarInputsFilterElement.d.ts.map +0 -1
  339. package/dist/components/core/list/SolidVarInputsFilterElement.js +0 -81
  340. package/dist/components/core/list/SolidVarInputsFilterElement.js.map +0 -1
  341. package/dist/components/core/list/SolidVarInputsFilterElement.tsx +0 -184
  342. package/dist/components/core/list/widgets/SolidChatterMessageCoModelEntityIdListViewWidget.d.ts +0 -3
  343. package/dist/components/core/list/widgets/SolidChatterMessageCoModelEntityIdListViewWidget.d.ts.map +0 -1
  344. package/dist/components/core/list/widgets/SolidChatterMessageCoModelEntityIdListViewWidget.js +0 -87
  345. package/dist/components/core/list/widgets/SolidChatterMessageCoModelEntityIdListViewWidget.js.map +0 -1
  346. package/dist/components/core/list/widgets/SolidChatterMessageCoModelEntityIdListViewWidget.tsx +0 -70
  347. package/dist/components/core/list/widgets/SolidMqMessageStageListViewWidget.d.ts +0 -3
  348. package/dist/components/core/list/widgets/SolidMqMessageStageListViewWidget.d.ts.map +0 -1
  349. package/dist/components/core/list/widgets/SolidMqMessageStageListViewWidget.js +0 -33
  350. package/dist/components/core/list/widgets/SolidMqMessageStageListViewWidget.js.map +0 -1
  351. package/dist/components/core/list/widgets/SolidMqMessageStageListViewWidget.tsx +0 -50
  352. package/dist/components/core/list/widgets/SolidSummarizeListHeaderActionMqMessages.d.ts +0 -3
  353. package/dist/components/core/list/widgets/SolidSummarizeListHeaderActionMqMessages.d.ts.map +0 -1
  354. package/dist/components/core/list/widgets/SolidSummarizeListHeaderActionMqMessages.js +0 -158
  355. package/dist/components/core/list/widgets/SolidSummarizeListHeaderActionMqMessages.js.map +0 -1
  356. package/dist/components/core/list/widgets/SolidSummarizeListHeaderActionMqMessages.tsx +0 -185
  357. package/dist/components/layout/DashboardHeader.d.ts +0 -3
  358. package/dist/components/layout/DashboardHeader.d.ts.map +0 -1
  359. package/dist/components/layout/DashboardHeader.js +0 -20
  360. package/dist/components/layout/DashboardHeader.js.map +0 -1
  361. package/dist/components/layout/DashboardHeader.tsx +0 -94
  362. package/dist/helpers/# no such endpoints exist, need to calle +0 -3
  363. package/dist/helpers/ToastContainer.d.ts +0 -4
  364. package/dist/helpers/ToastContainer.d.ts.map +0 -1
  365. package/dist/helpers/ToastContainer.js +0 -49
  366. package/dist/helpers/ToastContainer.js.map +0 -1
  367. package/dist/helpers/ToastContainer.tsx +0 -94
  368. package/dist/helpers/showToast.d.ts +0 -5
  369. package/dist/helpers/showToast.d.ts.map +0 -1
  370. package/dist/helpers/showToast.js +0 -17
  371. package/dist/helpers/showToast.js.map +0 -1
  372. package/dist/helpers/showToast.ts +0 -13
  373. package/dist/helpers/studioSandbox.d.ts +0 -31
  374. package/dist/helpers/studioSandbox.d.ts.map +0 -1
  375. package/dist/helpers/studioSandbox.js +0 -104
  376. package/dist/helpers/studioSandbox.js.map +0 -1
  377. package/dist/helpers/studioSandbox.ts +0 -117
  378. package/dist/nextAuth/authProviders.d.ts +0 -4
  379. package/dist/nextAuth/authProviders.d.ts.map +0 -1
  380. package/dist/nextAuth/authProviders.js +0 -198
  381. package/dist/nextAuth/authProviders.js.map +0 -1
  382. package/dist/nextAuth/authProviders.tsx +0 -232
  383. package/dist/nextAuth/handleLogout.d.ts +0 -2
  384. package/dist/nextAuth/handleLogout.d.ts.map +0 -1
  385. package/dist/nextAuth/handleLogout.js +0 -36
  386. package/dist/nextAuth/handleLogout.js.map +0 -1
  387. package/dist/nextAuth/handleLogout.tsx +0 -39
  388. package/dist/nextAuth/refreshAccessToken.d.ts +0 -2
  389. package/dist/nextAuth/refreshAccessToken.d.ts.map +0 -1
  390. package/dist/nextAuth/refreshAccessToken.js +0 -24
  391. package/dist/nextAuth/refreshAccessToken.js.map +0 -1
  392. package/dist/nextAuth/refreshAccessToken.tsx +0 -28
  393. package/dist/redux/api/dashboardApi.d.ts +0 -23
  394. package/dist/redux/api/dashboardApi.d.ts.map +0 -1
  395. package/dist/redux/api/dashboardApi.js +0 -35
  396. package/dist/redux/api/dashboardApi.js.map +0 -1
  397. package/dist/redux/api/dashboardApi.ts +0 -56
  398. package/dist/redux/api/dashboardLayoutApi.d.ts +0 -24
  399. package/dist/redux/api/dashboardLayoutApi.d.ts.map +0 -1
  400. package/dist/redux/api/dashboardLayoutApi.js +0 -34
  401. package/dist/redux/api/dashboardLayoutApi.js.map +0 -1
  402. package/dist/redux/api/dashboardLayoutApi.ts +0 -55
  403. package/dist/redux/api/dashboardQuestionApi.d.ts +0 -5
  404. package/dist/redux/api/dashboardQuestionApi.d.ts.map +0 -1
  405. package/dist/redux/api/dashboardQuestionApi.js +0 -18
  406. package/dist/redux/api/dashboardQuestionApi.js.map +0 -1
  407. package/dist/redux/api/dashboardQuestionApi.ts +0 -17
  408. package/dist/redux/features/settingsSlice.d.ts +0 -20
  409. package/dist/redux/features/settingsSlice.d.ts.map +0 -1
  410. package/dist/redux/features/settingsSlice.js +0 -39
  411. package/dist/redux/features/settingsSlice.js.map +0 -1
  412. package/dist/redux/features/settingsSlice.ts +0 -60
  413. package/dist/resources/images/Footerbg.png +0 -0
  414. package/dist/resources/images/LoginBanner.png +0 -0
  415. package/dist/resources/images/dashboard/Ellipse 1.svg +0 -10
  416. package/dist/resources/images/dashboard/Rectangle 17.svg +0 -10
  417. package/dist/resources/images/dashboard/Rectangle 25.svg +0 -11
  418. package/dist/resources/images/dashboard/image 5.svg +0 -9
  419. package/dist/resources/images/loginhero.png +0 -0
  420. package/dist/resources/images/logo.png +0 -0
  421. package/dist/resources/images/radix-logo-white.png +0 -0
  422. package/dist/resources/images/radix-logo.png +0 -0
  423. package/dist/resources/images/signupBanner.png +0 -0
@@ -66,16 +66,17 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
66
66
  return to.concat(ar || Array.prototype.slice.call(from));
67
67
  };
68
68
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
69
- import { Cog, Database, ExternalLink, RefreshCw, Save, Search, ShieldAlert, Sparkles, } from "lucide-react";
70
- import { camelCase } from "lodash";
69
+ import { ArrowLeft, Check, Cog, Database, ExternalLink, RefreshCw, Save, Search, ShieldAlert, Sparkles, } from "lucide-react";
70
+ import { camelCase, startCase } from "lodash";
71
71
  import { useEffect, useMemo, useRef, useState } from "react";
72
72
  import { useDispatch } from "react-redux";
73
- import { useParams } from "react-router-dom";
73
+ import { useNavigate, useParams } from "react-router-dom";
74
74
  import { showToast } from "../../../../redux/features/toastSlice";
75
75
  import { SolidJsonEditor } from "../../../../components/core/json/SolidJsonEditor";
76
76
  import { Column, SolidDataTable } from "../../../../components/core/list/SolidDataTable";
77
+ import { waitForBackendAvailability } from "../../../../helpers/waitForBackendAvailability";
77
78
  import { SolidButton, SolidCheckbox, SolidDialog, SolidDialogBody, SolidDialogClose, SolidDialogDescription, SolidDialogFooter, SolidDialogHeader, SolidDialogSeparator, SolidDialogTitle, SolidInput, SolidSelect, SolidSpinner, SolidSwitch, SolidTabGroup, SolidTextarea, } from "../../../../components/shad-cn-ui";
78
- import { useApplyDatasourceIntrospectionMappingMutation, useGetDatasourceIntrospectionBootstrapQuery, useGetDatasourceIntrospectionTableDetailQuery, useGetDatasourceIntrospectionTablesQuery, usePreviewDatasourceIntrospectionMappingMutation, } from "../../../../redux/api/datasourceIntrospectionApi";
79
+ import { useApplyDatasourceIntrospectionMappingMutation, useCreateDatasourceIntrospectionMigrationArtifactsMutation, useGenerateDatasourceIntrospectionCodeMutation, useGetDatasourceIntrospectionBootstrapQuery, useGetDatasourceIntrospectionTableDetailQuery, useGetDatasourceIntrospectionTablesQuery, usePreviewDatasourceIntrospectionMappingMutation, useRunDatasourceIntrospectionMigrationMutation, } from "../../../../redux/api/datasourceIntrospectionApi";
79
80
  import { useGetmodelByIdQuery } from "../../../../redux/api/modelApi";
80
81
  import "./DatasourceIntrospectionPage.css";
81
82
  function providerLabel(type) {
@@ -104,6 +105,43 @@ var scalarFieldTypeOptions = [
104
105
  { value: "password", label: "Password" },
105
106
  ];
106
107
  var scalarFieldTypeValueSet = new Set(scalarFieldTypeOptions.map(function (option) { return option.value; }));
108
+ var mappingStrategyOptions = [
109
+ { value: "generated_id", label: "Legacy generated id" },
110
+ { value: "existing_id", label: "Legacy existing id" },
111
+ ];
112
+ function getBaseClassNameForLegacyType(value) {
113
+ return value === "existing_id"
114
+ ? "LegacyCommonEntityWithExistingId"
115
+ : "LegacyCommonEntityWithGeneratedId";
116
+ }
117
+ function getSuperclassFieldNameForLegacyType(columnName, legacyTableType) {
118
+ var _a;
119
+ var normalized = columnName.toLowerCase();
120
+ var legacyFieldMap = {
121
+ ss_created_at: "createdAt",
122
+ ss_updated_at: "updatedAt",
123
+ ss_deleted_at: "deletedAt",
124
+ ss_deleted_tracker: "deletedTracker",
125
+ ss_published_at: "publishedAt",
126
+ ss_locale_name: "localeName",
127
+ ss_default_entity_locale_id: "defaultEntityLocaleId",
128
+ ss_created_by_id: "createdBy",
129
+ ss_updated_by_id: "updatedBy",
130
+ };
131
+ if (normalized === "ss_id" && legacyTableType === "generated_id") {
132
+ return "id";
133
+ }
134
+ return (_a = legacyFieldMap[normalized]) !== null && _a !== void 0 ? _a : null;
135
+ }
136
+ function getSuggestedFieldNameForLegacyType(column, legacyTableType) {
137
+ if (legacyTableType === "existing_id" && column.isAutoGenerated) {
138
+ return "id";
139
+ }
140
+ if (legacyTableType === "generated_id" && column.columnName.toLowerCase() === "id") {
141
+ return "legacyId";
142
+ }
143
+ return camelCase(column.columnName.replace(/^ss_/i, ""));
144
+ }
107
145
  function getDefaultOrmTypeForSolidFieldType(dataSourceType, solidFieldType) {
108
146
  var _a, _b;
109
147
  var normalizedDatasourceType = dataSourceType.toLowerCase();
@@ -159,13 +197,6 @@ function getDefaultOrmTypeForSolidFieldType(dataSourceType, solidFieldType) {
159
197
  };
160
198
  return (_b = (_a = ormTypesByDatasource[normalizedDatasourceType]) === null || _a === void 0 ? void 0 : _a[solidFieldType]) !== null && _b !== void 0 ? _b : "varchar";
161
199
  }
162
- function legacyTypeLabel(value) {
163
- if (value === "generated_id")
164
- return "Legacy generated id";
165
- if (value === "existing_id")
166
- return "Legacy existing id";
167
- return "Legacy generated id";
168
- }
169
200
  function statusLabel(record) {
170
201
  return record.mapped ? "Mapped" : "Ready to map";
171
202
  }
@@ -176,6 +207,26 @@ function readQueryError(error) {
176
207
  || (error === null || error === void 0 ? void 0 : error.message)
177
208
  || "Something went wrong.");
178
209
  }
210
+ function isRecoverableGenerateCodeError(error) {
211
+ var _a, _b, _c;
212
+ var status = (_a = error === null || error === void 0 ? void 0 : error.status) !== null && _a !== void 0 ? _a : error === null || error === void 0 ? void 0 : error.originalStatus;
213
+ var message = [
214
+ error === null || error === void 0 ? void 0 : error.error,
215
+ error === null || error === void 0 ? void 0 : error.message,
216
+ (_b = error === null || error === void 0 ? void 0 : error.data) === null || _b === void 0 ? void 0 : _b.message,
217
+ (_c = error === null || error === void 0 ? void 0 : error.data) === null || _c === void 0 ? void 0 : _c.error,
218
+ ]
219
+ .filter(Boolean)
220
+ .join(" ")
221
+ .toLowerCase();
222
+ if (status === "FETCH_ERROR" || status === "TIMEOUT_ERROR" || status === "PARSING_ERROR") {
223
+ return true;
224
+ }
225
+ return (message.includes("failed to fetch")
226
+ || message.includes("network")
227
+ || message.includes("load failed")
228
+ || message.includes("fetch"));
229
+ }
179
230
  function normalizeName(value) {
180
231
  return value.trim().toLowerCase();
181
232
  }
@@ -207,27 +258,29 @@ function buildDrawerDraft(tableDetail, selectedTable, mappedModelData) {
207
258
  || ((_d = modelFields.find(function (field) { return field === null || field === void 0 ? void 0 : field.isUserKey; })) === null || _d === void 0 ? void 0 : _d.name)
208
259
  || "";
209
260
  var columns = tableDetail.columns.map(function (column) {
210
- var _a, _b, _c, _d, _e;
261
+ var _a, _b, _c, _d, _e, _f;
211
262
  var matchingField = findMatchingModelField(column, modelFields);
212
263
  return {
213
264
  columnName: column.columnName,
214
265
  fieldName: (_a = matchingField === null || matchingField === void 0 ? void 0 : matchingField.name) !== null && _a !== void 0 ? _a : column.fieldName,
266
+ displayName: (_b = matchingField === null || matchingField === void 0 ? void 0 : matchingField.displayName) !== null && _b !== void 0 ? _b : column.displayName,
215
267
  dataType: column.dataType,
216
- solidFieldType: (_b = matchingField === null || matchingField === void 0 ? void 0 : matchingField.type) !== null && _b !== void 0 ? _b : column.solidFieldType,
217
- ormType: (_c = matchingField === null || matchingField === void 0 ? void 0 : matchingField.ormType) !== null && _c !== void 0 ? _c : column.ormType,
268
+ solidFieldType: (_c = matchingField === null || matchingField === void 0 ? void 0 : matchingField.type) !== null && _c !== void 0 ? _c : column.solidFieldType,
269
+ ormType: (_d = matchingField === null || matchingField === void 0 ? void 0 : matchingField.ormType) !== null && _d !== void 0 ? _d : column.ormType,
218
270
  nullable: column.nullable,
219
- defaultValue: (_d = matchingField === null || matchingField === void 0 ? void 0 : matchingField.defaultValue) !== null && _d !== void 0 ? _d : column.defaultValue,
271
+ defaultValue: (_e = matchingField === null || matchingField === void 0 ? void 0 : matchingField.defaultValue) !== null && _e !== void 0 ? _e : column.defaultValue,
220
272
  characterMaximumLength: column.characterMaximumLength,
221
273
  numericPrecision: column.numericPrecision,
222
274
  numericScale: column.numericScale,
223
275
  ordinalPosition: column.ordinalPosition,
224
276
  isAutoGenerated: column.isAutoGenerated,
277
+ isDetectedPrimaryKey: column.isPrimaryKey,
225
278
  handledBySuperclass: column.handledBySuperclass,
226
279
  superclassFieldName: column.superclassFieldName,
227
- fieldId: (_e = matchingField === null || matchingField === void 0 ? void 0 : matchingField.id) !== null && _e !== void 0 ? _e : null,
280
+ fieldId: (_f = matchingField === null || matchingField === void 0 ? void 0 : matchingField.id) !== null && _f !== void 0 ? _f : null,
228
281
  include: column.handledBySuperclass ? false : Boolean(matchingField) || !selectedTable.mapped,
229
282
  matched: Boolean(matchingField),
230
- isPrimaryKey: Boolean(matchingField === null || matchingField === void 0 ? void 0 : matchingField.isPrimaryKey) || (column.isAutoGenerated && column.fieldName === "id"),
283
+ isPrimaryKey: Boolean(matchingField === null || matchingField === void 0 ? void 0 : matchingField.isPrimaryKey) || column.isPrimaryKey || (column.isAutoGenerated && column.fieldName === "id"),
231
284
  };
232
285
  });
233
286
  var draftUserKeyField = modelUserKeyField || tableDetail.suggestedMetadata.userKeyField;
@@ -277,6 +330,10 @@ function getDrawerValidationErrors(draft) {
277
330
  errors.push("Field name is required for column \"".concat(column.columnName, "\"."));
278
331
  continue;
279
332
  }
333
+ if (!column.displayName.trim()) {
334
+ errors.push("Field label is required for column \"".concat(column.columnName, "\"."));
335
+ continue;
336
+ }
280
337
  if (!scalarFieldTypeValueSet.has(column.solidFieldType)) {
281
338
  errors.push("SolidX type \"".concat(column.solidFieldType, "\" is not allowed in step 1 for column \"").concat(column.columnName, "\"."));
282
339
  continue;
@@ -328,6 +385,7 @@ function buildMappingRequest(draft, plannedMigrationTimestamp) {
328
385
  columns: draft.columns.map(function (column) { return ({
329
386
  columnName: column.columnName,
330
387
  fieldName: column.fieldName,
388
+ displayName: column.displayName,
331
389
  dataType: column.dataType,
332
390
  solidFieldType: column.solidFieldType,
333
391
  ormType: column.ormType,
@@ -475,47 +533,53 @@ function parseAndValidateReviewedModelJson(metadataJsonText, draft) {
475
533
  }
476
534
  export function DatasourceIntrospectionPage() {
477
535
  var _this = this;
478
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
536
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
479
537
  var params = useParams();
538
+ var navigate = useNavigate();
480
539
  var dispatch = useDispatch();
481
540
  var moduleId = Number((_a = params.moduleId) !== null && _a !== void 0 ? _a : 0);
482
541
  var isValidModuleId = Number.isFinite(moduleId) && moduleId > 0;
483
- var _o = useGetDatasourceIntrospectionBootstrapQuery(moduleId, {
542
+ var _r = useGetDatasourceIntrospectionBootstrapQuery(moduleId, {
484
543
  skip: !isValidModuleId,
485
- }), bootstrap = _o.data, isBootstrapLoading = _o.isLoading, isBootstrapFetching = _o.isFetching, bootstrapError = _o.error, refetchBootstrap = _o.refetch;
486
- var _p = useState(""), selectedDatasource = _p[0], setSelectedDatasource = _p[1];
487
- var _q = useState(""), selectedTableKey = _q[0], setSelectedTableKey = _q[1];
488
- var _r = useState(""), tableSearch = _r[0], setTableSearch = _r[1];
489
- var _s = useState(false), settingsOpen = _s[0], setSettingsOpen = _s[1];
490
- var _t = useState("datasource-info"), settingsTab = _t[0], setSettingsTab = _t[1];
491
- var _u = useState(false), drawerOpen = _u[0], setDrawerOpen = _u[1];
492
- var _v = useState(null), drawerDraft = _v[0], setDrawerDraft = _v[1];
493
- var _w = useState("general-info"), drawerTab = _w[0], setDrawerTab = _w[1];
494
- var _x = useState("edit"), drawerStep = _x[0], setDrawerStep = _x[1];
495
- var _y = useState("metadata-json"), reviewTab = _y[0], setReviewTab = _y[1];
496
- var _z = useState(null), mappingPreview = _z[0], setMappingPreview = _z[1];
497
- var _0 = useState(null), reviewedMetadataJsonValue = _0[0], setReviewedMetadataJsonValue = _0[1];
498
- var _1 = useState(""), metadataJsonText = _1[0], setMetadataJsonText = _1[1];
499
- var _2 = useState(null), metadataJsonValidationError = _2[0], setMetadataJsonValidationError = _2[1];
500
- var _3 = useState("initial"), metadataJsonResetToken = _3[0], setMetadataJsonResetToken = _3[1];
501
- var _4 = useState(false), drawerBootstrapping = _4[0], setDrawerBootstrapping = _4[1];
502
- var _5 = useState({
544
+ }), bootstrap = _r.data, isBootstrapLoading = _r.isLoading, isBootstrapFetching = _r.isFetching, bootstrapError = _r.error, refetchBootstrap = _r.refetch;
545
+ var _s = useState(""), selectedDatasource = _s[0], setSelectedDatasource = _s[1];
546
+ var _t = useState([]), selectedRows = _t[0], setSelectedRows = _t[1];
547
+ var _u = useState(""), workspaceTableKey = _u[0], setWorkspaceTableKey = _u[1];
548
+ var _v = useState(""), tableSearch = _v[0], setTableSearch = _v[1];
549
+ var _w = useState(false), settingsOpen = _w[0], setSettingsOpen = _w[1];
550
+ var _x = useState("datasource-info"), settingsTab = _x[0], setSettingsTab = _x[1];
551
+ var _y = useState(null), drawerDraft = _y[0], setDrawerDraft = _y[1];
552
+ var _z = useState("general-info"), drawerTab = _z[0], setDrawerTab = _z[1];
553
+ var _0 = useState("configure"), workspaceStep = _0[0], setWorkspaceStep = _0[1];
554
+ var _1 = useState(null), mappingPreview = _1[0], setMappingPreview = _1[1];
555
+ var _2 = useState(null), persistedMappingResult = _2[0], setPersistedMappingResult = _2[1];
556
+ var _3 = useState(null), migrationArtifactsResult = _3[0], setMigrationArtifactsResult = _3[1];
557
+ var _4 = useState(""), generateCodeOutput = _4[0], setGenerateCodeOutput = _4[1];
558
+ var _5 = useState(false), isGeneratingCodeWorkflow = _5[0], setIsGeneratingCodeWorkflow = _5[1];
559
+ var _6 = useState(""), generateCodeStatusMessage = _6[0], setGenerateCodeStatusMessage = _6[1];
560
+ var _7 = useState(null), generateCodeTimeoutMessage = _7[0], setGenerateCodeTimeoutMessage = _7[1];
561
+ var _8 = useState(false), generateCodeReady = _8[0], setGenerateCodeReady = _8[1];
562
+ var _9 = useState(false), hasAttemptedGenerateCode = _9[0], setHasAttemptedGenerateCode = _9[1];
563
+ var _10 = useState(""), runMigrationOutput = _10[0], setRunMigrationOutput = _10[1];
564
+ var _11 = useState(false), runMigrationCompleted = _11[0], setRunMigrationCompleted = _11[1];
565
+ var _12 = useState(null), reviewedMetadataJsonValue = _12[0], setReviewedMetadataJsonValue = _12[1];
566
+ var _13 = useState(""), metadataJsonText = _13[0], setMetadataJsonText = _13[1];
567
+ var _14 = useState(null), metadataJsonValidationError = _14[0], setMetadataJsonValidationError = _14[1];
568
+ var _15 = useState("initial"), metadataJsonResetToken = _15[0], setMetadataJsonResetToken = _15[1];
569
+ var _16 = useState(false), drawerBootstrapping = _16[0], setDrawerBootstrapping = _16[1];
570
+ var _17 = useState({
503
571
  relationInferenceEnabled: false,
504
572
  prioritizeUnmappedTables: true,
505
- }), sessionSettings = _5[0], setSessionSettings = _5[1];
506
- var _6 = useState(sessionSettings), draftSessionSettings = _6[0], setDraftSessionSettings = _6[1];
573
+ }), sessionSettings = _17[0], setSessionSettings = _17[1];
574
+ var _18 = useState(sessionSettings), draftSessionSettings = _18[0], setDraftSessionSettings = _18[1];
507
575
  var drawerBootstrapTimerRef = useRef(null);
508
- var scrollDrawerBodyToTop = function () {
509
- if (typeof document === "undefined")
510
- return;
511
- window.requestAnimationFrame(function () {
512
- var drawerBody = document.querySelector(".sdix-drawer-body");
513
- drawerBody === null || drawerBody === void 0 ? void 0 : drawerBody.scrollTo({ top: 0, left: 0 });
514
- });
515
- };
516
- var _7 = usePreviewDatasourceIntrospectionMappingMutation(), previewMapping = _7[0], isPreviewMappingLoading = _7[1].isLoading;
517
- var _8 = useApplyDatasourceIntrospectionMappingMutation(), applyMapping = _8[0], isApplyMappingLoading = _8[1].isLoading;
576
+ var _19 = usePreviewDatasourceIntrospectionMappingMutation(), previewMapping = _19[0], isPreviewMappingLoading = _19[1].isLoading;
577
+ var _20 = useApplyDatasourceIntrospectionMappingMutation(), applyMapping = _20[0], isApplyMappingLoading = _20[1].isLoading;
578
+ var _21 = useCreateDatasourceIntrospectionMigrationArtifactsMutation(), createMigrationArtifacts = _21[0], isCreateMigrationArtifactsLoading = _21[1].isLoading;
579
+ var _22 = useGenerateDatasourceIntrospectionCodeMutation(), generateCode = _22[0], isGenerateCodeLoading = _22[1].isLoading;
580
+ var _23 = useRunDatasourceIntrospectionMigrationMutation(), runMigration = _23[0], isRunMigrationLoading = _23[1].isLoading;
518
581
  var isSavingMapping = isApplyMappingLoading;
582
+ var isCreatingMigrationArtifacts = isCreateMigrationArtifactsLoading;
519
583
  useEffect(function () {
520
584
  if (!bootstrap)
521
585
  return;
@@ -526,13 +590,22 @@ export function DatasourceIntrospectionPage() {
526
590
  }
527
591
  }, [bootstrap, selectedDatasource]);
528
592
  useEffect(function () {
529
- setSelectedTableKey("");
593
+ setSelectedRows([]);
594
+ setWorkspaceTableKey("");
530
595
  setDrawerDraft(null);
531
- setDrawerOpen(false);
532
596
  setTableSearch("");
533
- setDrawerStep("edit");
534
- setReviewTab("metadata-json");
597
+ setWorkspaceStep("configure");
535
598
  setMappingPreview(null);
599
+ setPersistedMappingResult(null);
600
+ setMigrationArtifactsResult(null);
601
+ setGenerateCodeOutput("");
602
+ setIsGeneratingCodeWorkflow(false);
603
+ setGenerateCodeStatusMessage("");
604
+ setGenerateCodeTimeoutMessage(null);
605
+ setGenerateCodeReady(false);
606
+ setHasAttemptedGenerateCode(false);
607
+ setRunMigrationOutput("");
608
+ setRunMigrationCompleted(false);
536
609
  setReviewedMetadataJsonValue(null);
537
610
  setMetadataJsonText("");
538
611
  setMetadataJsonValidationError(null);
@@ -543,11 +616,6 @@ export function DatasourceIntrospectionPage() {
543
616
  window.clearTimeout(drawerBootstrapTimerRef.current);
544
617
  }
545
618
  }; }, []);
546
- useEffect(function () {
547
- if (!drawerOpen)
548
- return;
549
- scrollDrawerBodyToTop();
550
- }, [drawerOpen, drawerStep, drawerTab, reviewTab, selectedTableKey]);
551
619
  var datasourceOptions = useMemo(function () {
552
620
  var _a;
553
621
  return ((_a = bootstrap === null || bootstrap === void 0 ? void 0 : bootstrap.datasources) !== null && _a !== void 0 ? _a : []).map(function (datasource) { return ({
@@ -555,23 +623,26 @@ export function DatasourceIntrospectionPage() {
555
623
  value: datasource.name,
556
624
  }); });
557
625
  }, [bootstrap]);
558
- var _9 = useGetDatasourceIntrospectionTablesQuery({ moduleId: moduleId, datasource: selectedDatasource }, {
626
+ var _24 = useGetDatasourceIntrospectionTablesQuery({ moduleId: moduleId, datasource: selectedDatasource }, {
559
627
  skip: !isValidModuleId || !selectedDatasource,
560
- }), tablesResponse = _9.data, isTablesLoading = _9.isLoading, isTablesFetching = _9.isFetching, tablesError = _9.error, refetchTables = _9.refetch;
561
- var selectedTable = useMemo(function () { var _a, _b; return (_b = (_a = tablesResponse === null || tablesResponse === void 0 ? void 0 : tablesResponse.records) === null || _a === void 0 ? void 0 : _a.find(function (record) { var _a; return "".concat((_a = record.schema) !== null && _a !== void 0 ? _a : "", "::").concat(record.tableName) === selectedTableKey; })) !== null && _b !== void 0 ? _b : null; }, [tablesResponse, selectedTableKey]);
562
- var _10 = useGetDatasourceIntrospectionTableDetailQuery({
628
+ }), tablesResponse = _24.data, isTablesLoading = _24.isLoading, isTablesFetching = _24.isFetching, tablesError = _24.error, refetchTables = _24.refetch;
629
+ var selectedListRow = (_b = selectedRows[0]) !== null && _b !== void 0 ? _b : null;
630
+ var selectedListRowKey = selectedListRow ? "".concat((_c = selectedListRow.schema) !== null && _c !== void 0 ? _c : "", "::").concat(selectedListRow.tableName) : "";
631
+ var isWorkspaceMode = Boolean(workspaceTableKey);
632
+ var selectedTable = useMemo(function () { var _a, _b; return (_b = (_a = tablesResponse === null || tablesResponse === void 0 ? void 0 : tablesResponse.records) === null || _a === void 0 ? void 0 : _a.find(function (record) { var _a; return "".concat((_a = record.schema) !== null && _a !== void 0 ? _a : "", "::").concat(record.tableName) === workspaceTableKey; })) !== null && _b !== void 0 ? _b : null; }, [tablesResponse, workspaceTableKey]);
633
+ var _25 = useGetDatasourceIntrospectionTableDetailQuery({
563
634
  moduleId: moduleId,
564
635
  datasource: selectedDatasource,
565
- table: (_b = selectedTable === null || selectedTable === void 0 ? void 0 : selectedTable.tableName) !== null && _b !== void 0 ? _b : "",
566
- schema: (_c = selectedTable === null || selectedTable === void 0 ? void 0 : selectedTable.schema) !== null && _c !== void 0 ? _c : undefined,
636
+ table: (_d = selectedTable === null || selectedTable === void 0 ? void 0 : selectedTable.tableName) !== null && _d !== void 0 ? _d : "",
637
+ schema: (_e = selectedTable === null || selectedTable === void 0 ? void 0 : selectedTable.schema) !== null && _e !== void 0 ? _e : undefined,
567
638
  }, {
568
- skip: !drawerOpen || !isValidModuleId || !selectedDatasource || !selectedTable || !!(tablesResponse === null || tablesResponse === void 0 ? void 0 : tablesResponse.synchronizeBlocked),
569
- }), tableDetail = _10.data, isTableDetailLoading = _10.isLoading, isTableDetailFetching = _10.isFetching, tableDetailError = _10.error, refetchTableDetail = _10.refetch;
570
- var _11 = useGetmodelByIdQuery((_d = selectedTable === null || selectedTable === void 0 ? void 0 : selectedTable.mappedModelId) !== null && _d !== void 0 ? _d : 0, {
571
- skip: !drawerOpen || !(selectedTable === null || selectedTable === void 0 ? void 0 : selectedTable.mapped) || !(selectedTable === null || selectedTable === void 0 ? void 0 : selectedTable.mappedModelId),
572
- }), mappedModelResponse = _11.data, isMappedModelLoading = _11.isLoading, isMappedModelFetching = _11.isFetching, mappedModelError = _11.error;
639
+ skip: !isWorkspaceMode || !isValidModuleId || !selectedDatasource || !selectedTable || !!(tablesResponse === null || tablesResponse === void 0 ? void 0 : tablesResponse.synchronizeBlocked),
640
+ }), tableDetail = _25.data, isTableDetailLoading = _25.isLoading, isTableDetailFetching = _25.isFetching, tableDetailError = _25.error, refetchTableDetail = _25.refetch;
641
+ var _26 = useGetmodelByIdQuery((_f = selectedTable === null || selectedTable === void 0 ? void 0 : selectedTable.mappedModelId) !== null && _f !== void 0 ? _f : 0, {
642
+ skip: !isWorkspaceMode || !(selectedTable === null || selectedTable === void 0 ? void 0 : selectedTable.mapped) || !(selectedTable === null || selectedTable === void 0 ? void 0 : selectedTable.mappedModelId),
643
+ }), mappedModelResponse = _26.data, isMappedModelLoading = _26.isLoading, isMappedModelFetching = _26.isFetching, mappedModelError = _26.error;
573
644
  var mappedModelData = mappedModelResponse === null || mappedModelResponse === void 0 ? void 0 : mappedModelResponse.data;
574
- var selectedDatasourceRecord = (_f = (_e = bootstrap === null || bootstrap === void 0 ? void 0 : bootstrap.datasources) === null || _e === void 0 ? void 0 : _e.find(function (datasource) { return datasource.name === selectedDatasource; })) !== null && _f !== void 0 ? _f : null;
645
+ var selectedDatasourceRecord = (_h = (_g = bootstrap === null || bootstrap === void 0 ? void 0 : bootstrap.datasources) === null || _g === void 0 ? void 0 : _g.find(function (datasource) { return datasource.name === selectedDatasource; })) !== null && _h !== void 0 ? _h : null;
575
646
  var drawerLoadingError = (selectedTable === null || selectedTable === void 0 ? void 0 : selectedTable.mapped) ? (tableDetailError || mappedModelError) : tableDetailError;
576
647
  var isDrawerBlockingLoading = Boolean(selectedTable
577
648
  && (drawerBootstrapping
@@ -580,7 +651,40 @@ export function DatasourceIntrospectionPage() {
580
651
  || isTableDetailFetching
581
652
  || (selectedTable.mapped && (isMappedModelLoading || isMappedModelFetching))));
582
653
  useEffect(function () {
583
- if (!drawerOpen || !selectedTable || !tableDetail)
654
+ if (!isWorkspaceMode) {
655
+ setDrawerDraft(null);
656
+ return;
657
+ }
658
+ if (drawerBootstrapTimerRef.current) {
659
+ window.clearTimeout(drawerBootstrapTimerRef.current);
660
+ }
661
+ setDrawerDraft(null);
662
+ setDrawerTab("general-info");
663
+ setWorkspaceStep("configure");
664
+ setMappingPreview(null);
665
+ setPersistedMappingResult(null);
666
+ setMigrationArtifactsResult(null);
667
+ setGenerateCodeOutput("");
668
+ setIsGeneratingCodeWorkflow(false);
669
+ setGenerateCodeStatusMessage("");
670
+ setGenerateCodeTimeoutMessage(null);
671
+ setGenerateCodeReady(false);
672
+ setHasAttemptedGenerateCode(false);
673
+ setRunMigrationOutput("");
674
+ setRunMigrationCompleted(false);
675
+ setReviewedMetadataJsonValue(null);
676
+ setMetadataJsonText("");
677
+ setMetadataJsonValidationError(null);
678
+ setMetadataJsonResetToken("table-".concat(workspaceTableKey, "-").concat(Date.now()));
679
+ setDrawerBootstrapping(true);
680
+ }, [isWorkspaceMode, workspaceTableKey]);
681
+ useEffect(function () {
682
+ if (!isWorkspaceMode || !selectedTable)
683
+ return;
684
+ setSelectedRows([selectedTable]);
685
+ }, [isWorkspaceMode, selectedTable]);
686
+ useEffect(function () {
687
+ if (!isWorkspaceMode || !selectedTable || !tableDetail)
584
688
  return;
585
689
  if (selectedTable.mapped && (!mappedModelData || mappedModelData.id !== selectedTable.mappedModelId))
586
690
  return;
@@ -591,15 +695,15 @@ export function DatasourceIntrospectionPage() {
591
695
  drawerBootstrapTimerRef.current = window.setTimeout(function () {
592
696
  setDrawerBootstrapping(false);
593
697
  }, 150);
594
- }, [drawerOpen, selectedTable, tableDetail, mappedModelData, mappedModelResponse]);
698
+ }, [isWorkspaceMode, selectedTable, tableDetail, mappedModelData, mappedModelResponse]);
595
699
  var filteredRecords = useMemo(function () {
596
700
  var _a;
597
701
  var records = __spreadArray([], ((_a = tablesResponse === null || tablesResponse === void 0 ? void 0 : tablesResponse.records) !== null && _a !== void 0 ? _a : []), true);
598
702
  var searchNeedle = tableSearch.trim().toLowerCase();
599
703
  var filtered = searchNeedle
600
704
  ? records.filter(function (record) {
601
- var _a, _b, _c;
602
- var haystack = "".concat(record.tableName, " ").concat((_a = record.schema) !== null && _a !== void 0 ? _a : "", " ").concat((_b = record.mappedModelSingularName) !== null && _b !== void 0 ? _b : "", " ").concat((_c = record.mappedModelDisplayName) !== null && _c !== void 0 ? _c : "").toLowerCase();
705
+ var _a, _b, _c, _d, _e;
706
+ var haystack = "".concat(record.tableName, " ").concat((_a = record.schema) !== null && _a !== void 0 ? _a : "", " ").concat((_b = record.mappedModelSingularName) !== null && _b !== void 0 ? _b : "", " ").concat((_c = record.mappedModelDisplayName) !== null && _c !== void 0 ? _c : "", " ").concat((_d = record.mappedModuleName) !== null && _d !== void 0 ? _d : "", " ").concat((_e = record.mappedModuleDisplayName) !== null && _e !== void 0 ? _e : "").toLowerCase();
603
707
  return haystack.includes(searchNeedle);
604
708
  })
605
709
  : records;
@@ -639,7 +743,7 @@ export function DatasourceIntrospectionPage() {
639
743
  {
640
744
  value: "datasource-info",
641
745
  label: "Datasource Info",
642
- content: (_jsxs("div", { className: "sdix-settings-grid", children: [_jsxs("div", { className: "sdix-settings-static", children: [_jsx("span", { children: "Target module" }), _jsx("strong", { children: (_g = bootstrap === null || bootstrap === void 0 ? void 0 : bootstrap.module) === null || _g === void 0 ? void 0 : _g.displayName })] }), _jsxs("div", { className: "sdix-settings-static", children: [_jsx("span", { children: "Default datasource" }), _jsx("strong", { children: ((_h = bootstrap === null || bootstrap === void 0 ? void 0 : bootstrap.module) === null || _h === void 0 ? void 0 : _h.defaultDataSource) || "Not set" })] }), _jsxs("div", { className: "sdix-settings-static", children: [_jsx("span", { children: "Datasource name" }), _jsx("strong", { children: (selectedDatasourceRecord === null || selectedDatasourceRecord === void 0 ? void 0 : selectedDatasourceRecord.displayName) || "Not selected" })] }), _jsxs("div", { className: "sdix-settings-static", children: [_jsx("span", { children: "Datasource type" }), _jsx("strong", { children: selectedDatasourceRecord ? providerLabel(selectedDatasourceRecord.type) : "-" })] }), _jsxs("div", { className: "sdix-settings-static", children: [_jsx("span", { children: "Host" }), _jsx("strong", { children: (selectedDatasourceRecord === null || selectedDatasourceRecord === void 0 ? void 0 : selectedDatasourceRecord.host) || "-" })] }), _jsxs("div", { className: "sdix-settings-static", children: [_jsx("span", { children: "Port" }), _jsx("strong", { children: (_j = selectedDatasourceRecord === null || selectedDatasourceRecord === void 0 ? void 0 : selectedDatasourceRecord.port) !== null && _j !== void 0 ? _j : "-" })] }), _jsxs("div", { className: "sdix-settings-static", children: [_jsx("span", { children: "Database" }), _jsx("strong", { children: (selectedDatasourceRecord === null || selectedDatasourceRecord === void 0 ? void 0 : selectedDatasourceRecord.database) || "-" })] }), _jsxs("div", { className: "sdix-settings-static", children: [_jsx("span", { children: "Env Prefix" }), _jsx("strong", { children: (selectedDatasourceRecord === null || selectedDatasourceRecord === void 0 ? void 0 : selectedDatasourceRecord.envPrefix) || "-" })] }), _jsxs("div", { className: "sdix-settings-static", children: [_jsx("span", { children: "Synchronize" }), _jsx("strong", { children: selectedDatasourceRecord ? (selectedDatasourceRecord.synchronize === true ? "true" : "false") : "-" })] })] })),
746
+ content: (_jsxs("div", { className: "sdix-settings-grid", children: [_jsxs("div", { className: "sdix-settings-static", children: [_jsx("span", { children: "Target module" }), _jsx("strong", { children: (_j = bootstrap === null || bootstrap === void 0 ? void 0 : bootstrap.module) === null || _j === void 0 ? void 0 : _j.displayName })] }), _jsxs("div", { className: "sdix-settings-static", children: [_jsx("span", { children: "Default datasource" }), _jsx("strong", { children: ((_k = bootstrap === null || bootstrap === void 0 ? void 0 : bootstrap.module) === null || _k === void 0 ? void 0 : _k.defaultDataSource) || "Not set" })] }), _jsxs("div", { className: "sdix-settings-static", children: [_jsx("span", { children: "Datasource name" }), _jsx("strong", { children: (selectedDatasourceRecord === null || selectedDatasourceRecord === void 0 ? void 0 : selectedDatasourceRecord.displayName) || "Not selected" })] }), _jsxs("div", { className: "sdix-settings-static", children: [_jsx("span", { children: "Datasource type" }), _jsx("strong", { children: selectedDatasourceRecord ? providerLabel(selectedDatasourceRecord.type) : "-" })] }), _jsxs("div", { className: "sdix-settings-static", children: [_jsx("span", { children: "Host" }), _jsx("strong", { children: (selectedDatasourceRecord === null || selectedDatasourceRecord === void 0 ? void 0 : selectedDatasourceRecord.host) || "-" })] }), _jsxs("div", { className: "sdix-settings-static", children: [_jsx("span", { children: "Port" }), _jsx("strong", { children: (_l = selectedDatasourceRecord === null || selectedDatasourceRecord === void 0 ? void 0 : selectedDatasourceRecord.port) !== null && _l !== void 0 ? _l : "-" })] }), _jsxs("div", { className: "sdix-settings-static", children: [_jsx("span", { children: "Database" }), _jsx("strong", { children: (selectedDatasourceRecord === null || selectedDatasourceRecord === void 0 ? void 0 : selectedDatasourceRecord.database) || "-" })] }), _jsxs("div", { className: "sdix-settings-static", children: [_jsx("span", { children: "Env Prefix" }), _jsx("strong", { children: (selectedDatasourceRecord === null || selectedDatasourceRecord === void 0 ? void 0 : selectedDatasourceRecord.envPrefix) || "-" })] }), _jsxs("div", { className: "sdix-settings-static", children: [_jsx("span", { children: "Synchronize" }), _jsx("strong", { children: selectedDatasourceRecord ? (selectedDatasourceRecord.synchronize === true ? "true" : "false") : "-" })] })] })),
643
747
  },
644
748
  {
645
749
  value: "session-settings",
@@ -659,7 +763,7 @@ export function DatasourceIntrospectionPage() {
659
763
  _a.sent();
660
764
  _a.label = 3;
661
765
  case 3:
662
- if (!selectedTable) return [3 /*break*/, 5];
766
+ if (!(isWorkspaceMode && selectedTable)) return [3 /*break*/, 5];
663
767
  return [4 /*yield*/, refetchTableDetail()];
664
768
  case 4:
665
769
  _a.sent();
@@ -668,23 +772,38 @@ export function DatasourceIntrospectionPage() {
668
772
  }
669
773
  });
670
774
  }); };
671
- var openTableDrawer = function (record) {
672
- var _a, _b;
775
+ var startMappingForRecord = function (record) {
776
+ var _a;
673
777
  if (drawerBootstrapTimerRef.current) {
674
778
  window.clearTimeout(drawerBootstrapTimerRef.current);
675
779
  }
676
- setSelectedTableKey("".concat((_a = record.schema) !== null && _a !== void 0 ? _a : "", "::").concat(record.tableName));
780
+ setSelectedRows([record]);
781
+ setWorkspaceTableKey("".concat((_a = record.schema) !== null && _a !== void 0 ? _a : "", "::").concat(record.tableName));
782
+ };
783
+ var leaveWorkspace = function () {
784
+ if (drawerBootstrapTimerRef.current) {
785
+ window.clearTimeout(drawerBootstrapTimerRef.current);
786
+ }
787
+ setWorkspaceTableKey("");
677
788
  setDrawerDraft(null);
789
+ setWorkspaceStep("configure");
678
790
  setDrawerTab("general-info");
679
- setDrawerStep("edit");
680
- setReviewTab("metadata-json");
681
791
  setMappingPreview(null);
792
+ setPersistedMappingResult(null);
793
+ setMigrationArtifactsResult(null);
794
+ setGenerateCodeOutput("");
795
+ setIsGeneratingCodeWorkflow(false);
796
+ setGenerateCodeStatusMessage("");
797
+ setGenerateCodeTimeoutMessage(null);
798
+ setGenerateCodeReady(false);
799
+ setHasAttemptedGenerateCode(false);
800
+ setRunMigrationOutput("");
801
+ setRunMigrationCompleted(false);
682
802
  setReviewedMetadataJsonValue(null);
683
803
  setMetadataJsonText("");
684
804
  setMetadataJsonValidationError(null);
685
- setMetadataJsonResetToken("table-".concat((_b = record.schema) !== null && _b !== void 0 ? _b : "default", "-").concat(record.tableName, "-").concat(Date.now()));
686
- setDrawerBootstrapping(true);
687
- setDrawerOpen(true);
805
+ setMetadataJsonResetToken("workspace-closed-".concat(Date.now()));
806
+ setDrawerBootstrapping(false);
688
807
  };
689
808
  var applyDraftSettings = function () {
690
809
  setSessionSettings(draftSessionSettings);
@@ -692,6 +811,15 @@ export function DatasourceIntrospectionPage() {
692
811
  };
693
812
  var updateDrawerDraft = function (updater) {
694
813
  setMappingPreview(null);
814
+ setPersistedMappingResult(null);
815
+ setMigrationArtifactsResult(null);
816
+ setGenerateCodeOutput("");
817
+ setIsGeneratingCodeWorkflow(false);
818
+ setGenerateCodeStatusMessage("");
819
+ setGenerateCodeTimeoutMessage(null);
820
+ setGenerateCodeReady(false);
821
+ setHasAttemptedGenerateCode(false);
822
+ setRunMigrationOutput("");
695
823
  setDrawerDraft(function (current) { return (current ? updater(current) : current); });
696
824
  };
697
825
  var updateGeneralField = function (field, value) {
@@ -706,12 +834,20 @@ export function DatasourceIntrospectionPage() {
706
834
  return (__assign(__assign({}, current), { columns: current.columns.map(function (column) {
707
835
  if (column.columnName !== columnName)
708
836
  return column;
709
- return __assign(__assign({}, column), { fieldName: camelCase(nextFieldName) });
837
+ var previousSuggestedLabel = startCase(column.fieldName);
838
+ var nextNormalizedFieldName = camelCase(nextFieldName);
839
+ return __assign(__assign({}, column), { fieldName: nextNormalizedFieldName, displayName: !column.displayName.trim() || column.displayName === previousSuggestedLabel
840
+ ? startCase(nextNormalizedFieldName)
841
+ : column.displayName });
710
842
  }), userKeyField: current.userKeyField === ((_a = current.columns.find(function (column) { return column.columnName === columnName; })) === null || _a === void 0 ? void 0 : _a.fieldName)
711
843
  ? camelCase(nextFieldName)
712
844
  : current.userKeyField }));
713
845
  });
714
846
  };
847
+ var updateColumnDisplayName = function (columnName, nextDisplayName) {
848
+ updateDrawerDraft(function (current) { return (__assign(__assign({}, current), { columns: current.columns.map(function (column) { return (column.columnName === columnName
849
+ ? __assign(__assign({}, column), { displayName: nextDisplayName }) : column); }) })); });
850
+ };
715
851
  var updateColumnSolidFieldType = function (columnName, nextSolidFieldType) {
716
852
  updateDrawerDraft(function (current) { return (__assign(__assign({}, current), { columns: current.columns.map(function (column) {
717
853
  if (column.columnName !== columnName)
@@ -721,6 +857,33 @@ export function DatasourceIntrospectionPage() {
721
857
  return __assign(__assign({}, column), { solidFieldType: nextSolidFieldType, ormType: getDefaultOrmTypeForSolidFieldType(current.dataSourceType, nextSolidFieldType) });
722
858
  }) })); });
723
859
  };
860
+ var updateLegacyTableType = function (legacyTableType) {
861
+ updateDrawerDraft(function (current) {
862
+ var _a;
863
+ var renamedUserKeyColumns = new Map();
864
+ var columns = current.columns.map(function (column) {
865
+ var nextSuperclassFieldName = getSuperclassFieldNameForLegacyType(column.columnName, legacyTableType);
866
+ var nextHandledBySuperclass = Boolean(nextSuperclassFieldName);
867
+ var nextSuggestedFieldName = getSuggestedFieldNameForLegacyType(column, legacyTableType);
868
+ var shouldRebuildFieldName = column.handledBySuperclass !== nextHandledBySuperclass
869
+ || (legacyTableType === "existing_id" && column.isAutoGenerated && (column.fieldName === "id" || column.fieldName === "legacyId"))
870
+ || (legacyTableType === "generated_id" && column.columnName.toLowerCase() === "id");
871
+ var nextFieldName = shouldRebuildFieldName ? nextSuggestedFieldName : column.fieldName;
872
+ var nextDisplayName = !column.displayName.trim() || column.displayName === startCase(column.fieldName)
873
+ ? startCase(nextFieldName)
874
+ : column.displayName;
875
+ var nextInclude = nextHandledBySuperclass
876
+ ? false
877
+ : (legacyTableType === "existing_id" && column.isAutoGenerated ? true : column.include);
878
+ var nextIsPrimaryKey = (legacyTableType === "existing_id" && column.isAutoGenerated && nextFieldName === "id") || (legacyTableType === "generated_id" && column.isDetectedPrimaryKey);
879
+ if (current.userKeyField === column.fieldName && current.userKeyField !== nextFieldName) {
880
+ renamedUserKeyColumns.set(column.fieldName, nextFieldName);
881
+ }
882
+ return __assign(__assign({}, column), { fieldName: nextFieldName, displayName: nextDisplayName, handledBySuperclass: nextHandledBySuperclass, superclassFieldName: nextSuperclassFieldName, include: nextInclude, isPrimaryKey: nextIsPrimaryKey });
883
+ });
884
+ return __assign(__assign({}, current), { legacyTableType: legacyTableType, baseClassName: getBaseClassNameForLegacyType(legacyTableType), columns: columns, userKeyField: (_a = renamedUserKeyColumns.get(current.userKeyField)) !== null && _a !== void 0 ? _a : current.userKeyField });
885
+ });
886
+ };
724
887
  var setColumnIncluded = function (columnName, include) {
725
888
  updateDrawerDraft(function (current) { return (__assign(__assign({}, current), { columns: current.columns.map(function (column) {
726
889
  if (column.columnName !== columnName)
@@ -749,7 +912,7 @@ export function DatasourceIntrospectionPage() {
749
912
  return;
750
913
  window.open("/admin/core/solid-core/model-metadata/form/".concat(targetModelId), "_blank", "noopener,noreferrer");
751
914
  };
752
- var viewChanges = function () { return __awaiter(_this, void 0, void 0, function () {
915
+ var reviewMappingJson = function () { return __awaiter(_this, void 0, void 0, function () {
753
916
  var validationErrors, preview, error_1;
754
917
  var _a;
755
918
  return __generator(this, function (_b) {
@@ -778,8 +941,11 @@ export function DatasourceIntrospectionPage() {
778
941
  setMetadataJsonText(JSON.stringify(preview.metadataJson.model, null, 2));
779
942
  setMetadataJsonValidationError(null);
780
943
  setMetadataJsonResetToken("preview-".concat(preview.metadataJson.filePath, "-").concat(Date.now()));
781
- setReviewTab("metadata-json");
782
- setDrawerStep("review");
944
+ setPersistedMappingResult(null);
945
+ setMigrationArtifactsResult(null);
946
+ setGenerateCodeOutput("");
947
+ setRunMigrationOutput("");
948
+ setWorkspaceStep("review-json");
783
949
  return [3 /*break*/, 4];
784
950
  case 3:
785
951
  error_1 = _b.sent();
@@ -793,8 +959,8 @@ export function DatasourceIntrospectionPage() {
793
959
  }
794
960
  });
795
961
  }); };
796
- var saveMapping = function () { return __awaiter(_this, void 0, void 0, function () {
797
- var validationErrors, reviewedModelValidation, response, error_2;
962
+ var persistMappingArtifacts = function () { return __awaiter(_this, void 0, void 0, function () {
963
+ var validationErrors, reviewedModelValidation, response_1, error_2;
798
964
  var _a, _b, _c, _d;
799
965
  return __generator(this, function (_e) {
800
966
  switch (_e.label) {
@@ -806,14 +972,13 @@ export function DatasourceIntrospectionPage() {
806
972
  validationErrors.forEach(function (detail) {
807
973
  dispatch(showToast({ severity: "error", summary: "Validation", detail: detail }));
808
974
  });
809
- setDrawerStep("edit");
975
+ setWorkspaceStep("configure");
810
976
  return [2 /*return*/];
811
977
  }
812
978
  reviewedModelValidation = parseAndValidateReviewedModelJson(metadataJsonText, drawerDraft);
813
979
  if (reviewedModelValidation.error || !reviewedModelValidation.parsed) {
814
980
  setMetadataJsonValidationError((_b = reviewedModelValidation.error) !== null && _b !== void 0 ? _b : "Metadata JSON is invalid.");
815
- setReviewTab("metadata-json");
816
- setDrawerStep("review");
981
+ setWorkspaceStep("review-json");
817
982
  dispatch(showToast({
818
983
  severity: "error",
819
984
  summary: "Validation",
@@ -824,43 +989,207 @@ export function DatasourceIntrospectionPage() {
824
989
  setMetadataJsonValidationError(null);
825
990
  _e.label = 1;
826
991
  case 1:
827
- _e.trys.push([1, 5, , 6]);
992
+ _e.trys.push([1, 3, , 4]);
828
993
  return [4 /*yield*/, applyMapping({
829
994
  moduleId: bootstrap.module.id,
830
995
  payload: __assign(__assign({}, buildMappingRequest(drawerDraft, (_d = mappingPreview === null || mappingPreview === void 0 ? void 0 : mappingPreview.migration.timestamp) !== null && _d !== void 0 ? _d : null)), { reviewedModel: reviewedModelValidation.parsed }),
831
996
  }).unwrap()];
997
+ case 2:
998
+ response_1 = _e.sent();
999
+ dispatch(showToast({
1000
+ severity: "success",
1001
+ summary: "Mapping saved",
1002
+ detail: drawerDraft.mapped
1003
+ ? "The model mapping metadata was updated successfully."
1004
+ : "The model mapping metadata was created successfully.",
1005
+ }));
1006
+ setPersistedMappingResult(response_1);
1007
+ setMigrationArtifactsResult(null);
1008
+ setGenerateCodeOutput("");
1009
+ setIsGeneratingCodeWorkflow(false);
1010
+ setGenerateCodeStatusMessage("");
1011
+ setGenerateCodeTimeoutMessage(null);
1012
+ setGenerateCodeReady(false);
1013
+ setHasAttemptedGenerateCode(false);
1014
+ setRunMigrationOutput("");
1015
+ setRunMigrationCompleted(false);
1016
+ setDrawerDraft(function (current) { return (current
1017
+ ? __assign(__assign({}, current), { mapped: true, modelId: response_1.modelId }) : current); });
1018
+ setWorkspaceStep("generate-code");
1019
+ return [3 /*break*/, 4];
1020
+ case 3:
1021
+ error_2 = _e.sent();
1022
+ dispatch(showToast({
1023
+ severity: "error",
1024
+ summary: "Save failed",
1025
+ detail: readQueryError(error_2),
1026
+ }));
1027
+ return [3 /*break*/, 4];
1028
+ case 4: return [2 /*return*/];
1029
+ }
1030
+ });
1031
+ }); };
1032
+ var handleGenerateCode = function () { return __awaiter(_this, void 0, void 0, function () {
1033
+ var responseMessage, response, error_3, isBackendAvailable;
1034
+ var _a;
1035
+ return __generator(this, function (_b) {
1036
+ switch (_b.label) {
1037
+ case 0:
1038
+ if (!((_a = bootstrap === null || bootstrap === void 0 ? void 0 : bootstrap.module) === null || _a === void 0 ? void 0 : _a.id))
1039
+ return [2 /*return*/];
1040
+ setHasAttemptedGenerateCode(true);
1041
+ setRunMigrationCompleted(false);
1042
+ setIsGeneratingCodeWorkflow(true);
1043
+ setGenerateCodeStatusMessage("Submitting module generate-code request...");
1044
+ setGenerateCodeTimeoutMessage(null);
1045
+ setGenerateCodeReady(false);
1046
+ responseMessage = "";
1047
+ _b.label = 1;
1048
+ case 1:
1049
+ _b.trys.push([1, 3, , 4]);
1050
+ return [4 /*yield*/, generateCode({ moduleId: bootstrap.module.id }).unwrap()];
1051
+ case 2:
1052
+ response = _b.sent();
1053
+ responseMessage = response.output || response.message || "";
1054
+ setGenerateCodeOutput(responseMessage);
1055
+ setGenerateCodeStatusMessage("Waiting briefly for the backend restart window...");
1056
+ return [3 /*break*/, 4];
1057
+ case 3:
1058
+ error_3 = _b.sent();
1059
+ if (!isRecoverableGenerateCodeError(error_3)) {
1060
+ setIsGeneratingCodeWorkflow(false);
1061
+ setGenerateCodeStatusMessage("");
1062
+ setGenerateCodeTimeoutMessage(null);
1063
+ setGenerateCodeReady(false);
1064
+ dispatch(showToast({
1065
+ severity: "error",
1066
+ summary: "Generate code failed",
1067
+ detail: readQueryError(error_3),
1068
+ }));
1069
+ return [2 /*return*/];
1070
+ }
1071
+ setGenerateCodeStatusMessage("The API connection dropped during restart. Waiting for the backend to come back online...");
1072
+ return [3 /*break*/, 4];
1073
+ case 4: return [4 /*yield*/, new Promise(function (resolve) { return window.setTimeout(resolve, 5000); })];
1074
+ case 5:
1075
+ _b.sent();
1076
+ setGenerateCodeStatusMessage("Checking if the backend is back online...");
1077
+ return [4 /*yield*/, waitForBackendAvailability({
1078
+ retries: 40,
1079
+ delayMs: 1500,
1080
+ })];
1081
+ case 6:
1082
+ isBackendAvailable = _b.sent();
1083
+ setIsGeneratingCodeWorkflow(false);
1084
+ if (!isBackendAvailable) {
1085
+ setGenerateCodeTimeoutMessage("Code generation took longer than expected. The backend did not come back within 60 seconds, so there may be a compilation failure or another startup issue. Please review the generated code manually and check the API logs before continuing.");
1086
+ dispatch(showToast({
1087
+ severity: "warn",
1088
+ summary: "Backend restart taking too long",
1089
+ detail: "The generate-code request completed, but the backend did not come back within 60 seconds.",
1090
+ }));
1091
+ return [2 /*return*/];
1092
+ }
1093
+ setGenerateCodeStatusMessage("Backend is back online. You can continue.");
1094
+ setGenerateCodeReady(true);
1095
+ setMigrationArtifactsResult(null);
1096
+ setRunMigrationOutput("");
1097
+ dispatch(showToast({
1098
+ severity: "success",
1099
+ summary: "Code generated",
1100
+ detail: responseMessage || "The backend is back online. You can continue to the migration artifacts step.",
1101
+ }));
1102
+ return [2 /*return*/];
1103
+ }
1104
+ });
1105
+ }); };
1106
+ var handleCreateMigrationArtifacts = function () { return __awaiter(_this, void 0, void 0, function () {
1107
+ var reviewedModelValidation, response, error_4;
1108
+ var _a, _b, _c, _d;
1109
+ return __generator(this, function (_e) {
1110
+ switch (_e.label) {
1111
+ case 0:
1112
+ if (!drawerDraft || !((_a = bootstrap === null || bootstrap === void 0 ? void 0 : bootstrap.module) === null || _a === void 0 ? void 0 : _a.id) || !(persistedMappingResult === null || persistedMappingResult === void 0 ? void 0 : persistedMappingResult.modelId))
1113
+ return [2 /*return*/];
1114
+ reviewedModelValidation = parseAndValidateReviewedModelJson(metadataJsonText, drawerDraft);
1115
+ if (reviewedModelValidation.error || !reviewedModelValidation.parsed) {
1116
+ setMetadataJsonValidationError((_b = reviewedModelValidation.error) !== null && _b !== void 0 ? _b : "Metadata JSON is invalid.");
1117
+ setWorkspaceStep("review-json");
1118
+ dispatch(showToast({
1119
+ severity: "error",
1120
+ summary: "Validation",
1121
+ detail: (_c = reviewedModelValidation.error) !== null && _c !== void 0 ? _c : "Metadata JSON is invalid.",
1122
+ }));
1123
+ return [2 /*return*/];
1124
+ }
1125
+ _e.label = 1;
1126
+ case 1:
1127
+ _e.trys.push([1, 3, , 4]);
1128
+ return [4 /*yield*/, createMigrationArtifacts({
1129
+ moduleId: bootstrap.module.id,
1130
+ payload: __assign(__assign({}, buildMappingRequest(__assign(__assign({}, drawerDraft), { mapped: true, modelId: persistedMappingResult.modelId }), (_d = mappingPreview === null || mappingPreview === void 0 ? void 0 : mappingPreview.migration.timestamp) !== null && _d !== void 0 ? _d : null)), { reviewedModel: reviewedModelValidation.parsed }),
1131
+ }).unwrap()];
832
1132
  case 2:
833
1133
  response = _e.sent();
1134
+ setMigrationArtifactsResult(response);
1135
+ setWorkspaceStep("run-migration");
834
1136
  dispatch(showToast({
835
1137
  severity: "success",
836
- summary: "Saved",
1138
+ summary: "Migration artifacts created",
837
1139
  detail: response.migration.written
838
- ? "The mapping, metadata JSON, and migration template were written successfully."
839
- : drawerDraft.mapped
840
- ? "The model mapping was updated and written back to metadata JSON."
841
- : "The model mapping was created and written to metadata JSON.",
1140
+ ? "The migration file and datasource registration were written successfully."
1141
+ : "No migration file was required, but the datasource registration was updated successfully.",
1142
+ }));
1143
+ return [3 /*break*/, 4];
1144
+ case 3:
1145
+ error_4 = _e.sent();
1146
+ dispatch(showToast({
1147
+ severity: "error",
1148
+ summary: "Create migration artifacts failed",
1149
+ detail: readQueryError(error_4),
1150
+ }));
1151
+ return [3 /*break*/, 4];
1152
+ case 4: return [2 /*return*/];
1153
+ }
1154
+ });
1155
+ }); };
1156
+ var handleRunMigration = function () { return __awaiter(_this, void 0, void 0, function () {
1157
+ var response, error_5;
1158
+ var _a;
1159
+ return __generator(this, function (_b) {
1160
+ switch (_b.label) {
1161
+ case 0:
1162
+ if (!((_a = bootstrap === null || bootstrap === void 0 ? void 0 : bootstrap.module) === null || _a === void 0 ? void 0 : _a.id) || !selectedDatasource)
1163
+ return [2 /*return*/];
1164
+ _b.label = 1;
1165
+ case 1:
1166
+ _b.trys.push([1, 5, , 6]);
1167
+ return [4 /*yield*/, runMigration({
1168
+ moduleId: bootstrap.module.id,
1169
+ datasource: selectedDatasource,
1170
+ }).unwrap()];
1171
+ case 2:
1172
+ response = _b.sent();
1173
+ setRunMigrationOutput(response.output || response.message || "");
1174
+ setRunMigrationCompleted(true);
1175
+ dispatch(showToast({
1176
+ severity: "success",
1177
+ summary: "Migration complete",
1178
+ detail: response.message || "Migrations ran successfully for datasource \"".concat(selectedDatasource, "\"."),
842
1179
  }));
843
- setDrawerOpen(false);
844
- setDrawerDraft(null);
845
- setMappingPreview(null);
846
- setReviewedMetadataJsonValue(null);
847
- setMetadataJsonText("");
848
- setMetadataJsonValidationError(null);
849
- setMetadataJsonResetToken("saved-".concat(Date.now()));
850
- setDrawerStep("edit");
851
1180
  return [4 /*yield*/, refetchTables()];
852
1181
  case 3:
853
- _e.sent();
1182
+ _b.sent();
854
1183
  return [4 /*yield*/, refetchBootstrap()];
855
1184
  case 4:
856
- _e.sent();
1185
+ _b.sent();
857
1186
  return [3 /*break*/, 6];
858
1187
  case 5:
859
- error_2 = _e.sent();
1188
+ error_5 = _b.sent();
860
1189
  dispatch(showToast({
861
1190
  severity: "error",
862
- summary: "Save failed",
863
- detail: readQueryError(error_2),
1191
+ summary: "Run migration failed",
1192
+ detail: readQueryError(error_5),
864
1193
  }));
865
1194
  return [3 /*break*/, 6];
866
1195
  case 6: return [2 /*return*/];
@@ -870,21 +1199,84 @@ export function DatasourceIntrospectionPage() {
870
1199
  if (!isValidModuleId) {
871
1200
  return (_jsx("div", { className: "sdix-page", children: _jsxs("div", { className: "sdix-empty-state", children: [_jsx(ShieldAlert, { size: 24 }), _jsx("h2", { children: "Module not found" }), _jsx("p", { children: "Open datasource introspection from a saved module so SolidX knows which module should receive the mapped models." })] }) }));
872
1201
  }
873
- var selectableUnmappedColumns = (_k = drawerDraft === null || drawerDraft === void 0 ? void 0 : drawerDraft.columns.filter(function (column) { return !column.handledBySuperclass && !column.matched && !column.isPrimaryKey; })) !== null && _k !== void 0 ? _k : [];
1202
+ var stepSequence = [
1203
+ "configure",
1204
+ "review-json",
1205
+ "generate-code",
1206
+ "create-migrations",
1207
+ "run-migration",
1208
+ ];
1209
+ var currentStepIndex = stepSequence.indexOf(workspaceStep);
1210
+ var stepperItems = [
1211
+ {
1212
+ key: "configure",
1213
+ label: "Configure Mapping",
1214
+ complete: currentStepIndex > 0,
1215
+ active: workspaceStep === "configure",
1216
+ disabled: false,
1217
+ onClick: function () { return setWorkspaceStep("configure"); },
1218
+ },
1219
+ {
1220
+ key: "review-json",
1221
+ label: "Review Mapping JSON",
1222
+ complete: currentStepIndex > 1,
1223
+ active: workspaceStep === "review-json",
1224
+ disabled: !mappingPreview,
1225
+ onClick: function () {
1226
+ if (mappingPreview)
1227
+ setWorkspaceStep("review-json");
1228
+ },
1229
+ },
1230
+ {
1231
+ key: "generate-code",
1232
+ label: "Generate Code",
1233
+ complete: currentStepIndex > 2,
1234
+ active: workspaceStep === "generate-code",
1235
+ disabled: !persistedMappingResult,
1236
+ onClick: function () {
1237
+ if (persistedMappingResult)
1238
+ setWorkspaceStep("generate-code");
1239
+ },
1240
+ },
1241
+ {
1242
+ key: "create-migrations",
1243
+ label: "Create Migrations",
1244
+ complete: currentStepIndex > 3,
1245
+ active: workspaceStep === "create-migrations",
1246
+ disabled: !hasAttemptedGenerateCode,
1247
+ onClick: function () {
1248
+ if (hasAttemptedGenerateCode)
1249
+ setWorkspaceStep("create-migrations");
1250
+ },
1251
+ },
1252
+ {
1253
+ key: "run-migration",
1254
+ label: "Run Migration",
1255
+ complete: false,
1256
+ active: workspaceStep === "run-migration",
1257
+ disabled: !migrationArtifactsResult,
1258
+ onClick: function () {
1259
+ if (migrationArtifactsResult)
1260
+ setWorkspaceStep("run-migration");
1261
+ },
1262
+ },
1263
+ ];
1264
+ var selectableUnmappedColumns = (_m = drawerDraft === null || drawerDraft === void 0 ? void 0 : drawerDraft.columns.filter(function (column) { return !column.handledBySuperclass && !column.matched && !column.isPrimaryKey; })) !== null && _m !== void 0 ? _m : [];
874
1265
  var allSelectableUnmappedIncluded = selectableUnmappedColumns.length > 0
875
1266
  && selectableUnmappedColumns.every(function (column) { return column.include; });
876
- var drawerRawDdl = (_l = tableDetail === null || tableDetail === void 0 ? void 0 : tableDetail.rawDdl) !== null && _l !== void 0 ? _l : null;
1267
+ var drawerRawDdl = (_o = tableDetail === null || tableDetail === void 0 ? void 0 : tableDetail.rawDdl) !== null && _o !== void 0 ? _o : null;
877
1268
  var drawerTabs = drawerDraft ? [
878
1269
  {
879
1270
  value: "general-info",
880
1271
  label: "General Info",
881
- content: (_jsxs("div", { className: "sdix-drawer-form", children: [_jsxs("section", { className: "sdix-form-section", children: [_jsx("h4", { className: "solid-form-layout-label", children: "Model Info" }), _jsxs("div", { className: "sdix-form-grid", children: [_jsxs("div", { className: "sdix-form-field", children: [_jsx("label", { htmlFor: "sdix-singular-name", children: "Singular Name" }), _jsx(SolidInput, { id: "sdix-singular-name", value: drawerDraft.singularName, onChange: function (event) { return updateGeneralField("singularName", event.target.value); } })] }), _jsxs("div", { className: "sdix-form-field", children: [_jsx("label", { htmlFor: "sdix-plural-name", children: "Plural Name" }), _jsx(SolidInput, { id: "sdix-plural-name", value: drawerDraft.pluralName, onChange: function (event) { return updateGeneralField("pluralName", event.target.value); } })] }), _jsxs("div", { className: "sdix-form-field", children: [_jsx("label", { htmlFor: "sdix-display-name", children: "Display Name" }), _jsx(SolidInput, { id: "sdix-display-name", value: drawerDraft.displayName, onChange: function (event) { return updateGeneralField("displayName", event.target.value); } })] }), _jsxs("div", { className: "sdix-form-field", children: [_jsx("label", { htmlFor: "sdix-user-key-field", children: "User Key Field" }), _jsx(SolidSelect, { id: "sdix-user-key-field", value: drawerDraft.userKeyField, options: drawerUserKeyOptions, placeholder: "Select user key field", onChange: function (event) { return changeUserKeyField(event.value); } })] }), _jsxs("div", { className: "sdix-form-field sdix-form-field--full", children: [_jsx("label", { htmlFor: "sdix-description", children: "Description" }), _jsx(SolidTextarea, { id: "sdix-description", rows: 3, value: drawerDraft.description, onChange: function (event) { return updateGeneralField("description", event.target.value); } })] })] })] }), _jsxs("section", { className: "sdix-form-section", children: [_jsx("h4", { className: "solid-form-layout-label", children: "Datasource Binding" }), _jsxs("div", { className: "sdix-form-grid", children: [_jsxs("div", { className: "sdix-form-field", children: [_jsx("label", { htmlFor: "sdix-table-name", children: "Table Name" }), _jsx(SolidInput, { id: "sdix-table-name", value: drawerDraft.tableName, onChange: function (event) { return updateGeneralField("tableName", event.target.value); } })] }), _jsxs("div", { className: "sdix-form-field", children: [_jsx("label", { htmlFor: "sdix-schema-name", children: "Schema" }), _jsx(SolidInput, { id: "sdix-schema-name", value: (_m = drawerDraft.schema) !== null && _m !== void 0 ? _m : "default", disabled: true })] }), _jsxs("div", { className: "sdix-form-field", children: [_jsx("label", { htmlFor: "sdix-datasource-name", children: "Datasource" }), _jsx(SolidInput, { id: "sdix-datasource-name", value: drawerDraft.dataSource, disabled: true })] }), _jsxs("div", { className: "sdix-form-field", children: [_jsx("label", { htmlFor: "sdix-datasource-type", children: "Provider" }), _jsx(SolidInput, { id: "sdix-datasource-type", value: providerLabel(drawerDraft.dataSourceType), disabled: true })] }), _jsxs("div", { className: "sdix-form-field", children: [_jsx("label", { htmlFor: "sdix-legacy-type", children: "Legacy Strategy" }), _jsx(SolidInput, { id: "sdix-legacy-type", value: legacyTypeLabel(drawerDraft.legacyTableType), disabled: true })] }), _jsxs("div", { className: "sdix-form-field", children: [_jsx("label", { htmlFor: "sdix-base-class", children: "Superclass" }), _jsx(SolidInput, { id: "sdix-base-class", value: drawerDraft.baseClassName, disabled: true })] })] })] })] })),
1272
+ content: (_jsxs("div", { className: "sdix-drawer-form", children: [_jsxs("section", { className: "sdix-form-section", children: [_jsx("h4", { className: "solid-form-layout-label", children: "Model Info" }), _jsxs("div", { className: "sdix-form-grid", children: [_jsxs("div", { className: "sdix-form-field", children: [_jsx("label", { htmlFor: "sdix-singular-name", children: "Singular Name" }), _jsx(SolidInput, { id: "sdix-singular-name", value: drawerDraft.singularName, onChange: function (event) { return updateGeneralField("singularName", event.target.value); } })] }), _jsxs("div", { className: "sdix-form-field", children: [_jsx("label", { htmlFor: "sdix-plural-name", children: "Plural Name" }), _jsx(SolidInput, { id: "sdix-plural-name", value: drawerDraft.pluralName, onChange: function (event) { return updateGeneralField("pluralName", event.target.value); } })] }), _jsxs("div", { className: "sdix-form-field", children: [_jsx("label", { htmlFor: "sdix-display-name", children: "Display Name" }), _jsx(SolidInput, { id: "sdix-display-name", value: drawerDraft.displayName, onChange: function (event) { return updateGeneralField("displayName", event.target.value); } })] }), _jsxs("div", { className: "sdix-form-field", children: [_jsx("label", { htmlFor: "sdix-user-key-field", children: "User Key Field" }), _jsx(SolidSelect, { id: "sdix-user-key-field", value: drawerDraft.userKeyField, options: drawerUserKeyOptions, placeholder: "Select user key field", onChange: function (event) { return changeUserKeyField(event.value); } })] }), _jsxs("div", { className: "sdix-form-field sdix-form-field--full", children: [_jsx("label", { htmlFor: "sdix-description", children: "Description" }), _jsx(SolidTextarea, { className: "sdix-description-textarea", id: "sdix-description", rows: 2, value: drawerDraft.description, onChange: function (event) { return updateGeneralField("description", event.target.value); } })] })] })] }), _jsxs("section", { className: "sdix-form-section", children: [_jsx("h4", { className: "solid-form-layout-label", children: "Datasource Binding" }), _jsxs("div", { className: "sdix-form-grid", children: [_jsxs("div", { className: "sdix-form-field", children: [_jsx("label", { htmlFor: "sdix-table-name", children: "Table Name" }), _jsx(SolidInput, { id: "sdix-table-name", value: drawerDraft.tableName, onChange: function (event) { return updateGeneralField("tableName", event.target.value); } })] }), _jsxs("div", { className: "sdix-form-field", children: [_jsx("label", { htmlFor: "sdix-schema-name", children: "Schema" }), _jsx(SolidInput, { id: "sdix-schema-name", value: (_p = drawerDraft.schema) !== null && _p !== void 0 ? _p : "default", disabled: true })] }), _jsxs("div", { className: "sdix-form-field", children: [_jsx("label", { htmlFor: "sdix-datasource-name", children: "Datasource" }), _jsx(SolidInput, { id: "sdix-datasource-name", value: drawerDraft.dataSource, disabled: true })] }), _jsxs("div", { className: "sdix-form-field", children: [_jsx("label", { htmlFor: "sdix-datasource-type", children: "Provider" }), _jsx(SolidInput, { id: "sdix-datasource-type", value: providerLabel(drawerDraft.dataSourceType), disabled: true })] }), _jsxs("div", { className: "sdix-form-field", children: [_jsx("label", { htmlFor: "sdix-legacy-type", children: "Mapping Strategy" }), _jsx(SolidSelect, { id: "sdix-legacy-type", value: drawerDraft.legacyTableType, options: mappingStrategyOptions, onChange: function (event) { return updateLegacyTableType(event.value); } }), _jsxs("small", { className: "sdix-inline-note", children: ["This will use ", _jsx("strong", { children: drawerDraft.baseClassName }), " for the generated entity."] })] })] })] })] })),
882
1273
  },
883
1274
  {
884
1275
  value: "columns-mapping",
885
1276
  label: "Columns Mapping",
886
- content: (_jsxs("div", { className: "sdix-columns", children: [_jsx("div", { className: "sdix-columns__toolbar", children: _jsxs("div", { className: "sdix-columns__legend", "aria-label": "Column legend", children: [_jsx("span", { className: "sdix-status-badge is-superclass", children: "System column" }), _jsx("span", { className: "sdix-status-badge is-muted", children: "Application column" })] }) }), _jsxs("div", { className: "sdix-column-table", children: [_jsxs("div", { className: "sdix-column-row sdix-column-row--head sdix-column-row--mapping", children: [_jsx("span", { children: "Column" }), _jsx("span", { children: "Field" }), _jsx("span", { children: "Database" }), _jsx("span", { children: "SolidX" }), _jsx("span", { className: "sdix-column-select-header", children: selectableUnmappedColumns.length ? (_jsx(SolidCheckbox, { checked: allSelectableUnmappedIncluded, onChange: function (event) { return setUnmappedColumnsIncluded(event.target.checked); }, "aria-label": allSelectableUnmappedIncluded ? "Deselect all unmapped columns" : "Select all unmapped columns" })) : ("Include") }), _jsx("span", { children: "Status" }), _jsx("span", { children: "Action" })] }), drawerDraft.columns.map(function (column) {
1277
+ content: (_jsxs("div", { className: "sdix-columns", children: [_jsx("div", { className: "sdix-columns__toolbar", children: _jsxs("div", { className: "sdix-columns__legend", "aria-label": "Column legend", children: [_jsx("span", { className: "sdix-status-badge is-superclass", children: "System column" }), _jsx("span", { className: "sdix-status-badge is-muted", children: "Application column" })] }) }), _jsxs("div", { className: "sdix-column-table", children: [_jsxs("div", { className: "sdix-column-row sdix-column-row--head sdix-column-row--mapping", children: [_jsx("span", { className: "sdix-column-select-header", children: selectableUnmappedColumns.length ? (_jsx(SolidCheckbox, { checked: allSelectableUnmappedIncluded, onChange: function (event) { return setUnmappedColumnsIncluded(event.target.checked); }, "aria-label": allSelectableUnmappedIncluded ? "Deselect all unmapped columns" : "Select all unmapped columns" })) : ("Include") }), _jsx("span", { children: "Column" }), _jsx("span", { children: "Field" }), _jsx("span", { children: "Label" }), _jsx("span", { children: "Database" }), _jsx("span", { children: "SolidX" }), _jsx("span", { children: "Status" }), _jsx("span", { children: "Action" })] }), drawerDraft.columns.map(function (column) {
887
1278
  var isUserKey = drawerDraft.userKeyField === column.fieldName;
1279
+ var isPrimaryKeyField = column.isPrimaryKey;
888
1280
  var statusClassName = column.handledBySuperclass
889
1281
  ? "is-superclass"
890
1282
  : column.include
@@ -901,7 +1293,7 @@ export function DatasourceIntrospectionPage() {
901
1293
  : column.matched
902
1294
  ? "Currently omitted"
903
1295
  : "Skipped for now";
904
- return (_jsxs("div", { className: "sdix-column-row sdix-column-row--mapping", children: [_jsxs("span", { className: "sdix-column-meta", children: [_jsx("strong", { children: column.columnName }), column.isAutoGenerated ? _jsx("small", { children: "Generated id column" }) : null] }), _jsxs("span", { children: [_jsx(SolidInput, { value: column.fieldName, disabled: column.handledBySuperclass, onChange: function (event) { return updateColumnFieldName(column.columnName, event.target.value); } }), isUserKey ? _jsx("small", { className: "sdix-inline-note", children: "User key" }) : null] }), _jsx("span", { className: "sdix-column-meta", children: _jsx("strong", { children: column.dataType }) }), _jsx("span", { children: column.handledBySuperclass ? (_jsx("span", { children: column.solidFieldType })) : (_jsx(SolidSelect, { value: column.solidFieldType, options: scalarFieldTypeOptions, onChange: function (event) { return updateColumnSolidFieldType(column.columnName, event.value); } })) }), _jsx("span", { className: "sdix-column-include", children: column.handledBySuperclass ? (_jsx("span", { className: "sdix-column-placeholder", children: "-" })) : column.matched ? (_jsx("span", { className: "sdix-column-placeholder", children: "-" })) : column.isPrimaryKey ? (_jsx(SolidCheckbox, { checked: true, disabled: true, label: "Required" })) : (_jsx(SolidCheckbox, { checked: column.include, onChange: function (event) { return setColumnIncluded(column.columnName, event.target.checked); } })) }), _jsx("span", { children: _jsx("span", { className: "sdix-status-badge ".concat(statusClassName), children: statusText }) }), _jsx("span", { className: "sdix-column-action", children: column.handledBySuperclass ? (_jsx(SolidButton, { size: "small", variant: "outline", disabled: true, children: "Managed" })) : column.isPrimaryKey ? (_jsx(SolidButton, { size: "small", variant: "outline", disabled: true, children: "Required" })) : column.matched ? (_jsx(SolidButton, { size: "small", variant: "outline", onClick: function () { return setColumnIncluded(column.columnName, false); }, children: "Remove mapping" })) : (_jsx("span", { className: "sdix-column-placeholder", children: "-" })) })] }, column.columnName));
1296
+ return (_jsxs("div", { className: "sdix-column-row sdix-column-row--mapping", children: [_jsx("span", { className: "sdix-column-include", children: column.handledBySuperclass ? (_jsx("span", { className: "sdix-column-placeholder", children: "-" })) : column.matched ? (_jsx("span", { className: "sdix-column-placeholder", children: "-" })) : column.isPrimaryKey ? (_jsx(SolidCheckbox, { checked: true, disabled: true, "aria-label": "Required included column" })) : (_jsx(SolidCheckbox, { checked: column.include, onChange: function (event) { return setColumnIncluded(column.columnName, event.target.checked); } })) }), _jsxs("span", { className: "sdix-column-meta", children: [_jsx("strong", { children: column.columnName }), column.isAutoGenerated ? _jsx("small", { children: "Generated id column" }) : null] }), _jsxs("span", { children: [_jsx(SolidInput, { value: column.fieldName, disabled: column.handledBySuperclass, onChange: function (event) { return updateColumnFieldName(column.columnName, event.target.value); } }), isUserKey || isPrimaryKeyField ? (_jsxs("div", { className: "sdix-inline-note-stack", children: [isUserKey ? _jsx("small", { className: "sdix-inline-note", children: "User key" }) : null, isPrimaryKeyField ? _jsx("small", { className: "sdix-inline-note", children: "Primary key" }) : null] })) : null] }), _jsx("span", { children: _jsx(SolidInput, { value: column.displayName, disabled: column.handledBySuperclass, onChange: function (event) { return updateColumnDisplayName(column.columnName, event.target.value); } }) }), _jsx("span", { className: "sdix-column-meta", children: _jsx("strong", { children: column.dataType }) }), _jsx("span", { children: column.handledBySuperclass ? (_jsx("span", { children: column.solidFieldType })) : (_jsx(SolidSelect, { value: column.solidFieldType, options: scalarFieldTypeOptions, onChange: function (event) { return updateColumnSolidFieldType(column.columnName, event.value); } })) }), _jsx("span", { children: _jsx("span", { className: "sdix-status-badge ".concat(statusClassName), children: statusText }) }), _jsx("span", { className: "sdix-column-action", children: column.handledBySuperclass ? (_jsx(SolidButton, { size: "small", variant: "outline", disabled: true, className: "sdix-column-action-chip sdix-column-action-chip--managed", children: "Managed" })) : column.isPrimaryKey ? (_jsx(SolidButton, { size: "small", variant: "outline", disabled: true, className: "sdix-column-action-chip sdix-column-action-chip--required", children: "Required" })) : column.matched ? (_jsx(SolidButton, { size: "small", variant: "outline", onClick: function () { return setColumnIncluded(column.columnName, false); }, children: "Remove mapping" })) : (_jsx("span", { className: "sdix-column-placeholder", children: "-" })) })] }, column.columnName));
905
1297
  })] })] })),
906
1298
  },
907
1299
  {
@@ -910,38 +1302,73 @@ export function DatasourceIntrospectionPage() {
910
1302
  content: (_jsx("div", { className: "sdix-ddl-tab", children: (drawerRawDdl === null || drawerRawDdl === void 0 ? void 0 : drawerRawDdl.available) && drawerRawDdl.statement ? (_jsx("pre", { className: "sdix-ddl-code", children: _jsx("code", { children: drawerRawDdl.statement }) })) : (_jsxs("div", { className: "sdix-empty-state is-inline sdix-ddl-empty", children: [_jsx(Database, { size: 18 }), _jsx("p", { children: (drawerRawDdl === null || drawerRawDdl === void 0 ? void 0 : drawerRawDdl.note) || "DDL preview is not available for this table." })] })) })),
911
1303
  },
912
1304
  ] : [];
913
- var reviewTabs = mappingPreview ? [
914
- {
915
- value: "metadata-json",
916
- label: "Metadata JSON",
917
- content: (_jsxs("div", { className: "sdix-review-panel sdix-review-panel--metadata", children: [_jsxs("div", { className: "sdix-review-meta sdix-review-meta--compact", children: [_jsx("span", { children: "Target file" }), _jsx("strong", { children: mappingPreview.metadataJson.filePath })] }), _jsx(SolidJsonEditor, { className: "sdix-json-editor", value: reviewedMetadataJsonValue !== null && reviewedMetadataJsonValue !== void 0 ? reviewedMetadataJsonValue : mappingPreview.metadataJson.model, resetToken: metadataJsonResetToken, onValueChange: function (nextValue) {
918
- setReviewedMetadataJsonValue(nextValue);
919
- if (metadataJsonValidationError) {
920
- setMetadataJsonValidationError(null);
921
- }
922
- }, onTextChange: function (nextText) {
923
- setMetadataJsonText(nextText);
924
- }, onErrorChange: setMetadataJsonValidationError }), metadataJsonValidationError ? (_jsx("div", { className: "sdix-json-validation-error", children: _jsx("span", { children: metadataJsonValidationError }) })) : null] })),
925
- },
926
- {
927
- value: "migration",
928
- label: "Migration",
929
- content: (_jsx("div", { className: "sdix-review-panel sdix-review-panel--migration", children: mappingPreview.migration.willGenerate && mappingPreview.migration.filePath ? (_jsxs(_Fragment, { children: [_jsxs("div", { className: "sdix-review-meta sdix-review-meta--compact", children: [_jsx("span", { children: "Target file" }), _jsx("strong", { children: mappingPreview.migration.filePath })] }), _jsx("p", { className: "sdix-review-note", children: "This migration preview is generated from the current mapping and is read-only here. Saving the mapping will write a new template migration file to the target location." }), mappingPreview.migration.content ? (_jsx("pre", { className: "sdix-ddl-code sdix-ddl-code--fill", children: _jsx("code", { children: mappingPreview.migration.content }) })) : null] })) : (_jsxs("div", { className: "sdix-empty-state is-inline sdix-ddl-empty", children: [_jsx(Database, { size: 18 }), _jsx("p", { children: mappingPreview.migration.note })] })) })),
930
- },
931
- ] : [];
932
- return (_jsxs("div", { className: "sdix-page", children: [_jsxs("div", { className: "sdix-toolbar", children: [_jsx("div", { className: "sdix-toolbar__left", children: _jsxs("div", { className: "sdix-toolbar-search", children: [_jsx(Search, { size: 15 }), _jsx(SolidInput, { value: tableSearch, onChange: function (event) { return setTableSearch(event.target.value); }, placeholder: "Search tables", disabled: !selectedDatasource })] }) }), _jsxs("div", { className: "sdix-toolbar__actions", children: [isBootstrapFetching || isTablesFetching || isTableDetailFetching || isMappedModelFetching ? (_jsxs("div", { className: "sdix-inline-status", children: [_jsx(SolidSpinner, { size: 16 }), _jsx("span", { children: "Refreshing" })] })) : null, _jsx(SolidSelect, { value: selectedDatasource, options: datasourceOptions, placeholder: "Datasource", className: "sdix-toolbar-select sdix-toolbar-select--compact", onChange: function (event) { return setSelectedDatasource(event.value); } }), _jsx(SolidButton, { size: "small", className: "sdix-icon-button", leftIcon: _jsx(RefreshCw, { size: 16 }), onClick: function () { return void handleRefresh(); }, tooltip: "Refresh", "aria-label": "Refresh" }), _jsx(SolidButton, { size: "small", className: "sdix-icon-button", leftIcon: _jsx(Cog, { size: 16 }), onClick: function () {
933
- setDraftSessionSettings(sessionSettings);
934
- setSettingsTab("datasource-info");
935
- setSettingsOpen(true);
936
- }, tooltip: "Session settings", "aria-label": "Session settings" })] })] }), isBootstrapLoading ? (_jsxs("div", { className: "sdix-loading", children: [_jsx(SolidSpinner, { size: 28 }), _jsx("p", { children: "Loading introspection workspace..." })] })) : bootstrapError ? (_jsxs("div", { className: "sdix-error", children: [_jsx("span", { children: readQueryError(bootstrapError) }), _jsx(SolidButton, { size: "small", variant: "outline", onClick: function () { return void refetchBootstrap(); }, children: "Retry" })] })) : (_jsxs(_Fragment, { children: [selectedDatasource && (tablesResponse === null || tablesResponse === void 0 ? void 0 : tablesResponse.synchronizeBlocked) ? (_jsxs("div", { className: "sdix-blocker", children: [_jsx(ShieldAlert, { size: 20 }), _jsxs("div", { children: [_jsx("h3", { children: "Synchronize must be disabled before introspection" }), _jsx("p", { children: tablesResponse.synchronizeMessage })] })] })) : null, _jsx("div", { className: "sdix-workbench", children: _jsx("div", { className: "sdix-table-shell", children: !selectedDatasource ? (_jsxs("div", { className: "sdix-empty-state is-inline", children: [_jsx(Database, { size: 22 }), _jsx("p", { children: "Select a datasource to load its tables." })] })) : isTablesLoading ? (_jsxs("div", { className: "sdix-loading is-inline", children: [_jsx(SolidSpinner, { size: 24 }), _jsx("p", { children: "Inspecting datasource tables..." })] })) : tablesError ? (_jsxs("div", { className: "sdix-error is-inline", children: [_jsx("span", { children: readQueryError(tablesError) }), _jsx(SolidButton, { size: "small", variant: "outline", onClick: function () { return void refetchTables(); }, children: "Retry" })] })) : !filteredRecords.length ? (_jsxs("div", { className: "sdix-empty-state is-inline", children: [_jsx(Database, { size: 22 }), _jsx("p", { children: tableSearch ? "No tables match the current quick filter." : "No database tables were discovered for this datasource." })] })) : (_jsx("div", { className: "sdix-table-area", children: _jsxs(SolidDataTable, { value: filteredRecords, dataKey: "tableName", viewportHeight: "calc(100vh - 162px)", size: "small", onRowClick: function (_a) {
937
- var data = _a.data;
938
- return openTableDrawer(data);
939
- }, rowClassName: function (rowData) { var _a; return "".concat((_a = rowData.schema) !== null && _a !== void 0 ? _a : "", "::").concat(rowData.tableName) === selectedTableKey && drawerOpen ? "sdix-table-row-selected" : ""; }, emptyMessage: "No datasource tables found", children: [_jsx(Column, { field: "tableName", header: "Table", body: function (rowData) { return (_jsx("div", { className: "sdix-table-primary-cell", children: _jsx("strong", { children: rowData.tableName }) })); }, style: { minWidth: 240 } }), _jsx(Column, { field: "schema", header: "Schema", body: function (rowData) { return rowData.schema || "dbo/default"; }, style: { minWidth: 120 } }), _jsx(Column, { header: "Status", body: function (rowData) { return (_jsx("span", { className: "sdix-status-badge ".concat(rowData.mapped ? "is-mapped" : "is-unmapped"), children: statusLabel(rowData) })); }, style: { minWidth: 150 } }), _jsx(Column, { header: "Superclass", body: function (rowData) { return rowData.suggestedBaseClassName; }, style: { minWidth: 220 } }), _jsx(Column, { field: "suggestedUserKeyField", header: "User Key", style: { minWidth: 160 } }), _jsx(Column, { header: "Mapped Model", body: function (rowData) { return (rowData.mapped
940
- ? (rowData.mappedModelDisplayName || rowData.mappedModelSingularName || "-")
941
- : _jsx("span", { className: "sdix-muted-cell", children: "Not mapped" })); }, style: { minWidth: 200 } }), _jsx(Column, { header: "System Columns", body: function (rowData) { return Math.max(rowData.columnCount - rowData.physicalColumnCount, 0); }, style: { minWidth: 130 } }), _jsx(Column, { header: "Columns", body: function (rowData) { return rowData.physicalColumnCount; }, style: { minWidth: 110 } })] }) })) }) }), _jsxs(SolidDialog, { open: settingsOpen, onOpenChange: setSettingsOpen, style: { width: "min(560px, calc(100vw - 32px))" }, children: [_jsxs(SolidDialogHeader, { children: [_jsxs("div", { children: [_jsx(SolidDialogTitle, { children: "Session settings" }), _jsx(SolidDialogDescription, { children: "Review the selected datasource and adjust the session-specific introspection flags." })] }), _jsx(SolidDialogClose, {})] }), _jsx(SolidDialogSeparator, {}), _jsx(SolidDialogBody, { children: _jsx(SolidTabGroup, { tabs: settingsTabs, value: settingsTab, onValueChange: setSettingsTab, className: "sdix-settings-tabs", panelClassName: "sdix-settings-tab-panel" }) }), _jsxs(SolidDialogFooter, { children: [_jsx(SolidButton, { variant: "outline", onClick: function () { return setSettingsOpen(false); }, children: "Cancel" }), _jsx(SolidButton, { onClick: applyDraftSettings, children: "Apply" })] })] }), _jsxs(SolidDialog, { open: drawerOpen, onOpenChange: setDrawerOpen, className: "sdix-drawer", overlayClassName: "sdix-drawer-overlay", dismissible: true, children: [_jsxs(SolidDialogHeader, { className: "sdix-drawer-header", children: [_jsxs("div", { className: "sdix-drawer-header__identity", children: [_jsx(SolidDialogTitle, { children: (selectedTable === null || selectedTable === void 0 ? void 0 : selectedTable.tableName) || "Table details" }), _jsx(SolidDialogDescription, { className: "sdix-drawer-header__meta", children: selectedTable
942
- ? "".concat(selectedTable.schema || "default", " \u00B7 ").concat((selectedDatasourceRecord === null || selectedDatasourceRecord === void 0 ? void 0 : selectedDatasourceRecord.database) || (selectedDatasourceRecord === null || selectedDatasourceRecord === void 0 ? void 0 : selectedDatasourceRecord.displayName) || "Datasource").concat(selectedDatasourceRecord ? " \u00B7 ".concat(providerLabel(selectedDatasourceRecord.type)) : "")
943
- : "Review mapping details" })] }), _jsx(SolidDialogClose, {})] }), _jsx(SolidDialogSeparator, {}), _jsx(SolidDialogBody, { className: "sdix-drawer-body", children: !selectedTable ? (_jsxs("div", { className: "sdix-empty-state is-inline", children: [_jsx(Sparkles, { size: 22 }), _jsx("p", { children: "Select a table row to review its structure." })] })) : drawerLoadingError ? (_jsxs("div", { className: "sdix-error is-inline", children: [_jsx("span", { children: readQueryError(drawerLoadingError) }), _jsx(SolidButton, { size: "small", variant: "outline", onClick: function () { return void refetchTableDetail(); }, children: "Retry" })] })) : isDrawerBlockingLoading ? (_jsxs("div", { className: "sdix-loading is-inline", children: [_jsx(SolidSpinner, { size: 24 }), _jsx("p", { children: "Preparing column mapping preview..." })] })) : (_jsxs("div", { className: "sdix-drawer-stack", children: [drawerDraft && !drawerDraft.mapped && drawerStep === "edit" ? (_jsxs("div", { className: "sdix-detail-callout sdix-system-fields-callout", children: [_jsx("h3", { children: "SolidX system fields are added later" }), _jsxs("p", { children: ["This preview only lists the legacy table columns that already exist today.", " ", "Framework system fields from the selected superclass, including the namespaced", " ", _jsx("code", { children: "ss_*" }), " ", "columns, are introduced when you save the mapping and then generate/apply the follow-up migrations."] })] })) : null, drawerStep === "edit" ? (_jsx(SolidTabGroup, { tabs: drawerTabs, value: drawerTab, onValueChange: setDrawerTab, className: "sdix-drawer-tabs", panelClassName: "sdix-drawer-tab-panel" })) : (_jsx(SolidTabGroup, { tabs: reviewTabs, value: reviewTab, onValueChange: setReviewTab, className: "sdix-drawer-tabs", panelClassName: "sdix-drawer-tab-panel" }))] })) }), drawerDraft && !isDrawerBlockingLoading ? (_jsxs(_Fragment, { children: [_jsx(SolidDialogSeparator, {}), _jsxs(SolidDialogFooter, { className: "sdix-drawer-footer", children: [_jsx("div", { className: "sdix-drawer-footer__meta", children: drawerStep === "review" && mappingPreview ? (_jsxs("span", { children: ["Review the metadata update first, then save to apply", " ", _jsx("strong", { children: mappingPreview.summary.includedColumnNames.length }), " ", "mapped columns", mappingPreview.summary.generatedSystemColumnCount
944
- ? " and ".concat(mappingPreview.summary.generatedSystemColumnCount, " SolidX system column migration changes")
945
- : "", "."] })) : drawerDraft.mapped ? (_jsxs("span", { children: ["Editing mapped model", " ", _jsx("strong", { children: (selectedTable === null || selectedTable === void 0 ? void 0 : selectedTable.mappedModelDisplayName) || (selectedTable === null || selectedTable === void 0 ? void 0 : selectedTable.mappedModelSingularName) }), drawerDraft.mappedModuleLabel ? " in ".concat(drawerDraft.mappedModuleLabel) : ""] })) : (_jsx("span", { children: "Saving will create the model metadata and write it to the module JSON." })) }), _jsxs("div", { className: "sdix-drawer-footer__actions", children: [drawerDraft.mapped && drawerDraft.modelId ? (_jsx(SolidButton, { size: "small", variant: "outline", leftIcon: _jsx(ExternalLink, { size: 14 }), onClick: openMappedModelForm, children: "Open model form" })) : null, drawerStep === "review" ? (_jsxs(_Fragment, { children: [_jsx(SolidButton, { size: "small", variant: "outline", onClick: function () { return setDrawerStep("edit"); }, children: "Back to editing" }), _jsx(SolidButton, { size: "small", leftIcon: _jsx(Save, { size: 14 }), loading: isSavingMapping, onClick: function () { return void saveMapping(); }, children: "Save mapping" })] })) : (_jsx(SolidButton, { size: "small", leftIcon: _jsx(Save, { size: 14 }), loading: isPreviewMappingLoading, onClick: function () { return void viewChanges(); }, children: "View Changes" }))] })] })] })) : null] })] }))] }));
1305
+ var reviewJsonPanel = mappingPreview ? (_jsxs("div", { className: "sdix-review-panel sdix-review-panel--metadata", children: [_jsxs("div", { className: "sdix-review-meta sdix-review-meta--compact", children: [_jsx("span", { children: "Target file" }), _jsx("strong", { children: mappingPreview.metadataJson.filePath })] }), _jsx(SolidJsonEditor, { className: "sdix-json-editor", value: reviewedMetadataJsonValue !== null && reviewedMetadataJsonValue !== void 0 ? reviewedMetadataJsonValue : mappingPreview.metadataJson.model, resetToken: metadataJsonResetToken, onValueChange: function (nextValue) {
1306
+ setReviewedMetadataJsonValue(nextValue);
1307
+ if (metadataJsonValidationError) {
1308
+ setMetadataJsonValidationError(null);
1309
+ }
1310
+ }, onTextChange: function (nextText) {
1311
+ setMetadataJsonText(nextText);
1312
+ }, onErrorChange: setMetadataJsonValidationError }), metadataJsonValidationError ? (_jsx("div", { className: "sdix-json-validation-error", children: _jsx("span", { children: metadataJsonValidationError }) })) : null] })) : null;
1313
+ var createMigrationsPanel = mappingPreview ? (_jsx("div", { className: "sdix-review-panel sdix-review-panel--migration", children: mappingPreview.migration.willGenerate && mappingPreview.migration.filePath ? (_jsxs(_Fragment, { children: [_jsxs("div", { className: "sdix-review-meta sdix-review-meta--compact", children: [_jsx("span", { children: "Target file" }), _jsx("strong", { children: mappingPreview.migration.filePath })] }), _jsx("p", { className: "sdix-review-note", children: "This migration preview is generated from the current mapping and stays read-only here. Moving ahead writes the migration file to disk and updates the datasource registration now that the entity code already exists." }), mappingPreview.migration.content ? (_jsx("pre", { className: "sdix-ddl-code sdix-ddl-code--fill", children: _jsx("code", { children: mappingPreview.migration.content }) })) : null] })) : (_jsxs("div", { className: "sdix-empty-state is-inline sdix-ddl-empty", children: [_jsx(Database, { size: 18 }), _jsx("p", { children: mappingPreview.migration.note })] })) })) : null;
1314
+ var generateCodePanel = (_jsxs("div", { className: "sdix-stage-panel", children: [_jsxs("div", { className: "sdix-stage-panel__header", children: [_jsx("span", { className: "sdix-stage-panel__eyebrow", children: "Step 3" }), _jsx("h3", { children: "Generate module code" }), _jsx("p", { children: "The reviewed metadata JSON is now persisted. Run the normal SolidX module generation flow next so the entity, DTOs, repository, service, controller, and UI code are refreshed before we register the entity on the datasource and write the migration." })] }), _jsxs("div", { className: "sdix-stage-panel__body", children: [_jsxs("div", { className: "sdix-stage-panel__card", children: [_jsx("div", { className: "sdix-stage-panel__card-title", children: "What happens here" }), _jsxs("ul", { className: "sdix-stage-panel__list", children: [_jsxs("li", { children: ["The module generate-code pipeline runs for ", _jsx("strong", { children: (_q = bootstrap === null || bootstrap === void 0 ? void 0 : bootstrap.module) === null || _q === void 0 ? void 0 : _q.displayName }), "."] }), _jsx("li", { children: "The newly mapped model entity is generated inside the module source folder." }), _jsx("li", { children: "Any existing generated assets for this module may be refreshed." })] })] }), _jsx("div", { className: "sdix-stage-panel__actions", children: _jsx(SolidButton, { leftIcon: _jsx(Sparkles, { size: 14 }), loading: isGenerateCodeLoading || isGeneratingCodeWorkflow, disabled: isGenerateCodeLoading || isGeneratingCodeWorkflow, onClick: function () { return void handleGenerateCode(); }, children: "Generate Code" }) }), isGeneratingCodeWorkflow ? (_jsxs("div", { className: "sdix-empty-state is-inline sdix-stage-progress", children: [_jsx(SolidSpinner, { size: 30 }), _jsx("h3", { children: "Generating code" }), _jsx("p", { children: generateCodeStatusMessage || "Waiting for the backend to finish restarting..." })] })) : null, !isGeneratingCodeWorkflow && generateCodeTimeoutMessage ? (_jsxs("div", { className: "sdix-error is-inline sdix-stage-progress sdix-stage-progress--warning", children: [_jsx(ShieldAlert, { size: 22 }), _jsx("h3", { children: "Manual review recommended" }), _jsx("p", { children: generateCodeTimeoutMessage })] })) : null, generateCodeOutput ? (_jsx("pre", { className: "sdix-ddl-code sdix-ddl-code--fill", children: _jsx("code", { children: generateCodeOutput }) })) : null] })] }));
1315
+ var runMigrationPanel = (_jsxs("div", { className: "sdix-stage-panel", children: [_jsxs("div", { className: "sdix-stage-panel__header", children: [_jsx("span", { className: "sdix-stage-panel__eyebrow", children: "Step 5" }), _jsx("h3", { children: "Run datasource migration" }), _jsx("p", { children: "With the datasource file updated and module code generated, SolidX can now run the TypeORM migration for the selected datasource and apply the missing system fields to the legacy table." })] }), _jsxs("div", { className: "sdix-stage-panel__body", children: [_jsxs("div", { className: "sdix-stage-panel__card", children: [_jsx("div", { className: "sdix-stage-panel__card-title", children: "Command" }), _jsx("pre", { className: "sdix-stage-panel__command", children: _jsx("code", { children: "npx @solidxai/solidctl@latest migration -d ".concat(selectedDatasource, " run") }) })] }), runMigrationCompleted ? (_jsxs("div", { className: "sdix-empty-state is-inline sdix-stage-progress", children: [_jsx(Check, { size: 24 }), _jsx("h3", { children: "Migration finished" }), _jsx("p", { children: "Review the output below. When you are satisfied, click Finish to return to the model list." })] })) : null, runMigrationOutput ? (_jsx("pre", { className: "sdix-ddl-code sdix-ddl-code--fill", children: _jsx("code", { children: runMigrationOutput }) })) : null] })] }));
1316
+ var workspaceContent = drawerDraft ? (function () {
1317
+ switch (workspaceStep) {
1318
+ case "review-json":
1319
+ return reviewJsonPanel;
1320
+ case "create-migrations":
1321
+ return createMigrationsPanel;
1322
+ case "generate-code":
1323
+ return generateCodePanel;
1324
+ case "run-migration":
1325
+ return runMigrationPanel;
1326
+ case "configure":
1327
+ default:
1328
+ return (_jsx(SolidTabGroup, { tabs: drawerTabs, value: drawerTab, onValueChange: setDrawerTab, className: "sdix-drawer-tabs sdix-wizard-tabs", panelClassName: "sdix-drawer-tab-panel sdix-wizard-tab-panel" }));
1329
+ }
1330
+ })() : null;
1331
+ var workspaceMeta = drawerDraft ? (function () {
1332
+ switch (workspaceStep) {
1333
+ case "review-json":
1334
+ return (_jsx("span", { children: "Review the generated metadata JSON before it is written to the module metadata file." }));
1335
+ case "generate-code":
1336
+ return persistedMappingResult ? (_jsxs("span", { children: ["Metadata JSON has been saved for", " ", _jsx("strong", { children: drawerDraft.displayName || drawerDraft.singularName }), ". Generate the module code next so the entity file exists before datasource registration is updated. Continue stays disabled until you attempt code generation at least once."] })) : (_jsx("span", { children: "Save the metadata JSON before generating code." }));
1337
+ case "create-migrations":
1338
+ return mappingPreview ? (_jsxs("span", { children: ["Create the migration artifacts for", " ", _jsx("strong", { children: mappingPreview.summary.includedColumnNames.length }), " ", "mapped columns", mappingPreview.summary.generatedSystemColumnCount
1339
+ ? " and ".concat(mappingPreview.summary.generatedSystemColumnCount, " SolidX system column migration changes")
1340
+ : "", "."] })) : null;
1341
+ case "run-migration":
1342
+ return runMigrationCompleted ? (_jsxs("span", { children: ["The datasource migration has completed for", " ", _jsx("strong", { children: selectedDatasource }), ". Review the output below and click Finish when you are ready to return to the model list."] })) : (_jsxs("span", { children: ["Run the datasource migration for", " ", _jsx("strong", { children: selectedDatasource }), " ", "to apply the SolidX system columns on the legacy table."] }));
1343
+ case "configure":
1344
+ default:
1345
+ return drawerDraft.mapped ? (_jsxs("span", { children: ["Editing mapped model", " ", _jsx("strong", { children: (selectedTable === null || selectedTable === void 0 ? void 0 : selectedTable.mappedModelDisplayName) || (selectedTable === null || selectedTable === void 0 ? void 0 : selectedTable.mappedModelSingularName) }), drawerDraft.mappedModuleLabel ? " in ".concat(drawerDraft.mappedModuleLabel) : ""] })) : (_jsx("span", { children: "Configure the field mapping draft before generating the metadata JSON preview." }));
1346
+ }
1347
+ })() : null;
1348
+ return (_jsx("div", { className: "sdix-page", children: isBootstrapLoading ? (_jsxs("div", { className: "sdix-loading", children: [_jsx(SolidSpinner, { size: 28 }), _jsx("p", { children: "Loading introspection workspace..." })] })) : bootstrapError ? (_jsxs("div", { className: "sdix-error", children: [_jsx("span", { children: readQueryError(bootstrapError) }), _jsx(SolidButton, { size: "small", variant: "outline", onClick: function () { return void refetchBootstrap(); }, children: "Retry" })] })) : (_jsxs(_Fragment, { children: [!isWorkspaceMode ? (_jsxs("div", { className: "sdix-toolbar", children: [_jsx("div", { className: "sdix-toolbar__left", children: _jsxs("div", { className: "sdix-toolbar-search", children: [_jsx(Search, { size: 15 }), _jsx(SolidInput, { value: tableSearch, onChange: function (event) { return setTableSearch(event.target.value); }, placeholder: "Search tables", disabled: !selectedDatasource })] }) }), _jsxs("div", { className: "sdix-toolbar__actions", children: [isBootstrapFetching || isTablesFetching ? (_jsxs("div", { className: "sdix-inline-status", children: [_jsx(SolidSpinner, { size: 16 }), _jsx("span", { children: "Refreshing" })] })) : null, _jsx(SolidButton, { size: "small", leftIcon: _jsx(Sparkles, { size: 14 }), onClick: function () {
1349
+ if (selectedListRow) {
1350
+ startMappingForRecord(selectedListRow);
1351
+ }
1352
+ }, disabled: !selectedListRow, children: "Start Mapping" }), _jsx(SolidSelect, { value: selectedDatasource, options: datasourceOptions, placeholder: "Datasource", className: "sdix-toolbar-select sdix-toolbar-select--compact", onChange: function (event) { return setSelectedDatasource(event.value); } }), _jsx(SolidButton, { size: "small", className: "sdix-icon-button", leftIcon: _jsx(RefreshCw, { size: 16 }), onClick: function () { return void handleRefresh(); }, tooltip: "Refresh", "aria-label": "Refresh" }), _jsx(SolidButton, { size: "small", className: "sdix-icon-button", leftIcon: _jsx(Cog, { size: 16 }), onClick: function () {
1353
+ setDraftSessionSettings(sessionSettings);
1354
+ setSettingsTab("datasource-info");
1355
+ setSettingsOpen(true);
1356
+ }, tooltip: "Session settings", "aria-label": "Session settings" })] })] })) : null, selectedDatasource && (tablesResponse === null || tablesResponse === void 0 ? void 0 : tablesResponse.synchronizeBlocked) ? (_jsxs("div", { className: "sdix-blocker", children: [_jsx(ShieldAlert, { size: 20 }), _jsxs("div", { children: [_jsx("h3", { children: "Synchronize must be disabled before introspection" }), _jsx("p", { children: tablesResponse.synchronizeMessage })] })] })) : null, !isWorkspaceMode ? (_jsx("div", { className: "sdix-workbench", children: _jsx("div", { className: "sdix-table-shell", children: !selectedDatasource ? (_jsxs("div", { className: "sdix-empty-state is-inline", children: [_jsx(Database, { size: 22 }), _jsx("p", { children: "Select a datasource to load its tables." })] })) : isTablesLoading ? (_jsxs("div", { className: "sdix-loading is-inline", children: [_jsx(SolidSpinner, { size: 24 }), _jsx("p", { children: "Inspecting datasource tables..." })] })) : tablesError ? (_jsxs("div", { className: "sdix-error is-inline", children: [_jsx("span", { children: readQueryError(tablesError) }), _jsx(SolidButton, { size: "small", variant: "outline", onClick: function () { return void refetchTables(); }, children: "Retry" })] })) : !filteredRecords.length ? (_jsxs("div", { className: "sdix-empty-state is-inline", children: [_jsx(Database, { size: 22 }), _jsx("p", { children: tableSearch ? "No tables match the current quick filter." : "No database tables were discovered for this datasource." })] })) : (_jsx("div", { className: "sdix-table-area", children: _jsxs(SolidDataTable, { value: filteredRecords, dataKey: "tableName", viewportHeight: "calc(100vh - 162px)", size: "small", onRowClick: function (_a) {
1357
+ var data = _a.data;
1358
+ return setSelectedRows([data]);
1359
+ }, rowClassName: function (rowData) { var _a; return "".concat((_a = rowData.schema) !== null && _a !== void 0 ? _a : "", "::").concat(rowData.tableName) === selectedListRowKey ? "sdix-table-row-selected" : ""; }, emptyMessage: "No datasource tables found", children: [_jsx(Column, { header: "", body: function (rowData) {
1360
+ var _a;
1361
+ var rowKey = "".concat((_a = rowData.schema) !== null && _a !== void 0 ? _a : "", "::").concat(rowData.tableName);
1362
+ return (_jsx("div", { className: "sdix-selection-cell", "data-no-row-click": "true", children: _jsx(SolidCheckbox, { checked: rowKey === selectedListRowKey, onChange: function (event) { return setSelectedRows(event.target.checked ? [rowData] : []); } }) }));
1363
+ }, style: { width: 52, minWidth: 52 } }), _jsx(Column, { field: "tableName", header: "Table", body: function (rowData) { return (_jsx("div", { className: "sdix-table-primary-cell", children: _jsx("strong", { children: rowData.tableName }) })); }, style: { minWidth: 240 } }), _jsx(Column, { field: "schema", header: "Schema", body: function (rowData) { return rowData.schema || "dbo/default"; }, style: { minWidth: 120 } }), _jsx(Column, { header: "Status", body: function (rowData) { return (_jsx("span", { className: "sdix-status-badge ".concat(rowData.mapped ? "is-mapped" : "is-unmapped"), children: statusLabel(rowData) })); }, style: { minWidth: 150 } }), _jsx(Column, { header: "Superclass", body: function (rowData) { return rowData.suggestedBaseClassName; }, style: { minWidth: 220 } }), _jsx(Column, { field: "suggestedUserKeyField", header: "User Key", style: { minWidth: 160 } }), _jsx(Column, { header: "Mapped Model", body: function (rowData) { return (rowData.mapped
1364
+ ? (_jsxs("div", { className: "sdix-table-primary-cell", children: [_jsx("strong", { children: rowData.mappedModelDisplayName || rowData.mappedModelSingularName || "-" }), rowData.mappedModuleDisplayName || rowData.mappedModuleName ? (_jsx("span", { children: rowData.mappedModuleDisplayName || rowData.mappedModuleName })) : null] }))
1365
+ : _jsx("span", { className: "sdix-muted-cell", children: "Not mapped" })); }, style: { minWidth: 200 } }), _jsx(Column, { header: "System Columns", body: function (rowData) { return Math.max(rowData.columnCount - rowData.physicalColumnCount, 0); }, style: { minWidth: 130 } }), _jsx(Column, { header: "Columns", body: function (rowData) { return rowData.physicalColumnCount; }, style: { minWidth: 110 } })] }) })) }) })) : (_jsxs("div", { className: "sdix-workspace-screen", children: [_jsxs("div", { className: "sdix-workspace-header", children: [_jsx(SolidButton, { size: "small", variant: "outline", leftIcon: _jsx(ArrowLeft, { size: 14 }), onClick: leaveWorkspace, children: "Back" }), _jsxs("div", { className: "sdix-workspace-header__identity sdix-workspace-header__identity--right", children: [_jsx("h2", { children: (selectedTable === null || selectedTable === void 0 ? void 0 : selectedTable.tableName) || "Mapping workspace" }), _jsx("p", { children: selectedTable
1366
+ ? "".concat(selectedTable.schema || "dbo", " \u00B7 ").concat((selectedDatasourceRecord === null || selectedDatasourceRecord === void 0 ? void 0 : selectedDatasourceRecord.database) || (selectedDatasourceRecord === null || selectedDatasourceRecord === void 0 ? void 0 : selectedDatasourceRecord.displayName) || "Datasource").concat(selectedDatasourceRecord ? " \u00B7 ".concat(providerLabel(selectedDatasourceRecord.type)) : "")
1367
+ : "Complete the legacy table mapping in a dedicated workspace." })] })] }), !selectedTable && !isTablesLoading ? (_jsxs("div", { className: "sdix-error", children: [_jsx("span", { children: "The selected table is no longer available for this datasource." }), _jsx(SolidButton, { size: "small", variant: "outline", onClick: leaveWorkspace, children: "Back to table list" })] })) : drawerLoadingError ? (_jsxs("div", { className: "sdix-error", children: [_jsx("span", { children: readQueryError(drawerLoadingError) }), _jsx(SolidButton, { size: "small", variant: "outline", onClick: function () { return void refetchTableDetail(); }, children: "Retry" })] })) : isDrawerBlockingLoading ? (_jsxs("div", { className: "sdix-loading sdix-workspace-loading", children: [_jsx(SolidSpinner, { size: 24 }), _jsx("p", { children: "Preparing column mapping preview..." })] })) : (_jsxs("div", { className: "sdix-wizard-shell", children: [_jsx("div", { className: "sdix-wizard-stepper", children: stepperItems.map(function (step, index) { return (_jsxs("button", { type: "button", className: [
1368
+ "sdix-wizard-stepper-item",
1369
+ step.active ? "is-active" : "",
1370
+ step.complete ? "is-complete" : "",
1371
+ step.disabled ? "is-disabled" : "",
1372
+ ].filter(Boolean).join(" "), onClick: step.onClick, disabled: step.disabled, children: [_jsx("span", { className: "sdix-wizard-stepper-badge", children: step.complete ? _jsx(Check, { size: 12 }) : index + 1 }), _jsx("span", { className: "sdix-wizard-stepper-label", children: step.label })] }, step.key)); }) }), _jsx("div", { className: "sdix-wizard-panel", children: _jsx("div", { className: "sdix-wizard-panel__body", children: workspaceContent }) }), drawerDraft ? (_jsxs("div", { className: "sdix-wizard-footer", children: [_jsx("div", { className: "sdix-wizard-footer__meta", children: workspaceMeta }), _jsxs("div", { className: "sdix-wizard-footer__actions", children: [drawerDraft.mapped && drawerDraft.modelId ? (_jsx(SolidButton, { size: "small", variant: "outline", leftIcon: _jsx(ExternalLink, { size: 14 }), onClick: openMappedModelForm, children: "Open model form" })) : null, workspaceStep === "configure" ? (_jsx(SolidButton, { size: "small", leftIcon: _jsx(Save, { size: 14 }), loading: isPreviewMappingLoading, onClick: function () { return void reviewMappingJson(); }, children: "Review Mapping JSON" })) : null, workspaceStep === "review-json" ? (_jsxs(_Fragment, { children: [_jsx(SolidButton, { size: "small", variant: "outline", onClick: function () { return setWorkspaceStep("configure"); }, children: "Back" }), _jsx(SolidButton, { size: "small", leftIcon: _jsx(Save, { size: 14 }), loading: isSavingMapping, onClick: function () { return void persistMappingArtifacts(); }, children: "Save Mapping" })] })) : null, workspaceStep === "generate-code" ? (_jsxs(_Fragment, { children: [_jsx(SolidButton, { size: "small", variant: "outline", onClick: function () { return setWorkspaceStep("review-json"); }, children: "Back" }), _jsx(SolidButton, { size: "small", disabled: !hasAttemptedGenerateCode || isGenerateCodeLoading || isGeneratingCodeWorkflow, onClick: function () { return setWorkspaceStep("create-migrations"); }, children: "Continue" })] })) : null, workspaceStep === "create-migrations" ? (_jsxs(_Fragment, { children: [_jsx(SolidButton, { size: "small", variant: "outline", onClick: function () { return setWorkspaceStep("generate-code"); }, children: "Back" }), _jsx(SolidButton, { size: "small", leftIcon: _jsx(Save, { size: 14 }), loading: isCreatingMigrationArtifacts, onClick: function () { return void handleCreateMigrationArtifacts(); }, children: "Create Migration Artifacts" })] })) : null, workspaceStep === "run-migration" ? (runMigrationCompleted ? (_jsx(SolidButton, { size: "small", leftIcon: _jsx(Check, { size: 14 }), onClick: function () { return navigate("/admin/core/solid-core/model-metadata/list"); }, children: "Finish" })) : (_jsxs(_Fragment, { children: [_jsx(SolidButton, { size: "small", variant: "outline", onClick: function () { return setWorkspaceStep("create-migrations"); }, children: "Back" }), _jsx(SolidButton, { size: "small", leftIcon: _jsx(Database, { size: 14 }), loading: isRunMigrationLoading, onClick: function () { return void handleRunMigration(); }, children: "Run Migration" })] }))) : null] })] })) : null] }))] })), _jsxs(SolidDialog, { open: settingsOpen, onOpenChange: setSettingsOpen, style: { width: "min(560px, calc(100vw - 32px))" }, children: [_jsxs(SolidDialogHeader, { children: [_jsxs("div", { children: [_jsx(SolidDialogTitle, { children: "Session settings" }), _jsx(SolidDialogDescription, { children: "Review the selected datasource and adjust the session-specific introspection flags." })] }), _jsx(SolidDialogClose, {})] }), _jsx(SolidDialogSeparator, {}), _jsx(SolidDialogBody, { children: _jsx(SolidTabGroup, { tabs: settingsTabs, value: settingsTab, onValueChange: setSettingsTab, className: "sdix-settings-tabs", panelClassName: "sdix-settings-tab-panel" }) }), _jsxs(SolidDialogFooter, { children: [_jsx(SolidButton, { variant: "outline", onClick: function () { return setSettingsOpen(false); }, children: "Cancel" }), _jsx(SolidButton, { onClick: applyDraftSettings, children: "Apply" })] })] })] })) }));
946
1373
  }
947
1374
  //# sourceMappingURL=DatasourceIntrospectionPage.js.map