prefect 3.6.14.dev4__py3-none-any.whl → 3.6.14.dev5__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/events/clients.py +36 -3
- prefect/server/api/events.py +3 -2
- prefect/server/ui-v2/assets/{artifact-card-DmR_0bKj.js → artifact-card-DprxJzPy.js} +2 -2
- prefect/server/ui-v2/assets/{artifact-card-DmR_0bKj.js.map → artifact-card-DprxJzPy.js.map} +1 -1
- prefect/server/ui-v2/assets/{artifact._id-BF4365i6.js → artifact._id-CXcnU7_U.js} +2 -2
- prefect/server/ui-v2/assets/{artifact._id-BF4365i6.js.map → artifact._id-CXcnU7_U.js.map} +1 -1
- prefect/server/ui-v2/assets/{automation-wizard-DMI3p_HA.js → automation-wizard-DPKDA6ji.js} +2 -2
- prefect/server/ui-v2/assets/{automation-wizard-DMI3p_HA.js.map → automation-wizard-DPKDA6ji.js.map} +1 -1
- prefect/server/ui-v2/assets/{automation._id-C_ZATYDQ.js → automation._id-BvFFkDrn.js} +2 -2
- prefect/server/ui-v2/assets/{automation._id-C_ZATYDQ.js.map → automation._id-BvFFkDrn.js.map} +1 -1
- prefect/server/ui-v2/assets/{automation_._id.edit-Dkc09fFA.js → automation_._id.edit-vpFy8Znl.js} +2 -2
- prefect/server/ui-v2/assets/{automation_._id.edit-Dkc09fFA.js.map → automation_._id.edit-vpFy8Znl.js.map} +1 -1
- prefect/server/ui-v2/assets/{automations-header-H_FW9LY7.js → automations-header-eG-shDxp.js} +2 -2
- prefect/server/ui-v2/assets/{automations-header-H_FW9LY7.js.map → automations-header-eG-shDxp.js.map} +1 -1
- prefect/server/ui-v2/assets/{base-job-template-form-section-CVnxwfEi.js → base-job-template-form-section-du3c8HMM.js} +2 -2
- prefect/server/ui-v2/assets/{base-job-template-form-section-CVnxwfEi.js.map → base-job-template-form-section-du3c8HMM.js.map} +1 -1
- prefect/server/ui-v2/assets/{block-type-details-BIzTWlfj.js → block-type-details-CIGWaz9i.js} +2 -2
- prefect/server/ui-v2/assets/{block-type-details-BIzTWlfj.js.map → block-type-details-CIGWaz9i.js.map} +1 -1
- prefect/server/ui-v2/assets/{block-type-logo-B3XAhRSL.js → block-type-logo-B3oMH8dS.js} +2 -2
- prefect/server/ui-v2/assets/{block-type-logo-B3XAhRSL.js.map → block-type-logo-B3oMH8dS.js.map} +1 -1
- prefect/server/ui-v2/assets/{block._id-Bj0YEdv1.js → block._id-Cay2vm3g.js} +2 -2
- prefect/server/ui-v2/assets/{block._id-Bj0YEdv1.js.map → block._id-Cay2vm3g.js.map} +1 -1
- prefect/server/ui-v2/assets/{block_._id.edit-C7sUQ8mQ.js → block_._id.edit-bNSemu_v.js} +2 -2
- prefect/server/ui-v2/assets/{block_._id.edit-C7sUQ8mQ.js.map → block_._id.edit-bNSemu_v.js.map} +1 -1
- prefect/server/ui-v2/assets/{catalog-Cywf-iho.js → catalog-B3SdxUVJ.js} +2 -2
- prefect/server/ui-v2/assets/{catalog-Cywf-iho.js.map → catalog-B3SdxUVJ.js.map} +1 -1
- prefect/server/ui-v2/assets/{catalog_._slug-qLWMRQt3.js → catalog_._slug-BfQw_9GK.js} +2 -2
- prefect/server/ui-v2/assets/{catalog_._slug-qLWMRQt3.js.map → catalog_._slug-BfQw_9GK.js.map} +1 -1
- prefect/server/ui-v2/assets/{catalog_._slug_.create-LslFlpde.js → catalog_._slug_.create-k_HRDFv7.js} +2 -2
- prefect/server/ui-v2/assets/{catalog_._slug_.create-LslFlpde.js.map → catalog_._slug_.create-k_HRDFv7.js.map} +1 -1
- prefect/server/ui-v2/assets/{collapsible-BszH-EeY.js → collapsible-CjJyAdbn.js} +2 -2
- prefect/server/ui-v2/assets/{collapsible-BszH-EeY.js.map → collapsible-CjJyAdbn.js.map} +1 -1
- prefect/server/ui-v2/assets/{concurrency-limit._id-Dam_Ftkw.js → concurrency-limit._id-B3Gnqcjc.js} +2 -2
- prefect/server/ui-v2/assets/{concurrency-limit._id-Dam_Ftkw.js.map → concurrency-limit._id-B3Gnqcjc.js.map} +1 -1
- prefect/server/ui-v2/assets/create-AIgXW0ut.js +2 -0
- prefect/server/ui-v2/assets/{create-B11nNTmT.js.map → create-AIgXW0ut.js.map} +1 -1
- prefect/server/ui-v2/assets/{create-B8EFPjmO.js → create-CWAzl36x.js} +2 -2
- prefect/server/ui-v2/assets/{create-B8EFPjmO.js.map → create-CWAzl36x.js.map} +1 -1
- prefect/server/ui-v2/assets/{data-table-C1eRvlXV.js → data-table-B3EtpFhV.js} +2 -2
- prefect/server/ui-v2/assets/{data-table-C1eRvlXV.js.map → data-table-B3EtpFhV.js.map} +1 -1
- prefect/server/ui-v2/assets/{delete-confirmation-dialog-DCmC1ZTD.js → delete-confirmation-dialog-DyUMWSB-.js} +2 -2
- prefect/server/ui-v2/assets/{delete-confirmation-dialog-DCmC1ZTD.js.map → delete-confirmation-dialog-DyUMWSB-.js.map} +1 -1
- prefect/server/ui-v2/assets/{deployment-action-header-WD51TIyE.js → deployment-action-header-BJ8WZ6O0.js} +2 -2
- prefect/server/ui-v2/assets/{deployment-action-header-WD51TIyE.js.map → deployment-action-header-BJ8WZ6O0.js.map} +1 -1
- prefect/server/ui-v2/assets/{deployment-form-FaqDdnNa.js → deployment-form-DXZUK11h.js} +3 -3
- prefect/server/ui-v2/assets/{deployment-form-FaqDdnNa.js.map → deployment-form-DXZUK11h.js.map} +1 -1
- prefect/server/ui-v2/assets/{deployment-links-CLax44tW.js → deployment-links-bbtRf3OX.js} +2 -2
- prefect/server/ui-v2/assets/{deployment-links-CLax44tW.js.map → deployment-links-bbtRf3OX.js.map} +1 -1
- prefect/server/ui-v2/assets/{deployment._id-DrtOyhFC.js → deployment._id-DFzzDIAz.js} +2 -2
- prefect/server/ui-v2/assets/{deployment._id-DrtOyhFC.js.map → deployment._id-DFzzDIAz.js.map} +1 -1
- prefect/server/ui-v2/assets/{deployment._id-CbWiylvh.js → deployment._id-GmnYU2jN.js} +2 -2
- prefect/server/ui-v2/assets/{deployment._id-CbWiylvh.js.map → deployment._id-GmnYU2jN.js.map} +1 -1
- prefect/server/ui-v2/assets/deployment_._id.duplicate--_rm26pJ.js +2 -0
- prefect/server/ui-v2/assets/{deployment_._id.duplicate-CqlNWQfz.js.map → deployment_._id.duplicate--_rm26pJ.js.map} +1 -1
- prefect/server/ui-v2/assets/deployment_._id.edit-BS799pF4.js +2 -0
- prefect/server/ui-v2/assets/{deployment_._id.edit-CbvCe2YU.js.map → deployment_._id.edit-BS799pF4.js.map} +1 -1
- prefect/server/ui-v2/assets/{deployment_._id.run-BnIFeR-d.js → deployment_._id.run-c02Fu6v1.js} +2 -2
- prefect/server/ui-v2/assets/{deployment_._id.run-BnIFeR-d.js.map → deployment_._id.run-c02Fu6v1.js.map} +1 -1
- prefect/server/ui-v2/assets/{dropdown-menu-Bhox1zoa.js → dropdown-menu-6cSdnzsr.js} +2 -2
- prefect/server/ui-v2/assets/{dropdown-menu-Bhox1zoa.js.map → dropdown-menu-6cSdnzsr.js.map} +1 -1
- prefect/server/ui-v2/assets/{event-resource-display-65B76oFV.js → event-resource-display-DeFGeJR9.js} +2 -2
- prefect/server/ui-v2/assets/{event-resource-display-65B76oFV.js.map → event-resource-display-DeFGeJR9.js.map} +1 -1
- prefect/server/ui-v2/assets/{event._eventDate._eventId-CxPjH2H7.js → event._eventDate._eventId-CKnfHNoF.js} +2 -2
- prefect/server/ui-v2/assets/{event._eventDate._eventId-CxPjH2H7.js.map → event._eventDate._eventId-CKnfHNoF.js.map} +1 -1
- prefect/server/ui-v2/assets/{flow-run-graph-ZOatFLjv.js → flow-run-graph-aynL8fbE.js} +2 -2
- prefect/server/ui-v2/assets/{flow-run-graph-ZOatFLjv.js.map → flow-run-graph-aynL8fbE.js.map} +1 -1
- prefect/server/ui-v2/assets/{flow-run._id-CDFeuz16.js → flow-run._id-4lwBtUgU.js} +2 -2
- prefect/server/ui-v2/assets/{flow-run._id-CDFeuz16.js.map → flow-run._id-4lwBtUgU.js.map} +1 -1
- prefect/server/ui-v2/assets/{flow-run._id-1RC-URiA.js → flow-run._id-CT2imMDV.js} +2 -2
- prefect/server/ui-v2/assets/{flow-run._id-1RC-URiA.js.map → flow-run._id-CT2imMDV.js.map} +1 -1
- prefect/server/ui-v2/assets/{flow-run._id-U6rzXfvR.js → flow-run._id-s3t6dDIS.js} +3 -3
- prefect/server/ui-v2/assets/{flow-run._id-U6rzXfvR.js.map → flow-run._id-s3t6dDIS.js.map} +1 -1
- prefect/server/ui-v2/assets/{flow-runs-pagination-D_d5hdM0.js → flow-runs-pagination-DvDLs5GM.js} +2 -2
- prefect/server/ui-v2/assets/{flow-runs-pagination-D_d5hdM0.js.map → flow-runs-pagination-DvDLs5GM.js.map} +1 -1
- prefect/server/ui-v2/assets/{flow._id-DkeN8TLS.js → flow._id-U31aNcVQ.js} +2 -2
- prefect/server/ui-v2/assets/{flow._id-DkeN8TLS.js.map → flow._id-U31aNcVQ.js.map} +1 -1
- prefect/server/ui-v2/assets/{form-CJfDUosd.js → form-DvAgEGjn.js} +2 -2
- prefect/server/ui-v2/assets/{form-CJfDUosd.js.map → form-DvAgEGjn.js.map} +1 -1
- prefect/server/ui-v2/assets/{header-MZZX5lQ8.js → header-Bq61DIIv.js} +2 -2
- prefect/server/ui-v2/assets/{header-MZZX5lQ8.js.map → header-Bq61DIIv.js.map} +1 -1
- prefect/server/ui-v2/assets/{header-C5liWcfp.js → header-QiKDPn2b.js} +2 -2
- prefect/server/ui-v2/assets/{header-C5liWcfp.js.map → header-QiKDPn2b.js.map} +1 -1
- prefect/server/ui-v2/assets/{header-vYbWNFdK.js → header-YbYlGgAg.js} +2 -2
- prefect/server/ui-v2/assets/{header-vYbWNFdK.js.map → header-YbYlGgAg.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-BPmw935P.js → index--QEAQOap.js} +2 -2
- prefect/server/ui-v2/assets/{index-BPmw935P.js.map → index--QEAQOap.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-4xVLy12E.js → index-BJJn5VNO.js} +2 -2
- prefect/server/ui-v2/assets/{index-4xVLy12E.js.map → index-BJJn5VNO.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-B_3WKH2_.js → index-BToZEh2M.js} +2 -2
- prefect/server/ui-v2/assets/{index-B_3WKH2_.js.map → index-BToZEh2M.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-DeeA9nPM.js → index-BzE5jxe7.js} +2 -2
- prefect/server/ui-v2/assets/{index-DeeA9nPM.js.map → index-BzE5jxe7.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-BR6bwuK4.js → index-C-uTnVrI.js} +2 -2
- prefect/server/ui-v2/assets/{index-BR6bwuK4.js.map → index-C-uTnVrI.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-CbJNJTr8.js → index-C19BICb6.js} +2 -2
- prefect/server/ui-v2/assets/{index-CbJNJTr8.js.map → index-C19BICb6.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-CCCwtbSq.js → index-C84_3iOG.js} +2 -2
- prefect/server/ui-v2/assets/{index-CCCwtbSq.js.map → index-C84_3iOG.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-BOVwKiXn.js → index-CGt_907f.js} +2 -2
- prefect/server/ui-v2/assets/{index-BOVwKiXn.js.map → index-CGt_907f.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-7bWZ2Znt.js → index-COtFm673.js} +2 -2
- prefect/server/ui-v2/assets/{index-7bWZ2Znt.js.map → index-COtFm673.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-DLuXqHi9.js → index-CQlQauOE.js} +4 -4
- prefect/server/ui-v2/assets/{index-DLuXqHi9.js.map → index-CQlQauOE.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-ClXbR8i0.js → index-CovPzmtX.js} +2 -2
- prefect/server/ui-v2/assets/{index-ClXbR8i0.js.map → index-CovPzmtX.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-BgOHAC5L.js → index-CzZJA-g2.js} +2 -2
- prefect/server/ui-v2/assets/{index-BgOHAC5L.js.map → index-CzZJA-g2.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-Bmd9p_xN.js → index-D9O_iUny.js} +2 -2
- prefect/server/ui-v2/assets/{index-Bmd9p_xN.js.map → index-D9O_iUny.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-CfHvTOAO.js → index-DBhG-F3c.js} +2 -2
- prefect/server/ui-v2/assets/{index-CfHvTOAO.js.map → index-DBhG-F3c.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-5fQrQZ3K.js → index-DEijvsFf.js} +2 -2
- prefect/server/ui-v2/assets/{index-5fQrQZ3K.js.map → index-DEijvsFf.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-enqoJV8x.js → index-DJx6_wL3.js} +2 -2
- prefect/server/ui-v2/assets/{index-enqoJV8x.js.map → index-DJx6_wL3.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-BmdTLblr.js → index-DzylsDQg.js} +2 -2
- prefect/server/ui-v2/assets/{index-BmdTLblr.js.map → index-DzylsDQg.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-CcyfsgGP.js → index-MqrX6o60.js} +2 -2
- prefect/server/ui-v2/assets/{index-CcyfsgGP.js.map → index-MqrX6o60.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-MeJBhX-C.js → index-Xbikq0U9.js} +2 -2
- prefect/server/ui-v2/assets/{index-MeJBhX-C.js.map → index-Xbikq0U9.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-Cyw9YHlj.js → index-xd6ftCzl.js} +2 -2
- prefect/server/ui-v2/assets/{index-Cyw9YHlj.js.map → index-xd6ftCzl.js.map} +1 -1
- prefect/server/ui-v2/assets/{json-input-CJ1Ipjax.js → json-input-CUdR2ooF.js} +2 -2
- prefect/server/ui-v2/assets/{json-input-CJ1Ipjax.js.map → json-input-CUdR2ooF.js.map} +1 -1
- prefect/server/ui-v2/assets/{key._key-B0wb5Umi.js → key._key-Dkjl-3EA.js} +2 -2
- prefect/server/ui-v2/assets/{key._key-B0wb5Umi.js.map → key._key-Dkjl-3EA.js.map} +1 -1
- prefect/server/ui-v2/assets/{lazy-markdown-sP3PYQgB.js → lazy-markdown-B5J5jhCs.js} +2 -2
- prefect/server/ui-v2/assets/{lazy-markdown-sP3PYQgB.js.map → lazy-markdown-B5J5jhCs.js.map} +1 -1
- prefect/server/ui-v2/assets/{login-DNY0o3XU.js → login-DzDO0DVR.js} +2 -2
- prefect/server/ui-v2/assets/{login-DNY0o3XU.js.map → login-DzDO0DVR.js.map} +1 -1
- prefect/server/ui-v2/assets/{markdown-input-Bos2JYXW.js → markdown-input-BYRT3e1M.js} +2 -2
- prefect/server/ui-v2/assets/{markdown-input-Bos2JYXW.js.map → markdown-input-BYRT3e1M.js.map} +1 -1
- prefect/server/ui-v2/assets/{python-example-snippet-CWSJRd48.js → python-example-snippet-BMLiEUYL.js} +3 -3
- prefect/server/ui-v2/assets/{python-example-snippet-CWSJRd48.js.map → python-example-snippet-BMLiEUYL.js.map} +1 -1
- prefect/server/ui-v2/assets/{python-input-Bu4995lK.js → python-input-xovZoSSG.js} +2 -2
- prefect/server/ui-v2/assets/{python-input-Bu4995lK.js.map → python-input-xovZoSSG.js.map} +1 -1
- prefect/server/ui-v2/assets/{radio-group-C0D0oLYd.js → radio-group-B4HH3BMW.js} +2 -2
- prefect/server/ui-v2/assets/{radio-group-C0D0oLYd.js.map → radio-group-B4HH3BMW.js.map} +1 -1
- prefect/server/ui-v2/assets/{route-error-state-DzKu_Iw_.js → route-error-state-BI1VOaRa.js} +2 -2
- prefect/server/ui-v2/assets/{route-error-state-DzKu_Iw_.js.map → route-error-state-BI1VOaRa.js.map} +1 -1
- prefect/server/ui-v2/assets/schema-form-DvPKoIJV.js +2 -0
- prefect/server/ui-v2/assets/schema-form-DvPKoIJV.js.map +1 -0
- prefect/server/ui-v2/assets/{schema-form-input-string-format-datetime-DyDs1jNl.js → schema-form-input-string-format-datetime-FBLeet2k.js} +4 -4
- prefect/server/ui-v2/assets/{schema-form-input-string-format-datetime-DyDs1jNl.js.map → schema-form-input-string-format-datetime-FBLeet2k.js.map} +1 -1
- prefect/server/ui-v2/assets/{settings-a90cwhBe.js → settings-LiwgpMzF.js} +2 -2
- prefect/server/ui-v2/assets/{settings-a90cwhBe.js.map → settings-LiwgpMzF.js.map} +1 -1
- prefect/server/ui-v2/assets/{sort-filter-CCltjs1E.js → sort-filter-BdZ0BjdE.js} +2 -2
- prefect/server/ui-v2/assets/{sort-filter-CCltjs1E.js.map → sort-filter-BdZ0BjdE.js.map} +1 -1
- prefect/server/ui-v2/assets/{table-CrPymfJD.js → table--kjjs3jN.js} +2 -2
- prefect/server/ui-v2/assets/{table-CrPymfJD.js.map → table--kjjs3jN.js.map} +1 -1
- prefect/server/ui-v2/assets/{tags-input-BdNYl8nS.js → tags-input-9pBchAz7.js} +2 -2
- prefect/server/ui-v2/assets/{tags-input-BdNYl8nS.js.map → tags-input-9pBchAz7.js.map} +1 -1
- prefect/server/ui-v2/assets/{task-run-concurrency-limits-reset-dialog-B4bdiAgf.js → task-run-concurrency-limits-reset-dialog-B3XhJqIQ.js} +2 -2
- prefect/server/ui-v2/assets/{task-run-concurrency-limits-reset-dialog-B4bdiAgf.js.map → task-run-concurrency-limits-reset-dialog-B3XhJqIQ.js.map} +1 -1
- prefect/server/ui-v2/assets/{task-run._id-BzeMfM08.js → task-run._id-BdlPyINB.js} +2 -2
- prefect/server/ui-v2/assets/{task-run._id-BzeMfM08.js.map → task-run._id-BdlPyINB.js.map} +1 -1
- prefect/server/ui-v2/assets/{task-run._id-BQac40_I.js → task-run._id-BnZwcX9a.js} +2 -2
- prefect/server/ui-v2/assets/{task-run._id-BQac40_I.js.map → task-run._id-BnZwcX9a.js.map} +1 -1
- prefect/server/ui-v2/assets/{task-runs-pagination-WFGIqR6p.js → task-runs-pagination-ClbepGWu.js} +2 -2
- prefect/server/ui-v2/assets/{task-runs-pagination-WFGIqR6p.js.map → task-runs-pagination-ClbepGWu.js.map} +1 -1
- prefect/server/ui-v2/assets/{textarea-CGFflH-n.js → textarea-CjmPCtZi.js} +2 -2
- prefect/server/ui-v2/assets/{textarea-CGFflH-n.js.map → textarea-CjmPCtZi.js.map} +1 -1
- prefect/server/ui-v2/assets/{timezone-select-ClE9nfKA.js → timezone-select-5WxUFUXB.js} +2 -2
- prefect/server/ui-v2/assets/{timezone-select-ClE9nfKA.js.map → timezone-select-5WxUFUXB.js.map} +1 -1
- prefect/server/ui-v2/assets/{toggle-group-Dnv_LMnU.js → toggle-group-DjbSsHsv.js} +2 -2
- prefect/server/ui-v2/assets/{toggle-group-Dnv_LMnU.js.map → toggle-group-DjbSsHsv.js.map} +1 -1
- prefect/server/ui-v2/assets/{use-delete-automation-confirmation-dialog-CRGV6wvn.js → use-delete-automation-confirmation-dialog-C7nas8eR.js} +2 -2
- prefect/server/ui-v2/assets/{use-delete-automation-confirmation-dialog-CRGV6wvn.js.map → use-delete-automation-confirmation-dialog-C7nas8eR.js.map} +1 -1
- prefect/server/ui-v2/assets/{use-delete-block-document-confirmation-dialog-DNMP_gtr.js → use-delete-block-document-confirmation-dialog-Cz3znU4m.js} +2 -2
- prefect/server/ui-v2/assets/{use-delete-block-document-confirmation-dialog-DNMP_gtr.js.map → use-delete-block-document-confirmation-dialog-Cz3znU4m.js.map} +1 -1
- prefect/server/ui-v2/assets/{use-flow-runs-selected-rows-D3-TVsRL.js → use-flow-runs-selected-rows-B_7PiPKo.js} +2 -2
- prefect/server/ui-v2/assets/{use-flow-runs-selected-rows-D3-TVsRL.js.map → use-flow-runs-selected-rows-B_7PiPKo.js.map} +1 -1
- prefect/server/ui-v2/assets/{use-get-artifacts-flow-task-runs-I3Wb9fOV.js → use-get-artifacts-flow-task-runs-BitcuQLc.js} +2 -2
- prefect/server/ui-v2/assets/{use-get-artifacts-flow-task-runs-I3Wb9fOV.js.map → use-get-artifacts-flow-task-runs-BitcuQLc.js.map} +1 -1
- prefect/server/ui-v2/assets/{use-quick-run-Be-i6Tzi.js → use-quick-run-IfBGzpj9.js} +2 -2
- prefect/server/ui-v2/assets/{use-quick-run-Be-i6Tzi.js.map → use-quick-run-IfBGzpj9.js.map} +1 -1
- prefect/server/ui-v2/assets/{use-state-favicon-DtW_I9k3.js → use-state-favicon-kNCf3RcS.js} +2 -2
- prefect/server/ui-v2/assets/{use-state-favicon-DtW_I9k3.js.map → use-state-favicon-kNCf3RcS.js.map} +1 -1
- prefect/server/ui-v2/assets/{use-stepper-BSvi_u_j.js → use-stepper-DRdSNO1_.js} +2 -2
- prefect/server/ui-v2/assets/{use-stepper-BSvi_u_j.js.map → use-stepper-DRdSNO1_.js.map} +1 -1
- prefect/server/ui-v2/assets/{utilities-BCBDUmEl.js → utilities-B74wofJY.js} +2 -2
- prefect/server/ui-v2/assets/{utilities-BCBDUmEl.js.map → utilities-B74wofJY.js.map} +1 -1
- prefect/server/ui-v2/assets/{work-pool-filter-BuJB9elW.js → work-pool-filter-BD0cywQF.js} +2 -2
- prefect/server/ui-v2/assets/{work-pool-filter-BuJB9elW.js.map → work-pool-filter-BD0cywQF.js.map} +1 -1
- prefect/server/ui-v2/assets/{work-pool-queue-toggle-DP2ONU28.js → work-pool-queue-toggle-Dd3mOecD.js} +2 -2
- prefect/server/ui-v2/assets/{work-pool-queue-toggle-DP2ONU28.js.map → work-pool-queue-toggle-Dd3mOecD.js.map} +1 -1
- prefect/server/ui-v2/assets/{work-pool._workPoolName-BjhJe3F4.js → work-pool._workPoolName-Dxf0Y-lV.js} +2 -2
- prefect/server/ui-v2/assets/{work-pool._workPoolName-BjhJe3F4.js.map → work-pool._workPoolName-Dxf0Y-lV.js.map} +1 -1
- prefect/server/ui-v2/assets/work-pool_._workPoolName.edit-B0Y9VwYX.js +2 -0
- prefect/server/ui-v2/assets/{work-pool_._workPoolName.edit-lHDf1Aih.js.map → work-pool_._workPoolName.edit-B0Y9VwYX.js.map} +1 -1
- prefect/server/ui-v2/assets/{work-pool_._workPoolName.queue._workQueueName-CLthz7sB.js → work-pool_._workPoolName.queue._workQueueName-ZHSn4vVg.js} +2 -2
- prefect/server/ui-v2/assets/{work-pool_._workPoolName.queue._workQueueName-CLthz7sB.js.map → work-pool_._workPoolName.queue._workQueueName-ZHSn4vVg.js.map} +1 -1
- prefect/server/ui-v2/assets/{work-queue-icon-text-4iEAtZOh.js → work-queue-icon-text-GE7b8Ro1.js} +2 -2
- prefect/server/ui-v2/assets/{work-queue-icon-text-4iEAtZOh.js.map → work-queue-icon-text-GE7b8Ro1.js.map} +1 -1
- prefect/server/ui-v2/index.html +1 -1
- prefect/server/utilities/subscriptions.py +25 -8
- prefect/testing/fixtures.py +31 -1
- {prefect-3.6.14.dev4.dist-info → prefect-3.6.14.dev5.dist-info}/METADATA +1 -1
- {prefect-3.6.14.dev4.dist-info → prefect-3.6.14.dev5.dist-info}/RECORD +205 -205
- prefect/server/ui-v2/assets/create-B11nNTmT.js +0 -2
- prefect/server/ui-v2/assets/deployment_._id.duplicate-CqlNWQfz.js +0 -2
- prefect/server/ui-v2/assets/deployment_._id.edit-CbvCe2YU.js +0 -2
- prefect/server/ui-v2/assets/schema-form-BD95b0iS.js +0 -2
- prefect/server/ui-v2/assets/schema-form-BD95b0iS.js.map +0 -1
- prefect/server/ui-v2/assets/work-pool_._workPoolName.edit-lHDf1Aih.js +0 -2
- {prefect-3.6.14.dev4.dist-info → prefect-3.6.14.dev5.dist-info}/WHEEL +0 -0
- {prefect-3.6.14.dev4.dist-info → prefect-3.6.14.dev5.dist-info}/entry_points.txt +0 -0
- {prefect-3.6.14.dev4.dist-info → prefect-3.6.14.dev5.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{j as t,E as h,u as D,r as u}from"./vendor-tanstack-CWDKYA_B.js";import{E as S,t as d,v as C,w as v,x as w,D as j,bc as r,bd as b,be as N,ab as _}from"./index-
|
|
2
|
-
//# sourceMappingURL=index-
|
|
1
|
+
import{j as t,E as h,u as D,r as u}from"./vendor-tanstack-CWDKYA_B.js";import{E as S,t as d,v as C,w as v,x as w,D as j,bc as r,bd as b,be as N,ab as _}from"./index-CQlQauOE.js";import{D as E}from"./index-C19BICb6.js";import{D as k}from"./header-YbYlGgAg.js";import"./vendor-react-Bce9NwRC.js";import"./vendor-radix-DRMjKWJW.js";import"./vendor-recharts-BGjDGXVf.js";import"./vendor-forms-D-iybWES.js";import"./vendor-date-CRz8gtWZ.js";import"./use-quick-run-IfBGzpj9.js";import"./use-delete-confirmation-dialog-C5d6hPL-.js";import"./data-table-B3EtpFhV.js";import"./table--kjjs3jN.js";import"./delete-confirmation-dialog-DyUMWSB-.js";import"./index-C84_3iOG.js";import"./cronstrue-IJcBJ9tZ.js";import"./use-is-overflowing-CyVH32I2.js";import"./index-DzylsDQg.js";import"./tags-input-9pBchAz7.js";import"./dropdown-menu-6cSdnzsr.js";const P=()=>t.jsxs(S,{children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(d,{id:"Workflow"}),t.jsx(d,{id:"MoreHorizontal"}),t.jsx(d,{id:"Rocket"})]}),t.jsx(C,{children:"Create a deployment to get started"}),t.jsx(v,{children:"Deployments elevate workflows from functions you call manually to API objects that can be remotely triggered."}),t.jsx(w,{children:t.jsx(j,{id:"deployments-guide"})})]}),A=e=>({page:e?.page??1,limit:e?.limit??10,sort:e?.sort??"NAME_ASC",deployments:{operator:"and_",flow_or_deployment_name:{like_:e?.flowOrDeploymentName??""},tags:{operator:"and_",all_:e?.tags??[]}}}),F=()=>{const e=r.useSearch(),o=r.useNavigate(),s=(e.page??1)-1,a=e.limit??10,n=u.useMemo(()=>({pageIndex:s,pageSize:a}),[s,a]),p=u.useCallback(i=>{o({to:".",search:l=>({...l,page:i.pageIndex+1,limit:i.pageSize}),replace:!0})},[o]);return[n,p]},O=()=>{const e=r.useSearch(),o=r.useNavigate(),s=a=>{o({to:".",search:n=>({...n,sort:a}),replace:!0})};return[e.sort,s]},M=()=>{const e=r.useSearch(),o=r.useNavigate(),s=u.useMemo(()=>[{id:"flowOrDeploymentName",value:e.flowOrDeploymentName},{id:"tags",value:e.tags}],[e.flowOrDeploymentName,e.tags]),a=u.useCallback(n=>{o({to:".",search:p=>{const i=n.find(m=>m.id==="flowOrDeploymentName")?.value,l=n.find(m=>m.id==="tags")?.value;return{...p,offset:0,flowOrDeploymentName:i,tags:l}},replace:!0})},[o]);return[s,a]};function te(){const e=r.useSearch(),[o,s]=F(),[a,n]=O(),[p,i]=M(),[{data:l},{data:m}]=h({queries:[b(),N(A(e))]}),g=m?.results??[],{data:y}=D(_({flows:{operator:"and_",id:{any_:[...new Set(g.map(c=>c.flow_id))]}},offset:0,sort:"NAME_ASC"})),f=g.map(c=>({...c,flow:y?.find(x=>x.id===c.flow_id)}));return t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(k,{}),l===0?t.jsx(P,{}):t.jsx(E,{deployments:f,currentDeploymentsCount:l,pageCount:m?.pages??0,pagination:o,sort:a,columnFilters:p,onPaginationChange:s,onSortChange:n,onColumnFiltersChange:i})]})}export{te as component};
|
|
2
|
+
//# sourceMappingURL=index-D9O_iUny.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-Bmd9p_xN.js","sources":["../../src/components/deployments/empty-state/index.tsx","../../src/routes/deployments/index.tsx?tsr-split=component"],"sourcesContent":["import { DocsLink } from \"@/components/ui/docs-link\";\nimport {\n\tEmptyState,\n\tEmptyStateActions,\n\tEmptyStateDescription,\n\tEmptyStateIcon,\n\tEmptyStateTitle,\n} from \"@/components/ui/empty-state\";\n\nexport const DeploymentsEmptyState = () => (\n\t<EmptyState>\n\t\t<div className=\"flex items-center gap-3\">\n\t\t\t<EmptyStateIcon id=\"Workflow\" />\n\t\t\t<EmptyStateIcon id=\"MoreHorizontal\" />\n\t\t\t<EmptyStateIcon id=\"Rocket\" />\n\t\t</div>\n\t\t<EmptyStateTitle>Create a deployment to get started</EmptyStateTitle>\n\t\t<EmptyStateDescription>\n\t\t\tDeployments elevate workflows from functions you call manually to API\n\t\t\tobjects that can be remotely triggered.\n\t\t</EmptyStateDescription>\n\t\t<EmptyStateActions>\n\t\t\t<DocsLink id=\"deployments-guide\" />\n\t\t</EmptyStateActions>\n\t</EmptyState>\n);\n","import { useQuery, useSuspenseQueries } from \"@tanstack/react-query\";\nimport type { ErrorComponentProps } from \"@tanstack/react-router\";\nimport { createFileRoute } from \"@tanstack/react-router\";\nimport type {\n\tColumnFiltersState,\n\tPaginationState,\n} from \"@tanstack/react-table\";\nimport { zodValidator } from \"@tanstack/zod-adapter\";\nimport { useCallback, useMemo } from \"react\";\nimport { z } from \"zod\";\nimport {\n\tbuildCountDeploymentsQuery,\n\tbuildPaginateDeploymentsQuery,\n\ttype DeploymentsPaginationFilter,\n} from \"@/api/deployments\";\nimport { categorizeError } from \"@/api/error-utils\";\nimport { buildListFlowsQuery } from \"@/api/flows\";\nimport type { components } from \"@/api/prefect\";\nimport { DeploymentsDataTable } from \"@/components/deployments/data-table\";\nimport { DeploymentsEmptyState } from \"@/components/deployments/empty-state\";\nimport { DeploymentsPageHeader } from \"@/components/deployments/header\";\nimport { RouteErrorState } from \"@/components/ui/route-error-state\";\n\n/**\n * Schema for validating URL search parameters for the variables page.\n * @property {number} page - The page number to display. Must be positive. Defaults to 1.\n * @property {number} limit - The maximum number of items to return. Must be positive. Defaults to 10.\n */\nconst searchParams = z.object({\n\tpage: z.number().int().positive().optional().default(1).catch(1),\n\tlimit: z.number().int().positive().optional().default(10).catch(10),\n\tsort: z\n\t\t.enum([\"NAME_ASC\", \"NAME_DESC\", \"CREATED_DESC\", \"UPDATED_DESC\"])\n\t\t.optional()\n\t\t.default(\"NAME_ASC\")\n\t\t.catch(\"NAME_ASC\"),\n\tflowOrDeploymentName: z.string().optional().catch(\"\"),\n\ttags: z.array(z.string()).optional().catch([]),\n});\n\n/**\n * Builds pagination parameters for deployments query from search params\n *\n * @param search - Optional validated search parameters containing page and limit\n * @returns DeploymentsPaginationFilter with page, limit and sort order\n *\n * @example\n * ```ts\n * const filter = buildPaginationBody({ page: 2, limit: 25 })\n * // Returns { page: 2, limit: 25, sort: \"NAME_ASC\" }\n * ```\n */\nconst buildPaginationBody = (\n\tsearch?: z.infer<typeof searchParams>,\n): DeploymentsPaginationFilter => ({\n\tpage: search?.page ?? 1,\n\tlimit: search?.limit ?? 10,\n\tsort: search?.sort ?? \"NAME_ASC\",\n\tdeployments: {\n\t\toperator: \"and_\",\n\t\tflow_or_deployment_name: { like_: search?.flowOrDeploymentName ?? \"\" },\n\t\ttags: { operator: \"and_\", all_: search?.tags ?? [] },\n\t},\n});\n\nfunction DeploymentsErrorComponent({ error, reset }: ErrorComponentProps) {\n\tconst serverError = categorizeError(error, \"Failed to load deployments\");\n\n\t// Only handle API errors (server-error, client-error) at route level\n\t// Let network errors and unknown errors bubble up to root error component\n\tif (\n\t\tserverError.type !== \"server-error\" &&\n\t\tserverError.type !== \"client-error\"\n\t) {\n\t\tthrow error;\n\t}\n\n\treturn (\n\t\t<div className=\"flex flex-col gap-4\">\n\t\t\t<DeploymentsPageHeader />\n\t\t\t<RouteErrorState error={serverError} onRetry={reset} />\n\t\t</div>\n\t);\n}\n\nexport const Route = createFileRoute(\"/deployments/\")({\n\tvalidateSearch: zodValidator(searchParams),\n\tcomponent: RouteComponent,\n\terrorComponent: DeploymentsErrorComponent,\n\tloaderDeps: ({ search }) => buildPaginationBody(search),\n\tloader: async ({ deps, context }) => {\n\t\t// Get full count of deployments, don't block the UI\n\t\tconst deploymentsCountResult = context.queryClient.ensureQueryData(\n\t\t\tbuildCountDeploymentsQuery(),\n\t\t);\n\n\t\t// Get paginated deployments, wait for the result to get corresponding flows\n\t\tconst deploymentsPaginateResult = await context.queryClient.ensureQueryData(\n\t\t\tbuildPaginateDeploymentsQuery(deps),\n\t\t);\n\n\t\tconst deployments = deploymentsPaginateResult?.results ?? [];\n\n\t\tconst flowIds = [\n\t\t\t...new Set(deployments.map((deployment) => deployment.flow_id)),\n\t\t];\n\n\t\t// Get flows corresponding to the deployments\n\t\tconst flowsFilterResult = context.queryClient.ensureQueryData(\n\t\t\tbuildListFlowsQuery({\n\t\t\t\tflows: {\n\t\t\t\t\toperator: \"and_\",\n\t\t\t\t\tid: {\n\t\t\t\t\t\tany_: flowIds,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\toffset: 0,\n\t\t\t\tsort: \"NAME_ASC\",\n\t\t\t}),\n\t\t);\n\n\t\treturn {\n\t\t\tdeploymentsCountResult,\n\t\t\tdeploymentsPaginateResult,\n\t\t\tflowsFilterResult,\n\t\t};\n\t},\n\twrapInSuspense: true,\n});\n\n/**\n * Hook to manage pagination state and navigation for deployments table\n *\n * Handles conversion between 1-based page numbers in the URL and 0-based indices used by React Table.\n * Updates the URL search parameters when pagination changes.\n *\n * @returns A tuple containing:\n * - pagination: Current pagination state with pageIndex and pageSize\n * - onPaginationChange: Callback to update pagination and navigate with new search params\n */\nconst usePagination = () => {\n\tconst search = Route.useSearch();\n\tconst navigate = Route.useNavigate();\n\n\t// React Table uses 0-based pagination, so we need to subtract 1 from the page number\n\tconst pageIndex = (search.page ?? 1) - 1;\n\tconst pageSize = search.limit ?? 10;\n\tconst pagination: PaginationState = useMemo(\n\t\t() => ({\n\t\t\tpageIndex,\n\t\t\tpageSize,\n\t\t}),\n\t\t[pageIndex, pageSize],\n\t);\n\n\tconst onPaginationChange = useCallback(\n\t\t(newPagination: PaginationState) => {\n\t\t\tvoid navigate({\n\t\t\t\tto: \".\",\n\t\t\t\tsearch: (prev) => ({\n\t\t\t\t\t...prev,\n\t\t\t\t\tpage: newPagination.pageIndex + 1,\n\t\t\t\t\tlimit: newPagination.pageSize,\n\t\t\t\t}),\n\t\t\t\treplace: true,\n\t\t\t});\n\t\t},\n\t\t[navigate],\n\t);\n\n\treturn [pagination, onPaginationChange] as const;\n};\n\n/**\n * Hook to manage sorting state and navigation for deployments table\n *\n * Handles updating the URL search parameters when sort order changes.\n * Returns the current sort value from URL and a callback to update it.\n *\n * @returns A tuple containing:\n * - sort: Current sort value from URL search params\n * - onSortingChange: Callback to update sort and navigate with new search params\n */\nconst useSort = () => {\n\tconst search = Route.useSearch();\n\tconst navigate = Route.useNavigate();\n\n\tconst onSortingChange = (sort: components[\"schemas\"][\"DeploymentSort\"]) => {\n\t\tvoid navigate({\n\t\t\tto: \".\",\n\t\t\tsearch: (prev) => ({ ...prev, sort }),\n\t\t\treplace: true,\n\t\t});\n\t};\n\n\treturn [search.sort, onSortingChange] as const;\n};\n\nconst useDeploymentsColumnFilters = () => {\n\tconst search = Route.useSearch();\n\tconst navigate = Route.useNavigate();\n\tconst columnFilters: ColumnFiltersState = useMemo(\n\t\t() => [\n\t\t\t{ id: \"flowOrDeploymentName\", value: search.flowOrDeploymentName },\n\t\t\t{ id: \"tags\", value: search.tags },\n\t\t],\n\t\t[search.flowOrDeploymentName, search.tags],\n\t);\n\n\tconst onColumnFiltersChange = useCallback(\n\t\t(newColumnFilters: ColumnFiltersState) => {\n\t\t\tvoid navigate({\n\t\t\t\tto: \".\",\n\t\t\t\tsearch: (prev) => {\n\t\t\t\t\tconst flowOrDeploymentName = newColumnFilters.find(\n\t\t\t\t\t\t(filter) => filter.id === \"flowOrDeploymentName\",\n\t\t\t\t\t)?.value as string | undefined;\n\t\t\t\t\tconst tags = newColumnFilters.find((filter) => filter.id === \"tags\")\n\t\t\t\t\t\t?.value as string[] | undefined;\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...prev,\n\t\t\t\t\t\toffset: 0,\n\t\t\t\t\t\tflowOrDeploymentName,\n\t\t\t\t\t\ttags,\n\t\t\t\t\t};\n\t\t\t\t},\n\t\t\t\treplace: true,\n\t\t\t});\n\t\t},\n\t\t[navigate],\n\t);\n\n\treturn [columnFilters, onColumnFiltersChange] as const;\n};\n\nfunction RouteComponent() {\n\tconst search = Route.useSearch();\n\tconst [pagination, onPaginationChange] = usePagination();\n\tconst [sort, onSortChange] = useSort();\n\tconst [columnFilters, onColumnFiltersChange] = useDeploymentsColumnFilters();\n\n\tconst [{ data: deploymentsCount }, { data: deploymentsPage }] =\n\t\tuseSuspenseQueries({\n\t\t\tqueries: [\n\t\t\t\tbuildCountDeploymentsQuery(),\n\t\t\t\tbuildPaginateDeploymentsQuery(buildPaginationBody(search)),\n\t\t\t],\n\t\t});\n\n\tconst deployments = deploymentsPage?.results ?? [];\n\n\tconst { data: flows } = useQuery(\n\t\tbuildListFlowsQuery({\n\t\t\tflows: {\n\t\t\t\toperator: \"and_\",\n\t\t\t\tid: {\n\t\t\t\t\tany_: [\n\t\t\t\t\t\t...new Set(deployments.map((deployment) => deployment.flow_id)),\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t},\n\t\t\toffset: 0,\n\t\t\tsort: \"NAME_ASC\",\n\t\t}),\n\t);\n\n\tconst deploymentsWithFlows = deployments.map((deployment) => ({\n\t\t...deployment,\n\t\tflow: flows?.find((flow) => flow.id === deployment.flow_id),\n\t}));\n\n\treturn (\n\t\t<div className=\"flex flex-col gap-4\">\n\t\t\t<DeploymentsPageHeader />\n\t\t\t{deploymentsCount === 0 ? (\n\t\t\t\t<DeploymentsEmptyState />\n\t\t\t) : (\n\t\t\t\t<DeploymentsDataTable\n\t\t\t\t\tdeployments={deploymentsWithFlows}\n\t\t\t\t\tcurrentDeploymentsCount={deploymentsCount}\n\t\t\t\t\tpageCount={deploymentsPage?.pages ?? 0}\n\t\t\t\t\tpagination={pagination}\n\t\t\t\t\tsort={sort}\n\t\t\t\t\tcolumnFilters={columnFilters}\n\t\t\t\t\tonPaginationChange={onPaginationChange}\n\t\t\t\t\tonSortChange={onSortChange}\n\t\t\t\t\tonColumnFiltersChange={onColumnFiltersChange}\n\t\t\t\t/>\n\t\t\t)}\n\t\t</div>\n\t);\n}\n"],"names":["DeploymentsEmptyState","jsxs","EmptyState","jsx","EmptyStateIcon","EmptyStateTitle","EmptyStateDescription","EmptyStateActions","DocsLink","buildPaginationBody","search","page","limit","sort","deployments","operator","flow_or_deployment_name","like_","flowOrDeploymentName","tags","all_","usePagination","Route","useSearch","navigate","useNavigate","pageIndex","pageSize","pagination","useMemo","onPaginationChange","useCallback","newPagination","to","prev","replace","useSort","onSortingChange","useDeploymentsColumnFilters","columnFilters","id","value","onColumnFiltersChange","newColumnFilters","find","filter","offset","RouteComponent","onSortChange","data","deploymentsCount","deploymentsPage","useSuspenseQueries","queries","buildCountDeploymentsQuery","buildPaginateDeploymentsQuery","results","flows","useQuery","buildListFlowsQuery","any_","Set","map","deployment","flow_id","deploymentsWithFlows","flow","DeploymentsPageHeader","DeploymentsDataTable","pages"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"index-D9O_iUny.js","sources":["../../src/components/deployments/empty-state/index.tsx","../../src/routes/deployments/index.tsx?tsr-split=component"],"sourcesContent":["import { DocsLink } from \"@/components/ui/docs-link\";\nimport {\n\tEmptyState,\n\tEmptyStateActions,\n\tEmptyStateDescription,\n\tEmptyStateIcon,\n\tEmptyStateTitle,\n} from \"@/components/ui/empty-state\";\n\nexport const DeploymentsEmptyState = () => (\n\t<EmptyState>\n\t\t<div className=\"flex items-center gap-3\">\n\t\t\t<EmptyStateIcon id=\"Workflow\" />\n\t\t\t<EmptyStateIcon id=\"MoreHorizontal\" />\n\t\t\t<EmptyStateIcon id=\"Rocket\" />\n\t\t</div>\n\t\t<EmptyStateTitle>Create a deployment to get started</EmptyStateTitle>\n\t\t<EmptyStateDescription>\n\t\t\tDeployments elevate workflows from functions you call manually to API\n\t\t\tobjects that can be remotely triggered.\n\t\t</EmptyStateDescription>\n\t\t<EmptyStateActions>\n\t\t\t<DocsLink id=\"deployments-guide\" />\n\t\t</EmptyStateActions>\n\t</EmptyState>\n);\n","import { useQuery, useSuspenseQueries } from \"@tanstack/react-query\";\nimport type { ErrorComponentProps } from \"@tanstack/react-router\";\nimport { createFileRoute } from \"@tanstack/react-router\";\nimport type {\n\tColumnFiltersState,\n\tPaginationState,\n} from \"@tanstack/react-table\";\nimport { zodValidator } from \"@tanstack/zod-adapter\";\nimport { useCallback, useMemo } from \"react\";\nimport { z } from \"zod\";\nimport {\n\tbuildCountDeploymentsQuery,\n\tbuildPaginateDeploymentsQuery,\n\ttype DeploymentsPaginationFilter,\n} from \"@/api/deployments\";\nimport { categorizeError } from \"@/api/error-utils\";\nimport { buildListFlowsQuery } from \"@/api/flows\";\nimport type { components } from \"@/api/prefect\";\nimport { DeploymentsDataTable } from \"@/components/deployments/data-table\";\nimport { DeploymentsEmptyState } from \"@/components/deployments/empty-state\";\nimport { DeploymentsPageHeader } from \"@/components/deployments/header\";\nimport { RouteErrorState } from \"@/components/ui/route-error-state\";\n\n/**\n * Schema for validating URL search parameters for the variables page.\n * @property {number} page - The page number to display. Must be positive. Defaults to 1.\n * @property {number} limit - The maximum number of items to return. Must be positive. Defaults to 10.\n */\nconst searchParams = z.object({\n\tpage: z.number().int().positive().optional().default(1).catch(1),\n\tlimit: z.number().int().positive().optional().default(10).catch(10),\n\tsort: z\n\t\t.enum([\"NAME_ASC\", \"NAME_DESC\", \"CREATED_DESC\", \"UPDATED_DESC\"])\n\t\t.optional()\n\t\t.default(\"NAME_ASC\")\n\t\t.catch(\"NAME_ASC\"),\n\tflowOrDeploymentName: z.string().optional().catch(\"\"),\n\ttags: z.array(z.string()).optional().catch([]),\n});\n\n/**\n * Builds pagination parameters for deployments query from search params\n *\n * @param search - Optional validated search parameters containing page and limit\n * @returns DeploymentsPaginationFilter with page, limit and sort order\n *\n * @example\n * ```ts\n * const filter = buildPaginationBody({ page: 2, limit: 25 })\n * // Returns { page: 2, limit: 25, sort: \"NAME_ASC\" }\n * ```\n */\nconst buildPaginationBody = (\n\tsearch?: z.infer<typeof searchParams>,\n): DeploymentsPaginationFilter => ({\n\tpage: search?.page ?? 1,\n\tlimit: search?.limit ?? 10,\n\tsort: search?.sort ?? \"NAME_ASC\",\n\tdeployments: {\n\t\toperator: \"and_\",\n\t\tflow_or_deployment_name: { like_: search?.flowOrDeploymentName ?? \"\" },\n\t\ttags: { operator: \"and_\", all_: search?.tags ?? [] },\n\t},\n});\n\nfunction DeploymentsErrorComponent({ error, reset }: ErrorComponentProps) {\n\tconst serverError = categorizeError(error, \"Failed to load deployments\");\n\n\t// Only handle API errors (server-error, client-error) at route level\n\t// Let network errors and unknown errors bubble up to root error component\n\tif (\n\t\tserverError.type !== \"server-error\" &&\n\t\tserverError.type !== \"client-error\"\n\t) {\n\t\tthrow error;\n\t}\n\n\treturn (\n\t\t<div className=\"flex flex-col gap-4\">\n\t\t\t<DeploymentsPageHeader />\n\t\t\t<RouteErrorState error={serverError} onRetry={reset} />\n\t\t</div>\n\t);\n}\n\nexport const Route = createFileRoute(\"/deployments/\")({\n\tvalidateSearch: zodValidator(searchParams),\n\tcomponent: RouteComponent,\n\terrorComponent: DeploymentsErrorComponent,\n\tloaderDeps: ({ search }) => buildPaginationBody(search),\n\tloader: async ({ deps, context }) => {\n\t\t// Get full count of deployments, don't block the UI\n\t\tconst deploymentsCountResult = context.queryClient.ensureQueryData(\n\t\t\tbuildCountDeploymentsQuery(),\n\t\t);\n\n\t\t// Get paginated deployments, wait for the result to get corresponding flows\n\t\tconst deploymentsPaginateResult = await context.queryClient.ensureQueryData(\n\t\t\tbuildPaginateDeploymentsQuery(deps),\n\t\t);\n\n\t\tconst deployments = deploymentsPaginateResult?.results ?? [];\n\n\t\tconst flowIds = [\n\t\t\t...new Set(deployments.map((deployment) => deployment.flow_id)),\n\t\t];\n\n\t\t// Get flows corresponding to the deployments\n\t\tconst flowsFilterResult = context.queryClient.ensureQueryData(\n\t\t\tbuildListFlowsQuery({\n\t\t\t\tflows: {\n\t\t\t\t\toperator: \"and_\",\n\t\t\t\t\tid: {\n\t\t\t\t\t\tany_: flowIds,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\toffset: 0,\n\t\t\t\tsort: \"NAME_ASC\",\n\t\t\t}),\n\t\t);\n\n\t\treturn {\n\t\t\tdeploymentsCountResult,\n\t\t\tdeploymentsPaginateResult,\n\t\t\tflowsFilterResult,\n\t\t};\n\t},\n\twrapInSuspense: true,\n});\n\n/**\n * Hook to manage pagination state and navigation for deployments table\n *\n * Handles conversion between 1-based page numbers in the URL and 0-based indices used by React Table.\n * Updates the URL search parameters when pagination changes.\n *\n * @returns A tuple containing:\n * - pagination: Current pagination state with pageIndex and pageSize\n * - onPaginationChange: Callback to update pagination and navigate with new search params\n */\nconst usePagination = () => {\n\tconst search = Route.useSearch();\n\tconst navigate = Route.useNavigate();\n\n\t// React Table uses 0-based pagination, so we need to subtract 1 from the page number\n\tconst pageIndex = (search.page ?? 1) - 1;\n\tconst pageSize = search.limit ?? 10;\n\tconst pagination: PaginationState = useMemo(\n\t\t() => ({\n\t\t\tpageIndex,\n\t\t\tpageSize,\n\t\t}),\n\t\t[pageIndex, pageSize],\n\t);\n\n\tconst onPaginationChange = useCallback(\n\t\t(newPagination: PaginationState) => {\n\t\t\tvoid navigate({\n\t\t\t\tto: \".\",\n\t\t\t\tsearch: (prev) => ({\n\t\t\t\t\t...prev,\n\t\t\t\t\tpage: newPagination.pageIndex + 1,\n\t\t\t\t\tlimit: newPagination.pageSize,\n\t\t\t\t}),\n\t\t\t\treplace: true,\n\t\t\t});\n\t\t},\n\t\t[navigate],\n\t);\n\n\treturn [pagination, onPaginationChange] as const;\n};\n\n/**\n * Hook to manage sorting state and navigation for deployments table\n *\n * Handles updating the URL search parameters when sort order changes.\n * Returns the current sort value from URL and a callback to update it.\n *\n * @returns A tuple containing:\n * - sort: Current sort value from URL search params\n * - onSortingChange: Callback to update sort and navigate with new search params\n */\nconst useSort = () => {\n\tconst search = Route.useSearch();\n\tconst navigate = Route.useNavigate();\n\n\tconst onSortingChange = (sort: components[\"schemas\"][\"DeploymentSort\"]) => {\n\t\tvoid navigate({\n\t\t\tto: \".\",\n\t\t\tsearch: (prev) => ({ ...prev, sort }),\n\t\t\treplace: true,\n\t\t});\n\t};\n\n\treturn [search.sort, onSortingChange] as const;\n};\n\nconst useDeploymentsColumnFilters = () => {\n\tconst search = Route.useSearch();\n\tconst navigate = Route.useNavigate();\n\tconst columnFilters: ColumnFiltersState = useMemo(\n\t\t() => [\n\t\t\t{ id: \"flowOrDeploymentName\", value: search.flowOrDeploymentName },\n\t\t\t{ id: \"tags\", value: search.tags },\n\t\t],\n\t\t[search.flowOrDeploymentName, search.tags],\n\t);\n\n\tconst onColumnFiltersChange = useCallback(\n\t\t(newColumnFilters: ColumnFiltersState) => {\n\t\t\tvoid navigate({\n\t\t\t\tto: \".\",\n\t\t\t\tsearch: (prev) => {\n\t\t\t\t\tconst flowOrDeploymentName = newColumnFilters.find(\n\t\t\t\t\t\t(filter) => filter.id === \"flowOrDeploymentName\",\n\t\t\t\t\t)?.value as string | undefined;\n\t\t\t\t\tconst tags = newColumnFilters.find((filter) => filter.id === \"tags\")\n\t\t\t\t\t\t?.value as string[] | undefined;\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...prev,\n\t\t\t\t\t\toffset: 0,\n\t\t\t\t\t\tflowOrDeploymentName,\n\t\t\t\t\t\ttags,\n\t\t\t\t\t};\n\t\t\t\t},\n\t\t\t\treplace: true,\n\t\t\t});\n\t\t},\n\t\t[navigate],\n\t);\n\n\treturn [columnFilters, onColumnFiltersChange] as const;\n};\n\nfunction RouteComponent() {\n\tconst search = Route.useSearch();\n\tconst [pagination, onPaginationChange] = usePagination();\n\tconst [sort, onSortChange] = useSort();\n\tconst [columnFilters, onColumnFiltersChange] = useDeploymentsColumnFilters();\n\n\tconst [{ data: deploymentsCount }, { data: deploymentsPage }] =\n\t\tuseSuspenseQueries({\n\t\t\tqueries: [\n\t\t\t\tbuildCountDeploymentsQuery(),\n\t\t\t\tbuildPaginateDeploymentsQuery(buildPaginationBody(search)),\n\t\t\t],\n\t\t});\n\n\tconst deployments = deploymentsPage?.results ?? [];\n\n\tconst { data: flows } = useQuery(\n\t\tbuildListFlowsQuery({\n\t\t\tflows: {\n\t\t\t\toperator: \"and_\",\n\t\t\t\tid: {\n\t\t\t\t\tany_: [\n\t\t\t\t\t\t...new Set(deployments.map((deployment) => deployment.flow_id)),\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t},\n\t\t\toffset: 0,\n\t\t\tsort: \"NAME_ASC\",\n\t\t}),\n\t);\n\n\tconst deploymentsWithFlows = deployments.map((deployment) => ({\n\t\t...deployment,\n\t\tflow: flows?.find((flow) => flow.id === deployment.flow_id),\n\t}));\n\n\treturn (\n\t\t<div className=\"flex flex-col gap-4\">\n\t\t\t<DeploymentsPageHeader />\n\t\t\t{deploymentsCount === 0 ? (\n\t\t\t\t<DeploymentsEmptyState />\n\t\t\t) : (\n\t\t\t\t<DeploymentsDataTable\n\t\t\t\t\tdeployments={deploymentsWithFlows}\n\t\t\t\t\tcurrentDeploymentsCount={deploymentsCount}\n\t\t\t\t\tpageCount={deploymentsPage?.pages ?? 0}\n\t\t\t\t\tpagination={pagination}\n\t\t\t\t\tsort={sort}\n\t\t\t\t\tcolumnFilters={columnFilters}\n\t\t\t\t\tonPaginationChange={onPaginationChange}\n\t\t\t\t\tonSortChange={onSortChange}\n\t\t\t\t\tonColumnFiltersChange={onColumnFiltersChange}\n\t\t\t\t/>\n\t\t\t)}\n\t\t</div>\n\t);\n}\n"],"names":["DeploymentsEmptyState","jsxs","EmptyState","jsx","EmptyStateIcon","EmptyStateTitle","EmptyStateDescription","EmptyStateActions","DocsLink","buildPaginationBody","search","page","limit","sort","deployments","operator","flow_or_deployment_name","like_","flowOrDeploymentName","tags","all_","usePagination","Route","useSearch","navigate","useNavigate","pageIndex","pageSize","pagination","useMemo","onPaginationChange","useCallback","newPagination","to","prev","replace","useSort","onSortingChange","useDeploymentsColumnFilters","columnFilters","id","value","onColumnFiltersChange","newColumnFilters","find","filter","offset","RouteComponent","onSortChange","data","deploymentsCount","deploymentsPage","useSuspenseQueries","queries","buildCountDeploymentsQuery","buildPaginateDeploymentsQuery","results","flows","useQuery","buildListFlowsQuery","any_","Set","map","deployment","flow_id","deploymentsWithFlows","flow","DeploymentsPageHeader","DeploymentsDataTable","pages"],"mappings":"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"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{j as o}from"./vendor-tanstack-CWDKYA_B.js";import{s}from"./index-
|
|
2
|
-
//# sourceMappingURL=index-
|
|
1
|
+
import{j as o}from"./vendor-tanstack-CWDKYA_B.js";import{s}from"./index-CQlQauOE.js";import{R as p}from"./route-error-state-BI1VOaRa.js";import{o as n,e as l,a as m,n as e,s as a}from"./vendor-forms-D-iybWES.js";import"./vendor-react-Bce9NwRC.js";import"./vendor-radix-DRMjKWJW.js";import"./vendor-recharts-BGjDGXVf.js";import"./vendor-date-CRz8gtWZ.js";n({name:a().optional(),page:e().int().positive().optional().default(1).catch(1),limit:e().int().positive().max(100).optional().default(10).catch(10),tags:m(a()).optional(),sort:l(["CREATED_DESC","UPDATED_DESC","NAME_ASC","NAME_DESC"]).optional().default("NAME_ASC")}).optional().default({});function h({error:t,reset:i}){const r=s(t,"Failed to load flows");if(r.type!=="server-error"&&r.type!=="client-error")throw t;return o.jsxs("div",{className:"flex flex-col gap-4",children:[o.jsx("div",{children:o.jsx("h1",{className:"text-2xl font-semibold",children:"Flows"})}),o.jsx(p,{error:r,onRetry:i})]})}export{h as errorComponent};
|
|
2
|
+
//# sourceMappingURL=index-DBhG-F3c.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-CfHvTOAO.js","sources":["../../src/routes/flows/index.tsx?tsr-split=errorComponent"],"sourcesContent":["import {\n\tuseQuery,\n\tuseQueryClient,\n\tuseSuspenseQuery,\n} from \"@tanstack/react-query\";\nimport type { ErrorComponentProps } from \"@tanstack/react-router\";\nimport { createFileRoute } from \"@tanstack/react-router\";\nimport type {\n\tColumnFiltersState,\n\tPaginationState,\n} from \"@tanstack/react-table\";\nimport { zodValidator } from \"@tanstack/zod-adapter\";\nimport { useCallback, useMemo } from \"react\";\nimport { z } from \"zod\";\nimport { categorizeError } from \"@/api/error-utils\";\nimport { buildFilterFlowRunsQuery } from \"@/api/flow-runs\";\nimport {\n\tbuildCountFlowsFilteredQuery,\n\tbuildDeploymentsCountByFlowQuery,\n\tbuildNextRunsByFlowQuery,\n\tbuildPaginateFlowsQuery,\n\ttype FlowsPaginateFilter,\n} from \"@/api/flows\";\nimport FlowsPage from \"@/components/flows/flows-page\";\nimport { RouteErrorState } from \"@/components/ui/route-error-state\";\n\n// Route for /flows/\n\nconst searchParams = z\n\t.object({\n\t\tname: z.string().optional(),\n\t\tpage: z.number().int().positive().optional().default(1).catch(1),\n\t\tlimit: z\n\t\t\t.number()\n\t\t\t.int()\n\t\t\t.positive()\n\t\t\t.max(100)\n\t\t\t.optional()\n\t\t\t.default(10)\n\t\t\t.catch(10),\n\t\ttags: z.array(z.string()).optional(),\n\t\tsort: z\n\t\t\t.enum([\"CREATED_DESC\", \"UPDATED_DESC\", \"NAME_ASC\", \"NAME_DESC\"])\n\t\t\t.optional()\n\t\t\t.default(\"NAME_ASC\"),\n\t})\n\t.optional()\n\t.default({});\n\ntype SearchParams = z.infer<typeof searchParams>;\n\nconst buildPaginationBody = (search?: SearchParams): FlowsPaginateFilter => {\n\tconst hasNameFilter = Boolean(search?.name);\n\tconst hasTagsFilter = Boolean(search?.tags?.length);\n\n\tif (!hasNameFilter && !hasTagsFilter) {\n\t\treturn {\n\t\t\tpage: search?.page ?? 1,\n\t\t\tlimit: search?.limit ?? 10,\n\t\t\tsort: search?.sort ?? \"NAME_ASC\",\n\t\t};\n\t}\n\n\treturn {\n\t\tpage: search?.page ?? 1,\n\t\tlimit: search?.limit ?? 10,\n\t\tsort: search?.sort ?? \"NAME_ASC\",\n\t\tflows: {\n\t\t\toperator: \"and_\",\n\t\t\t...(hasNameFilter && { name: { like_: search?.name } }),\n\t\t\t...(hasTagsFilter && {\n\t\t\t\ttags: { operator: \"and_\", all_: search?.tags },\n\t\t\t}),\n\t\t},\n\t};\n};\n\nconst NUMBER_OF_ACTIVITY_BARS = 16;\n\nfunction FlowsErrorComponent({ error, reset }: ErrorComponentProps) {\n\tconst serverError = categorizeError(error, \"Failed to load flows\");\n\n\t// Only handle API errors (server-error, client-error) at route level\n\t// Let network errors and unknown errors bubble up to root error component\n\tif (\n\t\tserverError.type !== \"server-error\" &&\n\t\tserverError.type !== \"client-error\"\n\t) {\n\t\tthrow error;\n\t}\n\n\treturn (\n\t\t<div className=\"flex flex-col gap-4\">\n\t\t\t<div>\n\t\t\t\t<h1 className=\"text-2xl font-semibold\">Flows</h1>\n\t\t\t</div>\n\t\t\t<RouteErrorState error={serverError} onRetry={reset} />\n\t\t</div>\n\t);\n}\n\nexport const Route = createFileRoute(\"/flows/\")({\n\tvalidateSearch: zodValidator(searchParams),\n\tcomponent: FlowsRoute,\n\terrorComponent: FlowsErrorComponent,\n\tloaderDeps: ({ search }) => buildPaginationBody(search),\n\tloader: ({ deps, context }) => {\n\t\t// Prefetch current page queries without blocking the loader\n\t\tvoid context.queryClient.prefetchQuery(\n\t\t\tbuildPaginateFlowsQuery(deps, 30_000),\n\t\t);\n\t\tvoid context.queryClient.prefetchQuery(\n\t\t\tbuildCountFlowsFilteredQuery({\n\t\t\t\toffset: 0,\n\t\t\t\tsort: deps.sort,\n\t\t\t\tflows: deps.flows ?? undefined,\n\t\t\t}),\n\t\t);\n\t\t// Prefetch total count for empty state check\n\t\tvoid context.queryClient.prefetchQuery(\n\t\t\tbuildCountFlowsFilteredQuery({\n\t\t\t\toffset: 0,\n\t\t\t\tsort: \"NAME_ASC\",\n\t\t\t}),\n\t\t);\n\t},\n\twrapInSuspense: true,\n});\n\nconst usePagination = () => {\n\tconst search = Route.useSearch();\n\tconst navigate = Route.useNavigate();\n\n\t// Convert URL params (1-based page) to TanStack Table's PaginationState (0-based pageIndex)\n\tconst pagination: PaginationState = useMemo(\n\t\t() => ({\n\t\t\tpageIndex: (search.page ?? 1) - 1,\n\t\t\tpageSize: search.limit ?? 10,\n\t\t}),\n\t\t[search.page, search.limit],\n\t);\n\n\tconst onPaginationChange = useCallback(\n\t\t(newPagination: PaginationState) => {\n\t\t\tvoid navigate({\n\t\t\t\tto: \".\",\n\t\t\t\tsearch: (prev) => ({\n\t\t\t\t\t...prev,\n\t\t\t\t\t// Convert TanStack Table's 0-based pageIndex back to 1-based page for URL\n\t\t\t\t\tpage: newPagination.pageIndex + 1,\n\t\t\t\t\tlimit: newPagination.pageSize,\n\t\t\t\t}),\n\t\t\t\treplace: true,\n\t\t\t});\n\t\t},\n\t\t[navigate],\n\t);\n\n\treturn [pagination, onPaginationChange] as const;\n};\n\ntype FlowSort = \"CREATED_DESC\" | \"UPDATED_DESC\" | \"NAME_ASC\" | \"NAME_DESC\";\n\nconst useSort = () => {\n\tconst search = Route.useSearch();\n\tconst navigate = Route.useNavigate();\n\n\tconst onSortChange = useCallback(\n\t\t(sort: FlowSort) => {\n\t\t\tvoid navigate({\n\t\t\t\tto: \".\",\n\t\t\t\tsearch: (prev) => ({ ...prev, sort }),\n\t\t\t\treplace: true,\n\t\t\t});\n\t\t},\n\t\t[navigate],\n\t);\n\n\treturn [search.sort, onSortChange] as const;\n};\n\nconst useFlowsColumnFilters = () => {\n\tconst search = Route.useSearch();\n\tconst navigate = Route.useNavigate();\n\tconst columnFilters: ColumnFiltersState = useMemo(\n\t\t() => [\n\t\t\t{ id: \"name\", value: search.name },\n\t\t\t{ id: \"tags\", value: search.tags },\n\t\t],\n\t\t[search.name, search.tags],\n\t);\n\n\tconst onColumnFiltersChange = useCallback(\n\t\t(newColumnFilters: ColumnFiltersState) => {\n\t\t\tvoid navigate({\n\t\t\t\tto: \".\",\n\t\t\t\tsearch: (prev) => {\n\t\t\t\t\tconst name = newColumnFilters.find((filter) => filter.id === \"name\")\n\t\t\t\t\t\t?.value as string | undefined;\n\t\t\t\t\tconst tags = newColumnFilters.find((filter) => filter.id === \"tags\")\n\t\t\t\t\t\t?.value as string[] | undefined;\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...prev,\n\t\t\t\t\t\tpage: 1,\n\t\t\t\t\t\tname,\n\t\t\t\t\t\ttags,\n\t\t\t\t\t};\n\t\t\t\t},\n\t\t\t\treplace: true,\n\t\t\t});\n\t\t},\n\t\t[navigate],\n\t);\n\n\treturn [columnFilters, onColumnFiltersChange] as const;\n};\n\nfunction FlowsRoute() {\n\tconst search = Route.useSearch();\n\tconst queryClient = useQueryClient();\n\tconst [pagination, onPaginationChange] = usePagination();\n\tconst [sort, onSortChange] = useSort();\n\tconst [columnFilters, onColumnFiltersChange] = useFlowsColumnFilters();\n\n\tconst paginationBody = buildPaginationBody(search);\n\n\t// Use useSuspenseQuery for count (stable key, won't cause suspense on search change)\n\tconst { data: count } = useSuspenseQuery(\n\t\tbuildCountFlowsFilteredQuery({\n\t\t\toffset: 0,\n\t\t\tsort: search.sort,\n\t\t\tflows: paginationBody.flows ?? undefined,\n\t\t}),\n\t);\n\n\t// Get total count of all flows (without filters) to determine if empty state should be shown\n\tconst { data: totalCount } = useSuspenseQuery(\n\t\tbuildCountFlowsFilteredQuery({\n\t\t\toffset: 0,\n\t\t\tsort: \"NAME_ASC\",\n\t\t}),\n\t);\n\n\t// Use useQuery for paginated flows to leverage placeholderData: keepPreviousData\n\t// This prevents the page from suspending when search/filter changes\n\tconst { data: flowsPage } = useQuery(\n\t\tbuildPaginateFlowsQuery(paginationBody, 30_000),\n\t);\n\n\tconst flows = flowsPage?.results ?? [];\n\n\t// Prefetch a page and its child component data when user hovers over pagination buttons\n\tconst onPrefetchPage = useCallback(\n\t\t(page: number) => {\n\t\t\tconst pageDeps = { ...paginationBody, page };\n\t\t\tvoid queryClient\n\t\t\t\t.prefetchQuery(buildPaginateFlowsQuery(pageDeps, 30_000))\n\t\t\t\t.then(() => {\n\t\t\t\t\t// Get the prefetched page data from cache\n\t\t\t\t\tconst pageData = queryClient.getQueryData<{\n\t\t\t\t\t\tresults?: Array<{ id?: string }>;\n\t\t\t\t\t}>(buildPaginateFlowsQuery(pageDeps, 30_000).queryKey);\n\n\t\t\t\t\tconst flowIds =\n\t\t\t\t\t\tpageData?.results\n\t\t\t\t\t\t\t?.map((flow) => flow.id)\n\t\t\t\t\t\t\t.filter((id): id is string => Boolean(id)) ?? [];\n\n\t\t\t\t\tif (flowIds.length === 0) return;\n\n\t\t\t\t\t// Prefetch child component queries for each flow individually\n\t\t\t\t\t// Using individual flow IDs ensures query keys match what components use\n\t\t\t\t\tfor (const flowId of flowIds) {\n\t\t\t\t\t\t// FlowNextRun query - uses single flow ID array for query key matching\n\t\t\t\t\t\tvoid queryClient.prefetchQuery(buildNextRunsByFlowQuery([flowId]));\n\n\t\t\t\t\t\t// FlowDeploymentCount query - uses single flow ID array for query key matching\n\t\t\t\t\t\tvoid queryClient.prefetchQuery(\n\t\t\t\t\t\t\tbuildDeploymentsCountByFlowQuery([flowId]),\n\t\t\t\t\t\t);\n\t\t\t\t\t\t// FlowLastRun query - last completed run\n\t\t\t\t\t\tvoid queryClient.prefetchQuery(\n\t\t\t\t\t\t\tbuildFilterFlowRunsQuery({\n\t\t\t\t\t\t\t\tflows: { operator: \"and_\", id: { any_: [flowId] } },\n\t\t\t\t\t\t\t\tflow_runs: {\n\t\t\t\t\t\t\t\t\toperator: \"and_\",\n\t\t\t\t\t\t\t\t\tstart_time: { is_null_: false },\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\toffset: 0,\n\t\t\t\t\t\t\t\tlimit: 1,\n\t\t\t\t\t\t\t\tsort: \"START_TIME_DESC\",\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t// FlowActivity query - recent runs for activity chart\n\t\t\t\t\t\tvoid queryClient.prefetchQuery(\n\t\t\t\t\t\t\tbuildFilterFlowRunsQuery({\n\t\t\t\t\t\t\t\tflows: { operator: \"and_\", id: { any_: [flowId] } },\n\t\t\t\t\t\t\t\tflow_runs: {\n\t\t\t\t\t\t\t\t\toperator: \"and_\",\n\t\t\t\t\t\t\t\t\tstart_time: { is_null_: false },\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\toffset: 0,\n\t\t\t\t\t\t\t\tlimit: NUMBER_OF_ACTIVITY_BARS,\n\t\t\t\t\t\t\t\tsort: \"START_TIME_DESC\",\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t},\n\t\t[queryClient, paginationBody],\n\t);\n\n\treturn (\n\t\t<FlowsPage\n\t\t\tflows={flows}\n\t\t\tcount={count ?? 0}\n\t\t\ttotalCount={totalCount ?? 0}\n\t\t\tpageCount={flowsPage?.pages ?? 0}\n\t\t\tsort={sort as \"NAME_ASC\" | \"NAME_DESC\" | \"CREATED_DESC\"}\n\t\t\tpagination={pagination}\n\t\t\tonPaginationChange={onPaginationChange}\n\t\t\tonSortChange={onSortChange}\n\t\t\tcolumnFilters={columnFilters}\n\t\t\tonColumnFiltersChange={onColumnFiltersChange}\n\t\t\tonPrefetchPage={onPrefetchPage}\n\t\t/>\n\t);\n}\n"],"names":["z","name","string","optional","page","number","int","positive","default","catch","limit","max","tags","sort","FlowsErrorComponent","error","reset","serverError","categorizeError","type","jsxs","jsx","RouteErrorState"],"mappings":"kWA4BqBA,EACZ,CACPC,KAAMD,EAAEE,EAASC,SAAAA,EACjBC,KAAMJ,EAAEK,EAASC,MAAMC,SAAAA,EAAWJ,SAAAA,EAAWK,QAAQ,CAAC,EAAEC,MAAM,CAAC,EAC/DC,MAAOV,EACLK,EACAC,IAAAA,EACAC,SAAAA,EACAI,IAAI,GAAG,EACPR,SAAAA,EACAK,QAAQ,EAAE,EACVC,MAAM,EAAE,EACVG,KAAMZ,EAAQA,EAAEE,CAAQ,EAAEC,SAAAA,EAC1BU,KAAMb,EACC,CAAC,eAAgB,eAAgB,WAAY,WAAW,CAAC,EAC9DG,WACAK,QAAQ,UAAU,CACrB,CAAC,EACAL,WACAK,QAAQ,CAAA,CAAE,EAgCZ,SAASM,EAAoB,CAAEC,MAAAA,EAAOC,MAAAA,CAA2B,EAAG,CACnE,MAAMC,EAAcC,EAAgBH,EAAO,sBAAsB,EAIjE,GACCE,EAAYE,OAAS,gBACrBF,EAAYE,OAAS,eAErB,MAAMJ,EAGP,OACCK,EAAAA,KAAC,MAAA,CAAI,UAAU,sBACd,SAAA,CAAAC,EAAAA,IAAC,OACA,SAAAA,EAAAA,IAAC,KAAA,CAAG,UAAU,yBAAyB,iBAAK,CAAA,CAC7C,EACAA,EAAAA,IAACC,EAAA,CAAgB,MAAOL,EAAa,QAASD,CAAAA,CAAM,CAAA,EACrD,CAEF"}
|
|
1
|
+
{"version":3,"file":"index-DBhG-F3c.js","sources":["../../src/routes/flows/index.tsx?tsr-split=errorComponent"],"sourcesContent":["import {\n\tuseQuery,\n\tuseQueryClient,\n\tuseSuspenseQuery,\n} from \"@tanstack/react-query\";\nimport type { ErrorComponentProps } from \"@tanstack/react-router\";\nimport { createFileRoute } from \"@tanstack/react-router\";\nimport type {\n\tColumnFiltersState,\n\tPaginationState,\n} from \"@tanstack/react-table\";\nimport { zodValidator } from \"@tanstack/zod-adapter\";\nimport { useCallback, useMemo } from \"react\";\nimport { z } from \"zod\";\nimport { categorizeError } from \"@/api/error-utils\";\nimport { buildFilterFlowRunsQuery } from \"@/api/flow-runs\";\nimport {\n\tbuildCountFlowsFilteredQuery,\n\tbuildDeploymentsCountByFlowQuery,\n\tbuildNextRunsByFlowQuery,\n\tbuildPaginateFlowsQuery,\n\ttype FlowsPaginateFilter,\n} from \"@/api/flows\";\nimport FlowsPage from \"@/components/flows/flows-page\";\nimport { RouteErrorState } from \"@/components/ui/route-error-state\";\n\n// Route for /flows/\n\nconst searchParams = z\n\t.object({\n\t\tname: z.string().optional(),\n\t\tpage: z.number().int().positive().optional().default(1).catch(1),\n\t\tlimit: z\n\t\t\t.number()\n\t\t\t.int()\n\t\t\t.positive()\n\t\t\t.max(100)\n\t\t\t.optional()\n\t\t\t.default(10)\n\t\t\t.catch(10),\n\t\ttags: z.array(z.string()).optional(),\n\t\tsort: z\n\t\t\t.enum([\"CREATED_DESC\", \"UPDATED_DESC\", \"NAME_ASC\", \"NAME_DESC\"])\n\t\t\t.optional()\n\t\t\t.default(\"NAME_ASC\"),\n\t})\n\t.optional()\n\t.default({});\n\ntype SearchParams = z.infer<typeof searchParams>;\n\nconst buildPaginationBody = (search?: SearchParams): FlowsPaginateFilter => {\n\tconst hasNameFilter = Boolean(search?.name);\n\tconst hasTagsFilter = Boolean(search?.tags?.length);\n\n\tif (!hasNameFilter && !hasTagsFilter) {\n\t\treturn {\n\t\t\tpage: search?.page ?? 1,\n\t\t\tlimit: search?.limit ?? 10,\n\t\t\tsort: search?.sort ?? \"NAME_ASC\",\n\t\t};\n\t}\n\n\treturn {\n\t\tpage: search?.page ?? 1,\n\t\tlimit: search?.limit ?? 10,\n\t\tsort: search?.sort ?? \"NAME_ASC\",\n\t\tflows: {\n\t\t\toperator: \"and_\",\n\t\t\t...(hasNameFilter && { name: { like_: search?.name } }),\n\t\t\t...(hasTagsFilter && {\n\t\t\t\ttags: { operator: \"and_\", all_: search?.tags },\n\t\t\t}),\n\t\t},\n\t};\n};\n\nconst NUMBER_OF_ACTIVITY_BARS = 16;\n\nfunction FlowsErrorComponent({ error, reset }: ErrorComponentProps) {\n\tconst serverError = categorizeError(error, \"Failed to load flows\");\n\n\t// Only handle API errors (server-error, client-error) at route level\n\t// Let network errors and unknown errors bubble up to root error component\n\tif (\n\t\tserverError.type !== \"server-error\" &&\n\t\tserverError.type !== \"client-error\"\n\t) {\n\t\tthrow error;\n\t}\n\n\treturn (\n\t\t<div className=\"flex flex-col gap-4\">\n\t\t\t<div>\n\t\t\t\t<h1 className=\"text-2xl font-semibold\">Flows</h1>\n\t\t\t</div>\n\t\t\t<RouteErrorState error={serverError} onRetry={reset} />\n\t\t</div>\n\t);\n}\n\nexport const Route = createFileRoute(\"/flows/\")({\n\tvalidateSearch: zodValidator(searchParams),\n\tcomponent: FlowsRoute,\n\terrorComponent: FlowsErrorComponent,\n\tloaderDeps: ({ search }) => buildPaginationBody(search),\n\tloader: ({ deps, context }) => {\n\t\t// Prefetch current page queries without blocking the loader\n\t\tvoid context.queryClient.prefetchQuery(\n\t\t\tbuildPaginateFlowsQuery(deps, 30_000),\n\t\t);\n\t\tvoid context.queryClient.prefetchQuery(\n\t\t\tbuildCountFlowsFilteredQuery({\n\t\t\t\toffset: 0,\n\t\t\t\tsort: deps.sort,\n\t\t\t\tflows: deps.flows ?? undefined,\n\t\t\t}),\n\t\t);\n\t\t// Prefetch total count for empty state check\n\t\tvoid context.queryClient.prefetchQuery(\n\t\t\tbuildCountFlowsFilteredQuery({\n\t\t\t\toffset: 0,\n\t\t\t\tsort: \"NAME_ASC\",\n\t\t\t}),\n\t\t);\n\t},\n\twrapInSuspense: true,\n});\n\nconst usePagination = () => {\n\tconst search = Route.useSearch();\n\tconst navigate = Route.useNavigate();\n\n\t// Convert URL params (1-based page) to TanStack Table's PaginationState (0-based pageIndex)\n\tconst pagination: PaginationState = useMemo(\n\t\t() => ({\n\t\t\tpageIndex: (search.page ?? 1) - 1,\n\t\t\tpageSize: search.limit ?? 10,\n\t\t}),\n\t\t[search.page, search.limit],\n\t);\n\n\tconst onPaginationChange = useCallback(\n\t\t(newPagination: PaginationState) => {\n\t\t\tvoid navigate({\n\t\t\t\tto: \".\",\n\t\t\t\tsearch: (prev) => ({\n\t\t\t\t\t...prev,\n\t\t\t\t\t// Convert TanStack Table's 0-based pageIndex back to 1-based page for URL\n\t\t\t\t\tpage: newPagination.pageIndex + 1,\n\t\t\t\t\tlimit: newPagination.pageSize,\n\t\t\t\t}),\n\t\t\t\treplace: true,\n\t\t\t});\n\t\t},\n\t\t[navigate],\n\t);\n\n\treturn [pagination, onPaginationChange] as const;\n};\n\ntype FlowSort = \"CREATED_DESC\" | \"UPDATED_DESC\" | \"NAME_ASC\" | \"NAME_DESC\";\n\nconst useSort = () => {\n\tconst search = Route.useSearch();\n\tconst navigate = Route.useNavigate();\n\n\tconst onSortChange = useCallback(\n\t\t(sort: FlowSort) => {\n\t\t\tvoid navigate({\n\t\t\t\tto: \".\",\n\t\t\t\tsearch: (prev) => ({ ...prev, sort }),\n\t\t\t\treplace: true,\n\t\t\t});\n\t\t},\n\t\t[navigate],\n\t);\n\n\treturn [search.sort, onSortChange] as const;\n};\n\nconst useFlowsColumnFilters = () => {\n\tconst search = Route.useSearch();\n\tconst navigate = Route.useNavigate();\n\tconst columnFilters: ColumnFiltersState = useMemo(\n\t\t() => [\n\t\t\t{ id: \"name\", value: search.name },\n\t\t\t{ id: \"tags\", value: search.tags },\n\t\t],\n\t\t[search.name, search.tags],\n\t);\n\n\tconst onColumnFiltersChange = useCallback(\n\t\t(newColumnFilters: ColumnFiltersState) => {\n\t\t\tvoid navigate({\n\t\t\t\tto: \".\",\n\t\t\t\tsearch: (prev) => {\n\t\t\t\t\tconst name = newColumnFilters.find((filter) => filter.id === \"name\")\n\t\t\t\t\t\t?.value as string | undefined;\n\t\t\t\t\tconst tags = newColumnFilters.find((filter) => filter.id === \"tags\")\n\t\t\t\t\t\t?.value as string[] | undefined;\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...prev,\n\t\t\t\t\t\tpage: 1,\n\t\t\t\t\t\tname,\n\t\t\t\t\t\ttags,\n\t\t\t\t\t};\n\t\t\t\t},\n\t\t\t\treplace: true,\n\t\t\t});\n\t\t},\n\t\t[navigate],\n\t);\n\n\treturn [columnFilters, onColumnFiltersChange] as const;\n};\n\nfunction FlowsRoute() {\n\tconst search = Route.useSearch();\n\tconst queryClient = useQueryClient();\n\tconst [pagination, onPaginationChange] = usePagination();\n\tconst [sort, onSortChange] = useSort();\n\tconst [columnFilters, onColumnFiltersChange] = useFlowsColumnFilters();\n\n\tconst paginationBody = buildPaginationBody(search);\n\n\t// Use useSuspenseQuery for count (stable key, won't cause suspense on search change)\n\tconst { data: count } = useSuspenseQuery(\n\t\tbuildCountFlowsFilteredQuery({\n\t\t\toffset: 0,\n\t\t\tsort: search.sort,\n\t\t\tflows: paginationBody.flows ?? undefined,\n\t\t}),\n\t);\n\n\t// Get total count of all flows (without filters) to determine if empty state should be shown\n\tconst { data: totalCount } = useSuspenseQuery(\n\t\tbuildCountFlowsFilteredQuery({\n\t\t\toffset: 0,\n\t\t\tsort: \"NAME_ASC\",\n\t\t}),\n\t);\n\n\t// Use useQuery for paginated flows to leverage placeholderData: keepPreviousData\n\t// This prevents the page from suspending when search/filter changes\n\tconst { data: flowsPage } = useQuery(\n\t\tbuildPaginateFlowsQuery(paginationBody, 30_000),\n\t);\n\n\tconst flows = flowsPage?.results ?? [];\n\n\t// Prefetch a page and its child component data when user hovers over pagination buttons\n\tconst onPrefetchPage = useCallback(\n\t\t(page: number) => {\n\t\t\tconst pageDeps = { ...paginationBody, page };\n\t\t\tvoid queryClient\n\t\t\t\t.prefetchQuery(buildPaginateFlowsQuery(pageDeps, 30_000))\n\t\t\t\t.then(() => {\n\t\t\t\t\t// Get the prefetched page data from cache\n\t\t\t\t\tconst pageData = queryClient.getQueryData<{\n\t\t\t\t\t\tresults?: Array<{ id?: string }>;\n\t\t\t\t\t}>(buildPaginateFlowsQuery(pageDeps, 30_000).queryKey);\n\n\t\t\t\t\tconst flowIds =\n\t\t\t\t\t\tpageData?.results\n\t\t\t\t\t\t\t?.map((flow) => flow.id)\n\t\t\t\t\t\t\t.filter((id): id is string => Boolean(id)) ?? [];\n\n\t\t\t\t\tif (flowIds.length === 0) return;\n\n\t\t\t\t\t// Prefetch child component queries for each flow individually\n\t\t\t\t\t// Using individual flow IDs ensures query keys match what components use\n\t\t\t\t\tfor (const flowId of flowIds) {\n\t\t\t\t\t\t// FlowNextRun query - uses single flow ID array for query key matching\n\t\t\t\t\t\tvoid queryClient.prefetchQuery(buildNextRunsByFlowQuery([flowId]));\n\n\t\t\t\t\t\t// FlowDeploymentCount query - uses single flow ID array for query key matching\n\t\t\t\t\t\tvoid queryClient.prefetchQuery(\n\t\t\t\t\t\t\tbuildDeploymentsCountByFlowQuery([flowId]),\n\t\t\t\t\t\t);\n\t\t\t\t\t\t// FlowLastRun query - last completed run\n\t\t\t\t\t\tvoid queryClient.prefetchQuery(\n\t\t\t\t\t\t\tbuildFilterFlowRunsQuery({\n\t\t\t\t\t\t\t\tflows: { operator: \"and_\", id: { any_: [flowId] } },\n\t\t\t\t\t\t\t\tflow_runs: {\n\t\t\t\t\t\t\t\t\toperator: \"and_\",\n\t\t\t\t\t\t\t\t\tstart_time: { is_null_: false },\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\toffset: 0,\n\t\t\t\t\t\t\t\tlimit: 1,\n\t\t\t\t\t\t\t\tsort: \"START_TIME_DESC\",\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t// FlowActivity query - recent runs for activity chart\n\t\t\t\t\t\tvoid queryClient.prefetchQuery(\n\t\t\t\t\t\t\tbuildFilterFlowRunsQuery({\n\t\t\t\t\t\t\t\tflows: { operator: \"and_\", id: { any_: [flowId] } },\n\t\t\t\t\t\t\t\tflow_runs: {\n\t\t\t\t\t\t\t\t\toperator: \"and_\",\n\t\t\t\t\t\t\t\t\tstart_time: { is_null_: false },\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\toffset: 0,\n\t\t\t\t\t\t\t\tlimit: NUMBER_OF_ACTIVITY_BARS,\n\t\t\t\t\t\t\t\tsort: \"START_TIME_DESC\",\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t},\n\t\t[queryClient, paginationBody],\n\t);\n\n\treturn (\n\t\t<FlowsPage\n\t\t\tflows={flows}\n\t\t\tcount={count ?? 0}\n\t\t\ttotalCount={totalCount ?? 0}\n\t\t\tpageCount={flowsPage?.pages ?? 0}\n\t\t\tsort={sort as \"NAME_ASC\" | \"NAME_DESC\" | \"CREATED_DESC\"}\n\t\t\tpagination={pagination}\n\t\t\tonPaginationChange={onPaginationChange}\n\t\t\tonSortChange={onSortChange}\n\t\t\tcolumnFilters={columnFilters}\n\t\t\tonColumnFiltersChange={onColumnFiltersChange}\n\t\t\tonPrefetchPage={onPrefetchPage}\n\t\t/>\n\t);\n}\n"],"names":["z","name","string","optional","page","number","int","positive","default","catch","limit","max","tags","sort","FlowsErrorComponent","error","reset","serverError","categorizeError","type","jsxs","jsx","RouteErrorState"],"mappings":"kWA4BqBA,EACZ,CACPC,KAAMD,EAAEE,EAASC,SAAAA,EACjBC,KAAMJ,EAAEK,EAASC,MAAMC,SAAAA,EAAWJ,SAAAA,EAAWK,QAAQ,CAAC,EAAEC,MAAM,CAAC,EAC/DC,MAAOV,EACLK,EACAC,IAAAA,EACAC,SAAAA,EACAI,IAAI,GAAG,EACPR,SAAAA,EACAK,QAAQ,EAAE,EACVC,MAAM,EAAE,EACVG,KAAMZ,EAAQA,EAAEE,CAAQ,EAAEC,SAAAA,EAC1BU,KAAMb,EACC,CAAC,eAAgB,eAAgB,WAAY,WAAW,CAAC,EAC9DG,WACAK,QAAQ,UAAU,CACrB,CAAC,EACAL,WACAK,QAAQ,CAAA,CAAE,EAgCZ,SAASM,EAAoB,CAAEC,MAAAA,EAAOC,MAAAA,CAA2B,EAAG,CACnE,MAAMC,EAAcC,EAAgBH,EAAO,sBAAsB,EAIjE,GACCE,EAAYE,OAAS,gBACrBF,EAAYE,OAAS,eAErB,MAAMJ,EAGP,OACCK,EAAAA,KAAC,MAAA,CAAI,UAAU,sBACd,SAAA,CAAAC,EAAAA,IAAC,OACA,SAAAA,EAAAA,IAAC,KAAA,CAAG,UAAU,yBAAyB,iBAAK,CAAA,CAC7C,EACAA,EAAAA,IAACC,EAAA,CAAgB,MAAOL,EAAa,QAASD,CAAAA,CAAM,CAAA,EACrD,CAEF"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{j as s,L as r,s as n}from"./vendor-tanstack-CWDKYA_B.js";import{E as l,t as m,v as c,w as d,x,q as p,I as u,D as j,br as g,al as h,C as f,B as A,g as y,h as b,bs as D}from"./index-
|
|
2
|
-
//# sourceMappingURL=index-
|
|
1
|
+
import{j as s,L as r,s as n}from"./vendor-tanstack-CWDKYA_B.js";import{E as l,t as m,v as c,w as d,x,q as p,I as u,D as j,br as g,al as h,C as f,B as A,g as y,h as b,bs as D}from"./index-CQlQauOE.js";import{D as N}from"./delete-confirmation-dialog-DyUMWSB-.js";import{u as v,A as S,a as E,b as B,c as C,d as L}from"./use-delete-automation-confirmation-dialog-C7nas8eR.js";import{A as k}from"./automations-header-eG-shDxp.js";import"./vendor-react-Bce9NwRC.js";import"./vendor-radix-DRMjKWJW.js";import"./vendor-recharts-BGjDGXVf.js";import"./vendor-forms-D-iybWES.js";import"./vendor-date-CRz8gtWZ.js";import"./work-queue-icon-text-GE7b8Ro1.js";import"./index-DzylsDQg.js";import"./dropdown-menu-6cSdnzsr.js";import"./use-delete-confirmation-dialog-C5d6hPL-.js";const I=()=>s.jsxs(l,{children:[s.jsx(m,{id:"Bot"}),s.jsx(c,{children:"Create an automation to get started"}),s.jsx(d,{children:"Automations bring reactivity to your data stack and let you configure triggers and actions based on events."}),s.jsxs(x,{children:[s.jsx(r,{to:"/automations/create",children:s.jsxs(p,{children:["Add Automation ",s.jsx(u,{id:"Plus",className:"size-4 ml-2"})]})}),s.jsx(j,{id:"automations-guide"})]})]}),T=()=>{const[e,i]=v(),{data:a}=n(g()),o=t=>i(t);return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex flex-col gap-4",children:[s.jsx(k,{}),a.length===0?s.jsx(I,{}):s.jsxs("div",{className:"flex flex-col gap-4",children:[s.jsxs(h,{variant:"bodySmall",className:"text-muted-foreground",children:[a.length," ",`${a.length===1?"automation":"automations"}`]}),s.jsx("ul",{className:"flex flex-col gap-2",children:a.map(t=>s.jsx("li",{"aria-label":`automation item ${t.name}`,children:s.jsx($,{automation:t,onDelete:()=>o(t)})},t.id))})]})]}),s.jsx(N,{...e})]})},$=({automation:e,onDelete:i})=>s.jsxs(f,{className:"p-4 pt-5 flex flex-col gap-6",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(w,{automation:e}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(S,{automation:e}),s.jsx(E,{id:e.id,onDelete:i})]})]}),s.jsxs("div",{className:"flex flex-col gap-4",children:[e.description&&s.jsx(B,{automation:e}),s.jsx(C,{automation:e}),s.jsx(L,{automation:e})]})]}),w=({automation:e})=>s.jsx(A,{children:s.jsx(y,{children:s.jsx(b,{className:"text-xl",children:s.jsx(D,{to:"/automations/automation/$id",params:{id:e.id},className:"text-lg",children:e.name})})})}),W=T;export{W as component};
|
|
2
|
+
//# sourceMappingURL=index-DEijvsFf.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-
|
|
1
|
+
{"version":3,"file":"index-DEijvsFf.js","sources":["../../src/components/automations/automations-empty-state/automations-empty-state.tsx","../../src/components/automations/automations-page.tsx","../../src/routes/automations/index.tsx?tsr-split=component"],"sourcesContent":["import { Link } from \"@tanstack/react-router\";\nimport { Button } from \"@/components/ui/button\";\nimport { DocsLink } from \"@/components/ui/docs-link\";\nimport {\n\tEmptyState,\n\tEmptyStateActions,\n\tEmptyStateDescription,\n\tEmptyStateIcon,\n\tEmptyStateTitle,\n} from \"@/components/ui/empty-state\";\nimport { Icon } from \"@/components/ui/icons\";\n\nexport const AutomationsEmptyState = () => {\n\treturn (\n\t\t<EmptyState>\n\t\t\t<EmptyStateIcon id=\"Bot\" />\n\t\t\t<EmptyStateTitle>Create an automation to get started</EmptyStateTitle>\n\t\t\t<EmptyStateDescription>\n\t\t\t\tAutomations bring reactivity to your data stack and let you configure\n\t\t\t\ttriggers and actions based on events.\n\t\t\t</EmptyStateDescription>\n\t\t\t<EmptyStateActions>\n\t\t\t\t<Link to=\"/automations/create\">\n\t\t\t\t\t<Button>\n\t\t\t\t\t\tAdd Automation <Icon id=\"Plus\" className=\"size-4 ml-2\" />\n\t\t\t\t\t</Button>\n\t\t\t\t</Link>\n\t\t\t\t<DocsLink id=\"automations-guide\" />\n\t\t\t</EmptyStateActions>\n\t\t</EmptyState>\n\t);\n};\n","import { useSuspenseQuery } from \"@tanstack/react-query\";\nimport { type Automation, buildListAutomationsQuery } from \"@/api/automations\";\nimport {\n\tBreadcrumb,\n\tBreadcrumbItem,\n\tBreadcrumbLink,\n\tBreadcrumbList,\n} from \"@/components/ui/breadcrumb\";\nimport { Card } from \"@/components/ui/card\";\nimport { DeleteConfirmationDialog } from \"@/components/ui/delete-confirmation-dialog\";\nimport { Typography } from \"../ui/typography\";\nimport {\n\tAutomationActions,\n\tAutomationDescription,\n\tAutomationTrigger,\n} from \"./automation-details\";\nimport { AutomationEnableToggle } from \"./automation-enable-toggle\";\nimport { AutomationsActionsMenu } from \"./automations-actions-menu\";\nimport { AutomationsEmptyState } from \"./automations-empty-state\";\nimport { AutomationsHeader } from \"./automations-header\";\nimport { useDeleteAutomationConfirmationDialog } from \"./use-delete-automation-confirmation-dialog\";\n\nexport const AutomationsPage = () => {\n\tconst [dialogState, confirmDelete] = useDeleteAutomationConfirmationDialog();\n\tconst { data } = useSuspenseQuery(buildListAutomationsQuery());\n\n\tconst handleDelete = (automation: Automation) => confirmDelete(automation);\n\n\treturn (\n\t\t<>\n\t\t\t<div className=\"flex flex-col gap-4\">\n\t\t\t\t<AutomationsHeader />\n\t\t\t\t{data.length === 0 ? (\n\t\t\t\t\t<AutomationsEmptyState />\n\t\t\t\t) : (\n\t\t\t\t\t<div className=\"flex flex-col gap-4\">\n\t\t\t\t\t\t<Typography variant=\"bodySmall\" className=\"text-muted-foreground\">\n\t\t\t\t\t\t\t{data.length}{\" \"}\n\t\t\t\t\t\t\t{`${data.length === 1 ? \"automation\" : \"automations\"}`}\n\t\t\t\t\t\t</Typography>\n\t\t\t\t\t\t<ul className=\"flex flex-col gap-2\">\n\t\t\t\t\t\t\t{data.map((automation) => (\n\t\t\t\t\t\t\t\t<li\n\t\t\t\t\t\t\t\t\tkey={automation.id}\n\t\t\t\t\t\t\t\t\taria-label={`automation item ${automation.name}`}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<AutomationCardDetails\n\t\t\t\t\t\t\t\t\t\tautomation={automation}\n\t\t\t\t\t\t\t\t\t\tonDelete={() => handleDelete(automation)}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t\t<DeleteConfirmationDialog {...dialogState} />\n\t\t</>\n\t);\n};\n\ntype AutomationCardDetailsProps = {\n\tautomation: Automation;\n\tonDelete: () => void;\n};\nconst AutomationCardDetails = ({\n\tautomation,\n\tonDelete,\n}: AutomationCardDetailsProps) => {\n\treturn (\n\t\t<Card className=\"p-4 pt-5 flex flex-col gap-6\">\n\t\t\t<div className=\"flex items-center justify-between\">\n\t\t\t\t<NavHeader automation={automation} />\n\t\t\t\t<div className=\"flex items-center gap-2\">\n\t\t\t\t\t<AutomationEnableToggle automation={automation} />\n\t\t\t\t\t<AutomationsActionsMenu id={automation.id} onDelete={onDelete} />\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div className=\"flex flex-col gap-4\">\n\t\t\t\t{automation.description && (\n\t\t\t\t\t<AutomationDescription automation={automation} />\n\t\t\t\t)}\n\t\t\t\t<AutomationTrigger automation={automation} />\n\t\t\t\t<AutomationActions automation={automation} />\n\t\t\t</div>\n\t\t</Card>\n\t);\n};\n\ntype NavHeaderProps = {\n\tautomation: Automation;\n};\n\nconst NavHeader = ({ automation }: NavHeaderProps) => {\n\treturn (\n\t\t<Breadcrumb>\n\t\t\t<BreadcrumbList>\n\t\t\t\t<BreadcrumbItem className=\"text-xl\">\n\t\t\t\t\t<BreadcrumbLink\n\t\t\t\t\t\tto=\"/automations/automation/$id\"\n\t\t\t\t\t\tparams={{ id: automation.id }}\n\t\t\t\t\t\tclassName=\"text-lg\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{automation.name}\n\t\t\t\t\t</BreadcrumbLink>\n\t\t\t\t</BreadcrumbItem>\n\t\t\t</BreadcrumbList>\n\t\t</Breadcrumb>\n\t);\n};\n","import type { ErrorComponentProps } from \"@tanstack/react-router\";\nimport { createFileRoute } from \"@tanstack/react-router\";\nimport { buildListAutomationsQuery } from \"@/api/automations\";\nimport { categorizeError } from \"@/api/error-utils\";\nimport { AutomationsHeader } from \"@/components/automations/automations-header\";\nimport { AutomationsPage } from \"@/components/automations/automations-page\";\nimport { RouteErrorState } from \"@/components/ui/route-error-state\";\n\nfunction AutomationsErrorComponent({ error, reset }: ErrorComponentProps) {\n\tconst serverError = categorizeError(error, \"Failed to load automations\");\n\n\t// Only handle API errors (server-error, client-error) at route level\n\t// Let network errors and unknown errors bubble up to root error component\n\tif (\n\t\tserverError.type !== \"server-error\" &&\n\t\tserverError.type !== \"client-error\"\n\t) {\n\t\tthrow error;\n\t}\n\n\treturn (\n\t\t<div className=\"flex flex-col gap-4\">\n\t\t\t<AutomationsHeader />\n\t\t\t<RouteErrorState error={serverError} onRetry={reset} />\n\t\t</div>\n\t);\n}\n\n// nb: Currently there is no filtering or search params used on this page\nexport const Route = createFileRoute(\"/automations/\")({\n\tcomponent: AutomationsPage,\n\terrorComponent: AutomationsErrorComponent,\n\tloader: ({ context }) =>\n\t\tcontext.queryClient.ensureQueryData(buildListAutomationsQuery()),\n\twrapInSuspense: true,\n});\n"],"names":["AutomationsEmptyState","EmptyState","jsx","EmptyStateIcon","EmptyStateTitle","EmptyStateDescription","EmptyStateActions","Link","jsxs","Button","Icon","DocsLink","AutomationsPage","dialogState","confirmDelete","useDeleteAutomationConfirmationDialog","data","useSuspenseQuery","buildListAutomationsQuery","handleDelete","automation","Fragment","AutomationsHeader","Typography","AutomationCardDetails","DeleteConfirmationDialog","onDelete","Card","NavHeader","AutomationEnableToggle","AutomationsActionsMenu","AutomationDescription","AutomationTrigger","AutomationActions","Breadcrumb","BreadcrumbList","BreadcrumbItem","BreadcrumbLink","SplitComponent"],"mappings":"0vBAYO,MAAMA,EAAwB,WAElCC,EAAA,CACA,SAAA,CAAAC,EAAAA,IAACC,EAAA,CAAe,GAAG,KAAA,CAAM,EACzBD,EAAAA,IAACE,GAAgB,SAAA,qCAAA,CAAmC,EACpDF,EAAAA,IAACG,GAAsB,SAAA,6GAAA,CAGvB,SACCC,EAAA,CACA,SAAA,CAAAJ,MAACK,EAAA,CAAK,GAAG,sBACR,SAAAC,EAAAA,KAACC,EAAA,CAAO,SAAA,CAAA,kBACQP,EAAAA,IAACQ,EAAA,CAAK,GAAG,OAAO,UAAU,aAAA,CAAc,CAAA,CAAA,CACxD,CAAA,CACD,EACAR,EAAAA,IAACS,EAAA,CAAS,GAAG,mBAAA,CAAoB,CAAA,CAAA,CAClC,CAAA,EACD,ECPWC,EAAkB,IAAM,CACpC,KAAM,CAACC,EAAaC,CAAa,EAAIC,EAAA,EAC/B,CAAE,KAAAC,CAAA,EAASC,EAAiBC,GAA2B,EAEvDC,EAAgBC,GAA2BN,EAAcM,CAAU,EAEzE,OACCZ,EAAAA,KAAAa,WAAA,CACC,SAAA,CAAAb,EAAAA,KAAC,MAAA,CAAI,UAAU,sBACd,SAAA,CAAAN,EAAAA,IAACoB,EAAA,EAAkB,EAClBN,EAAK,SAAW,EAChBd,EAAAA,IAACF,IAAsB,EAEvBQ,EAAAA,KAAC,MAAA,CAAI,UAAU,sBACd,SAAA,CAAAA,EAAAA,KAACe,EAAA,CAAW,QAAQ,YAAY,UAAU,wBACxC,SAAA,CAAAP,EAAK,OAAQ,IACb,GAAGA,EAAK,SAAW,EAAI,aAAe,aAAa,EAAA,EACrD,QACC,KAAA,CAAG,UAAU,sBACZ,SAAAA,EAAK,IAAKI,GACVlB,EAAAA,IAAC,KAAA,CAEA,aAAY,mBAAmBkB,EAAW,IAAI,GAE9C,SAAAlB,EAAAA,IAACsB,EAAA,CACA,WAAAJ,EACA,SAAU,IAAMD,EAAaC,CAAU,CAAA,CAAA,CACxC,EANKA,EAAW,EAAA,CAQjB,CAAA,CACF,CAAA,CAAA,CACD,CAAA,EAEF,EACAlB,MAACuB,EAAA,CAA0B,GAAGZ,CAAA,CAAa,CAAA,EAC5C,CAEF,EAMMW,EAAwB,CAAC,CAC9B,WAAAJ,EACA,SAAAM,CACD,IAEElB,EAAAA,KAACmB,EAAA,CAAK,UAAU,+BACf,SAAA,CAAAnB,EAAAA,KAAC,MAAA,CAAI,UAAU,oCACd,SAAA,CAAAN,MAAC0B,GAAU,WAAAR,EAAwB,EACnCZ,EAAAA,KAAC,MAAA,CAAI,UAAU,0BACd,SAAA,CAAAN,MAAC2B,GAAuB,WAAAT,EAAwB,EAChDlB,EAAAA,IAAC4B,EAAA,CAAuB,GAAIV,EAAW,GAAI,SAAAM,CAAA,CAAoB,CAAA,CAAA,CAChE,CAAA,EACD,EACAlB,EAAAA,KAAC,MAAA,CAAI,UAAU,sBACb,SAAA,CAAAY,EAAW,aACXlB,EAAAA,IAAC6B,EAAA,CAAsB,WAAAX,CAAA,CAAwB,EAEhDlB,MAAC8B,GAAkB,WAAAZ,EAAwB,EAC3ClB,MAAC+B,GAAkB,WAAAb,CAAA,CAAwB,CAAA,CAAA,CAC5C,CAAA,EACD,EAQIQ,EAAY,CAAC,CAAE,WAAAR,WAElBc,EAAA,CACA,SAAAhC,EAAAA,IAACiC,GACA,SAAAjC,EAAAA,IAACkC,EAAA,CAAe,UAAU,UACzB,SAAAlC,EAAAA,IAACmC,EAAA,CACA,GAAG,8BACH,OAAQ,CAAE,GAAIjB,EAAW,EAAA,EACzB,UAAU,UAET,SAAAA,EAAW,IAAA,CAAA,CACb,CACD,EACD,EACD,EC/EFkB,EAvBS1B"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as l,j as e,L as W,u as N}from"./vendor-tanstack-CWDKYA_B.js";import{aW as b,aX as X,aY as q,ac as T,ad as I,ae as _,af as O,ah as F,ag as M,ai as A,aj as S,C as B,m as z,q as U,aZ as K,o as Y,I as Q,H as Z,a_ as ee,ak as C,al as V,a$ as te,b0 as se,b1 as ne,b2 as ae,b3 as E,b4 as re,B as oe,g as le,h as ce,i as P,b5 as v,a9 as ie,E as de,t as ue,v as me,w as xe,b6 as fe,b7 as he,b8 as w,b9 as pe,ba as ge,bb as k}from"./index-DLuXqHi9.js";import{A as je,X as ve,Y as be,b as Ne}from"./vendor-recharts-BGjDGXVf.js";import{f as y}from"./vendor-date-CRz8gtWZ.js";import{u as ye,C as we,a as Se,b as Ce}from"./collapsible-BszH-EeY.js";import{J as Ee,f as Pe,g as ke}from"./utilities-BCBDUmEl.js";import{E as Re,p as $,R as H,a as De,b as Le}from"./event-resource-display-65B76oFV.js";import"./vendor-react-Bce9NwRC.js";import"./vendor-radix-DRMjKWJW.js";import"./vendor-forms-D-iybWES.js";const Te=({active:t,payload:s})=>{if(!t||!s||!s.length)return null;const n=s[0]?.payload;return!n||typeof n.time!="number"||typeof n.count!="number"?null:e.jsxs("div",{className:"bg-popover border rounded-lg p-2 shadow-md",children:[e.jsxs("div",{className:"text-sm font-medium",children:[n.count," events"]}),e.jsx("div",{className:"text-xs text-muted-foreground",children:y(new Date(n.time),"PPp")})]})},Ie={count:{label:"Events",color:"hsl(262.1 83.3% 57.8%)"}},_e=l.forwardRef(function({data:s,className:a,showAxis:n=!0,startDate:o,endDate:c,onCursorChange:m},d){const x=l.useRef(null);l.useImperativeHandle(d,()=>({clearSelection:()=>{}}));const i=l.useMemo(()=>{const r=s.map(u=>({time:new Date(u.start_time).getTime(),count:u.count,label:u.label}));if(o&&c){const u=o.getTime(),j=c.getTime();(r.length===0||r[0].time>u)&&r.unshift({time:u,count:0,label:""}),(r.length===0||r[r.length-1].time<j)&&r.push({time:j,count:0,label:""})}return r},[s,o,c]),f=r=>{if(r.activeLabel!==void 0&&m){const u=typeof r.activeLabel=="number"?r.activeLabel:Number(r.activeLabel);Number.isNaN(u)||m(new Date(u))}},h=()=>{m?.(null)};return e.jsx("div",{ref:x,className:b("relative",a),children:e.jsx(X,{config:Ie,className:"h-full w-[calc(100%+3rem)] -mx-6",children:e.jsxs(je,{data:i,margin:{top:0,right:0,bottom:0,left:0},onMouseMove:f,onMouseLeave:h,children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:"eventsGradient",x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:"var(--color-count)",stopOpacity:.3}),e.jsx("stop",{offset:"100%",stopColor:"var(--color-count)",stopOpacity:0})]})}),e.jsx(ve,{dataKey:"time",tickFormatter:r=>y(new Date(r),"HH:mm"),tick:{fontSize:12},axisLine:!1,tickLine:!1,domain:["dataMin","dataMax"],hide:!n}),e.jsx(be,{hide:!0,domain:[0,r=>Math.max(1,r)]}),e.jsx(q,{content:e.jsx(Te,{})}),e.jsx(Ne,{type:"monotone",dataKey:"count",stroke:"var(--color-count)",strokeWidth:2,fill:"url(#eventsGradient)",dot:!1,activeDot:!1,isAnimationActive:!1})]})})})});function Oe({data:t,className:s,startDate:a,endDate:n}){return e.jsx("div",{className:b("relative",s),children:e.jsx(_e,{data:t,className:"h-full w-full",showAxis:!1,startDate:a,endDate:n})})}const Fe={automation:"Automation",block:"Block",deployment:"Deployment",flow:"Flow","work-pool":"Work Pool","work-queue":"Work Queue"};function Me(t){return e.jsx(l.Suspense,{children:e.jsx(Ae,{...t})})}function Ae({selectedResourceIds:t,onResourceIdsChange:s}){const[a,n]=l.useState(""),o=l.useDeferredValue(a),{resourceOptions:c}=ye(),m=l.useMemo(()=>o?c.filter(i=>i.name.toLowerCase().includes(o.toLowerCase())):c,[c,o]),d=l.useMemo(()=>{const i={automation:[],block:[],deployment:[],flow:[],"work-pool":[],"work-queue":[]};for(const f of m)i[f.type].push(f);return i},[m]),x=i=>{const f=t.includes(i);s(f?t.filter(h=>h!==i):[...t,i]),n("")};return e.jsxs(T,{children:[e.jsx(I,{"aria-label":"Filter by resource",selected:t.length>0,children:t.length>0?`${t.length} resource${t.length===1?"":"s"} selected`:"All resources"}),e.jsxs(_,{children:[e.jsx(O,{value:a,onValueChange:n,placeholder:"Search resources..."}),e.jsx(F,{children:"No resources found"}),e.jsx(M,{children:Object.entries(d).map(([i,f])=>f.length>0?e.jsx(A,{heading:Fe[i],children:f.map(h=>e.jsx(S,{value:h.resourceId,selected:t.includes(h.resourceId),onSelect:x,closeOnSelect:!1,children:h.name},h.resourceId))},i):null)})]})]})}function Be({occurred:t}){const s=new Date(t),a=y(s,"h:mm:ss a"),n=y(s,"MMM do, yyyy");return e.jsxs("div",{className:"flex flex-col text-right text-sm w-24 shrink-0",children:[e.jsx("span",{children:a}),e.jsx("span",{className:"text-xs text-muted-foreground",children:n})]})}function Ye({event:t,isLast:s}){const a=t.resource["prefect.resource.id"]||"",n=$(a),o=H[n];return e.jsxs("div",{className:"relative flex items-start justify-center w-10 h-full",children:[e.jsx("div",{className:b("absolute left-1/2 w-px -translate-x-1/2 bg-border",s?"top-0 h-5":"top-0 bottom-0"),style:{top:"-1rem",bottom:s?"auto":"-1rem"}}),e.jsx("div",{className:"relative flex items-center justify-center w-10 h-10 rounded-full bg-background border border-border",children:e.jsx(Q,{id:o,className:"h-5 w-5 text-muted-foreground"})})]})}function Qe(t){const s=t.getFullYear(),a=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0");return`${s}-${a}-${n}`}function Ve({eventId:t,eventName:s,occurred:a}){const n=Pe(s),o=Qe(new Date(a));return e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx(W,{to:"/events/event/$eventDate/$eventId",params:{eventDate:o,eventId:t},className:"text-left font-medium hover:underline",children:n}),e.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:s})]})}function $e(t){return t["prefect.resource.role"]}function R(t){return t["prefect.resource.id"]||""}function D(t){return t["prefect.resource.name"]||t["prefect.name"]||t["prefect-cloud.name"]||null}function He({related:t}){if(!t||t.length===0)return null;const s=[],a=[];for(const n of t)$e(n)==="tag"?s.push(n):a.push(n);return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-sm font-medium",children:"Related Resources"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[a.map(n=>{const o=R(n),m=D(n)||o,d=$(o),x=Le[d],i=H[d];return e.jsxs(De,{resource:n,relatedResources:t,className:"flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground hover:underline",children:[x&&e.jsx("span",{children:x}),e.jsx(Q,{id:i,className:"h-4 w-4"}),e.jsx("span",{children:m})]},o)}),s.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1",children:s.map(n=>{const o=R(n),c=D(n)||o.split(".").pop();return e.jsx(Z,{variant:"secondary",children:c},o)})})]})]})}function Ge({event:t,isLast:s}){const[a,n]=l.useState(!1);return e.jsxs("div",{className:"grid grid-cols-[6rem_2.5rem_1fr] gap-4 items-start py-4",children:[e.jsx(Be,{occurred:t.occurred}),e.jsx(Ye,{event:t,isLast:s}),e.jsx(we,{open:a,onOpenChange:n,children:e.jsxs(B,{className:"py-4",children:[e.jsx(z,{className:"py-0",children:e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx(Ve,{eventId:t.id,eventName:t.event,occurred:t.occurred}),e.jsx(Re,{event:t}),t.related&&t.related.length>0&&e.jsx(He,{related:t.related})]})}),e.jsx("div",{className:"px-6 pt-2",children:e.jsx(Se,{asChild:!0,children:e.jsxs(U,{variant:"ghost",size:"sm",className:"w-full justify-center gap-2 text-muted-foreground","aria-label":a?"Collapse event details":"Expand event details",children:[e.jsx(K,{className:b("h-4 w-4 transition-transform duration-200",a&&"rotate-180")}),e.jsx("span",{className:"text-xs",children:a?"Hide raw event":"Show raw event"})]})})}),e.jsx(Ce,{children:e.jsx(Y,{className:"pt-4",children:e.jsx(Ee,{value:JSON.stringify(t,null,2),className:"max-h-96 overflow-auto"})})})]})})]})}function Je({events:t,className:s}){return!t||t.length===0?null:e.jsx("ol",{className:b("list-none p-0 m-0",s),children:t.map((a,n)=>e.jsx("li",{children:e.jsx(Ge,{event:a,isLast:n===t.length-1})},a.id))})}const L=2;function We({filter:t,selectedEventTypes:s,onEventTypesChange:a}){const[n,o]=l.useState(""),c=l.useDeferredValue(n),{data:m=[]}=N(ee("event",t)),d=l.useMemo(()=>{const r=new Set;for(const u of m){const j=ke(u.value);for(const p of j)r.add(p)}return Array.from(r).sort()},[m]),x=l.useMemo(()=>c?d.filter(r=>r.toLowerCase().includes(c.toLowerCase())):d,[d,c]),i=r=>{const u=s.includes(r);a(u?s.filter(j=>j!==r):[...s,r])},f=()=>{a([])},h=()=>{if(s.length===0)return"All event types";const r=s.slice(0,L),u=s.length-L;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(", ")})}),u>0&&e.jsxs(V,{variant:"bodySmall",className:"shrink-0",children:["+ ",u]})]})};return e.jsxs(T,{children:[e.jsx(I,{"aria-label":"Filter by event type",selected:s.length===0,children:h()}),e.jsxs(_,{children:[e.jsx(O,{value:n,onValueChange:o,placeholder:"Search event types..."}),e.jsxs(M,{children:[e.jsx(F,{children:"No event types found"}),e.jsxs(A,{children:[e.jsxs(S,{"aria-label":"All event types",onSelect:f,closeOnSelect:!1,value:"__all__",children:[e.jsx(C,{checked:s.length===0}),"All event types"]}),x.map(r=>e.jsxs(S,{"aria-label":r,onSelect:()=>i(r),closeOnSelect:!1,value:r,children:[e.jsx(C,{checked:s.includes(r)}),r]},r))]})]})]})]})}const Xe=50;function qe({filter:t}){const[s,a]=l.useState(1),n=l.useRef(new Map),o=l.useRef(JSON.stringify(t));l.useEffect(()=>{const p=JSON.stringify(t);o.current!==p&&(n.current.clear(),a(1),o.current=p)},[t]);const c=N(te(t));l.useEffect(()=>{c.data?.next_page&&n.current.set(1,c.data.next_page)},[c.data?.next_page]);const m=s>1?n.current.get(s-1):null,d=N({...se(m??""),enabled:s>1&&!!m});l.useEffect(()=>{d.data?.next_page&&s>1&&n.current.set(s,d.data.next_page)},[d.data?.next_page,s]);const x=c.data?.total??0,i=Math.ceil(x/Xe),f=s===1?c.data?.events??[]:d.data?.events??c.data?.events??[],h=s>1&&d.isLoading;return{events:f,currentPage:s,totalPages:i,total:x,isLoadingNextPage:h,goToPage:p=>{p<1||p>i||p>1&&!n.current.has(p-1)||a(p)},goToNextPage:()=>{s<i&&n.current.has(s)&&a(s+1)},goToPreviousPage:()=>{s>1&&a(s-1)}}}function ze({search:t,onSearchChange:s}){const a=ne(t),n=ae(t),o=E({...t,rangeType:"range",start:a.from,end:a.to}),c=E({resource:t.resource,rangeType:"range",start:a.from,end:a.to}),{events:m,currentPage:d,totalPages:x,isLoadingNextPage:i,goToNextPage:f,goToPreviousPage:h}=qe({filter:n}),{data:r}=N(re(o)),u=g=>{s({resource:g})},j=g=>{s({event:g})},p=g=>{g?.type==="span"?s({rangeType:"span",seconds:g.seconds}):g?.type==="range"&&s({rangeType:"range",start:g.startDate.toISOString(),end:g.endDate.toISOString()})},[G,J]=l.useState(!1);return l.useEffect(()=>{const g=()=>{J(window.scrollY>100)};return window.addEventListener("scroll",g),()=>window.removeEventListener("scroll",g)},[]),e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(oe,{children:e.jsx(le,{children:e.jsx(ce,{className:"text-xl font-semibold",children:"Event Feed"})})})})}),e.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-[2fr_1fr]",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx(P,{children:"Resource"}),e.jsx(l.Suspense,{fallback:e.jsx(v,{className:"h-10 w-full"}),children:e.jsx(Me,{selectedResourceIds:t.resource??[],onResourceIdsChange:u})})]}),e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx(P,{children:"Events"}),e.jsx(l.Suspense,{fallback:e.jsx(v,{className:"h-10 w-full"}),children:e.jsx(We,{filter:c,selectedEventTypes:t.event??[],onEventTypesChange:j})})]})]}),e.jsx(B,{className:b("sticky top-0 z-10 transition-shadow",G&&"shadow-lg"),children:e.jsxs(Y,{className:"pt-6",children:[e.jsx(Oe,{data:r??[],className:"h-32",startDate:new Date(a.from),endDate:new Date(a.to)}),e.jsx("div",{className:"flex justify-center pt-3",children:e.jsx(ie,{value:t.rangeType==="range"&&t.start&&t.end?{type:"range",startDate:new Date(t.start),endDate:new Date(t.end)}:{type:"span",seconds:t.seconds??-86400},onValueChange:p})})]})}),m.length===0?e.jsxs(de,{children:[e.jsx(ue,{id:"Calendar"}),e.jsx(me,{children:"No events found"}),e.jsx(xe,{children:"No events match your current filters. Try adjusting your date range or filters."})]}):e.jsxs(e.Fragment,{children:[e.jsx(Je,{events:m}),x>1&&e.jsx("div",{className:"flex items-center justify-center gap-2",children:e.jsx(fe,{children:e.jsxs(he,{children:[e.jsx(w,{children:e.jsx(pe,{onClick:h,disabled:d<=1})}),e.jsx(w,{children:e.jsxs(V,{variant:"bodySmall",className:"px-2",children:["Page ",d," of ",x]})}),e.jsx(w,{children:e.jsx(ge,{onClick:f,disabled:d>=x})})]})})}),i&&e.jsx("div",{className:"flex justify-center py-4",children:e.jsx(v,{className:"h-8 w-32"})})]})]})}function Ue(){return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(v,{className:"h-8 w-48"}),e.jsxs("div",{className:"flex flex-wrap gap-4",children:[e.jsx(v,{className:"h-10 w-48"}),e.jsx(v,{className:"h-10 w-48"}),e.jsx(v,{className:"h-10 w-48"})]}),e.jsx(v,{className:"h-32 w-full"}),e.jsx(v,{className:"h-64 w-full"})]})}function ct(){const t=k.useSearch(),s=k.useNavigate(),a=n=>{s({to:".",search:o=>({...o,...n}),replace:!0})};return e.jsx(l.Suspense,{fallback:e.jsx(Ue,{}),children:e.jsx(ze,{search:t,onSearchChange:a})})}export{ct as component};
|
|
2
|
-
//# sourceMappingURL=index-
|
|
1
|
+
import{r as l,j as e,L as W,u as N}from"./vendor-tanstack-CWDKYA_B.js";import{aW as b,aX as X,aY as q,ac as T,ad as I,ae as _,af as O,ah as F,ag as M,ai as A,aj as S,C as B,m as z,q as U,aZ as K,o as Y,I as Q,H as Z,a_ as ee,ak as C,al as V,a$ as te,b0 as se,b1 as ne,b2 as ae,b3 as E,b4 as re,B as oe,g as le,h as ce,i as P,b5 as v,a9 as ie,E as de,t as ue,v as me,w as xe,b6 as fe,b7 as he,b8 as w,b9 as pe,ba as ge,bb as k}from"./index-CQlQauOE.js";import{A as je,X as ve,Y as be,b as Ne}from"./vendor-recharts-BGjDGXVf.js";import{f as y}from"./vendor-date-CRz8gtWZ.js";import{u as ye,C as we,a as Se,b as Ce}from"./collapsible-CjJyAdbn.js";import{J as Ee,f as Pe,g as ke}from"./utilities-B74wofJY.js";import{E as Re,p as $,R as H,a as De,b as Le}from"./event-resource-display-DeFGeJR9.js";import"./vendor-react-Bce9NwRC.js";import"./vendor-radix-DRMjKWJW.js";import"./vendor-forms-D-iybWES.js";const Te=({active:t,payload:s})=>{if(!t||!s||!s.length)return null;const n=s[0]?.payload;return!n||typeof n.time!="number"||typeof n.count!="number"?null:e.jsxs("div",{className:"bg-popover border rounded-lg p-2 shadow-md",children:[e.jsxs("div",{className:"text-sm font-medium",children:[n.count," events"]}),e.jsx("div",{className:"text-xs text-muted-foreground",children:y(new Date(n.time),"PPp")})]})},Ie={count:{label:"Events",color:"hsl(262.1 83.3% 57.8%)"}},_e=l.forwardRef(function({data:s,className:a,showAxis:n=!0,startDate:o,endDate:c,onCursorChange:m},d){const x=l.useRef(null);l.useImperativeHandle(d,()=>({clearSelection:()=>{}}));const i=l.useMemo(()=>{const r=s.map(u=>({time:new Date(u.start_time).getTime(),count:u.count,label:u.label}));if(o&&c){const u=o.getTime(),j=c.getTime();(r.length===0||r[0].time>u)&&r.unshift({time:u,count:0,label:""}),(r.length===0||r[r.length-1].time<j)&&r.push({time:j,count:0,label:""})}return r},[s,o,c]),f=r=>{if(r.activeLabel!==void 0&&m){const u=typeof r.activeLabel=="number"?r.activeLabel:Number(r.activeLabel);Number.isNaN(u)||m(new Date(u))}},h=()=>{m?.(null)};return e.jsx("div",{ref:x,className:b("relative",a),children:e.jsx(X,{config:Ie,className:"h-full w-[calc(100%+3rem)] -mx-6",children:e.jsxs(je,{data:i,margin:{top:0,right:0,bottom:0,left:0},onMouseMove:f,onMouseLeave:h,children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:"eventsGradient",x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:"var(--color-count)",stopOpacity:.3}),e.jsx("stop",{offset:"100%",stopColor:"var(--color-count)",stopOpacity:0})]})}),e.jsx(ve,{dataKey:"time",tickFormatter:r=>y(new Date(r),"HH:mm"),tick:{fontSize:12},axisLine:!1,tickLine:!1,domain:["dataMin","dataMax"],hide:!n}),e.jsx(be,{hide:!0,domain:[0,r=>Math.max(1,r)]}),e.jsx(q,{content:e.jsx(Te,{})}),e.jsx(Ne,{type:"monotone",dataKey:"count",stroke:"var(--color-count)",strokeWidth:2,fill:"url(#eventsGradient)",dot:!1,activeDot:!1,isAnimationActive:!1})]})})})});function Oe({data:t,className:s,startDate:a,endDate:n}){return e.jsx("div",{className:b("relative",s),children:e.jsx(_e,{data:t,className:"h-full w-full",showAxis:!1,startDate:a,endDate:n})})}const Fe={automation:"Automation",block:"Block",deployment:"Deployment",flow:"Flow","work-pool":"Work Pool","work-queue":"Work Queue"};function Me(t){return e.jsx(l.Suspense,{children:e.jsx(Ae,{...t})})}function Ae({selectedResourceIds:t,onResourceIdsChange:s}){const[a,n]=l.useState(""),o=l.useDeferredValue(a),{resourceOptions:c}=ye(),m=l.useMemo(()=>o?c.filter(i=>i.name.toLowerCase().includes(o.toLowerCase())):c,[c,o]),d=l.useMemo(()=>{const i={automation:[],block:[],deployment:[],flow:[],"work-pool":[],"work-queue":[]};for(const f of m)i[f.type].push(f);return i},[m]),x=i=>{const f=t.includes(i);s(f?t.filter(h=>h!==i):[...t,i]),n("")};return e.jsxs(T,{children:[e.jsx(I,{"aria-label":"Filter by resource",selected:t.length>0,children:t.length>0?`${t.length} resource${t.length===1?"":"s"} selected`:"All resources"}),e.jsxs(_,{children:[e.jsx(O,{value:a,onValueChange:n,placeholder:"Search resources..."}),e.jsx(F,{children:"No resources found"}),e.jsx(M,{children:Object.entries(d).map(([i,f])=>f.length>0?e.jsx(A,{heading:Fe[i],children:f.map(h=>e.jsx(S,{value:h.resourceId,selected:t.includes(h.resourceId),onSelect:x,closeOnSelect:!1,children:h.name},h.resourceId))},i):null)})]})]})}function Be({occurred:t}){const s=new Date(t),a=y(s,"h:mm:ss a"),n=y(s,"MMM do, yyyy");return e.jsxs("div",{className:"flex flex-col text-right text-sm w-24 shrink-0",children:[e.jsx("span",{children:a}),e.jsx("span",{className:"text-xs text-muted-foreground",children:n})]})}function Ye({event:t,isLast:s}){const a=t.resource["prefect.resource.id"]||"",n=$(a),o=H[n];return e.jsxs("div",{className:"relative flex items-start justify-center w-10 h-full",children:[e.jsx("div",{className:b("absolute left-1/2 w-px -translate-x-1/2 bg-border",s?"top-0 h-5":"top-0 bottom-0"),style:{top:"-1rem",bottom:s?"auto":"-1rem"}}),e.jsx("div",{className:"relative flex items-center justify-center w-10 h-10 rounded-full bg-background border border-border",children:e.jsx(Q,{id:o,className:"h-5 w-5 text-muted-foreground"})})]})}function Qe(t){const s=t.getFullYear(),a=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0");return`${s}-${a}-${n}`}function Ve({eventId:t,eventName:s,occurred:a}){const n=Pe(s),o=Qe(new Date(a));return e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx(W,{to:"/events/event/$eventDate/$eventId",params:{eventDate:o,eventId:t},className:"text-left font-medium hover:underline",children:n}),e.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:s})]})}function $e(t){return t["prefect.resource.role"]}function R(t){return t["prefect.resource.id"]||""}function D(t){return t["prefect.resource.name"]||t["prefect.name"]||t["prefect-cloud.name"]||null}function He({related:t}){if(!t||t.length===0)return null;const s=[],a=[];for(const n of t)$e(n)==="tag"?s.push(n):a.push(n);return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-sm font-medium",children:"Related Resources"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[a.map(n=>{const o=R(n),m=D(n)||o,d=$(o),x=Le[d],i=H[d];return e.jsxs(De,{resource:n,relatedResources:t,className:"flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground hover:underline",children:[x&&e.jsx("span",{children:x}),e.jsx(Q,{id:i,className:"h-4 w-4"}),e.jsx("span",{children:m})]},o)}),s.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1",children:s.map(n=>{const o=R(n),c=D(n)||o.split(".").pop();return e.jsx(Z,{variant:"secondary",children:c},o)})})]})]})}function Ge({event:t,isLast:s}){const[a,n]=l.useState(!1);return e.jsxs("div",{className:"grid grid-cols-[6rem_2.5rem_1fr] gap-4 items-start py-4",children:[e.jsx(Be,{occurred:t.occurred}),e.jsx(Ye,{event:t,isLast:s}),e.jsx(we,{open:a,onOpenChange:n,children:e.jsxs(B,{className:"py-4",children:[e.jsx(z,{className:"py-0",children:e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx(Ve,{eventId:t.id,eventName:t.event,occurred:t.occurred}),e.jsx(Re,{event:t}),t.related&&t.related.length>0&&e.jsx(He,{related:t.related})]})}),e.jsx("div",{className:"px-6 pt-2",children:e.jsx(Se,{asChild:!0,children:e.jsxs(U,{variant:"ghost",size:"sm",className:"w-full justify-center gap-2 text-muted-foreground","aria-label":a?"Collapse event details":"Expand event details",children:[e.jsx(K,{className:b("h-4 w-4 transition-transform duration-200",a&&"rotate-180")}),e.jsx("span",{className:"text-xs",children:a?"Hide raw event":"Show raw event"})]})})}),e.jsx(Ce,{children:e.jsx(Y,{className:"pt-4",children:e.jsx(Ee,{value:JSON.stringify(t,null,2),className:"max-h-96 overflow-auto"})})})]})})]})}function Je({events:t,className:s}){return!t||t.length===0?null:e.jsx("ol",{className:b("list-none p-0 m-0",s),children:t.map((a,n)=>e.jsx("li",{children:e.jsx(Ge,{event:a,isLast:n===t.length-1})},a.id))})}const L=2;function We({filter:t,selectedEventTypes:s,onEventTypesChange:a}){const[n,o]=l.useState(""),c=l.useDeferredValue(n),{data:m=[]}=N(ee("event",t)),d=l.useMemo(()=>{const r=new Set;for(const u of m){const j=ke(u.value);for(const p of j)r.add(p)}return Array.from(r).sort()},[m]),x=l.useMemo(()=>c?d.filter(r=>r.toLowerCase().includes(c.toLowerCase())):d,[d,c]),i=r=>{const u=s.includes(r);a(u?s.filter(j=>j!==r):[...s,r])},f=()=>{a([])},h=()=>{if(s.length===0)return"All event types";const r=s.slice(0,L),u=s.length-L;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(", ")})}),u>0&&e.jsxs(V,{variant:"bodySmall",className:"shrink-0",children:["+ ",u]})]})};return e.jsxs(T,{children:[e.jsx(I,{"aria-label":"Filter by event type",selected:s.length===0,children:h()}),e.jsxs(_,{children:[e.jsx(O,{value:n,onValueChange:o,placeholder:"Search event types..."}),e.jsxs(M,{children:[e.jsx(F,{children:"No event types found"}),e.jsxs(A,{children:[e.jsxs(S,{"aria-label":"All event types",onSelect:f,closeOnSelect:!1,value:"__all__",children:[e.jsx(C,{checked:s.length===0}),"All event types"]}),x.map(r=>e.jsxs(S,{"aria-label":r,onSelect:()=>i(r),closeOnSelect:!1,value:r,children:[e.jsx(C,{checked:s.includes(r)}),r]},r))]})]})]})]})}const Xe=50;function qe({filter:t}){const[s,a]=l.useState(1),n=l.useRef(new Map),o=l.useRef(JSON.stringify(t));l.useEffect(()=>{const p=JSON.stringify(t);o.current!==p&&(n.current.clear(),a(1),o.current=p)},[t]);const c=N(te(t));l.useEffect(()=>{c.data?.next_page&&n.current.set(1,c.data.next_page)},[c.data?.next_page]);const m=s>1?n.current.get(s-1):null,d=N({...se(m??""),enabled:s>1&&!!m});l.useEffect(()=>{d.data?.next_page&&s>1&&n.current.set(s,d.data.next_page)},[d.data?.next_page,s]);const x=c.data?.total??0,i=Math.ceil(x/Xe),f=s===1?c.data?.events??[]:d.data?.events??c.data?.events??[],h=s>1&&d.isLoading;return{events:f,currentPage:s,totalPages:i,total:x,isLoadingNextPage:h,goToPage:p=>{p<1||p>i||p>1&&!n.current.has(p-1)||a(p)},goToNextPage:()=>{s<i&&n.current.has(s)&&a(s+1)},goToPreviousPage:()=>{s>1&&a(s-1)}}}function ze({search:t,onSearchChange:s}){const a=ne(t),n=ae(t),o=E({...t,rangeType:"range",start:a.from,end:a.to}),c=E({resource:t.resource,rangeType:"range",start:a.from,end:a.to}),{events:m,currentPage:d,totalPages:x,isLoadingNextPage:i,goToNextPage:f,goToPreviousPage:h}=qe({filter:n}),{data:r}=N(re(o)),u=g=>{s({resource:g})},j=g=>{s({event:g})},p=g=>{g?.type==="span"?s({rangeType:"span",seconds:g.seconds}):g?.type==="range"&&s({rangeType:"range",start:g.startDate.toISOString(),end:g.endDate.toISOString()})},[G,J]=l.useState(!1);return l.useEffect(()=>{const g=()=>{J(window.scrollY>100)};return window.addEventListener("scroll",g),()=>window.removeEventListener("scroll",g)},[]),e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(oe,{children:e.jsx(le,{children:e.jsx(ce,{className:"text-xl font-semibold",children:"Event Feed"})})})})}),e.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-[2fr_1fr]",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx(P,{children:"Resource"}),e.jsx(l.Suspense,{fallback:e.jsx(v,{className:"h-10 w-full"}),children:e.jsx(Me,{selectedResourceIds:t.resource??[],onResourceIdsChange:u})})]}),e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx(P,{children:"Events"}),e.jsx(l.Suspense,{fallback:e.jsx(v,{className:"h-10 w-full"}),children:e.jsx(We,{filter:c,selectedEventTypes:t.event??[],onEventTypesChange:j})})]})]}),e.jsx(B,{className:b("sticky top-0 z-10 transition-shadow",G&&"shadow-lg"),children:e.jsxs(Y,{className:"pt-6",children:[e.jsx(Oe,{data:r??[],className:"h-32",startDate:new Date(a.from),endDate:new Date(a.to)}),e.jsx("div",{className:"flex justify-center pt-3",children:e.jsx(ie,{value:t.rangeType==="range"&&t.start&&t.end?{type:"range",startDate:new Date(t.start),endDate:new Date(t.end)}:{type:"span",seconds:t.seconds??-86400},onValueChange:p})})]})}),m.length===0?e.jsxs(de,{children:[e.jsx(ue,{id:"Calendar"}),e.jsx(me,{children:"No events found"}),e.jsx(xe,{children:"No events match your current filters. Try adjusting your date range or filters."})]}):e.jsxs(e.Fragment,{children:[e.jsx(Je,{events:m}),x>1&&e.jsx("div",{className:"flex items-center justify-center gap-2",children:e.jsx(fe,{children:e.jsxs(he,{children:[e.jsx(w,{children:e.jsx(pe,{onClick:h,disabled:d<=1})}),e.jsx(w,{children:e.jsxs(V,{variant:"bodySmall",className:"px-2",children:["Page ",d," of ",x]})}),e.jsx(w,{children:e.jsx(ge,{onClick:f,disabled:d>=x})})]})})}),i&&e.jsx("div",{className:"flex justify-center py-4",children:e.jsx(v,{className:"h-8 w-32"})})]})]})}function Ue(){return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(v,{className:"h-8 w-48"}),e.jsxs("div",{className:"flex flex-wrap gap-4",children:[e.jsx(v,{className:"h-10 w-48"}),e.jsx(v,{className:"h-10 w-48"}),e.jsx(v,{className:"h-10 w-48"})]}),e.jsx(v,{className:"h-32 w-full"}),e.jsx(v,{className:"h-64 w-full"})]})}function ct(){const t=k.useSearch(),s=k.useNavigate(),a=n=>{s({to:".",search:o=>({...o,...n}),replace:!0})};return e.jsx(l.Suspense,{fallback:e.jsx(Ue,{}),children:e.jsx(ze,{search:t,onSearchChange:a})})}export{ct as component};
|
|
2
|
+
//# sourceMappingURL=index-DJx6_wL3.js.map
|