@hot-updater/console 1.2.0-rc.35 → 1.2.0-rc.36
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.
- package/.output/nitro.json +1 -1
- package/.output/public/assets/-native-builds-search-DNupPw5R.js +1 -0
- package/.output/public/assets/{CompositeItem-CyQoQkYs.js → CompositeItem-CcgQyrSU.js} +1 -1
- package/.output/public/assets/{ConsoleFeatureUnavailable-C0iDIboF.js → ConsoleFeatureUnavailable-P2up1IkX.js} +1 -1
- package/.output/public/assets/{EventDetails-DFWS-HcW.js → EventDetails-BYZUOYsT.js} +1 -1
- package/.output/public/assets/{HashValueDisplay-DKziWjEg.js → HashValueDisplay-N89T2mVj.js} +1 -1
- package/.output/public/assets/{InsightsPageHeader-BATHTZWn.js → InsightsPageHeader-DhOT-Tmn.js} +1 -1
- package/.output/public/assets/IosInstall-BkjuGzx0.js +1 -0
- package/.output/public/assets/{NativeBuildsNav-D3FIlSu0.js → NativeBuildsNav-CivF1UpI.js} +1 -1
- package/.output/public/assets/{RelativeTime-BvgGWfXM.js → RelativeTime-CAIee8Fr.js} +1 -1
- package/.output/public/assets/RolloutPercentageBadge-BmtfOGOm.js +1 -0
- package/.output/public/assets/{RowReason-7dIWPxhy.js → RowReason-Cuf4SbKm.js} +1 -1
- package/.output/public/assets/{SandboxBadge-BPf2uve4.js → SandboxBadge-Cn1mlvQg.js} +1 -1
- package/.output/public/assets/{TargetDisplay-CiU6ZsDl.js → TargetDisplay-DeKn2_3n.js} +1 -1
- package/.output/public/assets/api-USY_IWMu.js +1 -0
- package/.output/public/assets/api-keys-Bjv4olzj.js +1 -0
- package/.output/public/assets/api-keys-CrrBMw2x.js +1 -0
- package/.output/public/assets/{uuidv7-DgXZ1zRR.js → constants-CNrAvpew.js} +1 -1
- package/.output/public/assets/dist-BDfiL2Qz.js +1 -0
- package/.output/public/assets/{index-CQDGK7Fg.js → index-DHcRzryp.js} +3 -3
- package/.output/public/assets/insights-9CSkLhLx.js +2 -0
- package/.output/public/assets/{insights-Bm4Kua5R.js → insights-BGMOFCgn.js} +2 -2
- package/.output/public/assets/insights-QaHXTgmd.js +1 -0
- package/.output/public/assets/insights-search-Bax3nNBz.js +1 -0
- package/.output/public/assets/{insights-usage-rpc-DdmD1Nuy.js → insights-usage-rpc-BG7EOn2n.js} +1 -1
- package/.output/public/assets/insights_.distribution-BfEb7XIX.js +1 -0
- package/.output/public/assets/insights_.distribution-Ce5y7hIU.js +2 -0
- package/.output/public/assets/insights_.distribution-gCONJgiU.js +1 -0
- package/.output/public/assets/installations-BKAdFmTM.js +1 -0
- package/.output/public/assets/{installations-DYT2mSjX.js → installations-BfbwP-Ub.js} +2 -2
- package/.output/public/assets/installations-D5bvOxlY.js +1 -0
- package/.output/public/assets/native-builds-CrRx3_wN.js +1 -0
- package/.output/public/assets/native-builds-FBNFjP4d.js +1 -0
- package/.output/public/assets/native-builds-FpedinKi.js +2 -0
- package/.output/public/assets/native-builds_._buildId-D0Y_qtSu.js +2 -0
- package/.output/public/assets/native-builds_._buildId-UU2Ja88v.js +1 -0
- package/.output/public/assets/native-builds_.devices-B0GrWGwS.js +2 -0
- package/.output/public/assets/native-builds_.devices-DossOQcr.js +1 -0
- package/.output/public/assets/remote-config-9h5s5yCy.js +1 -0
- package/.output/public/assets/{remote-config-D1EMK2er.js → remote-config-BbLyVNLo.js} +1 -1
- package/.output/public/assets/remote-config-CqFs9CSU.js +6 -0
- package/.output/public/assets/routes-BV7VD8Tr.js +1 -0
- package/.output/public/assets/routes-COOKrhya.js +2 -0
- package/.output/server/{__23tanstack-start-server-fn-resolver-BkmGm73S.mjs → __23tanstack-start-server-fn-resolver-DEsK7hJ-.mjs} +58 -58
- package/.output/server/_libs/@tanstack/react-router-ssr-query+[...].mjs +1 -1
- package/.output/server/_libs/_.mjs +1 -1
- package/.output/server/_ssr/{-native-builds-search-OJ8XmaBa.mjs → -native-builds-search-woFrbAdI.mjs} +19 -7
- package/.output/server/_ssr/{BundleIdDisplay-B90reloJ.mjs → BundleIdDisplay-BLXpHocZ.mjs} +2 -2
- package/.output/server/_ssr/{ChannelBadge-Dbmjpe-k.mjs → ChannelBadge-CWIc9tmb.mjs} +3 -3
- package/.output/server/_ssr/{ConsoleFeatureUnavailable-BX6uKVMH.mjs → ConsoleFeatureUnavailable-B4w26Z-l.mjs} +6 -6
- package/.output/server/_ssr/{EventDetails-DiO0Njqj.mjs → EventDetails-CnAKWnvZ.mjs} +6 -6
- package/.output/server/_ssr/{HashValueDisplay-CicukMPP.mjs → HashValueDisplay-DbMfscEm.mjs} +2 -2
- package/.output/server/_ssr/{InsightsPageHeader-Bu88jQMD.mjs → InsightsPageHeader-CGB3vsS1.mjs} +6 -6
- package/.output/server/_ssr/{IosInstall-qOwrZE2v.mjs → IosInstall-D9zJGmaC.mjs} +7 -7
- package/.output/server/_ssr/{NativeBuildsNav-D20VrrNx.mjs → NativeBuildsNav-CEKiVJZ2.mjs} +3 -3
- package/.output/server/_ssr/{NotFoundPage-_rXA1M7U.mjs → NotFoundPage-DZ6L0Lix.mjs} +2 -2
- package/.output/server/_ssr/{PlatformIcon-X18AN8Yp.mjs → PlatformIcon-C22qEcwo.mjs} +1 -1
- package/.output/server/_ssr/{QrCode-DmEsrduv.mjs → QrCode-Be-7de3s.mjs} +2 -2
- package/.output/server/_ssr/{RelativeTime-nw54zYAf.mjs → RelativeTime-B2N63vu0.mjs} +3 -3
- package/.output/server/_ssr/{RolloutPercentageBadge-DlRrxKdg.mjs → RolloutPercentageBadge-DgyHwvnj.mjs} +3 -3
- package/.output/server/_ssr/{RowReason-D46cFeQO.mjs → RowReason-DOCMSWpB.mjs} +4 -4
- package/.output/server/_ssr/{SandboxBadge-DXM9RKlS.mjs → SandboxBadge-DVOkxy3O.mjs} +2 -2
- package/.output/server/_ssr/{TargetDisplay-CIU-9UqJ.mjs → TargetDisplay-DcY84JrG.mjs} +3 -3
- package/.output/server/_ssr/{alert-dialog-CAb_7ZLL.mjs → alert-dialog-Bj6jW5-Q.mjs} +1 -1
- package/.output/server/_ssr/{api-v-mDt0z9.mjs → api-BYa88in2.mjs} +9 -7
- package/.output/server/_ssr/{api-keys-DY3XY8gz.mjs → api-keys-C3gWr3Qj.mjs} +9 -9
- package/.output/server/_ssr/{api-keys-CebW6Olm.mjs → api-keys-CIB4jF6t.mjs} +2 -2
- package/.output/server/_ssr/{api-keys-rpc-D0rQ5vvV.mjs → api-keys-rpc-CtMsJx1w.mjs} +3 -3
- package/.output/server/_ssr/{api-rpc-OTsF60lZ.mjs → api-rpc-sxif8D9h.mjs} +7 -7
- package/.output/server/_ssr/{auth-rpc-Cga9IGo3.mjs → auth-rpc-DYXg2d-s.mjs} +4 -4
- package/.output/server/_ssr/{auth.server-BVqW4FSJ.mjs → auth.server-BCtkdsmT.mjs} +2 -2
- package/.output/server/_ssr/{badge-Cy4z0pH1.mjs → badge-DVmF0rbO.mjs} +1 -1
- package/.output/server/_ssr/{card-UaEWfeRI.mjs → card-C7gkmtDR.mjs} +1 -1
- package/.output/server/_ssr/{config.server-OJdvjs7r.mjs → config.server-D5yjc-Hm.mjs} +3 -3
- package/.output/server/_ssr/{console-access-BM4TLI4g.mjs → console-access-MNaEuKXy.mjs} +2 -2
- package/.output/server/_ssr/{console-features-api-BmiP0aaD.mjs → console-features-api-B8PfM6k1.mjs} +5 -5
- package/.output/server/_ssr/{console-features-rpc-DPcZcHSW.mjs → console-features-rpc-Dl1bAdxy.mjs} +3 -3
- package/.output/server/_ssr/constants-B8b1IliD.mjs +8 -0
- package/.output/server/_ssr/{dialog-DWlZVg5y.mjs → dialog-COs-Oov4.mjs} +1 -1
- package/.output/server/_ssr/{empty-BPB71w6i.mjs → empty-BCi8eUlp.mjs} +2 -2
- package/.output/server/_ssr/{field-Bx8FKYuu.mjs → field-D7na2Ch2.mjs} +2 -2
- package/.output/server/_ssr/{input-group-BzfbjZEj.mjs → input-group-B64ZFSYp.mjs} +1 -1
- package/.output/server/_ssr/{insights-DaGJDccC.mjs → insights-B9kdn-hT.mjs} +23 -22
- package/.output/server/_ssr/{insights-CBOTZToQ.mjs → insights-DaaYBkr3.mjs} +5 -5
- package/.output/server/_ssr/{insights-CFbpYpMy.mjs → insights-Do0mUArh.mjs} +2 -2
- package/.output/server/_ssr/{insights-api-b2wrxjFK.mjs → insights-api-C6hqqqUk.mjs} +3 -3
- package/.output/server/_ssr/{insights-failures-rpc-DLo_DEAi.mjs → insights-failures-rpc-k6uyvIeh.mjs} +4 -4
- package/.output/server/_ssr/{insights-recovery-rpc-rpNu1Y8O.mjs → insights-recovery-rpc-DPW8WjEX.mjs} +3 -3
- package/.output/server/_ssr/{insights-rpc-C2u-cHw2.mjs → insights-rpc-DDLtqUqS.mjs} +3 -3
- package/.output/server/_ssr/{insights-search-BBOEGM68.mjs → insights-search-BxLGFC2Y.mjs} +3 -5
- package/.output/server/_ssr/{insights-usage-rpc-6VNQ-ZVG.mjs → insights-usage-rpc-_3iuUmaJ.mjs} +3 -3
- package/.output/server/_ssr/{insights-usage-rpc-BOfXGKaq.mjs → insights-usage-rpc-a9HwsRB_.mjs} +3 -3
- package/.output/server/_ssr/{insights_.distribution-a1c7v5MP.mjs → insights_.distribution-BjWQk0tw.mjs} +2 -2
- package/.output/server/_ssr/{insights_.distribution-DrY2XK92.mjs → insights_.distribution-CCCQgeXp.mjs} +15 -15
- package/.output/server/_ssr/{insights_.distribution-kX-VlU6s.mjs → insights_.distribution-DTvhOF_Z.mjs} +5 -5
- package/.output/server/_ssr/{installations-BG3Mf569.mjs → installations-BgKaxLj8.mjs} +2 -2
- package/.output/server/_ssr/{installations-uML6v5Uo.mjs → installations-DZoaae-j.mjs} +11 -11
- package/.output/server/_ssr/{installations-B5-uJU9A.mjs → installations-IiZ1O2zJ.mjs} +4 -4
- package/.output/server/_ssr/{ios-devices-rpc-DqTNHbdN.mjs → ios-devices-rpc-mzVC4RTM.mjs} +7 -7
- package/.output/server/_ssr/{iosDeviceCookie-DNXjIPeF.mjs → iosDeviceCookie-LOJ7WfKJ.mjs} +3 -3
- package/.output/server/_ssr/{iosDeviceProfile-Cl32eCmk.mjs → iosDeviceProfile-DtTmTG9a.mjs} +2 -2
- package/.output/server/_ssr/{iosDevices-BQ0RaNWs.mjs → iosDevices-DC-DR7X-.mjs} +2 -2
- package/.output/server/_ssr/{native-builds-BBOmHVsH.mjs → native-builds-DBVS616m.mjs} +61 -30
- package/.output/server/_ssr/{native-builds-BuYIAi2p.mjs → native-builds-uMIPDSmT.mjs} +3 -3
- package/.output/server/_ssr/{native-builds_._buildId-BUdWhQaH.mjs → native-builds_._buildId-BmB6oLsi.mjs} +3 -3
- package/.output/server/_ssr/{native-builds_._buildId-DZSLPTef.mjs → native-builds_._buildId-CfYzRkoT.mjs} +18 -17
- package/.output/server/_ssr/{native-builds_.devices-phkJgI1w.mjs → native-builds_.devices-CBoAFcVA.mjs} +16 -16
- package/.output/server/_ssr/{native-builds_.devices-QK5Z4ACD.mjs → native-builds_.devices-PvBuqXp0.mjs} +3 -3
- package/.output/server/_ssr/{nativeBuildDownloadLink-BVtopV-4.mjs → nativeBuildDownloadLink-B-Slw1_O.mjs} +2 -2
- package/.output/server/_ssr/{nativeBuildInstall-CVQLkYrX.mjs → nativeBuildInstall-_vrEhN0E.mjs} +3 -3
- package/.output/server/_ssr/{release-adoption-rpc-DSlOL5v7.mjs → release-adoption-rpc-BsUYFCSo.mjs} +5 -5
- package/.output/server/_ssr/{remote-config-C4PKU5_z.mjs → remote-config-D-8SQ4po.mjs} +2 -2
- package/.output/server/_ssr/{remote-config-DPHJyAHV.mjs → remote-config-DQzpUpwK.mjs} +2 -2
- package/.output/server/_ssr/{remote-config-9VJWDosm.mjs → remote-config-ZObJS2_F.mjs} +19 -19
- package/.output/server/_ssr/{remote-config-rpc-DxQ0jW52.mjs → remote-config-rpc-COjwhaa3.mjs} +3 -3
- package/.output/server/_ssr/{router-C1FV3SPc.mjs → router-DFO8ezEY.mjs} +33 -33
- package/.output/server/_ssr/{routes-DDzrfaZr.mjs → routes-B0kFLck5.mjs} +95 -43
- package/.output/server/_ssr/{routes-Dg1cG9-d.mjs → routes-DLdhFkXy.mjs} +45 -11
- package/.output/server/_ssr/{schema-migration-rpc-DdijfSjx.mjs → schema-migration-rpc-BTlEpk00.mjs} +3 -3
- package/.output/server/_ssr/{select-CQvxbdec.mjs → select-l3hYdF9p.mjs} +1 -1
- package/.output/server/_ssr/{server-CGStUbwn.mjs → server-Dsb2hUyp.mjs} +4 -4
- package/.output/server/_ssr/{sidebar-zjbq02-o.mjs → sidebar-DU3F2THA.mjs} +2 -2
- package/.output/server/_ssr/ssr.mjs +1 -1
- package/.output/server/_ssr/{start-BaUpXI0L.mjs → start-BXlykDIg.mjs} +1 -1
- package/.output/server/_ssr/{switch-_XoBaA1s.mjs → switch-B_NczfZN.mjs} +2 -2
- package/.output/server/_ssr/{table-FoAc6s3r.mjs → table-DScwmE5W.mjs} +1 -1
- package/.output/server/_ssr/{tabs-BgUZHny1.mjs → tabs-DodX8IAE.mjs} +2 -2
- package/.output/server/{_tanstack-start-manifest_v-wLJ-tAN0.mjs → _tanstack-start-manifest_v-D4QtfwLE.mjs} +94 -95
- package/.output/server/index.mjs +300 -307
- package/package.json +7 -7
- package/src/components/features/insights/AppUsage.tsx +3 -5
- package/src/components/features/insights/InsightsControls.tsx +2 -2
- package/src/components/features/native-builds/NativeBuildDetailPage.tsx +2 -0
- package/src/components/features/native-builds/NativeBuildsPage.tsx +79 -21
- package/src/components/features/native-builds/NativeBuildsTable.tsx +8 -6
- package/src/lib/api.ts +10 -2
- package/src/lib/constants.ts +12 -0
- package/src/lib/insights-search.ts +0 -3
- package/src/routes/-native-builds-search.ts +32 -4
- package/src/routes/-releases-search.ts +63 -2
- package/src/routes/index.tsx +113 -29
- package/src/routes/insights.tsx +3 -5
- package/src/routes/insights_.distribution.tsx +2 -2
- package/.output/public/assets/-native-builds-search-BvCftqF2.js +0 -1
- package/.output/public/assets/IosInstall-CyBFeLGv.js +0 -1
- package/.output/public/assets/RolloutPercentageBadge-DnmU8XbU.js +0 -1
- package/.output/public/assets/api-B1z_XXrQ.js +0 -1
- package/.output/public/assets/api-keys-C_u_ZmPS.js +0 -1
- package/.output/public/assets/api-keys-DPuPM7ag.js +0 -1
- package/.output/public/assets/dist-BEIz5ojx.js +0 -1
- package/.output/public/assets/insights-CpnFoyo5.js +0 -2
- package/.output/public/assets/insights-MQrx_wbP.js +0 -1
- package/.output/public/assets/insights-search-CtEcj6lz.js +0 -1
- package/.output/public/assets/insights_.distribution-Bjo0aQE4.js +0 -1
- package/.output/public/assets/insights_.distribution-Dd2mYz8D.js +0 -2
- package/.output/public/assets/insights_.distribution-REbBAqgL.js +0 -1
- package/.output/public/assets/installations-Di02gX_V.js +0 -1
- package/.output/public/assets/installations-iqDa8KPW.js +0 -1
- package/.output/public/assets/native-builds-CkaoQZVh.js +0 -2
- package/.output/public/assets/native-builds-CtqBGw8a.js +0 -1
- package/.output/public/assets/native-builds-hOC_V15R.js +0 -1
- package/.output/public/assets/native-builds_._buildId-CAnF7xPa.js +0 -2
- package/.output/public/assets/native-builds_._buildId-DSbzVVI5.js +0 -1
- package/.output/public/assets/native-builds_.devices-CCmLAkXG.js +0 -1
- package/.output/public/assets/native-builds_.devices-D-8DVNRB.js +0 -2
- package/.output/public/assets/refresh-cw-CpCxPYma.js +0 -1
- package/.output/public/assets/remote-config-CD50k2u7.js +0 -6
- package/.output/public/assets/remote-config-Dmuqm9xx.js +0 -1
- package/.output/public/assets/routes-BMbT1Qdm.js +0 -2
- package/.output/public/assets/routes-D8reVBSx.js +0 -1
- /package/.output/public/assets/{BundleIdDisplay-D8oR8mcP.js → BundleIdDisplay-Bm85NZma.js} +0 -0
- /package/.output/public/assets/{ChannelBadge-Do-lWsLM.js → ChannelBadge-B04sTjw5.js} +0 -0
- /package/.output/public/assets/{NotFoundPage-CijSy63W.js → NotFoundPage-DUWkihqx.js} +0 -0
- /package/.output/public/assets/{PlatformIcon-Kq3q98tU.js → PlatformIcon-CZjIJt0C.js} +0 -0
- /package/.output/public/assets/{QrCode-D3-Vuudy.js → QrCode-DJ5leikY.js} +0 -0
- /package/.output/public/assets/{alert-dialog-Dihztkem.js → alert-dialog-ndHfUqUh.js} +0 -0
- /package/.output/public/assets/{card-BfeRlTvj.js → card-VtWYErXu.js} +0 -0
- /package/.output/public/assets/{dialog-e9AF5T6h.js → dialog-Dx9gstou.js} +0 -0
- /package/.output/public/assets/{empty-DpSPWLc2.js → empty-Cdfs8tuN.js} +0 -0
- /package/.output/public/assets/{field-PkdRPD3A.js → field-CubHQ_EM.js} +0 -0
- /package/.output/public/assets/{relativeTime-D_aYJRc7.js → relativeTime-Wk64dka-.js} +0 -0
- /package/.output/public/assets/{table-r_sYqKTQ.js → table-DtcLx8yw.js} +0 -0
- /package/.output/public/assets/{tabs-BBfg-c0h.js → tabs-DYlO8l4M.js} +0 -0
- /package/.output/public/assets/{valueToPercent-Bn8p2lng.js → valueToPercent-Db73Kirz.js} +0 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hot-updater/console",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.2.0-rc.
|
|
4
|
+
"version": "1.2.0-rc.36",
|
|
5
5
|
"files": [
|
|
6
6
|
".output",
|
|
7
7
|
"lib",
|
|
@@ -59,10 +59,10 @@
|
|
|
59
59
|
"tw-animate-css": "^1.4.0",
|
|
60
60
|
"uqr": "^0.1.3",
|
|
61
61
|
"verkit": "0.4.0",
|
|
62
|
-
"@hot-updater/
|
|
63
|
-
"@hot-updater/
|
|
64
|
-
"@hot-updater/
|
|
65
|
-
"@hot-updater/
|
|
62
|
+
"@hot-updater/bsdiff": "1.2.0-rc.36",
|
|
63
|
+
"@hot-updater/protocol": "1.2.0-rc.36",
|
|
64
|
+
"@hot-updater/server": "1.2.0-rc.36",
|
|
65
|
+
"@hot-updater/plugin-core": "1.2.0-rc.36"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
68
|
"@tanstack/devtools-vite": "^0.6.0",
|
|
@@ -86,8 +86,8 @@
|
|
|
86
86
|
"vite-tsconfig-paths": "^6.1.1",
|
|
87
87
|
"vitest": "4.1.4",
|
|
88
88
|
"web-vitals": "^5.1.0",
|
|
89
|
-
"@hot-updater/cli-tools": "1.2.0-rc.
|
|
90
|
-
"@hot-updater/mock": "1.2.0-rc.
|
|
89
|
+
"@hot-updater/cli-tools": "1.2.0-rc.36",
|
|
90
|
+
"@hot-updater/mock": "1.2.0-rc.36"
|
|
91
91
|
},
|
|
92
92
|
"description": "React Native OTA solution for self-hosted",
|
|
93
93
|
"license": "SEE LICENSE IN LICENSE",
|
|
@@ -37,15 +37,13 @@ import {
|
|
|
37
37
|
TableHeader,
|
|
38
38
|
TableRow,
|
|
39
39
|
} from "@/components/ui/table";
|
|
40
|
+
import { DEFAULT_CHANNEL } from "@/lib/constants";
|
|
40
41
|
import {
|
|
41
42
|
DEFAULT_INSIGHTS_RETENTION,
|
|
42
43
|
type InsightsRetentionDays,
|
|
43
44
|
keepsTwelveMonths,
|
|
44
45
|
} from "@/lib/insights-retention";
|
|
45
|
-
import {
|
|
46
|
-
DEFAULT_INSIGHTS_CHANNEL,
|
|
47
|
-
type InsightsSearch,
|
|
48
|
-
} from "@/lib/insights-search";
|
|
46
|
+
import type { InsightsSearch } from "@/lib/insights-search";
|
|
49
47
|
import type { AppUsageReport, UsageWindow } from "@/lib/insights-usage";
|
|
50
48
|
|
|
51
49
|
import { EstimatedCount } from "./EstimatedCount";
|
|
@@ -105,7 +103,7 @@ export function AppUsage({
|
|
|
105
103
|
<div className="flex min-w-0 flex-col gap-1">
|
|
106
104
|
<CardTitle>App usage</CardTitle>
|
|
107
105
|
<InsightsScope
|
|
108
|
-
channel={search.channel ??
|
|
106
|
+
channel={search.channel ?? DEFAULT_CHANNEL}
|
|
109
107
|
platform={search.platform ?? "all"}
|
|
110
108
|
narrower={
|
|
111
109
|
search.appVersion ? [`App version ${search.appVersion}`] : []
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
SelectValue,
|
|
22
22
|
} from "@/components/ui/select";
|
|
23
23
|
import { useChannelsQuery } from "@/lib/api";
|
|
24
|
-
import {
|
|
24
|
+
import { DEFAULT_CHANNEL } from "@/lib/constants";
|
|
25
25
|
import type { AdoptionRelease, HealthPlatform } from "@/lib/release-adoption";
|
|
26
26
|
|
|
27
27
|
import { platformLabel } from "./InsightsScope";
|
|
@@ -36,7 +36,7 @@ export type InsightsFilters = {
|
|
|
36
36
|
};
|
|
37
37
|
|
|
38
38
|
const DEFAULT_FILTERS = {
|
|
39
|
-
channel:
|
|
39
|
+
channel: DEFAULT_CHANNEL,
|
|
40
40
|
platform: "all",
|
|
41
41
|
appVersion: undefined,
|
|
42
42
|
releaseId: undefined,
|
|
@@ -20,6 +20,7 @@ import {
|
|
|
20
20
|
import { SidebarTrigger } from "@/components/ui/sidebar";
|
|
21
21
|
import { Skeleton } from "@/components/ui/skeleton";
|
|
22
22
|
import { type KeysetPage, useNativeBuildDetailQuery } from "@/lib/api";
|
|
23
|
+
import { ALL_CHANNELS } from "@/lib/constants";
|
|
23
24
|
import {
|
|
24
25
|
formatByteSize,
|
|
25
26
|
nativeBuildArtifacts,
|
|
@@ -152,6 +153,7 @@ export function NativeBuildDetailPage({
|
|
|
152
153
|
className: "min-h-11 sm:min-h-8",
|
|
153
154
|
variant: "outline",
|
|
154
155
|
})}
|
|
156
|
+
search={{ channels: ALL_CHANNELS }}
|
|
155
157
|
to="/native-builds"
|
|
156
158
|
>
|
|
157
159
|
Show all native builds
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
import { HardDrive, RefreshCw } from "lucide-react";
|
|
1
|
+
import { AlertTriangle, HardDrive, RefreshCw } from "lucide-react";
|
|
2
2
|
|
|
3
|
+
import {
|
|
4
|
+
Alert,
|
|
5
|
+
AlertAction,
|
|
6
|
+
AlertDescription,
|
|
7
|
+
AlertTitle,
|
|
8
|
+
} from "@/components/ui/alert";
|
|
3
9
|
import { Button } from "@/components/ui/button";
|
|
4
10
|
import {
|
|
5
11
|
Select,
|
|
@@ -10,11 +16,12 @@ import {
|
|
|
10
16
|
SelectValue,
|
|
11
17
|
} from "@/components/ui/select";
|
|
12
18
|
import { SidebarTrigger } from "@/components/ui/sidebar";
|
|
19
|
+
import { useChannelsQuery, useNativeBuildsQuery } from "@/lib/api";
|
|
20
|
+
import { ALL_CHANNELS } from "@/lib/constants";
|
|
13
21
|
import {
|
|
14
|
-
type
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
} from "@/lib/api";
|
|
22
|
+
type NativeBuildsSearch,
|
|
23
|
+
resolveNativeBuildsSearch,
|
|
24
|
+
} from "@/routes/-native-builds-search";
|
|
18
25
|
|
|
19
26
|
import { ImportBuildDialog } from "./ImportBuild";
|
|
20
27
|
import { NativeBuildsNav } from "./NativeBuildsNav";
|
|
@@ -24,34 +31,57 @@ import { NativeBuildsTable } from "./NativeBuildsTable";
|
|
|
24
31
|
* The filter's values: a channel's is its name behind a prefix, so no channel
|
|
25
32
|
* name, `all` included, can be taken for "All channels".
|
|
26
33
|
*/
|
|
27
|
-
const ALL_CHANNELS = "all";
|
|
28
34
|
const CHANNEL_VALUE_PREFIX = "channel:";
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* The list while its channel is unknown: loading, whatever the cache holds,
|
|
38
|
+
* and nothing to refresh. A disabled query still reads when refetched.
|
|
39
|
+
*/
|
|
40
|
+
const PENDING_BUILDS = {
|
|
41
|
+
data: undefined,
|
|
42
|
+
isError: false,
|
|
43
|
+
isPending: true,
|
|
44
|
+
isPlaceholderData: false,
|
|
45
|
+
refetch: () => undefined,
|
|
46
|
+
} as const;
|
|
29
47
|
const channelValue = (name: string) => `${CHANNEL_VALUE_PREFIX}${name}`;
|
|
30
48
|
|
|
31
49
|
/**
|
|
32
50
|
* The native builds Hot Updater tracks: one page at a time, newest first,
|
|
33
|
-
*
|
|
34
|
-
* are in the URL, so a pull
|
|
51
|
+
* those that embed one channel, the default one unless the URL names another
|
|
52
|
+
* or every channel. The page and the channel are in the URL, so a pull
|
|
53
|
+
* request links to its channel's builds.
|
|
35
54
|
*/
|
|
36
55
|
export function NativeBuildsPage({
|
|
37
56
|
search,
|
|
38
57
|
onSearchChange,
|
|
39
58
|
}: {
|
|
40
|
-
readonly search:
|
|
41
|
-
readonly onSearchChange: (search:
|
|
59
|
+
readonly search: NativeBuildsSearch;
|
|
60
|
+
readonly onSearchChange: (search: NativeBuildsSearch) => void;
|
|
42
61
|
}) {
|
|
43
|
-
const { channel, before, after } = search;
|
|
44
|
-
const builds = useNativeBuildsQuery(search);
|
|
45
62
|
// The filter's choices; the rows decode their channel from its ID.
|
|
46
63
|
const channels = useChannelsQuery();
|
|
47
64
|
const channelNames = channels.data?.map(({ name }) => name) ?? [];
|
|
65
|
+
// The page the list shows: a URL without a channel opens on the default
|
|
66
|
+
// one, known once the channel list arrives. A loaded list outlives a failed
|
|
67
|
+
// refresh; without one, the default page waits, and nothing reads every
|
|
68
|
+
// channel in its place.
|
|
69
|
+
const page = resolveNativeBuildsSearch(search, channels.data && channelNames);
|
|
70
|
+
const pending = page === undefined;
|
|
71
|
+
const channelsFailed = pending && channels.isError;
|
|
72
|
+
const { channel, before, after } = page ?? search;
|
|
73
|
+
// Nothing reads every channel's builds on the way to the default channel's.
|
|
74
|
+
const query = useNativeBuildsQuery(page ?? {}, { enabled: !pending });
|
|
75
|
+
const builds = pending ? PENDING_BUILDS : query;
|
|
48
76
|
// A filtered channel may be gone, or not loaded yet: it stays a choice.
|
|
49
77
|
const choices =
|
|
50
78
|
channel === undefined || channelNames.includes(channel)
|
|
51
79
|
? channelNames
|
|
52
80
|
: [channel, ...channelNames];
|
|
53
81
|
const filterBy = (next: string | undefined) =>
|
|
54
|
-
onSearchChange(
|
|
82
|
+
onSearchChange(
|
|
83
|
+
next === undefined ? { channels: ALL_CHANNELS } : { channel: next },
|
|
84
|
+
);
|
|
55
85
|
|
|
56
86
|
return (
|
|
57
87
|
<div className="flex h-svh min-h-0 min-w-0 flex-col">
|
|
@@ -73,6 +103,7 @@ export function NativeBuildsPage({
|
|
|
73
103
|
<NativeBuildsNav current="builds" />
|
|
74
104
|
<div className="flex items-center gap-2">
|
|
75
105
|
<Select
|
|
106
|
+
disabled={pending}
|
|
76
107
|
items={[
|
|
77
108
|
{ label: "All channels", value: ALL_CHANNELS },
|
|
78
109
|
...choices.map((name) => ({
|
|
@@ -91,7 +122,13 @@ export function NativeBuildsPage({
|
|
|
91
122
|
: undefined,
|
|
92
123
|
)
|
|
93
124
|
}
|
|
94
|
-
value={
|
|
125
|
+
value={
|
|
126
|
+
pending
|
|
127
|
+
? null
|
|
128
|
+
: channel === undefined
|
|
129
|
+
? ALL_CHANNELS
|
|
130
|
+
: channelValue(channel)
|
|
131
|
+
}
|
|
95
132
|
>
|
|
96
133
|
<SelectTrigger
|
|
97
134
|
aria-label="Channel"
|
|
@@ -120,7 +157,7 @@ export function NativeBuildsPage({
|
|
|
120
157
|
<Button
|
|
121
158
|
aria-label="Refresh native builds"
|
|
122
159
|
className="size-11 sm:size-7"
|
|
123
|
-
disabled={builds.
|
|
160
|
+
disabled={builds.isPending}
|
|
124
161
|
onClick={() => void builds.refetch()}
|
|
125
162
|
size="icon-sm"
|
|
126
163
|
variant="ghost"
|
|
@@ -128,12 +165,33 @@ export function NativeBuildsPage({
|
|
|
128
165
|
<RefreshCw aria-hidden="true" />
|
|
129
166
|
</Button>
|
|
130
167
|
</div>
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
168
|
+
{channelsFailed ? (
|
|
169
|
+
<Alert variant="destructive">
|
|
170
|
+
<AlertTriangle />
|
|
171
|
+
<AlertTitle>Channels couldn't be loaded</AlertTitle>
|
|
172
|
+
<AlertDescription>
|
|
173
|
+
Native builds show once the channels load.
|
|
174
|
+
</AlertDescription>
|
|
175
|
+
<AlertAction>
|
|
176
|
+
<Button
|
|
177
|
+
className="min-h-11 sm:min-h-7"
|
|
178
|
+
onClick={() => void channels.refetch()}
|
|
179
|
+
size="xs"
|
|
180
|
+
variant="outline"
|
|
181
|
+
>
|
|
182
|
+
<RefreshCw data-icon="inline-start" />
|
|
183
|
+
Retry
|
|
184
|
+
</Button>
|
|
185
|
+
</AlertAction>
|
|
186
|
+
</Alert>
|
|
187
|
+
) : (
|
|
188
|
+
<NativeBuildsTable
|
|
189
|
+
builds={builds}
|
|
190
|
+
channel={channel}
|
|
191
|
+
onChannel={filterBy}
|
|
192
|
+
paged={before !== undefined || after !== undefined}
|
|
193
|
+
/>
|
|
194
|
+
)}
|
|
137
195
|
</div>
|
|
138
196
|
</div>
|
|
139
197
|
);
|
|
@@ -54,6 +54,7 @@ import { Button, buttonVariants } from "@/components/ui/button";
|
|
|
54
54
|
import { TableCell, TableHead } from "@/components/ui/table";
|
|
55
55
|
import { useIsMobile } from "@/hooks/use-mobile";
|
|
56
56
|
import { useNativeBuildFoldQuery } from "@/lib/api";
|
|
57
|
+
import { ALL_CHANNELS } from "@/lib/constants";
|
|
57
58
|
import {
|
|
58
59
|
formatByteSize,
|
|
59
60
|
nativeBuildArtifacts,
|
|
@@ -64,6 +65,7 @@ import {
|
|
|
64
65
|
} from "@/lib/native-builds";
|
|
65
66
|
import type { Fold } from "@/lib/server/foldedPage";
|
|
66
67
|
import type { NativeBuildFoldedPage } from "@/lib/server/nativeBuilds";
|
|
68
|
+
import type { NativeBuildsSearch } from "@/routes/-native-builds-search";
|
|
67
69
|
|
|
68
70
|
import { CopyableText } from "./CopyableText";
|
|
69
71
|
import { IMPORT_COMMAND, IMPORT_GUIDE_URL } from "./ImportBuild";
|
|
@@ -77,8 +79,8 @@ export const NATIVE_BUILD_GUIDE_URL =
|
|
|
77
79
|
const COLUMNS = 10;
|
|
78
80
|
|
|
79
81
|
/** The page of the list that shows `channel`'s builds, or every build. */
|
|
80
|
-
const channelSearch = (channel: string | undefined) =>
|
|
81
|
-
channel === undefined ? {} : { channel };
|
|
82
|
+
const channelSearch = (channel: string | undefined): NativeBuildsSearch =>
|
|
83
|
+
channel === undefined ? { channels: ALL_CHANNELS } : { channel };
|
|
82
84
|
|
|
83
85
|
/** A fold of older builds: "1 older build", "12 older builds". */
|
|
84
86
|
const OLDER_BUILDS = { one: "older build", other: "older builds" } as const;
|
|
@@ -594,7 +596,7 @@ export function NativeBuildsTable({
|
|
|
594
596
|
readonly builds: {
|
|
595
597
|
readonly data: NativeBuildFoldedPage | undefined;
|
|
596
598
|
readonly isError: boolean;
|
|
597
|
-
readonly
|
|
599
|
+
readonly isPending: boolean;
|
|
598
600
|
readonly isPlaceholderData: boolean;
|
|
599
601
|
readonly refetch: () => unknown;
|
|
600
602
|
};
|
|
@@ -662,7 +664,7 @@ export function NativeBuildsTable({
|
|
|
662
664
|
className="h-full overflow-y-auto aria-busy:opacity-60"
|
|
663
665
|
role="list"
|
|
664
666
|
>
|
|
665
|
-
{builds.
|
|
667
|
+
{builds.isPending ? (
|
|
666
668
|
<DataCardSkeletons label="Loading native builds" />
|
|
667
669
|
) : (
|
|
668
670
|
<>
|
|
@@ -707,7 +709,7 @@ export function NativeBuildsTable({
|
|
|
707
709
|
}
|
|
708
710
|
rowGroups
|
|
709
711
|
>
|
|
710
|
-
{builds.
|
|
712
|
+
{builds.isPending ? (
|
|
711
713
|
<DataTableBody>
|
|
712
714
|
<DataTableSkeletonRows
|
|
713
715
|
columns={COLUMNS}
|
|
@@ -743,7 +745,7 @@ export function NativeBuildsTable({
|
|
|
743
745
|
</DataTable>
|
|
744
746
|
)}
|
|
745
747
|
</DataTableFrame>
|
|
746
|
-
{builds.
|
|
748
|
+
{builds.isPending || entries === undefined ? null : (
|
|
747
749
|
<DataTablePagination
|
|
748
750
|
count={count}
|
|
749
751
|
folded={{ ...foldedTotal(entries), label: "older" }}
|
package/src/lib/api.ts
CHANGED
|
@@ -146,11 +146,15 @@ export function useChannelsQuery() {
|
|
|
146
146
|
});
|
|
147
147
|
}
|
|
148
148
|
|
|
149
|
-
export function useReleasesQuery(
|
|
149
|
+
export function useReleasesQuery(
|
|
150
|
+
filters?: ReleaseFilters,
|
|
151
|
+
{ enabled = true }: { readonly enabled?: boolean } = {},
|
|
152
|
+
) {
|
|
150
153
|
return useQuery({
|
|
151
154
|
queryKey: queryKeys.releases.list(filters),
|
|
152
155
|
queryFn: () => getReleases({ data: filters }),
|
|
153
156
|
placeholderData: (previousData) => previousData,
|
|
157
|
+
enabled,
|
|
154
158
|
});
|
|
155
159
|
}
|
|
156
160
|
|
|
@@ -251,12 +255,16 @@ export function useNativeBuildFoldQuery(
|
|
|
251
255
|
}
|
|
252
256
|
|
|
253
257
|
/** One page of native builds, newest first, kept on screen while the next loads. */
|
|
254
|
-
export function useNativeBuildsQuery(
|
|
258
|
+
export function useNativeBuildsQuery(
|
|
259
|
+
page: NativeBuildPage,
|
|
260
|
+
{ enabled = true }: { readonly enabled?: boolean } = {},
|
|
261
|
+
) {
|
|
255
262
|
return useQuery({
|
|
256
263
|
queryKey: queryKeys.nativeBuilds.list(page),
|
|
257
264
|
queryFn: () => getNativeBuilds({ data: page }),
|
|
258
265
|
placeholderData: (previousData) => previousData,
|
|
259
266
|
staleTime: 60_000,
|
|
267
|
+
enabled,
|
|
260
268
|
});
|
|
261
269
|
}
|
|
262
270
|
|
package/src/lib/constants.ts
CHANGED
|
@@ -1 +1,13 @@
|
|
|
1
1
|
export const DEFAULT_PAGE_LIMIT = 20;
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The channel the SDK and the CLI use when none is chosen. Insights, Bundles,
|
|
5
|
+
* and Native builds open on it when the URL names no channel.
|
|
6
|
+
*/
|
|
7
|
+
export const DEFAULT_CHANNEL = "production";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* The URL's `channels` value that lists every channel. It has a key of its
|
|
11
|
+
* own because any name, `all` included, can be a channel's.
|
|
12
|
+
*/
|
|
13
|
+
export const ALL_CHANNELS = "all";
|
|
@@ -17,9 +17,6 @@ const readHealthChart = (value: unknown): HealthChart | undefined =>
|
|
|
17
17
|
const readUsageWindow = (value: unknown): UsageWindow | undefined =>
|
|
18
18
|
value === "12m" ? value : readWindow(value);
|
|
19
19
|
|
|
20
|
-
/** The channel Insights reads when none is chosen: the SDK's and the CLI's default. */
|
|
21
|
-
export const DEFAULT_INSIGHTS_CHANNEL = "production";
|
|
22
|
-
|
|
23
20
|
export type InsightsSearch = {
|
|
24
21
|
/** Every report's platform; both when omitted. */
|
|
25
22
|
platform?: AppUsageScope["platform"];
|
|
@@ -3,6 +3,7 @@ import { assertCanonicalChannelName } from "@hot-updater/protocol";
|
|
|
3
3
|
|
|
4
4
|
import type { NativeBuildDetailSearch } from "@/components/features/native-builds/NativeBuildDetailPage";
|
|
5
5
|
import type { NativeBuildPage } from "@/lib/api";
|
|
6
|
+
import { ALL_CHANNELS, DEFAULT_CHANNEL } from "@/lib/constants";
|
|
6
7
|
|
|
7
8
|
const text = (value: unknown) =>
|
|
8
9
|
typeof value === "string" && value.length > 0 ? value : undefined;
|
|
@@ -25,20 +26,47 @@ const defined = <T extends object>(values: T): T =>
|
|
|
25
26
|
) as T;
|
|
26
27
|
|
|
27
28
|
/**
|
|
28
|
-
* The native build list's URL: a channel the builds embed,
|
|
29
|
-
* page. A page has one direction, so `before` wins over
|
|
29
|
+
* The native build list's URL: a channel the builds embed, or every channel,
|
|
30
|
+
* and one keyset page. A page has one direction, so `before` wins over
|
|
31
|
+
* `after`.
|
|
30
32
|
*/
|
|
33
|
+
export type NativeBuildsSearch = NativeBuildPage & {
|
|
34
|
+
/** Every channel, where the list would open on the default one. */
|
|
35
|
+
readonly channels?: typeof ALL_CHANNELS;
|
|
36
|
+
};
|
|
37
|
+
|
|
31
38
|
export const validateNativeBuildsSearch = (
|
|
32
39
|
search: Record<string, unknown>,
|
|
33
|
-
):
|
|
40
|
+
): NativeBuildsSearch => {
|
|
34
41
|
const before = text(search.before);
|
|
42
|
+
const channel = channelName(search.channel);
|
|
35
43
|
return defined({
|
|
36
|
-
channel
|
|
44
|
+
channel,
|
|
45
|
+
channels:
|
|
46
|
+
channel === undefined && search.channels === ALL_CHANNELS
|
|
47
|
+
? ALL_CHANNELS
|
|
48
|
+
: undefined,
|
|
37
49
|
before,
|
|
38
50
|
after: before === undefined ? text(search.after) : undefined,
|
|
39
51
|
});
|
|
40
52
|
};
|
|
41
53
|
|
|
54
|
+
/**
|
|
55
|
+
* The page the list reads. A URL that names no channel opens on the default
|
|
56
|
+
* channel, or on every channel when the project has no such channel;
|
|
57
|
+
* undefined until the channel names, which the page reads anyway, arrive.
|
|
58
|
+
*/
|
|
59
|
+
export const resolveNativeBuildsSearch = (
|
|
60
|
+
{ channels, ...page }: NativeBuildsSearch,
|
|
61
|
+
channelNames: readonly string[] | undefined,
|
|
62
|
+
): NativeBuildPage | undefined => {
|
|
63
|
+
if (page.channel !== undefined || channels === ALL_CHANNELS) return page;
|
|
64
|
+
if (channelNames === undefined) return undefined;
|
|
65
|
+
return channelNames.includes(DEFAULT_CHANNEL)
|
|
66
|
+
? { channel: DEFAULT_CHANNEL, ...page }
|
|
67
|
+
: page;
|
|
68
|
+
};
|
|
69
|
+
|
|
42
70
|
/** A native build page's URL: one page of the patches from it. */
|
|
43
71
|
export const validateNativeBuildDetailSearch = (
|
|
44
72
|
search: Record<string, unknown>,
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import type { ReleaseFilter } from "@hot-updater/plugin-core";
|
|
1
|
+
import type { ChannelRow, ReleaseFilter } from "@hot-updater/plugin-core";
|
|
2
|
+
|
|
3
|
+
import { ALL_CHANNELS, DEFAULT_CHANNEL } from "@/lib/constants";
|
|
2
4
|
|
|
3
5
|
export interface ReleaseSearch {
|
|
4
6
|
/** Releases newer than this id: the previous page. */
|
|
@@ -7,6 +9,8 @@ export interface ReleaseSearch {
|
|
|
7
9
|
beforeReleaseId?: string;
|
|
8
10
|
bundleId?: string;
|
|
9
11
|
channelId?: string;
|
|
12
|
+
/** Every channel, where the list would open on the default one. */
|
|
13
|
+
channels?: typeof ALL_CHANNELS;
|
|
10
14
|
enabled?: boolean;
|
|
11
15
|
platform?: "ios" | "android";
|
|
12
16
|
releaseId?: string;
|
|
@@ -47,12 +51,17 @@ export function validateReleaseSearch(
|
|
|
47
51
|
: search.platform === "android"
|
|
48
52
|
? "android"
|
|
49
53
|
: "ios";
|
|
54
|
+
const channels =
|
|
55
|
+
!bundleId && !scopeKey && !channelId && search.channels === ALL_CHANNELS
|
|
56
|
+
? ALL_CHANNELS
|
|
57
|
+
: undefined;
|
|
50
58
|
|
|
51
59
|
return {
|
|
52
60
|
afterReleaseId,
|
|
53
61
|
beforeReleaseId,
|
|
54
62
|
bundleId,
|
|
55
63
|
channelId,
|
|
64
|
+
channels,
|
|
56
65
|
enabled: scopeKey || channelId ? enabled : undefined,
|
|
57
66
|
platform,
|
|
58
67
|
releaseId: optionalString(search.releaseId),
|
|
@@ -82,6 +91,33 @@ export function hasReleaseFilters(search: ReleaseSearch): boolean {
|
|
|
82
91
|
return releaseFilterOf(search).kind !== "all";
|
|
83
92
|
}
|
|
84
93
|
|
|
94
|
+
/**
|
|
95
|
+
* The search the list shows. A URL that names no channel, bundle, or scope
|
|
96
|
+
* opens on the default channel's iOS releases, or on every channel when the
|
|
97
|
+
* project has no such channel; undefined until the channel list, which the
|
|
98
|
+
* page reads anyway, arrives. A link to one release that names no channel
|
|
99
|
+
* shows every channel, so its row shows wherever it is.
|
|
100
|
+
*/
|
|
101
|
+
export function resolveReleaseSearch(
|
|
102
|
+
search: ReleaseSearch,
|
|
103
|
+
channels: readonly Pick<ChannelRow, "id" | "name">[] | undefined,
|
|
104
|
+
): ReleaseSearch | undefined {
|
|
105
|
+
if (
|
|
106
|
+
search.bundleId ||
|
|
107
|
+
search.scopeKey ||
|
|
108
|
+
search.channelId ||
|
|
109
|
+
search.channels === ALL_CHANNELS
|
|
110
|
+
) {
|
|
111
|
+
return search;
|
|
112
|
+
}
|
|
113
|
+
if (search.releaseId) return { ...search, channels: ALL_CHANNELS };
|
|
114
|
+
if (channels === undefined) return undefined;
|
|
115
|
+
const defaultChannel = channels.find(({ name }) => name === DEFAULT_CHANNEL);
|
|
116
|
+
return defaultChannel
|
|
117
|
+
? validateReleaseSearch({ ...search, channelId: defaultChannel.id })
|
|
118
|
+
: search;
|
|
119
|
+
}
|
|
120
|
+
|
|
85
121
|
/**
|
|
86
122
|
* A new filter starts from the first page. A bundle or scope filter replaces
|
|
87
123
|
* the others, and choosing a channel or platform clears them.
|
|
@@ -91,7 +127,12 @@ export function updateReleaseFilters(
|
|
|
91
127
|
filters: Partial<
|
|
92
128
|
Pick<
|
|
93
129
|
ReleaseSearch,
|
|
94
|
-
|
|
130
|
+
| "bundleId"
|
|
131
|
+
| "channelId"
|
|
132
|
+
| "channels"
|
|
133
|
+
| "enabled"
|
|
134
|
+
| "platform"
|
|
135
|
+
| "scopeKey"
|
|
95
136
|
>
|
|
96
137
|
>,
|
|
97
138
|
): ReleaseSearch {
|
|
@@ -107,6 +148,7 @@ export function updateReleaseFilters(
|
|
|
107
148
|
if ("channelId" in filters || "platform" in filters) {
|
|
108
149
|
return validateReleaseSearch({
|
|
109
150
|
channelId: next.channelId,
|
|
151
|
+
channels: next.channels,
|
|
110
152
|
enabled: next.enabled,
|
|
111
153
|
platform: next.platform,
|
|
112
154
|
});
|
|
@@ -114,8 +156,27 @@ export function updateReleaseFilters(
|
|
|
114
156
|
return validateReleaseSearch({
|
|
115
157
|
bundleId: next.bundleId,
|
|
116
158
|
channelId: next.channelId,
|
|
159
|
+
channels: next.channels,
|
|
117
160
|
enabled: next.enabled,
|
|
118
161
|
platform: next.platform,
|
|
119
162
|
scopeKey: next.scopeKey,
|
|
120
163
|
});
|
|
121
164
|
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Whether the list shows what it opens on, so Clear has nothing to clear;
|
|
168
|
+
* true until the channel list arrives.
|
|
169
|
+
*/
|
|
170
|
+
export function showsDefaultReleases(
|
|
171
|
+
search: ReleaseSearch,
|
|
172
|
+
channels: readonly Pick<ChannelRow, "id" | "name">[] | undefined,
|
|
173
|
+
): boolean {
|
|
174
|
+
const view = resolveReleaseSearch(search, channels);
|
|
175
|
+
const opening = resolveReleaseSearch({}, channels);
|
|
176
|
+
return (
|
|
177
|
+
view === undefined ||
|
|
178
|
+
opening === undefined ||
|
|
179
|
+
JSON.stringify(releaseFilterOf(view)) ===
|
|
180
|
+
JSON.stringify(releaseFilterOf(opening))
|
|
181
|
+
);
|
|
182
|
+
}
|