Skip to content

Commit 83d5b31

Browse files
Android (#1002)
* chore(android): upgrade gradle plugin to 8.13.0 * feat(android): hide billing and subscription features on Android * chore: remove beta label from scripting feature * refactor: simplify log retention evaluation logic * 3.41.0
1 parent 59c89a2 commit 83d5b31

File tree

14 files changed

+71
-101
lines changed

14 files changed

+71
-101
lines changed

android/app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ android {
1313
applicationId "com.remoteit"
1414
minSdkVersion rootProject.ext.minSdkVersion
1515
targetSdkVersion rootProject.ext.targetSdkVersion
16-
versionCode 286
17-
versionName "3.40.2"
16+
versionCode 287
17+
versionName "3.41.0"
1818
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1919
aaptOptions {
2020
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ buildscript {
77
mavenCentral()
88
}
99
dependencies {
10-
classpath 'com.android.tools.build:gradle:8.12.1'
10+
classpath 'com.android.tools.build:gradle:8.13.0'
1111
classpath 'com.google.gms:google-services:4.4.0'
1212

1313
// NOTE: Do not place your application dependencies here; they belong

electron/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

electron/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "remoteit",
3-
"version": "3.40.2",
3+
"version": "3.41.0",
44
"private": true,
55
"main": "build/index.js",
66
"description": "Remote.It cross platform desktop application for creating and hosting connections",
@@ -169,4 +169,4 @@
169169
"build/**/*"
170170
]
171171
}
172-
}
172+
}

frontend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "remoteit-desktop-frontend",
3-
"version": "3.40.2",
3+
"version": "3.41.0",
44
"private": true,
55
"type": "module",
66
"scripts": {

frontend/src/components/AvatarMenu.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,7 @@ export const AvatarMenu: React.FC = () => {
9898
to="/account"
9999
badge={licenseIndicator}
100100
onClick={handleClose}
101-
>
102-
{browser.isAndroid && <Icon name="launch" size="sm" color="grayDark" inlineLeft fixedWidth />}
103-
</ListItemLocation>
101+
/>
104102
<ListItemLink
105103
title="Support"
106104
icon="life-ring"

frontend/src/components/EventList/EventList.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import { List, Box, Button, Typography } from '@mui/material'
88
import { fontSizes, spacing } from '../../styling'
99
import { humanizeDays, limitDays } from '../../models/plans'
1010
import { EventItem } from './EventItem'
11+
import { MobileUI } from '../MobileUI'
1112
import { Notice } from '../Notice'
12-
import browser from '../../services/browser'
1313

1414
export interface LogListProps {
1515
device?: IDevice
@@ -28,7 +28,7 @@ export const EventList: React.FC<LogListProps> = ({ device }) => {
2828
await dispatch.logs.fetch({ allowedDays, deviceId: device?.id })
2929
}
3030

31-
const showPlanUpgradeNotice = Boolean(planUpgrade && !fetching && !fetchingMore && !browser.isAndroid)
31+
const showPlanUpgradeNotice = Boolean(planUpgrade && !fetching && !fetchingMore)
3232

3333
return (
3434
<>
@@ -41,9 +41,11 @@ export const EventList: React.FC<LogListProps> = ({ device }) => {
4141
<Notice
4242
severity="warning"
4343
button={
44-
<Button to="/account/plans" variant="contained" color="warning" size="small" component={Link}>
45-
Upgrade
46-
</Button>
44+
<MobileUI android hide>
45+
<Button to="/account/plans" variant="contained" color="warning" size="small" component={Link}>
46+
Upgrade
47+
</Button>
48+
</MobileUI>
4749
}
4850
>
4951
Plan upgrade required to view logs past {humanizeDays(logLimit?.value)}.

frontend/src/components/SidebarNav.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,7 @@ export const SidebarNav: React.FC = () => {
110110
icon="scripting"
111111
match={['/script', '/scripts', '/runs']}
112112
dense
113-
>
114-
<Chip size="small" label="BETA" sx={{ fontSize: 9 }} />
115-
</ListItemLocation>
113+
/>
116114
<ListItemLocation title="Organization" to="/organization" icon="industry-alt" dense />
117115
<ListItemLocation title="Logs" to="/logs" icon="rectangle-history" dense exactMatch />
118116
<ListItemButton onClick={() => setMore(!more)} sx={{ marginTop: 2 }}>

frontend/src/models/logs.ts

Lines changed: 5 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -5,33 +5,6 @@ import { RootModel } from '.'
55

66
const DAY_MS = 24 * 60 * 60 * 1000
77

8-
const toTimestamp = (value?: Date | string) => (value ? new Date(value).getTime() : undefined)
9-
10-
const clamp = (value: number, min: number, max: number) => Math.min(Math.max(value, min), max)
11-
12-
const evaluateRetention = ({
13-
items,
14-
minDate,
15-
hasMore,
16-
allowedDays,
17-
}: {
18-
items: IEvent[]
19-
minDate?: Date
20-
hasMore?: boolean
21-
allowedDays: number
22-
}) => {
23-
const minDateMs = toTimestamp(minDate)
24-
const oldestMs = toTimestamp(items[items.length - 1]?.timestamp)
25-
const boundaryReady = Boolean(items.length && !hasMore && minDateMs !== undefined && oldestMs !== undefined)
26-
if (!boundaryReady) return { reached: false, near: false }
27-
28-
const reached = oldestMs! <= minDateMs!
29-
const thresholdDays = clamp(allowedDays > 0 ? allowedDays * 0.1 : 1, 0.25, 1)
30-
const near = !reached && oldestMs! - minDateMs! <= thresholdDays * DAY_MS
31-
32-
return { reached, near }
33-
}
34-
358
type ILogState = {
369
size: number
3710
after?: string
@@ -93,18 +66,16 @@ export default createModel<RootModel>()({
9366
items: mergedItems,
9467
}
9568

96-
const { reached, near } = evaluateRetention({
97-
items: mergedItems,
98-
minDate,
99-
hasMore: nextEvents.hasMore,
100-
allowedDays,
101-
})
69+
const hasReachedLimit = !nextEvents.hasMore && allowedDays > 0
70+
const firstLogMs = state.user.created?.getTime() || 0
71+
const logLimitMs = Date.now() - allowedDays * DAY_MS
72+
const planUpgrade = hasReachedLimit && firstLogMs < logLimitMs
10273

10374
set({
10475
events: nextEvents,
10576
fetching: false,
10677
fetchingMore: false,
107-
planUpgrade: reached || near,
78+
planUpgrade,
10879
})
10980
},
11081

frontend/src/pages/AccountPage.tsx

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { List, Typography, Tooltip, ButtonBase } from '@mui/material'
44
import { ListItemLocation } from '../components/ListItemLocation'
55
import { windowOpen } from '../services/browser'
66
import { Container } from '../components/Container'
7+
import { MobileUI } from '../components/MobileUI'
78
import { Logo } from '@common/brand/Logo'
89
import { Icon } from '../components/Icon'
910

@@ -33,12 +34,14 @@ export const AccountPage: React.FC = () => {
3334
dense
3435
/>
3536
<ListItemLocation title="Security" to="/account/security" icon="lock" dense />
36-
<ListItemLocation title="Subscription" to="/account/plans" icon="shopping-cart" dense>
37-
{!browser.hasBilling && <Icon name="launch" size="sm" color="grayDark" inlineLeft fixedWidth />}
38-
</ListItemLocation>
39-
<ListItemLocation title="Billing" to="/account/billing" icon="credit-card-front" dense>
40-
{!browser.hasBilling && <Icon name="launch" size="sm" color="grayDark" inlineLeft fixedWidth />}
41-
</ListItemLocation>
37+
<MobileUI android hide>
38+
<ListItemLocation title="Subscription" to="/account/plans" icon="shopping-cart" dense>
39+
{!browser.hasBilling && <Icon name="launch" size="sm" color="grayDark" inlineLeft fixedWidth />}
40+
</ListItemLocation>
41+
<ListItemLocation title="Billing" to="/account/billing" icon="credit-card-front" dense>
42+
{!browser.hasBilling && <Icon name="launch" size="sm" color="grayDark" inlineLeft fixedWidth />}
43+
</ListItemLocation>
44+
</MobileUI>
4245
<ListItemLocation title="License" to="/account/license" icon="id-badge" dense />
4346
<ListItemLocation title="Access Keys" to="/account/accessKey" icon="key" dense />
4447
</List>

0 commit comments

Comments
 (0)