prefect 3.6.14.dev1__py3-none-any.whl → 3.6.14.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/_observers.py +20 -8
- prefect/cli/server.py +18 -3
- prefect/deployments/runner.py +448 -8
- prefect/flows.py +162 -34
- prefect/runner/runner.py +48 -0
- prefect/server/orchestration/global_policy.py +4 -2
- prefect/server/ui-v2/assets/{artifact-card-DkgEVahF.js → artifact-card-D41jcvLX.js} +2 -2
- prefect/server/ui-v2/assets/{artifact-card-DkgEVahF.js.map → artifact-card-D41jcvLX.js.map} +1 -1
- prefect/server/ui-v2/assets/{artifact._id-C7yJhkKY.js → artifact._id-CYMvBFBb.js} +2 -2
- prefect/server/ui-v2/assets/{artifact._id-C7yJhkKY.js.map → artifact._id-CYMvBFBb.js.map} +1 -1
- prefect/server/ui-v2/assets/{automation-wizard-BLI4sqs9.js → automation-wizard-DHsWJ8JS.js} +2 -2
- prefect/server/ui-v2/assets/{automation-wizard-BLI4sqs9.js.map → automation-wizard-DHsWJ8JS.js.map} +1 -1
- prefect/server/ui-v2/assets/{automation._id-OLes3du9.js → automation._id-CCroE1-1.js} +2 -2
- prefect/server/ui-v2/assets/{automation._id-OLes3du9.js.map → automation._id-CCroE1-1.js.map} +1 -1
- prefect/server/ui-v2/assets/{automation_._id.edit-QrSzkDDB.js → automation_._id.edit-BgpDmMq7.js} +2 -2
- prefect/server/ui-v2/assets/{automation_._id.edit-QrSzkDDB.js.map → automation_._id.edit-BgpDmMq7.js.map} +1 -1
- prefect/server/ui-v2/assets/{automations-header-BoJc9HK8.js → automations-header-BEZXZmli.js} +2 -2
- prefect/server/ui-v2/assets/{automations-header-BoJc9HK8.js.map → automations-header-BEZXZmli.js.map} +1 -1
- prefect/server/ui-v2/assets/{base-job-template-form-section-Br6s0jNS.js → base-job-template-form-section-BubT4OHj.js} +2 -2
- prefect/server/ui-v2/assets/{base-job-template-form-section-Br6s0jNS.js.map → base-job-template-form-section-BubT4OHj.js.map} +1 -1
- prefect/server/ui-v2/assets/{block-type-details-BSbBP-Nm.js → block-type-details-DCWuBOwb.js} +2 -2
- prefect/server/ui-v2/assets/{block-type-details-BSbBP-Nm.js.map → block-type-details-DCWuBOwb.js.map} +1 -1
- prefect/server/ui-v2/assets/{block-type-logo-DNFERTyH.js → block-type-logo-SZMe2NdY.js} +2 -2
- prefect/server/ui-v2/assets/{block-type-logo-DNFERTyH.js.map → block-type-logo-SZMe2NdY.js.map} +1 -1
- prefect/server/ui-v2/assets/{block._id-DO6Hulrv.js → block._id-B6_kwTZ-.js} +2 -2
- prefect/server/ui-v2/assets/{block._id-DO6Hulrv.js.map → block._id-B6_kwTZ-.js.map} +1 -1
- prefect/server/ui-v2/assets/{block_._id.edit-BWF0TQvv.js → block_._id.edit-Bjg9WgY6.js} +2 -2
- prefect/server/ui-v2/assets/{block_._id.edit-BWF0TQvv.js.map → block_._id.edit-Bjg9WgY6.js.map} +1 -1
- prefect/server/ui-v2/assets/{catalog-BlaqZP0r.js → catalog-Bv8x-rIx.js} +2 -2
- prefect/server/ui-v2/assets/{catalog-BlaqZP0r.js.map → catalog-Bv8x-rIx.js.map} +1 -1
- prefect/server/ui-v2/assets/{catalog_._slug-BZWiMtjq.js → catalog_._slug-2GldfHc0.js} +2 -2
- prefect/server/ui-v2/assets/{catalog_._slug-BZWiMtjq.js.map → catalog_._slug-2GldfHc0.js.map} +1 -1
- prefect/server/ui-v2/assets/{catalog_._slug_.create-oHffbeMs.js → catalog_._slug_.create-Bjt7az95.js} +2 -2
- prefect/server/ui-v2/assets/{catalog_._slug_.create-oHffbeMs.js.map → catalog_._slug_.create-Bjt7az95.js.map} +1 -1
- prefect/server/ui-v2/assets/{collapsible-D45P93xU.js → collapsible-BT0EnMmT.js} +2 -2
- prefect/server/ui-v2/assets/{collapsible-D45P93xU.js.map → collapsible-BT0EnMmT.js.map} +1 -1
- prefect/server/ui-v2/assets/{concurrency-limit._id-B6oyPVya.js → concurrency-limit._id-Ba5Uof4l.js} +2 -2
- prefect/server/ui-v2/assets/{concurrency-limit._id-B6oyPVya.js.map → concurrency-limit._id-Ba5Uof4l.js.map} +1 -1
- prefect/server/ui-v2/assets/{create-CcYMd6w6.js → create-DK8Cy1hG.js} +2 -2
- prefect/server/ui-v2/assets/{create-CcYMd6w6.js.map → create-DK8Cy1hG.js.map} +1 -1
- prefect/server/ui-v2/assets/{create-DK1WvDhf.js → create-Ds8Lheyk.js} +2 -2
- prefect/server/ui-v2/assets/{create-DK1WvDhf.js.map → create-Ds8Lheyk.js.map} +1 -1
- prefect/server/ui-v2/assets/cronstrue-C72j5NDa.js +2 -0
- prefect/server/ui-v2/assets/cronstrue-C72j5NDa.js.map +1 -0
- prefect/server/ui-v2/assets/{data-table-B_iyrrTm.js → data-table-B6bdz5Zj.js} +2 -2
- prefect/server/ui-v2/assets/{data-table-B_iyrrTm.js.map → data-table-B6bdz5Zj.js.map} +1 -1
- prefect/server/ui-v2/assets/{delete-confirmation-dialog-7GKqeKy1.js → delete-confirmation-dialog-CV8ITEEW.js} +2 -2
- prefect/server/ui-v2/assets/{delete-confirmation-dialog-7GKqeKy1.js.map → delete-confirmation-dialog-CV8ITEEW.js.map} +1 -1
- prefect/server/ui-v2/assets/{deployment-action-header-DrvnfE9Y.js → deployment-action-header-DpjOcab0.js} +2 -2
- prefect/server/ui-v2/assets/{deployment-action-header-DrvnfE9Y.js.map → deployment-action-header-DpjOcab0.js.map} +1 -1
- prefect/server/ui-v2/assets/{deployment-form-DsAij22s.js → deployment-form-CjIPPnwV.js} +3 -3
- prefect/server/ui-v2/assets/{deployment-form-DsAij22s.js.map → deployment-form-CjIPPnwV.js.map} +1 -1
- prefect/server/ui-v2/assets/{deployment-links-BwqfKWQX.js → deployment-links--VkBo9wV.js} +2 -2
- prefect/server/ui-v2/assets/{deployment-links-BwqfKWQX.js.map → deployment-links--VkBo9wV.js.map} +1 -1
- prefect/server/ui-v2/assets/{deployment._id-E5e5s6bO.js → deployment._id-CW00MZGG.js} +2 -2
- prefect/server/ui-v2/assets/{deployment._id-E5e5s6bO.js.map → deployment._id-CW00MZGG.js.map} +1 -1
- prefect/server/ui-v2/assets/{deployment._id-U6KrtWw0.js → deployment._id-DjYh9IiR.js} +2 -2
- prefect/server/ui-v2/assets/{deployment._id-U6KrtWw0.js.map → deployment._id-DjYh9IiR.js.map} +1 -1
- prefect/server/ui-v2/assets/deployment_._id.duplicate-18ZQHHgI.js +2 -0
- prefect/server/ui-v2/assets/{deployment_._id.duplicate-C_kNyCA9.js.map → deployment_._id.duplicate-18ZQHHgI.js.map} +1 -1
- prefect/server/ui-v2/assets/deployment_._id.edit-C9H0Teuv.js +2 -0
- prefect/server/ui-v2/assets/{deployment_._id.edit-BP8pfTOR.js.map → deployment_._id.edit-C9H0Teuv.js.map} +1 -1
- prefect/server/ui-v2/assets/{deployment_._id.run-Di3-4Mtk.js → deployment_._id.run-CwHYw8j1.js} +2 -2
- prefect/server/ui-v2/assets/{deployment_._id.run-Di3-4Mtk.js.map → deployment_._id.run-CwHYw8j1.js.map} +1 -1
- prefect/server/ui-v2/assets/{dropdown-menu-iS8iJMpx.js → dropdown-menu-BYgkpoqb.js} +2 -2
- prefect/server/ui-v2/assets/{dropdown-menu-iS8iJMpx.js.map → dropdown-menu-BYgkpoqb.js.map} +1 -1
- prefect/server/ui-v2/assets/{event._eventDate._eventId-CG15qDSZ.js → event._eventDate._eventId-mPwFHce2.js} +2 -2
- prefect/server/ui-v2/assets/{event._eventDate._eventId-CG15qDSZ.js.map → event._eventDate._eventId-mPwFHce2.js.map} +1 -1
- prefect/server/ui-v2/assets/flow-run-graph-BMp5vJJa.js +2 -0
- prefect/server/ui-v2/assets/flow-run-graph-BMp5vJJa.js.map +1 -0
- prefect/server/ui-v2/assets/{flow-run._id-D_eAHZ5z.js → flow-run._id-CafHaMND.js} +2 -2
- prefect/server/ui-v2/assets/{flow-run._id-D_eAHZ5z.js.map → flow-run._id-CafHaMND.js.map} +1 -1
- prefect/server/ui-v2/assets/flow-run._id-CelqqA9P.js +4 -0
- prefect/server/ui-v2/assets/flow-run._id-CelqqA9P.js.map +1 -0
- prefect/server/ui-v2/assets/{flow-run._id-wco0Q19f.js → flow-run._id-hVuHWXbi.js} +2 -2
- prefect/server/ui-v2/assets/{flow-run._id-wco0Q19f.js.map → flow-run._id-hVuHWXbi.js.map} +1 -1
- prefect/server/ui-v2/assets/{flow-runs-pagination-DzGHOht3.js → flow-runs-pagination-CqjL9gOj.js} +2 -2
- prefect/server/ui-v2/assets/{flow-runs-pagination-DzGHOht3.js.map → flow-runs-pagination-CqjL9gOj.js.map} +1 -1
- prefect/server/ui-v2/assets/{flow._id-Dn2so3rK.js → flow._id-C1Djus0m.js} +2 -2
- prefect/server/ui-v2/assets/{flow._id-Dn2so3rK.js.map → flow._id-C1Djus0m.js.map} +1 -1
- prefect/server/ui-v2/assets/{form-rC8pxeRl.js → form-z_RaFdEo.js} +2 -2
- prefect/server/ui-v2/assets/{form-rC8pxeRl.js.map → form-z_RaFdEo.js.map} +1 -1
- prefect/server/ui-v2/assets/{header-CuAwmJ64.js → header-B-PvVnN7.js} +2 -2
- prefect/server/ui-v2/assets/{header-CuAwmJ64.js.map → header-B-PvVnN7.js.map} +1 -1
- prefect/server/ui-v2/assets/{header-C0zV3WDn.js → header-BSXYXvPS.js} +2 -2
- prefect/server/ui-v2/assets/{header-C0zV3WDn.js.map → header-BSXYXvPS.js.map} +1 -1
- prefect/server/ui-v2/assets/{header-C6ko3O7G.js → header-CKVO4oLE.js} +2 -2
- prefect/server/ui-v2/assets/{header-C6ko3O7G.js.map → header-CKVO4oLE.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-CotXErTe.js → index-B5zctA6A.js} +2 -2
- prefect/server/ui-v2/assets/{index-CotXErTe.js.map → index-B5zctA6A.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-k2161reF.js → index-BCzGofA2.js} +2 -2
- prefect/server/ui-v2/assets/{index-k2161reF.js.map → index-BCzGofA2.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-BdgomKuA.js → index-BOuQzuoR.js} +2 -2
- prefect/server/ui-v2/assets/{index-BdgomKuA.js.map → index-BOuQzuoR.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-pE_31vXF.js → index-BQOxk1xu.js} +2 -2
- prefect/server/ui-v2/assets/{index-pE_31vXF.js.map → index-BQOxk1xu.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-Benf9xn3.js → index-BU1Y-wgo.js} +2 -2
- prefect/server/ui-v2/assets/{index-Benf9xn3.js.map → index-BU1Y-wgo.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-CYpFLd7y.js → index-BxGluvOD.js} +2 -2
- prefect/server/ui-v2/assets/{index-CYpFLd7y.js.map → index-BxGluvOD.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-CcVSC2pV.js → index-CAbBPipD.js} +2 -2
- prefect/server/ui-v2/assets/{index-CcVSC2pV.js.map → index-CAbBPipD.js.map} +1 -1
- prefect/server/ui-v2/assets/index-CHwhYh-B.js +2 -0
- prefect/server/ui-v2/assets/{index-BYQ1P2TC.js.map → index-CHwhYh-B.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-0g8aAM30.js → index-CIKCrLeZ.js} +2 -2
- prefect/server/ui-v2/assets/{index-0g8aAM30.js.map → index-CIKCrLeZ.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-fhrsIceD.js → index-CLUjhc4A.js} +2 -2
- prefect/server/ui-v2/assets/{index-fhrsIceD.js.map → index-CLUjhc4A.js.map} +1 -1
- prefect/server/ui-v2/assets/index-CX5uU1zd.js +2 -0
- prefect/server/ui-v2/assets/index-CX5uU1zd.js.map +1 -0
- prefect/server/ui-v2/assets/{index-DwkedbVy.js → index-CXVePXfG.js} +2 -2
- prefect/server/ui-v2/assets/{index-DwkedbVy.js.map → index-CXVePXfG.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-DB2qeheX.js → index-D-ZIgaBw.js} +2 -2
- prefect/server/ui-v2/assets/{index-DB2qeheX.js.map → index-D-ZIgaBw.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-D8fZaZa7.js → index-D10Svo9k.js} +2 -2
- prefect/server/ui-v2/assets/{index-D8fZaZa7.js.map → index-D10Svo9k.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-CEStyUb-.js → index-D2EEipYt.js} +2 -2
- prefect/server/ui-v2/assets/{index-CEStyUb-.js.map → index-D2EEipYt.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-BIqzfifB.js → index-DV5fpxXB.js} +2 -2
- prefect/server/ui-v2/assets/{index-BIqzfifB.js.map → index-DV5fpxXB.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-C3D0Re7U.js → index-FHRYGk_R.js} +2 -2
- prefect/server/ui-v2/assets/{index-C3D0Re7U.js.map → index-FHRYGk_R.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-CCs20W5W.js → index-IGxqySze.js} +2 -2
- prefect/server/ui-v2/assets/{index-CCs20W5W.js.map → index-IGxqySze.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-BKbBu9gL.js → index-P2xc38Yh.js} +2 -2
- prefect/server/ui-v2/assets/{index-BKbBu9gL.js.map → index-P2xc38Yh.js.map} +1 -1
- prefect/server/ui-v2/assets/index-Yzhlw6-Q.js +17 -0
- prefect/server/ui-v2/assets/index-Yzhlw6-Q.js.map +1 -0
- prefect/server/ui-v2/assets/{index-BjsWjEUO.js → index-n7YFiQkB.js} +2 -2
- prefect/server/ui-v2/assets/{index-BjsWjEUO.js.map → index-n7YFiQkB.js.map} +1 -1
- prefect/server/ui-v2/assets/{json-input-C9dkBSdc.js → json-input-Dlzy_XLK.js} +2 -2
- prefect/server/ui-v2/assets/{json-input-C9dkBSdc.js.map → json-input-Dlzy_XLK.js.map} +1 -1
- prefect/server/ui-v2/assets/{key._key-BBVH44_R.js → key._key-DN_txnIw.js} +2 -2
- prefect/server/ui-v2/assets/{key._key-BBVH44_R.js.map → key._key-DN_txnIw.js.map} +1 -1
- prefect/server/ui-v2/assets/{lazy-markdown-BoMKGRXo.js → lazy-markdown-CPQjrQrX.js} +2 -2
- prefect/server/ui-v2/assets/{lazy-markdown-BoMKGRXo.js.map → lazy-markdown-CPQjrQrX.js.map} +1 -1
- prefect/server/ui-v2/assets/{login-BmmIDesJ.js → login-BsnFlv-8.js} +2 -2
- prefect/server/ui-v2/assets/{login-BmmIDesJ.js.map → login-BsnFlv-8.js.map} +1 -1
- prefect/server/ui-v2/assets/{markdown-input-C6P8cYT1.js → markdown-input-b0zl1NLl.js} +2 -2
- prefect/server/ui-v2/assets/{markdown-input-C6P8cYT1.js.map → markdown-input-b0zl1NLl.js.map} +1 -1
- prefect/server/ui-v2/assets/{python-example-snippet-DPumgTpL.js → python-example-snippet-W9Z_3hjQ.js} +3 -3
- prefect/server/ui-v2/assets/{python-example-snippet-DPumgTpL.js.map → python-example-snippet-W9Z_3hjQ.js.map} +1 -1
- prefect/server/ui-v2/assets/{python-input-DX4uV8MF.js → python-input-EKDBgTDE.js} +2 -2
- prefect/server/ui-v2/assets/{python-input-DX4uV8MF.js.map → python-input-EKDBgTDE.js.map} +1 -1
- prefect/server/ui-v2/assets/{radio-group-DeNK-Ob0.js → radio-group-BMeznoY8.js} +2 -2
- prefect/server/ui-v2/assets/{radio-group-DeNK-Ob0.js.map → radio-group-BMeznoY8.js.map} +1 -1
- prefect/server/ui-v2/assets/{route-error-state-C9CbByMx.js → route-error-state-BGOi4dn-.js} +2 -2
- prefect/server/ui-v2/assets/{route-error-state-C9CbByMx.js.map → route-error-state-BGOi4dn-.js.map} +1 -1
- prefect/server/ui-v2/assets/{schema-form-B45xnsnK.js → schema-form-BHWTZ8Sy.js} +2 -2
- prefect/server/ui-v2/assets/{schema-form-B45xnsnK.js.map → schema-form-BHWTZ8Sy.js.map} +1 -1
- prefect/server/ui-v2/assets/{schema-form-input-string-format-datetime-BJj81bu-.js → schema-form-input-string-format-datetime-hWIr4wQr.js} +4 -4
- prefect/server/ui-v2/assets/{schema-form-input-string-format-datetime-BJj81bu-.js.map → schema-form-input-string-format-datetime-hWIr4wQr.js.map} +1 -1
- prefect/server/ui-v2/assets/{settings-CbkeWqQ9.js → settings-DVSPGBen.js} +2 -2
- prefect/server/ui-v2/assets/{settings-CbkeWqQ9.js.map → settings-DVSPGBen.js.map} +1 -1
- prefect/server/ui-v2/assets/{sort-filter-DM7SvBB0.js → sort-filter-MiwMjIYc.js} +2 -2
- prefect/server/ui-v2/assets/{sort-filter-DM7SvBB0.js.map → sort-filter-MiwMjIYc.js.map} +1 -1
- prefect/server/ui-v2/assets/{table-CEPo6xb_.js → table-BJkw82b1.js} +2 -2
- prefect/server/ui-v2/assets/{table-CEPo6xb_.js.map → table-BJkw82b1.js.map} +1 -1
- prefect/server/ui-v2/assets/{tags-input-DJiZSVHp.js → tags-input-1KkWhGJZ.js} +2 -2
- prefect/server/ui-v2/assets/{tags-input-DJiZSVHp.js.map → tags-input-1KkWhGJZ.js.map} +1 -1
- prefect/server/ui-v2/assets/{task-run-concurrency-limits-reset-dialog-vJEkvqWp.js → task-run-concurrency-limits-reset-dialog-ClBlDic_.js} +2 -2
- prefect/server/ui-v2/assets/{task-run-concurrency-limits-reset-dialog-vJEkvqWp.js.map → task-run-concurrency-limits-reset-dialog-ClBlDic_.js.map} +1 -1
- prefect/server/ui-v2/assets/{task-run._id-BCnDnXrL.js → task-run._id-48TwMBP1.js} +2 -2
- prefect/server/ui-v2/assets/{task-run._id-BCnDnXrL.js.map → task-run._id-48TwMBP1.js.map} +1 -1
- prefect/server/ui-v2/assets/{task-run._id-ByJw1K82.js → task-run._id-BmK7HGNl.js} +2 -2
- prefect/server/ui-v2/assets/{task-run._id-ByJw1K82.js.map → task-run._id-BmK7HGNl.js.map} +1 -1
- prefect/server/ui-v2/assets/{task-runs-pagination-DbjB6XnY.js → task-runs-pagination-DA4izCRv.js} +2 -2
- prefect/server/ui-v2/assets/{task-runs-pagination-DbjB6XnY.js.map → task-runs-pagination-DA4izCRv.js.map} +1 -1
- prefect/server/ui-v2/assets/{textarea-BX8KbLGx.js → textarea-BqtBNhJB.js} +2 -2
- prefect/server/ui-v2/assets/{textarea-BX8KbLGx.js.map → textarea-BqtBNhJB.js.map} +1 -1
- prefect/server/ui-v2/assets/{timezone-select-TBj2n6Ox.js → timezone-select-BgD_PENN.js} +2 -2
- prefect/server/ui-v2/assets/{timezone-select-TBj2n6Ox.js.map → timezone-select-BgD_PENN.js.map} +1 -1
- prefect/server/ui-v2/assets/{toggle-group-D7mfSUim.js → toggle-group-ChA-JYQB.js} +2 -2
- prefect/server/ui-v2/assets/{toggle-group-D7mfSUim.js.map → toggle-group-ChA-JYQB.js.map} +1 -1
- prefect/server/ui-v2/assets/{use-delete-automation-confirmation-dialog-BpBSjz60.js → use-delete-automation-confirmation-dialog-Da1iWNZ_.js} +2 -2
- prefect/server/ui-v2/assets/{use-delete-automation-confirmation-dialog-BpBSjz60.js.map → use-delete-automation-confirmation-dialog-Da1iWNZ_.js.map} +1 -1
- prefect/server/ui-v2/assets/{use-delete-block-document-confirmation-dialog-BjKsNw6b.js → use-delete-block-document-confirmation-dialog-DfrxGSyY.js} +2 -2
- prefect/server/ui-v2/assets/{use-delete-block-document-confirmation-dialog-BjKsNw6b.js.map → use-delete-block-document-confirmation-dialog-DfrxGSyY.js.map} +1 -1
- prefect/server/ui-v2/assets/{use-flow-runs-selected-rows-B_BlBMic.js → use-flow-runs-selected-rows-CYOsQ-Df.js} +2 -2
- prefect/server/ui-v2/assets/{use-flow-runs-selected-rows-B_BlBMic.js.map → use-flow-runs-selected-rows-CYOsQ-Df.js.map} +1 -1
- prefect/server/ui-v2/assets/{use-get-artifacts-flow-task-runs-BfE433bC.js → use-get-artifacts-flow-task-runs-C0V3_gYz.js} +2 -2
- prefect/server/ui-v2/assets/{use-get-artifacts-flow-task-runs-BfE433bC.js.map → use-get-artifacts-flow-task-runs-C0V3_gYz.js.map} +1 -1
- prefect/server/ui-v2/assets/{use-quick-run-qrtcF-DD.js → use-quick-run-CgM0EheE.js} +2 -2
- prefect/server/ui-v2/assets/{use-quick-run-qrtcF-DD.js.map → use-quick-run-CgM0EheE.js.map} +1 -1
- prefect/server/ui-v2/assets/{use-stepper-CVy1_GBw.js → use-stepper-CSAs1T4U.js} +2 -2
- prefect/server/ui-v2/assets/{use-stepper-CVy1_GBw.js.map → use-stepper-CSAs1T4U.js.map} +1 -1
- prefect/server/ui-v2/assets/{utilities-D5-00wjP.js → utilities-DqaYuzh1.js} +2 -2
- prefect/server/ui-v2/assets/{utilities-D5-00wjP.js.map → utilities-DqaYuzh1.js.map} +1 -1
- prefect/server/ui-v2/assets/{vendor-date-7GxEwcQM.js → vendor-date-JS-ReHrg.js} +2 -2
- prefect/server/ui-v2/assets/{vendor-date-7GxEwcQM.js.map → vendor-date-JS-ReHrg.js.map} +1 -1
- prefect/server/ui-v2/assets/{vendor-graphs-R8z6S3Jg.js → vendor-graphs-BRVnayIy.js} +2 -2
- prefect/server/ui-v2/assets/{vendor-graphs-R8z6S3Jg.js.map → vendor-graphs-BRVnayIy.js.map} +1 -1
- prefect/server/ui-v2/assets/{vendor-radix-CznP1SOq.js → vendor-radix-BZJHvSaq.js} +9 -9
- prefect/server/ui-v2/assets/{vendor-radix-CznP1SOq.js.map → vendor-radix-BZJHvSaq.js.map} +1 -1
- prefect/server/ui-v2/assets/{work-pool-filter-D8MkTbSW.js → work-pool-filter-T6dM4jKE.js} +2 -2
- prefect/server/ui-v2/assets/{work-pool-filter-D8MkTbSW.js.map → work-pool-filter-T6dM4jKE.js.map} +1 -1
- prefect/server/ui-v2/assets/{work-pool-queue-toggle-CbI7Gfu5.js → work-pool-queue-toggle-CdUw2mAH.js} +2 -2
- prefect/server/ui-v2/assets/{work-pool-queue-toggle-CbI7Gfu5.js.map → work-pool-queue-toggle-CdUw2mAH.js.map} +1 -1
- prefect/server/ui-v2/assets/{work-pool._workPoolName-CCzzgVV2.js → work-pool._workPoolName-DD8gh9X-.js} +2 -2
- prefect/server/ui-v2/assets/{work-pool._workPoolName-CCzzgVV2.js.map → work-pool._workPoolName-DD8gh9X-.js.map} +1 -1
- prefect/server/ui-v2/assets/{work-pool_._workPoolName.edit-BAgiuU_j.js → work-pool_._workPoolName.edit-mmnZTSTy.js} +2 -2
- prefect/server/ui-v2/assets/{work-pool_._workPoolName.edit-BAgiuU_j.js.map → work-pool_._workPoolName.edit-mmnZTSTy.js.map} +1 -1
- prefect/server/ui-v2/assets/{work-pool_._workPoolName.queue._workQueueName-BUawWJEy.js → work-pool_._workPoolName.queue._workQueueName-fbwQqkVN.js} +2 -2
- prefect/server/ui-v2/assets/{work-pool_._workPoolName.queue._workQueueName-BUawWJEy.js.map → work-pool_._workPoolName.queue._workQueueName-fbwQqkVN.js.map} +1 -1
- prefect/server/ui-v2/assets/{work-queue-icon-text-D_G_UCJX.js → work-queue-icon-text-YyKOH96e.js} +2 -2
- prefect/server/ui-v2/assets/{work-queue-icon-text-D_G_UCJX.js.map → work-queue-icon-text-YyKOH96e.js.map} +1 -1
- prefect/server/ui-v2/index.html +3 -3
- prefect/settings/models/runner.py +11 -0
- prefect/tasks.py +30 -4
- {prefect-3.6.14.dev1.dist-info → prefect-3.6.14.dev2.dist-info}/METADATA +1 -1
- {prefect-3.6.14.dev1.dist-info → prefect-3.6.14.dev2.dist-info}/RECORD +215 -215
- prefect/server/ui-v2/assets/cronstrue-WDy4rv2V.js +0 -2
- prefect/server/ui-v2/assets/cronstrue-WDy4rv2V.js.map +0 -1
- prefect/server/ui-v2/assets/deployment_._id.duplicate-C_kNyCA9.js +0 -2
- prefect/server/ui-v2/assets/deployment_._id.edit-BP8pfTOR.js +0 -2
- prefect/server/ui-v2/assets/flow-run-graph-B1vF1w0Z.js +0 -2
- prefect/server/ui-v2/assets/flow-run-graph-B1vF1w0Z.js.map +0 -1
- prefect/server/ui-v2/assets/flow-run._id-BHY61H6u.js +0 -4
- prefect/server/ui-v2/assets/flow-run._id-BHY61H6u.js.map +0 -1
- prefect/server/ui-v2/assets/index-BYQ1P2TC.js +0 -2
- prefect/server/ui-v2/assets/index-Cd7pM9pk.js +0 -17
- prefect/server/ui-v2/assets/index-Cd7pM9pk.js.map +0 -1
- prefect/server/ui-v2/assets/index-DvKYj8ko.js +0 -2
- prefect/server/ui-v2/assets/index-DvKYj8ko.js.map +0 -1
- {prefect-3.6.14.dev1.dist-info → prefect-3.6.14.dev2.dist-info}/WHEEL +0 -0
- {prefect-3.6.14.dev1.dist-info → prefect-3.6.14.dev2.dist-info}/entry_points.txt +0 -0
- {prefect-3.6.14.dev1.dist-info → prefect-3.6.14.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 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-
|
|
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-Yzhlw6-Q.js";import{D as me}from"./data-table-B6bdz5Zj.js";import{T as pe}from"./tags-input-1KkWhGJZ.js";import{D as ge,a as fe,b as he,c as xe,d as R,e as we}from"./dropdown-menu-BYgkpoqb.js";import{Y as ye}from"./vendor-date-JS-ReHrg.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-BZJHvSaq.js";import"./vendor-recharts-D4imLXNl.js";import"./table-BJkw82b1.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-D-ZIgaBw.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-DB2qeheX.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,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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-D-ZIgaBw.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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,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,2 +1,2 @@
|
|
|
1
|
-
import{j as s,L as r,p as n}from"./vendor-tanstack-BK8oseNA.js";import{E as l,t as m,v as c,w as d,x,q as p,I as u,D as j,br as g,al as h,C as f,B as A,g as y,h as b,bs as D}from"./index-
|
|
2
|
-
//# sourceMappingURL=index-
|
|
1
|
+
import{j as s,L as r,p as n}from"./vendor-tanstack-BK8oseNA.js";import{E as l,t as m,v as c,w as d,x,q as p,I as u,D as j,br as g,al as h,C as f,B as A,g as y,h as b,bs as D}from"./index-Yzhlw6-Q.js";import{D as N}from"./delete-confirmation-dialog-CV8ITEEW.js";import{u as v,A as S,a as E,b as B,c as C,d as L}from"./use-delete-automation-confirmation-dialog-Da1iWNZ_.js";import{A as k}from"./automations-header-BEZXZmli.js";import"./vendor-react-Bce9NwRC.js";import"./vendor-radix-BZJHvSaq.js";import"./vendor-recharts-D4imLXNl.js";import"./vendor-forms-DxqqmhL5.js";import"./vendor-date-JS-ReHrg.js";import"./work-queue-icon-text-YyKOH96e.js";import"./index-P2xc38Yh.js";import"./dropdown-menu-BYgkpoqb.js";import"./use-delete-confirmation-dialog-CvQEyyhU.js";const I=()=>s.jsxs(l,{children:[s.jsx(m,{id:"Bot"}),s.jsx(c,{children:"Create an automation to get started"}),s.jsx(d,{children:"Automations bring reactivity to your data stack and let you configure triggers and actions based on events."}),s.jsxs(x,{children:[s.jsx(r,{to:"/automations/create",children:s.jsxs(p,{children:["Add Automation ",s.jsx(u,{id:"Plus",className:"size-4 ml-2"})]})}),s.jsx(j,{id:"automations-guide"})]})]}),T=()=>{const[e,i]=v(),{data:a}=n(g()),o=t=>i(t);return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex flex-col gap-4",children:[s.jsx(k,{}),a.length===0?s.jsx(I,{}):s.jsxs("div",{className:"flex flex-col gap-4",children:[s.jsxs(h,{variant:"bodySmall",className:"text-muted-foreground",children:[a.length," ",`${a.length===1?"automation":"automations"}`]}),s.jsx("ul",{className:"flex flex-col gap-2",children:a.map(t=>s.jsx("li",{"aria-label":`automation item ${t.name}`,children:s.jsx($,{automation:t,onDelete:()=>o(t)})},t.id))})]})]}),s.jsx(N,{...e})]})},$=({automation:e,onDelete:i})=>s.jsxs(f,{className:"p-4 pt-5 flex flex-col gap-6",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(w,{automation:e}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(S,{automation:e}),s.jsx(E,{id:e.id,onDelete:i})]})]}),s.jsxs("div",{className:"flex flex-col gap-4",children:[e.description&&s.jsx(B,{automation:e}),s.jsx(C,{automation:e}),s.jsx(L,{automation:e})]})]}),w=({automation:e})=>s.jsx(A,{children:s.jsx(y,{children:s.jsx(b,{className:"text-xl",children:s.jsx(D,{to:"/automations/automation/$id",params:{id:e.id},className:"text-lg",children:e.name})})})}),W=T;export{W as component};
|
|
2
|
+
//# sourceMappingURL=index-D10Svo9k.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-
|
|
1
|
+
{"version":3,"file":"index-D10Svo9k.js","sources":["../../src/components/automations/automations-empty-state/automations-empty-state.tsx","../../src/components/automations/automations-page.tsx","../../src/routes/automations/index.tsx?tsr-split=component"],"sourcesContent":["import { Link } from \"@tanstack/react-router\";\nimport { Button } from \"@/components/ui/button\";\nimport { DocsLink } from \"@/components/ui/docs-link\";\nimport {\n\tEmptyState,\n\tEmptyStateActions,\n\tEmptyStateDescription,\n\tEmptyStateIcon,\n\tEmptyStateTitle,\n} from \"@/components/ui/empty-state\";\nimport { Icon } from \"@/components/ui/icons\";\n\nexport const AutomationsEmptyState = () => {\n\treturn (\n\t\t<EmptyState>\n\t\t\t<EmptyStateIcon id=\"Bot\" />\n\t\t\t<EmptyStateTitle>Create an automation to get started</EmptyStateTitle>\n\t\t\t<EmptyStateDescription>\n\t\t\t\tAutomations bring reactivity to your data stack and let you configure\n\t\t\t\ttriggers and actions based on events.\n\t\t\t</EmptyStateDescription>\n\t\t\t<EmptyStateActions>\n\t\t\t\t<Link to=\"/automations/create\">\n\t\t\t\t\t<Button>\n\t\t\t\t\t\tAdd Automation <Icon id=\"Plus\" className=\"size-4 ml-2\" />\n\t\t\t\t\t</Button>\n\t\t\t\t</Link>\n\t\t\t\t<DocsLink id=\"automations-guide\" />\n\t\t\t</EmptyStateActions>\n\t\t</EmptyState>\n\t);\n};\n","import { useSuspenseQuery } from \"@tanstack/react-query\";\nimport { type Automation, buildListAutomationsQuery } from \"@/api/automations\";\nimport {\n\tBreadcrumb,\n\tBreadcrumbItem,\n\tBreadcrumbLink,\n\tBreadcrumbList,\n} from \"@/components/ui/breadcrumb\";\nimport { Card } from \"@/components/ui/card\";\nimport { DeleteConfirmationDialog } from \"@/components/ui/delete-confirmation-dialog\";\nimport { Typography } from \"../ui/typography\";\nimport {\n\tAutomationActions,\n\tAutomationDescription,\n\tAutomationTrigger,\n} from \"./automation-details\";\nimport { AutomationEnableToggle } from \"./automation-enable-toggle\";\nimport { AutomationsActionsMenu } from \"./automations-actions-menu\";\nimport { AutomationsEmptyState } from \"./automations-empty-state\";\nimport { AutomationsHeader } from \"./automations-header\";\nimport { useDeleteAutomationConfirmationDialog } from \"./use-delete-automation-confirmation-dialog\";\n\nexport const AutomationsPage = () => {\n\tconst [dialogState, confirmDelete] = useDeleteAutomationConfirmationDialog();\n\tconst { data } = useSuspenseQuery(buildListAutomationsQuery());\n\n\tconst handleDelete = (automation: Automation) => confirmDelete(automation);\n\n\treturn (\n\t\t<>\n\t\t\t<div className=\"flex flex-col gap-4\">\n\t\t\t\t<AutomationsHeader />\n\t\t\t\t{data.length === 0 ? (\n\t\t\t\t\t<AutomationsEmptyState />\n\t\t\t\t) : (\n\t\t\t\t\t<div className=\"flex flex-col gap-4\">\n\t\t\t\t\t\t<Typography variant=\"bodySmall\" className=\"text-muted-foreground\">\n\t\t\t\t\t\t\t{data.length}{\" \"}\n\t\t\t\t\t\t\t{`${data.length === 1 ? \"automation\" : \"automations\"}`}\n\t\t\t\t\t\t</Typography>\n\t\t\t\t\t\t<ul className=\"flex flex-col gap-2\">\n\t\t\t\t\t\t\t{data.map((automation) => (\n\t\t\t\t\t\t\t\t<li\n\t\t\t\t\t\t\t\t\tkey={automation.id}\n\t\t\t\t\t\t\t\t\taria-label={`automation item ${automation.name}`}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<AutomationCardDetails\n\t\t\t\t\t\t\t\t\t\tautomation={automation}\n\t\t\t\t\t\t\t\t\t\tonDelete={() => handleDelete(automation)}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t\t<DeleteConfirmationDialog {...dialogState} />\n\t\t</>\n\t);\n};\n\ntype AutomationCardDetailsProps = {\n\tautomation: Automation;\n\tonDelete: () => void;\n};\nconst AutomationCardDetails = ({\n\tautomation,\n\tonDelete,\n}: AutomationCardDetailsProps) => {\n\treturn (\n\t\t<Card className=\"p-4 pt-5 flex flex-col gap-6\">\n\t\t\t<div className=\"flex items-center justify-between\">\n\t\t\t\t<NavHeader automation={automation} />\n\t\t\t\t<div className=\"flex items-center gap-2\">\n\t\t\t\t\t<AutomationEnableToggle automation={automation} />\n\t\t\t\t\t<AutomationsActionsMenu id={automation.id} onDelete={onDelete} />\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div className=\"flex flex-col gap-4\">\n\t\t\t\t{automation.description && (\n\t\t\t\t\t<AutomationDescription automation={automation} />\n\t\t\t\t)}\n\t\t\t\t<AutomationTrigger automation={automation} />\n\t\t\t\t<AutomationActions automation={automation} />\n\t\t\t</div>\n\t\t</Card>\n\t);\n};\n\ntype NavHeaderProps = {\n\tautomation: Automation;\n};\n\nconst NavHeader = ({ automation }: NavHeaderProps) => {\n\treturn (\n\t\t<Breadcrumb>\n\t\t\t<BreadcrumbList>\n\t\t\t\t<BreadcrumbItem className=\"text-xl\">\n\t\t\t\t\t<BreadcrumbLink\n\t\t\t\t\t\tto=\"/automations/automation/$id\"\n\t\t\t\t\t\tparams={{ id: automation.id }}\n\t\t\t\t\t\tclassName=\"text-lg\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{automation.name}\n\t\t\t\t\t</BreadcrumbLink>\n\t\t\t\t</BreadcrumbItem>\n\t\t\t</BreadcrumbList>\n\t\t</Breadcrumb>\n\t);\n};\n","import type { ErrorComponentProps } from \"@tanstack/react-router\";\nimport { createFileRoute } from \"@tanstack/react-router\";\nimport { buildListAutomationsQuery } from \"@/api/automations\";\nimport { categorizeError } from \"@/api/error-utils\";\nimport { AutomationsHeader } from \"@/components/automations/automations-header\";\nimport { AutomationsPage } from \"@/components/automations/automations-page\";\nimport { RouteErrorState } from \"@/components/ui/route-error-state\";\n\nfunction AutomationsErrorComponent({ error, reset }: ErrorComponentProps) {\n\tconst serverError = categorizeError(error, \"Failed to load automations\");\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<AutomationsHeader />\n\t\t\t<RouteErrorState error={serverError} onRetry={reset} />\n\t\t</div>\n\t);\n}\n\n// nb: Currently there is no filtering or search params used on this page\nexport const Route = createFileRoute(\"/automations/\")({\n\tcomponent: AutomationsPage,\n\terrorComponent: AutomationsErrorComponent,\n\tloader: ({ context }) =>\n\t\tcontext.queryClient.ensureQueryData(buildListAutomationsQuery()),\n\twrapInSuspense: true,\n});\n"],"names":["AutomationsEmptyState","EmptyState","jsx","EmptyStateIcon","EmptyStateTitle","EmptyStateDescription","EmptyStateActions","Link","jsxs","Button","Icon","DocsLink","AutomationsPage","dialogState","confirmDelete","useDeleteAutomationConfirmationDialog","data","useSuspenseQuery","buildListAutomationsQuery","handleDelete","automation","Fragment","AutomationsHeader","Typography","AutomationCardDetails","DeleteConfirmationDialog","onDelete","Card","NavHeader","AutomationEnableToggle","AutomationsActionsMenu","AutomationDescription","AutomationTrigger","AutomationActions","Breadcrumb","BreadcrumbList","BreadcrumbItem","BreadcrumbLink","SplitComponent"],"mappings":"0vBAYO,MAAMA,EAAwB,WAElCC,EAAA,CACA,SAAA,CAAAC,EAAAA,IAACC,EAAA,CAAe,GAAG,KAAA,CAAM,EACzBD,EAAAA,IAACE,GAAgB,SAAA,qCAAA,CAAmC,EACpDF,EAAAA,IAACG,GAAsB,SAAA,6GAAA,CAGvB,SACCC,EAAA,CACA,SAAA,CAAAJ,MAACK,EAAA,CAAK,GAAG,sBACR,SAAAC,EAAAA,KAACC,EAAA,CAAO,SAAA,CAAA,kBACQP,EAAAA,IAACQ,EAAA,CAAK,GAAG,OAAO,UAAU,aAAA,CAAc,CAAA,CAAA,CACxD,CAAA,CACD,EACAR,EAAAA,IAACS,EAAA,CAAS,GAAG,mBAAA,CAAoB,CAAA,CAAA,CAClC,CAAA,EACD,ECPWC,EAAkB,I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EACD,EACAlB,EAAAA,KAAC,MAAA,CAAI,UAAU,sBACb,SAAA,CAAAY,EAAW,aACXlB,EAAAA,IAAC6B,EAAA,CAAsB,WAAAX,CAAA,CAAwB,EAEhDlB,MAAC8B,GAAkB,WAAAZ,EAAwB,EAC3ClB,MAAC+B,GAAkB,WAAAb,CAAA,CAAwB,CAAA,CAAA,CAC5C,CAAA,EACD,EAQIQ,EAAY,CAAC,CAAE,WAAAR,WAElBc,EAAA,CACA,SAAAhC,EAAAA,IAACiC,GACA,SAAAjC,EAAAA,IAACkC,EAAA,CAAe,UAAU,UACzB,SAAAlC,EAAAA,IAACmC,EAAA,CACA,GAAG,8BACH,OAAQ,CAAE,GAAIjB,EAAW,EAAA,EACzB,UAAU,UAET,SAAAA,EAAW,IAAA,CAAA,CACb,CACD,EACD,EACD,EC/EFkB,EAvBS1B"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{j as e,F as N,r as p,C as Q,G as W,D as X,B as Y,L as he}from"./vendor-tanstack-BK8oseNA.js";import{q as d,I as k,y as v,bf as Z,G as ee,O as se,E as ne,t as ae,v as re,w as te,x as ce,D as oe,B as _,g as V,h as E,bg as xe,_ as G,$ as M,a0 as F,a1 as I,p as C,a3 as O,bh as P,bi as je,a2 as ge,bj as ye,bk as pe,bl as be,aw as Ce,ax as ve,ay as $,az as U}from"./index-Cd7pM9pk.js";import{D as ie}from"./data-table-B_iyrrTm.js";import{D as fe,a as we,b as Le,c as Se,d as T}from"./dropdown-menu-iS8iJMpx.js";import{F as le,a as u,b as x,c as j,d as g,e as y}from"./form-rC8pxeRl.js";import{a as de}from"./zod-DgSl2Nua.js";import{c as ue,o as z,n as L,s as h,b as ke,f as S,e as De}from"./vendor-forms-DxqqmhL5.js";import{T as Re,a as Te,b as Ae}from"./task-run-concurrency-limits-reset-dialog-vJEkvqWp.js";import"./vendor-react-Bce9NwRC.js";import"./vendor-radix-CznP1SOq.js";import"./vendor-recharts-D4imLXNl.js";import"./vendor-date-7GxEwcQM.js";import"./table-CEPo6xb_.js";const Ne=({onEditRow:s,onDeleteRow:n,...a})=>{const r=i=>{navigator.clipboard.writeText(i),v.success("ID copied")},t=a.row.original;return e.jsxs(fe,{children:[e.jsx(we,{asChild:!0,children:e.jsxs(d,{variant:"outline",className:"size-8 p-0",children:[e.jsx("span",{className:"sr-only",children:"Open menu"}),e.jsx(k,{id:"MoreVertical",className:"size-4"})]})}),e.jsxs(Le,{align:"end",children:[e.jsx(Se,{children:"Actions"}),e.jsx(T,{onClick:()=>r(t.id),children:"Copy ID"}),e.jsx(T,{onClick:()=>n(t),children:"Delete"}),e.jsx(T,{onClick:()=>s(t),children:"Edit"})]})]})},_e=s=>{const{updateGlobalConcurrencyLimit:n}=Z(),a=(i,c)=>{n({id_or_name:c,active:i},{onSuccess:()=>{v.success("Concurrency limit updated")},onError:o=>{const l=o.message||"Unknown error while updating active field.";console.error(l)}})},r=s.getValue(),t=s.row.original.id;return e.jsx(ee,{"aria-label":"toggle active",checked:r,onCheckedChange:i=>a(i,t)})},B=N("/concurrency-limits/"),b=Y(),Ve=({onEditRow:s,onDeleteRow:n})=>[b.accessor("name",{header:"Name"}),b.accessor("limit",{header:"Limit"}),b.accessor("active_slots",{header:"Active Slots"}),b.accessor("slot_decay_per_second",{header:"Slots Decay Per Second"}),b.accessor("active",{header:"Active",cell:_e}),b.display({id:"actions",cell:a=>e.jsx("div",{className:"flex flex-row justify-end",children:e.jsx(Ne,{...a,onEditRow:s,onDeleteRow:n})})})],Ee=({data:s,onEditRow:n,onDeleteRow:a})=>{const r=B.useNavigate(),{search:t}=B.useSearch(),i=p.useDeferredValue(t??""),c=p.useMemo(()=>s.filter(o=>o.name.toLowerCase().includes(i.toLowerCase())),[s,i]);return e.jsx(Ge,{data:c,onDeleteRow:a,onEditRow:n,searchValue:t,onSearchChange:o=>{r({to:".",search:l=>({...l,search:o})})}})};function Ge({data:s,onDeleteRow:n,onEditRow:a,onSearchChange:r,searchValue:t}){const i=Q({data:s,columns:Ve({onDeleteRow:n,onEditRow:a}),getCoreRowModel:X(),getPaginationRowModel:W()});return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(se,{className:"max-w-72",placeholder:"Search global concurrency limit",value:t,onChange:c=>r(c.target.value)}),e.jsx(ie,{table:i})]})}const Me=({onAdd:s})=>e.jsxs(ne,{children:[e.jsx(ae,{id:"AlignVerticalJustifyStart"}),e.jsx(re,{children:"Add a concurrency limit"}),e.jsx(te,{children:"Global concurrency limits can be applied to flow runs, task runs and any operation where you want to control concurrency."}),e.jsxs(ce,{children:[e.jsxs(d,{onClick:s,children:["Add Concurrency Limit ",e.jsx(k,{id:"Plus",className:"size-4 ml-2"})]}),e.jsx(oe,{id:"global-concurrency-guide"})]})]}),Fe=({onAdd:s})=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(_,{children:e.jsx(V,{children:e.jsx(E,{className:"text-xl font-semibold",children:"Global Concurrency Limits"})})}),e.jsx(d,{onClick:s,size:"icon",className:"size-7",variant:"outline","aria-label":"add global concurrency limit",children:e.jsx(k,{id:"Plus",className:"size-4"})})]}),Ie=z({active:ke().default(!0),denied_slots:L().default(0).or(h()).pipe(S.number()),limit:L().default(0).or(h()).pipe(S.number()),name:h().min(2,{message:"Name must be at least 2 characters"}).default(""),slot_decay_per_second:L().default(0).or(h()).pipe(S.number()),active_slots:L().default(0).or(h()).pipe(S.number())}),A={active:!0,name:"",limit:0,slot_decay_per_second:0,denied_slots:0,active_slots:0},Oe=({limitToUpdate:s,onSubmit:n})=>{const{createGlobalConcurrencyLimit:a,status:r}=xe(),{updateGlobalConcurrencyLimit:t,status:i}=Z(),c=ue({resolver:de(Ie),defaultValues:A});return p.useEffect(()=>{if(s){const{active:l,name:D,limit:f,slot_decay_per_second:w,active_slots:me}=s;c.reset({active:l,name:D,limit:f,slot_decay_per_second:w,active_slots:me})}else c.reset(A)},[c,s]),{form:c,saveOrUpdate:l=>{const D=()=>{c.reset(A),n()};s?.id?t({id_or_name:s.id,...l},{onSuccess:()=>{v.success("Limit updated")},onError:f=>{const w=f.message||"Unknown error while updating limit.";c.setError("root",{message:w})},onSettled:D}):a(l,{onSuccess:()=>{v.success("Limit created")},onError:f=>{const w=f.message||"Unknown error while creating variable.";c.setError("root",{message:w})},onSettled:D})},isLoading:r==="pending"||i==="pending"}},H=({limitToUpdate:s,onOpenChange:n,onSubmit:a})=>{const{form:r,isLoading:t,saveOrUpdate:i}=Oe({limitToUpdate:s,onSubmit:a}),c=s?`Update ${s.name}`:"Add Concurrency Limit";return e.jsx(G,{open:!0,onOpenChange:n,children:e.jsxs(M,{"aria-describedby":void 0,children:[e.jsx(F,{children:e.jsx(I,{children:c})}),e.jsx(le,{...r,children:e.jsxs("form",{onSubmit:o=>{r.handleSubmit(i)(o)},className:"space-y-4",children:[e.jsx(u,{children:r.formState.errors.root?.message}),e.jsx(x,{control:r.control,name:"name",render:({field:o})=>e.jsxs(j,{children:[e.jsx(g,{children:"Name"}),e.jsx(y,{children:e.jsx(C,{type:"text",autoComplete:"off",...o})}),e.jsx(u,{})]})}),e.jsx(x,{control:r.control,name:"limit",render:({field:o})=>e.jsxs(j,{children:[e.jsx(g,{children:"Concurrency Limit"}),e.jsx(y,{children:e.jsx(C,{type:"number",...o})}),e.jsx(u,{})]})}),e.jsx(x,{control:r.control,name:"slot_decay_per_second",render:({field:o})=>e.jsxs(j,{children:[e.jsx(g,{children:"Slot Decay Per Second"}),e.jsx(y,{children:e.jsx(C,{type:"number",...o})}),e.jsx(u,{})]})}),s&&e.jsx(x,{control:r.control,name:"active_slots",render:({field:o})=>e.jsxs(j,{children:[e.jsx(g,{children:"Active Slots"}),e.jsx(y,{children:e.jsx(C,{type:"number",...o})}),e.jsx(u,{})]})}),e.jsx(x,{control:r.control,name:"active",render:({field:o})=>e.jsxs(j,{children:[e.jsx(g,{children:"Active"}),e.jsx(y,{children:e.jsx(ee,{className:"block",checked:o.value,onCheckedChange:o.onChange})}),e.jsx(u,{})]})}),e.jsxs(O,{children:[e.jsx(P,{asChild:!0,children:e.jsx(d,{variant:"outline",children:"Close"})}),e.jsx(d,{type:"submit",loading:t,children:s?"Update":"Save"})]})]})})]})})},Pe=({limit:s,onOpenChange:n,onDelete:a})=>{const{deleteGlobalConcurrencyLimit:r,isPending:t}=je(),i=c=>{r(c,{onSuccess:()=>{v.success("Concurrency limit deleted")},onError:o=>{const l=o.message||"Unknown error while deleting concurrency limit.";console.error(l)},onSettled:a})};return e.jsx(G,{open:!0,onOpenChange:n,children:e.jsxs(M,{children:[e.jsx(F,{children:e.jsx(I,{children:"Delete Concurrency Limit"})}),e.jsxs(ge,{children:["Are you sure you want to delete ",s.name]}),e.jsxs(O,{children:[e.jsx(P,{asChild:!0,children:e.jsx(d,{variant:"outline",children:"Close"})}),e.jsx(d,{variant:"destructive",onClick:()=>i(s.id),loading:t,children:"Delete"})]})]})})},ze=({openDialog:s,onCloseDialog:n,onOpenChange:a})=>{const{dialog:r,data:t}=s;switch(r){case"create":return e.jsx(H,{onOpenChange:a,onSubmit:n});case"delete":return e.jsx(Pe,{limit:t,onOpenChange:a,onDelete:n});case"edit":return e.jsx(H,{onOpenChange:a,limitToUpdate:t,onSubmit:n});default:return null}},$e=()=>{const[s,n]=p.useState({dialog:null,data:void 0}),{data:a}=ye(),r=()=>n({dialog:"create",data:void 0}),t=l=>n({dialog:"edit",data:l}),i=l=>n({dialog:"delete",data:l}),c=()=>n({dialog:null,data:void 0}),o=l=>{l||c()};return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(Fe,{onAdd:r}),a.length===0?e.jsx(Me,{onAdd:r}):e.jsx(Ee,{data:a,onEditRow:t,onDeleteRow:i}),e.jsx(ze,{openDialog:s,onCloseDialog:c,onOpenChange:o})]})},Ue=s=>{const a=s.getValue().length;return a===0?"None":a},Be=s=>{const n=s.getValue(),a=s.row.original.id;return e.jsx(he,{params:{id:a},to:"/concurrency-limits/concurrency-limit/$id",children:n})},q=N("/concurrency-limits/"),R=Y(),He=({onDeleteRow:s,onResetRow:n})=>[R.accessor("tag",{header:"Tag",cell:Be}),R.accessor("concurrency_limit",{header:"Slots"}),R.accessor("active_slots",{header:"Active Task Runs",cell:Ue}),R.display({id:"actions",cell:a=>{const r=a.row.original;return e.jsx("div",{className:"flex flex-row justify-end",children:e.jsx(Re,{id:r.id,onDelete:()=>s(r),onReset:()=>n(r)})})}})],qe=({data:s,onDeleteRow:n,onResetRow:a})=>{const r=q.useNavigate(),{search:t}=q.useSearch(),i=p.useDeferredValue(t??""),c=p.useMemo(()=>s.filter(o=>o.tag.toLowerCase().includes(i.toLowerCase())),[s,i]);return e.jsx(Je,{data:c,onDeleteRow:n,onResetRow:a,searchValue:t,onSearchChange:o=>{r({to:".",search:l=>({...l,search:o})})}})};function Je({data:s,onDeleteRow:n,onResetRow:a,onSearchChange:r,searchValue:t}){const i=Q({data:s,columns:He({onDeleteRow:n,onResetRow:a}),getCoreRowModel:X(),getPaginationRowModel:W()});return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(se,{className:"max-w-72",placeholder:"Search active task limit",value:t,onChange:c=>r(c.target.value)}),e.jsx(ie,{table:i})]})}const Ke=({onAdd:s})=>e.jsxs(ne,{children:[e.jsx(ae,{id:"CircleArrowOutUpRight"}),e.jsx(re,{children:"Add a concurrency limit for your task runs"}),e.jsx(te,{children:"Creating a limit allows you to limit the number of tasks running simultaneously with a given tag."}),e.jsxs(ce,{children:[e.jsxs(d,{onClick:s,children:["Add Concurrency Limit ",e.jsx(k,{id:"Plus",className:"size-4 ml-2"})]}),e.jsx(oe,{id:"task-concurrency-guide"})]})]}),Qe=({onAdd:s})=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(_,{children:e.jsx(V,{children:e.jsx(E,{className:"text-xl font-semibold",children:"Task Run Concurrency Limits"})})}),e.jsx(d,{onClick:s,size:"icon",className:"size-7",variant:"outline","aria-label":"add task run concurrency limit",children:e.jsx(k,{id:"Plus",className:"size-4"})})]}),We=z({tag:h().min(1),concurrency_limit:L().default(0).or(h()).pipe(S.number())}),J={tag:"",concurrency_limit:0},Xe=({onOpenChange:s,onSubmit:n})=>{const{createTaskRunConcurrencyLimit:a,isPending:r}=pe(),t=ue({resolver:de(We),defaultValues:J}),i=c=>{a(c,{onSuccess:()=>{v.success("Concurrency limit added")},onError:o=>{const l=o.message||"Unknown error while updating limit.";t.setError("root",{message:l})},onSettled:()=>{t.reset(J),n()}})};return e.jsx(G,{open:!0,onOpenChange:s,children:e.jsxs(M,{"aria-describedby":void 0,children:[e.jsx(F,{children:e.jsx(I,{children:"Add Task Run Concurrency Limit"})}),e.jsx(le,{...t,children:e.jsxs("form",{onSubmit:c=>{t.handleSubmit(i)(c)},className:"space-y-4",children:[e.jsx(u,{children:t.formState.errors.root?.message}),e.jsx(x,{control:t.control,name:"tag",render:({field:c})=>e.jsxs(j,{children:[e.jsx(g,{children:"Tag"}),e.jsx(y,{children:e.jsx(C,{type:"text",autoComplete:"off",...c})}),e.jsx(u,{})]})}),e.jsx(x,{control:t.control,name:"concurrency_limit",render:({field:c})=>e.jsxs(j,{children:[e.jsx(g,{children:"Concurrency Limit"}),e.jsx(y,{children:e.jsx(C,{type:"number",...c})}),e.jsx(u,{})]})}),e.jsxs(O,{children:[e.jsx(P,{asChild:!0,children:e.jsx(d,{variant:"outline",children:"Close"})}),e.jsx(d,{type:"submit",loading:r,children:"Add"})]})]})})]})})},Ye=({openDialog:s,onCloseDialog:n,onOpenChange:a})=>{const{dialog:r,data:t}=s;switch(r){case"create":return e.jsx(Xe,{onOpenChange:a,onSubmit:n});case"reset":return e.jsx(Ae,{data:t,onOpenChange:a,onReset:n});case"delete":return e.jsx(Te,{data:t,onOpenChange:a,onDelete:n});default:return null}},Ze=()=>{const[s,n]=p.useState({dialog:null,data:void 0}),{data:a}=be(),r=()=>n({dialog:"create",data:void 0}),t=l=>n({dialog:"delete",data:l}),i=l=>n({dialog:"reset",data:l}),c=()=>n({dialog:null,data:void 0}),o=l=>{l||c()};return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(Qe,{onAdd:r}),a.length===0?e.jsx(Ke,{onAdd:r}):e.jsx(qe,{data:a,onDeleteRow:t,onResetRow:i}),e.jsx(Ye,{openDialog:s,onCloseDialog:c,onOpenChange:o})]})},K=N("/concurrency-limits/"),m={global:{tabSearchValue:"global",displayValue:"Global"},"task-run":{tabSearchValue:"task-run",displayValue:"Task Run"}},es=({globalView:s,taskRunView:n})=>{const{tab:a}=K.useSearch(),r=K.useNavigate();return e.jsxs(Ce,{defaultValue:"Global",value:a,children:[e.jsxs(ve,{children:[e.jsx($,{value:m.global.tabSearchValue,onClick:()=>{r({to:"/concurrency-limits",search:{tab:m.global.tabSearchValue}})},children:m.global.displayValue}),e.jsx($,{value:m["task-run"].tabSearchValue,onClick:()=>{r({to:"/concurrency-limits",search:{tab:m["task-run"].tabSearchValue}})},children:m["task-run"].displayValue})]}),e.jsx(U,{value:m.global.tabSearchValue,children:s}),e.jsx(U,{value:m["task-run"].tabSearchValue,children:n})]})},ss=()=>e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(ns,{}),e.jsx(es,{globalView:e.jsx($e,{}),taskRunView:e.jsx(Ze,{})})]}),ns=()=>e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(_,{children:e.jsx(V,{children:e.jsx(E,{className:"text-xl font-semibold",children:"Concurrency"})})})});z({search:h().optional(),tab:De(["global","task-run"]).default("global")});const gs=ss;export{gs as component};
|
|
2
|
-
//# sourceMappingURL=index-
|
|
1
|
+
import{j as e,F as N,r as p,C as Q,G as W,D as X,B as Y,L as he}from"./vendor-tanstack-BK8oseNA.js";import{q as d,I as k,y as v,bf as Z,G as ee,O as se,E as ne,t as ae,v as re,w as te,x as ce,D as oe,B as _,g as V,h as E,bg as xe,_ as G,$ as M,a0 as F,a1 as I,p as C,a3 as O,bh as P,bi as je,a2 as ge,bj as ye,bk as pe,bl as be,aw as Ce,ax as ve,ay as $,az as U}from"./index-Yzhlw6-Q.js";import{D as ie}from"./data-table-B6bdz5Zj.js";import{D as fe,a as we,b as Le,c as Se,d as T}from"./dropdown-menu-BYgkpoqb.js";import{F as le,a as u,b as x,c as j,d as g,e as y}from"./form-z_RaFdEo.js";import{a as de}from"./zod-DgSl2Nua.js";import{c as ue,o as z,n as L,s as h,b as ke,f as S,e as De}from"./vendor-forms-DxqqmhL5.js";import{T as Re,a as Te,b as Ae}from"./task-run-concurrency-limits-reset-dialog-ClBlDic_.js";import"./vendor-react-Bce9NwRC.js";import"./vendor-radix-BZJHvSaq.js";import"./vendor-recharts-D4imLXNl.js";import"./vendor-date-JS-ReHrg.js";import"./table-BJkw82b1.js";const Ne=({onEditRow:s,onDeleteRow:n,...a})=>{const r=i=>{navigator.clipboard.writeText(i),v.success("ID copied")},t=a.row.original;return e.jsxs(fe,{children:[e.jsx(we,{asChild:!0,children:e.jsxs(d,{variant:"outline",className:"size-8 p-0",children:[e.jsx("span",{className:"sr-only",children:"Open menu"}),e.jsx(k,{id:"MoreVertical",className:"size-4"})]})}),e.jsxs(Le,{align:"end",children:[e.jsx(Se,{children:"Actions"}),e.jsx(T,{onClick:()=>r(t.id),children:"Copy ID"}),e.jsx(T,{onClick:()=>n(t),children:"Delete"}),e.jsx(T,{onClick:()=>s(t),children:"Edit"})]})]})},_e=s=>{const{updateGlobalConcurrencyLimit:n}=Z(),a=(i,c)=>{n({id_or_name:c,active:i},{onSuccess:()=>{v.success("Concurrency limit updated")},onError:o=>{const l=o.message||"Unknown error while updating active field.";console.error(l)}})},r=s.getValue(),t=s.row.original.id;return e.jsx(ee,{"aria-label":"toggle active",checked:r,onCheckedChange:i=>a(i,t)})},B=N("/concurrency-limits/"),b=Y(),Ve=({onEditRow:s,onDeleteRow:n})=>[b.accessor("name",{header:"Name"}),b.accessor("limit",{header:"Limit"}),b.accessor("active_slots",{header:"Active Slots"}),b.accessor("slot_decay_per_second",{header:"Slots Decay Per Second"}),b.accessor("active",{header:"Active",cell:_e}),b.display({id:"actions",cell:a=>e.jsx("div",{className:"flex flex-row justify-end",children:e.jsx(Ne,{...a,onEditRow:s,onDeleteRow:n})})})],Ee=({data:s,onEditRow:n,onDeleteRow:a})=>{const r=B.useNavigate(),{search:t}=B.useSearch(),i=p.useDeferredValue(t??""),c=p.useMemo(()=>s.filter(o=>o.name.toLowerCase().includes(i.toLowerCase())),[s,i]);return e.jsx(Ge,{data:c,onDeleteRow:a,onEditRow:n,searchValue:t,onSearchChange:o=>{r({to:".",search:l=>({...l,search:o})})}})};function Ge({data:s,onDeleteRow:n,onEditRow:a,onSearchChange:r,searchValue:t}){const i=Q({data:s,columns:Ve({onDeleteRow:n,onEditRow:a}),getCoreRowModel:X(),getPaginationRowModel:W()});return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(se,{className:"max-w-72",placeholder:"Search global concurrency limit",value:t,onChange:c=>r(c.target.value)}),e.jsx(ie,{table:i})]})}const Me=({onAdd:s})=>e.jsxs(ne,{children:[e.jsx(ae,{id:"AlignVerticalJustifyStart"}),e.jsx(re,{children:"Add a concurrency limit"}),e.jsx(te,{children:"Global concurrency limits can be applied to flow runs, task runs and any operation where you want to control concurrency."}),e.jsxs(ce,{children:[e.jsxs(d,{onClick:s,children:["Add Concurrency Limit ",e.jsx(k,{id:"Plus",className:"size-4 ml-2"})]}),e.jsx(oe,{id:"global-concurrency-guide"})]})]}),Fe=({onAdd:s})=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(_,{children:e.jsx(V,{children:e.jsx(E,{className:"text-xl font-semibold",children:"Global Concurrency Limits"})})}),e.jsx(d,{onClick:s,size:"icon",className:"size-7",variant:"outline","aria-label":"add global concurrency limit",children:e.jsx(k,{id:"Plus",className:"size-4"})})]}),Ie=z({active:ke().default(!0),denied_slots:L().default(0).or(h()).pipe(S.number()),limit:L().default(0).or(h()).pipe(S.number()),name:h().min(2,{message:"Name must be at least 2 characters"}).default(""),slot_decay_per_second:L().default(0).or(h()).pipe(S.number()),active_slots:L().default(0).or(h()).pipe(S.number())}),A={active:!0,name:"",limit:0,slot_decay_per_second:0,denied_slots:0,active_slots:0},Oe=({limitToUpdate:s,onSubmit:n})=>{const{createGlobalConcurrencyLimit:a,status:r}=xe(),{updateGlobalConcurrencyLimit:t,status:i}=Z(),c=ue({resolver:de(Ie),defaultValues:A});return p.useEffect(()=>{if(s){const{active:l,name:D,limit:f,slot_decay_per_second:w,active_slots:me}=s;c.reset({active:l,name:D,limit:f,slot_decay_per_second:w,active_slots:me})}else c.reset(A)},[c,s]),{form:c,saveOrUpdate:l=>{const D=()=>{c.reset(A),n()};s?.id?t({id_or_name:s.id,...l},{onSuccess:()=>{v.success("Limit updated")},onError:f=>{const w=f.message||"Unknown error while updating limit.";c.setError("root",{message:w})},onSettled:D}):a(l,{onSuccess:()=>{v.success("Limit created")},onError:f=>{const w=f.message||"Unknown error while creating variable.";c.setError("root",{message:w})},onSettled:D})},isLoading:r==="pending"||i==="pending"}},H=({limitToUpdate:s,onOpenChange:n,onSubmit:a})=>{const{form:r,isLoading:t,saveOrUpdate:i}=Oe({limitToUpdate:s,onSubmit:a}),c=s?`Update ${s.name}`:"Add Concurrency Limit";return e.jsx(G,{open:!0,onOpenChange:n,children:e.jsxs(M,{"aria-describedby":void 0,children:[e.jsx(F,{children:e.jsx(I,{children:c})}),e.jsx(le,{...r,children:e.jsxs("form",{onSubmit:o=>{r.handleSubmit(i)(o)},className:"space-y-4",children:[e.jsx(u,{children:r.formState.errors.root?.message}),e.jsx(x,{control:r.control,name:"name",render:({field:o})=>e.jsxs(j,{children:[e.jsx(g,{children:"Name"}),e.jsx(y,{children:e.jsx(C,{type:"text",autoComplete:"off",...o})}),e.jsx(u,{})]})}),e.jsx(x,{control:r.control,name:"limit",render:({field:o})=>e.jsxs(j,{children:[e.jsx(g,{children:"Concurrency Limit"}),e.jsx(y,{children:e.jsx(C,{type:"number",...o})}),e.jsx(u,{})]})}),e.jsx(x,{control:r.control,name:"slot_decay_per_second",render:({field:o})=>e.jsxs(j,{children:[e.jsx(g,{children:"Slot Decay Per Second"}),e.jsx(y,{children:e.jsx(C,{type:"number",...o})}),e.jsx(u,{})]})}),s&&e.jsx(x,{control:r.control,name:"active_slots",render:({field:o})=>e.jsxs(j,{children:[e.jsx(g,{children:"Active Slots"}),e.jsx(y,{children:e.jsx(C,{type:"number",...o})}),e.jsx(u,{})]})}),e.jsx(x,{control:r.control,name:"active",render:({field:o})=>e.jsxs(j,{children:[e.jsx(g,{children:"Active"}),e.jsx(y,{children:e.jsx(ee,{className:"block",checked:o.value,onCheckedChange:o.onChange})}),e.jsx(u,{})]})}),e.jsxs(O,{children:[e.jsx(P,{asChild:!0,children:e.jsx(d,{variant:"outline",children:"Close"})}),e.jsx(d,{type:"submit",loading:t,children:s?"Update":"Save"})]})]})})]})})},Pe=({limit:s,onOpenChange:n,onDelete:a})=>{const{deleteGlobalConcurrencyLimit:r,isPending:t}=je(),i=c=>{r(c,{onSuccess:()=>{v.success("Concurrency limit deleted")},onError:o=>{const l=o.message||"Unknown error while deleting concurrency limit.";console.error(l)},onSettled:a})};return e.jsx(G,{open:!0,onOpenChange:n,children:e.jsxs(M,{children:[e.jsx(F,{children:e.jsx(I,{children:"Delete Concurrency Limit"})}),e.jsxs(ge,{children:["Are you sure you want to delete ",s.name]}),e.jsxs(O,{children:[e.jsx(P,{asChild:!0,children:e.jsx(d,{variant:"outline",children:"Close"})}),e.jsx(d,{variant:"destructive",onClick:()=>i(s.id),loading:t,children:"Delete"})]})]})})},ze=({openDialog:s,onCloseDialog:n,onOpenChange:a})=>{const{dialog:r,data:t}=s;switch(r){case"create":return e.jsx(H,{onOpenChange:a,onSubmit:n});case"delete":return e.jsx(Pe,{limit:t,onOpenChange:a,onDelete:n});case"edit":return e.jsx(H,{onOpenChange:a,limitToUpdate:t,onSubmit:n});default:return null}},$e=()=>{const[s,n]=p.useState({dialog:null,data:void 0}),{data:a}=ye(),r=()=>n({dialog:"create",data:void 0}),t=l=>n({dialog:"edit",data:l}),i=l=>n({dialog:"delete",data:l}),c=()=>n({dialog:null,data:void 0}),o=l=>{l||c()};return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(Fe,{onAdd:r}),a.length===0?e.jsx(Me,{onAdd:r}):e.jsx(Ee,{data:a,onEditRow:t,onDeleteRow:i}),e.jsx(ze,{openDialog:s,onCloseDialog:c,onOpenChange:o})]})},Ue=s=>{const a=s.getValue().length;return a===0?"None":a},Be=s=>{const n=s.getValue(),a=s.row.original.id;return e.jsx(he,{params:{id:a},to:"/concurrency-limits/concurrency-limit/$id",children:n})},q=N("/concurrency-limits/"),R=Y(),He=({onDeleteRow:s,onResetRow:n})=>[R.accessor("tag",{header:"Tag",cell:Be}),R.accessor("concurrency_limit",{header:"Slots"}),R.accessor("active_slots",{header:"Active Task Runs",cell:Ue}),R.display({id:"actions",cell:a=>{const r=a.row.original;return e.jsx("div",{className:"flex flex-row justify-end",children:e.jsx(Re,{id:r.id,onDelete:()=>s(r),onReset:()=>n(r)})})}})],qe=({data:s,onDeleteRow:n,onResetRow:a})=>{const r=q.useNavigate(),{search:t}=q.useSearch(),i=p.useDeferredValue(t??""),c=p.useMemo(()=>s.filter(o=>o.tag.toLowerCase().includes(i.toLowerCase())),[s,i]);return e.jsx(Je,{data:c,onDeleteRow:n,onResetRow:a,searchValue:t,onSearchChange:o=>{r({to:".",search:l=>({...l,search:o})})}})};function Je({data:s,onDeleteRow:n,onResetRow:a,onSearchChange:r,searchValue:t}){const i=Q({data:s,columns:He({onDeleteRow:n,onResetRow:a}),getCoreRowModel:X(),getPaginationRowModel:W()});return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(se,{className:"max-w-72",placeholder:"Search active task limit",value:t,onChange:c=>r(c.target.value)}),e.jsx(ie,{table:i})]})}const Ke=({onAdd:s})=>e.jsxs(ne,{children:[e.jsx(ae,{id:"CircleArrowOutUpRight"}),e.jsx(re,{children:"Add a concurrency limit for your task runs"}),e.jsx(te,{children:"Creating a limit allows you to limit the number of tasks running simultaneously with a given tag."}),e.jsxs(ce,{children:[e.jsxs(d,{onClick:s,children:["Add Concurrency Limit ",e.jsx(k,{id:"Plus",className:"size-4 ml-2"})]}),e.jsx(oe,{id:"task-concurrency-guide"})]})]}),Qe=({onAdd:s})=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(_,{children:e.jsx(V,{children:e.jsx(E,{className:"text-xl font-semibold",children:"Task Run Concurrency Limits"})})}),e.jsx(d,{onClick:s,size:"icon",className:"size-7",variant:"outline","aria-label":"add task run concurrency limit",children:e.jsx(k,{id:"Plus",className:"size-4"})})]}),We=z({tag:h().min(1),concurrency_limit:L().default(0).or(h()).pipe(S.number())}),J={tag:"",concurrency_limit:0},Xe=({onOpenChange:s,onSubmit:n})=>{const{createTaskRunConcurrencyLimit:a,isPending:r}=pe(),t=ue({resolver:de(We),defaultValues:J}),i=c=>{a(c,{onSuccess:()=>{v.success("Concurrency limit added")},onError:o=>{const l=o.message||"Unknown error while updating limit.";t.setError("root",{message:l})},onSettled:()=>{t.reset(J),n()}})};return e.jsx(G,{open:!0,onOpenChange:s,children:e.jsxs(M,{"aria-describedby":void 0,children:[e.jsx(F,{children:e.jsx(I,{children:"Add Task Run Concurrency Limit"})}),e.jsx(le,{...t,children:e.jsxs("form",{onSubmit:c=>{t.handleSubmit(i)(c)},className:"space-y-4",children:[e.jsx(u,{children:t.formState.errors.root?.message}),e.jsx(x,{control:t.control,name:"tag",render:({field:c})=>e.jsxs(j,{children:[e.jsx(g,{children:"Tag"}),e.jsx(y,{children:e.jsx(C,{type:"text",autoComplete:"off",...c})}),e.jsx(u,{})]})}),e.jsx(x,{control:t.control,name:"concurrency_limit",render:({field:c})=>e.jsxs(j,{children:[e.jsx(g,{children:"Concurrency Limit"}),e.jsx(y,{children:e.jsx(C,{type:"number",...c})}),e.jsx(u,{})]})}),e.jsxs(O,{children:[e.jsx(P,{asChild:!0,children:e.jsx(d,{variant:"outline",children:"Close"})}),e.jsx(d,{type:"submit",loading:r,children:"Add"})]})]})})]})})},Ye=({openDialog:s,onCloseDialog:n,onOpenChange:a})=>{const{dialog:r,data:t}=s;switch(r){case"create":return e.jsx(Xe,{onOpenChange:a,onSubmit:n});case"reset":return e.jsx(Ae,{data:t,onOpenChange:a,onReset:n});case"delete":return e.jsx(Te,{data:t,onOpenChange:a,onDelete:n});default:return null}},Ze=()=>{const[s,n]=p.useState({dialog:null,data:void 0}),{data:a}=be(),r=()=>n({dialog:"create",data:void 0}),t=l=>n({dialog:"delete",data:l}),i=l=>n({dialog:"reset",data:l}),c=()=>n({dialog:null,data:void 0}),o=l=>{l||c()};return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(Qe,{onAdd:r}),a.length===0?e.jsx(Ke,{onAdd:r}):e.jsx(qe,{data:a,onDeleteRow:t,onResetRow:i}),e.jsx(Ye,{openDialog:s,onCloseDialog:c,onOpenChange:o})]})},K=N("/concurrency-limits/"),m={global:{tabSearchValue:"global",displayValue:"Global"},"task-run":{tabSearchValue:"task-run",displayValue:"Task Run"}},es=({globalView:s,taskRunView:n})=>{const{tab:a}=K.useSearch(),r=K.useNavigate();return e.jsxs(Ce,{defaultValue:"Global",value:a,children:[e.jsxs(ve,{children:[e.jsx($,{value:m.global.tabSearchValue,onClick:()=>{r({to:"/concurrency-limits",search:{tab:m.global.tabSearchValue}})},children:m.global.displayValue}),e.jsx($,{value:m["task-run"].tabSearchValue,onClick:()=>{r({to:"/concurrency-limits",search:{tab:m["task-run"].tabSearchValue}})},children:m["task-run"].displayValue})]}),e.jsx(U,{value:m.global.tabSearchValue,children:s}),e.jsx(U,{value:m["task-run"].tabSearchValue,children:n})]})},ss=()=>e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(ns,{}),e.jsx(es,{globalView:e.jsx($e,{}),taskRunView:e.jsx(Ze,{})})]}),ns=()=>e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(_,{children:e.jsx(V,{children:e.jsx(E,{className:"text-xl font-semibold",children:"Concurrency"})})})});z({search:h().optional(),tab:De(["global","task-run"]).default("global")});const gs=ss;export{gs as component};
|
|
2
|
+
//# sourceMappingURL=index-D2EEipYt.js.map
|