prefect 3.6.12__py3-none-any.whl → 3.6.13.dev2__py3-none-any.whl
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.
- prefect/_build_info.py +3 -3
- prefect/_internal/urls.py +29 -0
- prefect/_states.py +4 -1
- prefect/client/orchestration/_concurrency_limits/client.py +16 -16
- prefect/client/subscriptions.py +1 -1
- prefect/events/clients.py +52 -13
- prefect/runner/storage.py +3 -23
- prefect/server/ui-v2/assets/{artifact-card-Ds2tntMW.js → artifact-card-C8JEQRHl.js} +2 -2
- prefect/server/ui-v2/assets/{artifact-card-Ds2tntMW.js.map → artifact-card-C8JEQRHl.js.map} +1 -1
- prefect/server/ui-v2/assets/{artifact._id-erPNL0a8.js → artifact._id-67V8kTg9.js} +2 -2
- prefect/server/ui-v2/assets/{artifact._id-erPNL0a8.js.map → artifact._id-67V8kTg9.js.map} +1 -1
- prefect/server/ui-v2/assets/{automation-wizard-Bx9AQxRV.js → automation-wizard-DuxZ47Nn.js} +2 -2
- prefect/server/ui-v2/assets/{automation-wizard-Bx9AQxRV.js.map → automation-wizard-DuxZ47Nn.js.map} +1 -1
- prefect/server/ui-v2/assets/automation._id-D8S8r4Ji.js +2 -0
- prefect/server/ui-v2/assets/{automation._id-IHh5QJwE.js.map → automation._id-D8S8r4Ji.js.map} +1 -1
- prefect/server/ui-v2/assets/{automation_._id.edit-Ds8vO0c5.js → automation_._id.edit-C1fOM0Hx.js} +2 -2
- prefect/server/ui-v2/assets/{automation_._id.edit-Ds8vO0c5.js.map → automation_._id.edit-C1fOM0Hx.js.map} +1 -1
- prefect/server/ui-v2/assets/{automations-header-C6aUe5Tw.js → automations-header-DrijTNGi.js} +2 -2
- prefect/server/ui-v2/assets/{automations-header-C6aUe5Tw.js.map → automations-header-DrijTNGi.js.map} +1 -1
- prefect/server/ui-v2/assets/{base-job-template-form-section-a-9TFMcW.js → base-job-template-form-section-BDkqOkpe.js} +2 -2
- prefect/server/ui-v2/assets/{base-job-template-form-section-a-9TFMcW.js.map → base-job-template-form-section-BDkqOkpe.js.map} +1 -1
- prefect/server/ui-v2/assets/{block-type-details-eq3Wg2ht.js → block-type-details-CrFHWH5D.js} +2 -2
- prefect/server/ui-v2/assets/{block-type-details-eq3Wg2ht.js.map → block-type-details-CrFHWH5D.js.map} +1 -1
- prefect/server/ui-v2/assets/block-type-logo-WQNm0PzP.js +2 -0
- prefect/server/ui-v2/assets/{block-type-logo-B31LJm5H.js.map → block-type-logo-WQNm0PzP.js.map} +1 -1
- prefect/server/ui-v2/assets/{block._id-OVdz3htC.js → block._id-C3gN1Ae8.js} +2 -2
- prefect/server/ui-v2/assets/{block._id-OVdz3htC.js.map → block._id-C3gN1Ae8.js.map} +1 -1
- prefect/server/ui-v2/assets/block_._id.edit-DzPuSvat.js +2 -0
- prefect/server/ui-v2/assets/{block_._id.edit-CIhIBJrm.js.map → block_._id.edit-DzPuSvat.js.map} +1 -1
- prefect/server/ui-v2/assets/catalog-T-7MqsyE.js +2 -0
- prefect/server/ui-v2/assets/{catalog-CfniU0UV.js.map → catalog-T-7MqsyE.js.map} +1 -1
- prefect/server/ui-v2/assets/catalog_._slug-DMOI61fc.js +2 -0
- prefect/server/ui-v2/assets/{catalog_._slug-C9p86T4s.js.map → catalog_._slug-DMOI61fc.js.map} +1 -1
- prefect/server/ui-v2/assets/catalog_._slug_.create-l9bGUPi-.js +2 -0
- prefect/server/ui-v2/assets/{catalog_._slug_.create-BhSunL__.js.map → catalog_._slug_.create-l9bGUPi-.js.map} +1 -1
- prefect/server/ui-v2/assets/{collapsible-DBD7wjpi.js → collapsible-DM-Ze5-Y.js} +2 -2
- prefect/server/ui-v2/assets/{collapsible-DBD7wjpi.js.map → collapsible-DM-Ze5-Y.js.map} +1 -1
- prefect/server/ui-v2/assets/{concurrency-limit._id-C-XWq7Tf.js → concurrency-limit._id-BHEt9viF.js} +2 -2
- prefect/server/ui-v2/assets/{concurrency-limit._id-C-XWq7Tf.js.map → concurrency-limit._id-BHEt9viF.js.map} +1 -1
- prefect/server/ui-v2/assets/{create-Bj2t5YQq.js → create-BMxUOyN5.js} +2 -2
- prefect/server/ui-v2/assets/{create-Bj2t5YQq.js.map → create-BMxUOyN5.js.map} +1 -1
- prefect/server/ui-v2/assets/{create-noFojqGL.js → create-Cq-EAHVk.js} +2 -2
- prefect/server/ui-v2/assets/{create-noFojqGL.js.map → create-Cq-EAHVk.js.map} +1 -1
- prefect/server/ui-v2/assets/{data-table-BjFlVIyC.js → data-table-Bw8TZx9D.js} +2 -2
- prefect/server/ui-v2/assets/{data-table-BjFlVIyC.js.map → data-table-Bw8TZx9D.js.map} +1 -1
- prefect/server/ui-v2/assets/{delete-confirmation-dialog-COdZmNfa.js → delete-confirmation-dialog-CTdWZlGM.js} +2 -2
- prefect/server/ui-v2/assets/{delete-confirmation-dialog-COdZmNfa.js.map → delete-confirmation-dialog-CTdWZlGM.js.map} +1 -1
- prefect/server/ui-v2/assets/{deployment-action-header-C6v2kZ6V.js → deployment-action-header-BObYqmI_.js} +2 -2
- prefect/server/ui-v2/assets/{deployment-action-header-C6v2kZ6V.js.map → deployment-action-header-BObYqmI_.js.map} +1 -1
- prefect/server/ui-v2/assets/{deployment-form-D9d5sZM2.js → deployment-form-CntyhRrK.js} +3 -3
- prefect/server/ui-v2/assets/{deployment-form-D9d5sZM2.js.map → deployment-form-CntyhRrK.js.map} +1 -1
- prefect/server/ui-v2/assets/{deployment-links-Dy-M1Que.js → deployment-links-DBUSCaxB.js} +2 -2
- prefect/server/ui-v2/assets/{deployment-links-Dy-M1Que.js.map → deployment-links-DBUSCaxB.js.map} +1 -1
- prefect/server/ui-v2/assets/{deployment._id-CZlY9261.js → deployment._id-BXanVFA8.js} +2 -2
- prefect/server/ui-v2/assets/{deployment._id-CZlY9261.js.map → deployment._id-BXanVFA8.js.map} +1 -1
- prefect/server/ui-v2/assets/deployment._id-Q5cvHMX9.js +2 -0
- prefect/server/ui-v2/assets/{deployment._id-DVmqclRz.js.map → deployment._id-Q5cvHMX9.js.map} +1 -1
- prefect/server/ui-v2/assets/deployment_._id.duplicate-DB-4hHHc.js +2 -0
- prefect/server/ui-v2/assets/{deployment_._id.duplicate-DVMjpk5m.js.map → deployment_._id.duplicate-DB-4hHHc.js.map} +1 -1
- prefect/server/ui-v2/assets/deployment_._id.edit-CWf1RIGy.js +2 -0
- prefect/server/ui-v2/assets/{deployment_._id.edit-Ck_P6KDn.js.map → deployment_._id.edit-CWf1RIGy.js.map} +1 -1
- prefect/server/ui-v2/assets/{deployment_._id.run-Cht7AHDG.js → deployment_._id.run-CoHGXFoM.js} +2 -2
- prefect/server/ui-v2/assets/{deployment_._id.run-Cht7AHDG.js.map → deployment_._id.run-CoHGXFoM.js.map} +1 -1
- prefect/server/ui-v2/assets/{dropdown-menu-xZ_3w9OP.js → dropdown-menu-CT-s-V7d.js} +2 -2
- prefect/server/ui-v2/assets/{dropdown-menu-xZ_3w9OP.js.map → dropdown-menu-CT-s-V7d.js.map} +1 -1
- prefect/server/ui-v2/assets/{event._eventDate._eventId-CpexuXd6.js → event._eventDate._eventId-BITo_GYL.js} +2 -2
- prefect/server/ui-v2/assets/{event._eventDate._eventId-CpexuXd6.js.map → event._eventDate._eventId-BITo_GYL.js.map} +1 -1
- prefect/server/ui-v2/assets/flow-run-graph-DxIl6fzW.js +2 -0
- prefect/server/ui-v2/assets/flow-run-graph-DxIl6fzW.js.map +1 -0
- prefect/server/ui-v2/assets/{flow-run._id-ZBlKBwPO.js → flow-run._id-Bbm9OpDi.js} +2 -2
- prefect/server/ui-v2/assets/{flow-run._id-ZBlKBwPO.js.map → flow-run._id-Bbm9OpDi.js.map} +1 -1
- prefect/server/ui-v2/assets/flow-run._id-BtSgRDtA.js +2 -0
- prefect/server/ui-v2/assets/{flow-run._id-OL0YhyLW.js.map → flow-run._id-BtSgRDtA.js.map} +1 -1
- prefect/server/ui-v2/assets/flow-run._id-DJuMECRh.js +4 -0
- prefect/server/ui-v2/assets/flow-run._id-DJuMECRh.js.map +1 -0
- prefect/server/ui-v2/assets/flow-runs-pagination-LrU9Aio8.js +2 -0
- prefect/server/ui-v2/assets/flow-runs-pagination-LrU9Aio8.js.map +1 -0
- prefect/server/ui-v2/assets/flow._id-BJBRokk4.js +2 -0
- prefect/server/ui-v2/assets/{flow._id-DhrCicwR.js.map → flow._id-BJBRokk4.js.map} +1 -1
- prefect/server/ui-v2/assets/{form-BTub_PhK.js → form-CVSlEnl8.js} +2 -2
- prefect/server/ui-v2/assets/{form-BTub_PhK.js.map → form-CVSlEnl8.js.map} +1 -1
- prefect/server/ui-v2/assets/{header-Dp9qi8fq.js → header-4plZZheZ.js} +2 -2
- prefect/server/ui-v2/assets/{header-Dp9qi8fq.js.map → header-4plZZheZ.js.map} +1 -1
- prefect/server/ui-v2/assets/{header-B75eb688.js → header-9rXZ4r39.js} +2 -2
- prefect/server/ui-v2/assets/{header-B75eb688.js.map → header-9rXZ4r39.js.map} +1 -1
- prefect/server/ui-v2/assets/{header-6wmrKLU3.js → header-D3uM8_xM.js} +2 -2
- prefect/server/ui-v2/assets/{header-6wmrKLU3.js.map → header-D3uM8_xM.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-BA7ACCoL.js → index-6OsEYhIi.js} +2 -2
- prefect/server/ui-v2/assets/{index-BA7ACCoL.js.map → index-6OsEYhIi.js.map} +1 -1
- prefect/server/ui-v2/assets/index-B7xsJ-QH.js +2 -0
- prefect/server/ui-v2/assets/{index-CT_nG86y.js.map → index-B7xsJ-QH.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-CGWoVV2s.js → index-BeoNC2tJ.js} +2 -2
- prefect/server/ui-v2/assets/{index-CGWoVV2s.js.map → index-BeoNC2tJ.js.map} +1 -1
- prefect/server/ui-v2/assets/index-BfJLUM7N.js +2 -0
- prefect/server/ui-v2/assets/index-BfJLUM7N.js.map +1 -0
- prefect/server/ui-v2/assets/{index-DzMGV8GV.js → index-Bj0OOguP.js} +2 -2
- prefect/server/ui-v2/assets/{index-DzMGV8GV.js.map → index-Bj0OOguP.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-zpb5iSCL.js → index-BlpD74iH.js} +2 -2
- prefect/server/ui-v2/assets/{index-zpb5iSCL.js.map → index-BlpD74iH.js.map} +1 -1
- prefect/server/ui-v2/assets/index-BvSl3DKP.js +17 -0
- prefect/server/ui-v2/assets/index-BvSl3DKP.js.map +1 -0
- prefect/server/ui-v2/assets/index-CDwJvjUM.js +2 -0
- prefect/server/ui-v2/assets/{index-Cs8eFQKw.js.map → index-CDwJvjUM.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-UN2Tx4jH.js → index-CDyLkbVG.js} +2 -2
- prefect/server/ui-v2/assets/{index-UN2Tx4jH.js.map → index-CDyLkbVG.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-D08xgmV0.js → index-ChIrfjIW.js} +2 -2
- prefect/server/ui-v2/assets/{index-D08xgmV0.js.map → index-ChIrfjIW.js.map} +1 -1
- prefect/server/ui-v2/assets/index-CzCSgCK-.js +2 -0
- prefect/server/ui-v2/assets/{index-qPlIYf3i.js.map → index-CzCSgCK-.js.map} +1 -1
- prefect/server/ui-v2/assets/index-D5v9S-lB.js +2 -0
- prefect/server/ui-v2/assets/{index-B_3f8Hcb.js.map → index-D5v9S-lB.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-DfiNsXba.js → index-D6GJ4go1.js} +2 -2
- prefect/server/ui-v2/assets/{index-DfiNsXba.js.map → index-D6GJ4go1.js.map} +1 -1
- prefect/server/ui-v2/assets/index-DJyKqsFO.js +2 -0
- prefect/server/ui-v2/assets/{index-H6bwm6L6.js.map → index-DJyKqsFO.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-DSaSov8V.js → index-DODEq1Pi.js} +2 -2
- prefect/server/ui-v2/assets/{index-DSaSov8V.js.map → index-DODEq1Pi.js.map} +1 -1
- prefect/server/ui-v2/assets/index-DicK6p3K.js +2 -0
- prefect/server/ui-v2/assets/{index-7-r4ia_S.js.map → index-DicK6p3K.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-DYOACRXY.js → index-DqCPbST9.js} +2 -2
- prefect/server/ui-v2/assets/{index-DYOACRXY.js.map → index-DqCPbST9.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-DOkFJdYY.js → index-DxPoKag8.js} +2 -2
- prefect/server/ui-v2/assets/{index-DOkFJdYY.js.map → index-DxPoKag8.js.map} +1 -1
- prefect/server/ui-v2/assets/index-NY089eTx.css +1 -0
- prefect/server/ui-v2/assets/{index-HGoNWFfP.js → index-h9-QgNjZ.js} +2 -2
- prefect/server/ui-v2/assets/{index-HGoNWFfP.js.map → index-h9-QgNjZ.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-D3ILnEzm.js → index-tBdv6kBF.js} +2 -2
- prefect/server/ui-v2/assets/{index-D3ILnEzm.js.map → index-tBdv6kBF.js.map} +1 -1
- prefect/server/ui-v2/assets/index-udb79rgq.js +2 -0
- prefect/server/ui-v2/assets/{index-7ThYp9SY.js.map → index-udb79rgq.js.map} +1 -1
- prefect/server/ui-v2/assets/{json-input-9UPGqxTw.js → json-input-Dt1icmrn.js} +2 -2
- prefect/server/ui-v2/assets/{json-input-9UPGqxTw.js.map → json-input-Dt1icmrn.js.map} +1 -1
- prefect/server/ui-v2/assets/{key._key-CTFfXO_k.js → key._key-Cyh5MBX_.js} +2 -2
- prefect/server/ui-v2/assets/{key._key-CTFfXO_k.js.map → key._key-Cyh5MBX_.js.map} +1 -1
- prefect/server/ui-v2/assets/{lazy-markdown-BHwIrC8E.js → lazy-markdown-BwIwKFRF.js} +2 -2
- prefect/server/ui-v2/assets/{lazy-markdown-BHwIrC8E.js.map → lazy-markdown-BwIwKFRF.js.map} +1 -1
- prefect/server/ui-v2/assets/{login-kqmT29n7.js → login-DKXFVSwk.js} +2 -2
- prefect/server/ui-v2/assets/{login-kqmT29n7.js.map → login-DKXFVSwk.js.map} +1 -1
- prefect/server/ui-v2/assets/{markdown-input-BesmAbLS.js → markdown-input-Dp0mBlkV.js} +2 -2
- prefect/server/ui-v2/assets/{markdown-input-BesmAbLS.js.map → markdown-input-Dp0mBlkV.js.map} +1 -1
- prefect/server/ui-v2/assets/{python-example-snippet-COTWYn1Y.js → python-example-snippet-BYwPjHI5.js} +3 -3
- prefect/server/ui-v2/assets/{python-example-snippet-COTWYn1Y.js.map → python-example-snippet-BYwPjHI5.js.map} +1 -1
- prefect/server/ui-v2/assets/{python-input-Bjccebi0.js → python-input-y26XMqXw.js} +2 -2
- prefect/server/ui-v2/assets/{python-input-Bjccebi0.js.map → python-input-y26XMqXw.js.map} +1 -1
- prefect/server/ui-v2/assets/{radio-group-DkAK0M2h.js → radio-group-D0van45v.js} +2 -2
- prefect/server/ui-v2/assets/{radio-group-DkAK0M2h.js.map → radio-group-D0van45v.js.map} +1 -1
- prefect/server/ui-v2/assets/route-error-state-CGGpuCGN.js +2 -0
- prefect/server/ui-v2/assets/{route-error-state-ALftyvGl.js.map → route-error-state-CGGpuCGN.js.map} +1 -1
- prefect/server/ui-v2/assets/{schema-form-BR4E-WXE.js → schema-form-2tg5SXM4.js} +2 -2
- prefect/server/ui-v2/assets/{schema-form-BR4E-WXE.js.map → schema-form-2tg5SXM4.js.map} +1 -1
- prefect/server/ui-v2/assets/{schema-form-input-string-format-datetime-BhL8C5NS.js → schema-form-input-string-format-datetime-CZt6AJ4z.js} +4 -4
- prefect/server/ui-v2/assets/{schema-form-input-string-format-datetime-BhL8C5NS.js.map → schema-form-input-string-format-datetime-CZt6AJ4z.js.map} +1 -1
- prefect/server/ui-v2/assets/settings-DDUadk_N.js +2 -0
- prefect/server/ui-v2/assets/settings-DDUadk_N.js.map +1 -0
- prefect/server/ui-v2/assets/{sort-filter-BD4vwJXt.js → sort-filter-D9p3cPx9.js} +2 -2
- prefect/server/ui-v2/assets/{sort-filter-BD4vwJXt.js.map → sort-filter-D9p3cPx9.js.map} +1 -1
- prefect/server/ui-v2/assets/state-colors-CAAf0Eg3.js +2 -0
- prefect/server/ui-v2/assets/state-colors-CAAf0Eg3.js.map +1 -0
- prefect/server/ui-v2/assets/table-vo9Do8sA.js +2 -0
- prefect/server/ui-v2/assets/table-vo9Do8sA.js.map +1 -0
- prefect/server/ui-v2/assets/tags-input-Ci2JQ-k3.js +2 -0
- prefect/server/ui-v2/assets/tags-input-Ci2JQ-k3.js.map +1 -0
- prefect/server/ui-v2/assets/task-run-concurrency-limits-reset-dialog-CJzPc2gw.js +2 -0
- prefect/server/ui-v2/assets/{task-run-concurrency-limits-reset-dialog-CG3den1B.js.map → task-run-concurrency-limits-reset-dialog-CJzPc2gw.js.map} +1 -1
- prefect/server/ui-v2/assets/{task-run._id-DOcIzVi0.js → task-run._id-CjevSs79.js} +3 -3
- prefect/server/ui-v2/assets/{task-run._id-DOcIzVi0.js.map → task-run._id-CjevSs79.js.map} +1 -1
- prefect/server/ui-v2/assets/task-run._id-D8QKG5UZ.js +2 -0
- prefect/server/ui-v2/assets/{task-run._id-CnIVqU6v.js.map → task-run._id-D8QKG5UZ.js.map} +1 -1
- prefect/server/ui-v2/assets/task-runs-pagination-CifoSGct.js +2 -0
- prefect/server/ui-v2/assets/{task-runs-pagination-DLSAz-Ur.js.map → task-runs-pagination-CifoSGct.js.map} +1 -1
- prefect/server/ui-v2/assets/{textarea-D8LjlIx7.js → textarea-BAtfAxtV.js} +2 -2
- prefect/server/ui-v2/assets/{textarea-D8LjlIx7.js.map → textarea-BAtfAxtV.js.map} +1 -1
- prefect/server/ui-v2/assets/{timezone-select-BG3cL3-U.js → timezone-select-QlQTZSsF.js} +2 -2
- prefect/server/ui-v2/assets/{timezone-select-BG3cL3-U.js.map → timezone-select-QlQTZSsF.js.map} +1 -1
- prefect/server/ui-v2/assets/{toggle-group-D3zeurIL.js → toggle-group-BJN1vjEh.js} +2 -2
- prefect/server/ui-v2/assets/{toggle-group-D3zeurIL.js.map → toggle-group-BJN1vjEh.js.map} +1 -1
- prefect/server/ui-v2/assets/use-delete-automation-confirmation-dialog-eOWJYPkD.js +2 -0
- prefect/server/ui-v2/assets/{use-delete-automation-confirmation-dialog-Bzy2ML2T.js.map → use-delete-automation-confirmation-dialog-eOWJYPkD.js.map} +1 -1
- prefect/server/ui-v2/assets/{use-delete-block-document-confirmation-dialog-DRAP-Tnu.js → use-delete-block-document-confirmation-dialog-BTwSeHRM.js} +2 -2
- prefect/server/ui-v2/assets/{use-delete-block-document-confirmation-dialog-DRAP-Tnu.js.map → use-delete-block-document-confirmation-dialog-BTwSeHRM.js.map} +1 -1
- prefect/server/ui-v2/assets/{use-flow-runs-selected-rows-D4yWonR8.js → use-flow-runs-selected-rows-BL_Gv9CC.js} +2 -2
- prefect/server/ui-v2/assets/{use-flow-runs-selected-rows-D4yWonR8.js.map → use-flow-runs-selected-rows-BL_Gv9CC.js.map} +1 -1
- prefect/server/ui-v2/assets/{use-get-artifacts-flow-task-runs-DZeBiVd9.js → use-get-artifacts-flow-task-runs-TSCoomjQ.js} +2 -2
- prefect/server/ui-v2/assets/{use-get-artifacts-flow-task-runs-DZeBiVd9.js.map → use-get-artifacts-flow-task-runs-TSCoomjQ.js.map} +1 -1
- prefect/server/ui-v2/assets/{use-quick-run-BxAMqZDM.js → use-quick-run-BMnCkwSv.js} +2 -2
- prefect/server/ui-v2/assets/{use-quick-run-BxAMqZDM.js.map → use-quick-run-BMnCkwSv.js.map} +1 -1
- prefect/server/ui-v2/assets/{use-stepper-T3wAKNvM.js → use-stepper-C1wm66U2.js} +2 -2
- prefect/server/ui-v2/assets/{use-stepper-T3wAKNvM.js.map → use-stepper-C1wm66U2.js.map} +1 -1
- prefect/server/ui-v2/assets/{utilities-B2JMf8iI.js → utilities-DxRXxFOF.js} +2 -2
- prefect/server/ui-v2/assets/{utilities-B2JMf8iI.js.map → utilities-DxRXxFOF.js.map} +1 -1
- prefect/server/ui-v2/assets/{work-pool-filter-CZz0AJlt.js → work-pool-filter-PudrkZYj.js} +2 -2
- prefect/server/ui-v2/assets/{work-pool-filter-CZz0AJlt.js.map → work-pool-filter-PudrkZYj.js.map} +1 -1
- prefect/server/ui-v2/assets/work-pool-queue-toggle-BAOrV_0R.js +2 -0
- prefect/server/ui-v2/assets/{work-pool-queue-toggle-D4eeo-hi.js.map → work-pool-queue-toggle-BAOrV_0R.js.map} +1 -1
- prefect/server/ui-v2/assets/{work-pool._workPoolName-DrWddu9K.js → work-pool._workPoolName-BOM3849e.js} +2 -2
- prefect/server/ui-v2/assets/{work-pool._workPoolName-DrWddu9K.js.map → work-pool._workPoolName-BOM3849e.js.map} +1 -1
- prefect/server/ui-v2/assets/work-pool_._workPoolName.edit-CIhcG6yr.js +2 -0
- prefect/server/ui-v2/assets/{work-pool_._workPoolName.edit-CA0ePjCk.js.map → work-pool_._workPoolName.edit-CIhcG6yr.js.map} +1 -1
- prefect/server/ui-v2/assets/{work-pool_._workPoolName.queue._workQueueName-DpUnE86v.js → work-pool_._workPoolName.queue._workQueueName-CjoM77tu.js} +2 -2
- prefect/server/ui-v2/assets/{work-pool_._workPoolName.queue._workQueueName-DpUnE86v.js.map → work-pool_._workPoolName.queue._workQueueName-CjoM77tu.js.map} +1 -1
- prefect/server/ui-v2/assets/{work-queue-icon-text-BjiA7vAW.js → work-queue-icon-text-CP4yX3uM.js} +2 -2
- prefect/server/ui-v2/assets/{work-queue-icon-text-BjiA7vAW.js.map → work-queue-icon-text-CP4yX3uM.js.map} +1 -1
- prefect/server/ui-v2/index.html +2 -2
- prefect/task_engine.py +16 -0
- prefect/task_worker.py +98 -16
- prefect/testing/fixtures.py +18 -1
- {prefect-3.6.12.dist-info → prefect-3.6.13.dev2.dist-info}/METADATA +1 -1
- {prefect-3.6.12.dist-info → prefect-3.6.13.dev2.dist-info}/RECORD +211 -210
- prefect/server/ui-v2/assets/automation._id-IHh5QJwE.js +0 -2
- prefect/server/ui-v2/assets/block-type-logo-B31LJm5H.js +0 -2
- prefect/server/ui-v2/assets/block_._id.edit-CIhIBJrm.js +0 -2
- prefect/server/ui-v2/assets/catalog-CfniU0UV.js +0 -2
- prefect/server/ui-v2/assets/catalog_._slug-C9p86T4s.js +0 -2
- prefect/server/ui-v2/assets/catalog_._slug_.create-BhSunL__.js +0 -2
- prefect/server/ui-v2/assets/deployment._id-DVmqclRz.js +0 -2
- prefect/server/ui-v2/assets/deployment_._id.duplicate-DVMjpk5m.js +0 -2
- prefect/server/ui-v2/assets/deployment_._id.edit-Ck_P6KDn.js +0 -2
- prefect/server/ui-v2/assets/flow-run-graph-CfoPEAgQ.js +0 -2
- prefect/server/ui-v2/assets/flow-run-graph-CfoPEAgQ.js.map +0 -1
- prefect/server/ui-v2/assets/flow-run._id-C-qxwEBp.js +0 -4
- prefect/server/ui-v2/assets/flow-run._id-C-qxwEBp.js.map +0 -1
- prefect/server/ui-v2/assets/flow-run._id-OL0YhyLW.js +0 -2
- prefect/server/ui-v2/assets/flow-runs-pagination-DnwkJapB.js +0 -2
- prefect/server/ui-v2/assets/flow-runs-pagination-DnwkJapB.js.map +0 -1
- prefect/server/ui-v2/assets/flow._id-DhrCicwR.js +0 -2
- prefect/server/ui-v2/assets/index-7-r4ia_S.js +0 -2
- prefect/server/ui-v2/assets/index-7ThYp9SY.js +0 -2
- prefect/server/ui-v2/assets/index-B7zHzWQW.css +0 -1
- prefect/server/ui-v2/assets/index-B_3f8Hcb.js +0 -2
- prefect/server/ui-v2/assets/index-BiCd-Iuz.js +0 -2
- prefect/server/ui-v2/assets/index-BiCd-Iuz.js.map +0 -1
- prefect/server/ui-v2/assets/index-CT_nG86y.js +0 -2
- prefect/server/ui-v2/assets/index-Cs8eFQKw.js +0 -2
- prefect/server/ui-v2/assets/index-H6bwm6L6.js +0 -2
- prefect/server/ui-v2/assets/index-WYPZo52S.js +0 -17
- prefect/server/ui-v2/assets/index-WYPZo52S.js.map +0 -1
- prefect/server/ui-v2/assets/index-qPlIYf3i.js +0 -2
- prefect/server/ui-v2/assets/route-error-state-ALftyvGl.js +0 -2
- prefect/server/ui-v2/assets/settings-BL0X8cDU.js +0 -2
- prefect/server/ui-v2/assets/settings-BL0X8cDU.js.map +0 -1
- prefect/server/ui-v2/assets/table-CEAx-qHs.js +0 -2
- prefect/server/ui-v2/assets/table-CEAx-qHs.js.map +0 -1
- prefect/server/ui-v2/assets/tags-input-D1RJZEUA.js +0 -2
- prefect/server/ui-v2/assets/tags-input-D1RJZEUA.js.map +0 -1
- prefect/server/ui-v2/assets/task-run-concurrency-limits-reset-dialog-CG3den1B.js +0 -2
- prefect/server/ui-v2/assets/task-run._id-CnIVqU6v.js +0 -2
- prefect/server/ui-v2/assets/task-runs-pagination-DLSAz-Ur.js +0 -2
- prefect/server/ui-v2/assets/use-delete-automation-confirmation-dialog-Bzy2ML2T.js +0 -2
- prefect/server/ui-v2/assets/use-local-storage-CpxMp5wR.js +0 -2
- prefect/server/ui-v2/assets/use-local-storage-CpxMp5wR.js.map +0 -1
- prefect/server/ui-v2/assets/work-pool-queue-toggle-D4eeo-hi.js +0 -2
- prefect/server/ui-v2/assets/work-pool_._workPoolName.edit-CA0ePjCk.js +0 -2
- {prefect-3.6.12.dist-info → prefect-3.6.13.dev2.dist-info}/WHEEL +0 -0
- {prefect-3.6.12.dist-info → prefect-3.6.13.dev2.dist-info}/entry_points.txt +0 -0
- {prefect-3.6.12.dist-info → prefect-3.6.13.dev2.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{j as e,L as C,s as y,r as m,C as z,D as U,m as
|
|
2
|
-
//# sourceMappingURL=index-
|
|
1
|
+
import{j as e,L as C,s as y,r as m,C as z,D as U,m as q,p as A}from"./vendor-tanstack-BK8oseNA.js";import{aM as W,aN as _,aO as B,aP as P,aQ as Q,N as O,aR as Y,aS as L,q as H,I as V,y as Z,ak as E,O as G,S as J,a as X,b as ee,c as ae,e as te,E as se,t as ne,v as le,w as oe,x as re,D as ie,B as ce,g as de,h as ue,aT as h,aU as F,aV as D}from"./index-BvSl3DKP.js";import{D as me}from"./data-table-Bw8TZx9D.js";import{T as pe}from"./tags-input-Ci2JQ-k3.js";import{D as ge,a as fe,b as he,c as xe,d as R,e as we}from"./dropdown-menu-CT-s-V7d.js";import{Y as ye}from"./vendor-date-7GxEwcQM.js";import{o as je,e as Se,a as _e,n as I,s as M}from"./vendor-forms-DxqqmhL5.js";import"./vendor-react-Bce9NwRC.js";import"./vendor-radix-CznP1SOq.js";import"./vendor-recharts-D4imLXNl.js";import"./table-vo9Do8sA.js";const Ce=({row:t})=>t.original.id?e.jsxs("div",{className:"flex flex-col pl-4",children:[e.jsx(C,{to:"/flows/flow/$id",params:{id:t.original.id},className:"text-sm font-medium truncate",title:t.original.name,children:t.original.name}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:["Created"," ",t.original?.created&&W(t.original.created,"dateTime")]})]}):null,ve=({row:t})=>{const a=t.original.id,{data:n}=y({..._({flows:{operator:"and_",id:{any_:[a??""]}},flow_runs:{operator:"and_",start_time:{is_null_:!1}},offset:0,limit:1,sort:"START_TIME_DESC"}),enabled:!!a}),s=n?.[0];return!a||!s?null:e.jsxs("div",{className:"flex items-center gap-1",children:[s.state_type&&e.jsx(B,{type:s.state_type,name:s.state_name??void 0}),e.jsx(C,{to:"/runs/flow-run/$id",params:{id:s.id??""},children:e.jsx("span",{className:"text-sm text-blue-700 hover:underline",children:s.name})})]})},be=({row:t})=>{const a=t.original.id,{data:n}=y(P(a?[a]:[],{enabled:!!a})),s=a?n?.[a]:null;return!a||!s?null:e.jsxs("div",{className:"flex items-center gap-1",children:[s.state_type&&e.jsx(B,{type:s.state_type,name:s.state_name}),e.jsx(C,{to:"/runs/flow-run/$id",params:{id:s.id??""},children:e.jsx("span",{className:"text-sm text-blue-700 hover:underline",children:s.name})})]})},Ne=({row:t})=>{const a=t.original.id,{data:n}=y(Q(a?[a]:[],{enabled:!!a}));if(!a)return null;const s=n?.[a]??0;return s===0?e.jsx("span",{className:"text-sm text-muted-foreground",children:"None"}):e.jsx(C,{to:"/flows/flow/$id",params:{id:a},search:{tab:"deployments"},children:e.jsxs("span",{className:"text-sm text-blue-700 hover:underline",children:[s," ",O(s,"Deployment")]})})},De=({row:t})=>{const a=t.original.id,{deleteFlow:n}=L();return a?e.jsx("div",{className:"flex justify-end",children:e.jsxs(ge,{children:[e.jsx(fe,{asChild:!0,children:e.jsxs(H,{variant:"ghost",className:"h-8 w-8 p-0",children:[e.jsx("span",{className:"sr-only",children:"Open menu"}),e.jsx(V,{id:"MoreVertical",className:"h-4 w-4"})]})}),e.jsxs(he,{align:"end",children:[e.jsx(xe,{children:"Actions"}),e.jsx(R,{onClick:()=>{navigator.clipboard.writeText(a),Z.success("ID copied")},children:"Copy ID"}),e.jsx(we,{}),e.jsx(R,{onClick:()=>n(a),children:"Delete"}),e.jsx(R,{children:"Automate"})]})]})}):null},k=16,Re=({row:t})=>{const a=t.original.id,{startDate:n,endDate:s}=m.useMemo(()=>{const i=new Date;return{startDate:ye(i),endDate:i}},[]),{data:o}=y({..._({flows:{operator:"and_",id:{any_:[a??""]}},flow_runs:{operator:"and_",start_time:{is_null_:!1}},offset:0,limit:k,sort:"START_TIME_DESC"}),enabled:!!a});return a?e.jsx(Y,{chartId:`flow-activity-${a}`,enrichedFlowRuns:o??[],startDate:n,endDate:s,numberOfBars:k,className:"h-[24px] w-[140px]"}):null},Te=[{id:"select",header:({table:t})=>e.jsx(E,{checked:t.getIsAllPageRowsSelected(),onCheckedChange:a=>t.toggleAllPageRowsSelected(!!a),"aria-label":"Select all"}),cell:({row:t})=>e.jsx(E,{checked:t.getIsSelected(),onCheckedChange:a=>t.toggleSelected(!!a),"aria-label":"Select row"}),enableSorting:!1,enableHiding:!1,maxSize:10},{accessorKey:"name",header:()=>e.jsx("div",{className:"pl-4",children:"Flow"}),cell:Ce},{accessorKey:"lastRuns",header:"Last Run",cell:ve},{accessorKey:"nextRuns",header:"Next Run",cell:be},{accessorKey:"deployments",header:"Deployments",cell:Ne},{accessorKey:"activity",header:"Activity",cell:Re},{id:"actions",cell:De}],Ae=[{label:"A to Z",value:"NAME_ASC"},{label:"Z to A",value:"NAME_DESC"},{label:"Created",value:"CREATED_DESC"}];function Ee({flows:t,count:a,pageCount:n,sort:s,pagination:o,onPaginationChange:i,onSortChange:g,columnFilters:c,onColumnFiltersChange:r,onPrefetchPage:x}){const{deleteFlow:w}=L(),[f,v]=m.useState({}),b=c.find(l=>l.id==="name")?.value??"",N=c.find(l=>l.id==="tags")?.value??[],j=m.useCallback(l=>{const u=c.filter(p=>p.id!=="name");r(l?[...u,{id:"name",value:l}]:u)},[r,c]),T=m.useCallback(l=>{const u=Array.isArray(l)?l:[],p=c.filter($=>$.id!=="tags");r(u.length?[...p,{id:"tags",value:u}]:p)},[r,c]),S=m.useCallback(l=>{let u=o;typeof l=="function"?u=l(o):u=l,i(u)},[o,i]),d=z({columns:Te,data:t,getCoreRowModel:U(),manualPagination:!0,pageCount:n,state:{rowSelection:f,pagination:o},onRowSelectionChange:v,onPaginationChange:S}),K=()=>{const u=Object.keys(f).map(p=>t[Number(p)].id);for(const p of u)w(p);d.toggleAllRowsSelected(!1)};return e.jsxs("div",{className:"h-full",children:[e.jsxs("div",{className:"grid sm:grid-cols-2 md:grid-cols-6 lg:grid-cols-12 gap-2 pb-4 items-center",children:[e.jsx("div",{className:"sm:col-span-2 md:col-span-6 lg:col-span-4 order-last lg:order-first",children:Object.keys(f).length>0?e.jsxs("p",{className:"text-sm text-muted-foreground flex items-center",children:[Object.keys(f).length," selected",e.jsx(V,{id:"Trash2",className:"ml-2 cursor-pointer h-4 w-4 inline",onClick:K})]}):e.jsxs("p",{className:"text-sm text-muted-foreground",children:[a," ",O(a,"Flow")]})}),e.jsx("div",{className:"sm:col-span-2 md:col-span-2 lg:col-span-3",children:e.jsx(G,{placeholder:"Flow names",value:b,onChange:l=>j(l.target.value)})}),e.jsx("div",{className:"xs:col-span-1 md:col-span-2 lg:col-span-3",children:e.jsx(pe,{placeholder:"Filter by tags",onChange:T,value:N})}),e.jsx("div",{className:"xs:col-span-1 md:col-span-2 lg:col-span-2",children:e.jsxs(J,{value:s,onValueChange:g,children:[e.jsx(X,{"aria-label":"Flow sort order",className:"w-full",children:e.jsx(ee,{placeholder:"Sort by"})}),e.jsx(ae,{children:Ae.map(l=>e.jsx(te,{value:l.value,children:l.label},l.value))})]})})]}),e.jsx(me,{table:d,onPrefetchPage:x})]})}const Fe=()=>e.jsxs(se,{children:[e.jsx(ne,{id:"Workflow"}),e.jsx(le,{children:"Run a flow to get started"}),e.jsx(oe,{children:"Flows are Python functions that encapsulate workflow logic and allow users to interact with and reason about the state of their workflows."}),e.jsx(re,{children:e.jsx(ie,{id:"flows-guide"})})]}),Ie=()=>e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(ce,{children:e.jsx(de,{children:e.jsx(ue,{className:"text-xl font-semibold",children:"Flows"})})})});function Me({flows:t,count:a,totalCount:n,pageCount:s,sort:o,pagination:i,onPaginationChange:g,onSortChange:c,columnFilters:r,onColumnFiltersChange:x,onPrefetchPage:w}){return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(Ie,{}),n===0?e.jsx(Fe,{}):e.jsx(Ee,{flows:t,count:a,pageCount:s,sort:o,pagination:i,onPaginationChange:g,onSortChange:c,columnFilters:r,onColumnFiltersChange:x,onPrefetchPage:w})]})}je({name:M().optional(),page:I().int().positive().optional().default(1).catch(1),limit:I().int().positive().max(100).optional().default(10).catch(10),tags:_e(M()).optional(),sort:Se(["CREATED_DESC","UPDATED_DESC","NAME_ASC","NAME_DESC"]).optional().default("NAME_ASC")}).optional().default({});const ke=t=>{const a=!!t?.name,n=!!t?.tags?.length;return!a&&!n?{page:t?.page??1,limit:t?.limit??10,sort:t?.sort??"NAME_ASC"}:{page:t?.page??1,limit:t?.limit??10,sort:t?.sort??"NAME_ASC",flows:{operator:"and_",...a&&{name:{like_:t?.name}},...n&&{tags:{operator:"and_",all_:t?.tags}}}}},Be=16,Pe=()=>{const t=h.useSearch(),a=h.useNavigate(),n=m.useMemo(()=>({pageIndex:(t.page??1)-1,pageSize:t.limit??10}),[t.page,t.limit]),s=m.useCallback(o=>{a({to:".",search:i=>({...i,page:o.pageIndex+1,limit:o.pageSize}),replace:!0})},[a]);return[n,s]},Qe=()=>{const t=h.useSearch(),a=h.useNavigate(),n=m.useCallback(s=>{a({to:".",search:o=>({...o,sort:s}),replace:!0})},[a]);return[t.sort,n]},Oe=()=>{const t=h.useSearch(),a=h.useNavigate(),n=m.useMemo(()=>[{id:"name",value:t.name},{id:"tags",value:t.tags}],[t.name,t.tags]),s=m.useCallback(o=>{a({to:".",search:i=>{const g=o.find(r=>r.id==="name")?.value,c=o.find(r=>r.id==="tags")?.value;return{...i,page:1,name:g,tags:c}},replace:!0})},[a]);return[n,s]};function Ge(){const t=h.useSearch(),a=q(),[n,s]=Pe(),[o,i]=Qe(),[g,c]=Oe(),r=ke(t),{data:x}=A(F({offset:0,sort:t.sort,flows:r.flows??void 0})),{data:w}=A(F({offset:0,sort:"NAME_ASC"})),{data:f}=y(D(r,3e4)),v=f?.results??[],b=m.useCallback(N=>{const j={...r,page:N};a.prefetchQuery(D(j,3e4)).then(()=>{const S=a.getQueryData(D(j,3e4).queryKey)?.results?.map(d=>d.id).filter(d=>!!d)??[];if(S.length!==0)for(const d of S)a.prefetchQuery(P([d])),a.prefetchQuery(Q([d])),a.prefetchQuery(_({flows:{operator:"and_",id:{any_:[d]}},flow_runs:{operator:"and_",start_time:{is_null_:!1}},offset:0,limit:1,sort:"START_TIME_DESC"})),a.prefetchQuery(_({flows:{operator:"and_",id:{any_:[d]}},flow_runs:{operator:"and_",start_time:{is_null_:!1}},offset:0,limit:Be,sort:"START_TIME_DESC"}))})},[a,r]);return e.jsx(Me,{flows:v,count:x??0,totalCount:w??0,pageCount:f?.pages??0,sort:o,pagination:n,onPaginationChange:s,onSortChange:i,columnFilters:g,onColumnFiltersChange:c,onPrefetchPage:b})}export{Ge as component};
|
|
2
|
+
//# sourceMappingURL=index-D6GJ4go1.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-DfiNsXba.js","sources":["../../src/components/flows/cells.tsx","../../src/components/flows/columns.tsx","../../src/components/flows/data-table.tsx","../../src/components/flows/empty-state/flows-empty-state.tsx","../../src/components/flows/flows-page-header.tsx","../../src/components/flows/flows-page.tsx","../../src/routes/flows/index.tsx?tsr-split=component"],"sourcesContent":["import { useQuery } from \"@tanstack/react-query\";\nimport { Link } from \"@tanstack/react-router\";\nimport { subWeeks } from \"date-fns\";\nimport { useMemo } from \"react\";\nimport { toast } from \"sonner\";\nimport { buildFilterFlowRunsQuery } from \"@/api/flow-runs\";\nimport {\n\tbuildDeploymentsCountByFlowQuery,\n\tbuildNextRunsByFlowQuery,\n\tuseDeleteFlowById,\n} from \"@/api/flows\";\nimport type { components } from \"@/api/prefect\";\nimport { Button } from \"@/components/ui/button\";\nimport {\n\tDropdownMenu,\n\tDropdownMenuContent,\n\tDropdownMenuItem,\n\tDropdownMenuLabel,\n\tDropdownMenuSeparator,\n\tDropdownMenuTrigger,\n} from \"@/components/ui/dropdown-menu\";\nimport { FlowRunActivityBarChart } from \"@/components/ui/flow-run-activity-bar-graph\";\nimport { Icon } from \"@/components/ui/icons\";\nimport { StateIcon } from \"@/components/ui/state-badge\";\nimport { pluralize } from \"@/utils\";\nimport { formatDate } from \"@/utils/date\";\n\ntype Flow = components[\"schemas\"][\"Flow\"];\n\nexport const FlowName = ({ row }: { row: { original: Flow } }) => {\n\tif (!row.original.id) return null;\n\n\treturn (\n\t\t<div className=\"flex flex-col pl-4\">\n\t\t\t<Link\n\t\t\t\tto=\"/flows/flow/$id\"\n\t\t\t\tparams={{ id: row.original.id }}\n\t\t\t\tclassName=\"text-sm font-medium truncate\"\n\t\t\t\ttitle={row.original.name}\n\t\t\t>\n\t\t\t\t{row.original.name}\n\t\t\t</Link>\n\t\t\t<span className=\"text-xs text-muted-foreground\">\n\t\t\t\tCreated{\" \"}\n\t\t\t\t{row.original?.created && formatDate(row.original.created, \"dateTime\")}\n\t\t\t</span>\n\t\t</div>\n\t);\n};\n\nexport const FlowLastRun = ({ row }: { row: { original: Flow } }) => {\n\tconst flowId = row.original.id;\n\tconst { data: flowRuns } = useQuery({\n\t\t...buildFilterFlowRunsQuery({\n\t\t\tflows: { operator: \"and_\", id: { any_: [flowId ?? \"\"] } },\n\t\t\tflow_runs: {\n\t\t\t\toperator: \"and_\",\n\t\t\t\tstart_time: { is_null_: false },\n\t\t\t},\n\t\t\toffset: 0,\n\t\t\tlimit: 1,\n\t\t\tsort: \"START_TIME_DESC\",\n\t\t}),\n\t\tenabled: !!flowId,\n\t});\n\n\tconst lastRun = flowRuns?.[0];\n\tif (!flowId || !lastRun) return null;\n\n\treturn (\n\t\t<div className=\"flex items-center gap-1\">\n\t\t\t{lastRun.state_type && (\n\t\t\t\t<StateIcon\n\t\t\t\t\ttype={lastRun.state_type}\n\t\t\t\t\tname={lastRun.state_name ?? undefined}\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t<Link to=\"/runs/flow-run/$id\" params={{ id: lastRun.id ?? \"\" }}>\n\t\t\t\t<span className=\"text-sm text-blue-700 hover:underline\">\n\t\t\t\t\t{lastRun.name}\n\t\t\t\t</span>\n\t\t\t</Link>\n\t\t</div>\n\t);\n};\n\nexport const FlowNextRun = ({ row }: { row: { original: Flow } }) => {\n\tconst flowId = row.original.id;\n\tconst { data: nextRunsMap } = useQuery(\n\t\tbuildNextRunsByFlowQuery(flowId ? [flowId] : [], { enabled: !!flowId }),\n\t);\n\n\tconst nextRun = flowId ? nextRunsMap?.[flowId] : null;\n\tif (!flowId || !nextRun) return null;\n\n\treturn (\n\t\t<div className=\"flex items-center gap-1\">\n\t\t\t{nextRun.state_type && (\n\t\t\t\t<StateIcon type={nextRun.state_type} name={nextRun.state_name} />\n\t\t\t)}\n\t\t\t<Link to=\"/runs/flow-run/$id\" params={{ id: nextRun.id ?? \"\" }}>\n\t\t\t\t<span className=\"text-sm text-blue-700 hover:underline\">\n\t\t\t\t\t{nextRun.name}\n\t\t\t\t</span>\n\t\t\t</Link>\n\t\t</div>\n\t);\n};\n\nexport const FlowDeploymentCount = ({ row }: { row: { original: Flow } }) => {\n\tconst flowId = row.original.id;\n\tconst { data: countsMap } = useQuery(\n\t\tbuildDeploymentsCountByFlowQuery(flowId ? [flowId] : [], {\n\t\t\tenabled: !!flowId,\n\t\t}),\n\t);\n\tif (!flowId) return null;\n\n\tconst count = countsMap?.[flowId] ?? 0;\n\n\tif (count === 0) {\n\t\treturn <span className=\"text-sm text-muted-foreground\">None</span>;\n\t}\n\n\treturn (\n\t\t<Link\n\t\t\tto=\"/flows/flow/$id\"\n\t\t\tparams={{ id: flowId }}\n\t\t\tsearch={{ tab: \"deployments\" }}\n\t\t>\n\t\t\t<span className=\"text-sm text-blue-700 hover:underline\">\n\t\t\t\t{count} {pluralize(count, \"Deployment\")}\n\t\t\t</span>\n\t\t</Link>\n\t);\n};\n\nexport const FlowActionMenu = ({ row }: { row: { original: Flow } }) => {\n\tconst id = row.original.id;\n\n\tconst { deleteFlow } = useDeleteFlowById();\n\n\tif (!id) {\n\t\treturn null;\n\t}\n\treturn (\n\t\t<div className=\"flex justify-end\">\n\t\t\t<DropdownMenu>\n\t\t\t\t<DropdownMenuTrigger asChild>\n\t\t\t\t\t<Button variant=\"ghost\" className=\"h-8 w-8 p-0\">\n\t\t\t\t\t\t<span className=\"sr-only\">Open menu</span>\n\t\t\t\t\t\t<Icon id=\"MoreVertical\" className=\"h-4 w-4\" />\n\t\t\t\t\t</Button>\n\t\t\t\t</DropdownMenuTrigger>\n\t\t\t\t<DropdownMenuContent align=\"end\">\n\t\t\t\t\t<DropdownMenuLabel>Actions</DropdownMenuLabel>\n\t\t\t\t\t<DropdownMenuItem\n\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\tvoid navigator.clipboard.writeText(id);\n\t\t\t\t\t\t\ttoast.success(\"ID copied\");\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\tCopy ID\n\t\t\t\t\t</DropdownMenuItem>\n\t\t\t\t\t<DropdownMenuSeparator />\n\t\t\t\t\t<DropdownMenuItem onClick={() => deleteFlow(id)}>\n\t\t\t\t\t\tDelete\n\t\t\t\t\t</DropdownMenuItem>\n\t\t\t\t\t<DropdownMenuItem>Automate</DropdownMenuItem>\n\t\t\t\t</DropdownMenuContent>\n\t\t\t</DropdownMenu>\n\t\t</div>\n\t);\n};\n\nconst NUMBER_OF_ACTIVITY_BARS = 16;\n\nexport const FlowActivity = ({ row }: { row: { original: Flow } }) => {\n\tconst flowId = row.original.id;\n\n\tconst { startDate, endDate } = useMemo((): {\n\t\tstartDate: Date;\n\t\tendDate: Date;\n\t} => {\n\t\tconst now = new Date();\n\t\treturn {\n\t\t\tstartDate: subWeeks(now, 1),\n\t\t\tendDate: now,\n\t\t};\n\t}, []);\n\n\tconst { data: flowRuns } = useQuery({\n\t\t...buildFilterFlowRunsQuery({\n\t\t\tflows: { operator: \"and_\", id: { any_: [flowId ?? \"\"] } },\n\t\t\tflow_runs: {\n\t\t\t\toperator: \"and_\",\n\t\t\t\tstart_time: { is_null_: false },\n\t\t\t},\n\t\t\toffset: 0,\n\t\t\tlimit: NUMBER_OF_ACTIVITY_BARS,\n\t\t\tsort: \"START_TIME_DESC\",\n\t\t}),\n\t\tenabled: !!flowId,\n\t});\n\n\tif (!flowId) return null;\n\n\treturn (\n\t\t<FlowRunActivityBarChart\n\t\t\tchartId={`flow-activity-${flowId}`}\n\t\t\tenrichedFlowRuns={flowRuns ?? []}\n\t\t\tstartDate={startDate}\n\t\t\tendDate={endDate}\n\t\t\tnumberOfBars={NUMBER_OF_ACTIVITY_BARS}\n\t\t\tclassName=\"h-[24px] w-[140px]\"\n\t\t/>\n\t);\n};\n","import type { ColumnDef } from \"@tanstack/react-table\";\nimport type { components } from \"@/api/prefect\";\nimport { Checkbox } from \"@/components/ui/checkbox\";\nimport {\n\tFlowActionMenu,\n\tFlowActivity,\n\tFlowDeploymentCount,\n\tFlowLastRun,\n\tFlowName,\n\tFlowNextRun,\n} from \"./cells\";\n\ntype Flow = components[\"schemas\"][\"Flow\"];\n\nexport const columns: ColumnDef<Flow>[] = [\n\t{\n\t\tid: \"select\",\n\t\theader: ({ table }) => (\n\t\t\t<Checkbox\n\t\t\t\tchecked={table.getIsAllPageRowsSelected()}\n\t\t\t\tonCheckedChange={(value) => table.toggleAllPageRowsSelected(!!value)}\n\t\t\t\taria-label=\"Select all\"\n\t\t\t/>\n\t\t),\n\t\tcell: ({ row }) => (\n\t\t\t<Checkbox\n\t\t\t\tchecked={row.getIsSelected()}\n\t\t\t\tonCheckedChange={(value) => row.toggleSelected(!!value)}\n\t\t\t\taria-label=\"Select row\"\n\t\t\t/>\n\t\t),\n\t\tenableSorting: false,\n\t\tenableHiding: false,\n\t\tmaxSize: 10,\n\t},\n\t{\n\t\taccessorKey: \"name\",\n\t\theader: () => <div className=\"pl-4\">Flow</div>,\n\t\tcell: FlowName,\n\t},\n\t{\n\t\taccessorKey: \"lastRuns\",\n\t\theader: \"Last Run\",\n\t\tcell: FlowLastRun,\n\t},\n\t{\n\t\taccessorKey: \"nextRuns\",\n\t\theader: \"Next Run\",\n\t\tcell: FlowNextRun,\n\t},\n\t{\n\t\taccessorKey: \"deployments\",\n\t\theader: \"Deployments\",\n\t\tcell: FlowDeploymentCount,\n\t},\n\t{\n\t\taccessorKey: \"activity\",\n\t\theader: \"Activity\",\n\t\tcell: FlowActivity,\n\t},\n\t{\n\t\tid: \"actions\",\n\t\tcell: FlowActionMenu,\n\t},\n];\n","import type {\n\tColumnFiltersState,\n\tOnChangeFn,\n\tPaginationState,\n} from \"@tanstack/react-table\";\nimport {\n\tgetCoreRowModel,\n\ttype RowSelectionState,\n\tuseReactTable,\n} from \"@tanstack/react-table\";\nimport type React from \"react\";\nimport { useCallback, useState } from \"react\";\nimport { type Flow, useDeleteFlowById } from \"@/api/flows\";\nimport { DataTable } from \"@/components/ui/data-table\";\nimport { Icon } from \"@/components/ui/icons\";\nimport { SearchInput } from \"@/components/ui/input\";\nimport {\n\tSelect,\n\tSelectContent,\n\tSelectItem,\n\tSelectTrigger,\n\tSelectValue,\n} from \"@/components/ui/select\";\nimport { TagsInput } from \"@/components/ui/tags-input\";\nimport { pluralize } from \"@/utils\";\nimport { columns } from \"./columns\";\n\nconst FLOW_SORT_OPTIONS = [\n\t{ label: \"A to Z\", value: \"NAME_ASC\" },\n\t{ label: \"Z to A\", value: \"NAME_DESC\" },\n\t{ label: \"Created\", value: \"CREATED_DESC\" },\n] as const;\n\ntype FlowSortValue = \"NAME_ASC\" | \"NAME_DESC\" | \"CREATED_DESC\" | \"UPDATED_DESC\";\n\nexport default function FlowsTable({\n\tflows,\n\tcount,\n\tpageCount,\n\tsort,\n\tpagination,\n\tonPaginationChange,\n\tonSortChange,\n\tcolumnFilters,\n\tonColumnFiltersChange,\n\tonPrefetchPage,\n}: {\n\tflows: Flow[];\n\tcount: number;\n\tpageCount: number;\n\tsort: FlowSortValue;\n\tpagination: PaginationState;\n\tonPaginationChange: (pagination: PaginationState) => void;\n\tonSortChange: (sort: FlowSortValue) => void;\n\tcolumnFilters: ColumnFiltersState;\n\tonColumnFiltersChange: (columnFilters: ColumnFiltersState) => void;\n\tonPrefetchPage?: (page: number) => void;\n}) {\n\tconst { deleteFlow } = useDeleteFlowById();\n\tconst [rowSelection, setRowSelection] = useState<RowSelectionState>({});\n\n\tconst nameSearchValue = (columnFilters.find((filter) => filter.id === \"name\")\n\t\t?.value ?? \"\") as string;\n\tconst tagsSearchValue = (columnFilters.find((filter) => filter.id === \"tags\")\n\t\t?.value ?? []) as string[];\n\n\tconst handleNameSearchChange = useCallback(\n\t\t(value?: string) => {\n\t\t\tconst filters = columnFilters.filter((filter) => filter.id !== \"name\");\n\t\t\tonColumnFiltersChange(\n\t\t\t\tvalue ? [...filters, { id: \"name\", value }] : filters,\n\t\t\t);\n\t\t},\n\t\t[onColumnFiltersChange, columnFilters],\n\t);\n\n\tconst handleTagsSearchChange: React.ChangeEventHandler<HTMLInputElement> &\n\t\t((tags: string[]) => void) = useCallback(\n\t\t(e: string[] | React.ChangeEvent<HTMLInputElement>) => {\n\t\t\tconst tags = Array.isArray(e) ? e : [];\n\t\t\tconst filters = columnFilters.filter((filter) => filter.id !== \"tags\");\n\t\t\tonColumnFiltersChange(\n\t\t\t\ttags.length ? [...filters, { id: \"tags\", value: tags }] : filters,\n\t\t\t);\n\t\t},\n\t\t[onColumnFiltersChange, columnFilters],\n\t);\n\n\tconst handlePaginationChange: OnChangeFn<PaginationState> = useCallback(\n\t\t(updater) => {\n\t\t\tlet newPagination = pagination;\n\t\t\tif (typeof updater === \"function\") {\n\t\t\t\tnewPagination = updater(pagination);\n\t\t\t} else {\n\t\t\t\tnewPagination = updater;\n\t\t\t}\n\t\t\tonPaginationChange(newPagination);\n\t\t},\n\t\t[pagination, onPaginationChange],\n\t);\n\n\tconst table = useReactTable({\n\t\tcolumns: columns,\n\t\tdata: flows,\n\t\tgetCoreRowModel: getCoreRowModel(),\n\t\tmanualPagination: true,\n\t\tpageCount,\n\t\tstate: {\n\t\t\trowSelection,\n\t\t\tpagination,\n\t\t},\n\t\tonRowSelectionChange: setRowSelection,\n\t\tonPaginationChange: handlePaginationChange,\n\t});\n\n\tconst handleDeleteRows = () => {\n\t\tconst selectedRows = Object.keys(rowSelection);\n\n\t\tconst idsToDelete = selectedRows.map((rowId) => flows[Number(rowId)].id);\n\n\t\tfor (const id of idsToDelete) {\n\t\t\tdeleteFlow(id);\n\t\t}\n\n\t\ttable.toggleAllRowsSelected(false);\n\t};\n\n\treturn (\n\t\t<div className=\"h-full\">\n\t\t\t<div className=\"grid sm:grid-cols-2 md:grid-cols-6 lg:grid-cols-12 gap-2 pb-4 items-center\">\n\t\t\t\t<div className=\"sm:col-span-2 md:col-span-6 lg:col-span-4 order-last lg:order-first\">\n\t\t\t\t\t{Object.keys(rowSelection).length > 0 ? (\n\t\t\t\t\t\t<p className=\"text-sm text-muted-foreground flex items-center\">\n\t\t\t\t\t\t\t{Object.keys(rowSelection).length} selected\n\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\tid=\"Trash2\"\n\t\t\t\t\t\t\t\tclassName=\"ml-2 cursor-pointer h-4 w-4 inline\"\n\t\t\t\t\t\t\t\tonClick={handleDeleteRows}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</p>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<p className=\"text-sm text-muted-foreground\">\n\t\t\t\t\t\t\t{count} {pluralize(count, \"Flow\")}\n\t\t\t\t\t\t</p>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t\t<div className=\"sm:col-span-2 md:col-span-2 lg:col-span-3\">\n\t\t\t\t\t<SearchInput\n\t\t\t\t\t\tplaceholder=\"Flow names\"\n\t\t\t\t\t\tvalue={nameSearchValue}\n\t\t\t\t\t\tonChange={(e) => handleNameSearchChange(e.target.value)}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t\t<div className=\"xs:col-span-1 md:col-span-2 lg:col-span-3\">\n\t\t\t\t\t<TagsInput\n\t\t\t\t\t\tplaceholder=\"Filter by tags\"\n\t\t\t\t\t\tonChange={handleTagsSearchChange}\n\t\t\t\t\t\tvalue={tagsSearchValue}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t\t<div className=\"xs:col-span-1 md:col-span-2 lg:col-span-2\">\n\t\t\t\t\t<Select value={sort} onValueChange={onSortChange}>\n\t\t\t\t\t\t<SelectTrigger aria-label=\"Flow sort order\" className=\"w-full\">\n\t\t\t\t\t\t\t<SelectValue placeholder=\"Sort by\" />\n\t\t\t\t\t\t</SelectTrigger>\n\t\t\t\t\t\t<SelectContent>\n\t\t\t\t\t\t\t{FLOW_SORT_OPTIONS.map((option) => (\n\t\t\t\t\t\t\t\t<SelectItem key={option.value} value={option.value}>\n\t\t\t\t\t\t\t\t\t{option.label}\n\t\t\t\t\t\t\t\t</SelectItem>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t</SelectContent>\n\t\t\t\t\t</Select>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<DataTable table={table} onPrefetchPage={onPrefetchPage} />\n\t\t</div>\n\t);\n}\n","import { DocsLink } from \"@/components/ui/docs-link\";\nimport {\n\tEmptyState,\n\tEmptyStateActions,\n\tEmptyStateDescription,\n\tEmptyStateIcon,\n\tEmptyStateTitle,\n} from \"@/components/ui/empty-state\";\n\nexport const FlowsEmptyState = () => (\n\t<EmptyState>\n\t\t<EmptyStateIcon id=\"Workflow\" />\n\t\t<EmptyStateTitle>Run a flow to get started</EmptyStateTitle>\n\t\t<EmptyStateDescription>\n\t\t\tFlows are Python functions that encapsulate workflow logic and allow users\n\t\t\tto interact with and reason about the state of their workflows.\n\t\t</EmptyStateDescription>\n\t\t<EmptyStateActions>\n\t\t\t<DocsLink id=\"flows-guide\" />\n\t\t</EmptyStateActions>\n\t</EmptyState>\n);\n","import {\n\tBreadcrumb,\n\tBreadcrumbItem,\n\tBreadcrumbList,\n} from \"@/components/ui/breadcrumb\";\n\nexport const FlowsHeader = () => {\n\treturn (\n\t\t<div className=\"flex items-center gap-2\">\n\t\t\t<Breadcrumb>\n\t\t\t\t<BreadcrumbList>\n\t\t\t\t\t<BreadcrumbItem className=\"text-xl font-semibold\">\n\t\t\t\t\t\tFlows\n\t\t\t\t\t</BreadcrumbItem>\n\t\t\t\t</BreadcrumbList>\n\t\t\t</Breadcrumb>\n\t\t</div>\n\t);\n};\n","import type {\n\tColumnFiltersState,\n\tPaginationState,\n} from \"@tanstack/react-table\";\nimport type { Flow } from \"@/api/flows\";\nimport FlowsTable from \"./data-table\";\nimport { FlowsEmptyState } from \"./empty-state\";\nimport { FlowsHeader } from \"./flows-page-header\";\n\ntype FlowSortValue = \"NAME_ASC\" | \"NAME_DESC\" | \"CREATED_DESC\" | \"UPDATED_DESC\";\n\ntype FlowsPageProps = {\n\tflows: Flow[];\n\tcount: number;\n\ttotalCount: number;\n\tpageCount: number;\n\tsort: FlowSortValue;\n\tpagination: PaginationState;\n\tonPaginationChange: (pagination: PaginationState) => void;\n\tonSortChange: (sort: FlowSortValue) => void;\n\tcolumnFilters: ColumnFiltersState;\n\tonColumnFiltersChange: (columnFilters: ColumnFiltersState) => void;\n\tonPrefetchPage?: (page: number) => void;\n};\n\nexport default function FlowsPage({\n\tflows,\n\tcount,\n\ttotalCount,\n\tpageCount,\n\tsort,\n\tpagination,\n\tonPaginationChange,\n\tonSortChange,\n\tcolumnFilters,\n\tonColumnFiltersChange,\n\tonPrefetchPage,\n}: FlowsPageProps) {\n\treturn (\n\t\t<div className=\"flex flex-col gap-4\">\n\t\t\t<FlowsHeader />\n\t\t\t{totalCount === 0 ? (\n\t\t\t\t<FlowsEmptyState />\n\t\t\t) : (\n\t\t\t\t<FlowsTable\n\t\t\t\t\tflows={flows}\n\t\t\t\t\tcount={count}\n\t\t\t\t\tpageCount={pageCount}\n\t\t\t\t\tsort={sort}\n\t\t\t\t\tpagination={pagination}\n\t\t\t\t\tonPaginationChange={onPaginationChange}\n\t\t\t\t\tonSortChange={onSortChange}\n\t\t\t\t\tcolumnFilters={columnFilters}\n\t\t\t\t\tonColumnFiltersChange={onColumnFiltersChange}\n\t\t\t\t\tonPrefetchPage={onPrefetchPage}\n\t\t\t\t/>\n\t\t\t)}\n\t\t</div>\n\t);\n}\n","import {\n\tuseQuery,\n\tuseQueryClient,\n\tuseSuspenseQuery,\n} from \"@tanstack/react-query\";\nimport type { ErrorComponentProps } from \"@tanstack/react-router\";\nimport { createFileRoute } from \"@tanstack/react-router\";\nimport type {\n\tColumnFiltersState,\n\tPaginationState,\n} from \"@tanstack/react-table\";\nimport { zodValidator } from \"@tanstack/zod-adapter\";\nimport { useCallback, useMemo } from \"react\";\nimport { z } from \"zod\";\nimport { categorizeError } from \"@/api/error-utils\";\nimport { buildFilterFlowRunsQuery } from \"@/api/flow-runs\";\nimport {\n\tbuildCountFlowsFilteredQuery,\n\tbuildDeploymentsCountByFlowQuery,\n\tbuildNextRunsByFlowQuery,\n\tbuildPaginateFlowsQuery,\n\ttype FlowsPaginateFilter,\n} from \"@/api/flows\";\nimport FlowsPage from \"@/components/flows/flows-page\";\nimport { RouteErrorState } from \"@/components/ui/route-error-state\";\n\n// Route for /flows/\n\nconst searchParams = z\n\t.object({\n\t\tname: z.string().optional(),\n\t\tpage: z.number().int().positive().optional().default(1).catch(1),\n\t\tlimit: z\n\t\t\t.number()\n\t\t\t.int()\n\t\t\t.positive()\n\t\t\t.max(100)\n\t\t\t.optional()\n\t\t\t.default(10)\n\t\t\t.catch(10),\n\t\ttags: z.array(z.string()).optional(),\n\t\tsort: z\n\t\t\t.enum([\"CREATED_DESC\", \"UPDATED_DESC\", \"NAME_ASC\", \"NAME_DESC\"])\n\t\t\t.optional()\n\t\t\t.default(\"NAME_ASC\"),\n\t})\n\t.optional()\n\t.default({});\n\ntype SearchParams = z.infer<typeof searchParams>;\n\nconst buildPaginationBody = (search?: SearchParams): FlowsPaginateFilter => {\n\tconst hasNameFilter = Boolean(search?.name);\n\tconst hasTagsFilter = Boolean(search?.tags?.length);\n\n\tif (!hasNameFilter && !hasTagsFilter) {\n\t\treturn {\n\t\t\tpage: search?.page ?? 1,\n\t\t\tlimit: search?.limit ?? 10,\n\t\t\tsort: search?.sort ?? \"NAME_ASC\",\n\t\t};\n\t}\n\n\treturn {\n\t\tpage: search?.page ?? 1,\n\t\tlimit: search?.limit ?? 10,\n\t\tsort: search?.sort ?? \"NAME_ASC\",\n\t\tflows: {\n\t\t\toperator: \"and_\",\n\t\t\t...(hasNameFilter && { name: { like_: search?.name } }),\n\t\t\t...(hasTagsFilter && {\n\t\t\t\ttags: { operator: \"and_\", all_: search?.tags },\n\t\t\t}),\n\t\t},\n\t};\n};\n\nconst NUMBER_OF_ACTIVITY_BARS = 16;\n\nfunction FlowsErrorComponent({ error, reset }: ErrorComponentProps) {\n\tconst serverError = categorizeError(error, \"Failed to load flows\");\n\n\t// Only handle API errors (server-error, client-error) at route level\n\t// Let network errors and unknown errors bubble up to root error component\n\tif (\n\t\tserverError.type !== \"server-error\" &&\n\t\tserverError.type !== \"client-error\"\n\t) {\n\t\tthrow error;\n\t}\n\n\treturn (\n\t\t<div className=\"flex flex-col gap-4\">\n\t\t\t<div>\n\t\t\t\t<h1 className=\"text-2xl font-semibold\">Flows</h1>\n\t\t\t</div>\n\t\t\t<RouteErrorState error={serverError} onRetry={reset} />\n\t\t</div>\n\t);\n}\n\nexport const Route = createFileRoute(\"/flows/\")({\n\tvalidateSearch: zodValidator(searchParams),\n\tcomponent: FlowsRoute,\n\terrorComponent: FlowsErrorComponent,\n\tloaderDeps: ({ search }) => buildPaginationBody(search),\n\tloader: ({ deps, context }) => {\n\t\t// Prefetch current page queries without blocking the loader\n\t\tvoid context.queryClient.prefetchQuery(\n\t\t\tbuildPaginateFlowsQuery(deps, 30_000),\n\t\t);\n\t\tvoid context.queryClient.prefetchQuery(\n\t\t\tbuildCountFlowsFilteredQuery({\n\t\t\t\toffset: 0,\n\t\t\t\tsort: deps.sort,\n\t\t\t\tflows: deps.flows ?? undefined,\n\t\t\t}),\n\t\t);\n\t\t// Prefetch total count for empty state check\n\t\tvoid context.queryClient.prefetchQuery(\n\t\t\tbuildCountFlowsFilteredQuery({\n\t\t\t\toffset: 0,\n\t\t\t\tsort: \"NAME_ASC\",\n\t\t\t}),\n\t\t);\n\t},\n\twrapInSuspense: true,\n});\n\nconst usePagination = () => {\n\tconst search = Route.useSearch();\n\tconst navigate = Route.useNavigate();\n\n\t// Convert URL params (1-based page) to TanStack Table's PaginationState (0-based pageIndex)\n\tconst pagination: PaginationState = useMemo(\n\t\t() => ({\n\t\t\tpageIndex: (search.page ?? 1) - 1,\n\t\t\tpageSize: search.limit ?? 10,\n\t\t}),\n\t\t[search.page, search.limit],\n\t);\n\n\tconst onPaginationChange = useCallback(\n\t\t(newPagination: PaginationState) => {\n\t\t\tvoid navigate({\n\t\t\t\tto: \".\",\n\t\t\t\tsearch: (prev) => ({\n\t\t\t\t\t...prev,\n\t\t\t\t\t// Convert TanStack Table's 0-based pageIndex back to 1-based page for URL\n\t\t\t\t\tpage: newPagination.pageIndex + 1,\n\t\t\t\t\tlimit: newPagination.pageSize,\n\t\t\t\t}),\n\t\t\t\treplace: true,\n\t\t\t});\n\t\t},\n\t\t[navigate],\n\t);\n\n\treturn [pagination, onPaginationChange] as const;\n};\n\ntype FlowSort = \"CREATED_DESC\" | \"UPDATED_DESC\" | \"NAME_ASC\" | \"NAME_DESC\";\n\nconst useSort = () => {\n\tconst search = Route.useSearch();\n\tconst navigate = Route.useNavigate();\n\n\tconst onSortChange = useCallback(\n\t\t(sort: FlowSort) => {\n\t\t\tvoid navigate({\n\t\t\t\tto: \".\",\n\t\t\t\tsearch: (prev) => ({ ...prev, sort }),\n\t\t\t\treplace: true,\n\t\t\t});\n\t\t},\n\t\t[navigate],\n\t);\n\n\treturn [search.sort, onSortChange] as const;\n};\n\nconst useFlowsColumnFilters = () => {\n\tconst search = Route.useSearch();\n\tconst navigate = Route.useNavigate();\n\tconst columnFilters: ColumnFiltersState = useMemo(\n\t\t() => [\n\t\t\t{ id: \"name\", value: search.name },\n\t\t\t{ id: \"tags\", value: search.tags },\n\t\t],\n\t\t[search.name, search.tags],\n\t);\n\n\tconst onColumnFiltersChange = useCallback(\n\t\t(newColumnFilters: ColumnFiltersState) => {\n\t\t\tvoid navigate({\n\t\t\t\tto: \".\",\n\t\t\t\tsearch: (prev) => {\n\t\t\t\t\tconst name = newColumnFilters.find((filter) => filter.id === \"name\")\n\t\t\t\t\t\t?.value as string | undefined;\n\t\t\t\t\tconst tags = newColumnFilters.find((filter) => filter.id === \"tags\")\n\t\t\t\t\t\t?.value as string[] | undefined;\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...prev,\n\t\t\t\t\t\tpage: 1,\n\t\t\t\t\t\tname,\n\t\t\t\t\t\ttags,\n\t\t\t\t\t};\n\t\t\t\t},\n\t\t\t\treplace: true,\n\t\t\t});\n\t\t},\n\t\t[navigate],\n\t);\n\n\treturn [columnFilters, onColumnFiltersChange] as const;\n};\n\nfunction FlowsRoute() {\n\tconst search = Route.useSearch();\n\tconst queryClient = useQueryClient();\n\tconst [pagination, onPaginationChange] = usePagination();\n\tconst [sort, onSortChange] = useSort();\n\tconst [columnFilters, onColumnFiltersChange] = useFlowsColumnFilters();\n\n\tconst paginationBody = buildPaginationBody(search);\n\n\t// Use useSuspenseQuery for count (stable key, won't cause suspense on search change)\n\tconst { data: count } = useSuspenseQuery(\n\t\tbuildCountFlowsFilteredQuery({\n\t\t\toffset: 0,\n\t\t\tsort: search.sort,\n\t\t\tflows: paginationBody.flows ?? undefined,\n\t\t}),\n\t);\n\n\t// Get total count of all flows (without filters) to determine if empty state should be shown\n\tconst { data: totalCount } = useSuspenseQuery(\n\t\tbuildCountFlowsFilteredQuery({\n\t\t\toffset: 0,\n\t\t\tsort: \"NAME_ASC\",\n\t\t}),\n\t);\n\n\t// Use useQuery for paginated flows to leverage placeholderData: keepPreviousData\n\t// This prevents the page from suspending when search/filter changes\n\tconst { data: flowsPage } = useQuery(\n\t\tbuildPaginateFlowsQuery(paginationBody, 30_000),\n\t);\n\n\tconst flows = flowsPage?.results ?? [];\n\n\t// Prefetch a page and its child component data when user hovers over pagination buttons\n\tconst onPrefetchPage = useCallback(\n\t\t(page: number) => {\n\t\t\tconst pageDeps = { ...paginationBody, page };\n\t\t\tvoid queryClient\n\t\t\t\t.prefetchQuery(buildPaginateFlowsQuery(pageDeps, 30_000))\n\t\t\t\t.then(() => {\n\t\t\t\t\t// Get the prefetched page data from cache\n\t\t\t\t\tconst pageData = queryClient.getQueryData<{\n\t\t\t\t\t\tresults?: Array<{ id?: string }>;\n\t\t\t\t\t}>(buildPaginateFlowsQuery(pageDeps, 30_000).queryKey);\n\n\t\t\t\t\tconst flowIds =\n\t\t\t\t\t\tpageData?.results\n\t\t\t\t\t\t\t?.map((flow) => flow.id)\n\t\t\t\t\t\t\t.filter((id): id is string => Boolean(id)) ?? [];\n\n\t\t\t\t\tif (flowIds.length === 0) return;\n\n\t\t\t\t\t// Prefetch child component queries for each flow individually\n\t\t\t\t\t// Using individual flow IDs ensures query keys match what components use\n\t\t\t\t\tfor (const flowId of flowIds) {\n\t\t\t\t\t\t// FlowNextRun query - uses single flow ID array for query key matching\n\t\t\t\t\t\tvoid queryClient.prefetchQuery(buildNextRunsByFlowQuery([flowId]));\n\n\t\t\t\t\t\t// FlowDeploymentCount query - uses single flow ID array for query key matching\n\t\t\t\t\t\tvoid queryClient.prefetchQuery(\n\t\t\t\t\t\t\tbuildDeploymentsCountByFlowQuery([flowId]),\n\t\t\t\t\t\t);\n\t\t\t\t\t\t// FlowLastRun query - last completed run\n\t\t\t\t\t\tvoid queryClient.prefetchQuery(\n\t\t\t\t\t\t\tbuildFilterFlowRunsQuery({\n\t\t\t\t\t\t\t\tflows: { operator: \"and_\", id: { any_: [flowId] } },\n\t\t\t\t\t\t\t\tflow_runs: {\n\t\t\t\t\t\t\t\t\toperator: \"and_\",\n\t\t\t\t\t\t\t\t\tstart_time: { is_null_: false },\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\toffset: 0,\n\t\t\t\t\t\t\t\tlimit: 1,\n\t\t\t\t\t\t\t\tsort: \"START_TIME_DESC\",\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t// FlowActivity query - recent runs for activity chart\n\t\t\t\t\t\tvoid queryClient.prefetchQuery(\n\t\t\t\t\t\t\tbuildFilterFlowRunsQuery({\n\t\t\t\t\t\t\t\tflows: { operator: \"and_\", id: { any_: [flowId] } },\n\t\t\t\t\t\t\t\tflow_runs: {\n\t\t\t\t\t\t\t\t\toperator: \"and_\",\n\t\t\t\t\t\t\t\t\tstart_time: { is_null_: false },\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\toffset: 0,\n\t\t\t\t\t\t\t\tlimit: NUMBER_OF_ACTIVITY_BARS,\n\t\t\t\t\t\t\t\tsort: \"START_TIME_DESC\",\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t},\n\t\t[queryClient, paginationBody],\n\t);\n\n\treturn (\n\t\t<FlowsPage\n\t\t\tflows={flows}\n\t\t\tcount={count ?? 0}\n\t\t\ttotalCount={totalCount ?? 0}\n\t\t\tpageCount={flowsPage?.pages ?? 0}\n\t\t\tsort={sort as \"NAME_ASC\" | \"NAME_DESC\" | \"CREATED_DESC\"}\n\t\t\tpagination={pagination}\n\t\t\tonPaginationChange={onPaginationChange}\n\t\t\tonSortChange={onSortChange}\n\t\t\tcolumnFilters={columnFilters}\n\t\t\tonColumnFiltersChange={onColumnFiltersChange}\n\t\t\tonPrefetchPage={onPrefetchPage}\n\t\t/>\n\t);\n}\n"],"names":["FlowName","row","jsxs","jsx","Link","formatDate","FlowLastRun","flowId","flowRuns","useQuery","buildFilterFlowRunsQuery","lastRun","StateIcon","FlowNextRun","nextRunsMap","buildNextRunsByFlowQuery","nextRun","FlowDeploymentCount","countsMap","buildDeploymentsCountByFlowQuery","count","pluralize","FlowActionMenu","id","deleteFlow","useDeleteFlowById","DropdownMenu","DropdownMenuTrigger","Button","Icon","DropdownMenuContent","DropdownMenuLabel","DropdownMenuItem","toast","DropdownMenuSeparator","NUMBER_OF_ACTIVITY_BARS","FlowActivity","startDate","endDate","useMemo","now","subWeeks","FlowRunActivityBarChart","columns","table","Checkbox","value","FLOW_SORT_OPTIONS","FlowsTable","flows","pageCount","sort","pagination","onPaginationChange","onSortChange","columnFilters","onColumnFiltersChange","onPrefetchPage","rowSelection","setRowSelection","useState","nameSearchValue","filter","tagsSearchValue","handleNameSearchChange","useCallback","filters","handleTagsSearchChange","e","tags","handlePaginationChange","updater","newPagination","useReactTable","getCoreRowModel","handleDeleteRows","idsToDelete","rowId","SearchInput","TagsInput","Select","SelectTrigger","SelectValue","SelectContent","option","SelectItem","DataTable","FlowsEmptyState","EmptyState","EmptyStateIcon","EmptyStateTitle","EmptyStateDescription","EmptyStateActions","DocsLink","FlowsHeader","Breadcrumb","BreadcrumbList","BreadcrumbItem","FlowsPage","totalCount","z","name","string","optional","page","number","int","positive","default","catch","limit","max","buildPaginationBody","search","hasNameFilter","Boolean","hasTagsFilter","length","operator","like_","all_","usePagination","Route","useSearch","navigate","useNavigate","pageIndex","pageSize","to","prev","replace","useSort","useFlowsColumnFilters","newColumnFilters","find","FlowsRoute","queryClient","useQueryClient","paginationBody","data","useSuspenseQuery","buildCountFlowsFilteredQuery","offset","undefined","flowsPage","buildPaginateFlowsQuery","results","pageDeps","prefetchQuery","then","flowIds","getQueryData","queryKey","map","flow","any_","flow_runs","start_time","is_null_","pages"],"mappings":"syBA6BO,MAAMA,GAAW,CAAC,CAAE,IAAAC,KACrBA,EAAI,SAAS,GAGjBC,EAAAA,KAAC,MAAA,CAAI,UAAU,qBACd,SAAA,CAAAC,EAAAA,IAACC,EAAA,CACA,GAAG,kBACH,OAAQ,CAAE,GAAIH,EAAI,SAAS,EAAA,EAC3B,UAAU,+BACV,MAAOA,EAAI,SAAS,KAEnB,WAAI,SAAS,IAAA,CAAA,EAEfC,EAAAA,KAAC,OAAA,CAAK,UAAU,gCAAgC,SAAA,CAAA,UACvC,IACPD,EAAI,UAAU,SAAWI,EAAWJ,EAAI,SAAS,QAAS,UAAU,CAAA,CAAA,CACtE,CAAA,EACD,EAhB4B,KAoBjBK,GAAc,CAAC,CAAE,IAAAL,KAAuC,CACpE,MAAMM,EAASN,EAAI,SAAS,GACtB,CAAE,KAAMO,CAAA,EAAaC,EAAS,CACnC,GAAGC,EAAyB,CAC3B,MAAO,CAAE,SAAU,OAAQ,GAAI,CAAE,KAAM,CAACH,GAAU,EAAE,EAAE,EACtD,UAAW,CACV,SAAU,OACV,WAAY,CAAE,SAAU,EAAA,CAAM,EAE/B,OAAQ,EACR,MAAO,EACP,KAAM,iBAAA,CACN,EACD,QAAS,CAAC,CAACA,CAAA,CACX,EAEKI,EAAUH,IAAW,CAAC,EAC5B,MAAI,CAACD,GAAU,CAACI,EAAgB,KAG/BT,E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AqB4F,EAAQ5F,CAAG,GAAK,CAAA,EAEhD,GAAI+H,EAAQjC,SAAW,EAIvB,UAAW9G,KAAU+I,EAEfd,EAAYY,cAAcrI,EAAyB,CAACR,CAAM,CAAC,CAAC,EAG5DiI,EAAYY,cAChBjI,EAAiC,CAACZ,CAAM,CAAC,CAC1C,EAEKiI,EAAYY,cAChB1I,EAAyB,CACxBuC,MAAO,CAAEqE,SAAU,OAAQ/F,GAAI,CAAEoI,KAAM,CAACpJ,CAAM,CAAA,CAAE,EAChDqJ,UAAW,CACVtC,SAAU,OACVuC,WAAY,CAAEC,SAAU,EAAA,CAAM,EAE/BhB,OAAQ,EACRhC,MAAO,EACP3D,KAAM,iBAAA,CACN,CACF,EAGKqF,EAAYY,cAChB1I,EAAyB,CACxBuC,MAAO,CAAEqE,SAAU,OAAQ/F,GAAI,CAAEoI,KAAM,CAACpJ,CAAM,CAAA,CAAE,EAChDqJ,UAAW,CACVtC,SAAU,OACVuC,WAAY,CAAEC,SAAU,EAAA,CAAM,EAE/BhB,OAAQ,EACRhC,MAAO3E,GACPgB,KAAM,iBAAA,CACN,CACF,CAEF,CAAC,CACH,EACA,CAACqF,EAAaE,CAAc,CAC7B,EAEA,aACExC,GAAA,CACA,MAAAjD,EACA,MAAO7B,GAAS,EAChB,WAAY+E,GAAc,EAC1B,UAAW6C,GAAWe,OAAS,EAC/B,KAAA5G,EACA,WAAAC,EACA,mBAAAC,EACA,aAAAC,EACA,cAAAC,EACA,sBAAAC,EACA,eAAAC,EAA+B,CAGlC"}
|
|
1
|
+
{"version":3,"file":"index-D6GJ4go1.js","sources":["../../src/components/flows/cells.tsx","../../src/components/flows/columns.tsx","../../src/components/flows/data-table.tsx","../../src/components/flows/empty-state/flows-empty-state.tsx","../../src/components/flows/flows-page-header.tsx","../../src/components/flows/flows-page.tsx","../../src/routes/flows/index.tsx?tsr-split=component"],"sourcesContent":["import { useQuery } from \"@tanstack/react-query\";\nimport { Link } from \"@tanstack/react-router\";\nimport { subWeeks } from \"date-fns\";\nimport { useMemo } from \"react\";\nimport { toast } from \"sonner\";\nimport { buildFilterFlowRunsQuery } from \"@/api/flow-runs\";\nimport {\n\tbuildDeploymentsCountByFlowQuery,\n\tbuildNextRunsByFlowQuery,\n\tuseDeleteFlowById,\n} from \"@/api/flows\";\nimport type { components } from \"@/api/prefect\";\nimport { Button } from \"@/components/ui/button\";\nimport {\n\tDropdownMenu,\n\tDropdownMenuContent,\n\tDropdownMenuItem,\n\tDropdownMenuLabel,\n\tDropdownMenuSeparator,\n\tDropdownMenuTrigger,\n} from \"@/components/ui/dropdown-menu\";\nimport { FlowRunActivityBarChart } from \"@/components/ui/flow-run-activity-bar-graph\";\nimport { Icon } from \"@/components/ui/icons\";\nimport { StateIcon } from \"@/components/ui/state-badge\";\nimport { pluralize } from \"@/utils\";\nimport { formatDate } from \"@/utils/date\";\n\ntype Flow = components[\"schemas\"][\"Flow\"];\n\nexport const FlowName = ({ row }: { row: { original: Flow } }) => {\n\tif (!row.original.id) return null;\n\n\treturn (\n\t\t<div className=\"flex flex-col pl-4\">\n\t\t\t<Link\n\t\t\t\tto=\"/flows/flow/$id\"\n\t\t\t\tparams={{ id: row.original.id }}\n\t\t\t\tclassName=\"text-sm font-medium truncate\"\n\t\t\t\ttitle={row.original.name}\n\t\t\t>\n\t\t\t\t{row.original.name}\n\t\t\t</Link>\n\t\t\t<span className=\"text-xs text-muted-foreground\">\n\t\t\t\tCreated{\" \"}\n\t\t\t\t{row.original?.created && formatDate(row.original.created, \"dateTime\")}\n\t\t\t</span>\n\t\t</div>\n\t);\n};\n\nexport const FlowLastRun = ({ row }: { row: { original: Flow } }) => {\n\tconst flowId = row.original.id;\n\tconst { data: flowRuns } = useQuery({\n\t\t...buildFilterFlowRunsQuery({\n\t\t\tflows: { operator: \"and_\", id: { any_: [flowId ?? \"\"] } },\n\t\t\tflow_runs: {\n\t\t\t\toperator: \"and_\",\n\t\t\t\tstart_time: { is_null_: false },\n\t\t\t},\n\t\t\toffset: 0,\n\t\t\tlimit: 1,\n\t\t\tsort: \"START_TIME_DESC\",\n\t\t}),\n\t\tenabled: !!flowId,\n\t});\n\n\tconst lastRun = flowRuns?.[0];\n\tif (!flowId || !lastRun) return null;\n\n\treturn (\n\t\t<div className=\"flex items-center gap-1\">\n\t\t\t{lastRun.state_type && (\n\t\t\t\t<StateIcon\n\t\t\t\t\ttype={lastRun.state_type}\n\t\t\t\t\tname={lastRun.state_name ?? undefined}\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t<Link to=\"/runs/flow-run/$id\" params={{ id: lastRun.id ?? \"\" }}>\n\t\t\t\t<span className=\"text-sm text-blue-700 hover:underline\">\n\t\t\t\t\t{lastRun.name}\n\t\t\t\t</span>\n\t\t\t</Link>\n\t\t</div>\n\t);\n};\n\nexport const FlowNextRun = ({ row }: { row: { original: Flow } }) => {\n\tconst flowId = row.original.id;\n\tconst { data: nextRunsMap } = useQuery(\n\t\tbuildNextRunsByFlowQuery(flowId ? [flowId] : [], { enabled: !!flowId }),\n\t);\n\n\tconst nextRun = flowId ? nextRunsMap?.[flowId] : null;\n\tif (!flowId || !nextRun) return null;\n\n\treturn (\n\t\t<div className=\"flex items-center gap-1\">\n\t\t\t{nextRun.state_type && (\n\t\t\t\t<StateIcon type={nextRun.state_type} name={nextRun.state_name} />\n\t\t\t)}\n\t\t\t<Link to=\"/runs/flow-run/$id\" params={{ id: nextRun.id ?? \"\" }}>\n\t\t\t\t<span className=\"text-sm text-blue-700 hover:underline\">\n\t\t\t\t\t{nextRun.name}\n\t\t\t\t</span>\n\t\t\t</Link>\n\t\t</div>\n\t);\n};\n\nexport const FlowDeploymentCount = ({ row }: { row: { original: Flow } }) => {\n\tconst flowId = row.original.id;\n\tconst { data: countsMap } = useQuery(\n\t\tbuildDeploymentsCountByFlowQuery(flowId ? [flowId] : [], {\n\t\t\tenabled: !!flowId,\n\t\t}),\n\t);\n\tif (!flowId) return null;\n\n\tconst count = countsMap?.[flowId] ?? 0;\n\n\tif (count === 0) {\n\t\treturn <span className=\"text-sm text-muted-foreground\">None</span>;\n\t}\n\n\treturn (\n\t\t<Link\n\t\t\tto=\"/flows/flow/$id\"\n\t\t\tparams={{ id: flowId }}\n\t\t\tsearch={{ tab: \"deployments\" }}\n\t\t>\n\t\t\t<span className=\"text-sm text-blue-700 hover:underline\">\n\t\t\t\t{count} {pluralize(count, \"Deployment\")}\n\t\t\t</span>\n\t\t</Link>\n\t);\n};\n\nexport const FlowActionMenu = ({ row }: { row: { original: Flow } }) => {\n\tconst id = row.original.id;\n\n\tconst { deleteFlow } = useDeleteFlowById();\n\n\tif (!id) {\n\t\treturn null;\n\t}\n\treturn (\n\t\t<div className=\"flex justify-end\">\n\t\t\t<DropdownMenu>\n\t\t\t\t<DropdownMenuTrigger asChild>\n\t\t\t\t\t<Button variant=\"ghost\" className=\"h-8 w-8 p-0\">\n\t\t\t\t\t\t<span className=\"sr-only\">Open menu</span>\n\t\t\t\t\t\t<Icon id=\"MoreVertical\" className=\"h-4 w-4\" />\n\t\t\t\t\t</Button>\n\t\t\t\t</DropdownMenuTrigger>\n\t\t\t\t<DropdownMenuContent align=\"end\">\n\t\t\t\t\t<DropdownMenuLabel>Actions</DropdownMenuLabel>\n\t\t\t\t\t<DropdownMenuItem\n\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\tvoid navigator.clipboard.writeText(id);\n\t\t\t\t\t\t\ttoast.success(\"ID copied\");\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\tCopy ID\n\t\t\t\t\t</DropdownMenuItem>\n\t\t\t\t\t<DropdownMenuSeparator />\n\t\t\t\t\t<DropdownMenuItem onClick={() => deleteFlow(id)}>\n\t\t\t\t\t\tDelete\n\t\t\t\t\t</DropdownMenuItem>\n\t\t\t\t\t<DropdownMenuItem>Automate</DropdownMenuItem>\n\t\t\t\t</DropdownMenuContent>\n\t\t\t</DropdownMenu>\n\t\t</div>\n\t);\n};\n\nconst NUMBER_OF_ACTIVITY_BARS = 16;\n\nexport const FlowActivity = ({ row }: { row: { original: Flow } }) => {\n\tconst flowId = row.original.id;\n\n\tconst { startDate, endDate } = useMemo((): {\n\t\tstartDate: Date;\n\t\tendDate: Date;\n\t} => {\n\t\tconst now = new Date();\n\t\treturn {\n\t\t\tstartDate: subWeeks(now, 1),\n\t\t\tendDate: now,\n\t\t};\n\t}, []);\n\n\tconst { data: flowRuns } = useQuery({\n\t\t...buildFilterFlowRunsQuery({\n\t\t\tflows: { operator: \"and_\", id: { any_: [flowId ?? \"\"] } },\n\t\t\tflow_runs: {\n\t\t\t\toperator: \"and_\",\n\t\t\t\tstart_time: { is_null_: false },\n\t\t\t},\n\t\t\toffset: 0,\n\t\t\tlimit: NUMBER_OF_ACTIVITY_BARS,\n\t\t\tsort: \"START_TIME_DESC\",\n\t\t}),\n\t\tenabled: !!flowId,\n\t});\n\n\tif (!flowId) return null;\n\n\treturn (\n\t\t<FlowRunActivityBarChart\n\t\t\tchartId={`flow-activity-${flowId}`}\n\t\t\tenrichedFlowRuns={flowRuns ?? []}\n\t\t\tstartDate={startDate}\n\t\t\tendDate={endDate}\n\t\t\tnumberOfBars={NUMBER_OF_ACTIVITY_BARS}\n\t\t\tclassName=\"h-[24px] w-[140px]\"\n\t\t/>\n\t);\n};\n","import type { ColumnDef } from \"@tanstack/react-table\";\nimport type { components } from \"@/api/prefect\";\nimport { Checkbox } from \"@/components/ui/checkbox\";\nimport {\n\tFlowActionMenu,\n\tFlowActivity,\n\tFlowDeploymentCount,\n\tFlowLastRun,\n\tFlowName,\n\tFlowNextRun,\n} from \"./cells\";\n\ntype Flow = components[\"schemas\"][\"Flow\"];\n\nexport const columns: ColumnDef<Flow>[] = [\n\t{\n\t\tid: \"select\",\n\t\theader: ({ table }) => (\n\t\t\t<Checkbox\n\t\t\t\tchecked={table.getIsAllPageRowsSelected()}\n\t\t\t\tonCheckedChange={(value) => table.toggleAllPageRowsSelected(!!value)}\n\t\t\t\taria-label=\"Select all\"\n\t\t\t/>\n\t\t),\n\t\tcell: ({ row }) => (\n\t\t\t<Checkbox\n\t\t\t\tchecked={row.getIsSelected()}\n\t\t\t\tonCheckedChange={(value) => row.toggleSelected(!!value)}\n\t\t\t\taria-label=\"Select row\"\n\t\t\t/>\n\t\t),\n\t\tenableSorting: false,\n\t\tenableHiding: false,\n\t\tmaxSize: 10,\n\t},\n\t{\n\t\taccessorKey: \"name\",\n\t\theader: () => <div className=\"pl-4\">Flow</div>,\n\t\tcell: FlowName,\n\t},\n\t{\n\t\taccessorKey: \"lastRuns\",\n\t\theader: \"Last Run\",\n\t\tcell: FlowLastRun,\n\t},\n\t{\n\t\taccessorKey: \"nextRuns\",\n\t\theader: \"Next Run\",\n\t\tcell: FlowNextRun,\n\t},\n\t{\n\t\taccessorKey: \"deployments\",\n\t\theader: \"Deployments\",\n\t\tcell: FlowDeploymentCount,\n\t},\n\t{\n\t\taccessorKey: \"activity\",\n\t\theader: \"Activity\",\n\t\tcell: FlowActivity,\n\t},\n\t{\n\t\tid: \"actions\",\n\t\tcell: FlowActionMenu,\n\t},\n];\n","import type {\n\tColumnFiltersState,\n\tOnChangeFn,\n\tPaginationState,\n} from \"@tanstack/react-table\";\nimport {\n\tgetCoreRowModel,\n\ttype RowSelectionState,\n\tuseReactTable,\n} from \"@tanstack/react-table\";\nimport type React from \"react\";\nimport { useCallback, useState } from \"react\";\nimport { type Flow, useDeleteFlowById } from \"@/api/flows\";\nimport { DataTable } from \"@/components/ui/data-table\";\nimport { Icon } from \"@/components/ui/icons\";\nimport { SearchInput } from \"@/components/ui/input\";\nimport {\n\tSelect,\n\tSelectContent,\n\tSelectItem,\n\tSelectTrigger,\n\tSelectValue,\n} from \"@/components/ui/select\";\nimport { TagsInput } from \"@/components/ui/tags-input\";\nimport { pluralize } from \"@/utils\";\nimport { columns } from \"./columns\";\n\nconst FLOW_SORT_OPTIONS = [\n\t{ label: \"A to Z\", value: \"NAME_ASC\" },\n\t{ label: \"Z to A\", value: \"NAME_DESC\" },\n\t{ label: \"Created\", value: \"CREATED_DESC\" },\n] as const;\n\ntype FlowSortValue = \"NAME_ASC\" | \"NAME_DESC\" | \"CREATED_DESC\" | \"UPDATED_DESC\";\n\nexport default function FlowsTable({\n\tflows,\n\tcount,\n\tpageCount,\n\tsort,\n\tpagination,\n\tonPaginationChange,\n\tonSortChange,\n\tcolumnFilters,\n\tonColumnFiltersChange,\n\tonPrefetchPage,\n}: {\n\tflows: Flow[];\n\tcount: number;\n\tpageCount: number;\n\tsort: FlowSortValue;\n\tpagination: PaginationState;\n\tonPaginationChange: (pagination: PaginationState) => void;\n\tonSortChange: (sort: FlowSortValue) => void;\n\tcolumnFilters: ColumnFiltersState;\n\tonColumnFiltersChange: (columnFilters: ColumnFiltersState) => void;\n\tonPrefetchPage?: (page: number) => void;\n}) {\n\tconst { deleteFlow } = useDeleteFlowById();\n\tconst [rowSelection, setRowSelection] = useState<RowSelectionState>({});\n\n\tconst nameSearchValue = (columnFilters.find((filter) => filter.id === \"name\")\n\t\t?.value ?? \"\") as string;\n\tconst tagsSearchValue = (columnFilters.find((filter) => filter.id === \"tags\")\n\t\t?.value ?? []) as string[];\n\n\tconst handleNameSearchChange = useCallback(\n\t\t(value?: string) => {\n\t\t\tconst filters = columnFilters.filter((filter) => filter.id !== \"name\");\n\t\t\tonColumnFiltersChange(\n\t\t\t\tvalue ? [...filters, { id: \"name\", value }] : filters,\n\t\t\t);\n\t\t},\n\t\t[onColumnFiltersChange, columnFilters],\n\t);\n\n\tconst handleTagsSearchChange: React.ChangeEventHandler<HTMLInputElement> &\n\t\t((tags: string[]) => void) = useCallback(\n\t\t(e: string[] | React.ChangeEvent<HTMLInputElement>) => {\n\t\t\tconst tags = Array.isArray(e) ? e : [];\n\t\t\tconst filters = columnFilters.filter((filter) => filter.id !== \"tags\");\n\t\t\tonColumnFiltersChange(\n\t\t\t\ttags.length ? [...filters, { id: \"tags\", value: tags }] : filters,\n\t\t\t);\n\t\t},\n\t\t[onColumnFiltersChange, columnFilters],\n\t);\n\n\tconst handlePaginationChange: OnChangeFn<PaginationState> = useCallback(\n\t\t(updater) => {\n\t\t\tlet newPagination = pagination;\n\t\t\tif (typeof updater === \"function\") {\n\t\t\t\tnewPagination = updater(pagination);\n\t\t\t} else {\n\t\t\t\tnewPagination = updater;\n\t\t\t}\n\t\t\tonPaginationChange(newPagination);\n\t\t},\n\t\t[pagination, onPaginationChange],\n\t);\n\n\tconst table = useReactTable({\n\t\tcolumns: columns,\n\t\tdata: flows,\n\t\tgetCoreRowModel: getCoreRowModel(),\n\t\tmanualPagination: true,\n\t\tpageCount,\n\t\tstate: {\n\t\t\trowSelection,\n\t\t\tpagination,\n\t\t},\n\t\tonRowSelectionChange: setRowSelection,\n\t\tonPaginationChange: handlePaginationChange,\n\t});\n\n\tconst handleDeleteRows = () => {\n\t\tconst selectedRows = Object.keys(rowSelection);\n\n\t\tconst idsToDelete = selectedRows.map((rowId) => flows[Number(rowId)].id);\n\n\t\tfor (const id of idsToDelete) {\n\t\t\tdeleteFlow(id);\n\t\t}\n\n\t\ttable.toggleAllRowsSelected(false);\n\t};\n\n\treturn (\n\t\t<div className=\"h-full\">\n\t\t\t<div className=\"grid sm:grid-cols-2 md:grid-cols-6 lg:grid-cols-12 gap-2 pb-4 items-center\">\n\t\t\t\t<div className=\"sm:col-span-2 md:col-span-6 lg:col-span-4 order-last lg:order-first\">\n\t\t\t\t\t{Object.keys(rowSelection).length > 0 ? (\n\t\t\t\t\t\t<p className=\"text-sm text-muted-foreground flex items-center\">\n\t\t\t\t\t\t\t{Object.keys(rowSelection).length} selected\n\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\tid=\"Trash2\"\n\t\t\t\t\t\t\t\tclassName=\"ml-2 cursor-pointer h-4 w-4 inline\"\n\t\t\t\t\t\t\t\tonClick={handleDeleteRows}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</p>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<p className=\"text-sm text-muted-foreground\">\n\t\t\t\t\t\t\t{count} {pluralize(count, \"Flow\")}\n\t\t\t\t\t\t</p>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t\t<div className=\"sm:col-span-2 md:col-span-2 lg:col-span-3\">\n\t\t\t\t\t<SearchInput\n\t\t\t\t\t\tplaceholder=\"Flow names\"\n\t\t\t\t\t\tvalue={nameSearchValue}\n\t\t\t\t\t\tonChange={(e) => handleNameSearchChange(e.target.value)}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t\t<div className=\"xs:col-span-1 md:col-span-2 lg:col-span-3\">\n\t\t\t\t\t<TagsInput\n\t\t\t\t\t\tplaceholder=\"Filter by tags\"\n\t\t\t\t\t\tonChange={handleTagsSearchChange}\n\t\t\t\t\t\tvalue={tagsSearchValue}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t\t<div className=\"xs:col-span-1 md:col-span-2 lg:col-span-2\">\n\t\t\t\t\t<Select value={sort} onValueChange={onSortChange}>\n\t\t\t\t\t\t<SelectTrigger aria-label=\"Flow sort order\" className=\"w-full\">\n\t\t\t\t\t\t\t<SelectValue placeholder=\"Sort by\" />\n\t\t\t\t\t\t</SelectTrigger>\n\t\t\t\t\t\t<SelectContent>\n\t\t\t\t\t\t\t{FLOW_SORT_OPTIONS.map((option) => (\n\t\t\t\t\t\t\t\t<SelectItem key={option.value} value={option.value}>\n\t\t\t\t\t\t\t\t\t{option.label}\n\t\t\t\t\t\t\t\t</SelectItem>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t</SelectContent>\n\t\t\t\t\t</Select>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<DataTable table={table} onPrefetchPage={onPrefetchPage} />\n\t\t</div>\n\t);\n}\n","import { DocsLink } from \"@/components/ui/docs-link\";\nimport {\n\tEmptyState,\n\tEmptyStateActions,\n\tEmptyStateDescription,\n\tEmptyStateIcon,\n\tEmptyStateTitle,\n} from \"@/components/ui/empty-state\";\n\nexport const FlowsEmptyState = () => (\n\t<EmptyState>\n\t\t<EmptyStateIcon id=\"Workflow\" />\n\t\t<EmptyStateTitle>Run a flow to get started</EmptyStateTitle>\n\t\t<EmptyStateDescription>\n\t\t\tFlows are Python functions that encapsulate workflow logic and allow users\n\t\t\tto interact with and reason about the state of their workflows.\n\t\t</EmptyStateDescription>\n\t\t<EmptyStateActions>\n\t\t\t<DocsLink id=\"flows-guide\" />\n\t\t</EmptyStateActions>\n\t</EmptyState>\n);\n","import {\n\tBreadcrumb,\n\tBreadcrumbItem,\n\tBreadcrumbList,\n} from \"@/components/ui/breadcrumb\";\n\nexport const FlowsHeader = () => {\n\treturn (\n\t\t<div className=\"flex items-center gap-2\">\n\t\t\t<Breadcrumb>\n\t\t\t\t<BreadcrumbList>\n\t\t\t\t\t<BreadcrumbItem className=\"text-xl font-semibold\">\n\t\t\t\t\t\tFlows\n\t\t\t\t\t</BreadcrumbItem>\n\t\t\t\t</BreadcrumbList>\n\t\t\t</Breadcrumb>\n\t\t</div>\n\t);\n};\n","import type {\n\tColumnFiltersState,\n\tPaginationState,\n} from \"@tanstack/react-table\";\nimport type { Flow } from \"@/api/flows\";\nimport FlowsTable from \"./data-table\";\nimport { FlowsEmptyState } from \"./empty-state\";\nimport { FlowsHeader } from \"./flows-page-header\";\n\ntype FlowSortValue = \"NAME_ASC\" | \"NAME_DESC\" | \"CREATED_DESC\" | \"UPDATED_DESC\";\n\ntype FlowsPageProps = {\n\tflows: Flow[];\n\tcount: number;\n\ttotalCount: number;\n\tpageCount: number;\n\tsort: FlowSortValue;\n\tpagination: PaginationState;\n\tonPaginationChange: (pagination: PaginationState) => void;\n\tonSortChange: (sort: FlowSortValue) => void;\n\tcolumnFilters: ColumnFiltersState;\n\tonColumnFiltersChange: (columnFilters: ColumnFiltersState) => void;\n\tonPrefetchPage?: (page: number) => void;\n};\n\nexport default function FlowsPage({\n\tflows,\n\tcount,\n\ttotalCount,\n\tpageCount,\n\tsort,\n\tpagination,\n\tonPaginationChange,\n\tonSortChange,\n\tcolumnFilters,\n\tonColumnFiltersChange,\n\tonPrefetchPage,\n}: FlowsPageProps) {\n\treturn (\n\t\t<div className=\"flex flex-col gap-4\">\n\t\t\t<FlowsHeader />\n\t\t\t{totalCount === 0 ? (\n\t\t\t\t<FlowsEmptyState />\n\t\t\t) : (\n\t\t\t\t<FlowsTable\n\t\t\t\t\tflows={flows}\n\t\t\t\t\tcount={count}\n\t\t\t\t\tpageCount={pageCount}\n\t\t\t\t\tsort={sort}\n\t\t\t\t\tpagination={pagination}\n\t\t\t\t\tonPaginationChange={onPaginationChange}\n\t\t\t\t\tonSortChange={onSortChange}\n\t\t\t\t\tcolumnFilters={columnFilters}\n\t\t\t\t\tonColumnFiltersChange={onColumnFiltersChange}\n\t\t\t\t\tonPrefetchPage={onPrefetchPage}\n\t\t\t\t/>\n\t\t\t)}\n\t\t</div>\n\t);\n}\n","import {\n\tuseQuery,\n\tuseQueryClient,\n\tuseSuspenseQuery,\n} from \"@tanstack/react-query\";\nimport type { ErrorComponentProps } from \"@tanstack/react-router\";\nimport { createFileRoute } from \"@tanstack/react-router\";\nimport type {\n\tColumnFiltersState,\n\tPaginationState,\n} from \"@tanstack/react-table\";\nimport { zodValidator } from \"@tanstack/zod-adapter\";\nimport { useCallback, useMemo } from \"react\";\nimport { z } from \"zod\";\nimport { categorizeError } from \"@/api/error-utils\";\nimport { buildFilterFlowRunsQuery } from \"@/api/flow-runs\";\nimport {\n\tbuildCountFlowsFilteredQuery,\n\tbuildDeploymentsCountByFlowQuery,\n\tbuildNextRunsByFlowQuery,\n\tbuildPaginateFlowsQuery,\n\ttype FlowsPaginateFilter,\n} from \"@/api/flows\";\nimport FlowsPage from \"@/components/flows/flows-page\";\nimport { RouteErrorState } from \"@/components/ui/route-error-state\";\n\n// Route for /flows/\n\nconst searchParams = z\n\t.object({\n\t\tname: z.string().optional(),\n\t\tpage: z.number().int().positive().optional().default(1).catch(1),\n\t\tlimit: z\n\t\t\t.number()\n\t\t\t.int()\n\t\t\t.positive()\n\t\t\t.max(100)\n\t\t\t.optional()\n\t\t\t.default(10)\n\t\t\t.catch(10),\n\t\ttags: z.array(z.string()).optional(),\n\t\tsort: z\n\t\t\t.enum([\"CREATED_DESC\", \"UPDATED_DESC\", \"NAME_ASC\", \"NAME_DESC\"])\n\t\t\t.optional()\n\t\t\t.default(\"NAME_ASC\"),\n\t})\n\t.optional()\n\t.default({});\n\ntype SearchParams = z.infer<typeof searchParams>;\n\nconst buildPaginationBody = (search?: SearchParams): FlowsPaginateFilter => {\n\tconst hasNameFilter = Boolean(search?.name);\n\tconst hasTagsFilter = Boolean(search?.tags?.length);\n\n\tif (!hasNameFilter && !hasTagsFilter) {\n\t\treturn {\n\t\t\tpage: search?.page ?? 1,\n\t\t\tlimit: search?.limit ?? 10,\n\t\t\tsort: search?.sort ?? \"NAME_ASC\",\n\t\t};\n\t}\n\n\treturn {\n\t\tpage: search?.page ?? 1,\n\t\tlimit: search?.limit ?? 10,\n\t\tsort: search?.sort ?? \"NAME_ASC\",\n\t\tflows: {\n\t\t\toperator: \"and_\",\n\t\t\t...(hasNameFilter && { name: { like_: search?.name } }),\n\t\t\t...(hasTagsFilter && {\n\t\t\t\ttags: { operator: \"and_\", all_: search?.tags },\n\t\t\t}),\n\t\t},\n\t};\n};\n\nconst NUMBER_OF_ACTIVITY_BARS = 16;\n\nfunction FlowsErrorComponent({ error, reset }: ErrorComponentProps) {\n\tconst serverError = categorizeError(error, \"Failed to load flows\");\n\n\t// Only handle API errors (server-error, client-error) at route level\n\t// Let network errors and unknown errors bubble up to root error component\n\tif (\n\t\tserverError.type !== \"server-error\" &&\n\t\tserverError.type !== \"client-error\"\n\t) {\n\t\tthrow error;\n\t}\n\n\treturn (\n\t\t<div className=\"flex flex-col gap-4\">\n\t\t\t<div>\n\t\t\t\t<h1 className=\"text-2xl font-semibold\">Flows</h1>\n\t\t\t</div>\n\t\t\t<RouteErrorState error={serverError} onRetry={reset} />\n\t\t</div>\n\t);\n}\n\nexport const Route = createFileRoute(\"/flows/\")({\n\tvalidateSearch: zodValidator(searchParams),\n\tcomponent: FlowsRoute,\n\terrorComponent: FlowsErrorComponent,\n\tloaderDeps: ({ search }) => buildPaginationBody(search),\n\tloader: ({ deps, context }) => {\n\t\t// Prefetch current page queries without blocking the loader\n\t\tvoid context.queryClient.prefetchQuery(\n\t\t\tbuildPaginateFlowsQuery(deps, 30_000),\n\t\t);\n\t\tvoid context.queryClient.prefetchQuery(\n\t\t\tbuildCountFlowsFilteredQuery({\n\t\t\t\toffset: 0,\n\t\t\t\tsort: deps.sort,\n\t\t\t\tflows: deps.flows ?? undefined,\n\t\t\t}),\n\t\t);\n\t\t// Prefetch total count for empty state check\n\t\tvoid context.queryClient.prefetchQuery(\n\t\t\tbuildCountFlowsFilteredQuery({\n\t\t\t\toffset: 0,\n\t\t\t\tsort: \"NAME_ASC\",\n\t\t\t}),\n\t\t);\n\t},\n\twrapInSuspense: true,\n});\n\nconst usePagination = () => {\n\tconst search = Route.useSearch();\n\tconst navigate = Route.useNavigate();\n\n\t// Convert URL params (1-based page) to TanStack Table's PaginationState (0-based pageIndex)\n\tconst pagination: PaginationState = useMemo(\n\t\t() => ({\n\t\t\tpageIndex: (search.page ?? 1) - 1,\n\t\t\tpageSize: search.limit ?? 10,\n\t\t}),\n\t\t[search.page, search.limit],\n\t);\n\n\tconst onPaginationChange = useCallback(\n\t\t(newPagination: PaginationState) => {\n\t\t\tvoid navigate({\n\t\t\t\tto: \".\",\n\t\t\t\tsearch: (prev) => ({\n\t\t\t\t\t...prev,\n\t\t\t\t\t// Convert TanStack Table's 0-based pageIndex back to 1-based page for URL\n\t\t\t\t\tpage: newPagination.pageIndex + 1,\n\t\t\t\t\tlimit: newPagination.pageSize,\n\t\t\t\t}),\n\t\t\t\treplace: true,\n\t\t\t});\n\t\t},\n\t\t[navigate],\n\t);\n\n\treturn [pagination, onPaginationChange] as const;\n};\n\ntype FlowSort = \"CREATED_DESC\" | \"UPDATED_DESC\" | \"NAME_ASC\" | \"NAME_DESC\";\n\nconst useSort = () => {\n\tconst search = Route.useSearch();\n\tconst navigate = Route.useNavigate();\n\n\tconst onSortChange = useCallback(\n\t\t(sort: FlowSort) => {\n\t\t\tvoid navigate({\n\t\t\t\tto: \".\",\n\t\t\t\tsearch: (prev) => ({ ...prev, sort }),\n\t\t\t\treplace: true,\n\t\t\t});\n\t\t},\n\t\t[navigate],\n\t);\n\n\treturn [search.sort, onSortChange] as const;\n};\n\nconst useFlowsColumnFilters = () => {\n\tconst search = Route.useSearch();\n\tconst navigate = Route.useNavigate();\n\tconst columnFilters: ColumnFiltersState = useMemo(\n\t\t() => [\n\t\t\t{ id: \"name\", value: search.name },\n\t\t\t{ id: \"tags\", value: search.tags },\n\t\t],\n\t\t[search.name, search.tags],\n\t);\n\n\tconst onColumnFiltersChange = useCallback(\n\t\t(newColumnFilters: ColumnFiltersState) => {\n\t\t\tvoid navigate({\n\t\t\t\tto: \".\",\n\t\t\t\tsearch: (prev) => {\n\t\t\t\t\tconst name = newColumnFilters.find((filter) => filter.id === \"name\")\n\t\t\t\t\t\t?.value as string | undefined;\n\t\t\t\t\tconst tags = newColumnFilters.find((filter) => filter.id === \"tags\")\n\t\t\t\t\t\t?.value as string[] | undefined;\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...prev,\n\t\t\t\t\t\tpage: 1,\n\t\t\t\t\t\tname,\n\t\t\t\t\t\ttags,\n\t\t\t\t\t};\n\t\t\t\t},\n\t\t\t\treplace: true,\n\t\t\t});\n\t\t},\n\t\t[navigate],\n\t);\n\n\treturn [columnFilters, onColumnFiltersChange] as const;\n};\n\nfunction FlowsRoute() {\n\tconst search = Route.useSearch();\n\tconst queryClient = useQueryClient();\n\tconst [pagination, onPaginationChange] = usePagination();\n\tconst [sort, onSortChange] = useSort();\n\tconst [columnFilters, onColumnFiltersChange] = useFlowsColumnFilters();\n\n\tconst paginationBody = buildPaginationBody(search);\n\n\t// Use useSuspenseQuery for count (stable key, won't cause suspense on search change)\n\tconst { data: count } = useSuspenseQuery(\n\t\tbuildCountFlowsFilteredQuery({\n\t\t\toffset: 0,\n\t\t\tsort: search.sort,\n\t\t\tflows: paginationBody.flows ?? undefined,\n\t\t}),\n\t);\n\n\t// Get total count of all flows (without filters) to determine if empty state should be shown\n\tconst { data: totalCount } = useSuspenseQuery(\n\t\tbuildCountFlowsFilteredQuery({\n\t\t\toffset: 0,\n\t\t\tsort: \"NAME_ASC\",\n\t\t}),\n\t);\n\n\t// Use useQuery for paginated flows to leverage placeholderData: keepPreviousData\n\t// This prevents the page from suspending when search/filter changes\n\tconst { data: flowsPage } = useQuery(\n\t\tbuildPaginateFlowsQuery(paginationBody, 30_000),\n\t);\n\n\tconst flows = flowsPage?.results ?? [];\n\n\t// Prefetch a page and its child component data when user hovers over pagination buttons\n\tconst onPrefetchPage = useCallback(\n\t\t(page: number) => {\n\t\t\tconst pageDeps = { ...paginationBody, page };\n\t\t\tvoid queryClient\n\t\t\t\t.prefetchQuery(buildPaginateFlowsQuery(pageDeps, 30_000))\n\t\t\t\t.then(() => {\n\t\t\t\t\t// Get the prefetched page data from cache\n\t\t\t\t\tconst pageData = queryClient.getQueryData<{\n\t\t\t\t\t\tresults?: Array<{ id?: string }>;\n\t\t\t\t\t}>(buildPaginateFlowsQuery(pageDeps, 30_000).queryKey);\n\n\t\t\t\t\tconst flowIds =\n\t\t\t\t\t\tpageData?.results\n\t\t\t\t\t\t\t?.map((flow) => flow.id)\n\t\t\t\t\t\t\t.filter((id): id is string => Boolean(id)) ?? [];\n\n\t\t\t\t\tif (flowIds.length === 0) return;\n\n\t\t\t\t\t// Prefetch child component queries for each flow individually\n\t\t\t\t\t// Using individual flow IDs ensures query keys match what components use\n\t\t\t\t\tfor (const flowId of flowIds) {\n\t\t\t\t\t\t// FlowNextRun query - uses single flow ID array for query key matching\n\t\t\t\t\t\tvoid queryClient.prefetchQuery(buildNextRunsByFlowQuery([flowId]));\n\n\t\t\t\t\t\t// FlowDeploymentCount query - uses single flow ID array for query key matching\n\t\t\t\t\t\tvoid queryClient.prefetchQuery(\n\t\t\t\t\t\t\tbuildDeploymentsCountByFlowQuery([flowId]),\n\t\t\t\t\t\t);\n\t\t\t\t\t\t// FlowLastRun query - last completed run\n\t\t\t\t\t\tvoid queryClient.prefetchQuery(\n\t\t\t\t\t\t\tbuildFilterFlowRunsQuery({\n\t\t\t\t\t\t\t\tflows: { operator: \"and_\", id: { any_: [flowId] } },\n\t\t\t\t\t\t\t\tflow_runs: {\n\t\t\t\t\t\t\t\t\toperator: \"and_\",\n\t\t\t\t\t\t\t\t\tstart_time: { is_null_: false },\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\toffset: 0,\n\t\t\t\t\t\t\t\tlimit: 1,\n\t\t\t\t\t\t\t\tsort: \"START_TIME_DESC\",\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t// FlowActivity query - recent runs for activity chart\n\t\t\t\t\t\tvoid queryClient.prefetchQuery(\n\t\t\t\t\t\t\tbuildFilterFlowRunsQuery({\n\t\t\t\t\t\t\t\tflows: { operator: \"and_\", id: { any_: [flowId] } },\n\t\t\t\t\t\t\t\tflow_runs: {\n\t\t\t\t\t\t\t\t\toperator: \"and_\",\n\t\t\t\t\t\t\t\t\tstart_time: { is_null_: false },\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\toffset: 0,\n\t\t\t\t\t\t\t\tlimit: NUMBER_OF_ACTIVITY_BARS,\n\t\t\t\t\t\t\t\tsort: \"START_TIME_DESC\",\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t},\n\t\t[queryClient, paginationBody],\n\t);\n\n\treturn (\n\t\t<FlowsPage\n\t\t\tflows={flows}\n\t\t\tcount={count ?? 0}\n\t\t\ttotalCount={totalCount ?? 0}\n\t\t\tpageCount={flowsPage?.pages ?? 0}\n\t\t\tsort={sort as \"NAME_ASC\" | \"NAME_DESC\" | \"CREATED_DESC\"}\n\t\t\tpagination={pagination}\n\t\t\tonPaginationChange={onPaginationChange}\n\t\t\tonSortChange={onSortChange}\n\t\t\tcolumnFilters={columnFilters}\n\t\t\tonColumnFiltersChange={onColumnFiltersChange}\n\t\t\tonPrefetchPage={onPrefetchPage}\n\t\t/>\n\t);\n}\n"],"names":["FlowName","row","jsxs","jsx","Link","formatDate","FlowLastRun","flowId","flowRuns","useQuery","buildFilterFlowRunsQuery","lastRun","StateIcon","FlowNextRun","nextRunsMap","buildNextRunsByFlowQuery","nextRun","FlowDeploymentCount","countsMap","buildDeploymentsCountByFlowQuery","count","pluralize","FlowActionMenu","id","deleteFlow","useDeleteFlowById","DropdownMenu","DropdownMenuTrigger","Button","Icon","DropdownMenuContent","DropdownMenuLabel","DropdownMenuItem","toast","DropdownMenuSeparator","NUMBER_OF_ACTIVITY_BARS","FlowActivity","startDate","endDate","useMemo","now","subWeeks","FlowRunActivityBarChart","columns","table","Checkbox","value","FLOW_SORT_OPTIONS","FlowsTable","flows","pageCount","sort","pagination","onPaginationChange","onSortChange","columnFilters","onColumnFiltersChange","onPrefetchPage","rowSelection","setRowSelection","useState","nameSearchValue","filter","tagsSearchValue","handleNameSearchChange","useCallback","filters","handleTagsSearchChange","e","tags","handlePaginationChange","updater","newPagination","useReactTable","getCoreRowModel","handleDeleteRows","idsToDelete","rowId","SearchInput","TagsInput","Select","SelectTrigger","SelectValue","SelectContent","option","SelectItem","DataTable","FlowsEmptyState","EmptyState","EmptyStateIcon","EmptyStateTitle","EmptyStateDescription","EmptyStateActions","DocsLink","FlowsHeader","Breadcrumb","BreadcrumbList","BreadcrumbItem","FlowsPage","totalCount","z","name","string","optional","page","number","int","positive","default","catch","limit","max","buildPaginationBody","search","hasNameFilter","Boolean","hasTagsFilter","length","operator","like_","all_","usePagination","Route","useSearch","navigate","useNavigate","pageIndex","pageSize","to","prev","replace","useSort","useFlowsColumnFilters","newColumnFilters","find","FlowsRoute","queryClient","useQueryClient","paginationBody","data","useSuspenseQuery","buildCountFlowsFilteredQuery","offset","undefined","flowsPage","buildPaginateFlowsQuery","results","pageDeps","prefetchQuery","then","flowIds","getQueryData","queryKey","map","flow","any_","flow_runs","start_time","is_null_","pages"],"mappings":"syBA6BO,MAAMA,GAAW,CAAC,CAAE,IAAAC,KACrBA,EAAI,SAAS,GAGjBC,EAAAA,KAAC,MAAA,CAAI,UAAU,qBACd,SAAA,CAAAC,EAAAA,IAACC,EAAA,CACA,GAAG,kBACH,OAAQ,CAAE,GAAIH,EAAI,SAAS,EAAA,EAC3B,UAAU,+BACV,MAAOA,EAAI,SAAS,KAEnB,WAAI,SAAS,IAAA,CAAA,EAEfC,EAAAA,KAAC,OAAA,CAAK,UAAU,gCAAgC,SAAA,CAAA,UACvC,IACPD,EAAI,UAAU,SAAWI,EAAWJ,EAAI,SAAS,QAAS,UAAU,CAAA,CAAA,CACtE,CAAA,EACD,EAhB4B,KAoBjBK,GAAc,CAAC,CAAE,IAAAL,KAAuC,CACpE,MAAMM,EAASN,EAAI,SAAS,GACtB,CAAE,KAAMO,CAAA,EAAaC,EAAS,CACnC,GAAGC,EAAyB,CAC3B,MAAO,CAAE,SAAU,OAAQ,GAAI,CAAE,KAAM,CAACH,GAAU,EAAE,EAAE,EACtD,UAAW,CACV,SAAU,OACV,WAAY,CAAE,SAAU,EAAA,CAAM,EAE/B,OAAQ,EACR,MAAO,EACP,KAAM,iBAAA,CACN,EACD,QAAS,CAAC,CAACA,CAAA,CACX,EAEKI,EAAUH,IAAW,CAAC,EAC5B,MAAI,CAACD,GAAU,CAACI,EAAgB,KAG/BT,EAAAA,KAAC,MAAA,CAAI,UAAU,0BACb,SAAA,CAAAS,EAAQ,YACRR,EAAAA,IAACS,EAAA,CACA,KAAMD,EAAQ,WACd,KAAMA,EAAQ,YAAc,MAAA,CAAA,QAG7BP,EAAA,CAAK,GAAG,qBAAqB,OAAQ,CAAE,GAAIO,EAAQ,IAAM,EAAA,EACzD,SAAAR,EAAAA,IAAC,OAAA,CAAK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AEqE,SAAU,OAAQ/F,GAAI,CAAEoI,KAAM,CAACpJ,CAAM,CAAA,CAAE,EAChDqJ,UAAW,CACVtC,SAAU,OACVuC,WAAY,CAAEC,SAAU,EAAA,CAAM,EAE/BhB,OAAQ,EACRhC,MAAO,EACP3D,KAAM,iBAAA,CACN,CACF,EAGKqF,EAAYY,cAChB1I,EAAyB,CACxBuC,MAAO,CAAEqE,SAAU,OAAQ/F,GAAI,CAAEoI,KAAM,CAACpJ,CAAM,CAAA,CAAE,EAChDqJ,UAAW,CACVtC,SAAU,OACVuC,WAAY,CAAEC,SAAU,EAAA,CAAM,EAE/BhB,OAAQ,EACRhC,MAAO3E,GACPgB,KAAM,iBAAA,CACN,CACF,CAEF,CAAC,CACH,EACA,CAACqF,EAAaE,CAAc,CAC7B,EAEA,aACExC,GAAA,CACA,MAAAjD,EACA,MAAO7B,GAAS,EAChB,WAAY+E,GAAc,EAC1B,UAAW6C,GAAWe,OAAS,EAC/B,KAAA5G,EACA,WAAAC,EACA,mBAAAC,EACA,aAAAC,EACA,cAAAC,EACA,sBAAAC,EACA,eAAAC,EAA+B,CAGlC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as c,j as e,E as h}from"./vendor-tanstack-BK8oseNA.js";import{al as j,N as b,O as v,S,a as A,b as C,c as N,e as T,I as x,B as E,g as k,h as I,D as y,E as D,t as M,v as V,w as L,x as w,au as B,bt as p,bu as R,bv as _}from"./index-BvSl3DKP.js";import{A as G}from"./artifact-card-C8JEQRHl.js";import{T as Q,a as f}from"./toggle-group-BJN1vjEh.js";import{u as F}from"./use-debounce-callback-ClAx-Wwx.js";import"./vendor-react-Bce9NwRC.js";import"./vendor-radix-CznP1SOq.js";import"./vendor-recharts-D4imLXNl.js";import"./vendor-forms-DxqqmhL5.js";import"./vendor-date-7GxEwcQM.js";import"./lazy-markdown-BwIwKFRF.js";const O=[{value:"all",label:"All Types"},{value:"markdown",label:"Markdown"},{value:"progress",label:"Progress"},{value:"image",label:"Image"},{value:"table",label:"Table"}],P=({filters:a,onFilterChange:s,totalCount:r,displayMode:o,setDisplayMode:i})=>{const l=c.useCallback(t=>{s([...a.filter(u=>u.id!=="name"),{id:"name",label:"Name",value:t}])},[a,s]),d=c.useCallback(t=>{s([...a.filter(u=>u.id!=="type"),{id:"type",label:"Type",value:t}])},[a,s]),m=c.useMemo(()=>a.find(t=>t.id==="type")?.value,[a]),n=c.useMemo(()=>a.find(t=>t.id==="name")?.value,[a]);return e.jsxs("div",{"data-testid":"artifact-filter",className:"flex justify-between items-center",children:[e.jsx("div",{children:e.jsxs(j,{variant:"body",className:"text-sm text-muted-foreground",children:[r," ",b(r,"artifact")]})}),e.jsxs("div",{className:"flex gap-4",children:[e.jsx(v,{"data-testid":"search-input",defaultValue:n,placeholder:"Search artifacts",onChange:t=>l(t.target.value)}),e.jsxs("div",{className:"flex gap-4",children:[e.jsxs(S,{"data-testid":"type-select",value:m,onValueChange:d,children:[e.jsx(A,{"aria-label":"Artifact type",children:e.jsx(C,{placeholder:"Type"})}),e.jsx(N,{children:O.map(({value:t,label:u})=>e.jsx(T,{value:t,children:u},t))})]}),e.jsx("div",{children:e.jsxs(Q,{type:"single",defaultValue:o,onValueChange:t=>i(t),children:[e.jsx(f,{"data-testid":"grid-layout",value:"grid",children:e.jsx(x,{id:"LayoutGrid"})}),e.jsx(f,{"data-testid":"list-layout",value:"list",children:e.jsx(x,{id:"AlignJustify"})})]})})]})]})]})},q=()=>e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(E,{children:e.jsx(k,{children:e.jsx(I,{className:"text-xl font-semibold",children:"Artifacts"})})})}),e.jsx(y,{id:"artifacts-guide",label:"Documentation"})]}),z=()=>e.jsxs(D,{children:[e.jsx("div",{className:"flex items-center gap-3",children:e.jsx(M,{id:"Image"})}),e.jsx(V,{children:"Create an artifact to get started"}),e.jsx(L,{children:"Artifacts are byproducts of your runs; they can be anything from a markdown string to a table."}),e.jsx(w,{children:e.jsx(y,{id:"artifacts-guide"})})]}),H=({filters:a,onFilterChange:s,artifactsList:r,artifactsCount:o})=>{const[i,l]=B("artifacts-grid-style","grid"),d=c.useMemo(()=>i==="grid"?"grid grid-cols-1 lg:grid-cols-2 xl:grid-cols-3 gap-4":"grid-cols-1",[i]),m=c.useMemo(()=>r.reduce((n,t)=>(n.find(u=>u.key===t.key)||n.push(t),n),[]),[r]);return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(q,{}),e.jsx(P,{filters:a,onFilterChange:s,totalCount:o,setDisplayMode:l,displayMode:i}),m.length===0?e.jsx(z,{}):e.jsx("div",{className:d,children:m.map(n=>e.jsx(G,{artifact:n},n.id))})]})},g=a=>({artifacts:{operator:"and_",type:{any_:a?.type&&a?.type!=="all"?[a.type]:void 0},key:{like_:a?.name??""}},sort:"CREATED_DESC",offset:0}),J=()=>{const a=p.useSearch(),s=p.useNavigate(),r=c.useMemo(()=>[{id:"type",label:"Type",value:a.type??"all"},{id:"name",label:"Name",value:a.name}],[a.type,a.name]),o=F(c.useCallback(i=>{i&&s({to:".",search:()=>i.filter(l=>l.value).reduce((l,d)=>(d.value&&(l[d.id]=d.value),l),{}),replace:!0})},[s]),400);return{filters:r,onFilterChange:o}};function ie(){const a=p.useSearch(),{filters:s,onFilterChange:r}=J(),[{data:o},{data:i}]=h({queries:[R(g(a)),_(g(a))]});return e.jsx(H,{filters:s,onFilterChange:r,artifactsCount:o,artifactsList:i})}export{ie as component};
|
|
2
|
+
//# sourceMappingURL=index-DJyKqsFO.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-H6bwm6L6.js","sources":["../../src/components/artifacts/artifacts-filter.tsx","../../src/components/artifacts/artifacts-header.tsx","../../src/components/artifacts/empty-state.tsx","../../src/components/artifacts/artifacts-page.tsx","../../src/routes/artifacts/index.tsx?tsr-split=component"],"sourcesContent":["import { useCallback, useMemo } from \"react\";\nimport { SearchInput } from \"@/components/ui/input\";\nimport {\n\tSelect,\n\tSelectContent,\n\tSelectItem,\n\tSelectTrigger,\n\tSelectValue,\n} from \"@/components/ui/select\";\nimport { pluralize } from \"@/utils\";\nimport { Icon } from \"../ui/icons\";\nimport { ToggleGroup, ToggleGroupItem } from \"../ui/toggle-group\";\nimport { Typography } from \"../ui/typography\";\nimport type { filterType } from \"./types\";\n\ntype ArtifactsFilterProps = {\n\tfilters: filterType[];\n\tonFilterChange: (newFilters: filterType[]) => void;\n\ttotalCount: number;\n\tsetDisplayMode: (mode: string) => void;\n\tdisplayMode: string;\n};\n\nconst artifactTypeOptions = [\n\t{ value: \"all\", label: \"All Types\" },\n\t{ value: \"markdown\", label: \"Markdown\" },\n\t{ value: \"progress\", label: \"Progress\" },\n\t{ value: \"image\", label: \"Image\" },\n\t{ value: \"table\", label: \"Table\" },\n] as const;\n\nexport const ArtifactsFilterComponent = ({\n\tfilters,\n\tonFilterChange,\n\ttotalCount,\n\tdisplayMode,\n\tsetDisplayMode,\n}: ArtifactsFilterProps) => {\n\tconst changeArtifactName = useCallback(\n\t\t(value: string) => {\n\t\t\tonFilterChange([\n\t\t\t\t...filters.filter((filter) => filter.id !== \"name\"),\n\t\t\t\t{ id: \"name\", label: \"Name\", value },\n\t\t\t]);\n\t\t},\n\t\t[filters, onFilterChange],\n\t);\n\n\tconst changeArtifactType = useCallback(\n\t\t(value: string) => {\n\t\t\tonFilterChange([\n\t\t\t\t...filters.filter((filter) => filter.id !== \"type\"),\n\t\t\t\t{ id: \"type\", label: \"Type\", value },\n\t\t\t]);\n\t\t},\n\t\t[filters, onFilterChange],\n\t);\n\n\tconst typeValue = useMemo(\n\t\t() => filters.find((val) => val.id === \"type\")?.value,\n\t\t[filters],\n\t);\n\n\tconst nameValue = useMemo(\n\t\t() => filters.find((val) => val.id === \"name\")?.value,\n\t\t[filters],\n\t);\n\treturn (\n\t\t<div\n\t\t\tdata-testid=\"artifact-filter\"\n\t\t\tclassName=\"flex justify-between items-center\"\n\t\t>\n\t\t\t<div>\n\t\t\t\t<Typography variant=\"body\" className=\"text-sm text-muted-foreground\">\n\t\t\t\t\t{totalCount} {pluralize(totalCount, \"artifact\")}\n\t\t\t\t</Typography>\n\t\t\t</div>\n\t\t\t<div className=\"flex gap-4\">\n\t\t\t\t<SearchInput\n\t\t\t\t\tdata-testid=\"search-input\"\n\t\t\t\t\tdefaultValue={nameValue}\n\t\t\t\t\tplaceholder=\"Search artifacts\"\n\t\t\t\t\tonChange={(e) => changeArtifactName(e.target.value)}\n\t\t\t\t/>\n\n\t\t\t\t<div className=\"flex gap-4\">\n\t\t\t\t\t<Select\n\t\t\t\t\t\tdata-testid=\"type-select\"\n\t\t\t\t\t\tvalue={typeValue}\n\t\t\t\t\t\tonValueChange={changeArtifactType}\n\t\t\t\t\t>\n\t\t\t\t\t\t<SelectTrigger aria-label=\"Artifact type\">\n\t\t\t\t\t\t\t<SelectValue placeholder=\"Type\" />\n\t\t\t\t\t\t</SelectTrigger>\n\t\t\t\t\t\t<SelectContent>\n\t\t\t\t\t\t\t{artifactTypeOptions.map(({ value, label }) => (\n\t\t\t\t\t\t\t\t<SelectItem key={value} value={value}>\n\t\t\t\t\t\t\t\t\t{label}\n\t\t\t\t\t\t\t\t</SelectItem>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t</SelectContent>\n\t\t\t\t\t</Select>\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<ToggleGroup\n\t\t\t\t\t\t\ttype=\"single\"\n\t\t\t\t\t\t\tdefaultValue={displayMode}\n\t\t\t\t\t\t\tonValueChange={(value: string) => setDisplayMode(value)}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<ToggleGroupItem data-testid=\"grid-layout\" value=\"grid\">\n\t\t\t\t\t\t\t\t<Icon id=\"LayoutGrid\" />\n\t\t\t\t\t\t\t</ToggleGroupItem>\n\t\t\t\t\t\t\t<ToggleGroupItem data-testid=\"list-layout\" value=\"list\">\n\t\t\t\t\t\t\t\t<Icon id=\"AlignJustify\" />\n\t\t\t\t\t\t\t</ToggleGroupItem>\n\t\t\t\t\t\t</ToggleGroup>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n","import {\n\tBreadcrumb,\n\tBreadcrumbItem,\n\tBreadcrumbList,\n} from \"@/components/ui/breadcrumb\";\nimport { DocsLink } from \"@/components/ui/docs-link\";\n\nexport const ArtifactsHeader = () => {\n\treturn (\n\t\t<div className=\"flex items-center justify-between\">\n\t\t\t<div className=\"flex items-center gap-2\">\n\t\t\t\t<Breadcrumb>\n\t\t\t\t\t<BreadcrumbList>\n\t\t\t\t\t\t<BreadcrumbItem className=\"text-xl font-semibold\">\n\t\t\t\t\t\t\tArtifacts\n\t\t\t\t\t\t</BreadcrumbItem>\n\t\t\t\t\t</BreadcrumbList>\n\t\t\t\t</Breadcrumb>\n\t\t\t</div>\n\t\t\t<DocsLink id=\"artifacts-guide\" label=\"Documentation\" />\n\t\t</div>\n\t);\n};\n","import { DocsLink } from \"@/components/ui/docs-link\";\nimport {\n\tEmptyState,\n\tEmptyStateActions,\n\tEmptyStateDescription,\n\tEmptyStateIcon,\n\tEmptyStateTitle,\n} from \"@/components/ui/empty-state\";\n\nexport const ArtifactsEmptyState = () => (\n\t<EmptyState>\n\t\t<div className=\"flex items-center gap-3\">\n\t\t\t<EmptyStateIcon id=\"Image\" />\n\t\t</div>\n\t\t<EmptyStateTitle>Create an artifact to get started</EmptyStateTitle>\n\t\t<EmptyStateDescription>\n\t\t\tArtifacts are byproducts of your runs; they can be anything from a\n\t\t\tmarkdown string to a table.\n\t\t</EmptyStateDescription>\n\t\t<EmptyStateActions>\n\t\t\t<DocsLink id=\"artifacts-guide\" />\n\t\t</EmptyStateActions>\n\t</EmptyState>\n);\n","import { useMemo } from \"react\";\nimport type { Artifact } from \"@/api/artifacts\";\nimport { useLocalStorage } from \"@/hooks/use-local-storage\";\nimport { ArtifactCard } from \"./artifact-card\";\nimport { ArtifactsFilterComponent } from \"./artifacts-filter\";\nimport { ArtifactsHeader } from \"./artifacts-header\";\nimport { ArtifactsEmptyState } from \"./empty-state\";\nimport type { filterType } from \"./types\";\n\nexport type ArtifactsPageProps = {\n\tfilters: filterType[];\n\tonFilterChange: (newFilters: filterType[]) => void;\n\tartifactsCount: number;\n\tartifactsList: Artifact[];\n};\n\nexport const ArtifactsPage = ({\n\tfilters,\n\tonFilterChange,\n\tartifactsList,\n\tartifactsCount,\n}: ArtifactsPageProps) => {\n\tconst [displayMode, setDisplayMode] = useLocalStorage<string>(\n\t\t\"artifacts-grid-style\",\n\t\t\"grid\",\n\t);\n\n\tconst gridClass = useMemo(() => {\n\t\treturn displayMode === \"grid\"\n\t\t\t? \"grid grid-cols-1 lg:grid-cols-2 xl:grid-cols-3 gap-4\"\n\t\t\t: \"grid-cols-1\";\n\t}, [displayMode]);\n\n\tconst artifactsListFiltered = useMemo(\n\t\t() =>\n\t\t\t// reduced vs set to preserve sort order\n\t\t\tartifactsList.reduce((acc, artifact) => {\n\t\t\t\tif (!acc.find((a) => a.key === artifact.key)) {\n\t\t\t\t\tacc.push(artifact);\n\t\t\t\t}\n\t\t\t\treturn acc;\n\t\t\t}, [] as Artifact[]),\n\t\t[artifactsList],\n\t);\n\n\treturn (\n\t\t<div className=\"flex flex-col gap-4\">\n\t\t\t<ArtifactsHeader />\n\t\t\t<ArtifactsFilterComponent\n\t\t\t\tfilters={filters}\n\t\t\t\tonFilterChange={onFilterChange}\n\t\t\t\ttotalCount={artifactsCount}\n\t\t\t\tsetDisplayMode={setDisplayMode}\n\t\t\t\tdisplayMode={displayMode}\n\t\t\t/>\n\n\t\t\t{artifactsListFiltered.length === 0 ? (\n\t\t\t\t<ArtifactsEmptyState />\n\t\t\t) : (\n\t\t\t\t<div className={gridClass}>\n\t\t\t\t\t{artifactsListFiltered.map((artifact) => (\n\t\t\t\t\t\t<ArtifactCard key={artifact.id} artifact={artifact} />\n\t\t\t\t\t))}\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</div>\n\t);\n};\n","import { useSuspenseQueries } from \"@tanstack/react-query\";\nimport { createFileRoute } from \"@tanstack/react-router\";\nimport { zodValidator } from \"@tanstack/zod-adapter\";\nimport { useCallback, useMemo } from \"react\";\nimport { z } from \"zod\";\nimport {\n\ttype ArtifactsFilter,\n\tbuildCountArtifactsQuery,\n\tbuildListArtifactsQuery,\n} from \"@/api/artifacts\";\nimport { ArtifactsPage } from \"@/components/artifacts/artifacts-page\";\nimport type { filterType } from \"@/components/artifacts/types\";\nimport useDebounceCallback from \"@/hooks/use-debounce-callback\";\n\n/**\n * Schema for validating URL search parameters for the artifacts page.\n * @property {number} page - The page number to display. Must be positive. Defaults to 1.\n * @property {number} limit - The maximum number of items to return. Must be positive. Defaults to 10.\n */\nconst searchParams = z.object({\n\ttype: z.string().optional().catch(\"\"),\n\tname: z.string().optional().catch(\"\"),\n});\n\n/**\n * Builds filter parameters for artifacts query from search params\n *\n * @param search - Optional validated search parameters containing page and limit\n * @returns ArtifactsFilter with type and name\n *\n * @example\n * ```ts\n * const filter = buildFilterBody({ type: \"markdown\", name: \"my-dataset\" })\n * // Returns {\n * //\t\tartifacts: {\n * //\t\t\toperator: \"and_\",\n * //\t\t\ttype: { any_: [\"markdown\"] },\n * //\t\t\tkey: { like_: \"my-dataset\" }\n * //\t\t},\n * //\t\tsort: \"CREATED_DESC\",\n * //\t\toffset: 0\n * //}\n * ```\n */\nconst buildFilterBody = (\n\tsearch?: z.infer<typeof searchParams>,\n): ArtifactsFilter => ({\n\tartifacts: {\n\t\toperator: \"and_\", // Logical operator for combining filters\n\t\ttype: {\n\t\t\tany_: search?.type && search?.type !== \"all\" ? [search.type] : undefined, // Filter by artifact type\n\t\t},\n\t\tkey: {\n\t\t\tlike_: search?.name ?? \"\", // Filter by artifact name\n\t\t},\n\t},\n\tsort: \"CREATED_DESC\",\n\toffset: 0,\n});\n\nexport const Route = createFileRoute(\"/artifacts/\")({\n\tvalidateSearch: zodValidator(searchParams),\n\tcomponent: RouteComponent,\n\tloaderDeps: ({ search }) => buildFilterBody(search),\n\tloader: async ({ deps, context }) => {\n\t\tconst [artifactsCount, artifactsList] = await Promise.all([\n\t\t\tcontext.queryClient.ensureQueryData(buildCountArtifactsQuery(deps)),\n\t\t\tcontext.queryClient.ensureQueryData(buildListArtifactsQuery(deps)),\n\t\t]);\n\n\t\treturn { artifactsCount, artifactsList };\n\t},\n\twrapInSuspense: true,\n});\n\nconst useFilter = () => {\n\tconst search = Route.useSearch();\n\tconst navigate = Route.useNavigate();\n\n\tconst filters = useMemo(\n\t\t() => [\n\t\t\t{ id: \"type\", label: \"Type\", value: search.type ?? \"all\" },\n\t\t\t{ id: \"name\", label: \"Name\", value: search.name },\n\t\t],\n\t\t[search.type, search.name],\n\t);\n\n\tconst onFilterChange = useDebounceCallback(\n\t\tuseCallback(\n\t\t\t(newFilters: filterType[]) => {\n\t\t\t\tif (!newFilters) return;\n\t\t\t\tvoid navigate({\n\t\t\t\t\tto: \".\",\n\t\t\t\t\tsearch: () =>\n\t\t\t\t\t\tnewFilters\n\t\t\t\t\t\t\t.filter((filter) => filter.value)\n\t\t\t\t\t\t\t.reduce(\n\t\t\t\t\t\t\t\t(prev, curr) => {\n\t\t\t\t\t\t\t\t\tif (!curr.value) return prev;\n\t\t\t\t\t\t\t\t\tprev[curr.id] = curr.value;\n\t\t\t\t\t\t\t\t\treturn prev;\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t{} as Record<string, string>,\n\t\t\t\t\t\t\t),\n\t\t\t\t\treplace: true,\n\t\t\t\t});\n\t\t\t},\n\t\t\t[navigate],\n\t\t),\n\t\t400,\n\t);\n\n\treturn { filters, onFilterChange };\n};\n\nfunction RouteComponent() {\n\tconst search = Route.useSearch();\n\tconst { filters, onFilterChange } = useFilter();\n\n\tconst [{ data: artifactsCount }, { data: artifactsList }] =\n\t\tuseSuspenseQueries({\n\t\t\tqueries: [\n\t\t\t\tbuildCountArtifactsQuery(buildFilterBody(search)),\n\t\t\t\tbuildListArtifactsQuery(buildFilterBody(search)),\n\t\t\t],\n\t\t});\n\n\treturn (\n\t\t<ArtifactsPage\n\t\t\tfilters={filters}\n\t\t\tonFilterChange={onFilterChange}\n\t\t\tartifactsCount={artifactsCount}\n\t\t\tartifactsList={artifactsList}\n\t\t/>\n\t);\n}\n"],"names":["artifactTypeOptions","ArtifactsFilterComponent","filters","onFilterChange","totalCount","displayMode","setDisplayMode","changeArtifactName","useCallback","value","filter","changeArtifactType","typeValue","useMemo","val","nameValue","jsxs","jsx","Typography","pluralize","SearchInput","e","Select","SelectTrigger","SelectValue","SelectContent","label","SelectItem","ToggleGroup","ToggleGroupItem","Icon","ArtifactsHeader","Breadcrumb","BreadcrumbList","BreadcrumbItem","DocsLink","ArtifactsEmptyState","EmptyState","EmptyStateIcon","EmptyStateTitle","EmptyStateDescription","EmptyStateActions","ArtifactsPage","artifactsList","artifactsCount","useLocalStorage","gridClass","artifactsListFiltered","acc","artifact","a","ArtifactCard","buildFilterBody","search","artifacts","operator","type","any_","undefined","key","like_","name","sort","offset","useFilter","Route","useSearch","navigate","useNavigate","id","useDebounceCallback","newFilters","to","reduce","prev","curr","replace","RouteComponent","data","useSuspenseQueries","queries","buildCountArtifactsQuery","buildListArtifactsQuery"],"mappings":"qpBAuBA,MAAMA,EAAsB,CAC3B,CAAE,MAAO,MAAO,MAAO,WAAA,EACvB,CAAE,MAAO,WAAY,MAAO,UAAA,EAC5B,CAAE,MAAO,WAAY,MAAO,UAAA,EAC5B,CAAE,MAAO,QAAS,MAAO,OAAA,EACzB,CAAE,MAAO,QAAS,MAAO,OAAA,CAC1B,EAEaC,EAA2B,CAAC,CACxC,QAAAC,EACA,eAAAC,EACA,WAAAC,EACA,YAAAC,EACA,eAAAC,CACD,IAA4B,CAC3B,MAAMC,EAAqBC,EAAAA,YACzBC,GAAkB,CAClBN,EAAe,CACd,GAAGD,EAAQ,OAAQQ,GAAWA,EAAO,KAAO,MAAM,EAClD,CAAE,GAAI,OAAQ,MA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,IAAI,CAC1B,EAEM1D,EAAiBmE,EACtB9D,EAAAA,YACE+D,GAA6B,CACxBA,GACAJ,EAAS,CACbK,GAAI,IACJnB,OAAQA,IACPkB,EACE7D,OAAQA,GAAWA,EAAOD,KAAK,EAC/BgE,OACA,CAACC,EAAMC,KACDA,EAAKlE,QACViE,EAAKC,EAAKN,EAAE,EAAIM,EAAKlE,OACdiE,GAER,CAAA,CACD,EACFE,QAAS,EAAA,CACT,CACF,EACA,CAACT,CAAQ,CACV,EACA,GACD,EAEA,MAAO,CAAEjE,QAAAA,EAASC,eAAAA,CAAAA,CACnB,EAEA,SAAS0E,IAAiB,CACzB,MAAMxB,EAASY,EAAMC,UAAAA,EACf,CAAEhE,QAAAA,EAASC,eAAAA,CAAAA,EAAmB6D,EAAAA,EAE9B,CAAC,CAAEc,KAAMlC,CAAAA,EAAkB,CAAEkC,KAAMnC,CAAAA,CAAe,EACvDoC,EAAmB,CAClBC,QAAS,CACRC,EAAyB7B,EAAgBC,CAAM,CAAC,EAChD6B,EAAwB9B,EAAgBC,CAAM,CAAC,CAAC,CAAA,CAEjD,EAEF,OACCpC,EAAAA,IAACyB,EAAA,CACA,QAAAxC,EACA,eAAAC,EACA,eAAAyC,EACA,cAAAD,EAA6B,CAGhC"}
|
|
1
|
+
{"version":3,"file":"index-DJyKqsFO.js","sources":["../../src/components/artifacts/artifacts-filter.tsx","../../src/components/artifacts/artifacts-header.tsx","../../src/components/artifacts/empty-state.tsx","../../src/components/artifacts/artifacts-page.tsx","../../src/routes/artifacts/index.tsx?tsr-split=component"],"sourcesContent":["import { useCallback, useMemo } from \"react\";\nimport { SearchInput } from \"@/components/ui/input\";\nimport {\n\tSelect,\n\tSelectContent,\n\tSelectItem,\n\tSelectTrigger,\n\tSelectValue,\n} from \"@/components/ui/select\";\nimport { pluralize } from \"@/utils\";\nimport { Icon } from \"../ui/icons\";\nimport { ToggleGroup, ToggleGroupItem } from \"../ui/toggle-group\";\nimport { Typography } from \"../ui/typography\";\nimport type { filterType } from \"./types\";\n\ntype ArtifactsFilterProps = {\n\tfilters: filterType[];\n\tonFilterChange: (newFilters: filterType[]) => void;\n\ttotalCount: number;\n\tsetDisplayMode: (mode: string) => void;\n\tdisplayMode: string;\n};\n\nconst artifactTypeOptions = [\n\t{ value: \"all\", label: \"All Types\" },\n\t{ value: \"markdown\", label: \"Markdown\" },\n\t{ value: \"progress\", label: \"Progress\" },\n\t{ value: \"image\", label: \"Image\" },\n\t{ value: \"table\", label: \"Table\" },\n] as const;\n\nexport const ArtifactsFilterComponent = ({\n\tfilters,\n\tonFilterChange,\n\ttotalCount,\n\tdisplayMode,\n\tsetDisplayMode,\n}: ArtifactsFilterProps) => {\n\tconst changeArtifactName = useCallback(\n\t\t(value: string) => {\n\t\t\tonFilterChange([\n\t\t\t\t...filters.filter((filter) => filter.id !== \"name\"),\n\t\t\t\t{ id: \"name\", label: \"Name\", value },\n\t\t\t]);\n\t\t},\n\t\t[filters, onFilterChange],\n\t);\n\n\tconst changeArtifactType = useCallback(\n\t\t(value: string) => {\n\t\t\tonFilterChange([\n\t\t\t\t...filters.filter((filter) => filter.id !== \"type\"),\n\t\t\t\t{ id: \"type\", label: \"Type\", value },\n\t\t\t]);\n\t\t},\n\t\t[filters, onFilterChange],\n\t);\n\n\tconst typeValue = useMemo(\n\t\t() => filters.find((val) => val.id === \"type\")?.value,\n\t\t[filters],\n\t);\n\n\tconst nameValue = useMemo(\n\t\t() => filters.find((val) => val.id === \"name\")?.value,\n\t\t[filters],\n\t);\n\treturn (\n\t\t<div\n\t\t\tdata-testid=\"artifact-filter\"\n\t\t\tclassName=\"flex justify-between items-center\"\n\t\t>\n\t\t\t<div>\n\t\t\t\t<Typography variant=\"body\" className=\"text-sm text-muted-foreground\">\n\t\t\t\t\t{totalCount} {pluralize(totalCount, \"artifact\")}\n\t\t\t\t</Typography>\n\t\t\t</div>\n\t\t\t<div className=\"flex gap-4\">\n\t\t\t\t<SearchInput\n\t\t\t\t\tdata-testid=\"search-input\"\n\t\t\t\t\tdefaultValue={nameValue}\n\t\t\t\t\tplaceholder=\"Search artifacts\"\n\t\t\t\t\tonChange={(e) => changeArtifactName(e.target.value)}\n\t\t\t\t/>\n\n\t\t\t\t<div className=\"flex gap-4\">\n\t\t\t\t\t<Select\n\t\t\t\t\t\tdata-testid=\"type-select\"\n\t\t\t\t\t\tvalue={typeValue}\n\t\t\t\t\t\tonValueChange={changeArtifactType}\n\t\t\t\t\t>\n\t\t\t\t\t\t<SelectTrigger aria-label=\"Artifact type\">\n\t\t\t\t\t\t\t<SelectValue placeholder=\"Type\" />\n\t\t\t\t\t\t</SelectTrigger>\n\t\t\t\t\t\t<SelectContent>\n\t\t\t\t\t\t\t{artifactTypeOptions.map(({ value, label }) => (\n\t\t\t\t\t\t\t\t<SelectItem key={value} value={value}>\n\t\t\t\t\t\t\t\t\t{label}\n\t\t\t\t\t\t\t\t</SelectItem>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t</SelectContent>\n\t\t\t\t\t</Select>\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<ToggleGroup\n\t\t\t\t\t\t\ttype=\"single\"\n\t\t\t\t\t\t\tdefaultValue={displayMode}\n\t\t\t\t\t\t\tonValueChange={(value: string) => setDisplayMode(value)}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<ToggleGroupItem data-testid=\"grid-layout\" value=\"grid\">\n\t\t\t\t\t\t\t\t<Icon id=\"LayoutGrid\" />\n\t\t\t\t\t\t\t</ToggleGroupItem>\n\t\t\t\t\t\t\t<ToggleGroupItem data-testid=\"list-layout\" value=\"list\">\n\t\t\t\t\t\t\t\t<Icon id=\"AlignJustify\" />\n\t\t\t\t\t\t\t</ToggleGroupItem>\n\t\t\t\t\t\t</ToggleGroup>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n","import {\n\tBreadcrumb,\n\tBreadcrumbItem,\n\tBreadcrumbList,\n} from \"@/components/ui/breadcrumb\";\nimport { DocsLink } from \"@/components/ui/docs-link\";\n\nexport const ArtifactsHeader = () => {\n\treturn (\n\t\t<div className=\"flex items-center justify-between\">\n\t\t\t<div className=\"flex items-center gap-2\">\n\t\t\t\t<Breadcrumb>\n\t\t\t\t\t<BreadcrumbList>\n\t\t\t\t\t\t<BreadcrumbItem className=\"text-xl font-semibold\">\n\t\t\t\t\t\t\tArtifacts\n\t\t\t\t\t\t</BreadcrumbItem>\n\t\t\t\t\t</BreadcrumbList>\n\t\t\t\t</Breadcrumb>\n\t\t\t</div>\n\t\t\t<DocsLink id=\"artifacts-guide\" label=\"Documentation\" />\n\t\t</div>\n\t);\n};\n","import { DocsLink } from \"@/components/ui/docs-link\";\nimport {\n\tEmptyState,\n\tEmptyStateActions,\n\tEmptyStateDescription,\n\tEmptyStateIcon,\n\tEmptyStateTitle,\n} from \"@/components/ui/empty-state\";\n\nexport const ArtifactsEmptyState = () => (\n\t<EmptyState>\n\t\t<div className=\"flex items-center gap-3\">\n\t\t\t<EmptyStateIcon id=\"Image\" />\n\t\t</div>\n\t\t<EmptyStateTitle>Create an artifact to get started</EmptyStateTitle>\n\t\t<EmptyStateDescription>\n\t\t\tArtifacts are byproducts of your runs; they can be anything from a\n\t\t\tmarkdown string to a table.\n\t\t</EmptyStateDescription>\n\t\t<EmptyStateActions>\n\t\t\t<DocsLink id=\"artifacts-guide\" />\n\t\t</EmptyStateActions>\n\t</EmptyState>\n);\n","import { useMemo } from \"react\";\nimport type { Artifact } from \"@/api/artifacts\";\nimport { useLocalStorage } from \"@/hooks/use-local-storage\";\nimport { ArtifactCard } from \"./artifact-card\";\nimport { ArtifactsFilterComponent } from \"./artifacts-filter\";\nimport { ArtifactsHeader } from \"./artifacts-header\";\nimport { ArtifactsEmptyState } from \"./empty-state\";\nimport type { filterType } from \"./types\";\n\nexport type ArtifactsPageProps = {\n\tfilters: filterType[];\n\tonFilterChange: (newFilters: filterType[]) => void;\n\tartifactsCount: number;\n\tartifactsList: Artifact[];\n};\n\nexport const ArtifactsPage = ({\n\tfilters,\n\tonFilterChange,\n\tartifactsList,\n\tartifactsCount,\n}: ArtifactsPageProps) => {\n\tconst [displayMode, setDisplayMode] = useLocalStorage<string>(\n\t\t\"artifacts-grid-style\",\n\t\t\"grid\",\n\t);\n\n\tconst gridClass = useMemo(() => {\n\t\treturn displayMode === \"grid\"\n\t\t\t? \"grid grid-cols-1 lg:grid-cols-2 xl:grid-cols-3 gap-4\"\n\t\t\t: \"grid-cols-1\";\n\t}, [displayMode]);\n\n\tconst artifactsListFiltered = useMemo(\n\t\t() =>\n\t\t\t// reduced vs set to preserve sort order\n\t\t\tartifactsList.reduce((acc, artifact) => {\n\t\t\t\tif (!acc.find((a) => a.key === artifact.key)) {\n\t\t\t\t\tacc.push(artifact);\n\t\t\t\t}\n\t\t\t\treturn acc;\n\t\t\t}, [] as Artifact[]),\n\t\t[artifactsList],\n\t);\n\n\treturn (\n\t\t<div className=\"flex flex-col gap-4\">\n\t\t\t<ArtifactsHeader />\n\t\t\t<ArtifactsFilterComponent\n\t\t\t\tfilters={filters}\n\t\t\t\tonFilterChange={onFilterChange}\n\t\t\t\ttotalCount={artifactsCount}\n\t\t\t\tsetDisplayMode={setDisplayMode}\n\t\t\t\tdisplayMode={displayMode}\n\t\t\t/>\n\n\t\t\t{artifactsListFiltered.length === 0 ? (\n\t\t\t\t<ArtifactsEmptyState />\n\t\t\t) : (\n\t\t\t\t<div className={gridClass}>\n\t\t\t\t\t{artifactsListFiltered.map((artifact) => (\n\t\t\t\t\t\t<ArtifactCard key={artifact.id} artifact={artifact} />\n\t\t\t\t\t))}\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</div>\n\t);\n};\n","import { useSuspenseQueries } from \"@tanstack/react-query\";\nimport { createFileRoute } from \"@tanstack/react-router\";\nimport { zodValidator } from \"@tanstack/zod-adapter\";\nimport { useCallback, useMemo } from \"react\";\nimport { z } from \"zod\";\nimport {\n\ttype ArtifactsFilter,\n\tbuildCountArtifactsQuery,\n\tbuildListArtifactsQuery,\n} from \"@/api/artifacts\";\nimport { ArtifactsPage } from \"@/components/artifacts/artifacts-page\";\nimport type { filterType } from \"@/components/artifacts/types\";\nimport useDebounceCallback from \"@/hooks/use-debounce-callback\";\n\n/**\n * Schema for validating URL search parameters for the artifacts page.\n * @property {number} page - The page number to display. Must be positive. Defaults to 1.\n * @property {number} limit - The maximum number of items to return. Must be positive. Defaults to 10.\n */\nconst searchParams = z.object({\n\ttype: z.string().optional().catch(\"\"),\n\tname: z.string().optional().catch(\"\"),\n});\n\n/**\n * Builds filter parameters for artifacts query from search params\n *\n * @param search - Optional validated search parameters containing page and limit\n * @returns ArtifactsFilter with type and name\n *\n * @example\n * ```ts\n * const filter = buildFilterBody({ type: \"markdown\", name: \"my-dataset\" })\n * // Returns {\n * //\t\tartifacts: {\n * //\t\t\toperator: \"and_\",\n * //\t\t\ttype: { any_: [\"markdown\"] },\n * //\t\t\tkey: { like_: \"my-dataset\" }\n * //\t\t},\n * //\t\tsort: \"CREATED_DESC\",\n * //\t\toffset: 0\n * //}\n * ```\n */\nconst buildFilterBody = (\n\tsearch?: z.infer<typeof searchParams>,\n): ArtifactsFilter => ({\n\tartifacts: {\n\t\toperator: \"and_\", // Logical operator for combining filters\n\t\ttype: {\n\t\t\tany_: search?.type && search?.type !== \"all\" ? [search.type] : undefined, // Filter by artifact type\n\t\t},\n\t\tkey: {\n\t\t\tlike_: search?.name ?? \"\", // Filter by artifact name\n\t\t},\n\t},\n\tsort: \"CREATED_DESC\",\n\toffset: 0,\n});\n\nexport const Route = createFileRoute(\"/artifacts/\")({\n\tvalidateSearch: zodValidator(searchParams),\n\tcomponent: RouteComponent,\n\tloaderDeps: ({ search }) => buildFilterBody(search),\n\tloader: async ({ deps, context }) => {\n\t\tconst [artifactsCount, artifactsList] = await Promise.all([\n\t\t\tcontext.queryClient.ensureQueryData(buildCountArtifactsQuery(deps)),\n\t\t\tcontext.queryClient.ensureQueryData(buildListArtifactsQuery(deps)),\n\t\t]);\n\n\t\treturn { artifactsCount, artifactsList };\n\t},\n\twrapInSuspense: true,\n});\n\nconst useFilter = () => {\n\tconst search = Route.useSearch();\n\tconst navigate = Route.useNavigate();\n\n\tconst filters = useMemo(\n\t\t() => [\n\t\t\t{ id: \"type\", label: \"Type\", value: search.type ?? \"all\" },\n\t\t\t{ id: \"name\", label: \"Name\", value: search.name },\n\t\t],\n\t\t[search.type, search.name],\n\t);\n\n\tconst onFilterChange = useDebounceCallback(\n\t\tuseCallback(\n\t\t\t(newFilters: filterType[]) => {\n\t\t\t\tif (!newFilters) return;\n\t\t\t\tvoid navigate({\n\t\t\t\t\tto: \".\",\n\t\t\t\t\tsearch: () =>\n\t\t\t\t\t\tnewFilters\n\t\t\t\t\t\t\t.filter((filter) => filter.value)\n\t\t\t\t\t\t\t.reduce(\n\t\t\t\t\t\t\t\t(prev, curr) => {\n\t\t\t\t\t\t\t\t\tif (!curr.value) return prev;\n\t\t\t\t\t\t\t\t\tprev[curr.id] = curr.value;\n\t\t\t\t\t\t\t\t\treturn prev;\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t{} as Record<string, string>,\n\t\t\t\t\t\t\t),\n\t\t\t\t\treplace: true,\n\t\t\t\t});\n\t\t\t},\n\t\t\t[navigate],\n\t\t),\n\t\t400,\n\t);\n\n\treturn { filters, onFilterChange };\n};\n\nfunction RouteComponent() {\n\tconst search = Route.useSearch();\n\tconst { filters, onFilterChange } = useFilter();\n\n\tconst [{ data: artifactsCount }, { data: artifactsList }] =\n\t\tuseSuspenseQueries({\n\t\t\tqueries: [\n\t\t\t\tbuildCountArtifactsQuery(buildFilterBody(search)),\n\t\t\t\tbuildListArtifactsQuery(buildFilterBody(search)),\n\t\t\t],\n\t\t});\n\n\treturn (\n\t\t<ArtifactsPage\n\t\t\tfilters={filters}\n\t\t\tonFilterChange={onFilterChange}\n\t\t\tartifactsCount={artifactsCount}\n\t\t\tartifactsList={artifactsList}\n\t\t/>\n\t);\n}\n"],"names":["artifactTypeOptions","ArtifactsFilterComponent","filters","onFilterChange","totalCount","displayMode","setDisplayMode","changeArtifactName","useCallback","value","filter","changeArtifactType","typeValue","useMemo","val","nameValue","jsxs","jsx","Typography","pluralize","SearchInput","e","Select","SelectTrigger","SelectValue","SelectContent","label","SelectItem","ToggleGroup","ToggleGroupItem","Icon","ArtifactsHeader","Breadcrumb","BreadcrumbList","BreadcrumbItem","DocsLink","ArtifactsEmptyState","EmptyState","EmptyStateIcon","EmptyStateTitle","EmptyStateDescription","EmptyStateActions","ArtifactsPage","artifactsList","artifactsCount","useLocalStorage","gridClass","artifactsListFiltered","acc","artifact","a","ArtifactCard","buildFilterBody","search","artifacts","operator","type","any_","undefined","key","like_","name","sort","offset","useFilter","Route","useSearch","navigate","useNavigate","id","useDebounceCallback","newFilters","to","reduce","prev","curr","replace","RouteComponent","data","useSuspenseQueries","queries","buildCountArtifactsQuery","buildListArtifactsQuery"],"mappings":"8mBAuBA,MAAMA,EAAsB,CAC3B,CAAE,MAAO,MAAO,MAAO,WAAA,EACvB,CAAE,MAAO,WAAY,MAAO,UAAA,EAC5B,CAAE,MAAO,WAAY,MAAO,UAAA,EAC5B,CAAE,MAAO,QAAS,MAAO,OAAA,EACzB,CAAE,MAAO,QAAS,MAAO,OAAA,CAC1B,EAEaC,EAA2B,CAAC,CACxC,QAAAC,EACA,eAAAC,EACA,WAAAC,EACA,YAAAC,EACA,eAAAC,CACD,IAA4B,CAC3B,MAAMC,EAAqBC,EAAAA,YACzBC,GAAkB,CAClBN,EAAe,CACd,GAAGD,EAAQ,OAAQQ,GAAWA,EAAO,KAAO,MAAM,EAClD,CAAE,GAAI,OAAQ,MAAO,OAAQ,MAAAD,CAAA,CAAM,CACnC,CACF,EACA,CAACP,EAASC,CAAc,CAAA,EAGnBQ,EAAqBH,EAAAA,YACzBC,GAAkB,CAClBN,EAAe,CACd,GAAGD,EAAQ,OAAQQ,GAAWA,EAAO,KAAO,MAAM,EAClD,CAAE,GAAI,OAAQ,M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AAKC,EAAKN,EAAE,EAAIM,EAAKlE,OACdiE,GAER,CAAA,CACD,EACFE,QAAS,EAAA,CACT,CACF,EACA,CAACT,CAAQ,CACV,EACA,GACD,EAEA,MAAO,CAAEjE,QAAAA,EAASC,eAAAA,CAAAA,CACnB,EAEA,SAAS0E,IAAiB,CACzB,MAAMxB,EAASY,EAAMC,UAAAA,EACf,CAAEhE,QAAAA,EAASC,eAAAA,CAAAA,EAAmB6D,EAAAA,EAE9B,CAAC,CAAEc,KAAMlC,CAAAA,EAAkB,CAAEkC,KAAMnC,CAAAA,CAAe,EACvDoC,EAAmB,CAClBC,QAAS,CACRC,EAAyB7B,EAAgBC,CAAM,CAAC,EAChD6B,EAAwB9B,EAAgBC,CAAM,CAAC,CAAC,CAAA,CAEjD,EAEF,OACCpC,EAAAA,IAACyB,EAAA,CACA,QAAAxC,EACA,eAAAC,EACA,eAAAyC,EACA,cAAAD,EAA6B,CAGhC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{j as e}from"./vendor-tanstack-BK8oseNA.js";import{S as C,a as S,b as D,
|
|
2
|
-
//# sourceMappingURL=index-
|
|
1
|
+
import{j as e}from"./vendor-tanstack-BK8oseNA.js";import{S as C,a as S,b as D,aq as a,c as A,e as L}from"./index-BvSl3DKP.js";const E={COMPLETED:"Completed",RUNNING:"Running",SCHEDULED:"Scheduled",PENDING:"Pending",FAILED:"Failed",CANCELLED:"Cancelled",CANCELLING:"Cancelling",CRASHED:"Crashed",PAUSED:"Paused"},N=["Scheduled","Late","Resuming","AwaitingRetry","AwaitingConcurrencySlot","Pending","Paused","Suspended","Running","Retrying","Completed","Cached","Cancelled","Cancelling","Crashed","Failed","TimedOut"],g={Scheduled:"SCHEDULED",Late:"SCHEDULED",Resuming:"SCHEDULED",AwaitingRetry:"SCHEDULED",AwaitingConcurrencySlot:"SCHEDULED",Pending:"PENDING",Paused:"PAUSED",Suspended:"PAUSED",Running:"RUNNING",Retrying:"RUNNING",Completed:"COMPLETED",Cached:"COMPLETED",Cancelled:"CANCELLED",Cancelling:"CANCELLING",Crashed:"CRASHED",Failed:"FAILED",TimedOut:"FAILED"},R=N.filter(t=>t!=="Scheduled"),u=["COMPLETED","FAILED","CANCELLED","CRASHED"],P=({value:t,onValueChange:l,placeholder:i="Select state",terminalOnly:c=!1,excludeState:s})=>{const d=Object.entries(E).filter(([n])=>!(c&&!u.includes(n)||s&&n===s));return e.jsxs(C,{value:t,onValueChange:l,children:[e.jsx(S,{"aria-label":"select state",className:"w-full",children:e.jsx(D,{placeholder:i,children:t&&e.jsx(a,{type:t,name:E[t]})})}),e.jsx(A,{className:"w-full min-w-[300px]",children:d.map(([n,r])=>e.jsx(L,{value:n,className:"flex items-center",children:e.jsx(a,{type:n,name:r})},n))})]})};export{E as R,P as S,N as a,g as b,R as c};
|
|
2
|
+
//# sourceMappingURL=index-DODEq1Pi.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-
|
|
1
|
+
{"version":3,"file":"index-DODEq1Pi.js","sources":["../../src/api/flow-runs/constants.ts","../../src/components/ui/state-select/index.tsx"],"sourcesContent":["import type { components } from \"@/api/prefect\";\n\nexport const RUN_STATES = {\n\tCOMPLETED: \"Completed\",\n\tRUNNING: \"Running\",\n\tSCHEDULED: \"Scheduled\",\n\tPENDING: \"Pending\",\n\tFAILED: \"Failed\",\n\tCANCELLED: \"Cancelled\",\n\tCANCELLING: \"Cancelling\",\n\tCRASHED: \"Crashed\",\n\tPAUSED: \"Paused\",\n} as const satisfies Record<\n\tcomponents[\"schemas\"][\"StateType\"],\n\tCapitalize<Lowercase<components[\"schemas\"][\"StateType\"]>>\n>;\n\nexport type RunStates = keyof typeof RUN_STATES;\n\nexport type StateType = components[\"schemas\"][\"StateType\"];\n\n/**\n * All possible state names that can be used in automations.\n * This list is intentionally ordered by state type progression\n * to match the Vue implementation.\n */\nexport const STATE_NAMES = [\n\t\"Scheduled\",\n\t\"Late\",\n\t\"Resuming\",\n\t\"AwaitingRetry\",\n\t\"AwaitingConcurrencySlot\",\n\t\"Pending\",\n\t\"Paused\",\n\t\"Suspended\",\n\t\"Running\",\n\t\"Retrying\",\n\t\"Completed\",\n\t\"Cached\",\n\t\"Cancelled\",\n\t\"Cancelling\",\n\t\"Crashed\",\n\t\"Failed\",\n\t\"TimedOut\",\n] as const;\n\nexport type StateName = (typeof STATE_NAMES)[number];\n\n/**\n * Maps state names to their corresponding state types.\n * Multiple state names can map to the same state type.\n */\nexport const STATE_NAME_TO_TYPE: Record<StateName, StateType> = {\n\tScheduled: \"SCHEDULED\",\n\tLate: \"SCHEDULED\",\n\tResuming: \"SCHEDULED\",\n\tAwaitingRetry: \"SCHEDULED\",\n\tAwaitingConcurrencySlot: \"SCHEDULED\",\n\tPending: \"PENDING\",\n\tPaused: \"PAUSED\",\n\tSuspended: \"PAUSED\",\n\tRunning: \"RUNNING\",\n\tRetrying: \"RUNNING\",\n\tCompleted: \"COMPLETED\",\n\tCached: \"COMPLETED\",\n\tCancelled: \"CANCELLED\",\n\tCancelling: \"CANCELLING\",\n\tCrashed: \"CRASHED\",\n\tFailed: \"FAILED\",\n\tTimedOut: \"FAILED\",\n} as const;\n\n/**\n * State names that are not \"Scheduled\" - used for the \"All except scheduled\" convenience option.\n */\nexport const STATE_NAMES_WITHOUT_SCHEDULED = STATE_NAMES.filter(\n\t(name) => name !== \"Scheduled\",\n);\n","import { RUN_STATES } from \"@/api/flow-runs/constants\";\nimport type { components } from \"@/api/prefect\";\nimport {\n\tSelect,\n\tSelectContent,\n\tSelectItem,\n\tSelectTrigger,\n\tSelectValue,\n} from \"@/components/ui/select\";\nimport { StateBadge } from \"@/components/ui/state-badge\";\n\ntype StateType = components[\"schemas\"][\"StateType\"];\n\nconst TERMINAL_STATES: StateType[] = [\n\t\"COMPLETED\",\n\t\"FAILED\",\n\t\"CANCELLED\",\n\t\"CRASHED\",\n];\n\nexport type StateSelectProps = {\n\tvalue?: StateType;\n\tonValueChange: (value: StateType) => void;\n\tplaceholder?: string;\n\tterminalOnly?: boolean;\n\texcludeState?: StateType;\n};\n\nexport const StateSelect = ({\n\tvalue,\n\tonValueChange,\n\tplaceholder = \"Select state\",\n\tterminalOnly = false,\n\texcludeState,\n}: StateSelectProps) => {\n\tconst stateEntries = Object.entries(RUN_STATES) as [StateType, string][];\n\n\tconst filteredStates = stateEntries.filter(([key]) => {\n\t\tif (terminalOnly && !TERMINAL_STATES.includes(key)) {\n\t\t\treturn false;\n\t\t}\n\t\tif (excludeState && key === excludeState) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t});\n\n\treturn (\n\t\t<Select value={value} onValueChange={onValueChange}>\n\t\t\t<SelectTrigger aria-label=\"select state\" className=\"w-full\">\n\t\t\t\t<SelectValue placeholder={placeholder}>\n\t\t\t\t\t{value && <StateBadge type={value} name={RUN_STATES[value]} />}\n\t\t\t\t</SelectValue>\n\t\t\t</SelectTrigger>\n\t\t\t<SelectContent className=\"w-full min-w-[300px]\">\n\t\t\t\t{filteredStates.map(([key, displayName]) => (\n\t\t\t\t\t<SelectItem key={key} value={key} className=\"flex items-center\">\n\t\t\t\t\t\t<StateBadge type={key} name={displayName} />\n\t\t\t\t\t</SelectItem>\n\t\t\t\t))}\n\t\t\t</SelectContent>\n\t\t</Select>\n\t);\n};\n"],"names":["RUN_STATES","STATE_NAMES","STATE_NAME_TO_TYPE","STATE_NAMES_WITHOUT_SCHEDULED","name","TERMINAL_STATES","StateSelect","value","onValueChange","placeholder","terminalOnly","excludeState","filteredStates","key","jsxs","Select","jsx","SelectTrigger","SelectValue","StateBadge","SelectContent","displayName","SelectItem"],"mappings":"8HAEO,MAAMA,EAAa,CACzB,UAAW,YACX,QAAS,UACT,UAAW,YACX,QAAS,UACT,OAAQ,SACR,UAAW,YACX,WAAY,aACZ,QAAS,UACT,OAAQ,QACT,EAcaC,EAAc,CAC1B,YACA,OACA,WACA,gBACA,0BACA,UACA,SACA,YACA,UACA,WACA,YACA,SACA,YACA,aACA,UACA,SACA,UACD,EAQaC,EAAmD,CAC/D,UAAW,YACX,KAAM,YACN,SAAU,YACV,cAAe,YACf,wBAAyB,YACzB,QAAS,UACT,OAAQ,SACR,UAAW,SACX,QAAS,UACT,SAAU,UACV,UAAW,YACX,OAAQ,YACR,UAAW,YACX,WAAY,aACZ,QAAS,UACT,OAAQ,SACR,SAAU,QACX,EAKaC,EAAgCF,EAAY,OACvDG,GAASA,IAAS,WACpB,EChEMC,EAA+B,CACpC,YACA,SACA,YACA,SACD,EAUaC,EAAc,CAAC,CAC3B,MAAAC,EACA,cAAAC,EACA,YAAAC,EAAc,eACd,aAAAC,EAAe,GACf,aAAAC,CACD,IAAwB,CAGvB,MAAMC,EAFe,OAAO,QAAQZ,CAAU,EAEV,OAAO,CAAC,CAACa,CAAG,IAC3C,EAAAH,GAAgB,CAACL,EAAgB,SAASQ,CAAG,GAG7CF,GAAgBE,IAAQF,EAI5B,EAED,OACCG,EAAAA,KAACC,EAAA,CAAO,MAAAR,EAAc,cAAAC,EACrB,SAAA,CAAAQ,EAAAA,IAACC,GAAc,aAAW,eAAe,UAAU,SAClD,SAAAD,EAAAA,IAACE,GAAY,YAAAT,EACX,SAAAF,GAASS,MAACG,EAAA,CAAW,KAAMZ,EAAO,KAAMP,EAAWO,CAAK,EAAG,EAC7D,CAAA,CACD,EACAS,EAAAA,IAACI,EAAA,CAAc,UAAU,uBACvB,SAAAR,EAAe,IAAI,CAAC,CAACC,EAAKQ,CAAW,IACrCL,EAAAA,IAACM,EAAA,CAAqB,MAAOT,EAAK,UAAU,oBAC3C,SAAAG,EAAAA,IAACG,EAAA,CAAW,KAAMN,EAAK,KAAMQ,CAAA,CAAa,CAAA,EAD1BR,CAEjB,CACA,CAAA,CACF,CAAA,EACD,CAEF"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{j as t,E as h,s as D,r as u}from"./vendor-tanstack-BK8oseNA.js";import{E as S,t as d,v as C,w as v,x as w,D as j,bc as r,bd as b,be as N,ab as _}from"./index-BvSl3DKP.js";import{D as E}from"./index-Bj0OOguP.js";import{D as k}from"./header-9rXZ4r39.js";import"./vendor-react-Bce9NwRC.js";import"./vendor-radix-CznP1SOq.js";import"./vendor-recharts-D4imLXNl.js";import"./vendor-forms-DxqqmhL5.js";import"./vendor-date-7GxEwcQM.js";import"./use-quick-run-BMnCkwSv.js";import"./use-delete-confirmation-dialog-CvQEyyhU.js";import"./data-table-Bw8TZx9D.js";import"./table-vo9Do8sA.js";import"./delete-confirmation-dialog-CTdWZlGM.js";import"./index-tBdv6kBF.js";import"./cronstrue-WDy4rv2V.js";import"./use-is-overflowing-Bv_2pq2B.js";import"./index-ChIrfjIW.js";import"./tags-input-Ci2JQ-k3.js";import"./dropdown-menu-CT-s-V7d.js";const P=()=>t.jsxs(S,{children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(d,{id:"Workflow"}),t.jsx(d,{id:"MoreHorizontal"}),t.jsx(d,{id:"Rocket"})]}),t.jsx(C,{children:"Create a deployment to get started"}),t.jsx(v,{children:"Deployments elevate workflows from functions you call manually to API objects that can be remotely triggered."}),t.jsx(w,{children:t.jsx(j,{id:"deployments-guide"})})]}),A=e=>({page:e?.page??1,limit:e?.limit??10,sort:e?.sort??"NAME_ASC",deployments:{operator:"and_",flow_or_deployment_name:{like_:e?.flowOrDeploymentName??""},tags:{operator:"and_",all_:e?.tags??[]}}}),F=()=>{const e=r.useSearch(),o=r.useNavigate(),s=(e.page??1)-1,a=e.limit??10,n=u.useMemo(()=>({pageIndex:s,pageSize:a}),[s,a]),p=u.useCallback(i=>{o({to:".",search:l=>({...l,page:i.pageIndex+1,limit:i.pageSize}),replace:!0})},[o]);return[n,p]},O=()=>{const e=r.useSearch(),o=r.useNavigate(),s=a=>{o({to:".",search:n=>({...n,sort:a}),replace:!0})};return[e.sort,s]},M=()=>{const e=r.useSearch(),o=r.useNavigate(),s=u.useMemo(()=>[{id:"flowOrDeploymentName",value:e.flowOrDeploymentName},{id:"tags",value:e.tags}],[e.flowOrDeploymentName,e.tags]),a=u.useCallback(n=>{o({to:".",search:p=>{const i=n.find(m=>m.id==="flowOrDeploymentName")?.value,l=n.find(m=>m.id==="tags")?.value;return{...p,offset:0,flowOrDeploymentName:i,tags:l}},replace:!0})},[o]);return[s,a]};function te(){const e=r.useSearch(),[o,s]=F(),[a,n]=O(),[p,i]=M(),[{data:l},{data:m}]=h({queries:[b(),N(A(e))]}),g=m?.results??[],{data:y}=D(_({flows:{operator:"and_",id:{any_:[...new Set(g.map(c=>c.flow_id))]}},offset:0,sort:"NAME_ASC"})),f=g.map(c=>({...c,flow:y?.find(x=>x.id===c.flow_id)}));return t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(k,{}),l===0?t.jsx(P,{}):t.jsx(E,{deployments:f,currentDeploymentsCount:l,pageCount:m?.pages??0,pagination:o,sort:a,columnFilters:p,onPaginationChange:s,onSortChange:n,onColumnFiltersChange:i})]})}export{te as component};
|
|
2
|
+
//# sourceMappingURL=index-DicK6p3K.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-7-r4ia_S.js","sources":["../../src/components/deployments/empty-state/index.tsx","../../src/routes/deployments/index.tsx?tsr-split=component"],"sourcesContent":["import { DocsLink } from \"@/components/ui/docs-link\";\nimport {\n\tEmptyState,\n\tEmptyStateActions,\n\tEmptyStateDescription,\n\tEmptyStateIcon,\n\tEmptyStateTitle,\n} from \"@/components/ui/empty-state\";\n\nexport const DeploymentsEmptyState = () => (\n\t<EmptyState>\n\t\t<div className=\"flex items-center gap-3\">\n\t\t\t<EmptyStateIcon id=\"Workflow\" />\n\t\t\t<EmptyStateIcon id=\"MoreHorizontal\" />\n\t\t\t<EmptyStateIcon id=\"Rocket\" />\n\t\t</div>\n\t\t<EmptyStateTitle>Create a deployment to get started</EmptyStateTitle>\n\t\t<EmptyStateDescription>\n\t\t\tDeployments elevate workflows from functions you call manually to API\n\t\t\tobjects that can be remotely triggered.\n\t\t</EmptyStateDescription>\n\t\t<EmptyStateActions>\n\t\t\t<DocsLink id=\"deployments-guide\" />\n\t\t</EmptyStateActions>\n\t</EmptyState>\n);\n","import { useQuery, useSuspenseQueries } from \"@tanstack/react-query\";\nimport type { ErrorComponentProps } from \"@tanstack/react-router\";\nimport { createFileRoute } from \"@tanstack/react-router\";\nimport type {\n\tColumnFiltersState,\n\tPaginationState,\n} from \"@tanstack/react-table\";\nimport { zodValidator } from \"@tanstack/zod-adapter\";\nimport { useCallback, useMemo } from \"react\";\nimport { z } from \"zod\";\nimport {\n\tbuildCountDeploymentsQuery,\n\tbuildPaginateDeploymentsQuery,\n\ttype DeploymentsPaginationFilter,\n} from \"@/api/deployments\";\nimport { categorizeError } from \"@/api/error-utils\";\nimport { buildListFlowsQuery } from \"@/api/flows\";\nimport type { components } from \"@/api/prefect\";\nimport { DeploymentsDataTable } from \"@/components/deployments/data-table\";\nimport { DeploymentsEmptyState } from \"@/components/deployments/empty-state\";\nimport { DeploymentsPageHeader } from \"@/components/deployments/header\";\nimport { RouteErrorState } from \"@/components/ui/route-error-state\";\n\n/**\n * Schema for validating URL search parameters for the variables page.\n * @property {number} page - The page number to display. Must be positive. Defaults to 1.\n * @property {number} limit - The maximum number of items to return. Must be positive. Defaults to 10.\n */\nconst searchParams = z.object({\n\tpage: z.number().int().positive().optional().default(1).catch(1),\n\tlimit: z.number().int().positive().optional().default(10).catch(10),\n\tsort: z\n\t\t.enum([\"NAME_ASC\", \"NAME_DESC\", \"CREATED_DESC\", \"UPDATED_DESC\"])\n\t\t.optional()\n\t\t.default(\"NAME_ASC\")\n\t\t.catch(\"NAME_ASC\"),\n\tflowOrDeploymentName: z.string().optional().catch(\"\"),\n\ttags: z.array(z.string()).optional().catch([]),\n});\n\n/**\n * Builds pagination parameters for deployments query from search params\n *\n * @param search - Optional validated search parameters containing page and limit\n * @returns DeploymentsPaginationFilter with page, limit and sort order\n *\n * @example\n * ```ts\n * const filter = buildPaginationBody({ page: 2, limit: 25 })\n * // Returns { page: 2, limit: 25, sort: \"NAME_ASC\" }\n * ```\n */\nconst buildPaginationBody = (\n\tsearch?: z.infer<typeof searchParams>,\n): DeploymentsPaginationFilter => ({\n\tpage: search?.page ?? 1,\n\tlimit: search?.limit ?? 10,\n\tsort: search?.sort ?? \"NAME_ASC\",\n\tdeployments: {\n\t\toperator: \"and_\",\n\t\tflow_or_deployment_name: { like_: search?.flowOrDeploymentName ?? \"\" },\n\t\ttags: { operator: \"and_\", all_: search?.tags ?? [] },\n\t},\n});\n\nfunction DeploymentsErrorComponent({ error, reset }: ErrorComponentProps) {\n\tconst serverError = categorizeError(error, \"Failed to load deployments\");\n\n\t// Only handle API errors (server-error, client-error) at route level\n\t// Let network errors and unknown errors bubble up to root error component\n\tif (\n\t\tserverError.type !== \"server-error\" &&\n\t\tserverError.type !== \"client-error\"\n\t) {\n\t\tthrow error;\n\t}\n\n\treturn (\n\t\t<div className=\"flex flex-col gap-4\">\n\t\t\t<DeploymentsPageHeader />\n\t\t\t<RouteErrorState error={serverError} onRetry={reset} />\n\t\t</div>\n\t);\n}\n\nexport const Route = createFileRoute(\"/deployments/\")({\n\tvalidateSearch: zodValidator(searchParams),\n\tcomponent: RouteComponent,\n\terrorComponent: DeploymentsErrorComponent,\n\tloaderDeps: ({ search }) => buildPaginationBody(search),\n\tloader: async ({ deps, context }) => {\n\t\t// Get full count of deployments, don't block the UI\n\t\tconst deploymentsCountResult = context.queryClient.ensureQueryData(\n\t\t\tbuildCountDeploymentsQuery(),\n\t\t);\n\n\t\t// Get paginated deployments, wait for the result to get corresponding flows\n\t\tconst deploymentsPaginateResult = await context.queryClient.ensureQueryData(\n\t\t\tbuildPaginateDeploymentsQuery(deps),\n\t\t);\n\n\t\tconst deployments = deploymentsPaginateResult?.results ?? [];\n\n\t\tconst flowIds = [\n\t\t\t...new Set(deployments.map((deployment) => deployment.flow_id)),\n\t\t];\n\n\t\t// Get flows corresponding to the deployments\n\t\tconst flowsFilterResult = context.queryClient.ensureQueryData(\n\t\t\tbuildListFlowsQuery({\n\t\t\t\tflows: {\n\t\t\t\t\toperator: \"and_\",\n\t\t\t\t\tid: {\n\t\t\t\t\t\tany_: flowIds,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\toffset: 0,\n\t\t\t\tsort: \"NAME_ASC\",\n\t\t\t}),\n\t\t);\n\n\t\treturn {\n\t\t\tdeploymentsCountResult,\n\t\t\tdeploymentsPaginateResult,\n\t\t\tflowsFilterResult,\n\t\t};\n\t},\n\twrapInSuspense: true,\n});\n\n/**\n * Hook to manage pagination state and navigation for deployments table\n *\n * Handles conversion between 1-based page numbers in the URL and 0-based indices used by React Table.\n * Updates the URL search parameters when pagination changes.\n *\n * @returns A tuple containing:\n * - pagination: Current pagination state with pageIndex and pageSize\n * - onPaginationChange: Callback to update pagination and navigate with new search params\n */\nconst usePagination = () => {\n\tconst search = Route.useSearch();\n\tconst navigate = Route.useNavigate();\n\n\t// React Table uses 0-based pagination, so we need to subtract 1 from the page number\n\tconst pageIndex = (search.page ?? 1) - 1;\n\tconst pageSize = search.limit ?? 10;\n\tconst pagination: PaginationState = useMemo(\n\t\t() => ({\n\t\t\tpageIndex,\n\t\t\tpageSize,\n\t\t}),\n\t\t[pageIndex, pageSize],\n\t);\n\n\tconst onPaginationChange = useCallback(\n\t\t(newPagination: PaginationState) => {\n\t\t\tvoid navigate({\n\t\t\t\tto: \".\",\n\t\t\t\tsearch: (prev) => ({\n\t\t\t\t\t...prev,\n\t\t\t\t\tpage: newPagination.pageIndex + 1,\n\t\t\t\t\tlimit: newPagination.pageSize,\n\t\t\t\t}),\n\t\t\t\treplace: true,\n\t\t\t});\n\t\t},\n\t\t[navigate],\n\t);\n\n\treturn [pagination, onPaginationChange] as const;\n};\n\n/**\n * Hook to manage sorting state and navigation for deployments table\n *\n * Handles updating the URL search parameters when sort order changes.\n * Returns the current sort value from URL and a callback to update it.\n *\n * @returns A tuple containing:\n * - sort: Current sort value from URL search params\n * - onSortingChange: Callback to update sort and navigate with new search params\n */\nconst useSort = () => {\n\tconst search = Route.useSearch();\n\tconst navigate = Route.useNavigate();\n\n\tconst onSortingChange = (sort: components[\"schemas\"][\"DeploymentSort\"]) => {\n\t\tvoid navigate({\n\t\t\tto: \".\",\n\t\t\tsearch: (prev) => ({ ...prev, sort }),\n\t\t\treplace: true,\n\t\t});\n\t};\n\n\treturn [search.sort, onSortingChange] as const;\n};\n\nconst useDeploymentsColumnFilters = () => {\n\tconst search = Route.useSearch();\n\tconst navigate = Route.useNavigate();\n\tconst columnFilters: ColumnFiltersState = useMemo(\n\t\t() => [\n\t\t\t{ id: \"flowOrDeploymentName\", value: search.flowOrDeploymentName },\n\t\t\t{ id: \"tags\", value: search.tags },\n\t\t],\n\t\t[search.flowOrDeploymentName, search.tags],\n\t);\n\n\tconst onColumnFiltersChange = useCallback(\n\t\t(newColumnFilters: ColumnFiltersState) => {\n\t\t\tvoid navigate({\n\t\t\t\tto: \".\",\n\t\t\t\tsearch: (prev) => {\n\t\t\t\t\tconst flowOrDeploymentName = newColumnFilters.find(\n\t\t\t\t\t\t(filter) => filter.id === \"flowOrDeploymentName\",\n\t\t\t\t\t)?.value as string | undefined;\n\t\t\t\t\tconst tags = newColumnFilters.find((filter) => filter.id === \"tags\")\n\t\t\t\t\t\t?.value as string[] | undefined;\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...prev,\n\t\t\t\t\t\toffset: 0,\n\t\t\t\t\t\tflowOrDeploymentName,\n\t\t\t\t\t\ttags,\n\t\t\t\t\t};\n\t\t\t\t},\n\t\t\t\treplace: true,\n\t\t\t});\n\t\t},\n\t\t[navigate],\n\t);\n\n\treturn [columnFilters, onColumnFiltersChange] as const;\n};\n\nfunction RouteComponent() {\n\tconst search = Route.useSearch();\n\tconst [pagination, onPaginationChange] = usePagination();\n\tconst [sort, onSortChange] = useSort();\n\tconst [columnFilters, onColumnFiltersChange] = useDeploymentsColumnFilters();\n\n\tconst [{ data: deploymentsCount }, { data: deploymentsPage }] =\n\t\tuseSuspenseQueries({\n\t\t\tqueries: [\n\t\t\t\tbuildCountDeploymentsQuery(),\n\t\t\t\tbuildPaginateDeploymentsQuery(buildPaginationBody(search)),\n\t\t\t],\n\t\t});\n\n\tconst deployments = deploymentsPage?.results ?? [];\n\n\tconst { data: flows } = useQuery(\n\t\tbuildListFlowsQuery({\n\t\t\tflows: {\n\t\t\t\toperator: \"and_\",\n\t\t\t\tid: {\n\t\t\t\t\tany_: [\n\t\t\t\t\t\t...new Set(deployments.map((deployment) => deployment.flow_id)),\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t},\n\t\t\toffset: 0,\n\t\t\tsort: \"NAME_ASC\",\n\t\t}),\n\t);\n\n\tconst deploymentsWithFlows = deployments.map((deployment) => ({\n\t\t...deployment,\n\t\tflow: flows?.find((flow) => flow.id === deployment.flow_id),\n\t}));\n\n\treturn (\n\t\t<div className=\"flex flex-col gap-4\">\n\t\t\t<DeploymentsPageHeader />\n\t\t\t{deploymentsCount === 0 ? (\n\t\t\t\t<DeploymentsEmptyState />\n\t\t\t) : (\n\t\t\t\t<DeploymentsDataTable\n\t\t\t\t\tdeployments={deploymentsWithFlows}\n\t\t\t\t\tcurrentDeploymentsCount={deploymentsCount}\n\t\t\t\t\tpageCount={deploymentsPage?.pages ?? 0}\n\t\t\t\t\tpagination={pagination}\n\t\t\t\t\tsort={sort}\n\t\t\t\t\tcolumnFilters={columnFilters}\n\t\t\t\t\tonPaginationChange={onPaginationChange}\n\t\t\t\t\tonSortChange={onSortChange}\n\t\t\t\t\tonColumnFiltersChange={onColumnFiltersChange}\n\t\t\t\t/>\n\t\t\t)}\n\t\t</div>\n\t);\n}\n"],"names":["DeploymentsEmptyState","jsxs","EmptyState","jsx","EmptyStateIcon","EmptyStateTitle","EmptyStateDescription","EmptyStateActions","DocsLink","buildPaginationBody","search","page","limit","sort","deployments","operator","flow_or_deployment_name","like_","flowOrDeploymentName","tags","all_","usePagination","Route","useSearch","navigate","useNavigate","pageIndex","pageSize","pagination","useMemo","onPaginationChange","useCallback","newPagination","to","prev","replace","useSort","onSortingChange","useDeploymentsColumnFilters","columnFilters","id","value","onColumnFiltersChange","newColumnFilters","find","filter","offset","RouteComponent","onSortChange","data","deploymentsCount","deploymentsPage","useSuspenseQueries","queries","buildCountDeploymentsQuery","buildPaginateDeploymentsQuery","results","flows","useQuery","buildListFlowsQuery","any_","Set","map","deployment","flow_id","deploymentsWithFlows","flow","DeploymentsPageHeader","DeploymentsDataTable","pages"],"mappings":"uzBASO,MAAMA,EAAwB,IACpCC,EAAAA,KAACC,EAAA,CACA,SAAA,CAAAD,EAAAA,KAAC,MAAA,CAAI,UAAU,0BACd,SAAA,CAAAE,EAAAA,IAACC,EAAA,CAAe,GAAG,UAAA,CAAW,EAC9BD,EAAAA,IAACC,EAAA,CAAe,GAAG,gBAAA,CAAiB,EACpCD,EAAAA,IAACC,EAAA,CAAe,GAAG,QAAA,CAAS,CAAA,EAC7B,EACAD,EAAAA,IAACE,GAAgB,SAAA,oCAAA,CAAkC,EACnDF,EAAAA,IAACG,GAAsB,SAAA,+GAAA,CAGvB,QACCC,EAAA,CACA,SAAAJ,EAAAA,IAACK,EAAA,CAAS,GAAG,oBAAoB,CAAA,CAClC,CAAA,EACD,EC4BKC,EACLC,IACkC,CAClCC,KAAMD,GAAQC,MAAQ,EACtBC,MAAOF,GAAQE,OAAS,GACxBC,KAAMH,GAAQG,MAAQ,WACtBC,YAAa,CACZC,SAAU,OACVC,wBAAyB,CAAEC,MAAOP,GAAQQ,sBAAwB,EAAA,EAClEC,KAAM,CAAEJ,SAAU,OAAQK,KAAMV,GAAQS,MAAQ,CAAA,CAAA,CAAG,CAErD,GA6EME,EAAgBA,IAAM,CAC3B,MAAMX,EAASY,EAAMC,UAAAA,EACfC,EAAWF,EAAMG,YAAAA,EAGjBC,GAAahB,EAAOC,MAAQ,GAAK,EACjCgB,EAAWjB,EAAOE,OAAS,GAC3BgB,EAA8BC,EAAAA,QACnC,KAAO,CACNH,UAAAA,EACAC,SAAAA,CAAAA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,EAASY,EAAMC,UAAAA,EACf,CAACK,EAAYE,CAAkB,EAAIT,EAAAA,EACnC,CAACR,EAAMmC,CAAY,EAAIZ,EAAAA,EACvB,CAACG,EAAeG,CAAqB,EAAIJ,EAAAA,EAEzC,CAAC,CAAEW,KAAMC,CAAAA,EAAoB,CAAED,KAAME,CAAAA,CAAiB,EAC3DC,EAAmB,CAClBC,QAAS,CACRC,EAAAA,EACAC,EAA8B9C,EAAoBC,CAAM,CAAC,CAAC,CAAA,CAE3D,EAEII,EAAcqC,GAAiBK,SAAW,CAAA,EAE1C,CAAEP,KAAMQ,CAAAA,EAAUC,EACvBC,EAAoB,CACnBF,MAAO,CACN1C,SAAU,OACVyB,GAAI,CACHoB,KAAM,CACL,GAAG,IAAIC,IAAI/C,EAAYgD,IAAKC,GAAeA,EAAWC,OAAO,CAAC,CAAC,CAAA,CAEjE,EAEDlB,OAAQ,EACRjC,KAAM,UAAA,CACN,CACF,EAEMoD,EAAuBnD,EAAYgD,IAAKC,IAAgB,CAC7D,GAAGA,EACHG,KAAMT,GAAOb,QAAesB,EAAK1B,KAAOuB,EAAWC,OAAO,CAAA,EACzD,EAEF,OACC/D,EAAAA,KAAC,MAAA,CAAI,UAAU,sBACd,SAAA,CAAAE,EAAAA,IAACgE,EAAA,EAAqB,EACrBjB,IAAqB,EACrB/C,EAAAA,IAACH,EAAA,CAAA,CAAqB,EAEtBG,EAAAA,IAACiE,EAAA,CACA,YAAaH,EACb,wBAAyBf,EACzB,UAAWC,GAAiBkB,OAAS,EACrC,WAAAzC,EACA,KAAAf,EACA,cAAA0B,EACA,mBAAAT,EACA,aAAAkB,EACA,sBAAAN,CAAA,CAA6C,CAAA,EAGhD,CAEF"}
|
|
1
|
+
{"version":3,"file":"index-DicK6p3K.js","sources":["../../src/components/deployments/empty-state/index.tsx","../../src/routes/deployments/index.tsx?tsr-split=component"],"sourcesContent":["import { DocsLink } from \"@/components/ui/docs-link\";\nimport {\n\tEmptyState,\n\tEmptyStateActions,\n\tEmptyStateDescription,\n\tEmptyStateIcon,\n\tEmptyStateTitle,\n} from \"@/components/ui/empty-state\";\n\nexport const DeploymentsEmptyState = () => (\n\t<EmptyState>\n\t\t<div className=\"flex items-center gap-3\">\n\t\t\t<EmptyStateIcon id=\"Workflow\" />\n\t\t\t<EmptyStateIcon id=\"MoreHorizontal\" />\n\t\t\t<EmptyStateIcon id=\"Rocket\" />\n\t\t</div>\n\t\t<EmptyStateTitle>Create a deployment to get started</EmptyStateTitle>\n\t\t<EmptyStateDescription>\n\t\t\tDeployments elevate workflows from functions you call manually to API\n\t\t\tobjects that can be remotely triggered.\n\t\t</EmptyStateDescription>\n\t\t<EmptyStateActions>\n\t\t\t<DocsLink id=\"deployments-guide\" />\n\t\t</EmptyStateActions>\n\t</EmptyState>\n);\n","import { useQuery, useSuspenseQueries } from \"@tanstack/react-query\";\nimport type { ErrorComponentProps } from \"@tanstack/react-router\";\nimport { createFileRoute } from \"@tanstack/react-router\";\nimport type {\n\tColumnFiltersState,\n\tPaginationState,\n} from \"@tanstack/react-table\";\nimport { zodValidator } from \"@tanstack/zod-adapter\";\nimport { useCallback, useMemo } from \"react\";\nimport { z } from \"zod\";\nimport {\n\tbuildCountDeploymentsQuery,\n\tbuildPaginateDeploymentsQuery,\n\ttype DeploymentsPaginationFilter,\n} from \"@/api/deployments\";\nimport { categorizeError } from \"@/api/error-utils\";\nimport { buildListFlowsQuery } from \"@/api/flows\";\nimport type { components } from \"@/api/prefect\";\nimport { DeploymentsDataTable } from \"@/components/deployments/data-table\";\nimport { DeploymentsEmptyState } from \"@/components/deployments/empty-state\";\nimport { DeploymentsPageHeader } from \"@/components/deployments/header\";\nimport { RouteErrorState } from \"@/components/ui/route-error-state\";\n\n/**\n * Schema for validating URL search parameters for the variables page.\n * @property {number} page - The page number to display. Must be positive. Defaults to 1.\n * @property {number} limit - The maximum number of items to return. Must be positive. Defaults to 10.\n */\nconst searchParams = z.object({\n\tpage: z.number().int().positive().optional().default(1).catch(1),\n\tlimit: z.number().int().positive().optional().default(10).catch(10),\n\tsort: z\n\t\t.enum([\"NAME_ASC\", \"NAME_DESC\", \"CREATED_DESC\", \"UPDATED_DESC\"])\n\t\t.optional()\n\t\t.default(\"NAME_ASC\")\n\t\t.catch(\"NAME_ASC\"),\n\tflowOrDeploymentName: z.string().optional().catch(\"\"),\n\ttags: z.array(z.string()).optional().catch([]),\n});\n\n/**\n * Builds pagination parameters for deployments query from search params\n *\n * @param search - Optional validated search parameters containing page and limit\n * @returns DeploymentsPaginationFilter with page, limit and sort order\n *\n * @example\n * ```ts\n * const filter = buildPaginationBody({ page: 2, limit: 25 })\n * // Returns { page: 2, limit: 25, sort: \"NAME_ASC\" }\n * ```\n */\nconst buildPaginationBody = (\n\tsearch?: z.infer<typeof searchParams>,\n): DeploymentsPaginationFilter => ({\n\tpage: search?.page ?? 1,\n\tlimit: search?.limit ?? 10,\n\tsort: search?.sort ?? \"NAME_ASC\",\n\tdeployments: {\n\t\toperator: \"and_\",\n\t\tflow_or_deployment_name: { like_: search?.flowOrDeploymentName ?? \"\" },\n\t\ttags: { operator: \"and_\", all_: search?.tags ?? [] },\n\t},\n});\n\nfunction DeploymentsErrorComponent({ error, reset }: ErrorComponentProps) {\n\tconst serverError = categorizeError(error, \"Failed to load deployments\");\n\n\t// Only handle API errors (server-error, client-error) at route level\n\t// Let network errors and unknown errors bubble up to root error component\n\tif (\n\t\tserverError.type !== \"server-error\" &&\n\t\tserverError.type !== \"client-error\"\n\t) {\n\t\tthrow error;\n\t}\n\n\treturn (\n\t\t<div className=\"flex flex-col gap-4\">\n\t\t\t<DeploymentsPageHeader />\n\t\t\t<RouteErrorState error={serverError} onRetry={reset} />\n\t\t</div>\n\t);\n}\n\nexport const Route = createFileRoute(\"/deployments/\")({\n\tvalidateSearch: zodValidator(searchParams),\n\tcomponent: RouteComponent,\n\terrorComponent: DeploymentsErrorComponent,\n\tloaderDeps: ({ search }) => buildPaginationBody(search),\n\tloader: async ({ deps, context }) => {\n\t\t// Get full count of deployments, don't block the UI\n\t\tconst deploymentsCountResult = context.queryClient.ensureQueryData(\n\t\t\tbuildCountDeploymentsQuery(),\n\t\t);\n\n\t\t// Get paginated deployments, wait for the result to get corresponding flows\n\t\tconst deploymentsPaginateResult = await context.queryClient.ensureQueryData(\n\t\t\tbuildPaginateDeploymentsQuery(deps),\n\t\t);\n\n\t\tconst deployments = deploymentsPaginateResult?.results ?? [];\n\n\t\tconst flowIds = [\n\t\t\t...new Set(deployments.map((deployment) => deployment.flow_id)),\n\t\t];\n\n\t\t// Get flows corresponding to the deployments\n\t\tconst flowsFilterResult = context.queryClient.ensureQueryData(\n\t\t\tbuildListFlowsQuery({\n\t\t\t\tflows: {\n\t\t\t\t\toperator: \"and_\",\n\t\t\t\t\tid: {\n\t\t\t\t\t\tany_: flowIds,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\toffset: 0,\n\t\t\t\tsort: \"NAME_ASC\",\n\t\t\t}),\n\t\t);\n\n\t\treturn {\n\t\t\tdeploymentsCountResult,\n\t\t\tdeploymentsPaginateResult,\n\t\t\tflowsFilterResult,\n\t\t};\n\t},\n\twrapInSuspense: true,\n});\n\n/**\n * Hook to manage pagination state and navigation for deployments table\n *\n * Handles conversion between 1-based page numbers in the URL and 0-based indices used by React Table.\n * Updates the URL search parameters when pagination changes.\n *\n * @returns A tuple containing:\n * - pagination: Current pagination state with pageIndex and pageSize\n * - onPaginationChange: Callback to update pagination and navigate with new search params\n */\nconst usePagination = () => {\n\tconst search = Route.useSearch();\n\tconst navigate = Route.useNavigate();\n\n\t// React Table uses 0-based pagination, so we need to subtract 1 from the page number\n\tconst pageIndex = (search.page ?? 1) - 1;\n\tconst pageSize = search.limit ?? 10;\n\tconst pagination: PaginationState = useMemo(\n\t\t() => ({\n\t\t\tpageIndex,\n\t\t\tpageSize,\n\t\t}),\n\t\t[pageIndex, pageSize],\n\t);\n\n\tconst onPaginationChange = useCallback(\n\t\t(newPagination: PaginationState) => {\n\t\t\tvoid navigate({\n\t\t\t\tto: \".\",\n\t\t\t\tsearch: (prev) => ({\n\t\t\t\t\t...prev,\n\t\t\t\t\tpage: newPagination.pageIndex + 1,\n\t\t\t\t\tlimit: newPagination.pageSize,\n\t\t\t\t}),\n\t\t\t\treplace: true,\n\t\t\t});\n\t\t},\n\t\t[navigate],\n\t);\n\n\treturn [pagination, onPaginationChange] as const;\n};\n\n/**\n * Hook to manage sorting state and navigation for deployments table\n *\n * Handles updating the URL search parameters when sort order changes.\n * Returns the current sort value from URL and a callback to update it.\n *\n * @returns A tuple containing:\n * - sort: Current sort value from URL search params\n * - onSortingChange: Callback to update sort and navigate with new search params\n */\nconst useSort = () => {\n\tconst search = Route.useSearch();\n\tconst navigate = Route.useNavigate();\n\n\tconst onSortingChange = (sort: components[\"schemas\"][\"DeploymentSort\"]) => {\n\t\tvoid navigate({\n\t\t\tto: \".\",\n\t\t\tsearch: (prev) => ({ ...prev, sort }),\n\t\t\treplace: true,\n\t\t});\n\t};\n\n\treturn [search.sort, onSortingChange] as const;\n};\n\nconst useDeploymentsColumnFilters = () => {\n\tconst search = Route.useSearch();\n\tconst navigate = Route.useNavigate();\n\tconst columnFilters: ColumnFiltersState = useMemo(\n\t\t() => [\n\t\t\t{ id: \"flowOrDeploymentName\", value: search.flowOrDeploymentName },\n\t\t\t{ id: \"tags\", value: search.tags },\n\t\t],\n\t\t[search.flowOrDeploymentName, search.tags],\n\t);\n\n\tconst onColumnFiltersChange = useCallback(\n\t\t(newColumnFilters: ColumnFiltersState) => {\n\t\t\tvoid navigate({\n\t\t\t\tto: \".\",\n\t\t\t\tsearch: (prev) => {\n\t\t\t\t\tconst flowOrDeploymentName = newColumnFilters.find(\n\t\t\t\t\t\t(filter) => filter.id === \"flowOrDeploymentName\",\n\t\t\t\t\t)?.value as string | undefined;\n\t\t\t\t\tconst tags = newColumnFilters.find((filter) => filter.id === \"tags\")\n\t\t\t\t\t\t?.value as string[] | undefined;\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...prev,\n\t\t\t\t\t\toffset: 0,\n\t\t\t\t\t\tflowOrDeploymentName,\n\t\t\t\t\t\ttags,\n\t\t\t\t\t};\n\t\t\t\t},\n\t\t\t\treplace: true,\n\t\t\t});\n\t\t},\n\t\t[navigate],\n\t);\n\n\treturn [columnFilters, onColumnFiltersChange] as const;\n};\n\nfunction RouteComponent() {\n\tconst search = Route.useSearch();\n\tconst [pagination, onPaginationChange] = usePagination();\n\tconst [sort, onSortChange] = useSort();\n\tconst [columnFilters, onColumnFiltersChange] = useDeploymentsColumnFilters();\n\n\tconst [{ data: deploymentsCount }, { data: deploymentsPage }] =\n\t\tuseSuspenseQueries({\n\t\t\tqueries: [\n\t\t\t\tbuildCountDeploymentsQuery(),\n\t\t\t\tbuildPaginateDeploymentsQuery(buildPaginationBody(search)),\n\t\t\t],\n\t\t});\n\n\tconst deployments = deploymentsPage?.results ?? [];\n\n\tconst { data: flows } = useQuery(\n\t\tbuildListFlowsQuery({\n\t\t\tflows: {\n\t\t\t\toperator: \"and_\",\n\t\t\t\tid: {\n\t\t\t\t\tany_: [\n\t\t\t\t\t\t...new Set(deployments.map((deployment) => deployment.flow_id)),\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t},\n\t\t\toffset: 0,\n\t\t\tsort: \"NAME_ASC\",\n\t\t}),\n\t);\n\n\tconst deploymentsWithFlows = deployments.map((deployment) => ({\n\t\t...deployment,\n\t\tflow: flows?.find((flow) => flow.id === deployment.flow_id),\n\t}));\n\n\treturn (\n\t\t<div className=\"flex flex-col gap-4\">\n\t\t\t<DeploymentsPageHeader />\n\t\t\t{deploymentsCount === 0 ? (\n\t\t\t\t<DeploymentsEmptyState />\n\t\t\t) : (\n\t\t\t\t<DeploymentsDataTable\n\t\t\t\t\tdeployments={deploymentsWithFlows}\n\t\t\t\t\tcurrentDeploymentsCount={deploymentsCount}\n\t\t\t\t\tpageCount={deploymentsPage?.pages ?? 0}\n\t\t\t\t\tpagination={pagination}\n\t\t\t\t\tsort={sort}\n\t\t\t\t\tcolumnFilters={columnFilters}\n\t\t\t\t\tonPaginationChange={onPaginationChange}\n\t\t\t\t\tonSortChange={onSortChange}\n\t\t\t\t\tonColumnFiltersChange={onColumnFiltersChange}\n\t\t\t\t/>\n\t\t\t)}\n\t\t</div>\n\t);\n}\n"],"names":["DeploymentsEmptyState","jsxs","EmptyState","jsx","EmptyStateIcon","EmptyStateTitle","EmptyStateDescription","EmptyStateActions","DocsLink","buildPaginationBody","search","page","limit","sort","deployments","operator","flow_or_deployment_name","like_","flowOrDeploymentName","tags","all_","usePagination","Route","useSearch","navigate","useNavigate","pageIndex","pageSize","pagination","useMemo","onPaginationChange","useCallback","newPagination","to","prev","replace","useSort","onSortingChange","useDeploymentsColumnFilters","columnFilters","id","value","onColumnFiltersChange","newColumnFilters","find","filter","offset","RouteComponent","onSortChange","data","deploymentsCount","deploymentsPage","useSuspenseQueries","queries","buildCountDeploymentsQuery","buildPaginateDeploymentsQuery","results","flows","useQuery","buildListFlowsQuery","any_","Set","map","deployment","flow_id","deploymentsWithFlows","flow","DeploymentsPageHeader","DeploymentsDataTable","pages"],"mappings":"i0BASO,MAAMA,EAAwB,IACpCC,EAAAA,KAACC,EAAA,CACA,SAAA,CAAAD,EAAAA,KAAC,MAAA,CAAI,UAAU,0BACd,SAAA,CAAAE,EAAAA,IAACC,EAAA,CAAe,GAAG,UAAA,CAAW,EAC9BD,EAAAA,IAACC,EAAA,CAAe,GAAG,gBAAA,CAAiB,EACpCD,EAAAA,IAACC,EAAA,CAAe,GAAG,QAAA,CAAS,CAAA,EAC7B,EACAD,EAAAA,IAACE,GAAgB,SAAA,oCAAA,CAAkC,EACnDF,EAAAA,IAACG,GAAsB,SAAA,+GAAA,CAGvB,QACCC,EAAA,CACA,SAAAJ,EAAAA,IAACK,EAAA,CAAS,GAAG,oBAAoB,CAAA,CAClC,CAAA,EACD,EC4BKC,EACLC,IACkC,CAClCC,KAAMD,GAAQC,MAAQ,EACtBC,MAAOF,GAAQE,OAAS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EAAAA,IAACH,EAAA,CAAA,CAAqB,EAEtBG,EAAAA,IAACiE,EAAA,CACA,YAAaH,EACb,wBAAyBf,EACzB,UAAWC,GAAiBkB,OAAS,EACrC,WAAAzC,EACA,KAAAf,EACA,cAAA0B,EACA,mBAAAT,EACA,aAAAkB,EACA,sBAAAN,CAAA,CAA6C,CAAA,EAGhD,CAEF"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{j as e,L as h,r as d,C as v,D,B as N,p as S,s as T}from"./vendor-tanstack-BK8oseNA.js";import{
|
|
2
|
-
//# sourceMappingURL=index-
|
|
1
|
+
import{j as e,L as h,r as d,C as v,D,B as N,p as S,s as T}from"./vendor-tanstack-BK8oseNA.js";import{al as p,ak as f,bm as w,ac as I,ad as R,bn as _,ae as z,af as E,ah as M,ag as P,ai as A,aj as L,q as j,I as k,N as F,E as Q,t as q,v as H,w as V,x as $,D as O,B as G,h as U,O as J,bo as K,bp as W,bq as x}from"./index-BvSl3DKP.js";import{u as C,B as X}from"./use-delete-block-document-confirmation-dialog-BTwSeHRM.js";import{D as Y}from"./data-table-Bw8TZx9D.js";import{D as y}from"./delete-confirmation-dialog-CTdWZlGM.js";import{B as Z}from"./block-type-logo-WQNm0PzP.js";import"./vendor-react-Bce9NwRC.js";import"./vendor-radix-CznP1SOq.js";import"./vendor-recharts-D4imLXNl.js";import"./vendor-forms-DxqqmhL5.js";import"./vendor-date-7GxEwcQM.js";import"./dropdown-menu-CT-s-V7d.js";import"./use-delete-confirmation-dialog-CvQEyyhU.js";import"./table-vo9Do8sA.js";const ee=({blockDocument:a})=>{const{id:o,name:s,block_type:t,block_type_name:l}=a;return e.jsxs("div",{className:"flex gap-4 items-center",children:[t&&l&&e.jsx(Z,{size:"sm",logoUrl:t.logo_url,alt:`${l} logo`}),e.jsxs("div",{className:"flex flex-col",children:[s&&e.jsx(h,{to:"/blocks/block/$id",params:{id:o},children:e.jsx(p,{className:"font-semibold",children:s})}),l&&a.block_type?.slug&&e.jsx(h,{to:"/blocks/catalog/$slug",params:{slug:a.block_type.slug},children:e.jsx(p,{variant:"bodySmall",className:"text-muted-foreground",children:l})})]})]})},b=N(),se=({onDelete:a})=>[b.display({size:20,id:"select",header:({table:o})=>{let s=!1;return o.getIsAllRowsSelected()?s=!0:o.getIsSomePageRowsSelected()&&(s="indeterminate"),e.jsx(f,{checked:s,onCheckedChange:t=>o.toggleAllPageRowsSelected(!!t),"aria-label":"Select all"})},cell:({row:o})=>e.jsx(f,{checked:o.getIsSelected(),onCheckedChange:s=>o.toggleSelected(!!s),"aria-label":"Select row"}),enableSorting:!1,enableHiding:!1}),b.display({id:"block",header:"Block",cell:({row:o})=>e.jsx(ee,{blockDocument:o.original})}),b.display({id:"actions",cell:o=>{const s=o.row.original;return e.jsx("div",{className:"flex justify-end",children:e.jsx(X,{blockDocument:s,onDelete:()=>a(s)})})}})],oe=({blockDocuments:a,blockDocumentsCount:o,onPaginationChange:s,pagination:t,rowSelection:l,setRowSelection:i})=>{const[r,m]=C(),u=d.useCallback(c=>{let g=t;typeof c=="function"?g=c(t):g=c,s(g)},[t,s]),n=v({columns:se({onDelete:m}),data:a,defaultColumn:{maxSize:300},getCoreRowModel:D(),manualPagination:!0,onPaginationChange:u,rowCount:o,getRowId:c=>c.id,onRowSelectionChange:i,state:{pagination:t,rowSelection:l}});return e.jsxs(e.Fragment,{children:[e.jsx(Y,{table:n}),e.jsx(y,{...r})]})};function ae({selectedBlockTypesSlugs:a,onToggleBlockTypeSlug:o,onRemoveBlockTypeSlug:s}){return e.jsx(d.Suspense,{children:e.jsx(te,{selectedBlockTypesSlugs:a,onToggleBlockTypeSlug:o,onRemoveBlockTypeSlug:s})})}function te({selectedBlockTypesSlugs:a,onToggleBlockTypeSlug:o,onRemoveBlockTypeSlug:s}){const[t,l]=d.useState(""),i=d.useDeferredValue(t),{data:r}=S(w()),m=d.useMemo(()=>a.map(n=>r.find(c=>c.slug===n)).filter(Boolean),[r,a]),u=d.useMemo(()=>r.filter(n=>n.name.toLowerCase().includes(i.toLowerCase())),[r,i]);return e.jsxs(I,{children:[e.jsx(R,{selected:a.length>0,children:e.jsx("div",{className:"flex gap-1",children:a.length>0?m.map(n=>e.jsx(_,{tag:n.name,onRemove:()=>s(n.slug)},n.id)):"Select blocks"})}),e.jsxs(z,{children:[e.jsx(E,{value:t,onValueChange:l,placeholder:"Search for a block type..."}),e.jsx(M,{children:"No block type found"}),e.jsx(P,{children:e.jsx(A,{children:u.map(n=>e.jsx(L,{selected:a.includes(n.slug),onSelect:c=>{o(c),l("")},value:n.slug,children:n.name},n.id))})})]})]})}const le=({count:a,rowSelection:o,setRowSelection:s})=>{const[t,l]=C(),i=d.useMemo(()=>Object.keys(o),[o]);return i.length>0?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(p,{variant:"bodySmall",className:"text-muted-foreground",children:[i.length," selected"]}),e.jsx(j,{"aria-label":"Delete rows",size:"icon",variant:"secondary",onClick:()=>{l(i,{onSuccess:()=>s({})})},children:e.jsx(k,{id:"Trash2",className:"size-4"})})]}),e.jsx(y,{...t})]}):e.jsxs(p,{variant:"bodySmall",className:"text-muted-foreground",children:[a," ",F(a,"Block")]})},ne=()=>e.jsxs(Q,{children:[e.jsx(q,{id:"Box"}),e.jsx(H,{children:"Add a block to get started"}),e.jsx(V,{children:"Blocks securely store credentials and configuration to easily manage connections to external systems."}),e.jsxs($,{children:[e.jsx(h,{to:"/blocks/catalog",children:e.jsxs(j,{children:["Add Block ",e.jsx(k,{id:"Plus",className:"size-4 ml-2"})]})}),e.jsx(O,{id:"blocks-guide"})]})]}),ce=({allCount:a,blockDocuments:o=[],onSearch:s,search:t,blockTypeSlugsFilter:l,onToggleBlockTypeSlug:i,onRemoveBlockTypeSlug:r,pagination:m,onPaginationChange:u})=>{const[n,c]=d.useState({});return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(G,{children:e.jsx(U,{className:"text-xl font-semibold",children:"Blocks"})}),e.jsx(j,{size:"icon",className:"size-7",variant:"outline",children:e.jsx(h,{to:"/blocks/catalog",children:e.jsx(k,{id:"Plus",className:"size-4"})})})]}),a===0?e.jsx(ne,{}):e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(le,{rowSelection:n,setRowSelection:c,count:a}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ae,{selectedBlockTypesSlugs:l,onToggleBlockTypeSlug:i,onRemoveBlockTypeSlug:r}),e.jsx("div",{className:"min-w-56",children:e.jsx(J,{"aria-label":"search blocks",placeholder:"Search blocks",value:t,onChange:g=>s(g.target.value)})})]})]}),e.jsx(oe,{blockDocuments:o,rowSelection:n,setRowSelection:c,blockDocumentsCount:a,pagination:m,onPaginationChange:u})]})]})};function ve(){const[a,o]=ie(),[s,t]=re(),[l,i]=de(),{data:r}=S(K()),{data:m}=T(W({sort:"NAME_ASC",include_secrets:!1,block_documents:{name:{like_:a},operator:"and_",is_anonymous:{eq_:!1}},block_types:{slug:{any_:s.length>0?s:void 0}},offset:l.pageIndex*l.pageSize,limit:l.pageSize})),u=c=>{const g=s.filter(B=>B!==c);t(g)},n=c=>{if(s.includes(c))return u(c);t([...s,c])};return e.jsx(ce,{allCount:r,blockDocuments:m,onSearch:o,search:a,blockTypeSlugsFilter:s,onRemoveBlockTypeSlug:u,onToggleBlockTypeSlug:n,pagination:l,onPaginationChange:i})}function ie(){const{blockName:a}=x.useSearch(),o=x.useNavigate(),s=d.useCallback(l=>{o({to:".",search:i=>({...i,blockName:l}),replace:!0})},[o]);return[d.useMemo(()=>a??"",[a]),s]}function re(){const{blockTypes:a=[]}=x.useSearch(),o=x.useNavigate(),s=d.useCallback(t=>{o({to:".",search:l=>({...l,blockTypes:t}),replace:!0})},[o]);return[a,s]}function de(){const a=x.useSearch(),o=x.useNavigate(),s=(a.page??1)-1,t=a.limit??10,l=d.useMemo(()=>({pageIndex:s,pageSize:t}),[s,t]),i=d.useCallback(r=>{o({to:".",search:m=>({...m,page:r.pageIndex+1,limit:r.pageSize}),replace:!0})},[o]);return[l,i]}export{ve as component};
|
|
2
|
+
//# sourceMappingURL=index-DqCPbST9.js.map
|