prefect 3.6.16.dev5__py3-none-any.whl → 3.6.16.dev7__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/cli/__init__.py +1 -0
- prefect/cli/cloud/asset.py +135 -0
- prefect/server/ui-v2/assets/artifact-card-BnPKAfkY.js +2 -0
- prefect/server/ui-v2/assets/artifact-card-BnPKAfkY.js.map +1 -0
- prefect/server/ui-v2/assets/artifact._id-vDOuIuta.js +2 -0
- prefect/server/ui-v2/assets/artifact._id-vDOuIuta.js.map +1 -0
- prefect/server/ui-v2/assets/automation-wizard-RlOhF90R.js +2 -0
- prefect/server/ui-v2/assets/automation-wizard-RlOhF90R.js.map +1 -0
- prefect/server/ui-v2/assets/automation._id-CEHa-X0X.js +2 -0
- prefect/server/ui-v2/assets/{automation._id-CMiura1b.js.map → automation._id-CEHa-X0X.js.map} +1 -1
- prefect/server/ui-v2/assets/{automation_._id.edit-Cbfcwa-K.js → automation_._id.edit-BRWAsELa.js} +2 -2
- prefect/server/ui-v2/assets/{automation_._id.edit-Cbfcwa-K.js.map → automation_._id.edit-BRWAsELa.js.map} +1 -1
- prefect/server/ui-v2/assets/{automations-header-BxPCOE-0.js → automations-header-Dr6v5dPp.js} +2 -2
- prefect/server/ui-v2/assets/{automations-header-BxPCOE-0.js.map → automations-header-Dr6v5dPp.js.map} +1 -1
- prefect/server/ui-v2/assets/base-job-template-form-section-C8_R96gO.js +2 -0
- prefect/server/ui-v2/assets/base-job-template-form-section-C8_R96gO.js.map +1 -0
- prefect/server/ui-v2/assets/block-type-details-tAkUWqs1.js +2 -0
- prefect/server/ui-v2/assets/block-type-details-tAkUWqs1.js.map +1 -0
- prefect/server/ui-v2/assets/block-type-logo-scnMsyY5.js +2 -0
- prefect/server/ui-v2/assets/{block-type-logo-DuvU7goV.js.map → block-type-logo-scnMsyY5.js.map} +1 -1
- prefect/server/ui-v2/assets/block._id-BY42cyjR.js +2 -0
- prefect/server/ui-v2/assets/block._id-BY42cyjR.js.map +1 -0
- prefect/server/ui-v2/assets/{block_._id.edit-C4SmoQ4y.js → block_._id.edit-n2jwU5yr.js} +2 -2
- prefect/server/ui-v2/assets/{block_._id.edit-C4SmoQ4y.js.map → block_._id.edit-n2jwU5yr.js.map} +1 -1
- prefect/server/ui-v2/assets/catalog-5_GoCKpb.js +2 -0
- prefect/server/ui-v2/assets/catalog-5_GoCKpb.js.map +1 -0
- prefect/server/ui-v2/assets/catalog_._slug-sZvt0fDy.js +2 -0
- prefect/server/ui-v2/assets/catalog_._slug-sZvt0fDy.js.map +1 -0
- prefect/server/ui-v2/assets/{catalog_._slug_.create-CgKL4TS2.js → catalog_._slug_.create-rboQmoyW.js} +2 -2
- prefect/server/ui-v2/assets/{catalog_._slug_.create-CgKL4TS2.js.map → catalog_._slug_.create-rboQmoyW.js.map} +1 -1
- prefect/server/ui-v2/assets/{collapsible-DZbPzSgr.js → collapsible-Lk7MRvBH.js} +2 -2
- prefect/server/ui-v2/assets/{collapsible-DZbPzSgr.js.map → collapsible-Lk7MRvBH.js.map} +1 -1
- prefect/server/ui-v2/assets/concurrency-limit._id-D5i9zZJh.js +2 -0
- prefect/server/ui-v2/assets/concurrency-limit._id-D5i9zZJh.js.map +1 -0
- prefect/server/ui-v2/assets/create-CtsA2QIl.js +2 -0
- prefect/server/ui-v2/assets/{create-BrNwbpVu.js.map → create-CtsA2QIl.js.map} +1 -1
- prefect/server/ui-v2/assets/{create-DWgkh2HT.js → create-DJPAEZ93.js} +2 -2
- prefect/server/ui-v2/assets/create-DJPAEZ93.js.map +1 -0
- prefect/server/ui-v2/assets/{data-table-QSHqmTar.js → data-table-bk-0xKWT.js} +2 -2
- prefect/server/ui-v2/assets/{data-table-QSHqmTar.js.map → data-table-bk-0xKWT.js.map} +1 -1
- prefect/server/ui-v2/assets/{delete-confirmation-dialog-dLycVNo4.js → delete-confirmation-dialog-BZg9EOfN.js} +2 -2
- prefect/server/ui-v2/assets/{delete-confirmation-dialog-dLycVNo4.js.map → delete-confirmation-dialog-BZg9EOfN.js.map} +1 -1
- prefect/server/ui-v2/assets/{deployment-action-header-CzvBTL6H.js → deployment-action-header-DwuMPgVg.js} +2 -2
- prefect/server/ui-v2/assets/{deployment-action-header-CzvBTL6H.js.map → deployment-action-header-DwuMPgVg.js.map} +1 -1
- prefect/server/ui-v2/assets/deployment-form-BpKkzEf2.js +3 -0
- prefect/server/ui-v2/assets/deployment-form-BpKkzEf2.js.map +1 -0
- prefect/server/ui-v2/assets/{deployment-links-CGjJpxJA.js → deployment-links-B67P-6Ph.js} +2 -2
- prefect/server/ui-v2/assets/{deployment-links-CGjJpxJA.js.map → deployment-links-B67P-6Ph.js.map} +1 -1
- prefect/server/ui-v2/assets/{deployment._id-DXrb6frJ.js → deployment._id-BVOBfMVf.js} +2 -2
- prefect/server/ui-v2/assets/deployment._id-BVOBfMVf.js.map +1 -0
- prefect/server/ui-v2/assets/deployment._id-KOMC9fpE.js +2 -0
- prefect/server/ui-v2/assets/deployment._id-KOMC9fpE.js.map +1 -0
- prefect/server/ui-v2/assets/deployment_._id.duplicate-BPk2SchT.js +2 -0
- prefect/server/ui-v2/assets/deployment_._id.duplicate-BPk2SchT.js.map +1 -0
- prefect/server/ui-v2/assets/deployment_._id.edit-Dv0M_huv.js +2 -0
- prefect/server/ui-v2/assets/deployment_._id.edit-Dv0M_huv.js.map +1 -0
- prefect/server/ui-v2/assets/deployment_._id.run-DFVA4Xhx.js +2 -0
- prefect/server/ui-v2/assets/{deployment_._id.run-CnacOmhY.js.map → deployment_._id.run-DFVA4Xhx.js.map} +1 -1
- prefect/server/ui-v2/assets/{dropdown-menu-B9LKPlz7.js → dropdown-menu-fRiq5bS-.js} +2 -2
- prefect/server/ui-v2/assets/{dropdown-menu-B9LKPlz7.js.map → dropdown-menu-fRiq5bS-.js.map} +1 -1
- prefect/server/ui-v2/assets/{event-resource-display-B42RIaiX.js → event-resource-display-C1ZAey-o.js} +2 -2
- prefect/server/ui-v2/assets/{event-resource-display-B42RIaiX.js.map → event-resource-display-C1ZAey-o.js.map} +1 -1
- prefect/server/ui-v2/assets/event._eventDate._eventId-CcbtP9Ag.js +2 -0
- prefect/server/ui-v2/assets/{event._eventDate._eventId-CKTuT_8S.js.map → event._eventDate._eventId-CcbtP9Ag.js.map} +1 -1
- prefect/server/ui-v2/assets/flow-run-graph-CycKStSg.js +2 -0
- prefect/server/ui-v2/assets/flow-run-graph-CycKStSg.js.map +1 -0
- prefect/server/ui-v2/assets/{flow-run._id-BKv9Meqc.js → flow-run._id-Dn9R_Tjy.js} +2 -2
- prefect/server/ui-v2/assets/flow-run._id-Dn9R_Tjy.js.map +1 -0
- prefect/server/ui-v2/assets/{flow-run._id-ZTkjj6bM.js → flow-run._id-Dwx7ojcj.js} +2 -2
- prefect/server/ui-v2/assets/flow-run._id-Dwx7ojcj.js.map +1 -0
- prefect/server/ui-v2/assets/flow-run._id-YzRd5jrC.js +4 -0
- prefect/server/ui-v2/assets/flow-run._id-YzRd5jrC.js.map +1 -0
- prefect/server/ui-v2/assets/flow-runs-pagination-DMLZFM1m.js +2 -0
- prefect/server/ui-v2/assets/flow-runs-pagination-DMLZFM1m.js.map +1 -0
- prefect/server/ui-v2/assets/flow._id-V6-Qhkwk.js +2 -0
- prefect/server/ui-v2/assets/flow._id-V6-Qhkwk.js.map +1 -0
- prefect/server/ui-v2/assets/{form-DOdmIC3A.js → form-Cl5Hk9bq.js} +2 -2
- prefect/server/ui-v2/assets/{form-DOdmIC3A.js.map → form-Cl5Hk9bq.js.map} +1 -1
- prefect/server/ui-v2/assets/{header-DcIuN5UN.js → header-BuI436ik.js} +2 -2
- prefect/server/ui-v2/assets/{header-DcIuN5UN.js.map → header-BuI436ik.js.map} +1 -1
- prefect/server/ui-v2/assets/{header-CnBwASd-.js → header-DcAQCxQl.js} +2 -2
- prefect/server/ui-v2/assets/{header-CnBwASd-.js.map → header-DcAQCxQl.js.map} +1 -1
- prefect/server/ui-v2/assets/{header-DxE-NzAK.js → header-qlcK4NLD.js} +2 -2
- prefect/server/ui-v2/assets/{header-DxE-NzAK.js.map → header-qlcK4NLD.js.map} +1 -1
- prefect/server/ui-v2/assets/index--Z69UYXV.js +2 -0
- prefect/server/ui-v2/assets/index--Z69UYXV.js.map +1 -0
- prefect/server/ui-v2/assets/{index-D0R9_LIL.js → index-BO4Qqsm8.js} +2 -2
- prefect/server/ui-v2/assets/index-BO4Qqsm8.js.map +1 -0
- prefect/server/ui-v2/assets/index-Bg45XS_V.js +2 -0
- prefect/server/ui-v2/assets/index-Bg45XS_V.js.map +1 -0
- prefect/server/ui-v2/assets/{index-BIBIJufF.js → index-BleYpDoN.js} +2 -2
- prefect/server/ui-v2/assets/index-BleYpDoN.js.map +1 -0
- prefect/server/ui-v2/assets/{index-DyOAqIOp.js → index-C63VUjOh.js} +2 -2
- prefect/server/ui-v2/assets/{index-DyOAqIOp.js.map → index-C63VUjOh.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-DfKXdmko.js → index-C6LgWyJb.js} +2 -2
- prefect/server/ui-v2/assets/index-C6LgWyJb.js.map +1 -0
- prefect/server/ui-v2/assets/index-CE-bVgqj.js +2 -0
- prefect/server/ui-v2/assets/{index-DlAHvqFx.js.map → index-CE-bVgqj.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-V_xTKaEb.js → index-CPpeVt8m.js} +13 -13
- prefect/server/ui-v2/assets/index-CPpeVt8m.js.map +1 -0
- prefect/server/ui-v2/assets/index-CYaUe0Ym.js +2 -0
- prefect/server/ui-v2/assets/index-CYaUe0Ym.js.map +1 -0
- prefect/server/ui-v2/assets/{index-C5RMFRyZ.js → index-Clbms0kg.js} +2 -2
- prefect/server/ui-v2/assets/index-Clbms0kg.js.map +1 -0
- prefect/server/ui-v2/assets/index-D13YFoYA.js +2 -0
- prefect/server/ui-v2/assets/index-D13YFoYA.js.map +1 -0
- prefect/server/ui-v2/assets/{index-Cx1qEoCK.js → index-D73a_nGu.js} +2 -2
- prefect/server/ui-v2/assets/{index-Cx1qEoCK.js.map → index-D73a_nGu.js.map} +1 -1
- prefect/server/ui-v2/assets/index-DJXBzX1E.css +1 -0
- prefect/server/ui-v2/assets/{index-BO60ehN6.js → index-DPPPaOr_.js} +2 -2
- prefect/server/ui-v2/assets/index-DPPPaOr_.js.map +1 -0
- prefect/server/ui-v2/assets/{index-DP8W-xJo.js → index-DU9ShbqW.js} +2 -2
- prefect/server/ui-v2/assets/index-DU9ShbqW.js.map +1 -0
- prefect/server/ui-v2/assets/index-DdR1lzZk.js +2 -0
- prefect/server/ui-v2/assets/index-DdR1lzZk.js.map +1 -0
- prefect/server/ui-v2/assets/{index-B9ttjsyu.js → index-ELo08q04.js} +2 -2
- prefect/server/ui-v2/assets/{index-B9ttjsyu.js.map → index-ELo08q04.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-BTL1xHS9.js → index-cp6PTdHp.js} +2 -2
- prefect/server/ui-v2/assets/{index-BTL1xHS9.js.map → index-cp6PTdHp.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-D6G96ToY.js → index-kM_g8J0u.js} +2 -2
- prefect/server/ui-v2/assets/{index-D6G96ToY.js.map → index-kM_g8J0u.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-q5Y3hlDT.js → index-mYcm9Rkr.js} +2 -2
- prefect/server/ui-v2/assets/index-mYcm9Rkr.js.map +1 -0
- prefect/server/ui-v2/assets/{index-D9cOtoSU.js → index-yavn_NBp.js} +2 -2
- prefect/server/ui-v2/assets/index-yavn_NBp.js.map +1 -0
- prefect/server/ui-v2/assets/{json-input-YKJMJCcT.js → json-input-iUzf6BvZ.js} +2 -2
- prefect/server/ui-v2/assets/{json-input-YKJMJCcT.js.map → json-input-iUzf6BvZ.js.map} +1 -1
- prefect/server/ui-v2/assets/{key-value-RPUUqQ6F.js → key-value-DI27Dv4P.js} +2 -2
- prefect/server/ui-v2/assets/{key-value-RPUUqQ6F.js.map → key-value-DI27Dv4P.js.map} +1 -1
- prefect/server/ui-v2/assets/key._key-C-nk2nld.js +2 -0
- prefect/server/ui-v2/assets/key._key-C-nk2nld.js.map +1 -0
- prefect/server/ui-v2/assets/{lazy-markdown-B9vEkJ0h.js → lazy-markdown-D_y73qoD.js} +2 -2
- prefect/server/ui-v2/assets/{lazy-markdown-B9vEkJ0h.js.map → lazy-markdown-D_y73qoD.js.map} +1 -1
- prefect/server/ui-v2/assets/{login-C3PhSGQJ.js → login-DR_xuMmg.js} +2 -2
- prefect/server/ui-v2/assets/{login-C3PhSGQJ.js.map → login-DR_xuMmg.js.map} +1 -1
- prefect/server/ui-v2/assets/{markdown-input-Dei7u1qp.js → markdown-input-hzlzpUdj.js} +2 -2
- prefect/server/ui-v2/assets/{markdown-input-Dei7u1qp.js.map → markdown-input-hzlzpUdj.js.map} +1 -1
- prefect/server/ui-v2/assets/{python-example-snippet-DvulFxgw.js → python-example-snippet-d8bTNJ0J.js} +3 -3
- prefect/server/ui-v2/assets/{python-example-snippet-DvulFxgw.js.map → python-example-snippet-d8bTNJ0J.js.map} +1 -1
- prefect/server/ui-v2/assets/{python-input-niCawr8m.js → python-input-Bxdnzvx3.js} +2 -2
- prefect/server/ui-v2/assets/{python-input-niCawr8m.js.map → python-input-Bxdnzvx3.js.map} +1 -1
- prefect/server/ui-v2/assets/{radio-group-D55TQZsk.js → radio-group-0oOEMJCS.js} +2 -2
- prefect/server/ui-v2/assets/{radio-group-D55TQZsk.js.map → radio-group-0oOEMJCS.js.map} +1 -1
- prefect/server/ui-v2/assets/{route-error-state-Cu4m0LTX.js → route-error-state-BqbnZCc-.js} +2 -2
- prefect/server/ui-v2/assets/{route-error-state-Cu4m0LTX.js.map → route-error-state-BqbnZCc-.js.map} +1 -1
- prefect/server/ui-v2/assets/{schema-form-BQAcWW5k.js → schema-form-BD-WM4S0.js} +2 -2
- prefect/server/ui-v2/assets/{schema-form-BQAcWW5k.js.map → schema-form-BD-WM4S0.js.map} +1 -1
- prefect/server/ui-v2/assets/{schema-form-input-string-format-datetime-Cb4sTJle.js → schema-form-input-string-format-datetime-Dg3zVAp5.js} +4 -4
- prefect/server/ui-v2/assets/{schema-form-input-string-format-datetime-Cb4sTJle.js.map → schema-form-input-string-format-datetime-Dg3zVAp5.js.map} +1 -1
- prefect/server/ui-v2/assets/{settings-DV4ewZ_4.js → settings-Dm6yMLix.js} +2 -2
- prefect/server/ui-v2/assets/{settings-DV4ewZ_4.js.map → settings-Dm6yMLix.js.map} +1 -1
- prefect/server/ui-v2/assets/{sort-filter-DY7vgl7C.js → sort-filter-X6JyRc0-.js} +2 -2
- prefect/server/ui-v2/assets/{sort-filter-DY7vgl7C.js.map → sort-filter-X6JyRc0-.js.map} +1 -1
- prefect/server/ui-v2/assets/{table-ChOwO4Pk.js → table-Xyel2BEw.js} +2 -2
- prefect/server/ui-v2/assets/{table-ChOwO4Pk.js.map → table-Xyel2BEw.js.map} +1 -1
- prefect/server/ui-v2/assets/{tags-input-2KSBvO_K.js → tags-input-DqZ8v99z.js} +2 -2
- prefect/server/ui-v2/assets/{tags-input-2KSBvO_K.js.map → tags-input-DqZ8v99z.js.map} +1 -1
- prefect/server/ui-v2/assets/{task-run-concurrency-limits-reset-dialog-CNrP9yPQ.js → task-run-concurrency-limits-reset-dialog-5xFWeoYy.js} +2 -2
- prefect/server/ui-v2/assets/{task-run-concurrency-limits-reset-dialog-CNrP9yPQ.js.map → task-run-concurrency-limits-reset-dialog-5xFWeoYy.js.map} +1 -1
- prefect/server/ui-v2/assets/{task-run._id-cqXH0PMU.js → task-run._id-9DcrUEGz.js} +3 -3
- prefect/server/ui-v2/assets/{task-run._id-cqXH0PMU.js.map → task-run._id-9DcrUEGz.js.map} +1 -1
- prefect/server/ui-v2/assets/{task-run._id-CQGeAiBh.js → task-run._id-DJkoLl_e.js} +2 -2
- prefect/server/ui-v2/assets/task-run._id-DJkoLl_e.js.map +1 -0
- prefect/server/ui-v2/assets/task-runs-pagination-B2fSdB1t.js +2 -0
- prefect/server/ui-v2/assets/task-runs-pagination-B2fSdB1t.js.map +1 -0
- prefect/server/ui-v2/assets/{textarea-9v5uTuxg.js → textarea-DFEOJJdc.js} +2 -2
- prefect/server/ui-v2/assets/{textarea-9v5uTuxg.js.map → textarea-DFEOJJdc.js.map} +1 -1
- prefect/server/ui-v2/assets/{timezone-select-DPtR_b06.js → timezone-select-NViFNNLz.js} +2 -2
- prefect/server/ui-v2/assets/{timezone-select-DPtR_b06.js.map → timezone-select-NViFNNLz.js.map} +1 -1
- prefect/server/ui-v2/assets/{toggle-group-CBJphTE6.js → toggle-group-EMgSOoYH.js} +2 -2
- prefect/server/ui-v2/assets/{toggle-group-CBJphTE6.js.map → toggle-group-EMgSOoYH.js.map} +1 -1
- prefect/server/ui-v2/assets/use-delete-automation-confirmation-dialog-BHgDXlwg.js +2 -0
- prefect/server/ui-v2/assets/use-delete-automation-confirmation-dialog-BHgDXlwg.js.map +1 -0
- prefect/server/ui-v2/assets/{use-delete-block-document-confirmation-dialog-BYY1b8yH.js → use-delete-block-document-confirmation-dialog-CxRkBKPg.js} +2 -2
- prefect/server/ui-v2/assets/{use-delete-block-document-confirmation-dialog-BYY1b8yH.js.map → use-delete-block-document-confirmation-dialog-CxRkBKPg.js.map} +1 -1
- prefect/server/ui-v2/assets/use-flow-runs-selected-rows-Ck8nwx2q.js +2 -0
- prefect/server/ui-v2/assets/use-flow-runs-selected-rows-Ck8nwx2q.js.map +1 -0
- prefect/server/ui-v2/assets/{use-get-artifacts-flow-task-runs-BOTU5FPq.js → use-get-artifacts-flow-task-runs-D7Djt53s.js} +2 -2
- prefect/server/ui-v2/assets/{use-get-artifacts-flow-task-runs-BOTU5FPq.js.map → use-get-artifacts-flow-task-runs-D7Djt53s.js.map} +1 -1
- prefect/server/ui-v2/assets/{use-quick-run-DzSmbSlu.js → use-quick-run-Cpy0t7dX.js} +2 -2
- prefect/server/ui-v2/assets/{use-quick-run-DzSmbSlu.js.map → use-quick-run-Cpy0t7dX.js.map} +1 -1
- prefect/server/ui-v2/assets/{use-state-favicon-UFxhmhHr.js → use-state-favicon-CMsL9s6j.js} +2 -2
- prefect/server/ui-v2/assets/{use-state-favicon-UFxhmhHr.js.map → use-state-favicon-CMsL9s6j.js.map} +1 -1
- prefect/server/ui-v2/assets/use-stepper-CZZEx5js.js +2 -0
- prefect/server/ui-v2/assets/use-stepper-CZZEx5js.js.map +1 -0
- prefect/server/ui-v2/assets/{utilities-2FfCfMAV.js → utilities-D9BfvLg5.js} +2 -2
- prefect/server/ui-v2/assets/{utilities-2FfCfMAV.js.map → utilities-D9BfvLg5.js.map} +1 -1
- prefect/server/ui-v2/assets/work-pool-filter-dsJ6xeK6.js +2 -0
- prefect/server/ui-v2/assets/work-pool-filter-dsJ6xeK6.js.map +1 -0
- prefect/server/ui-v2/assets/{work-pool-queue-toggle-zSWhEFap.js → work-pool-queue-toggle-f_-cTWxB.js} +2 -2
- prefect/server/ui-v2/assets/{work-pool-queue-toggle-zSWhEFap.js.map → work-pool-queue-toggle-f_-cTWxB.js.map} +1 -1
- prefect/server/ui-v2/assets/{work-pool._workPoolName-BwIVfCIe.js → work-pool._workPoolName-zBqgkYLT.js} +2 -2
- prefect/server/ui-v2/assets/{work-pool._workPoolName-BwIVfCIe.js.map → work-pool._workPoolName-zBqgkYLT.js.map} +1 -1
- prefect/server/ui-v2/assets/{work-pool_._workPoolName.edit-j7cjgoJp.js → work-pool_._workPoolName.edit-B-8_CnfA.js} +2 -2
- prefect/server/ui-v2/assets/{work-pool_._workPoolName.edit-j7cjgoJp.js.map → work-pool_._workPoolName.edit-B-8_CnfA.js.map} +1 -1
- prefect/server/ui-v2/assets/{work-pool_._workPoolName.queue._workQueueName-BlFjSdoB.js → work-pool_._workPoolName.queue._workQueueName-DzrY1tMq.js} +2 -2
- prefect/server/ui-v2/assets/work-pool_._workPoolName.queue._workQueueName-DzrY1tMq.js.map +1 -0
- prefect/server/ui-v2/assets/{work-queue-icon-text-vWlRNW-b.js → work-queue-icon-text-BqqQ413o.js} +2 -2
- prefect/server/ui-v2/assets/{work-queue-icon-text-vWlRNW-b.js.map → work-queue-icon-text-BqqQ413o.js.map} +1 -1
- prefect/server/ui-v2/index.html +2 -2
- prefect/task_engine.py +26 -12
- prefect/workers/base.py +18 -1
- {prefect-3.6.16.dev5.dist-info → prefect-3.6.16.dev7.dist-info}/METADATA +1 -1
- {prefect-3.6.16.dev5.dist-info → prefect-3.6.16.dev7.dist-info}/RECORD +208 -207
- prefect/server/ui-v2/assets/artifact-card-DQfjRA2u.js +0 -2
- prefect/server/ui-v2/assets/artifact-card-DQfjRA2u.js.map +0 -1
- prefect/server/ui-v2/assets/artifact._id-BBhuX3px.js +0 -2
- prefect/server/ui-v2/assets/artifact._id-BBhuX3px.js.map +0 -1
- prefect/server/ui-v2/assets/automation-wizard-DeT-tz5i.js +0 -2
- prefect/server/ui-v2/assets/automation-wizard-DeT-tz5i.js.map +0 -1
- prefect/server/ui-v2/assets/automation._id-CMiura1b.js +0 -2
- prefect/server/ui-v2/assets/base-job-template-form-section-MeO0M71Y.js +0 -2
- prefect/server/ui-v2/assets/base-job-template-form-section-MeO0M71Y.js.map +0 -1
- prefect/server/ui-v2/assets/block-type-details-Bcb9qEO8.js +0 -2
- prefect/server/ui-v2/assets/block-type-details-Bcb9qEO8.js.map +0 -1
- prefect/server/ui-v2/assets/block-type-logo-DuvU7goV.js +0 -2
- prefect/server/ui-v2/assets/block._id-DFR6zmOy.js +0 -2
- prefect/server/ui-v2/assets/block._id-DFR6zmOy.js.map +0 -1
- prefect/server/ui-v2/assets/catalog-CPzaK8QS.js +0 -2
- prefect/server/ui-v2/assets/catalog-CPzaK8QS.js.map +0 -1
- prefect/server/ui-v2/assets/catalog_._slug-60h4tERz.js +0 -2
- prefect/server/ui-v2/assets/catalog_._slug-60h4tERz.js.map +0 -1
- prefect/server/ui-v2/assets/concurrency-limit._id-BFfR6_U0.js +0 -2
- prefect/server/ui-v2/assets/concurrency-limit._id-BFfR6_U0.js.map +0 -1
- prefect/server/ui-v2/assets/create-BrNwbpVu.js +0 -2
- prefect/server/ui-v2/assets/create-DWgkh2HT.js.map +0 -1
- prefect/server/ui-v2/assets/deployment-form-B33C7F2u.js +0 -3
- prefect/server/ui-v2/assets/deployment-form-B33C7F2u.js.map +0 -1
- prefect/server/ui-v2/assets/deployment._id-5rPcPD0T.js +0 -2
- prefect/server/ui-v2/assets/deployment._id-5rPcPD0T.js.map +0 -1
- prefect/server/ui-v2/assets/deployment._id-DXrb6frJ.js.map +0 -1
- prefect/server/ui-v2/assets/deployment_._id.duplicate-D7YLydeq.js +0 -2
- prefect/server/ui-v2/assets/deployment_._id.duplicate-D7YLydeq.js.map +0 -1
- prefect/server/ui-v2/assets/deployment_._id.edit-Daq0J0Ow.js +0 -2
- prefect/server/ui-v2/assets/deployment_._id.edit-Daq0J0Ow.js.map +0 -1
- prefect/server/ui-v2/assets/deployment_._id.run-CnacOmhY.js +0 -2
- prefect/server/ui-v2/assets/event._eventDate._eventId-CKTuT_8S.js +0 -2
- prefect/server/ui-v2/assets/flow-run-graph-OrT2Osbu.js +0 -2
- prefect/server/ui-v2/assets/flow-run-graph-OrT2Osbu.js.map +0 -1
- prefect/server/ui-v2/assets/flow-run._id-BKv9Meqc.js.map +0 -1
- prefect/server/ui-v2/assets/flow-run._id-DCYAnq0D.js +0 -4
- prefect/server/ui-v2/assets/flow-run._id-DCYAnq0D.js.map +0 -1
- prefect/server/ui-v2/assets/flow-run._id-ZTkjj6bM.js.map +0 -1
- prefect/server/ui-v2/assets/flow-runs-pagination-CykMKOhv.js +0 -2
- prefect/server/ui-v2/assets/flow-runs-pagination-CykMKOhv.js.map +0 -1
- prefect/server/ui-v2/assets/flow._id-DhrxqQmD.js +0 -2
- prefect/server/ui-v2/assets/flow._id-DhrxqQmD.js.map +0 -1
- prefect/server/ui-v2/assets/index-BIBIJufF.js.map +0 -1
- prefect/server/ui-v2/assets/index-BO60ehN6.js.map +0 -1
- prefect/server/ui-v2/assets/index-BS7fbJ2s.js +0 -2
- prefect/server/ui-v2/assets/index-BS7fbJ2s.js.map +0 -1
- prefect/server/ui-v2/assets/index-C5RMFRyZ.js.map +0 -1
- prefect/server/ui-v2/assets/index-D0R9_LIL.js.map +0 -1
- prefect/server/ui-v2/assets/index-D9cOtoSU.js.map +0 -1
- prefect/server/ui-v2/assets/index-DEpWUeaO.js +0 -2
- prefect/server/ui-v2/assets/index-DEpWUeaO.js.map +0 -1
- prefect/server/ui-v2/assets/index-DP8W-xJo.js.map +0 -1
- prefect/server/ui-v2/assets/index-DfKXdmko.js.map +0 -1
- prefect/server/ui-v2/assets/index-DiVKp6rW.js +0 -2
- prefect/server/ui-v2/assets/index-DiVKp6rW.js.map +0 -1
- prefect/server/ui-v2/assets/index-DlAHvqFx.js +0 -2
- prefect/server/ui-v2/assets/index-VNFzALsC.js +0 -2
- prefect/server/ui-v2/assets/index-VNFzALsC.js.map +0 -1
- prefect/server/ui-v2/assets/index-V_xTKaEb.js.map +0 -1
- prefect/server/ui-v2/assets/index-WIq8QUNT.js +0 -2
- prefect/server/ui-v2/assets/index-WIq8QUNT.js.map +0 -1
- prefect/server/ui-v2/assets/index-m9O-nIOl.css +0 -1
- prefect/server/ui-v2/assets/index-q5Y3hlDT.js.map +0 -1
- prefect/server/ui-v2/assets/key._key-CX8FwfwL.js +0 -2
- prefect/server/ui-v2/assets/key._key-CX8FwfwL.js.map +0 -1
- prefect/server/ui-v2/assets/task-run._id-CQGeAiBh.js.map +0 -1
- prefect/server/ui-v2/assets/task-runs-pagination-CYoOghEN.js +0 -2
- prefect/server/ui-v2/assets/task-runs-pagination-CYoOghEN.js.map +0 -1
- prefect/server/ui-v2/assets/use-delete-automation-confirmation-dialog-DZplMJDW.js +0 -2
- prefect/server/ui-v2/assets/use-delete-automation-confirmation-dialog-DZplMJDW.js.map +0 -1
- prefect/server/ui-v2/assets/use-flow-runs-selected-rows-1YE-VIgM.js +0 -2
- prefect/server/ui-v2/assets/use-flow-runs-selected-rows-1YE-VIgM.js.map +0 -1
- prefect/server/ui-v2/assets/use-stepper-CnGJHRLP.js +0 -2
- prefect/server/ui-v2/assets/use-stepper-CnGJHRLP.js.map +0 -1
- prefect/server/ui-v2/assets/work-pool-filter-CGfXNujK.js +0 -2
- prefect/server/ui-v2/assets/work-pool-filter-CGfXNujK.js.map +0 -1
- prefect/server/ui-v2/assets/work-pool_._workPoolName.queue._workQueueName-BlFjSdoB.js.map +0 -1
- {prefect-3.6.16.dev5.dist-info → prefect-3.6.16.dev7.dist-info}/WHEEL +0 -0
- {prefect-3.6.16.dev5.dist-info → prefect-3.6.16.dev7.dist-info}/entry_points.txt +0 -0
- {prefect-3.6.16.dev5.dist-info → prefect-3.6.16.dev7.dist-info}/licenses/LICENSE +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"task-runs-pagination-CYoOghEN.js","sources":["../../src/components/task-runs/task-runs-list/task-run-sort-filter.tsx","../../src/components/task-runs/task-runs-list/task-runs-list-item.tsx","../../src/components/task-runs/task-runs-list/task-runs-list.tsx","../../src/components/task-runs/task-runs-list/task-runs-pagination.tsx"],"sourcesContent":["import {\n\tSelect,\n\tSelectContent,\n\tSelectItem,\n\tSelectTrigger,\n\tSelectValue,\n} from \"@/components/ui/select\";\nimport type { TaskRunSortFilters } from \"./task-run-sort-filter.constants\";\n\ntype TaskRunsSortFilterProps = {\n\tdefaultValue?: TaskRunSortFilters;\n\tonSelect: (filter: TaskRunSortFilters) => void;\n\tvalue: undefined | TaskRunSortFilters;\n};\n\nexport const TaskRunsSortFilter = ({\n\tdefaultValue,\n\tvalue,\n\tonSelect,\n}: TaskRunsSortFilterProps) => {\n\treturn (\n\t\t<Select defaultValue={defaultValue} value={value} onValueChange={onSelect}>\n\t\t\t<SelectTrigger aria-label=\"Task run sort order\" className=\"w-full\">\n\t\t\t\t<SelectValue placeholder=\"Sort by\" />\n\t\t\t</SelectTrigger>\n\t\t\t<SelectContent>\n\t\t\t\t<SelectItem value=\"EXPECTED_START_TIME_DESC\">\n\t\t\t\t\tNewest to oldest\n\t\t\t\t</SelectItem>\n\t\t\t\t<SelectItem value=\"EXPECTED_START_TIME_ASC\">\n\t\t\t\t\tOldest to newest\n\t\t\t\t</SelectItem>\n\t\t\t</SelectContent>\n\t\t</Select>\n\t);\n};\n","import { useSuspenseQuery } from \"@tanstack/react-query\";\nimport { cva } from \"class-variance-authority\";\nimport humanizeDuration from \"humanize-duration\";\nimport { Suspense, useMemo } from \"react\";\nimport { buildGetFlowRunDetailsQuery, type FlowRun } from \"@/api/flow-runs\";\nimport { buildFLowDetailsQuery, type Flow } from \"@/api/flows\";\nimport type { components } from \"@/api/prefect\";\nimport type { TaskRun, TaskRunResponse } from \"@/api/task-runs\";\nimport {\n\tBreadcrumb,\n\tBreadcrumbItem,\n\tBreadcrumbLink,\n\tBreadcrumbList,\n\tBreadcrumbSeparator,\n} from \"@/components/ui/breadcrumb\";\nimport { Card } from \"@/components/ui/card\";\nimport { Checkbox } from \"@/components/ui/checkbox\";\nimport { Icon } from \"@/components/ui/icons\";\nimport { StateBadge } from \"@/components/ui/state-badge\";\nimport { TagBadgeGroup } from \"@/components/ui/tag-badge-group\";\nimport {\n\tTooltip,\n\tTooltipContent,\n\tTooltipProvider,\n\tTooltipTrigger,\n} from \"@/components/ui/tooltip\";\nimport { formatDate } from \"@/utils/date\";\n\ntype TaskRunsListItemProps = {\n\ttaskRun: TaskRun | TaskRunResponse;\n\tflow?: Flow;\n\tflowRun?: FlowRun;\n\tchecked?: boolean;\n\tonCheckedChange?: (checked: boolean) => void;\n};\n\nexport const TaskRunsListItem = ({\n\ttaskRun,\n\tflow,\n\tflowRun,\n\tchecked,\n\tonCheckedChange,\n}: TaskRunsListItemProps) => {\n\tconst isSelectable = typeof onCheckedChange === \"function\";\n\n\treturn (\n\t\t<Card className={stateCardVariants({ state: taskRun.state?.type })}>\n\t\t\t<div className=\"flex justify-between items-center\">\n\t\t\t\t<div className=\"flex items-center gap-2\">\n\t\t\t\t\t{isSelectable && (\n\t\t\t\t\t\t<Checkbox\n\t\t\t\t\t\t\tchecked={checked ?? false}\n\t\t\t\t\t\t\tonCheckedChange={onCheckedChange}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t\t<TaskRunBreadcrumbs taskRun={taskRun} flow={flow} flowRun={flowRun} />\n\t\t\t\t</div>\n\t\t\t\t<div>\n\t\t\t\t\t<TagBadgeGroup tags={taskRun.tags ?? []} />\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div className=\"flex items-center gap-2\">\n\t\t\t\t{taskRun.state && (\n\t\t\t\t\t<StateBadge type={taskRun.state.type} name={taskRun.state.name} />\n\t\t\t\t)}\n\t\t\t\t<TaskRunStartTime taskRun={taskRun} />\n\t\t\t\t<TaskRunDuration taskRun={taskRun} />\n\t\t\t</div>\n\t\t</Card>\n\t);\n};\n\nconst stateCardVariants = cva(\"flex flex-col gap-2 p-4 border-l-8\", {\n\tvariants: {\n\t\tstate: {\n\t\t\tCOMPLETED: \"border-l-green-600\",\n\t\t\tFAILED: \"border-l-red-600\",\n\t\t\tRUNNING: \"border-l-blue-700\",\n\t\t\tCANCELLED: \"border-l-gray-800\",\n\t\t\tCANCELLING: \"border-l-gray-800\",\n\t\t\tCRASHED: \"border-l-orange-600\",\n\t\t\tPAUSED: \"border-l-gray-800\",\n\t\t\tPENDING: \"border-l-gray-800\",\n\t\t\tSCHEDULED: \"border-l-yellow-700\",\n\t\t} satisfies Record<components[\"schemas\"][\"StateType\"], string>,\n\t},\n});\n\ntype TaskRunBreadcrumbsProps = {\n\ttaskRun: TaskRun | TaskRunResponse;\n\tflow?: Flow;\n\tflowRun?: FlowRun;\n};\n\nconst TaskRunBreadcrumbs = ({\n\ttaskRun,\n\tflow,\n\tflowRun,\n}: TaskRunBreadcrumbsProps) => {\n\treturn (\n\t\t<div className=\"flex items-center\">\n\t\t\t<Breadcrumb>\n\t\t\t\t<BreadcrumbList>\n\t\t\t\t\t{flow && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<BreadcrumbItem>\n\t\t\t\t\t\t\t\t<BreadcrumbLink\n\t\t\t\t\t\t\t\t\tto=\"/flows/flow/$id\"\n\t\t\t\t\t\t\t\t\tparams={{ id: flow.id }}\n\t\t\t\t\t\t\t\t\tclassName=\"font-semibold text-foreground\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{flow.name}\n\t\t\t\t\t\t\t\t</BreadcrumbLink>\n\t\t\t\t\t\t\t</BreadcrumbItem>\n\t\t\t\t\t\t\t<BreadcrumbSeparator />\n\t\t\t\t\t\t</>\n\t\t\t\t\t)}\n\t\t\t\t\t{flowRun && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<BreadcrumbItem>\n\t\t\t\t\t\t\t\t<BreadcrumbLink\n\t\t\t\t\t\t\t\t\tto=\"/runs/flow-run/$id\"\n\t\t\t\t\t\t\t\t\tparams={{ id: flowRun.id }}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{flowRun.name}\n\t\t\t\t\t\t\t\t</BreadcrumbLink>\n\t\t\t\t\t\t\t</BreadcrumbItem>\n\t\t\t\t\t\t\t<BreadcrumbSeparator />\n\t\t\t\t\t\t</>\n\t\t\t\t\t)}\n\t\t\t\t\t<BreadcrumbItem className=\"font-bold text-foreground\">\n\t\t\t\t\t\t<BreadcrumbLink to=\"/runs/task-run/$id\" params={{ id: taskRun.id }}>\n\t\t\t\t\t\t\t{taskRun.name}\n\t\t\t\t\t\t</BreadcrumbLink>\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\ntype TaskRunStartTimeProps = {\n\ttaskRun: TaskRun | TaskRunResponse;\n};\n\nconst TaskRunStartTime = ({ taskRun }: TaskRunStartTimeProps) => {\n\t// These properties only exist on UITaskRun, not TaskRunResponse\n\tconst start_time =\n\t\t\"start_time\" in taskRun ? (taskRun.start_time as string | null) : null;\n\tconst expected_start_time =\n\t\t\"expected_start_time\" in taskRun\n\t\t\t? (taskRun.expected_start_time as string | null)\n\t\t\t: null;\n\n\tconst { text, tooltipText } = useMemo(() => {\n\t\tlet text: string | undefined;\n\t\tlet tooltipText: string | undefined;\n\t\tif (start_time) {\n\t\t\ttext = formatDate(start_time, \"dateTimeNumeric\");\n\t\t\ttooltipText = new Date(start_time).toString();\n\t\t} else if (expected_start_time) {\n\t\t\ttext = `Scheduled for ${formatDate(expected_start_time, \"dateTimeNumeric\")}`;\n\t\t\ttooltipText = new Date(expected_start_time).toString();\n\t\t}\n\t\treturn { text, tooltipText };\n\t}, [expected_start_time, start_time]);\n\n\treturn (\n\t\t<TooltipProvider>\n\t\t\t<Tooltip>\n\t\t\t\t<TooltipTrigger asChild disabled={!text}>\n\t\t\t\t\t<div className=\"text-xs font-mono flex gap-2 items-center\">\n\t\t\t\t\t\t<Icon id=\"Calendar\" className=\"size-4\" />\n\t\t\t\t\t\t{text ?? \"No start time\"}\n\t\t\t\t\t</div>\n\t\t\t\t</TooltipTrigger>\n\t\t\t\t<TooltipContent>{tooltipText}</TooltipContent>\n\t\t\t</Tooltip>\n\t\t</TooltipProvider>\n\t);\n};\n\ntype TaskRunDurationProps = {\n\ttaskRun: TaskRun | TaskRunResponse;\n};\n\nconst TaskRunDuration = ({ taskRun }: TaskRunDurationProps) => {\n\t// These properties only exist on UITaskRun, not TaskRunResponse\n\tconst estimated_run_time =\n\t\t\"estimated_run_time\" in taskRun\n\t\t\t? (taskRun.estimated_run_time as number | null)\n\t\t\t: null;\n\tconst total_run_time =\n\t\t\"total_run_time\" in taskRun\n\t\t\t? (taskRun.total_run_time as number | null)\n\t\t\t: null;\n\tconst duration = estimated_run_time ?? total_run_time ?? 0;\n\n\tif (duration === 0) {\n\t\treturn null;\n\t}\n\n\tconst durationLabel = humanizeDuration(duration * 1000, {\n\t\tmaxDecimalPoints: 2,\n\t\tunits: [\"h\", \"m\", \"s\"],\n\t\tround: true,\n\t});\n\tconst durationTooltip = humanizeDuration(duration * 1000, {\n\t\tmaxDecimalPoints: 5,\n\t\tunits: [\"h\", \"m\", \"s\"],\n\t});\n\n\treturn (\n\t\t<TooltipProvider>\n\t\t\t<Tooltip>\n\t\t\t\t<TooltipTrigger asChild>\n\t\t\t\t\t<div className=\"flex gap-2 items-center text-xs font-mono\">\n\t\t\t\t\t\t<Icon id=\"Clock\" className=\"size-4\" />\n\t\t\t\t\t\t{durationLabel}\n\t\t\t\t\t</div>\n\t\t\t\t</TooltipTrigger>\n\t\t\t\t<TooltipContent>{durationTooltip}</TooltipContent>\n\t\t\t</Tooltip>\n\t\t</TooltipProvider>\n\t);\n};\n\ntype TaskRunsListItemWithDataProps = {\n\ttaskRun: TaskRun | TaskRunResponse;\n\tchecked?: boolean;\n\tonCheckedChange?: (checked: boolean) => void;\n};\n\ntype TaskRunsListItemWithFlowDataProps = {\n\ttaskRun: TaskRun | TaskRunResponse;\n\tflowRunId: string;\n\tchecked?: boolean;\n\tonCheckedChange?: (checked: boolean) => void;\n};\n\nconst TaskRunsListItemWithFlowData = ({\n\ttaskRun,\n\tflowRunId,\n\tchecked,\n\tonCheckedChange,\n}: TaskRunsListItemWithFlowDataProps) => {\n\tconst { data: flowRun } = useSuspenseQuery(\n\t\tbuildGetFlowRunDetailsQuery(flowRunId),\n\t);\n\tconst { data: flow } = useSuspenseQuery(\n\t\tbuildFLowDetailsQuery(flowRun.flow_id),\n\t);\n\n\treturn (\n\t\t<TaskRunsListItem\n\t\t\ttaskRun={taskRun}\n\t\t\tflow={flow}\n\t\t\tflowRun={flowRun}\n\t\t\tchecked={checked}\n\t\t\tonCheckedChange={onCheckedChange}\n\t\t/>\n\t);\n};\n\nconst TaskRunsListItemWithDataInner = ({\n\ttaskRun,\n\tchecked,\n\tonCheckedChange,\n}: TaskRunsListItemWithDataProps) => {\n\tconst flowRunId = taskRun.flow_run_id;\n\n\tif (!flowRunId) {\n\t\treturn (\n\t\t\t<TaskRunsListItem\n\t\t\t\ttaskRun={taskRun}\n\t\t\t\tchecked={checked}\n\t\t\t\tonCheckedChange={onCheckedChange}\n\t\t\t/>\n\t\t);\n\t}\n\n\treturn (\n\t\t<TaskRunsListItemWithFlowData\n\t\t\ttaskRun={taskRun}\n\t\t\tflowRunId={flowRunId}\n\t\t\tchecked={checked}\n\t\t\tonCheckedChange={onCheckedChange}\n\t\t/>\n\t);\n};\n\nexport const TaskRunsListItemWithData = ({\n\ttaskRun,\n\tchecked,\n\tonCheckedChange,\n}: TaskRunsListItemWithDataProps) => {\n\treturn (\n\t\t<Suspense\n\t\t\tfallback={\n\t\t\t\t<Card className=\"flex flex-col gap-2 p-4 border-l-8 border-l-gray-300 animate-pulse\">\n\t\t\t\t\t<div className=\"h-5 bg-gray-200 rounded w-1/3\" />\n\t\t\t\t\t<div className=\"h-4 bg-gray-200 rounded w-1/4\" />\n\t\t\t\t</Card>\n\t\t\t}\n\t\t>\n\t\t\t<TaskRunsListItemWithDataInner\n\t\t\t\ttaskRun={taskRun}\n\t\t\t\tchecked={checked}\n\t\t\t\tonCheckedChange={onCheckedChange}\n\t\t\t/>\n\t\t</Suspense>\n\t);\n};\n","import type { TaskRunResponse } from \"@/api/task-runs\";\nimport { Button } from \"@/components/ui/button\";\nimport { Card } from \"@/components/ui/card\";\nimport { Skeleton } from \"@/components/ui/skeleton\";\nimport { Typography } from \"@/components/ui/typography\";\nimport { TaskRunsListItemWithData } from \"./task-runs-list-item\";\n\ntype TaskRunsListProps = {\n\ttaskRuns?: Array<TaskRunResponse>;\n\tonSelect?: (id: string, checked: boolean) => void;\n\tselectedRows?: Set<string>;\n\tonClearFilters?: () => void;\n};\n\nexport const TaskRunsList = ({\n\ttaskRuns,\n\tonClearFilters,\n\tonSelect,\n\tselectedRows,\n}: TaskRunsListProps) => {\n\tif (!taskRuns) {\n\t\treturn <LoadingSkeleton numSkeletons={5} />;\n\t}\n\n\tif (taskRuns.length === 0) {\n\t\treturn (\n\t\t\t<div className=\"flex justify-center py-4\">\n\t\t\t\t<div className=\"flex flex-col gap-2\">\n\t\t\t\t\t<Typography>No runs found</Typography>\n\t\t\t\t\t{onClearFilters && (\n\t\t\t\t\t\t<Button onClick={onClearFilters}>Clear Filters</Button>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t);\n\t}\n\n\treturn (\n\t\t<ul className=\"flex flex-col gap-2\">\n\t\t\t{taskRuns.map((taskRun) => (\n\t\t\t\t<li key={taskRun.id}>\n\t\t\t\t\t<TaskRunsListItemWithData\n\t\t\t\t\t\ttaskRun={taskRun}\n\t\t\t\t\t\tchecked={selectedRows?.has(taskRun.id)}\n\t\t\t\t\t\tonCheckedChange={\n\t\t\t\t\t\t\tonSelect ? (checked) => onSelect(taskRun.id, checked) : undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t</li>\n\t\t\t))}\n\t\t</ul>\n\t);\n};\n\ntype LoadingSkeletonProps = {\n\tnumSkeletons?: number;\n};\nconst LoadingSkeleton = ({ numSkeletons = 1 }: LoadingSkeletonProps) => (\n\t<ul className=\"flex flex-col gap-1\">\n\t\t{Array.from({ length: numSkeletons }).map((_, i) => (\n\t\t\t// biome-ignore lint/suspicious/noArrayIndexKey: okay for static skeleton list\n\t\t\t<li key={i}>\n\t\t\t\t<Card className=\"flex flex-col gap-2 p-4\">\n\t\t\t\t\t<div className=\"flex justify-between\">\n\t\t\t\t\t\t<Skeleton className=\"h-4 w-[350px]\" />\n\t\t\t\t\t\t<Skeleton className=\"h-4 w-[400px]\" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<Skeleton className=\"h-4 w-[400px]\" />\n\t\t\t\t\t<Skeleton className=\"h-4 w-[200px]\" />\n\t\t\t\t</Card>\n\t\t\t</li>\n\t\t))}\n\t</ul>\n);\n","import {\n\tPagination,\n\tPaginationContent,\n\tPaginationFirstButton,\n\tPaginationItem,\n\tPaginationLastButton,\n\tPaginationNextButton,\n\tPaginationPreviousButton,\n} from \"@/components/ui/pagination\";\nimport {\n\tSelect,\n\tSelectContent,\n\tSelectItem,\n\tSelectTrigger,\n\tSelectValue,\n} from \"@/components/ui/select\";\n\nconst PAGINATION_INCREMENTS = [5, 10, 25, 50, 100];\n\nexport type PaginationState = {\n\tlimit: number;\n\tpage: number;\n};\nexport type PaginationStateUpdater = (\n\tprevState: PaginationState,\n) => PaginationState;\n\ntype TaskRunsPaginationProps = {\n\tcount: number;\n\tpages: number;\n\tpagination: PaginationState;\n\tonChangePagination: (pagination: PaginationState) => void;\n\tonPrefetchPage?: (page: number) => void;\n};\nexport const TaskRunsPagination = ({\n\tcount,\n\tpages,\n\tpagination,\n\tonChangePagination,\n\tonPrefetchPage,\n}: TaskRunsPaginationProps) => {\n\tconst handleFirstPage = () =>\n\t\tonChangePagination({ limit: pagination.limit, page: 1 });\n\tconst handlePreviousPage = () =>\n\t\tonChangePagination({ limit: pagination.limit, page: pagination.page - 1 });\n\tconst handleNextPage = () =>\n\t\tonChangePagination({ limit: pagination.limit, page: pagination.page + 1 });\n\n\tconst handleLastPage = () =>\n\t\tonChangePagination({ limit: pagination.limit, page: pages });\n\n\tconst handlePrefetchFirstPage = () => {\n\t\tif (pagination.page > 1) onPrefetchPage?.(1);\n\t};\n\tconst handlePrefetchPreviousPage = () => {\n\t\tif (pagination.page > 1) onPrefetchPage?.(pagination.page - 1);\n\t};\n\tconst handlePrefetchNextPage = () => {\n\t\tif (pagination.page < pages) onPrefetchPage?.(pagination.page + 1);\n\t};\n\tconst handlePrefetchLastPage = () => {\n\t\tif (pagination.page < pages) onPrefetchPage?.(pages);\n\t};\n\n\tconst disablePreviousPage = pagination.page <= 1;\n\tconst disableNextPage = pagination.page >= pages;\n\n\tconst handleChangeLimit = (value: string) => {\n\t\tconst newLimit = Number(value);\n\t\tconst newTotalPages = Math.ceil(count / newLimit);\n\t\tconst newPage = Math.min(pagination.page, newTotalPages);\n\t\tonChangePagination({\n\t\t\tlimit: newLimit,\n\t\t\tpage: newPage,\n\t\t});\n\t};\n\n\treturn (\n\t\t<div className=\"flex flex-row justify-between items-center\">\n\t\t\t<div className=\"flex flex-row items-center gap-2 text-xs text-muted-foreground\">\n\t\t\t\t<span className=\"whitespace-nowrap\">Items per page</span>\n\t\t\t\t<Select\n\t\t\t\t\tvalue={String(pagination.limit)}\n\t\t\t\t\tonValueChange={handleChangeLimit}\n\t\t\t\t>\n\t\t\t\t\t<SelectTrigger aria-label=\"Items per page\">\n\t\t\t\t\t\t<SelectValue placeholder=\"Theme\" />\n\t\t\t\t\t</SelectTrigger>\n\t\t\t\t\t<SelectContent>\n\t\t\t\t\t\t{PAGINATION_INCREMENTS.map((increment) => (\n\t\t\t\t\t\t\t<SelectItem key={increment} value={String(increment)}>\n\t\t\t\t\t\t\t\t{increment}\n\t\t\t\t\t\t\t</SelectItem>\n\t\t\t\t\t\t))}\n\t\t\t\t\t</SelectContent>\n\t\t\t\t</Select>\n\t\t\t</div>\n\t\t\t<Pagination className=\"justify-end\">\n\t\t\t\t<PaginationContent>\n\t\t\t\t\t<PaginationItem>\n\t\t\t\t\t\t<PaginationFirstButton\n\t\t\t\t\t\t\tonClick={handleFirstPage}\n\t\t\t\t\t\t\tonMouseEnter={handlePrefetchFirstPage}\n\t\t\t\t\t\t\tdisabled={disablePreviousPage}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<PaginationPreviousButton\n\t\t\t\t\t\t\tonClick={handlePreviousPage}\n\t\t\t\t\t\t\tonMouseEnter={handlePrefetchPreviousPage}\n\t\t\t\t\t\t\tdisabled={disablePreviousPage}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</PaginationItem>\n\t\t\t\t\t<PaginationItem className=\"text-sm\">\n\t\t\t\t\t\tPage {pages === 0 ? 0 : pagination.page} of {pages}\n\t\t\t\t\t</PaginationItem>\n\t\t\t\t\t<PaginationItem>\n\t\t\t\t\t\t<PaginationNextButton\n\t\t\t\t\t\t\tonClick={handleNextPage}\n\t\t\t\t\t\t\tonMouseEnter={handlePrefetchNextPage}\n\t\t\t\t\t\t\tdisabled={disableNextPage}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</PaginationItem>\n\t\t\t\t\t<PaginationItem>\n\t\t\t\t\t\t<PaginationLastButton\n\t\t\t\t\t\t\tonClick={handleLastPage}\n\t\t\t\t\t\t\tonMouseEnter={handlePrefetchLastPage}\n\t\t\t\t\t\t\tdisabled={disableNextPage}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</PaginationItem>\n\t\t\t\t</PaginationContent>\n\t\t\t</Pagination>\n\t\t</div>\n\t);\n};\n"],"names":["TaskRunsSortFilter","defaultValue","value","onSelect","jsxs","Select","jsx","SelectTrigger","SelectValue","SelectContent","SelectItem","TaskRunsListItem","taskRun","flow","flowRun","checked","onCheckedChange","isSelectable","Card","stateCardVariants","Checkbox","TaskRunBreadcrumbs","TagBadgeGroup","StateBadge","TaskRunStartTime","TaskRunDuration","cva","Breadcrumb","BreadcrumbList","Fragment","BreadcrumbItem","BreadcrumbLink","BreadcrumbSeparator","start_time","expected_start_time","text","tooltipText","useMemo","formatDate","TooltipProvider","Tooltip","TooltipTrigger","Icon","TooltipContent","estimated_run_time","total_run_time","duration","durationLabel","humanizeDuration","durationTooltip","TaskRunsListItemWithFlowData","flowRunId","useSuspenseQuery","buildGetFlowRunDetailsQuery","buildFLowDetailsQuery","TaskRunsListItemWithDataInner","TaskRunsListItemWithData","Suspense","TaskRunsList","taskRuns","onClearFilters","selectedRows","Typography","Button","LoadingSkeleton","numSkeletons","_","i","Skeleton","PAGINATION_INCREMENTS","TaskRunsPagination","count","pages","pagination","onChangePagination","onPrefetchPage","handleFirstPage","handlePreviousPage","handleNextPage","handleLastPage","handlePrefetchFirstPage","handlePrefetchPreviousPage","handlePrefetchNextPage","handlePrefetchLastPage","disablePreviousPage","disableNextPage","handleChangeLimit","newLimit","newTotalPages","newPage","increment","Pagination","PaginationContent","PaginationItem","PaginationFirstButton","PaginationPreviousButton","PaginationNextButton","PaginationLastButton"],"mappings":"yWAeO,MAAMA,GAAq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AW,KAAK,EAC9B,cAAea,EAEf,SAAA,CAAAhF,EAAAA,IAACC,GAAc,aAAW,iBACzB,eAACC,EAAA,CAAY,YAAY,QAAQ,CAAA,CAClC,EACAF,EAAAA,IAACG,EAAA,CACC,SAAA4D,GAAsB,IAAKqB,GAC3BpF,MAACI,EAAA,CAA2B,MAAO,OAAOgF,CAAS,EACjD,SAAAA,CAAA,EADeA,CAEjB,CACA,CAAA,CACF,CAAA,CAAA,CAAA,CACD,EACD,EACApF,MAACqF,EAAA,CAAW,UAAU,cACrB,gBAACC,EAAA,CACA,SAAA,CAAAxF,OAACyF,EAAA,CACA,SAAA,CAAAvF,EAAAA,IAACwF,GAAA,CACA,QAASlB,EACT,aAAcI,EACd,SAAUI,CAAA,CAAA,EAEX9E,EAAAA,IAACyF,GAAA,CACA,QAASlB,EACT,aAAcI,EACd,SAAUG,CAAA,CAAA,CACX,EACD,EACAhF,EAAAA,KAACyF,EAAA,CAAe,UAAU,UAAU,SAAA,CAAA,QAC7BrB,IAAU,EAAI,EAAIC,EAAW,KAAK,OAAKD,CAAA,EAC9C,QACCqB,EAAA,CACA,SAAAvF,EAAAA,IAAC0F,GAAA,CACA,QAASlB,EACT,aAAcI,EACd,SAAUG,CAAA,CAAA,EAEZ,QACCQ,EAAA,CACA,SAAAvF,EAAAA,IAAC2F,GAAA,CACA,QAASlB,EACT,aAAcI,EACd,SAAUE,CAAA,CAAA,CACX,CACD,CAAA,CAAA,CACD,CAAA,CACD,CAAA,EACD,CAEF"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{u as z,j as t,L as p,r as Y,s as re,t as oe,E as ae,d as ce}from"./vendor-tanstack-BdLtprmr.js";import{bt as ie,d0 as le,T as B,d7 as ue,da as de,C as G,ap as u,au as K,I as w,a2 as pe,bl as me,q as H,f as fe,a3 as he,a4 as xe,a5 as ye,L as je,b9 as N,cu as we,dd as v,$ as ke,cr as Ae,U as _,db as _e,de as be,G as ge,y as b,bE as De,df as Se}from"./index-V_xTKaEb.js";import{F as Te,W as Ee,a as Ne}from"./work-queue-icon-text-vWlRNW-b.js";import{D as ve,a as Re,b as Ce,c as Le,d as k}from"./dropdown-menu-B9LKPlz7.js";import{u as Pe}from"./use-delete-confirmation-dialog-CkL-rSsp.js";const We=e=>{const{automationIds:s,blockDocumentIds:n,deploymentIds:r,workPoolIds:c,workQueueIds:a}=Ie(e.actions),{data:o,loading:i}=qe(Array.from(s)),l=z({queries:[ie({offset:0,sort:"BLOCK_TYPE_AND_NAME_ASC",include_secrets:!1,block_documents:{operator:"and_",id:{any_:Array.from(n)},is_anonymous:{}}},{enabled:n.size>0}),le({offset:0,sort:"CREATED_DESC",deployments:{id:{any_:Array.from(r)},operator:"and_"}},{enabled:r.size>0}),B({offset:0,work_pools:{id:{any_:Array.from(c)},operator:"and_"}},{enabled:c.size>0}),ue({offset:0,work_queues:{id:{any_:Array.from(a)},operator:"and_"}},{enabled:a.size>0})],combine:d=>{const[j,ee,te,se]=d;return{data:{blockDocuments:j.data,deployments:ee.data,workPools:te.data,workQueues:se.data},loading:d.some(ne=>ne.isLoading)}}});return{loading:i||l.loading,data:{automationsMap:o,blockDocumentsMap:A(l.data.blockDocuments),deploymentsMap:A(l.data.deployments),workPoolsMap:A(l.data.workPools),workQueuesMap:A(l.data.workQueues)}}},qe=e=>z({queries:Array.from(e).map(s=>de(s)),combine:s=>{const n=new Map;for(const r of s)r.data&&n.set(r.data.id,r.data);return{data:n,loading:s.some(r=>r.isLoading)}}}),Ie=e=>{const s=new Set,n=new Set,r=new Set,c=new Set,a=new Set;for(const o of e)switch(o.type){case"run-deployment":case"pause-deployment":case"resume-deployment":o.deployment_id&&r.add(o.deployment_id);break;case"pause-work-queue":case"resume-work-queue":o.work_queue_id&&a.add(o.work_queue_id);break;case"pause-automation":case"resume-automation":o.automation_id&&s.add(o.automation_id);break;case"pause-work-pool":case"resume-work-pool":o.work_pool_id&&c.add(o.work_pool_id);break;case"send-notification":case"call-webhook":o.block_document_id&&n.add(o.block_document_id);break}return{automationIds:s,blockDocumentIds:n,deploymentIds:r,workPoolIds:c,workQueueIds:a}};function A(e){const s=new Map;for(const n of e??[])s.set(n.id,n);return s}const Qe={"cancel-flow-run":"Cancel flow run","suspend-flow-run":"Suspend flow run","resume-flow-run":"Resume a flow run","change-flow-run-state":"Change state of a flow run","run-deployment":"Run deployment","pause-deployment":"Pause deployment","resume-deployment":"Resume deployment","pause-work-queue":"Pause work queue","resume-work-queue":"Resume work queue","pause-work-pool":"Pause work pool","resume-work-pool":"Resume work pool","pause-automation":"Pause automation","resume-automation":"Resume automation","call-webhook":"Call webhook using","send-notification":"Send a notification using","do-nothing":"Do nothing"},$e=({action:e,automationsMap:s,blockDocumentsMap:n,deploymentsMap:r,workPoolsMap:c,workQueuesMap:a})=>t.jsx(G,{className:"p-4",children:t.jsx(Me,{action:e,automationsMap:s,blockDocumentsMap:n,deploymentsMap:r,workPoolsMap:c,workQueuesMap:a})}),Me=({action:e,automationsMap:s,blockDocumentsMap:n,deploymentsMap:r,workPoolsMap:c,workQueuesMap:a})=>{const o=Qe[e.type];switch(e.type){case"cancel-flow-run":case"suspend-flow-run":case"resume-flow-run":case"do-nothing":return t.jsx(Oe,{label:o});case"run-deployment":if(e.deployment_id&&e.source==="selected"){const i=r.get(e.deployment_id);return i?t.jsx(P,{label:o,deployment:i,parameters:e.parameters,job_variables:e.job_variables}):t.jsx(u,{children:"Deployment not found"})}return t.jsx(h,{label:o});case"pause-deployment":case"resume-deployment":if(e.deployment_id&&e.source==="selected"){const i=r.get(e.deployment_id);return i?t.jsx(P,{label:o,deployment:i}):t.jsx(u,{children:"Deployment not found"})}return t.jsx(h,{label:o});case"pause-work-queue":case"resume-work-queue":if(e.work_queue_id&&e.source==="selected"){const i=a.get(e.work_queue_id);return i?t.jsx(Be,{label:o,workQueue:i}):t.jsx(u,{children:"Work queue not found"})}return t.jsx(h,{label:o});case"pause-automation":case"resume-automation":if(e.automation_id&&e.source==="selected"){const i=s.get(e.automation_id);return i?t.jsx(Fe,{label:o,automation:i}):t.jsx(u,{children:"Automation not found"})}return t.jsx(h,{label:o});case"pause-work-pool":case"resume-work-pool":if(e.work_pool_id&&e.source==="selected"){const i=c.get(e.work_pool_id);return i?t.jsx(Ye,{label:o,workPool:i}):t.jsx(u,{children:"Workpool not found"})}return t.jsx(h,{label:o});case"send-notification":{const i=n.get(e.block_document_id);return i?t.jsx(Ve,{label:o,blockDocument:i}):t.jsx(u,{children:"Block document not found"})}case"call-webhook":{const i=n.get(e.block_document_id);return i?t.jsx(ze,{label:o,blockDocument:i}):t.jsx(u,{children:"Block document not found"})}case"change-flow-run-state":return t.jsx(Ue,{label:o,type:e.state,name:e.name});default:return null}},f=({children:e})=>t.jsx("div",{className:"text-sm flex items-center gap-1",children:e}),y=({iconId:e,name:s})=>t.jsxs("div",{className:"text-xs flex items-center",children:[t.jsx(w,{id:e,className:"size-4 mr-1"}),s]}),Oe=({label:e})=>t.jsxs(u,{variant:"bodySmall",children:[e," from the triggering event"]}),h=({label:e})=>t.jsxs(u,{variant:"bodySmall",children:[e," inferred from the triggering event"]}),Ue=({label:e,type:s,name:n})=>t.jsxs(f,{children:[t.jsx(h,{label:e})," to ",t.jsx(K,{type:s,name:n})]}),P=({label:e,deployment:s,parameters:n,job_variables:r})=>t.jsxs(f,{children:[t.jsxs("label",{htmlFor:`${e}-${s.id}`,children:[e,":"]}),t.jsx(p,{to:"/deployments/deployment/$id",params:{id:s.id},"aria-label":s.name,children:t.jsx(y,{iconId:"Rocket",name:s.name})}),n!==void 0&&t.jsx(W,{title:"Parameters",payload:n}),r!==void 0&&t.jsx(W,{title:"Job Variables",payload:r})]}),W=({title:e,payload:s})=>t.jsxs(pe,{children:[t.jsx(me,{asChild:!0,children:t.jsxs(H,{variant:"secondary",size:"sm",children:["Show ",fe(e)]})}),t.jsxs(he,{"aria-describedby":void 0,children:[t.jsx(xe,{children:t.jsx(ye,{children:e})}),t.jsx(je,{value:JSON.stringify(s),disabled:!0})]})]}),Fe=({label:e,automation:s})=>t.jsxs(f,{children:[t.jsxs("label",{htmlFor:`${e}-${s.id}`,children:[e,":"]}),t.jsx(p,{to:"/automations/automation/$id",params:{id:s.id},"aria-label":s.name,children:t.jsx(y,{iconId:"Bot",name:s.name})})]}),Ve=({label:e,blockDocument:s})=>{if(!s.name)return t.jsx(u,{children:"Block not found"});const n=s.block_type_name?`Send a ${s.block_type_name.toLowerCase()} using`:e;return t.jsxs(f,{children:[t.jsx("label",{htmlFor:`${e}-${s.id}`,children:n}),t.jsx(p,{to:"/blocks/block/$id",params:{id:s.id},"aria-label":s.name,children:t.jsx(y,{iconId:"Box",name:s.name})})]})},ze=({label:e,blockDocument:s})=>s.name?t.jsxs(f,{children:[t.jsx("label",{htmlFor:`${e}-${s.id}`,children:e}),t.jsx(p,{to:"/blocks/block/$id",params:{id:s.id},"aria-label":s.name,children:t.jsx(y,{iconId:"Box",name:s.name})})]}):t.jsx(u,{children:"Block not found"}),Ye=({label:e,workPool:s})=>t.jsxs(f,{children:[t.jsxs("label",{htmlFor:`${e}-${s.id}`,children:[e,":"]}),t.jsx(p,{to:"/work-pools/work-pool/$workPoolName",params:{workPoolName:s.name},"aria-label":s.name,children:t.jsx(y,{iconId:"Cpu",name:s.name})})]}),Be=({label:e,workQueue:s})=>t.jsxs(f,{children:[t.jsxs("label",{htmlFor:`${e}-${s.id}`,children:[e,":"]}),t.jsx(p,{to:"/work-pools/work-pool/$workPoolName/queue/$workQueueName",params:{workPoolName:s.name,workQueueName:s.name},"aria-label":s.name,children:t.jsx(y,{iconId:"Cpu",name:s.name})})]}),Ge=({trigger:e})=>{const s=e.triggers?.length??0,n=e.require;let r;return n==="all"?r="all":n==="any"?r="any":typeof n=="number"?r=`at least ${n}`:r="all",t.jsx("div",{className:"flex flex-wrap gap-1 items-center",children:t.jsxs(u,{variant:"bodySmall",children:["A compound trigger requiring ",r," of ",s," nested"," ",s===1?"trigger":"triggers"," to fire"]})})},q=()=>t.jsx(u,{variant:"bodySmall",children:"A custom trigger"}),Ke=({deploymentId:e})=>t.jsx(Y.Suspense,{fallback:t.jsx(N,{className:"h-4 w-full"}),children:t.jsx(He,{deploymentId:e})}),He=({deploymentId:e})=>{const{data:s}=re(we(e));return t.jsxs("div",{className:"flex items-center gap-1 text-xs",children:["Deployment",t.jsxs(p,{to:"/deployments/deployment/$id",params:{id:s.id},className:"flex items-center gap-1",children:[t.jsx(w,{id:"Rocket",className:"size-4"}),s.name]})]})},g=1,Je=["prefect.deployment.ready","prefect.deployment.not-ready","prefect.deployment.disabled"],Xe=["prefect.work-pool.ready","prefect.work-pool.not-ready","prefect.work-pool.paused","prefect.work-pool.not_ready"],Ze=["prefect.work-queue.ready","prefect.work-queue.not-ready","prefect.work-queue.paused"];function R(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function m(e){return R(e)&&e.type==="event"&&(e.posture==="Reactive"||e.posture==="Proactive")}function et(e){return R(e)&&e.type==="compound"&&Array.isArray(e.triggers)}function tt(e){return R(e)&&e.type==="sequence"&&Array.isArray(e.triggers)}function J(e){return e==null?[]:Array.isArray(e)?e:[e]}function st(e,s){if(m(e)){const n=e.match;if(n&&typeof n=="object"){const r=n[s];return r?J(r):[]}}return[]}function D(e,s){const n=st(e,"prefect.resource.id");return n.length===0?!1:s(n)}function S(e,s){return m(e)?(e.for_each??[]).every(r=>r.startsWith(s)):!1}function T(e,s){return m(e)?s(e.after??[]):!1}function E(e,s){return m(e)?s(e.expect??[]):!1}function I(e){return Je.includes(e)}function Q(e){return Xe.includes(e)}function $(e){return Ze.includes(e)}function nt(e){return m(e)&&D(e,s=>s.every(n=>n.startsWith("prefect.deployment")))&&S(e,"prefect.resource.id")&&T(e,s=>s.every(n=>I(n)))&&E(e,s=>s.every(n=>I(n)))&&e.threshold===g}function rt(e,s){const n=e.match_related;if(!n)return[];const r=Array.isArray(n)?n:[n],c=[];for(const a of r)if(a&&typeof a=="object"){const o=a[s];o&&c.push(...J(o))}return c}function ot(e){const s=e.match_related;return s?Array.isArray(s)?s.length===0:Object.keys(s).length===0:!0}function M(e,s){const n=rt(e,"prefect.resource.id");return n.length===0?!1:n.every(r=>r.startsWith(s))}function at(e){return ot(e)||M(e,"prefect.flow")||M(e,"prefect.tag")}function ct(e){return m(e)&&D(e,s=>s.every(n=>n.startsWith("prefect.flow-run")))&&S(e,"prefect.resource.id")&&T(e,s=>s.every(n=>n.startsWith("prefect.flow-run")))&&E(e,s=>s.every(n=>n.startsWith("prefect.flow-run")))&&at(e)&&e.threshold===g}function it(e){return m(e)&&D(e,s=>s.every(n=>n.startsWith("prefect.work-pool")))&&S(e,"prefect.resource.id")&&T(e,s=>s.every(n=>Q(n)))&&E(e,s=>s.every(n=>Q(n)))&&e.threshold===g}function lt(e){return m(e)&&D(e,s=>s.every(n=>n.startsWith("prefect.work-queue")))&&S(e,"prefect.resource.id")&&T(e,s=>s.every(n=>$(n)))&&E(e,s=>s.every(n=>$(n)))&&e.threshold===g}const ut={"deployment-status":nt,"flow-run-state":ct,"work-pool-status":it,"work-queue-status":lt};function dt(e){for(const[s,n]of Object.entries(ut))if(n(e))return s;return"custom"}function C(e){switch(e){case"Reactive":return"enters";case"Proactive":return"stays in"}}function pt(e){switch(e){case"READY":return"Ready";case"NOT_READY":return"Not Ready";case"PAUSED":return"Paused";default:{const s=e;throw new Error(`getWorkQueueStatusLabel missing case for ${s}`)}}}function mt(e){switch(e){case"ready":return"ready";case"not_ready":return"not ready"}}const ft=({deploymentIds:e,posture:s,status:n,time:r})=>{const c=e.length===0,a=C(s),o=mt(n);return t.jsxs("div",{className:"flex flex-wrap gap-1 items-center",children:[t.jsx("span",{children:"When"}),c?t.jsx("span",{children:"any deployment"}):e.map((i,l)=>t.jsxs("span",{className:"flex items-center gap-1",children:[t.jsx(Ke,{deploymentId:i}),l===e.length-2&&t.jsx("span",{children:"or"})]},i)),t.jsx("span",{children:a}),t.jsx("span",{children:o}),s==="Proactive"&&r!==void 0&&r>0&&t.jsxs("span",{children:["for ",v(r)]})]})};function ht(e){const s=e.toUpperCase();return["COMPLETED","FAILED","RUNNING","CANCELLED","CANCELLING","CRASHED","PAUSED","PENDING","SCHEDULED"].includes(s)?s:null}const xt=({flowIds:e,tags:s,posture:n,states:r,time:c})=>{const a=C(n);return t.jsxs("div",{className:"flex flex-wrap gap-1 items-center",children:[t.jsx("span",{children:"When any flow run"}),e.length>0&&t.jsxs(t.Fragment,{children:[t.jsx("span",{children:"of flow"}),e.map((o,i)=>t.jsxs("span",{className:"flex items-center gap-1",children:[t.jsx(Te,{flowId:o}),i===e.length-2&&t.jsx("span",{children:"or"})]},o))]}),s.length>0&&t.jsxs(t.Fragment,{children:[t.jsx("span",{children:"with the tag"}),t.jsx(ke,{tags:s})]}),t.jsx("span",{children:a}),r.length>0?r.map(o=>{const i=ht(o);return i?t.jsx(K,{type:i},o):null}):t.jsx("span",{children:"any state"}),n==="Proactive"&&c!==void 0&&c>0&&t.jsxs("span",{children:["for ",Ae(c)]})]})},yt=({trigger:e})=>{const s=e.triggers?.length??0;return t.jsx("div",{className:"flex flex-wrap gap-1 items-center",children:t.jsxs(u,{variant:"bodySmall",children:["A sequence trigger with ",s," nested"," ",s===1?"trigger":"triggers"," that must fire in order"]})})},jt=e=>{switch(e){case"READY":return"Ready";case"NOT_READY":return"Not Ready";case"PAUSED":return"Paused"}},wt=({workPoolName:e})=>t.jsxs(p,{to:"/work-pools/work-pool/$workPoolName",params:{workPoolName:e},className:"inline-flex items-center gap-1",children:[t.jsx(w,{id:"Cpu",className:"size-4"}),e]}),kt=e=>e.length===0?null:e.map((s,n)=>t.jsxs("span",{className:"inline-flex items-center gap-1",children:[t.jsx(wt,{workPoolName:s.name}),n===e.length-2&&" or ",n<e.length-2&&", "]},s.id)),At=({workPoolIds:e,posture:s,status:n,time:r})=>{const{data:c=[]}=oe(B({offset:0,work_pools:{id:{any_:e},operator:"and_"}},{enabled:e.length>0})),a=s==="Reactive"?"enters":"stays in",o=jt(n).toLowerCase(),i=e.length===0?"any work pool":`${_(e.length,"work pool")} `;return t.jsxs("div",{className:"flex flex-wrap gap-1 items-center",children:[t.jsx("span",{children:"When"}),t.jsx("span",{children:i}),e.length>0&&kt(c),t.jsx("span",{children:a}),t.jsx("span",{children:o}),s==="Proactive"&&r!==void 0&&t.jsxs("span",{children:["for ",v(r)]})]})},_t=e=>t.jsx(Y.Suspense,{fallback:t.jsx(N,{className:"h-4 w-full"}),children:t.jsx(bt,{...e})}),bt=({workQueueIds:e,workPoolNames:s,posture:n,status:r,time:c})=>{const a=e.length===0,o=s.length===0,l=ae({queries:e.map(d=>_e(d))}).map(d=>d.data);return t.jsxs("div",{className:"flex flex-wrap gap-1 items-center text-sm",children:[t.jsx("span",{children:"When"}),a?t.jsx("span",{children:"any work queue"}):t.jsxs(t.Fragment,{children:[t.jsx("span",{children:_(l.length,"work queue")}),l.map((d,j)=>t.jsxs("span",{className:"flex items-center gap-1",children:[t.jsx(Ee,{workPoolName:d.work_pool_name??"",workQueueName:d.name,showLabel:!0,showStatus:!0}),j===l.length-2&&t.jsx("span",{children:"or"})]},d.id))]}),!o&&t.jsxs(t.Fragment,{children:[t.jsxs("span",{children:["from the ",_(s.length,"work pool")]}),s.map((d,j)=>t.jsxs("span",{className:"flex items-center gap-1",children:[t.jsx(Ne,{workPoolName:d}),j===s.length-2&&t.jsx("span",{children:"or"})]},d))]}),t.jsx("span",{children:C(n)}),t.jsx("span",{children:pt(r).toLowerCase()}),n==="Proactive"&&c!==void 0&&t.jsxs("span",{children:["for ",v(c)]})]})};function X(e){return e==null?[]:Array.isArray(e)?e:[e]}function L(e,s){const n=e.match;if(n&&typeof n=="object")return n[s]}function Z(e,s){const n=e.match_related;if(!n)return[];const r=Array.isArray(n)?n:[n],c=[];for(const a of r)if(a&&typeof a=="object"){const o=a[s];o&&c.push(...X(o))}return c}function x(e,s){if(s==null)return[];const n=X(s);return n.includes(`${e}.*`)?[]:n.filter(r=>r.startsWith(e)).map(r=>r.split(`${e}.`)[1]??"").filter(r=>r!==""&&r!=="*")}function O(e){return e.includes("prefect.flow-run.*")?[]:e.filter(s=>s.startsWith("prefect.flow-run.")).map(s=>s.split("prefect.flow-run.")[1]??"").filter(s=>s!=="")}function gt(e){const s=Z(e,"prefect.resource.id"),n=x("prefect.flow",s),r=x("prefect.tag",s),c=e.posture,a=O(c==="Reactive"?e.expect??[]:e.after??[]);return{flowIds:n,tags:r,posture:c,states:a,time:e.within}}const U={"prefect.deployment.ready":"ready","prefect.deployment.not-ready":"not_ready","prefect.deployment.disabled":"not_ready"};function Dt(e){const s=L(e,"prefect.resource.id"),n=x("prefect.deployment",s),r=e.posture,c=r==="Reactive"?e.expect:e.after;let a="ready";for(const o of c??[])if(o in U){a=U[o];break}return{deploymentIds:n,posture:r,status:a,time:e.within}}const F={"prefect.work-pool.ready":"READY","prefect.work-pool.not-ready":"NOT_READY","prefect.work-pool.not_ready":"NOT_READY","prefect.work-pool.paused":"PAUSED"};function St(e){const s=L(e,"prefect.resource.id"),n=x("prefect.work-pool",s),r=e.posture,c=r==="Reactive"?e.expect:e.after;let a="READY";for(const o of c??[])if(o in F){a=F[o];break}return{workPoolIds:n,posture:r,status:a,time:e.within}}const V={"prefect.work-queue.ready":"READY","prefect.work-queue.not-ready":"NOT_READY","prefect.work-queue.paused":"PAUSED"};function Tt(e){const s=L(e,"prefect.resource.id"),n=x("prefect.work-queue",s),r=Z(e,"prefect.resource.id"),c=x("prefect.work-pool",r),a=e.posture,o=a==="Reactive"?e.expect:e.after;let i="READY";for(const l of o??[])if(l in V){i=V[l];break}return{workQueueIds:n,workPoolNames:c,posture:a,status:i,time:e.within}}const Et=({trigger:e})=>{if(et(e))return t.jsx(Ge,{trigger:e});if(tt(e))return t.jsx(yt,{trigger:e});if(!m(e))return t.jsx(q,{});switch(dt(e)){case"flow-run-state":return t.jsx(xt,{...gt(e)});case"deployment-status":return t.jsx(ft,{...Dt(e)});case"work-pool-status":return t.jsx(At,{...St(e)});case"work-queue-status":return t.jsx(_t,{...Tt(e)});default:return t.jsx(q,{})}},Pt=({automation:e})=>t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx(u,{className:"text-muted-foreground",variant:"bodySmall",children:"Description"}),t.jsx(u,{className:"text-muted-foreground",children:e.description||"None"})]}),Wt=({automation:e})=>{const{trigger:s}=e;return t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx(u,{children:"Trigger"}),t.jsx(Et,{trigger:s})]})},qt=({automation:e})=>{const{data:s,loading:n}=We(e),{automationsMap:r,blockDocumentsMap:c,deploymentsMap:a,workPoolsMap:o,workQueuesMap:i}=s;return t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx(u,{children:_(e.actions.length,"Action")}),t.jsx("ul",{className:"flex flex-col gap-2",children:n?Array.from({length:e.actions.length},(l,d)=>t.jsx(G,{className:"p-4",children:t.jsx(N,{className:"p-2 h-2 w-full"})},d)):e.actions.map(l=>t.jsx("li",{children:t.jsx($e,{action:l,automationsMap:r,blockDocumentsMap:c,deploymentsMap:a,workPoolsMap:o,workQueuesMap:i})},l.type))})]})},It=({automation:e})=>{const{updateAutomation:s}=be(),n=(r,c)=>{s({enabled:r,id:c},{onSuccess:()=>{b.success(`Automation ${r?"enabled":"disabled"}`)},onError:a=>{const o=a.message||"Unknown error while updating automation";console.error(o)}})};return t.jsx(ge,{"aria-label":"toggle automation",checked:e.enabled,onCheckedChange:r=>n(r,e.id)})},Qt=({id:e,onDelete:s})=>{const n=r=>{navigator.clipboard.writeText(r),b.success("ID copied")};return t.jsxs(ve,{children:[t.jsx(Re,{asChild:!0,children:t.jsxs(H,{variant:"outline",className:"size-8 p-0",children:[t.jsx("span",{className:"sr-only",children:"Open menu"}),t.jsx(w,{id:"MoreVertical",className:"size-4"})]})}),t.jsxs(Ce,{align:"end",children:[t.jsx(Le,{children:"Actions"}),t.jsx(k,{onClick:()=>n(e),children:"Copy ID"}),t.jsx(k,{asChild:!0,children:t.jsx(p,{to:"/automations/automation/$id/edit",params:{id:e},children:"Edit"})}),t.jsx(k,{onClick:s,children:"Delete"}),t.jsx(k,{asChild:!0,children:t.jsxs("a",{href:De["automations-guide"],className:"flex items-center",children:["Documentation ",t.jsx(w,{id:"ExternalLink",className:"ml-2 size-4"})]})})]})]})},$t=()=>{const e=ce(),[s,n]=Pe(),{deleteAutomation:r}=Se();return[s,(a,{shouldNavigate:o=!1}={})=>n({title:"Delete Automation",description:`Are you sure you want to delete ${a.name}?`,onConfirm:()=>{r(a.id,{onSuccess:()=>{b.success("Automation deleted"),o&&e({to:"/automations"})},onError:i=>{const l=i.message||"Unknown error while deleting automation.";b.error(l),console.error(l)}})}})]};export{It as A,Qt as a,Pt as b,Wt as c,qt as d,$t as u};
|
|
2
|
-
//# sourceMappingURL=use-delete-automation-confirmation-dialog-DZplMJDW.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-delete-automation-confirmation-dialog-DZplMJDW.js","sources":["../../src/api/automations/use-get-automation-action-resources/use-get-automation-action-resources.ts","../../src/components/automations/action-details/action-details.tsx","../../src/components/automations/trigger-details/trigger-details-compound.tsx","../../src/components/automations/trigger-details/trigger-details-custom.tsx","../../src/components/deployments/deployment-link.tsx","../../src/components/automations/trigger-details/trigger-utils.ts","../../src/components/automations/trigger-details/trigger-details-deployment-status.tsx","../../src/components/automations/trigger-details/trigger-details-flow-run-state.tsx","../../src/components/automations/trigger-details/trigger-details-sequence.tsx","../../src/components/automations/trigger-details/trigger-details-work-pool-status.tsx","../../src/components/automations/trigger-details/trigger-details-work-queue-status.tsx","../../src/components/automations/trigger-details/trigger-details.tsx","../../src/components/automations/automation-details.tsx","../../src/components/automations/automation-enable-toggle/automation-enable-toggle.tsx","../../src/components/automations/automations-actions-menu/automations-actions-menu.tsx","../../src/components/automations/use-delete-automation-confirmation-dialog.ts"],"sourcesContent":["import { useQueries } from \"@tanstack/react-query\";\nimport { type Automation, buildGetAutomationQuery } from \"@/api/automations\";\nimport { buildListFilterBlockDocumentsQuery } from \"@/api/block-documents\";\nimport { buildFilterDeploymentsQuery } from \"@/api/deployments\";\nimport { buildFilterWorkPoolsQuery } from \"@/api/work-pools\";\nimport { buildFilterWorkQueuesQuery } from \"@/api/work-queues\";\n\n/**\n *\n * @param automation\n * @returns an object of maps to get information about an action's selected source (automations, deployments, work pools, and work queues)\n *\n * @example\n * ```ts\n * const { loading, data } = useGetAutomationActionResources(MY_AUTOMATION);\n *\n *\n * if (loading) {\n * return \"Loading...\"\n * }\n *\n * const { automationsMap, blockDocumentsMap, deploymentsMap, workPoolsMap, workQueuesMap } = data\n * return (\n * \t\t<ActionDetails\n *\t\t\tautomation={MY_AUTOMATION}\n *\t\t\tautomations={automationsMap}\n *\t\t\tblockDocumentsMap={blockDocumentsMap}\n *\t\t\tdeployments={deploymentsMap}\n *\t\t\tworkPools={workPoolsMap}\n *\t\t\tworkQueues={workQueuesMap}\n *\t\t/>)\n * ```\n */\nexport const useGetAutomationActionResources = (automation: Automation) => {\n\tconst {\n\t\tautomationIds,\n\t\tblockDocumentIds,\n\t\tdeploymentIds,\n\t\tworkPoolIds,\n\t\tworkQueueIds,\n\t} = getResourceSets(automation.actions);\n\n\t// nb: Automations /filter doesn't support `id`. Need to do it per GET call\n\tconst { data: automationsData, loading: automationsLoading } =\n\t\tuseListAutomationsQueries(Array.from(automationIds));\n\n\t// Need to do deployments filter API\n\tconst remainingQueries = useQueries({\n\t\tqueries: [\n\t\t\tbuildListFilterBlockDocumentsQuery(\n\t\t\t\t{\n\t\t\t\t\toffset: 0,\n\t\t\t\t\tsort: \"BLOCK_TYPE_AND_NAME_ASC\",\n\t\t\t\t\tinclude_secrets: false,\n\t\t\t\t\tblock_documents: {\n\t\t\t\t\t\toperator: \"and_\",\n\t\t\t\t\t\tid: { any_: Array.from(blockDocumentIds) },\n\t\t\t\t\t\tis_anonymous: {},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{ enabled: blockDocumentIds.size > 0 },\n\t\t\t),\n\t\t\tbuildFilterDeploymentsQuery(\n\t\t\t\t{\n\t\t\t\t\toffset: 0,\n\t\t\t\t\tsort: \"CREATED_DESC\",\n\t\t\t\t\tdeployments: {\n\t\t\t\t\t\tid: { any_: Array.from(deploymentIds) },\n\t\t\t\t\t\toperator: \"and_\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{ enabled: deploymentIds.size > 0 },\n\t\t\t),\n\t\t\tbuildFilterWorkPoolsQuery(\n\t\t\t\t{\n\t\t\t\t\toffset: 0,\n\t\t\t\t\twork_pools: {\n\t\t\t\t\t\tid: { any_: Array.from(workPoolIds) },\n\t\t\t\t\t\toperator: \"and_\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{ enabled: workPoolIds.size > 0 },\n\t\t\t),\n\t\t\tbuildFilterWorkQueuesQuery(\n\t\t\t\t{\n\t\t\t\t\toffset: 0,\n\t\t\t\t\twork_queues: {\n\t\t\t\t\t\tid: { any_: Array.from(workQueueIds) },\n\t\t\t\t\t\toperator: \"and_\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{ enabled: workQueueIds.size > 0 },\n\t\t\t),\n\t\t],\n\t\tcombine: (results) => {\n\t\t\tconst [blockDocuments, deployments, workPools, workQueues] = results;\n\t\t\treturn {\n\t\t\t\tdata: {\n\t\t\t\t\tblockDocuments: blockDocuments.data,\n\t\t\t\t\tdeployments: deployments.data,\n\t\t\t\t\tworkPools: workPools.data,\n\t\t\t\t\tworkQueues: workQueues.data,\n\t\t\t\t},\n\t\t\t\tloading: results.some((result) => result.isLoading),\n\t\t\t};\n\t\t},\n\t});\n\n\treturn {\n\t\tloading: automationsLoading || remainingQueries.loading,\n\t\tdata: {\n\t\t\tautomationsMap: automationsData,\n\t\t\tblockDocumentsMap: listToMap(remainingQueries.data.blockDocuments),\n\t\t\tdeploymentsMap: listToMap(remainingQueries.data.deployments),\n\t\t\tworkPoolsMap: listToMap(remainingQueries.data.workPools),\n\t\t\tworkQueuesMap: listToMap(remainingQueries.data.workQueues),\n\t\t},\n\t};\n};\n\nconst useListAutomationsQueries = (automationIds: Array<string>) =>\n\tuseQueries({\n\t\tqueries: Array.from(automationIds).map((automationId) =>\n\t\t\tbuildGetAutomationQuery(automationId),\n\t\t),\n\t\tcombine: (results) => {\n\t\t\tconst retMap = new Map<string, Automation>();\n\t\t\tfor (const result of results) {\n\t\t\t\tif (result.data) {\n\t\t\t\t\tretMap.set(result.data.id, result.data);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tdata: retMap,\n\t\t\t\tloading: results.some((result) => result.isLoading),\n\t\t\t};\n\t\t},\n\t});\n\nexport const getResourceSets = (actions: Automation[\"actions\"]) => {\n\tconst automationIds = new Set<string>();\n\tconst blockDocumentIds = new Set<string>();\n\tconst deploymentIds = new Set<string>();\n\tconst workPoolIds = new Set<string>();\n\tconst workQueueIds = new Set<string>();\n\n\tfor (const action of actions) {\n\t\tswitch (action.type) {\n\t\t\tcase \"run-deployment\":\n\t\t\tcase \"pause-deployment\":\n\t\t\tcase \"resume-deployment\":\n\t\t\t\tif (action.deployment_id) {\n\t\t\t\t\tdeploymentIds.add(action.deployment_id);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"pause-work-queue\":\n\t\t\tcase \"resume-work-queue\":\n\t\t\t\tif (action.work_queue_id) {\n\t\t\t\t\tworkQueueIds.add(action.work_queue_id);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"pause-automation\":\n\t\t\tcase \"resume-automation\":\n\t\t\t\tif (action.automation_id) {\n\t\t\t\t\tautomationIds.add(action.automation_id);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"pause-work-pool\":\n\t\t\tcase \"resume-work-pool\":\n\t\t\t\tif (action.work_pool_id) {\n\t\t\t\t\tworkPoolIds.add(action.work_pool_id);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"send-notification\":\n\t\t\tcase \"call-webhook\":\n\t\t\t\tif (action.block_document_id) {\n\t\t\t\t\tblockDocumentIds.add(action.block_document_id);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t// TODO: add these back when the corresponding actions are implemented\n\t\t\t// case \"do-nothing\":\n\t\t\t// case \"cancel-flow-run\":\n\t\t\t// case \"change-flow-run-state\":\n\t\t\t// case \"suspend-flow-run\":\n\t\t\t// case \"resume-flow-run\":\n\t\t}\n\t}\n\n\treturn {\n\t\tautomationIds,\n\t\tblockDocumentIds,\n\t\tdeploymentIds,\n\t\tworkPoolIds,\n\t\tworkQueueIds,\n\t};\n};\n\nfunction listToMap<T extends { id: string }>(\n\tlist: T[] | undefined,\n): Map<T[\"id\"], T> {\n\tconst map = new Map<T[\"id\"], T>();\n\tfor (const item of list ?? []) {\n\t\tmap.set(item.id, item);\n\t}\n\treturn map;\n}\n","import { Link } from \"@tanstack/react-router\";\nimport type { Automation } from \"@/api/automations\";\nimport type { BlockDocument } from \"@/api/block-documents\";\nimport type { Deployment } from \"@/api/deployments\";\nimport type { components } from \"@/api/prefect\";\nimport type { WorkPool } from \"@/api/work-pools\";\nimport type { WorkQueue } from \"@/api/work-queues\";\nimport { Button } from \"@/components/ui/button\";\nimport { Card } from \"@/components/ui/card\";\nimport {\n\tDialog,\n\tDialogContent,\n\tDialogHeader,\n\tDialogTitle,\n\tDialogTrigger,\n} from \"@/components/ui/dialog\";\nimport { Icon, type IconId } from \"@/components/ui/icons\";\nimport { LazyJsonInput as JsonInput } from \"@/components/ui/json-input-lazy\";\nimport { StateBadge } from \"@/components/ui/state-badge\";\nimport { Typography } from \"@/components/ui/typography\";\nimport { capitalize } from \"@/utils\";\n\nconst ACTION_TYPE_TO_STRING = {\n\t\"cancel-flow-run\": \"Cancel flow run\",\n\t\"suspend-flow-run\": \"Suspend flow run\",\n\t\"resume-flow-run\": \"Resume a flow run\",\n\t\"change-flow-run-state\": \"Change state of a flow run\",\n\t\"run-deployment\": \"Run deployment\",\n\t\"pause-deployment\": \"Pause deployment\",\n\t\"resume-deployment\": \"Resume deployment\",\n\t\"pause-work-queue\": \"Pause work queue\",\n\t\"resume-work-queue\": \"Resume work queue\",\n\t\"pause-work-pool\": \"Pause work pool\",\n\t\"resume-work-pool\": \"Resume work pool\",\n\t\"pause-automation\": \"Pause automation\",\n\t\"resume-automation\": \"Resume automation\",\n\t\"call-webhook\": \"Call webhook using\",\n\t/** Default string if `block_type_name` is not found. */\n\t\"send-notification\": \"Send a notification using\",\n\t\"do-nothing\": \"Do nothing\",\n} as const;\ntype ActionLabel =\n\t(typeof ACTION_TYPE_TO_STRING)[keyof typeof ACTION_TYPE_TO_STRING];\n\ntype AutomationAction = Automation[\"actions\"][number];\n\ntype ActionDetailsProps = {\n\taction: AutomationAction;\n\tautomationsMap: Map<string, Automation>;\n\tblockDocumentsMap: Map<string, BlockDocument>;\n\tdeploymentsMap: Map<string, Deployment>;\n\tworkPoolsMap: Map<string, WorkPool>;\n\tworkQueuesMap: Map<string, WorkQueue>;\n};\nexport const ActionDetails = ({\n\taction,\n\tautomationsMap,\n\tblockDocumentsMap,\n\tdeploymentsMap,\n\tworkPoolsMap,\n\tworkQueuesMap,\n}: ActionDetailsProps) => (\n\t<Card className=\"p-4\">\n\t\t<ActionDetailsType\n\t\t\taction={action}\n\t\t\tautomationsMap={automationsMap}\n\t\t\tblockDocumentsMap={blockDocumentsMap}\n\t\t\tdeploymentsMap={deploymentsMap}\n\t\t\tworkPoolsMap={workPoolsMap}\n\t\t\tworkQueuesMap={workQueuesMap}\n\t\t/>\n\t</Card>\n);\n\nconst ActionDetailsType = ({\n\taction,\n\tautomationsMap,\n\tblockDocumentsMap,\n\tdeploymentsMap,\n\tworkPoolsMap,\n\tworkQueuesMap,\n}: ActionDetailsProps) => {\n\tconst label = ACTION_TYPE_TO_STRING[action.type];\n\tswitch (action.type) {\n\t\t// Non-inferrable Actions\n\t\tcase \"cancel-flow-run\":\n\t\tcase \"suspend-flow-run\":\n\t\tcase \"resume-flow-run\":\n\t\tcase \"do-nothing\":\n\t\t\treturn <NoninferredAction label={label} />;\n\t\t// Inferable actions\n\t\tcase \"run-deployment\":\n\t\t\tif (action.deployment_id && action.source === \"selected\") {\n\t\t\t\tconst deployment = deploymentsMap.get(action.deployment_id);\n\t\t\t\tif (!deployment) {\n\t\t\t\t\treturn <Typography>Deployment not found</Typography>;\n\t\t\t\t}\n\t\t\t\treturn (\n\t\t\t\t\t<DeploymentActionDetails\n\t\t\t\t\t\tlabel={label}\n\t\t\t\t\t\tdeployment={deployment}\n\t\t\t\t\t\tparameters={action.parameters}\n\t\t\t\t\t\tjob_variables={action.job_variables}\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn <InferredAction label={label} />;\n\t\tcase \"pause-deployment\":\n\t\tcase \"resume-deployment\":\n\t\t\tif (action.deployment_id && action.source === \"selected\") {\n\t\t\t\tconst deployment = deploymentsMap.get(action.deployment_id);\n\t\t\t\tif (!deployment) {\n\t\t\t\t\treturn <Typography>Deployment not found</Typography>;\n\t\t\t\t}\n\t\t\t\treturn (\n\t\t\t\t\t<DeploymentActionDetails label={label} deployment={deployment} />\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn <InferredAction label={label} />;\n\t\tcase \"pause-work-queue\":\n\t\tcase \"resume-work-queue\":\n\t\t\tif (action.work_queue_id && action.source === \"selected\") {\n\t\t\t\tconst workQueue = workQueuesMap.get(action.work_queue_id);\n\t\t\t\tif (!workQueue) {\n\t\t\t\t\treturn <Typography>Work queue not found</Typography>;\n\t\t\t\t}\n\t\t\t\treturn <WorkQueueActionDetails label={label} workQueue={workQueue} />;\n\t\t\t}\n\t\t\treturn <InferredAction label={label} />;\n\t\tcase \"pause-automation\":\n\t\tcase \"resume-automation\":\n\t\t\tif (action.automation_id && action.source === \"selected\") {\n\t\t\t\tconst automation = automationsMap.get(action.automation_id);\n\t\t\t\tif (!automation) {\n\t\t\t\t\treturn <Typography>Automation not found</Typography>;\n\t\t\t\t}\n\t\t\t\treturn (\n\t\t\t\t\t<AutomationActionDetails label={label} automation={automation} />\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn <InferredAction label={label} />;\n\t\tcase \"pause-work-pool\":\n\t\tcase \"resume-work-pool\":\n\t\t\tif (action.work_pool_id && action.source === \"selected\") {\n\t\t\t\tconst workPool = workPoolsMap.get(action.work_pool_id);\n\t\t\t\tif (!workPool) {\n\t\t\t\t\treturn <Typography>Workpool not found</Typography>;\n\t\t\t\t}\n\t\t\t\treturn <WorkPoolActionDetails label={label} workPool={workPool} />;\n\t\t\t}\n\t\t\treturn <InferredAction label={label} />;\n\t\t// Other actions\n\t\tcase \"send-notification\": {\n\t\t\tconst blockDocument = blockDocumentsMap.get(action.block_document_id);\n\t\t\tif (!blockDocument) {\n\t\t\t\treturn <Typography>Block document not found</Typography>;\n\t\t\t}\n\t\t\treturn (\n\t\t\t\t<BlockDocumentActionDetails\n\t\t\t\t\tlabel={label}\n\t\t\t\t\tblockDocument={blockDocument}\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\t\tcase \"call-webhook\": {\n\t\t\tconst blockDocument = blockDocumentsMap.get(action.block_document_id);\n\t\t\tif (!blockDocument) {\n\t\t\t\treturn <Typography>Block document not found</Typography>;\n\t\t\t}\n\t\t\treturn (\n\t\t\t\t<CallWebhookActionDetails label={label} blockDocument={blockDocument} />\n\t\t\t);\n\t\t}\n\t\tcase \"change-flow-run-state\":\n\t\t\treturn (\n\t\t\t\t<ChangeFlowRunStateActionDetails\n\t\t\t\t\tlabel={label}\n\t\t\t\t\ttype={action.state}\n\t\t\t\t\tname={action.name}\n\t\t\t\t/>\n\t\t\t);\n\t\tdefault:\n\t\t\treturn null;\n\t}\n};\n\nconst ActionResource = ({ children }: { children: React.ReactNode }) => (\n\t<div className=\"text-sm flex items-center gap-1\">{children}</div>\n);\n\nconst ActionResourceName = ({\n\ticonId,\n\tname,\n}: {\n\tname: string;\n\ticonId: IconId;\n}) => (\n\t<div className=\"text-xs flex items-center\">\n\t\t<Icon id={iconId} className=\"size-4 mr-1\" />\n\t\t{name}\n\t</div>\n);\n\nconst NoninferredAction = ({ label }: { label: ActionLabel }) => (\n\t<Typography variant=\"bodySmall\">{label} from the triggering event</Typography>\n);\n\nconst InferredAction = ({ label }: { label: ActionLabel }) => (\n\t<Typography variant=\"bodySmall\">\n\t\t{label} inferred from the triggering event\n\t</Typography>\n);\n\ntype ChangeFlowRunStateActionDetailsProps = {\n\tlabel: ActionLabel;\n\ttype: components[\"schemas\"][\"StateType\"];\n\tname?: string | null;\n};\n\nexport const ChangeFlowRunStateActionDetails = ({\n\tlabel,\n\ttype,\n\tname,\n}: ChangeFlowRunStateActionDetailsProps) => {\n\treturn (\n\t\t<ActionResource>\n\t\t\t<InferredAction label={label} /> to <StateBadge type={type} name={name} />\n\t\t</ActionResource>\n\t);\n};\n\n// Selected resources\ntype DeploymentActionDetailsProps = {\n\tlabel: ActionLabel;\n\tdeployment: Deployment;\n\tparameters?: Record<string, unknown> | null;\n\tjob_variables?: Record<string, unknown> | null;\n};\nexport const DeploymentActionDetails = ({\n\tlabel,\n\tdeployment,\n\tparameters,\n\tjob_variables,\n}: DeploymentActionDetailsProps) => {\n\treturn (\n\t\t<ActionResource>\n\t\t\t<label htmlFor={`${label}-${deployment.id}`}>{label}:</label>\n\t\t\t<Link\n\t\t\t\tto=\"/deployments/deployment/$id\"\n\t\t\t\tparams={{ id: deployment.id }}\n\t\t\t\taria-label={deployment.name}\n\t\t\t>\n\t\t\t\t<ActionResourceName iconId=\"Rocket\" name={deployment.name} />\n\t\t\t</Link>\n\t\t\t{parameters !== undefined && (\n\t\t\t\t<RunDeploymentJsonDialog title=\"Parameters\" payload={parameters} />\n\t\t\t)}\n\t\t\t{job_variables !== undefined && (\n\t\t\t\t<RunDeploymentJsonDialog\n\t\t\t\t\ttitle=\"Job Variables\"\n\t\t\t\t\tpayload={job_variables}\n\t\t\t\t/>\n\t\t\t)}\n\t\t</ActionResource>\n\t);\n};\n\ntype RunDeploymentJsonDialogProps = {\n\ttitle: string;\n\tpayload: Record<string, unknown> | null | undefined;\n};\n\nconst RunDeploymentJsonDialog = ({\n\ttitle,\n\tpayload,\n}: RunDeploymentJsonDialogProps) => {\n\treturn (\n\t\t<Dialog>\n\t\t\t<DialogTrigger asChild>\n\t\t\t\t<Button variant=\"secondary\" size=\"sm\">\n\t\t\t\t\tShow {capitalize(title)}\n\t\t\t\t</Button>\n\t\t\t</DialogTrigger>\n\t\t\t<DialogContent aria-describedby={undefined}>\n\t\t\t\t<DialogHeader>\n\t\t\t\t\t<DialogTitle>{title}</DialogTitle>\n\t\t\t\t</DialogHeader>\n\t\t\t\t<JsonInput value={JSON.stringify(payload)} disabled />\n\t\t\t</DialogContent>\n\t\t</Dialog>\n\t);\n};\n\ntype AutomationActionDetailsProps = {\n\tlabel: ActionLabel;\n\tautomation: Automation;\n};\nexport const AutomationActionDetails = ({\n\tlabel,\n\tautomation,\n}: AutomationActionDetailsProps) => {\n\treturn (\n\t\t<ActionResource>\n\t\t\t<label htmlFor={`${label}-${automation.id}`}>{label}:</label>\n\t\t\t<Link\n\t\t\t\tto=\"/automations/automation/$id\"\n\t\t\t\tparams={{ id: automation.id }}\n\t\t\t\taria-label={automation.name}\n\t\t\t>\n\t\t\t\t<ActionResourceName iconId=\"Bot\" name={automation.name} />\n\t\t\t</Link>\n\t\t</ActionResource>\n\t);\n};\n\ntype BlockDocumentActionDetailsProps = {\n\tlabel: ActionLabel;\n\tblockDocument: BlockDocument;\n};\nexport const BlockDocumentActionDetails = ({\n\tlabel,\n\tblockDocument,\n}: BlockDocumentActionDetailsProps) => {\n\tif (!blockDocument.name) {\n\t\treturn <Typography>Block not found</Typography>;\n\t}\n\n\tconst _label = blockDocument.block_type_name\n\t\t? `Send a ${blockDocument.block_type_name.toLowerCase()} using`\n\t\t: label;\n\n\treturn (\n\t\t<ActionResource>\n\t\t\t<label htmlFor={`${label}-${blockDocument.id}`}>{_label}</label>\n\t\t\t<Link\n\t\t\t\tto=\"/blocks/block/$id\"\n\t\t\t\tparams={{ id: blockDocument.id }}\n\t\t\t\taria-label={blockDocument.name}\n\t\t\t>\n\t\t\t\t<ActionResourceName iconId=\"Box\" name={blockDocument.name} />\n\t\t\t</Link>\n\t\t</ActionResource>\n\t);\n};\n\ntype CallWebhookActionDetailsProps = {\n\tlabel: ActionLabel;\n\tblockDocument: BlockDocument;\n};\nexport const CallWebhookActionDetails = ({\n\tlabel,\n\tblockDocument,\n}: CallWebhookActionDetailsProps) => {\n\tif (!blockDocument.name) {\n\t\treturn <Typography>Block not found</Typography>;\n\t}\n\n\treturn (\n\t\t<ActionResource>\n\t\t\t<label htmlFor={`${label}-${blockDocument.id}`}>{label}</label>\n\t\t\t<Link\n\t\t\t\tto=\"/blocks/block/$id\"\n\t\t\t\tparams={{ id: blockDocument.id }}\n\t\t\t\taria-label={blockDocument.name}\n\t\t\t>\n\t\t\t\t<ActionResourceName iconId=\"Box\" name={blockDocument.name} />\n\t\t\t</Link>\n\t\t</ActionResource>\n\t);\n};\n\ntype WorkPoolActionDetailsProps = {\n\tlabel: ActionLabel;\n\tworkPool: WorkPool;\n};\nexport const WorkPoolActionDetails = ({\n\tlabel,\n\tworkPool,\n}: WorkPoolActionDetailsProps) => {\n\treturn (\n\t\t<ActionResource>\n\t\t\t<label htmlFor={`${label}-${workPool.id}`}>{label}:</label>\n\t\t\t<Link\n\t\t\t\tto=\"/work-pools/work-pool/$workPoolName\"\n\t\t\t\tparams={{ workPoolName: workPool.name }}\n\t\t\t\taria-label={workPool.name}\n\t\t\t>\n\t\t\t\t<ActionResourceName iconId=\"Cpu\" name={workPool.name} />\n\t\t\t</Link>\n\t\t</ActionResource>\n\t);\n};\n\ntype WorkQueueActionDetailsProps = {\n\tlabel: ActionLabel;\n\tworkQueue: WorkQueue;\n};\nexport const WorkQueueActionDetails = ({\n\tlabel,\n\tworkQueue,\n}: WorkQueueActionDetailsProps) => {\n\treturn (\n\t\t<ActionResource>\n\t\t\t<label htmlFor={`${label}-${workQueue.id}`}>{label}:</label>\n\t\t\t<Link\n\t\t\t\tto=\"/work-pools/work-pool/$workPoolName/queue/$workQueueName\"\n\t\t\t\tparams={{\n\t\t\t\t\tworkPoolName: workQueue.name,\n\t\t\t\t\tworkQueueName: workQueue.name,\n\t\t\t\t}}\n\t\t\t\taria-label={workQueue.name}\n\t\t\t>\n\t\t\t\t<ActionResourceName iconId=\"Cpu\" name={workQueue.name} />\n\t\t\t</Link>\n\t\t</ActionResource>\n\t);\n};\n","import { Typography } from \"@/components/ui/typography\";\nimport type { CompoundTrigger } from \"./trigger-utils\";\n\ntype TriggerDetailsCompoundProps = {\n\ttrigger: CompoundTrigger;\n};\n\nexport const TriggerDetailsCompound = ({\n\ttrigger,\n}: TriggerDetailsCompoundProps) => {\n\tconst triggerCount = trigger.triggers?.length ?? 0;\n\tconst requireValue = trigger.require;\n\n\tlet requireLabel: string;\n\tif (requireValue === \"all\") {\n\t\trequireLabel = \"all\";\n\t} else if (requireValue === \"any\") {\n\t\trequireLabel = \"any\";\n\t} else if (typeof requireValue === \"number\") {\n\t\trequireLabel = `at least ${requireValue}`;\n\t} else {\n\t\trequireLabel = \"all\";\n\t}\n\n\treturn (\n\t\t<div className=\"flex flex-wrap gap-1 items-center\">\n\t\t\t<Typography variant=\"bodySmall\">\n\t\t\t\tA compound trigger requiring {requireLabel} of {triggerCount} nested{\" \"}\n\t\t\t\t{triggerCount === 1 ? \"trigger\" : \"triggers\"} to fire\n\t\t\t</Typography>\n\t\t</div>\n\t);\n};\n","import { Typography } from \"@/components/ui/typography\";\n\nexport const TriggerDetailsCustom = () => {\n\treturn <Typography variant=\"bodySmall\">A custom trigger</Typography>;\n};\n","import { useSuspenseQuery } from \"@tanstack/react-query\";\nimport { Link } from \"@tanstack/react-router\";\nimport { Suspense } from \"react\";\nimport { buildDeploymentDetailsQuery } from \"@/api/deployments\";\nimport { Icon } from \"@/components/ui/icons\";\nimport { Skeleton } from \"@/components/ui/skeleton\";\n\ntype DeploymentLinkProps = {\n\tdeploymentId: string;\n};\n\nexport const DeploymentLink = ({ deploymentId }: DeploymentLinkProps) => {\n\treturn (\n\t\t<Suspense fallback={<Skeleton className=\"h-4 w-full\" />}>\n\t\t\t<DeploymentLinkImplementation deploymentId={deploymentId} />\n\t\t</Suspense>\n\t);\n};\n\nconst DeploymentLinkImplementation = ({\n\tdeploymentId,\n}: DeploymentLinkProps) => {\n\tconst { data: deployment } = useSuspenseQuery(\n\t\tbuildDeploymentDetailsQuery(deploymentId),\n\t);\n\n\treturn (\n\t\t<div className=\"flex items-center gap-1 text-xs\">\n\t\t\tDeployment\n\t\t\t<Link\n\t\t\t\tto=\"/deployments/deployment/$id\"\n\t\t\t\tparams={{ id: deployment.id }}\n\t\t\t\tclassName=\"flex items-center gap-1\"\n\t\t\t>\n\t\t\t\t<Icon id=\"Rocket\" className=\"size-4\" />\n\t\t\t\t{deployment.name}\n\t\t\t</Link>\n\t\t</div>\n\t);\n};\n","import type { components } from \"@/api/prefect\";\n\n// Type aliases for OpenAPI schema types\nexport type EventTrigger = components[\"schemas\"][\"EventTrigger\"];\nexport type CompoundTrigger = components[\"schemas\"][\"CompoundTrigger-Input\"];\nexport type SequenceTrigger = components[\"schemas\"][\"SequenceTrigger-Input\"];\n\n// Union type for all automation triggers\nexport type AutomationTrigger =\n\t| EventTrigger\n\t| CompoundTrigger\n\t| SequenceTrigger;\n\n// Template constants - following Vue implementation (5 templates)\nexport const AUTOMATION_TRIGGER_TEMPLATES = [\n\t\"deployment-status\",\n\t\"flow-run-state\",\n\t\"work-pool-status\",\n\t\"work-queue-status\",\n\t\"custom\",\n] as const;\n\nexport type AutomationTriggerTemplate =\n\t(typeof AUTOMATION_TRIGGER_TEMPLATES)[number];\n\n// Event posture types\nexport type AutomationTriggerEventPosture = \"Reactive\" | \"Proactive\";\n\n// Default threshold for event triggers (from Vue implementation)\nexport const DEFAULT_EVENT_TRIGGER_THRESHOLD = 1;\n\n// Event constants for each template type\nexport const DEPLOYMENT_STATUS_EVENTS = [\n\t\"prefect.deployment.ready\",\n\t\"prefect.deployment.not-ready\",\n\t\"prefect.deployment.disabled\",\n] as const;\n\nexport const WORK_POOL_STATUS_EVENTS = [\n\t\"prefect.work-pool.ready\",\n\t\"prefect.work-pool.not-ready\",\n\t\"prefect.work-pool.paused\",\n\t\"prefect.work-pool.not_ready\",\n] as const;\n\nexport const WORK_QUEUE_STATUS_EVENTS = [\n\t\"prefect.work-queue.ready\",\n\t\"prefect.work-queue.not-ready\",\n\t\"prefect.work-queue.paused\",\n] as const;\n\n// Type guard helper - check if value is a record/object\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\n// Primary type guards for trigger types\nexport function isEventTrigger(trigger: unknown): trigger is EventTrigger {\n\treturn (\n\t\tisRecord(trigger) &&\n\t\ttrigger.type === \"event\" &&\n\t\t(trigger.posture === \"Reactive\" || trigger.posture === \"Proactive\")\n\t);\n}\n\nexport function isCompoundTrigger(\n\ttrigger: unknown,\n): trigger is CompoundTrigger {\n\treturn (\n\t\tisRecord(trigger) &&\n\t\ttrigger.type === \"compound\" &&\n\t\tArray.isArray(trigger.triggers)\n\t);\n}\n\nexport function isSequenceTrigger(\n\ttrigger: unknown,\n): trigger is SequenceTrigger {\n\treturn (\n\t\tisRecord(trigger) &&\n\t\ttrigger.type === \"sequence\" &&\n\t\tArray.isArray(trigger.triggers)\n\t);\n}\n\nexport function isAutomationTrigger(\n\ttrigger: unknown,\n): trigger is AutomationTrigger {\n\treturn (\n\t\tisEventTrigger(trigger) ||\n\t\tisCompoundTrigger(trigger) ||\n\t\tisSequenceTrigger(trigger)\n\t);\n}\n\n// Helper to convert value to array (handles undefined, single value, or array)\nfunction asArray<T>(value: T | T[] | undefined | null): T[] {\n\tif (value === undefined || value === null) {\n\t\treturn [];\n\t}\n\treturn Array.isArray(value) ? value : [value];\n}\n\n// Get match value from trigger (handles snake_case field names from OpenAPI)\nfunction getTriggerMatchValue(\n\ttrigger: AutomationTrigger,\n\tkey: string,\n): string[] {\n\tif (isEventTrigger(trigger)) {\n\t\tconst match = trigger.match;\n\t\tif (match && typeof match === \"object\") {\n\t\t\tconst value = (match as Record<string, unknown>)[key];\n\t\t\treturn value ? asArray(value as string | string[]) : [];\n\t\t}\n\t}\n\treturn [];\n}\n\n// Validation helper: check if match resource satisfies predicate\nexport function isMatchResource(\n\ttrigger: AutomationTrigger,\n\tpredicate: (resourceIds: string[]) => boolean,\n): boolean {\n\tconst prefectResourceIds = getTriggerMatchValue(\n\t\ttrigger,\n\t\t\"prefect.resource.id\",\n\t);\n\n\tif (prefectResourceIds.length === 0) {\n\t\treturn false;\n\t}\n\n\treturn predicate(prefectResourceIds);\n}\n\n// Validation helper: check if for_each contains the expected resource\nexport function isForEachResource(\n\ttrigger: AutomationTrigger,\n\tresource: string,\n): boolean {\n\tif (isEventTrigger(trigger)) {\n\t\tconst forEach = trigger.for_each ?? [];\n\t\treturn forEach.every((value) => value.startsWith(resource));\n\t}\n\treturn false;\n}\n\n// Validation helper: check if after events satisfy predicate\nexport function isAfterResource(\n\ttrigger: AutomationTrigger,\n\tpredicate: (events: string[]) => boolean,\n): boolean {\n\tif (isEventTrigger(trigger)) {\n\t\treturn predicate(trigger.after ?? []);\n\t}\n\treturn false;\n}\n\n// Validation helper: check if expect events satisfy predicate\nexport function isExpectResource(\n\ttrigger: AutomationTrigger,\n\tpredicate: (events: string[]) => boolean,\n): boolean {\n\tif (isEventTrigger(trigger)) {\n\t\treturn predicate(trigger.expect ?? []);\n\t}\n\treturn false;\n}\n\n// Event type checkers\nfunction isDeploymentStatusEvent(event: string): boolean {\n\treturn (DEPLOYMENT_STATUS_EVENTS as readonly string[]).includes(event);\n}\n\nfunction isWorkPoolStatusEvent(event: string): boolean {\n\treturn (WORK_POOL_STATUS_EVENTS as readonly string[]).includes(event);\n}\n\nfunction isWorkQueueStatusEvent(event: string): boolean {\n\treturn (WORK_QUEUE_STATUS_EVENTS as readonly string[]).includes(event);\n}\n\n// Template-specific type guards\n\n/**\n * Check if trigger is a deployment-status template\n * Validates:\n * - Is an event trigger\n * - match['prefect.resource.id'] starts with 'prefect.deployment'\n * - for_each contains 'prefect.resource.id'\n * - after events are deployment status events\n * - expect events are deployment status events\n * - threshold === 1\n */\nexport function isDeploymentStatusTrigger(trigger: unknown): boolean {\n\treturn (\n\t\tisEventTrigger(trigger) &&\n\t\tisMatchResource(trigger, (prefectResourceIds) =>\n\t\t\tprefectResourceIds.every((value) =>\n\t\t\t\tvalue.startsWith(\"prefect.deployment\"),\n\t\t\t),\n\t\t) &&\n\t\tisForEachResource(trigger, \"prefect.resource.id\") &&\n\t\tisAfterResource(trigger, (triggerAfters) =>\n\t\t\ttriggerAfters.every((after) => isDeploymentStatusEvent(after)),\n\t\t) &&\n\t\tisExpectResource(trigger, (triggerExpects) =>\n\t\t\ttriggerExpects.every((expect) => isDeploymentStatusEvent(expect)),\n\t\t) &&\n\t\ttrigger.threshold === DEFAULT_EVENT_TRIGGER_THRESHOLD\n\t);\n}\n\n// Helper functions for flow-run-state template validation\nfunction getTriggerMatchRelatedValue(\n\ttrigger: EventTrigger,\n\tkey: string,\n): string[] {\n\tconst matchRelated = trigger.match_related;\n\tif (!matchRelated) {\n\t\treturn [];\n\t}\n\n\t// match_related can be a single object or an array of objects\n\tconst matchRelatedArray = Array.isArray(matchRelated)\n\t\t? matchRelated\n\t\t: [matchRelated];\n\n\tconst values: string[] = [];\n\tfor (const match of matchRelatedArray) {\n\t\tif (match && typeof match === \"object\") {\n\t\t\tconst value = (match as Record<string, unknown>)[key];\n\t\t\tif (value) {\n\t\t\t\tvalues.push(...asArray(value as string | string[]));\n\t\t\t}\n\t\t}\n\t}\n\treturn values;\n}\n\nfunction isEmptyMatchRelated(trigger: EventTrigger): boolean {\n\tconst matchRelated = trigger.match_related;\n\tif (!matchRelated) {\n\t\treturn true;\n\t}\n\tif (Array.isArray(matchRelated)) {\n\t\treturn matchRelated.length === 0;\n\t}\n\treturn Object.keys(matchRelated).length === 0;\n}\n\nfunction isMatchRelatedResource(\n\ttrigger: EventTrigger,\n\tresource: string,\n): boolean {\n\tconst prefectResourceIds = getTriggerMatchRelatedValue(\n\t\ttrigger,\n\t\t\"prefect.resource.id\",\n\t);\n\n\tif (prefectResourceIds.length === 0) {\n\t\treturn false;\n\t}\n\n\treturn prefectResourceIds.every((value) => value.startsWith(resource));\n}\n\nfunction isFlowRunStateTriggerMatchRelated(trigger: EventTrigger): boolean {\n\treturn (\n\t\tisEmptyMatchRelated(trigger) ||\n\t\tisMatchRelatedResource(trigger, \"prefect.flow\") ||\n\t\tisMatchRelatedResource(trigger, \"prefect.tag\")\n\t);\n}\n\n/**\n * Check if trigger is a flow-run-state template\n * Validates:\n * - Is an event trigger\n * - match['prefect.resource.id'] starts with 'prefect.flow-run'\n * - for_each contains 'prefect.resource.id'\n * - after events start with 'prefect.flow-run'\n * - expect events start with 'prefect.flow-run'\n * - matchRelated is empty OR contains flow/tag patterns\n * - threshold === 1\n */\nexport function isFlowRunStateTrigger(trigger: unknown): boolean {\n\treturn (\n\t\tisEventTrigger(trigger) &&\n\t\tisMatchResource(trigger, (prefectResourceIds) =>\n\t\t\tprefectResourceIds.every((value) => value.startsWith(\"prefect.flow-run\")),\n\t\t) &&\n\t\tisForEachResource(trigger, \"prefect.resource.id\") &&\n\t\tisAfterResource(trigger, (triggerAfters) =>\n\t\t\ttriggerAfters.every((after) => after.startsWith(\"prefect.flow-run\")),\n\t\t) &&\n\t\tisExpectResource(trigger, (triggerExpects) =>\n\t\t\ttriggerExpects.every((expect) => expect.startsWith(\"prefect.flow-run\")),\n\t\t) &&\n\t\tisFlowRunStateTriggerMatchRelated(trigger) &&\n\t\ttrigger.threshold === DEFAULT_EVENT_TRIGGER_THRESHOLD\n\t);\n}\n\n/**\n * Check if trigger is a work-pool-status template\n * Validates:\n * - Is an event trigger\n * - match['prefect.resource.id'] starts with 'prefect.work-pool'\n * - for_each contains 'prefect.resource.id'\n * - after events are work pool status events\n * - expect events are work pool status events\n * - threshold === 1\n */\nexport function isWorkPoolStatusTrigger(trigger: unknown): boolean {\n\treturn (\n\t\tisEventTrigger(trigger) &&\n\t\tisMatchResource(trigger, (prefectResourceIds) =>\n\t\t\tprefectResourceIds.every((value) =>\n\t\t\t\tvalue.startsWith(\"prefect.work-pool\"),\n\t\t\t),\n\t\t) &&\n\t\tisForEachResource(trigger, \"prefect.resource.id\") &&\n\t\tisAfterResource(trigger, (triggerAfters) =>\n\t\t\ttriggerAfters.every((after) => isWorkPoolStatusEvent(after)),\n\t\t) &&\n\t\tisExpectResource(trigger, (triggerExpects) =>\n\t\t\ttriggerExpects.every((expect) => isWorkPoolStatusEvent(expect)),\n\t\t) &&\n\t\ttrigger.threshold === DEFAULT_EVENT_TRIGGER_THRESHOLD\n\t);\n}\n\n/**\n * Check if trigger is a work-queue-status template\n * Validates:\n * - Is an event trigger\n * - match['prefect.resource.id'] starts with 'prefect.work-queue'\n * - for_each contains 'prefect.resource.id'\n * - after events are work queue status events\n * - expect events are work queue status events\n * - threshold === 1\n */\nexport function isWorkQueueStatusTrigger(trigger: unknown): boolean {\n\treturn (\n\t\tisEventTrigger(trigger) &&\n\t\tisMatchResource(trigger, (prefectResourceIds) =>\n\t\t\tprefectResourceIds.every((value) =>\n\t\t\t\tvalue.startsWith(\"prefect.work-queue\"),\n\t\t\t),\n\t\t) &&\n\t\tisForEachResource(trigger, \"prefect.resource.id\") &&\n\t\tisAfterResource(trigger, (triggerAfters) =>\n\t\t\ttriggerAfters.every((after) => isWorkQueueStatusEvent(after)),\n\t\t) &&\n\t\tisExpectResource(trigger, (triggerExpects) =>\n\t\t\ttriggerExpects.every((expect) => isWorkQueueStatusEvent(expect)),\n\t\t) &&\n\t\ttrigger.threshold === DEFAULT_EVENT_TRIGGER_THRESHOLD\n\t);\n}\n\n// Template check registry (excluding 'custom' which is the default)\nconst automationTriggerTemplateChecks: Record<\n\tExclude<AutomationTriggerTemplate, \"custom\">,\n\t(trigger: unknown) => boolean\n> = {\n\t\"deployment-status\": isDeploymentStatusTrigger,\n\t\"flow-run-state\": isFlowRunStateTrigger,\n\t\"work-pool-status\": isWorkPoolStatusTrigger,\n\t\"work-queue-status\": isWorkQueueStatusTrigger,\n};\n\n/**\n * Detect the template type of an automation trigger\n * Returns 'custom' if no template matches\n */\nexport function getAutomationTriggerTemplate(\n\ttrigger: AutomationTrigger,\n): AutomationTriggerTemplate {\n\tfor (const [type, guard] of Object.entries(automationTriggerTemplateChecks)) {\n\t\tif (guard(trigger)) {\n\t\t\treturn type as AutomationTriggerTemplate;\n\t\t}\n\t}\n\n\treturn \"custom\";\n}\n\n// Template labels\nconst automationTriggerTemplateLabels: Record<\n\tAutomationTriggerTemplate,\n\tstring\n> = {\n\t\"deployment-status\": \"Deployment status\",\n\t\"flow-run-state\": \"Flow run state\",\n\t\"work-pool-status\": \"Work pool status\",\n\t\"work-queue-status\": \"Work queue status\",\n\tcustom: \"Custom\",\n};\n\n/**\n * Get human-readable label for a trigger template\n */\nexport function getAutomationTriggerTemplateLabel(\n\ttemplate: AutomationTriggerTemplate,\n): string {\n\treturn automationTriggerTemplateLabels[template];\n}\n\n/**\n * Get human-readable label for event posture\n * \"Reactive\" -> \"enters\"\n * \"Proactive\" -> \"stays in\"\n */\nexport function getAutomationTriggerEventPostureLabel(\n\tposture: AutomationTriggerEventPosture,\n): string {\n\tswitch (posture) {\n\t\tcase \"Reactive\":\n\t\t\treturn \"enters\";\n\t\tcase \"Proactive\":\n\t\t\treturn \"stays in\";\n\t}\n}\n\n/**\n * Check if a string is a valid automation trigger template\n */\nexport function isAutomationTriggerTemplate(\n\tvalue: string,\n): value is AutomationTriggerTemplate {\n\treturn (AUTOMATION_TRIGGER_TEMPLATES as readonly string[]).includes(value);\n}\n\n// Work queue status types and labels\nexport type WorkQueueStatusTriggerStatus = \"READY\" | \"NOT_READY\" | \"PAUSED\";\n\n/**\n * Get human-readable label for work queue status\n * \"READY\" -> \"Ready\"\n * \"NOT_READY\" -> \"Not Ready\"\n * \"PAUSED\" -> \"Paused\"\n */\nexport function getWorkQueueStatusLabel(\n\tstatus: WorkQueueStatusTriggerStatus,\n): string {\n\tswitch (status) {\n\t\tcase \"READY\":\n\t\t\treturn \"Ready\";\n\t\tcase \"NOT_READY\":\n\t\t\treturn \"Not Ready\";\n\t\tcase \"PAUSED\":\n\t\t\treturn \"Paused\";\n\t\tdefault: {\n\t\t\tconst exhaustive: never = status;\n\t\t\tthrow new Error(\n\t\t\t\t`getWorkQueueStatusLabel missing case for ${exhaustive as string}`,\n\t\t\t);\n\t\t}\n\t}\n}\n","import { DeploymentLink } from \"@/components/deployments/deployment-link\";\nimport { secondsToString } from \"@/utils/seconds\";\nimport {\n\ttype AutomationTriggerEventPosture,\n\tgetAutomationTriggerEventPostureLabel,\n} from \"./trigger-utils\";\n\ntype DeploymentStatus = \"ready\" | \"not_ready\";\n\ntype TriggerDetailsDeploymentStatusProps = {\n\tdeploymentIds: string[];\n\tposture: AutomationTriggerEventPosture;\n\tstatus: DeploymentStatus;\n\ttime?: number;\n};\n\nfunction getDeploymentStatusLabel(status: DeploymentStatus): string {\n\tswitch (status) {\n\t\tcase \"ready\":\n\t\t\treturn \"ready\";\n\t\tcase \"not_ready\":\n\t\t\treturn \"not ready\";\n\t}\n}\n\nexport const TriggerDetailsDeploymentStatus = ({\n\tdeploymentIds,\n\tposture,\n\tstatus,\n\ttime,\n}: TriggerDetailsDeploymentStatusProps) => {\n\tconst isAnyDeployment = deploymentIds.length === 0;\n\tconst postureLabel = getAutomationTriggerEventPostureLabel(posture);\n\tconst statusLabel = getDeploymentStatusLabel(status);\n\n\treturn (\n\t\t<div className=\"flex flex-wrap gap-1 items-center\">\n\t\t\t<span>When</span>\n\n\t\t\t{isAnyDeployment ? (\n\t\t\t\t<span>any deployment</span>\n\t\t\t) : (\n\t\t\t\tdeploymentIds.map((deploymentId, index) => (\n\t\t\t\t\t<span key={deploymentId} className=\"flex items-center gap-1\">\n\t\t\t\t\t\t<DeploymentLink deploymentId={deploymentId} />\n\t\t\t\t\t\t{index === deploymentIds.length - 2 && <span>or</span>}\n\t\t\t\t\t</span>\n\t\t\t\t))\n\t\t\t)}\n\n\t\t\t<span>{postureLabel}</span>\n\t\t\t<span>{statusLabel}</span>\n\n\t\t\t{posture === \"Proactive\" && time !== undefined && time > 0 && (\n\t\t\t\t<span>for {secondsToString(time)}</span>\n\t\t\t)}\n\t\t</div>\n\t);\n};\n","import type { components } from \"@/api/prefect\";\nimport { FlowLink } from \"@/components/flows/flow-link\";\nimport { StateBadge } from \"@/components/ui/state-badge\";\nimport { TagBadgeGroup } from \"@/components/ui/tag-badge-group\";\nimport { secondsToApproximateString } from \"@/utils\";\nimport {\n\ttype AutomationTriggerEventPosture,\n\tgetAutomationTriggerEventPostureLabel,\n} from \"./trigger-utils\";\n\ntype StateType = components[\"schemas\"][\"StateType\"];\n\ntype TriggerDetailsFlowRunStateProps = {\n\tflowIds: string[];\n\ttags: string[];\n\tposture: AutomationTriggerEventPosture;\n\tstates: string[];\n\ttime?: number;\n};\n\n/**\n * Maps a state name string to a StateType enum value.\n * Handles various state name formats (e.g., \"Completed\", \"COMPLETED\", \"completed\")\n * and maps them to the uppercase StateType values expected by StateBadge.\n */\nfunction mapStateNameToStateType(stateName: string): StateType | null {\n\tconst normalizedName = stateName.toUpperCase();\n\n\tconst validStateTypes: StateType[] = [\n\t\t\"COMPLETED\",\n\t\t\"FAILED\",\n\t\t\"RUNNING\",\n\t\t\"CANCELLED\",\n\t\t\"CANCELLING\",\n\t\t\"CRASHED\",\n\t\t\"PAUSED\",\n\t\t\"PENDING\",\n\t\t\"SCHEDULED\",\n\t];\n\n\tif (validStateTypes.includes(normalizedName as StateType)) {\n\t\treturn normalizedName as StateType;\n\t}\n\n\treturn null;\n}\n\nexport const TriggerDetailsFlowRunState = ({\n\tflowIds,\n\ttags,\n\tposture,\n\tstates,\n\ttime,\n}: TriggerDetailsFlowRunStateProps) => {\n\tconst postureLabel = getAutomationTriggerEventPostureLabel(posture);\n\n\treturn (\n\t\t<div className=\"flex flex-wrap gap-1 items-center\">\n\t\t\t<span>When any flow run</span>\n\n\t\t\t{flowIds.length > 0 && (\n\t\t\t\t<>\n\t\t\t\t\t<span>of flow</span>\n\t\t\t\t\t{flowIds.map((flowId, index) => (\n\t\t\t\t\t\t<span key={flowId} className=\"flex items-center gap-1\">\n\t\t\t\t\t\t\t<FlowLink flowId={flowId} />\n\t\t\t\t\t\t\t{index === flowIds.length - 2 && <span>or</span>}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t))}\n\t\t\t\t</>\n\t\t\t)}\n\n\t\t\t{tags.length > 0 && (\n\t\t\t\t<>\n\t\t\t\t\t<span>with the tag</span>\n\t\t\t\t\t<TagBadgeGroup tags={tags} />\n\t\t\t\t</>\n\t\t\t)}\n\n\t\t\t<span>{postureLabel}</span>\n\n\t\t\t{states.length > 0 ? (\n\t\t\t\tstates.map((state) => {\n\t\t\t\t\tconst stateType = mapStateNameToStateType(state);\n\t\t\t\t\tif (stateType) {\n\t\t\t\t\t\treturn <StateBadge key={state} type={stateType} />;\n\t\t\t\t\t}\n\t\t\t\t\treturn null;\n\t\t\t\t})\n\t\t\t) : (\n\t\t\t\t<span>any state</span>\n\t\t\t)}\n\n\t\t\t{posture === \"Proactive\" && time !== undefined && time > 0 && (\n\t\t\t\t<span>for {secondsToApproximateString(time)}</span>\n\t\t\t)}\n\t\t</div>\n\t);\n};\n","import { Typography } from \"@/components/ui/typography\";\nimport type { SequenceTrigger } from \"./trigger-utils\";\n\ntype TriggerDetailsSequenceProps = {\n\ttrigger: SequenceTrigger;\n};\n\nexport const TriggerDetailsSequence = ({\n\ttrigger,\n}: TriggerDetailsSequenceProps) => {\n\tconst triggerCount = trigger.triggers?.length ?? 0;\n\n\treturn (\n\t\t<div className=\"flex flex-wrap gap-1 items-center\">\n\t\t\t<Typography variant=\"bodySmall\">\n\t\t\t\tA sequence trigger with {triggerCount} nested{\" \"}\n\t\t\t\t{triggerCount === 1 ? \"trigger\" : \"triggers\"} that must fire in order\n\t\t\t</Typography>\n\t\t</div>\n\t);\n};\n","import { useQuery } from \"@tanstack/react-query\";\nimport { Link } from \"@tanstack/react-router\";\nimport { buildFilterWorkPoolsQuery, type WorkPool } from \"@/api/work-pools\";\nimport { Icon } from \"@/components/ui/icons\";\nimport { pluralize } from \"@/utils\";\nimport { secondsToString } from \"@/utils/seconds\";\nimport type { AutomationTriggerEventPosture } from \"./trigger-utils\";\n\ntype WorkPoolStatusType = \"READY\" | \"NOT_READY\" | \"PAUSED\";\n\nexport type TriggerDetailsWorkPoolStatusProps = {\n\tworkPoolIds: string[];\n\tposture: AutomationTriggerEventPosture;\n\tstatus: WorkPoolStatusType;\n\ttime?: number;\n};\n\nconst getStatusLabel = (status: WorkPoolStatusType): string => {\n\tswitch (status) {\n\t\tcase \"READY\":\n\t\t\treturn \"Ready\";\n\t\tcase \"NOT_READY\":\n\t\t\treturn \"Not Ready\";\n\t\tcase \"PAUSED\":\n\t\t\treturn \"Paused\";\n\t}\n};\n\nconst WorkPoolLinkInline = ({ workPoolName }: { workPoolName: string }) => {\n\treturn (\n\t\t<Link\n\t\t\tto=\"/work-pools/work-pool/$workPoolName\"\n\t\t\tparams={{ workPoolName }}\n\t\t\tclassName=\"inline-flex items-center gap-1\"\n\t\t>\n\t\t\t<Icon id=\"Cpu\" className=\"size-4\" />\n\t\t\t{workPoolName}\n\t\t</Link>\n\t);\n};\n\nconst renderWorkPoolLinks = (workPools: WorkPool[]) => {\n\tif (workPools.length === 0) {\n\t\treturn null;\n\t}\n\n\treturn workPools.map((workPool, index) => (\n\t\t<span key={workPool.id} className=\"inline-flex items-center gap-1\">\n\t\t\t<WorkPoolLinkInline workPoolName={workPool.name} />\n\t\t\t{index === workPools.length - 2 && \" or \"}\n\t\t\t{index < workPools.length - 2 && \", \"}\n\t\t</span>\n\t));\n};\n\nexport const TriggerDetailsWorkPoolStatus = ({\n\tworkPoolIds,\n\tposture,\n\tstatus,\n\ttime,\n}: TriggerDetailsWorkPoolStatusProps) => {\n\tconst { data: workPools = [] } = useQuery(\n\t\tbuildFilterWorkPoolsQuery(\n\t\t\t{\n\t\t\t\toffset: 0,\n\t\t\t\twork_pools: { id: { any_: workPoolIds }, operator: \"and_\" },\n\t\t\t},\n\t\t\t{ enabled: workPoolIds.length > 0 },\n\t\t),\n\t);\n\n\tconst postureLabel = posture === \"Reactive\" ? \"enters\" : \"stays in\";\n\tconst statusLabel = getStatusLabel(status).toLowerCase();\n\n\tconst workPoolLabel =\n\t\tworkPoolIds.length === 0\n\t\t\t? \"any work pool\"\n\t\t\t: `${pluralize(workPoolIds.length, \"work pool\")} `;\n\n\treturn (\n\t\t<div className=\"flex flex-wrap gap-1 items-center\">\n\t\t\t<span>When</span>\n\t\t\t<span>{workPoolLabel}</span>\n\t\t\t{workPoolIds.length > 0 && renderWorkPoolLinks(workPools)}\n\t\t\t<span>{postureLabel}</span>\n\t\t\t<span>{statusLabel}</span>\n\t\t\t{posture === \"Proactive\" && time !== undefined && (\n\t\t\t\t<span>for {secondsToString(time)}</span>\n\t\t\t)}\n\t\t</div>\n\t);\n};\n","import { useSuspenseQueries } from \"@tanstack/react-query\";\nimport { Suspense } from \"react\";\nimport { buildGetWorkQueueQuery } from \"@/api/work-queues\";\nimport { Skeleton } from \"@/components/ui/skeleton\";\nimport { WorkPoolLink } from \"@/components/work-pools/work-pool-link\";\nimport { WorkQueueIconText } from \"@/components/work-pools/work-queue-icon-text\";\nimport { pluralize } from \"@/utils\";\nimport { secondsToString } from \"@/utils/seconds\";\nimport {\n\ttype AutomationTriggerEventPosture,\n\tgetAutomationTriggerEventPostureLabel,\n\tgetWorkQueueStatusLabel,\n\ttype WorkQueueStatusTriggerStatus,\n} from \"./trigger-utils\";\n\nexport type TriggerDetailsWorkQueueStatusProps = {\n\tworkQueueIds: string[];\n\tworkPoolNames: string[];\n\tposture: AutomationTriggerEventPosture;\n\tstatus: WorkQueueStatusTriggerStatus;\n\ttime?: number;\n};\n\nexport const TriggerDetailsWorkQueueStatus = (\n\tprops: TriggerDetailsWorkQueueStatusProps,\n) => {\n\treturn (\n\t\t<Suspense fallback={<Skeleton className=\"h-4 w-full\" />}>\n\t\t\t<TriggerDetailsWorkQueueStatusImplementation {...props} />\n\t\t</Suspense>\n\t);\n};\n\nconst TriggerDetailsWorkQueueStatusImplementation = ({\n\tworkQueueIds,\n\tworkPoolNames,\n\tposture,\n\tstatus,\n\ttime,\n}: TriggerDetailsWorkQueueStatusProps) => {\n\tconst anyWorkQueue = workQueueIds.length === 0;\n\tconst anyWorkPool = workPoolNames.length === 0;\n\n\tconst workQueueQueries = useSuspenseQueries({\n\t\tqueries: workQueueIds.map((id) => buildGetWorkQueueQuery(id)),\n\t});\n\n\tconst workQueues = workQueueQueries.map((query) => query.data);\n\n\treturn (\n\t\t<div className=\"flex flex-wrap gap-1 items-center text-sm\">\n\t\t\t<span>When</span>\n\n\t\t\t{anyWorkQueue ? (\n\t\t\t\t<span>any work queue</span>\n\t\t\t) : (\n\t\t\t\t<>\n\t\t\t\t\t<span>{pluralize(workQueues.length, \"work queue\")}</span>\n\t\t\t\t\t{workQueues.map((workQueue, index) => (\n\t\t\t\t\t\t<span key={workQueue.id} className=\"flex items-center gap-1\">\n\t\t\t\t\t\t\t<WorkQueueIconText\n\t\t\t\t\t\t\t\tworkPoolName={workQueue.work_pool_name ?? \"\"}\n\t\t\t\t\t\t\t\tworkQueueName={workQueue.name}\n\t\t\t\t\t\t\t\tshowLabel\n\t\t\t\t\t\t\t\tshowStatus\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{index === workQueues.length - 2 && <span>or</span>}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t))}\n\t\t\t\t</>\n\t\t\t)}\n\n\t\t\t{!anyWorkPool && (\n\t\t\t\t<>\n\t\t\t\t\t<span>from the {pluralize(workPoolNames.length, \"work pool\")}</span>\n\t\t\t\t\t{workPoolNames.map((workPoolName, index) => (\n\t\t\t\t\t\t<span key={workPoolName} className=\"flex items-center gap-1\">\n\t\t\t\t\t\t\t<WorkPoolLink workPoolName={workPoolName} />\n\t\t\t\t\t\t\t{index === workPoolNames.length - 2 && <span>or</span>}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t))}\n\t\t\t\t</>\n\t\t\t)}\n\n\t\t\t<span>{getAutomationTriggerEventPostureLabel(posture)}</span>\n\t\t\t<span>{getWorkQueueStatusLabel(status).toLowerCase()}</span>\n\n\t\t\t{posture === \"Proactive\" && time !== undefined && (\n\t\t\t\t<span>for {secondsToString(time)}</span>\n\t\t\t)}\n\t\t</div>\n\t);\n};\n","import { TriggerDetailsCompound } from \"./trigger-details-compound\";\nimport { TriggerDetailsCustom } from \"./trigger-details-custom\";\nimport { TriggerDetailsDeploymentStatus } from \"./trigger-details-deployment-status\";\nimport { TriggerDetailsFlowRunState } from \"./trigger-details-flow-run-state\";\nimport { TriggerDetailsSequence } from \"./trigger-details-sequence\";\nimport { TriggerDetailsWorkPoolStatus } from \"./trigger-details-work-pool-status\";\nimport { TriggerDetailsWorkQueueStatus } from \"./trigger-details-work-queue-status\";\nimport {\n\ttype AutomationTrigger,\n\ttype AutomationTriggerEventPosture,\n\ttype EventTrigger,\n\tgetAutomationTriggerTemplate,\n\tisCompoundTrigger,\n\tisEventTrigger,\n\tisSequenceTrigger,\n\ttype WorkQueueStatusTriggerStatus,\n} from \"./trigger-utils\";\n\ntype TriggerDetailsProps = {\n\ttrigger: AutomationTrigger;\n};\n\ntype DeploymentStatus = \"ready\" | \"not_ready\";\ntype WorkPoolStatusType = \"READY\" | \"NOT_READY\" | \"PAUSED\";\n\nfunction asArray<T>(value: T | T[] | undefined | null): T[] {\n\tif (value === undefined || value === null) {\n\t\treturn [];\n\t}\n\treturn Array.isArray(value) ? value : [value];\n}\n\nfunction getMatchValue(\n\ttrigger: EventTrigger,\n\tkey: string,\n): string | string[] | undefined {\n\tconst match = trigger.match;\n\tif (match && typeof match === \"object\") {\n\t\treturn (match as Record<string, string | string[] | undefined>)[key];\n\t}\n\treturn undefined;\n}\n\nfunction getMatchRelatedValue(trigger: EventTrigger, key: string): string[] {\n\tconst matchRelated = trigger.match_related;\n\tif (!matchRelated) {\n\t\treturn [];\n\t}\n\n\tconst matchRelatedArray = Array.isArray(matchRelated)\n\t\t? matchRelated\n\t\t: [matchRelated];\n\n\tconst values: string[] = [];\n\tfor (const match of matchRelatedArray) {\n\t\tif (match && typeof match === \"object\") {\n\t\t\tconst value = (match as Record<string, unknown>)[key];\n\t\t\tif (value) {\n\t\t\t\tvalues.push(...asArray(value as string | string[]));\n\t\t\t}\n\t\t}\n\t}\n\treturn values;\n}\n\nfunction fromResourceId(resource: string, value: unknown): string[] {\n\tif (value === undefined || value === null) {\n\t\treturn [];\n\t}\n\n\tconst values = asArray(value as string | string[]);\n\n\tif (values.includes(`${resource}.*`)) {\n\t\treturn [];\n\t}\n\n\treturn values\n\t\t.filter((v) => v.startsWith(resource))\n\t\t.map((v) => {\n\t\t\tconst parts = v.split(`${resource}.`);\n\t\t\treturn parts[1] ?? \"\";\n\t\t})\n\t\t.filter((id) => id !== \"\" && id !== \"*\");\n}\n\nfunction fromStateNameEvents(events: string[]): string[] {\n\tif (events.includes(\"prefect.flow-run.*\")) {\n\t\treturn [];\n\t}\n\n\treturn events\n\t\t.filter((event) => event.startsWith(\"prefect.flow-run.\"))\n\t\t.map((event) => {\n\t\t\tconst parts = event.split(\"prefect.flow-run.\");\n\t\t\treturn parts[1] ?? \"\";\n\t\t})\n\t\t.filter((name) => name !== \"\");\n}\n\nfunction extractFlowRunStateProps(trigger: EventTrigger): {\n\tflowIds: string[];\n\ttags: string[];\n\tposture: AutomationTriggerEventPosture;\n\tstates: string[];\n\ttime?: number;\n} {\n\tconst matchRelatedResourceIds = getMatchRelatedValue(\n\t\ttrigger,\n\t\t\"prefect.resource.id\",\n\t);\n\n\tconst flowIds = fromResourceId(\"prefect.flow\", matchRelatedResourceIds);\n\tconst tags = fromResourceId(\"prefect.tag\", matchRelatedResourceIds);\n\n\tconst posture = trigger.posture;\n\tconst states =\n\t\tposture === \"Reactive\"\n\t\t\t? fromStateNameEvents(trigger.expect ?? [])\n\t\t\t: fromStateNameEvents(trigger.after ?? []);\n\n\treturn {\n\t\tflowIds,\n\t\ttags,\n\t\tposture,\n\t\tstates,\n\t\ttime: trigger.within,\n\t};\n}\n\nconst DEPLOYMENT_STATUS_EVENT_TO_STATUS: Record<string, DeploymentStatus> = {\n\t\"prefect.deployment.ready\": \"ready\",\n\t\"prefect.deployment.not-ready\": \"not_ready\",\n\t\"prefect.deployment.disabled\": \"not_ready\",\n};\n\nfunction extractDeploymentStatusProps(trigger: EventTrigger): {\n\tdeploymentIds: string[];\n\tposture: AutomationTriggerEventPosture;\n\tstatus: DeploymentStatus;\n\ttime?: number;\n} {\n\tconst resourceIdValue = getMatchValue(trigger, \"prefect.resource.id\");\n\tconst deploymentIds = fromResourceId(\"prefect.deployment\", resourceIdValue);\n\n\tconst posture = trigger.posture;\n\tconst statusEvents = posture === \"Reactive\" ? trigger.expect : trigger.after;\n\n\tlet status: DeploymentStatus = \"ready\";\n\tfor (const event of statusEvents ?? []) {\n\t\tif (event in DEPLOYMENT_STATUS_EVENT_TO_STATUS) {\n\t\t\tstatus = DEPLOYMENT_STATUS_EVENT_TO_STATUS[event];\n\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn {\n\t\tdeploymentIds,\n\t\tposture,\n\t\tstatus,\n\t\ttime: trigger.within,\n\t};\n}\n\nconst WORK_POOL_STATUS_EVENT_TO_STATUS: Record<string, WorkPoolStatusType> = {\n\t\"prefect.work-pool.ready\": \"READY\",\n\t\"prefect.work-pool.not-ready\": \"NOT_READY\",\n\t\"prefect.work-pool.not_ready\": \"NOT_READY\",\n\t\"prefect.work-pool.paused\": \"PAUSED\",\n};\n\nfunction extractWorkPoolStatusProps(trigger: EventTrigger): {\n\tworkPoolIds: string[];\n\tposture: AutomationTriggerEventPosture;\n\tstatus: WorkPoolStatusType;\n\ttime?: number;\n} {\n\tconst resourceIdValue = getMatchValue(trigger, \"prefect.resource.id\");\n\tconst workPoolIds = fromResourceId(\"prefect.work-pool\", resourceIdValue);\n\n\tconst posture = trigger.posture;\n\tconst statusEvents = posture === \"Reactive\" ? trigger.expect : trigger.after;\n\n\tlet status: WorkPoolStatusType = \"READY\";\n\tfor (const event of statusEvents ?? []) {\n\t\tif (event in WORK_POOL_STATUS_EVENT_TO_STATUS) {\n\t\t\tstatus = WORK_POOL_STATUS_EVENT_TO_STATUS[event];\n\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn {\n\t\tworkPoolIds,\n\t\tposture,\n\t\tstatus,\n\t\ttime: trigger.within,\n\t};\n}\n\nconst WORK_QUEUE_STATUS_EVENT_TO_STATUS: Record<\n\tstring,\n\tWorkQueueStatusTriggerStatus\n> = {\n\t\"prefect.work-queue.ready\": \"READY\",\n\t\"prefect.work-queue.not-ready\": \"NOT_READY\",\n\t\"prefect.work-queue.paused\": \"PAUSED\",\n};\n\nfunction extractWorkQueueStatusProps(trigger: EventTrigger): {\n\tworkQueueIds: string[];\n\tworkPoolNames: string[];\n\tposture: AutomationTriggerEventPosture;\n\tstatus: WorkQueueStatusTriggerStatus;\n\ttime?: number;\n} {\n\tconst resourceIdValue = getMatchValue(trigger, \"prefect.resource.id\");\n\tconst workQueueIds = fromResourceId(\"prefect.work-queue\", resourceIdValue);\n\n\tconst matchRelatedResourceIds = getMatchRelatedValue(\n\t\ttrigger,\n\t\t\"prefect.resource.id\",\n\t);\n\tconst workPoolNames = fromResourceId(\n\t\t\"prefect.work-pool\",\n\t\tmatchRelatedResourceIds,\n\t);\n\n\tconst posture = trigger.posture;\n\tconst statusEvents = posture === \"Reactive\" ? trigger.expect : trigger.after;\n\n\tlet status: WorkQueueStatusTriggerStatus = \"READY\";\n\tfor (const event of statusEvents ?? []) {\n\t\tif (event in WORK_QUEUE_STATUS_EVENT_TO_STATUS) {\n\t\t\tstatus = WORK_QUEUE_STATUS_EVENT_TO_STATUS[event];\n\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn {\n\t\tworkQueueIds,\n\t\tworkPoolNames,\n\t\tposture,\n\t\tstatus,\n\t\ttime: trigger.within,\n\t};\n}\n\nexport const TriggerDetails = ({ trigger }: TriggerDetailsProps) => {\n\tif (isCompoundTrigger(trigger)) {\n\t\treturn <TriggerDetailsCompound trigger={trigger} />;\n\t}\n\n\tif (isSequenceTrigger(trigger)) {\n\t\treturn <TriggerDetailsSequence trigger={trigger} />;\n\t}\n\n\tif (!isEventTrigger(trigger)) {\n\t\treturn <TriggerDetailsCustom />;\n\t}\n\n\tconst template = getAutomationTriggerTemplate(trigger);\n\n\tswitch (template) {\n\t\tcase \"flow-run-state\":\n\t\t\treturn (\n\t\t\t\t<TriggerDetailsFlowRunState {...extractFlowRunStateProps(trigger)} />\n\t\t\t);\n\t\tcase \"deployment-status\":\n\t\t\treturn (\n\t\t\t\t<TriggerDetailsDeploymentStatus\n\t\t\t\t\t{...extractDeploymentStatusProps(trigger)}\n\t\t\t\t/>\n\t\t\t);\n\t\tcase \"work-pool-status\":\n\t\t\treturn (\n\t\t\t\t<TriggerDetailsWorkPoolStatus\n\t\t\t\t\t{...extractWorkPoolStatusProps(trigger)}\n\t\t\t\t/>\n\t\t\t);\n\t\tcase \"work-queue-status\":\n\t\t\treturn (\n\t\t\t\t<TriggerDetailsWorkQueueStatus\n\t\t\t\t\t{...extractWorkQueueStatusProps(trigger)}\n\t\t\t\t/>\n\t\t\t);\n\t\tdefault:\n\t\t\treturn <TriggerDetailsCustom />;\n\t}\n};\n","import type { Automation } from \"@/api/automations\";\nimport { useGetAutomationActionResources } from \"@/api/automations/use-get-automation-action-resources\";\nimport { ActionDetails } from \"@/components/automations/action-details\";\nimport { TriggerDetails } from \"@/components/automations/trigger-details\";\nimport { Card } from \"@/components/ui/card\";\nimport { Skeleton } from \"@/components/ui/skeleton\";\nimport { Typography } from \"@/components/ui/typography\";\nimport { pluralize } from \"@/utils\";\n\ntype AutomationDetailsProps = {\n\tautomation: Automation;\n};\n\nexport const AutomationDescription = ({\n\tautomation,\n}: AutomationDetailsProps) => {\n\treturn (\n\t\t<div className=\"flex flex-col gap-1\">\n\t\t\t<Typography className=\"text-muted-foreground\" variant=\"bodySmall\">\n\t\t\t\tDescription\n\t\t\t</Typography>\n\t\t\t<Typography className=\"text-muted-foreground\">\n\t\t\t\t{automation.description || \"None\"}\n\t\t\t</Typography>\n\t\t</div>\n\t);\n};\n\nexport const AutomationTrigger = ({ automation }: AutomationDetailsProps) => {\n\tconst { trigger } = automation;\n\treturn (\n\t\t<div className=\"flex flex-col gap-1\">\n\t\t\t<Typography>Trigger</Typography>\n\t\t\t<TriggerDetails trigger={trigger} />\n\t\t</div>\n\t);\n};\n\nexport const AutomationActions = ({ automation }: AutomationDetailsProps) => {\n\tconst { data: resources, loading } =\n\t\tuseGetAutomationActionResources(automation);\n\n\tconst {\n\t\tautomationsMap,\n\t\tblockDocumentsMap,\n\t\tdeploymentsMap,\n\t\tworkPoolsMap,\n\t\tworkQueuesMap,\n\t} = resources;\n\n\treturn (\n\t\t<div className=\"flex flex-col gap-1\">\n\t\t\t<Typography>{pluralize(automation.actions.length, \"Action\")}</Typography>\n\t\t\t<ul className=\"flex flex-col gap-2\">\n\t\t\t\t{loading\n\t\t\t\t\t? Array.from({ length: automation.actions.length }, (_, i) => (\n\t\t\t\t\t\t\t// biome-ignore lint/suspicious/noArrayIndexKey: ok for loading skeletons\n\t\t\t\t\t\t\t<Card className=\"p-4\" key={i}>\n\t\t\t\t\t\t\t\t<Skeleton className=\"p-2 h-2 w-full\" />\n\t\t\t\t\t\t\t</Card>\n\t\t\t\t\t\t))\n\t\t\t\t\t: automation.actions.map((action) => (\n\t\t\t\t\t\t\t<li key={action.type}>\n\t\t\t\t\t\t\t\t<ActionDetails\n\t\t\t\t\t\t\t\t\taction={action}\n\t\t\t\t\t\t\t\t\tautomationsMap={automationsMap}\n\t\t\t\t\t\t\t\t\tblockDocumentsMap={blockDocumentsMap}\n\t\t\t\t\t\t\t\t\tdeploymentsMap={deploymentsMap}\n\t\t\t\t\t\t\t\t\tworkPoolsMap={workPoolsMap}\n\t\t\t\t\t\t\t\t\tworkQueuesMap={workQueuesMap}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t))}\n\t\t\t</ul>\n\t\t</div>\n\t);\n};\n","import { toast } from \"sonner\";\nimport { type Automation, useUpdateAutomation } from \"@/api/automations\";\nimport { Switch } from \"@/components/ui/switch\";\n\ntype AutomationEnableToggleProps = {\n\tautomation: Automation;\n};\nexport const AutomationEnableToggle = ({\n\tautomation,\n}: AutomationEnableToggleProps) => {\n\tconst { updateAutomation } = useUpdateAutomation();\n\n\tconst handleCheckedChange = (checked: boolean, id: string) => {\n\t\tupdateAutomation(\n\t\t\t{\n\t\t\t\tenabled: checked,\n\t\t\t\tid,\n\t\t\t},\n\t\t\t{\n\t\t\t\tonSuccess: () => {\n\t\t\t\t\ttoast.success(`Automation ${checked ? \"enabled\" : \"disabled\"}`);\n\t\t\t\t},\n\t\t\t\tonError: (error) => {\n\t\t\t\t\tconst message =\n\t\t\t\t\t\terror.message || \"Unknown error while updating automation\";\n\t\t\t\t\tconsole.error(message);\n\t\t\t\t},\n\t\t\t},\n\t\t);\n\t};\n\n\treturn (\n\t\t<Switch\n\t\t\taria-label=\"toggle automation\"\n\t\t\tchecked={automation.enabled}\n\t\t\tonCheckedChange={(checked) => handleCheckedChange(checked, automation.id)}\n\t\t/>\n\t);\n};\n","import { Link } from \"@tanstack/react-router\";\nimport { toast } from \"sonner\";\nimport { Button } from \"@/components/ui/button\";\nimport { DOCS_LINKS } from \"@/components/ui/docs-link\";\nimport {\n\tDropdownMenu,\n\tDropdownMenuContent,\n\tDropdownMenuItem,\n\tDropdownMenuLabel,\n\tDropdownMenuTrigger,\n} from \"@/components/ui/dropdown-menu\";\nimport { Icon } from \"@/components/ui/icons\";\n\ntype Props = {\n\tid: string;\n\tonDelete: () => void;\n};\n\nexport const AutomationsActionsMenu = ({ id, onDelete }: Props) => {\n\tconst handleCopyId = (id: string) => {\n\t\tvoid navigator.clipboard.writeText(id);\n\t\ttoast.success(\"ID copied\");\n\t};\n\n\treturn (\n\t\t<DropdownMenu>\n\t\t\t<DropdownMenuTrigger asChild>\n\t\t\t\t<Button variant=\"outline\" className=\"size-8 p-0\">\n\t\t\t\t\t<span className=\"sr-only\">Open menu</span>\n\t\t\t\t\t<Icon id=\"MoreVertical\" className=\"size-4\" />\n\t\t\t\t</Button>\n\t\t\t</DropdownMenuTrigger>\n\t\t\t<DropdownMenuContent align=\"end\">\n\t\t\t\t<DropdownMenuLabel>Actions</DropdownMenuLabel>\n\t\t\t\t<DropdownMenuItem onClick={() => handleCopyId(id)}>\n\t\t\t\t\tCopy ID\n\t\t\t\t</DropdownMenuItem>\n\t\t\t\t<DropdownMenuItem asChild>\n\t\t\t\t\t<Link to=\"/automations/automation/$id/edit\" params={{ id }}>\n\t\t\t\t\t\tEdit\n\t\t\t\t\t</Link>\n\t\t\t\t</DropdownMenuItem>\n\t\t\t\t<DropdownMenuItem onClick={onDelete}>Delete</DropdownMenuItem>\n\t\t\t\t<DropdownMenuItem asChild>\n\t\t\t\t\t<a\n\t\t\t\t\t\thref={DOCS_LINKS[\"automations-guide\"]}\n\t\t\t\t\t\tclassName=\"flex items-center\"\n\t\t\t\t\t>\n\t\t\t\t\t\tDocumentation <Icon id=\"ExternalLink\" className=\"ml-2 size-4\" />\n\t\t\t\t\t</a>\n\t\t\t\t</DropdownMenuItem>\n\t\t\t</DropdownMenuContent>\n\t\t</DropdownMenu>\n\t);\n};\n","import { useNavigate } from \"@tanstack/react-router\";\nimport { toast } from \"sonner\";\nimport { type Automation, useDeleteAutomation } from \"@/api/automations\";\nimport { useDeleteConfirmationDialog } from \"@/components/ui/delete-confirmation-dialog\";\n\nexport const useDeleteAutomationConfirmationDialog = () => {\n\tconst navigate = useNavigate();\n\tconst [dialogState, confirmDelete] = useDeleteConfirmationDialog();\n\n\tconst { deleteAutomation } = useDeleteAutomation();\n\n\tconst handleConfirmDelete = (\n\t\tautomation: Automation,\n\t\t{\n\t\t\tshouldNavigate = false,\n\t\t}: {\n\t\t\t/** Should navigate back to /automations */\n\t\t\tshouldNavigate?: boolean;\n\t\t} = {},\n\t) =>\n\t\tconfirmDelete({\n\t\t\ttitle: \"Delete Automation\",\n\t\t\tdescription: `Are you sure you want to delete ${automation.name}?`,\n\t\t\tonConfirm: () => {\n\t\t\t\tdeleteAutomation(automation.id, {\n\t\t\t\t\tonSuccess: () => {\n\t\t\t\t\t\ttoast.success(\"Automation deleted\");\n\t\t\t\t\t\tif (shouldNavigate) {\n\t\t\t\t\t\t\tvoid navigate({ to: \"/automations\" });\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tonError: (error) => {\n\t\t\t\t\t\tconst message =\n\t\t\t\t\t\t\terror.message || \"Unknown error while deleting automation.\";\n\t\t\t\t\t\ttoast.error(message);\n\t\t\t\t\t\tconsole.error(message);\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t},\n\t\t});\n\n\treturn [dialogState, handleConfirmDelete] as const;\n};\n"],"names":["useGetAutomationActionResources","automation","automationIds","blockDocumentIds","deploymentIds","workPoolIds","workQueueIds","getResourceSets","automationsData","automationsLoading","useListAutomationsQueries","remainingQueries","useQueries","buildListFilterBlockDocumentsQuery","buildFilterDeploymentsQuery","buildFilterWorkPoolsQuery","buildFilterWorkQueuesQuery","results","blockDocuments","deployments","workPools","workQueues","result","listToMap","automationId","buildGetAutomationQuery","retMap","actions","action","list","map","item","ACTION_TYPE_TO_STRING","ActionDetails","automationsMap","blockDocumentsMap","deploymentsMap","workPoolsMap","workQueuesMap","jsx","Card","ActionDetailsType","label","NoninferredAction","deployment","DeploymentActionDetails","Typography","InferredAction","workQueue","WorkQueueActionDetails","AutomationActionDetails","workPool","WorkPoolActionDetails","blockDocument","BlockDocumentActionDetails","CallWebhookActionDetails","ChangeFlowRunStateActionDetails","ActionResource","children","ActionResourceName","iconId","name","jsxs","Icon","type","StateBadge","parameters","job_variables","Link","RunDeploymentJsonDialog","title","payload","Dialog","DialogTrigger","Button","capitalize","DialogContent","DialogHeader","DialogTitle","JsonInput","_label","TriggerDetailsCompound","trigger","triggerCount","requireValue","requireLabel","TriggerDetailsCustom","DeploymentLink","deploymentId","Suspense","Skeleton","DeploymentLinkImplementation","useSuspenseQuery","buildDeploymentDetailsQuery","DEFAULT_EVENT_TRIGGER_THRESHOLD","DEPLOYMENT_STATUS_EVENTS","WORK_POOL_STATUS_EVENTS","WORK_QUEUE_STATUS_EVENTS","isRecord","value","isEventTrigger","isCompoundTrigger","isSequenceTrigger","asArray","getTriggerMatchValue","key","match","isMatchResource","predicate","prefectResourceIds","isForEachResource","resource","isAfterResource","isExpectResource","isDeploymentStatusEvent","event","isWorkPoolStatusEvent","isWorkQueueStatusEvent","isDeploymentStatusTrigger","triggerAfters","after","triggerExpects","expect","getTriggerMatchRelatedValue","matchRelated","matchRelatedArray","values","isEmptyMatchRelated","isMatchRelatedResource","isFlowRunStateTriggerMatchRelated","isFlowRunStateTrigger","isWorkPoolStatusTrigger","isWorkQueueStatusTrigger","automationTriggerTemplateChecks","getAutomationTriggerTemplate","guard","getAutomationTriggerEventPostureLabel","posture","getWorkQueueStatusLabel","status","exhaustive","getDeploymentStatusLabel","TriggerDetailsDeploymentStatus","time","isAnyDeployment","postureLabel","statusLabel","index","secondsToString","mapStateNameToStateType","stateName","normalizedName","TriggerDetailsFlowRunState","flowIds","tags","states","Fragment","flowId","FlowLink","TagBadgeGroup","state","stateType","secondsToApproximateString","TriggerDetailsSequence","getStatusLabel","WorkPoolLinkInline","workPoolName","renderWorkPoolLinks","TriggerDetailsWorkPoolStatus","useQuery","workPoolLabel","pluralize","TriggerDetailsWorkQueueStatus","props","TriggerDetailsWorkQueueStatusImplementation","workPoolNames","anyWorkQueue","anyWorkPool","useSuspenseQueries","id","buildGetWorkQueueQuery","query","WorkQueueIconText","WorkPoolLink","getMatchValue","getMatchRelatedValue","fromResourceId","v","fromStateNameEvents","events","extractFlowRunStateProps","matchRelatedResourceIds","DEPLOYMENT_STATUS_EVENT_TO_STATUS","extractDeploymentStatusProps","resourceIdValue","statusEvents","WORK_POOL_STATUS_EVENT_TO_STATUS","extractWorkPoolStatusProps","WORK_QUEUE_STATUS_EVENT_TO_STATUS","extractWorkQueueStatusProps","TriggerDetails","AutomationDescription","AutomationTrigger","AutomationActions","resources","loading","_","i","AutomationEnableToggle","updateAutomation","useUpdateAutomation","handleCheckedChange","checked","toast","error","message","Switch","AutomationsActionsMenu","onDelete","handleCopyId","DropdownMenu","DropdownMenuTrigger","DropdownMenuContent","DropdownMenuLabel","DropdownMenuItem","DOCS_LINKS","useDeleteAutomationConfirmationDialog","navigate","useNavigate","dialogState","confirmDelete","useDeleteConfirmationDialog","deleteAutomation","useDeleteAutomation","shouldNavigate"],"mappings":"mlBAiCO,MAAMA,GAAmCC,GAA2B,CAC1E,KAAM,CACL,cAAAC,EACA,iBAAAC,EACA,cAAAC,EACA,YAAAC,EACA,aAAAC,CAAA,EACGC,GAAgBN,EAAW,OAAO,EAGhC,CAAE,KAAMO,EAAiB,QAASC,GACvCC,GAA0B,MAAM,KAAKR,CAAa,CAAC,EAG9CS,EAAmBC,EAAW,CACnC,QAAS,CACRC,GACC,CACC,OAAQ,EACR,KAAM,0BACN,gBAAiB,GACjB,gBAAiB,CAChB,SAAU,OACV,GAAI,CAAE,KAAM,MAAM,KAAKV,CAAgB,CAAA,EACvC,aAAc,CAAA,CAAC,CAChB,EAED,CAAE,QAASA,EAAiB,KAAO,CAAA,CAAE,EAEtCW,GACC,CACC,OAAQ,EACR,KAAM,eACN,YAAa,CACZ,GAAI,CAAE,KAAM,MAAM,KAAKV,CAAa,CAAA,EACpC,SAAU,MAAA,CACX,EAED,CAAE,QAASA,EAAc,KAAO,CAAA,CAAE,EAEnCW,EACC,CACC,OAAQ,EACR,WAAY,CACX,GAAI,CAAE,KAAM,MAAM,KAAKV,CAAW,CAAA,EAClC,SAAU,MAAA,CACX,EAED,CAAE,QAASA,EA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,EAAG,SAAA,UAEnD,EACA5I,EAAAA,IAACyL,EAAA,CAAiB,QAAO,GACxB,SAAAzL,EAAAA,IAAC6B,EAAA,CAAK,GAAG,mCAAmC,OAAQ,CAAE,GAAA+G,CAAA,EAAM,gBAE5D,EACD,EACA5I,EAAAA,IAACyL,EAAA,CAAiB,QAASN,EAAU,SAAA,SAAM,EAC3CnL,EAAAA,IAACyL,EAAA,CAAiB,QAAO,GACxB,SAAAlK,EAAAA,KAAC,IAAA,CACA,KAAMmK,GAAW,mBAAmB,EACpC,UAAU,oBACV,SAAA,CAAA,iBACc1L,EAAAA,IAACwB,EAAA,CAAK,GAAG,eAAe,UAAU,aAAA,CAAc,CAAA,CAAA,CAAA,CAC/D,CACD,CAAA,CAAA,CACD,CAAA,EACD,CAEF,ECjDamK,GAAwC,IAAM,CAC1D,MAAMC,EAAWC,GAAA,EACX,CAACC,EAAaC,CAAa,EAAIC,GAAA,EAE/B,CAAE,iBAAAC,CAAA,EAAqBC,GAAA,EAgC7B,MAAO,CAACJ,EA9BoB,CAC3BpO,EACA,CACC,eAAAyO,EAAiB,EAAA,EAId,CAAA,IAEJJ,EAAc,CACb,MAAO,oBACP,YAAa,mCAAmCrO,EAAW,IAAI,IAC/D,UAAW,IAAM,CAChBuO,EAAiBvO,EAAW,GAAI,CAC/B,UAAW,IAAM,CAChBoN,EAAM,QAAQ,oBAAoB,EAC9BqB,GACEP,EAAS,CAAE,GAAI,eAAgB,CAEtC,EACA,QAAUb,GAAU,CACnB,MAAMC,EACLD,EAAM,SAAW,2CAClBD,EAAM,MAAME,CAAO,EACnB,QAAQ,MAAMA,CAAO,CACtB,CAAA,CACA,CACF,CAAA,CACA,CAEsC,CACzC"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{j as s,r as x}from"./vendor-tanstack-BdLtprmr.js";import{cy as j,y as w,ap as h,U as g,q as y,I as D,ao as S}from"./index-V_xTKaEb.js";import{D as C}from"./delete-confirmation-dialog-dLycVNo4.js";import{u as F}from"./use-delete-confirmation-dialog-CkL-rSsp.js";const k=()=>{const[o,t]=F(),{mutateAsync:n}=j(),a=async(u,i=()=>{})=>{try{const c=await Promise.allSettled(u.map(r=>n(r))),{numFails:l,numSuccess:e}=c.reduce((r,m)=>(m.status==="rejected"?r.numFails+=1:r.numSuccess+=1,r),{numFails:0,numSuccess:0});l>1?w.error(`${l} flow runs failed to delete`):l===1?w.error("Flow run failed to delete"):e>1?w.success(`${e} flow runs deleted`):w.success("Flow run deleted")}catch(c){console.error("Unknown error while deleting flow run.",c)}finally{i()}};return[o,(u,i=()=>{})=>t({title:"Delete Flow Runs",description:"Are you sure you want to delete selected flow runs?",onConfirm:()=>{a(u,i)}})]},T=({count:o=0,...t})=>"results"in t&&"setSelectedRows"in t&&"selectedRows"in t?s.jsx(R,{count:o,...t}):s.jsxs(h,{variant:"bodySmall",className:"text-muted-foreground",children:[o," ",g(o,"Flow run")]});function R({count:o=0,results:t=[],setSelectedRows:n,selectedRows:a}){const[d,u]=k(),i=x.useMemo(()=>t.map(({id:e})=>e),[t]),c=Array.from(a),l=()=>{const e=i.every(f=>a.has(f)),r=i.some(f=>a.has(f));let m=!1;return e?m=!0:r&&(m="indeterminate"),s.jsx(S,{className:"block",checked:m,onCheckedChange:f=>{n(f?new Set(i):new Set)},"aria-label":"Toggle all"})};return a.size>0?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(l,{}),s.jsxs(h,{variant:"bodySmall",className:"text-muted-foreground",children:[c.length," selected"]}),s.jsx(y,{"aria-label":"Delete rows",size:"icon",variant:"secondary",onClick:()=>{u(c,()=>n(new Set))},children:s.jsx(D,{id:"Trash2",className:"size-4"})})]}),s.jsx(C,{...d})]}):s.jsxs("div",{className:"flex items-center gap-2",children:[t&&n&&a&&s.jsx(S,{className:"block",checked:!1,onCheckedChange:e=>{n(new Set(e?i:void 0))},"aria-label":"Toggle all"}),s.jsxs(h,{variant:"bodySmall",className:"text-muted-foreground",children:[o," ",g(o,"Flow run")]})]})}const z=o=>{const[t,n]=x.useState(new Set(o)),a=l=>n(e=>new Set(e).add(l)),d=l=>n(e=>{const r=new Set(e);return r.delete(l),r});return[t,n,{addRow:a,removeRow:d,onSelectRow:(l,e)=>{e?a(l):d(l)},clearSet:()=>n(new Set)}]};export{T as F,z as u};
|
|
2
|
-
//# sourceMappingURL=use-flow-runs-selected-rows-1YE-VIgM.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-flow-runs-selected-rows-1YE-VIgM.js","sources":["../../src/components/flow-runs/flow-runs-list/use-delete-flow-runs-dialog.ts","../../src/components/flow-runs/flow-runs-list/flow-runs-row-count.tsx","../../src/components/flow-runs/flow-runs-list/use-flow-runs-selected-rows.ts"],"sourcesContent":["import { toast } from \"sonner\";\nimport { useDeleteFlowRun } from \"@/api/flow-runs\";\nimport { useDeleteConfirmationDialog } from \"@/components/ui/delete-confirmation-dialog\";\n\nexport const useDeleteFlowRunsDialog = () => {\n\tconst [dialogState, confirmDelete] = useDeleteConfirmationDialog();\n\n\tconst { mutateAsync } = useDeleteFlowRun();\n\n\tconst handleDeletes = async (\n\t\tflowRunIds: Array<string>,\n\t\tonConfirm = () => {},\n\t) => {\n\t\ttry {\n\t\t\tconst res = await Promise.allSettled(\n\t\t\t\tflowRunIds.map((id) => mutateAsync(id)),\n\t\t\t);\n\t\t\tconst { numFails, numSuccess } = res.reduce(\n\t\t\t\t(accumulator, currentValue) => {\n\t\t\t\t\tif (currentValue.status === \"rejected\") {\n\t\t\t\t\t\taccumulator.numFails += 1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\taccumulator.numSuccess += 1;\n\t\t\t\t\t}\n\t\t\t\t\treturn accumulator;\n\t\t\t\t},\n\t\t\t\t{ numFails: 0, numSuccess: 0 },\n\t\t\t);\n\t\t\tif (numFails > 1) {\n\t\t\t\ttoast.error(`${numFails} flow runs failed to delete`);\n\t\t\t} else if (numFails === 1) {\n\t\t\t\ttoast.error(\"Flow run failed to delete\");\n\t\t\t} else if (numSuccess > 1) {\n\t\t\t\ttoast.success(`${numSuccess} flow runs deleted`);\n\t\t\t} else {\n\t\t\t\ttoast.success(\"Flow run deleted\");\n\t\t\t}\n\t\t} catch (err) {\n\t\t\tconsole.error(\"Unknown error while deleting flow run.\", err);\n\t\t} finally {\n\t\t\tonConfirm();\n\t\t}\n\t};\n\n\tconst handleConfirmDelete = (\n\t\tflowRunIds: Array<string>,\n\t\tonConfirm = () => {},\n\t) =>\n\t\tconfirmDelete({\n\t\t\ttitle: \"Delete Flow Runs\",\n\t\t\tdescription: \"Are you sure you want to delete selected flow runs?\",\n\t\t\tonConfirm: () => {\n\t\t\t\tvoid handleDeletes(flowRunIds, onConfirm);\n\t\t\t},\n\t\t});\n\n\treturn [dialogState, handleConfirmDelete] as const;\n};\n","import type { CheckedState } from \"@radix-ui/react-checkbox\";\nimport { useMemo } from \"react\";\nimport { Button } from \"@/components/ui/button\";\nimport { Checkbox } from \"@/components/ui/checkbox\";\nimport { DeleteConfirmationDialog } from \"@/components/ui/delete-confirmation-dialog\";\nimport { Icon } from \"@/components/ui/icons\";\nimport { Typography } from \"@/components/ui/typography\";\nimport { pluralize } from \"@/utils\";\nimport type { FlowRunCardData } from \"../flow-run-card\";\nimport { useDeleteFlowRunsDialog } from \"./use-delete-flow-runs-dialog\";\n\ntype CountOnlyProps = {\n\tcount: number | undefined;\n};\ntype SelectableProps = {\n\tcount: number | undefined;\n\tresults: Array<FlowRunCardData> | undefined;\n\tsetSelectedRows: (rows: Set<string>) => void;\n\tselectedRows: Set<string>;\n};\ntype FlowRunsRowCountProps = CountOnlyProps | SelectableProps;\n\nexport const FlowRunsRowCount = ({\n\tcount = 0,\n\t...props\n}: FlowRunsRowCountProps) => {\n\t// Selectable UX\n\tif (\n\t\t\"results\" in props &&\n\t\t\"setSelectedRows\" in props &&\n\t\t\"selectedRows\" in props\n\t) {\n\t\treturn <SelectedCount count={count} {...props} />;\n\t}\n\n\t// Count only UX\n\treturn (\n\t\t<Typography variant=\"bodySmall\" className=\"text-muted-foreground\">\n\t\t\t{count} {pluralize(count, \"Flow run\")}\n\t\t</Typography>\n\t);\n};\n\nfunction SelectedCount({\n\tcount = 0,\n\tresults = [],\n\tsetSelectedRows,\n\tselectedRows,\n}: SelectableProps) {\n\tconst [deleteConfirmationDialogState, confirmDelete] =\n\t\tuseDeleteFlowRunsDialog();\n\n\tconst resultsIds = useMemo(() => results.map(({ id }) => id), [results]);\n\n\tconst selectedRowsList = Array.from(selectedRows);\n\n\tconst ToggleCheckbox = () => {\n\t\tconst isAllRowsSelected = resultsIds.every((id) => selectedRows.has(id));\n\t\tconst isSomeRowsSelected = resultsIds.some((id) => selectedRows.has(id));\n\t\tlet checkedState: CheckedState = false;\n\t\tif (isAllRowsSelected) {\n\t\t\tcheckedState = true;\n\t\t} else if (isSomeRowsSelected) {\n\t\t\tcheckedState = \"indeterminate\";\n\t\t}\n\t\treturn (\n\t\t\t<Checkbox\n\t\t\t\tclassName=\"block\"\n\t\t\t\tchecked={checkedState}\n\t\t\t\tonCheckedChange={(checked) => {\n\t\t\t\t\tif (checked) {\n\t\t\t\t\t\tsetSelectedRows(new Set(resultsIds));\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsetSelectedRows(new Set());\n\t\t\t\t\t}\n\t\t\t\t}}\n\t\t\t\taria-label=\"Toggle all\"\n\t\t\t/>\n\t\t);\n\t};\n\n\t// If has selected rows\n\tif (selectedRows.size > 0)\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<div className=\"flex items-center gap-2\">\n\t\t\t\t\t<ToggleCheckbox />\n\t\t\t\t\t<Typography variant=\"bodySmall\" className=\"text-muted-foreground\">\n\t\t\t\t\t\t{selectedRowsList.length} selected\n\t\t\t\t\t</Typography>\n\t\t\t\t\t<Button\n\t\t\t\t\t\taria-label=\"Delete rows\"\n\t\t\t\t\t\tsize=\"icon\"\n\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\tconfirmDelete(selectedRowsList, () => setSelectedRows(new Set()));\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t<Icon id=\"Trash2\" className=\"size-4\" />\n\t\t\t\t\t</Button>\n\t\t\t\t</div>\n\t\t\t\t<DeleteConfirmationDialog {...deleteConfirmationDialogState} />\n\t\t\t</>\n\t\t);\n\n\treturn (\n\t\t<div className=\"flex items-center gap-2\">\n\t\t\t{results && setSelectedRows && selectedRows && (\n\t\t\t\t<Checkbox\n\t\t\t\t\tclassName=\"block\"\n\t\t\t\t\tchecked={false}\n\t\t\t\t\tonCheckedChange={(checked) => {\n\t\t\t\t\t\tsetSelectedRows(new Set(checked ? resultsIds : undefined));\n\t\t\t\t\t}}\n\t\t\t\t\taria-label=\"Toggle all\"\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t<Typography variant=\"bodySmall\" className=\"text-muted-foreground\">\n\t\t\t\t{count} {pluralize(count, \"Flow run\")}\n\t\t\t</Typography>\n\t\t</div>\n\t);\n}\n","import { useState } from \"react\";\n\nexport const useFlowRunsSelectedRows = (defaultValues?: Array<string>) => {\n\tconst [selectedRows, setSelectedRows] = useState<Set<string>>(\n\t\tnew Set(defaultValues),\n\t);\n\n\tconst addRow = (id: string) =>\n\t\tsetSelectedRows((curr) => new Set(curr).add(id));\n\n\tconst removeRow = (id: string) =>\n\t\tsetSelectedRows((curr) => {\n\t\t\tconst newValue = new Set(curr);\n\t\t\tnewValue.delete(id);\n\t\t\treturn newValue;\n\t\t});\n\n\tconst onSelectRow = (id: string, checked: boolean) => {\n\t\tif (checked) {\n\t\t\taddRow(id);\n\t\t} else {\n\t\t\tremoveRow(id);\n\t\t}\n\t};\n\n\tconst clearSet = () => setSelectedRows(new Set());\n\n\tconst utils = {\n\t\taddRow,\n\t\tremoveRow,\n\t\tonSelectRow,\n\t\tclearSet,\n\t};\n\n\treturn [selectedRows, setSelectedRows, utils] as const;\n};\n"],"names":["useDeleteFlowRunsDialog","dialogState","confirmDelete","useDeleteConfirmationDialog","mutateAsync","useDeleteFlowRun","handleDeletes","flowRunIds","onConfirm","res","id","numFails","numSuccess","accumulator","currentValue","toast","err","FlowRunsRowCount","count","props","jsx","SelectedCount","jsxs","Typography","pluralize","results","setSelectedRows","selectedRows","deleteConfirmationDialogState","resultsIds","useMemo","selectedRowsList","ToggleCheckbox","isAllRowsSelected","isSomeRowsSelected","checkedState","Checkbox","checked","Fragment","Button","Icon","DeleteConfirmationDialog","useFlowRunsSelectedRows","defaultValues","useState","addRow","curr","removeRow","newValue"],"mappings":"4QAIO,MAAMA,EAA0B,IAAM,CAC5C,KAAM,CAACC,EAAaC,CAAa,EAAIC,EAAA,EAE/B,CAAE,YAAAC,CAAA,EAAgBC,EAAA,EAElBC,EAAgB,MACrBC,EACAC,EAAY,IAAM,CAAC,IACf,CACJ,GAAI,CACH,MAAMC,EAAM,MAAM,QAAQ,WACzBF,EAAW,IAAKG,GAAON,EAAYM,CAAE,CAAC,CAAA,EAEjC,CAAE,SAAAC,EAAU,WAAAC,CAAA,EAAeH,EAAI,OACpC,CAACI,EAAaC,KACTA,EAAa,SAAW,WAC3BD,EAAY,UAAY,EAExBA,EAAY,YAAc,EAEpBA,GAER,CAAE,SAAU,EAAG,WAAY,CAAA,CAAE,EAE1BF,EAAW,EACdI,EAAM,MAAM,GAAGJ,CAAQ,6BAA6B,EAC1CA,IAAa,EACvBI,EAAM,MAAM,2BAA2B,EAC7BH,EAAa,EACvBG,EAAM,QAAQ,GAAGH,CAAU,oBAAoB,EAE/CG,EAAM,QAAQ,kBAAkB,CAElC,OAASC,EAAK,CACb,QAAQ,MAAM,yCAA0CA,CAAG,CAC5D,QAAA,CACCR,EAAA,CACD,CACD,EAcA,MAAO,CAACP,EAZoB,CAC3BM,EACAC,EAAY,IAAM,CAAC,IAEnBN,EAAc,CACb,MAAO,mBACP,YAAa,sDACb,UAAW,IAAM,CACXI,EAAcC,EAAYC,CAAS,CACzC,CAAA,C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-
import{j as d,r as x}from"./vendor-tanstack-BdLtprmr.js";import{C as j,a_ as f,I as C,ap as y}from"./index-V_xTKaEb.js";const L=({currentStepNum:e,onClick:s,steps:r,completedSteps:t,visitedSteps:o})=>d.jsx(j,{className:"p-4 flex flex-row items-center justify-around gap-4 overflow-x-auto",children:r.map((n,a)=>{const p=e===a,m=o.has(a),u=t.has(a);return d.jsx(N,{disabled:!m,onClick:()=>s({stepName:n,stepNum:a}),number:a,isActive:p,isComplete:u,name:n},n)})}),N=({isActive:e=!1,isComplete:s=!1,disabled:r=!1,onClick:t=()=>{},number:o,name:n})=>{const a=o+1,p=a<10?`0${a}`:String(a);return d.jsxs("button",{type:"button",className:f("flex items-center gap-3 text-nowrap",r&&"cursor-not-allowed"),disabled:r,onClick:()=>t({number:o,name:n}),children:[s?d.jsx(C,{id:"CircleCheck",color:e?"teal":"grey",className:"size-12"}):d.jsx(v,{isActive:e,label:p}),d.jsx(y,{variant:"bodyLarge",className:f("text-gray-500 border-gray-500 whitespace-nowrap",e&&"text-teal-700 border-teal-700"),children:n})]})},v=({isActive:e=!1,label:s})=>d.jsx("div",{className:f("flex items-center justify-center size-12 rounded-full border-4 text-gray-500 border-gray-500",e&&"text-teal-700 border-teal-700"),children:d.jsx(y,{variant:"bodyLarge",className:f("text-gray-500 border-gray-500",e&&"text-teal-700 border-teal-700"),children:s})}),g=(e=new Set)=>{const[s,r]=x.useState(e),t=x.useMemo(()=>({add:c=>r(l=>new Set([...Array.from(l),c])),remove:c=>r(l=>new Set([...Array.from(l).filter(S=>S!==c)])),toggle:c=>r(l=>l.has(c)?new Set(Array.from(l).filter(S=>S!==c)):new Set([...Array.from(l),c])),clear:()=>r(new Set),reset:()=>r(e)}),[e]),o={has:x.useCallback(n=>s.has(n),[s]),...t};return[s,o]},V=(e,s=0,r)=>{const[t,o]=x.useState(s),[n,{add:a,reset:p}]=g(r??new Set([0])),[m,{add:u,reset:c}]=g(new Set),l=()=>{t<e-1&&(u(t),a(t+1),o(i=>i+1))},S=()=>{t>0&&o(i=>i-1)},b=i=>{o(i)},h=()=>{c(),p(),o(s)},w=t===e-1;return{changeStep:b,completedStepsSet:m,currentStep:t,decrementStep:S,incrementStep:l,isFinalStep:w,isStartingStep:t===0,reset:h,visitedStepsSet:n}};export{L as S,V as u};
|
|
2
|
-
//# sourceMappingURL=use-stepper-CnGJHRLP.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-stepper-CnGJHRLP.js","sources":["../../src/components/ui/stepper/stepper.tsx","../../src/hooks/use-set.ts","../../src/hooks/use-stepper.ts"],"sourcesContent":["import { Card } from \"@/components/ui/card\";\nimport { Icon } from \"@/components/ui/icons\";\nimport { Typography } from \"@/components/ui/typography\";\nimport { cn } from \"@/utils\";\n\ntype StepperProps = {\n\tcurrentStepNum: number;\n\tsteps: Array<string> | ReadonlyArray<string>;\n\tonClick: ({\n\t\tstepName,\n\t\tstepNum,\n\t}: {\n\t\tstepName: string;\n\t\tstepNum: number;\n\t}) => void;\n\tcompletedSteps: Set<number>;\n\tvisitedSteps: Set<number>;\n};\nconst Stepper = ({\n\tcurrentStepNum,\n\tonClick,\n\tsteps,\n\tcompletedSteps,\n\tvisitedSteps,\n}: StepperProps) => {\n\treturn (\n\t\t<Card className=\"p-4 flex flex-row items-center justify-around gap-4 overflow-x-auto\">\n\t\t\t{steps.map((step, i) => {\n\t\t\t\tconst isCurrentStep = currentStepNum === i;\n\t\t\t\tconst isStepVisited = visitedSteps.has(i);\n\t\t\t\tconst isStepComplete = completedSteps.has(i);\n\n\t\t\t\treturn (\n\t\t\t\t\t<Step\n\t\t\t\t\t\tkey={step}\n\t\t\t\t\t\tdisabled={!isStepVisited}\n\t\t\t\t\t\tonClick={() => onClick({ stepName: step, stepNum: i })}\n\t\t\t\t\t\tnumber={i}\n\t\t\t\t\t\tisActive={isCurrentStep}\n\t\t\t\t\t\tisComplete={isStepComplete}\n\t\t\t\t\t\tname={step}\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t})}\n\t\t</Card>\n\t);\n};\n\ntype StepProps = {\n\tisActive?: boolean;\n\tisComplete?: boolean;\n\tdisabled?: boolean;\n\tnumber: number;\n\tname: string;\n\tonClick?: ({ number, name }: { number: number; name: string }) => void;\n};\n\nconst Step = ({\n\tisActive = false,\n\tisComplete = false,\n\tdisabled = false,\n\tonClick = () => {},\n\t/** Assume steps are indexed =0 */\n\tnumber,\n\tname,\n}: StepProps) => {\n\t// add 1 to number assuming index 0\n\tconst adjustedNumberDisplay = number + 1;\n\tconst numberLabel =\n\t\tadjustedNumberDisplay < 10\n\t\t\t? `0${adjustedNumberDisplay}`\n\t\t\t: String(adjustedNumberDisplay);\n\n\treturn (\n\t\t<button\n\t\t\ttype=\"button\"\n\t\t\tclassName={cn(\n\t\t\t\t\"flex items-center gap-3 text-nowrap\",\n\t\t\t\tdisabled && \"cursor-not-allowed\",\n\t\t\t)}\n\t\t\tdisabled={disabled}\n\t\t\tonClick={() => onClick({ number, name })}\n\t\t>\n\t\t\t{isComplete ? (\n\t\t\t\t<Icon\n\t\t\t\t\tid=\"CircleCheck\"\n\t\t\t\t\tcolor={isActive ? \"teal\" : \"grey\"}\n\t\t\t\t\tclassName=\"size-12\"\n\t\t\t\t/>\n\t\t\t) : (\n\t\t\t\t<StepIcon isActive={isActive} label={numberLabel} />\n\t\t\t)}\n\t\t\t<Typography\n\t\t\t\tvariant=\"bodyLarge\"\n\t\t\t\tclassName={cn(\n\t\t\t\t\t\"text-gray-500 border-gray-500 whitespace-nowrap\",\n\t\t\t\t\tisActive && \"text-teal-700 border-teal-700\",\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t{name}\n\t\t\t</Typography>\n\t\t</button>\n\t);\n};\n\ntype StepIconProps = {\n\tlabel: string;\n\tisActive?: boolean;\n};\nconst StepIcon = ({ isActive = false, label }: StepIconProps) => (\n\t<div\n\t\tclassName={cn(\n\t\t\t\"flex items-center justify-center size-12 rounded-full border-4 text-gray-500 border-gray-500\",\n\t\t\tisActive && \"text-teal-700 border-teal-700\",\n\t\t)}\n\t>\n\t\t<Typography\n\t\t\tvariant=\"bodyLarge\"\n\t\t\tclassName={cn(\n\t\t\t\t\"text-gray-500 border-gray-500\",\n\t\t\t\tisActive && \"text-teal-700 border-teal-700\",\n\t\t\t)}\n\t\t>\n\t\t\t{label}\n\t\t</Typography>\n\t</div>\n);\n\nexport { Step, Stepper };\n","import { useCallback, useMemo, useState } from \"react\";\n\ntype StableActions<K> = {\n\tadd: (key: K) => void;\n\tremove: (key: K) => void;\n\ttoggle: (key: K) => void;\n\treset: () => void;\n\tclear: () => void;\n};\n\ntype Actions<K> = StableActions<K> & {\n\thas: (key: K) => boolean;\n};\n\n/**\n * A hook that is used to declarative to keep state of a 'Set' type of data structure.\n * This is useful in cases where the UX needs to keep track of selected rows by id\n *\n * @param initialSet Initial state of a Set\n * @returns a Set object and utils as a tuple\n *\n * @example\n * ```tsx\n * function FlowCheckboxList() {\n * const [selectedIDs, { has, toggle }] = useSet<string>();\n *\n * return flows.map((flow) =>\n * \t\t<Checkbox\n * \t\t\tkey={flow.id}\n * \t\t\tchecked={has(flow.id)}\n * \t\t\tonCheck={() => toggle(flow.id)}\n * \t\t\tlabel={flow.name} />\n *\n * }\n * ```\n */\nexport const useSet = <K>(initialSet = new Set<K>()): [Set<K>, Actions<K>] => {\n\tconst [set, setSet] = useState(initialSet);\n\n\tconst stableActions = useMemo(() => {\n\t\tconst add = (item: K) =>\n\t\t\tsetSet((curr) => new Set([...Array.from(curr), item]));\n\t\tconst remove = (item: K) =>\n\t\t\tsetSet(\n\t\t\t\t(curr) => new Set([...Array.from(curr).filter((i) => i !== item)]),\n\t\t\t);\n\t\tconst toggle = (item: K) =>\n\t\t\tsetSet((curr) =>\n\t\t\t\tcurr.has(item)\n\t\t\t\t\t? new Set(Array.from(curr).filter((i) => i !== item))\n\t\t\t\t\t: new Set([...Array.from(curr), item]),\n\t\t\t);\n\t\tconst reset = () => setSet(initialSet);\n\t\tconst clear = () => setSet(new Set());\n\n\t\treturn { add, remove, toggle, clear, reset };\n\t}, [initialSet]);\n\n\tconst utils = {\n\t\thas: useCallback((item) => set.has(item), [set]),\n\t\t...stableActions,\n\t} as Actions<K>;\n\n\treturn [set, utils];\n};\n","import { useState } from \"react\";\nimport { useSet } from \"./use-set\";\n/**\n *\n * @param steps\n * @param startingStep\n * @returns state with declarative utilities to increment, decrement, or skip to a current state\n *\n * @example\n * ```ts\n * const STEPS = ['Trigger', 'Actions', 'Details'] as const\n *\n * const stepper = useStepper(STEPS.length);\n *\n * return (\n * <div>\n * <h2>Current Step: {STEPS[stepper.currentStep]}</h2>\n * <ul>\n * {STEPS.map((step, i) => (\n * \t\t\t<li key={i} onClick={() => stepper.setStep(i)}>{step}</li>\n * \t\t)}\n * </ul>\n * <div>\n * <Button disabled={stepper.isStartingStep} onClick={stepper.decrementStep()}>Previous</Button>\n * <Button onClick={stepper.incrementStep()}>{stepper.isFinalStep ? 'Save' : 'Next'}</Button>\n * </div>\n * </div>\n * )\n * ```\n */\nexport const useStepper = (\n\tnumSteps: number,\n\tstartingStep = 0,\n\tinitialVisitedSteps?: Set<number>,\n) => {\n\tconst [currentStep, setCurrentStep] = useState(startingStep);\n\tconst [visitedStepsSet, { add: addVisitedStep, reset: resetVisitedSteps }] =\n\t\tuseSet(initialVisitedSteps ?? new Set<number>([0]));\n\tconst [\n\t\tcompletedStepsSet,\n\t\t{ add: addCompletedStep, reset: resetCompletedSteps },\n\t] = useSet(new Set<number>());\n\n\tconst incrementStep = () => {\n\t\tif (currentStep < numSteps - 1) {\n\t\t\t// Marks step as visited\n\t\t\taddCompletedStep(currentStep);\n\t\t\taddVisitedStep(currentStep + 1);\n\t\t\tsetCurrentStep((curr) => curr + 1);\n\t\t}\n\t};\n\n\tconst decrementStep = () => {\n\t\tif (currentStep > 0) {\n\t\t\tsetCurrentStep((curr) => curr - 1);\n\t\t}\n\t};\n\n\tconst changeStep = (stepNum: number) => {\n\t\tsetCurrentStep(stepNum);\n\t};\n\n\tconst reset = () => {\n\t\tresetCompletedSteps();\n\t\tresetVisitedSteps();\n\t\tsetCurrentStep(startingStep);\n\t};\n\n\tconst isFinalStep = currentStep === numSteps - 1;\n\tconst isStartingStep = currentStep === 0;\n\n\treturn {\n\t\tchangeStep,\n\t\tcompletedStepsSet,\n\t\tcurrentStep,\n\t\tdecrementStep,\n\t\tincrementStep,\n\t\tisFinalStep,\n\t\tisStartingStep,\n\t\treset,\n\t\tvisitedStepsSet,\n\t};\n};\n"],"names":["Stepper","currentStepNum","onClick","steps","completedSteps","visitedSteps","jsx","Card","step","i","isCurrentStep","isStepVisited","isStepComplete","Step","isActive","isComplete","disabled","number","name","adjustedNumberDisplay","numberLabel","jsxs","cn","Icon","StepIcon","Typography","label","useSet","initialSet","set","setSet","useState","stableActions","useMemo","item","curr","utils","useCallback","useStepper","numSteps","startingStep","initialVisitedSteps","currentStep","setCurrentStep","visitedStepsSet","addVisitedStep","resetVisitedSteps","completedStepsSet","addCompletedStep","resetCompletedSteps","incrementStep","decrementStep","changeStep","stepNum","reset","isFinalStep"],"mappings":"wHAkBA,MAAMA,EAAU,CAAC,CAChB,eAAAC,EACA,QAAAC,EACA,MAAAC,EACA,eAAAC,EACA,aAAAC,CACD,IAEEC,MAACC,GAAK,UAAU,sEACd,WAAM,IAAI,CAACC,EAAMC,IAAM,CACvB,MAAMC,EAAgBT,IAAmBQ,EACnCE,EAAgBN,EAAa,IAAII,CAAC,EAClCG,EAAiBR,EAAe,IAAIK,CAAC,EAE3C,OACCH,EAAAA,IAACO,EAAA,CAEA,SAAU,CAACF,EACX,QAAS,IAAMT,EAAQ,CAAE,SAAUM,EAAM,QAASC,EAAG,EACrD,OAAQA,EACR,SAAUC,EACV,WAAYE,EACZ,KAAMJ,CAAA,EANDA,CAAA,CASR,CAAC,CAAA,CACF,EAaIK,EAAO,CAAC,CACb,SAAAC,EAAW,GACX,WAAAC,EAAa,GACb,SAAAC,EAAW,GACX,QAAAd,EAAU,IA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,CAAA,CAEF"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as o,t as S,j as e}from"./vendor-tanstack-BdLtprmr.js";import{d0 as C,ag as A,ah as w,ai as N,aj as g,ak as y,al as k,am as z,an as h,ao as x,ap as E,T as L}from"./index-V_xTKaEb.js";const _=2,D=({selectedDeployments:s,onSelectDeployments:t})=>{const[i,u]=o.useState(""),n=o.useDeferredValue(i),{data:c=[]}=S(C({deployments:n?{operator:"and_",name:{like_:n}}:void 0,limit:100,offset:0,sort:"NAME_ASC"})),{data:f=[]}=S(C({deployments:s.size>0?{operator:"and_",id:{any_:Array.from(s)}}:void 0,limit:s.size||1,offset:0,sort:"NAME_ASC"},{enabled:s.size>0})),j=a=>{const r=new Set(s);s.has(a)?r.delete(a):r.add(a),t(r)},p=()=>{t(new Set)},b=()=>{if(s.size===0)return"All deployments";const a=f.filter(d=>s.has(d.id)).map(d=>d.name),r=a.slice(0,_),m=a.length-_;return e.jsxs("div",{className:"flex flex-1 min-w-0 items-center gap-2",children:[e.jsx("div",{className:"flex flex-1 min-w-0 items-center gap-2 overflow-hidden",children:e.jsx("span",{className:"truncate",children:r.join(", ")})}),m>0&&e.jsxs(E,{variant:"bodySmall",className:"shrink-0",children:["+ ",m]})]})},l=o.useMemo(()=>c.filter(a=>!n||a.name.toLowerCase().includes(n.toLowerCase())),[c,n]);return e.jsxs(A,{children:[e.jsx(w,{"aria-label":"Filter by deployment",selected:s.size===0,children:b()}),e.jsxs(N,{children:[e.jsx(g,{value:i,onValueChange:u,placeholder:"Search deployments..."}),e.jsxs(y,{children:[e.jsx(k,{children:"No deployments found"}),e.jsxs(z,{children:[e.jsxs(h,{"aria-label":"All deployments",onSelect:p,closeOnSelect:!1,value:"__all__",children:[e.jsx(x,{checked:s.size===0}),"All deployments"]}),l.map(a=>e.jsxs(h,{"aria-label":a.name,onSelect:()=>j(a.id),closeOnSelect:!1,value:a.id,children:[e.jsx(x,{checked:s.has(a.id)}),a.name]},a.id))]})]})]})]})},v=2,F=({selectedWorkPools:s,onSelectWorkPools:t})=>{const[i,u]=o.useState(""),n=o.useDeferredValue(i),{data:c=[]}=S(L({limit:100,offset:0})),f=l=>{const a=new Set(s);s.has(l)?a.delete(l):a.add(l),t(a)},j=()=>{t(new Set)},p=()=>{if(s.size===0)return"All work pools";const l=Array.from(s).sort((m,d)=>m.localeCompare(d)),a=l.slice(0,v),r=l.length-v;return e.jsxs("div",{className:"flex flex-1 min-w-0 items-center gap-2",children:[e.jsx("div",{className:"flex flex-1 min-w-0 items-center gap-2 overflow-hidden",children:e.jsx("span",{className:"truncate",children:a.join(", ")})}),r>0&&e.jsxs(E,{variant:"bodySmall",className:"shrink-0",children:["+ ",r]})]})},b=o.useMemo(()=>c.filter(l=>!n||l.name.toLowerCase().includes(n.toLowerCase())).sort((l,a)=>l.name.localeCompare(a.name)),[c,n]);return e.jsxs(A,{children:[e.jsx(w,{"aria-label":"Filter by work pool",selected:s.size===0,children:p()}),e.jsxs(N,{children:[e.jsx(g,{value:i,onValueChange:u,placeholder:"Search work pools..."}),e.jsxs(y,{children:[e.jsx(k,{children:"No work pools found"}),e.jsxs(z,{children:[e.jsxs(h,{"aria-label":"All work pools",onSelect:j,closeOnSelect:!1,value:"__all__",children:[e.jsx(x,{checked:s.size===0}),"All work pools"]}),b.map(l=>e.jsxs(h,{"aria-label":l.name,onSelect:()=>f(l.name),closeOnSelect:!1,value:l.name,children:[e.jsx(x,{checked:s.has(l.name)}),l.name]},l.name))]})]})]})]})};export{D,F as W};
|
|
2
|
-
//# sourceMappingURL=work-pool-filter-CGfXNujK.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"work-pool-filter-CGfXNujK.js","sources":["../../src/components/flow-runs/flow-runs-list/flow-runs-filters/deployment-filter.tsx","../../src/components/flow-runs/flow-runs-list/flow-runs-filters/work-pool-filter.tsx"],"sourcesContent":["import { useQuery } from \"@tanstack/react-query\";\nimport { useDeferredValue, useMemo, useState } from \"react\";\nimport {\n\tbuildFilterDeploymentsQuery,\n\ttype Deployment,\n} from \"@/api/deployments\";\nimport { Checkbox } from \"@/components/ui/checkbox\";\nimport {\n\tCombobox,\n\tComboboxCommandEmtpy,\n\tComboboxCommandGroup,\n\tComboboxCommandInput,\n\tComboboxCommandItem,\n\tComboboxCommandList,\n\tComboboxContent,\n\tComboboxTrigger,\n} from \"@/components/ui/combobox\";\nimport { Typography } from \"@/components/ui/typography\";\n\nconst MAX_DEPLOYMENTS_DISPLAYED = 2;\n\ntype DeploymentFilterProps = {\n\tselectedDeployments: Set<string>;\n\tonSelectDeployments: (deployments: Set<string>) => void;\n};\n\nexport const DeploymentFilter = ({\n\tselectedDeployments,\n\tonSelectDeployments,\n}: DeploymentFilterProps) => {\n\tconst [search, setSearch] = useState(\"\");\n\tconst deferredSearch = useDeferredValue(search);\n\n\tconst { data: deployments = [] } = useQuery(\n\t\tbuildFilterDeploymentsQuery({\n\t\t\tdeployments: deferredSearch\n\t\t\t\t? {\n\t\t\t\t\t\toperator: \"and_\",\n\t\t\t\t\t\tname: { like_: deferredSearch },\n\t\t\t\t\t}\n\t\t\t\t: undefined,\n\t\t\tlimit: 100,\n\t\t\toffset: 0,\n\t\t\tsort: \"NAME_ASC\",\n\t\t}),\n\t);\n\n\tconst { data: selectedDeploymentsData = [] } = useQuery(\n\t\tbuildFilterDeploymentsQuery(\n\t\t\t{\n\t\t\t\tdeployments:\n\t\t\t\t\tselectedDeployments.size > 0\n\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\toperator: \"and_\",\n\t\t\t\t\t\t\t\tid: { any_: Array.from(selectedDeployments) },\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t: undefined,\n\t\t\t\tlimit: selectedDeployments.size || 1,\n\t\t\t\toffset: 0,\n\t\t\t\tsort: \"NAME_ASC\",\n\t\t\t},\n\t\t\t{ enabled: selectedDeployments.size > 0 },\n\t\t),\n\t);\n\n\tconst handleSelectDeployment = (deploymentId: string) => {\n\t\tconst updatedDeployments = new Set(selectedDeployments);\n\t\tif (selectedDeployments.has(deploymentId)) {\n\t\t\tupdatedDeployments.delete(deploymentId);\n\t\t} else {\n\t\t\tupdatedDeployments.add(deploymentId);\n\t\t}\n\t\tonSelectDeployments(updatedDeployments);\n\t};\n\n\tconst handleClearAll = () => {\n\t\tonSelectDeployments(new Set());\n\t};\n\n\tconst renderSelectedDeployments = () => {\n\t\tif (selectedDeployments.size === 0) {\n\t\t\treturn \"All deployments\";\n\t\t}\n\n\t\tconst selectedDeploymentNames = selectedDeploymentsData\n\t\t\t.filter((deployment) => selectedDeployments.has(deployment.id))\n\t\t\t.map((deployment) => deployment.name);\n\n\t\tconst visible = selectedDeploymentNames.slice(0, MAX_DEPLOYMENTS_DISPLAYED);\n\t\tconst extraCount =\n\t\t\tselectedDeploymentNames.length - MAX_DEPLOYMENTS_DISPLAYED;\n\n\t\treturn (\n\t\t\t<div className=\"flex flex-1 min-w-0 items-center gap-2\">\n\t\t\t\t<div className=\"flex flex-1 min-w-0 items-center gap-2 overflow-hidden\">\n\t\t\t\t\t<span className=\"truncate\">{visible.join(\", \")}</span>\n\t\t\t\t</div>\n\t\t\t\t{extraCount > 0 && (\n\t\t\t\t\t<Typography variant=\"bodySmall\" className=\"shrink-0\">\n\t\t\t\t\t\t+ {extraCount}\n\t\t\t\t\t</Typography>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t);\n\t};\n\n\tconst filteredDeployments = useMemo(() => {\n\t\treturn deployments.filter(\n\t\t\t(deployment: Deployment) =>\n\t\t\t\t!deferredSearch ||\n\t\t\t\tdeployment.name.toLowerCase().includes(deferredSearch.toLowerCase()),\n\t\t);\n\t}, [deployments, deferredSearch]);\n\n\treturn (\n\t\t<Combobox>\n\t\t\t<ComboboxTrigger\n\t\t\t\taria-label=\"Filter by deployment\"\n\t\t\t\tselected={selectedDeployments.size === 0}\n\t\t\t>\n\t\t\t\t{renderSelectedDeployments()}\n\t\t\t</ComboboxTrigger>\n\t\t\t<ComboboxContent>\n\t\t\t\t<ComboboxCommandInput\n\t\t\t\t\tvalue={search}\n\t\t\t\t\tonValueChange={setSearch}\n\t\t\t\t\tplaceholder=\"Search deployments...\"\n\t\t\t\t/>\n\t\t\t\t<ComboboxCommandList>\n\t\t\t\t\t<ComboboxCommandEmtpy>No deployments found</ComboboxCommandEmtpy>\n\t\t\t\t\t<ComboboxCommandGroup>\n\t\t\t\t\t\t<ComboboxCommandItem\n\t\t\t\t\t\t\taria-label=\"All deployments\"\n\t\t\t\t\t\t\tonSelect={handleClearAll}\n\t\t\t\t\t\t\tcloseOnSelect={false}\n\t\t\t\t\t\t\tvalue=\"__all__\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Checkbox checked={selectedDeployments.size === 0} />\n\t\t\t\t\t\t\tAll deployments\n\t\t\t\t\t\t</ComboboxCommandItem>\n\t\t\t\t\t\t{filteredDeployments.map((deployment: Deployment) => (\n\t\t\t\t\t\t\t<ComboboxCommandItem\n\t\t\t\t\t\t\t\tkey={deployment.id}\n\t\t\t\t\t\t\t\taria-label={deployment.name}\n\t\t\t\t\t\t\t\tonSelect={() => handleSelectDeployment(deployment.id)}\n\t\t\t\t\t\t\t\tcloseOnSelect={false}\n\t\t\t\t\t\t\t\tvalue={deployment.id}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<Checkbox checked={selectedDeployments.has(deployment.id)} />\n\t\t\t\t\t\t\t\t{deployment.name}\n\t\t\t\t\t\t\t</ComboboxCommandItem>\n\t\t\t\t\t\t))}\n\t\t\t\t\t</ComboboxCommandGroup>\n\t\t\t\t</ComboboxCommandList>\n\t\t\t</ComboboxContent>\n\t\t</Combobox>\n\t);\n};\n","import { useQuery } from \"@tanstack/react-query\";\nimport { useDeferredValue, useMemo, useState } from \"react\";\nimport {\n\tbuildFilterWorkPoolsQuery,\n\ttype WorkPool,\n} from \"@/api/work-pools/work-pools\";\nimport { Checkbox } from \"@/components/ui/checkbox\";\nimport {\n\tCombobox,\n\tComboboxCommandEmtpy,\n\tComboboxCommandGroup,\n\tComboboxCommandInput,\n\tComboboxCommandItem,\n\tComboboxCommandList,\n\tComboboxContent,\n\tComboboxTrigger,\n} from \"@/components/ui/combobox\";\nimport { Typography } from \"@/components/ui/typography\";\n\nconst MAX_WORK_POOLS_DISPLAYED = 2;\n\ntype WorkPoolFilterProps = {\n\tselectedWorkPools: Set<string>;\n\tonSelectWorkPools: (workPools: Set<string>) => void;\n};\n\nexport const WorkPoolFilter = ({\n\tselectedWorkPools,\n\tonSelectWorkPools,\n}: WorkPoolFilterProps) => {\n\tconst [search, setSearch] = useState(\"\");\n\tconst deferredSearch = useDeferredValue(search);\n\n\tconst { data: workPools = [] } = useQuery(\n\t\tbuildFilterWorkPoolsQuery({\n\t\t\tlimit: 100,\n\t\t\toffset: 0,\n\t\t}),\n\t);\n\n\tconst handleSelectWorkPool = (workPoolName: string) => {\n\t\tconst updatedWorkPools = new Set(selectedWorkPools);\n\t\tif (selectedWorkPools.has(workPoolName)) {\n\t\t\tupdatedWorkPools.delete(workPoolName);\n\t\t} else {\n\t\t\tupdatedWorkPools.add(workPoolName);\n\t\t}\n\t\tonSelectWorkPools(updatedWorkPools);\n\t};\n\n\tconst handleClearAll = () => {\n\t\tonSelectWorkPools(new Set());\n\t};\n\n\tconst renderSelectedWorkPools = () => {\n\t\tif (selectedWorkPools.size === 0) {\n\t\t\treturn \"All work pools\";\n\t\t}\n\n\t\tconst selectedWorkPoolNames = Array.from(selectedWorkPools).sort((a, b) =>\n\t\t\ta.localeCompare(b),\n\t\t);\n\n\t\tconst visible = selectedWorkPoolNames.slice(0, MAX_WORK_POOLS_DISPLAYED);\n\t\tconst extraCount = selectedWorkPoolNames.length - MAX_WORK_POOLS_DISPLAYED;\n\n\t\treturn (\n\t\t\t<div className=\"flex flex-1 min-w-0 items-center gap-2\">\n\t\t\t\t<div className=\"flex flex-1 min-w-0 items-center gap-2 overflow-hidden\">\n\t\t\t\t\t<span className=\"truncate\">{visible.join(\", \")}</span>\n\t\t\t\t</div>\n\t\t\t\t{extraCount > 0 && (\n\t\t\t\t\t<Typography variant=\"bodySmall\" className=\"shrink-0\">\n\t\t\t\t\t\t+ {extraCount}\n\t\t\t\t\t</Typography>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t);\n\t};\n\n\tconst filteredWorkPools = useMemo(() => {\n\t\treturn workPools\n\t\t\t.filter(\n\t\t\t\t(workPool: WorkPool) =>\n\t\t\t\t\t!deferredSearch ||\n\t\t\t\t\tworkPool.name.toLowerCase().includes(deferredSearch.toLowerCase()),\n\t\t\t)\n\t\t\t.sort((a: WorkPool, b: WorkPool) => a.name.localeCompare(b.name));\n\t}, [workPools, deferredSearch]);\n\n\treturn (\n\t\t<Combobox>\n\t\t\t<ComboboxTrigger\n\t\t\t\taria-label=\"Filter by work pool\"\n\t\t\t\tselected={selectedWorkPools.size === 0}\n\t\t\t>\n\t\t\t\t{renderSelectedWorkPools()}\n\t\t\t</ComboboxTrigger>\n\t\t\t<ComboboxContent>\n\t\t\t\t<ComboboxCommandInput\n\t\t\t\t\tvalue={search}\n\t\t\t\t\tonValueChange={setSearch}\n\t\t\t\t\tplaceholder=\"Search work pools...\"\n\t\t\t\t/>\n\t\t\t\t<ComboboxCommandList>\n\t\t\t\t\t<ComboboxCommandEmtpy>No work pools found</ComboboxCommandEmtpy>\n\t\t\t\t\t<ComboboxCommandGroup>\n\t\t\t\t\t\t<ComboboxCommandItem\n\t\t\t\t\t\t\taria-label=\"All work pools\"\n\t\t\t\t\t\t\tonSelect={handleClearAll}\n\t\t\t\t\t\t\tcloseOnSelect={false}\n\t\t\t\t\t\t\tvalue=\"__all__\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Checkbox checked={selectedWorkPools.size === 0} />\n\t\t\t\t\t\t\tAll work pools\n\t\t\t\t\t\t</ComboboxCommandItem>\n\t\t\t\t\t\t{filteredWorkPools.map((workPool: WorkPool) => (\n\t\t\t\t\t\t\t<ComboboxCommandItem\n\t\t\t\t\t\t\t\tkey={workPool.name}\n\t\t\t\t\t\t\t\taria-label={workPool.name}\n\t\t\t\t\t\t\t\tonSelect={() => handleSelectWorkPool(workPool.name)}\n\t\t\t\t\t\t\t\tcloseOnSelect={false}\n\t\t\t\t\t\t\t\tvalue={workPool.name}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<Checkbox checked={selectedWorkPools.has(workPool.name)} />\n\t\t\t\t\t\t\t\t{workPool.name}\n\t\t\t\t\t\t\t</ComboboxCommandItem>\n\t\t\t\t\t\t))}\n\t\t\t\t\t</ComboboxCommandGroup>\n\t\t\t\t</ComboboxCommandList>\n\t\t\t</ComboboxContent>\n\t\t</Combobox>\n\t);\n};\n"],"names":["MAX_DEPLOYMENTS_DISPLAYED","DeploymentFilter","selectedDeployments","onSelectDeployments","search","setSearch","useState","deferredSearch","useDeferredValue","deployments","useQuery","buildFilterDeploymentsQuery","selectedDeploymentsData","handleSelectDeployment","deploymentId","updatedDeployments","handleClearAll","renderSelectedDeployments","selectedDeploymentNames","deployment","visible","extraCount","jsxs","jsx","Typography","filteredDeployments","useMemo","Combobox","ComboboxTrigger","ComboboxContent","ComboboxCommandInput","ComboboxCommandList","ComboboxCommandEmtpy","ComboboxCommandGroup","ComboboxCommandItem","Checkbox","MAX_WORK_POOLS_DISPLAYED","WorkPoolFilter","selectedWorkPools","onSelectWorkPools","workPools","buildFilterWorkPoolsQuery","handleSelectWorkPool","workPoolName","updatedWorkPools","renderSelectedWorkPools","selectedWorkPoolNames","a","b","filteredWorkPools","workPool"],"mappings":"gMAmBA,MAAMA,EAA4B,EAOrBC,EAAmB,CAAC,CAChC,oBAAAC,EACA,oBAAAC,CACD,IAA6B,CAC5B,KAAM,CAACC,EAAQC,CAAS,EAAIC,EAAAA,SAAS,EAAE,EACjCC,EAAiBC,EAAAA,iBAAiBJ,CAAM,EAExC,CAAE,KAAMK,EAAc,CAAA,GAAOC,EAClCC,EAA4B,CAC3B,YAAaJ,EACV,CACA,SAAU,OACV,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