Skip to content

Commit 5dee5de

Browse files
committed
v2.4.2
1 parent 7b7e4c0 commit 5dee5de

23 files changed

+1739
-1591
lines changed

assets/icon.icns

-14.6 KB
Binary file not shown.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@
166166
"@babel/preset-react": "^7.12.7",
167167
"@babel/preset-typescript": "^7.12.7",
168168
"@babel/register": "^7.12.1",
169-
"@pmmmwh/react-refresh-webpack-plugin": "^0.4.3",
169+
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.4",
170170
"@teamsupercell/typings-for-css-modules-loader": "^2.4.0",
171171
"@testing-library/jest-dom": "^5.11.6",
172172
"@testing-library/react": "^11.2.2",
@@ -238,7 +238,7 @@
238238
"webpack": "^5.5.1",
239239
"webpack-bundle-analyzer": "^4.1.0",
240240
"webpack-cli": "^4.2.0",
241-
"webpack-dev-server": "^3.11.0",
241+
"webpack-dev-server": "^3.11.3",
242242
"webpack-merge": "^5.4.0",
243243
"yarn-deduplicate": "^3.1.0"
244244
},

src/App.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import osqueryRefreshThunk from './app/osqueryRefreshThunk';
2020
import syncRepoThunk from './app/repoThunk';
2121
import Subscription from './containers/Subscription';
2222
import CodeActivation from './containers/CodeActivation';
23+
import TrialActivation from "./containers/TrialActivation";
2324

2425
const { Header, Sider, Content } = Layout;
2526

@@ -162,6 +163,7 @@ class App extends React.Component {
162163
{/* <Route path="/hardening" component={Hardening} /> */}
163164
<Route path="/subscription" component={Subscription} />
164165
<Route path="/code-activation" component={CodeActivation} />
166+
<Route path="/trial-activation" component={TrialActivation} />
165167
<Route path="/debug" component={Debug} />
166168
</Switch>
167169
</Content>

src/app/repoThunk.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@ import recalculateAnalytics from '../features/analyticsSlice/utils/recalculateAn
1414
import { refreshAnalytics } from '../features/analyticsSlice/analyticsSlice';
1515
import { resetKey } from '../features/subscriptionSlice/subscriptionSlice';
1616

17+
import { API_HOST } from '../configs';
18+
1719
const META_REFETCH_TIMEOUT = 1 * 60 * 1000; // refetch meta files every minute.
1820

1921
const manaAxios = axios.create({
20-
baseURL: 'https://slack.manasecurity.com/api/v1.0/',
22+
baseURL: `${API_HOST}api/v1.0/`,
2123
timeout: 30000,
2224
});
2325

@@ -198,7 +200,7 @@ const syncMissingRepo = async (
198200
}
199201
};
200202

201-
export default function syncRepoThunk() {
203+
export default function syncRepoThunk(infinite_run = true) {
202204
return (dispatch, getState) => {
203205
console.log('repo sync started');
204206

@@ -223,7 +225,13 @@ export default function syncRepoThunk() {
223225
)
224226
)
225227
.then(() => dispatch(setSyncStatus({ inSync: false })))
226-
.then(() => restartThunkWithTimeout(dispatch, syncRepoThunk))
228+
.then(() => {
229+
if (infinite_run) {
230+
restartThunkWithTimeout(dispatch, syncRepoThunk);
231+
} else {
232+
console.log('One-time sync completed.');
233+
}
234+
})
227235
.catch((error) => {
228236
console.log(`meta fetch failure: ${error}`);
229237
dispatch(setSyncStatus({ inSync: false }));

src/components/DashboardAppPromo.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ const DashboardAppPromo = (props) => {
1818
<div className="absolute m-20px bottom-0 left-0 right-0">
1919
<div className="absolute bottom-0 left-0">
2020
<p className="text-base">{message}</p>
21-
<p className="text-base text-gray-300">Upgrade to PRO</p>
21+
<p className="text-base text-gray-300">
22+
Start a free 14 day trial, no credit card required
23+
</p>
2224
</div>
2325
</div>
2426
</div>

src/components/FreePlan.tsx

Lines changed: 17 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
import React from 'react';
2-
import { Card, Row, Col, Button, Image, Tag } from 'antd';
1+
import React, { useCallback } from 'react';
2+
import { Card, Row, Col, Button, Image, Tag, Form, Input, Alert } from 'antd';
3+
import { Link, useHistory } from 'react-router-dom';
34

45
import greenTickImg from '../../assets/green-tick.svg';
5-
import { Link } from 'react-router-dom';
66

77
const FreePlan = (props) => {
8-
const { openBuyLink } = props;
8+
const history = useHistory();
9+
const handleOnClick = () => history.push('/trial-activation');
10+
911
return (
1012
<div className="overflow-y-auto overflow-x-hidden h-full pb-4">
1113
<div className="relative pt-11 pb-6">
@@ -15,20 +17,21 @@ const FreePlan = (props) => {
1517
<Row gutter={[2, 2]} className="pr-1">
1618
<Col span={24}>
1719
<Card className="rounded-md">
18-
<p className="text-2xl font-bold pb-8">PRO · $59.99/year</p>
19-
<p className="text-base pb-2">Tracks 30,000+ vulnerabilities</p>
20-
<p className="text-base pb-2">Supports 1000+ macOS apps</p>
20+
<p className="text-2xl font-bold pb-2">PRO · $59.99/year</p>
21+
<p className="text-base pb-2">Supports 100+ macOS apps</p>
2122
<p className="text-base pb-2">Priority email support</p>
22-
<p className="text-base pb-12">30 days money back guarantee</p>
23-
<p className="pb-4">
23+
<p className="text-base pb-2">Cancel any time</p>
24+
<p className="text-base">No credit card required</p>
25+
<p className="pt-8">
2426
<Button
25-
className="bg-opacity-25 border-0 text-base w-4/12 mr-6"
27+
className="bg-opacity-25 border-0 text-base w-6/12 mr-6 blue"
2628
size="large"
2729
style={{ background: '#0A40FF14', color: '#0A40FF' }}
28-
onClick={openBuyLink}
30+
onClick={handleOnClick}
2931
>
30-
Buy
32+
Start a free 14 day trial
3133
</Button>
34+
3235
<Link to="/code-activation" className="text-base blue">
3336
Add activation code
3437
</Link>
@@ -37,7 +40,7 @@ const FreePlan = (props) => {
3740
</Col>
3841
<Col span={24}>
3942
<Card className="rounded-md">
40-
<p className="text-2xl font-bold pb-8">
43+
<p className="text-2xl font-bold pb-2">
4144
Community · $0&nbsp;
4245
<Image
4346
className="mt-1"
@@ -47,17 +50,8 @@ const FreePlan = (props) => {
4750
preview={false}
4851
/>
4952
</p>
50-
<p className="text-base pb-2">Tracks 4,000+ vulnerabilities</p>
5153
<p className="text-base pb-2">Supports 10 essential macOS apps</p>
52-
<p className="text-base pb-12">Email support</p>
53-
54-
{/* <Button
55-
disabled
56-
size="large"
57-
className="bg-blue-700 bg-opacity-25 text-blue-700 border-0 text-base w-4/12"
58-
>
59-
switch back
60-
</Button> */}
54+
<p className="text-base">Email support</p>
6155
</Card>
6256
</Col>
6357
</Row>

src/components/NoVulnsSummary.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import React from 'react';
22
import { Col, Image, Row } from 'antd';
3+
import { Link } from 'react-router-dom';
34

45
import greenTickImg from '../../assets/green-tick.svg';
56
import DashboardAppPromo from './DashboardAppPromo';
6-
import { Link } from 'react-router-dom';
77

88
const NoVulnsSummary = (props) => {
99
const { paid } = props;
1010
if (!paid) {
1111
const promoMessage =
12-
'Only ten essential apps are supported in FREE plan. Find vulnerabilities for 1000+ apps with PRO subscription';
12+
'Only 10 essential apps are covered by Community edition. Find vulnerabilities for 100+ apps with PRO subscription';
1313
return (
1414
<div className="mb-0.5">
1515
<div className="dashboard-item rounded-b-none mb-px mt-1">

src/components/PaidPlan.tsx

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const PaidPlan = (props) => {
1414
<Row gutter={[2, 2]} className="pr-1">
1515
<Col span={24}>
1616
<Card className="rounded-md">
17-
<p className="text-2xl font-bold pb-8">
17+
<p className="text-2xl font-bold pb-2">
1818
PRO · $59.99/year&nbsp;
1919
<Image
2020
className="mt-1"
@@ -24,10 +24,10 @@ const PaidPlan = (props) => {
2424
preview={false}
2525
/>
2626
</p>
27-
<p className="text-base pb-2">Tracks 30,000+ vulnerabilities</p>
28-
<p className="text-base pb-2">Supports 1000+ macOS apps</p>
27+
<p className="text-base pb-2">Supports 100+ macOS apps</p>
2928
<p className="text-base pb-2">Priority email support</p>
30-
<p className="text-base pb-4">30 days money back guarantee</p>
29+
<p className="text-base pb-2">Cancel any time</p>
30+
<p className="text-base">No credit card required</p>
3131
{/* <p>
3232
<Button
3333
disabled
@@ -41,13 +41,12 @@ const PaidPlan = (props) => {
4141
</Col>
4242
<Col span={24}>
4343
<Card className="rounded-md">
44-
<p className="text-2xl font-bold pb-8">Community · $0</p>
45-
<p className="text-base pb-2">Tracks 4,000+ vulnerabilities</p>
46-
<p className="text-base pb-2">Supports 10 macOS apps</p>
47-
<p className="text-base pb-4">Email support</p>
44+
<p className="text-2xl font-bold pb-2">Community · $0</p>
45+
<p className="text-base pb-2">Supports 10 essential macOS apps</p>
46+
<p className="text-base pb-8">Email support</p>
4847

4948
<Button
50-
className="bg-blue-700 bg-opacity-25 text-blue-700 border-0 w-4/12"
49+
className="bg-blue-700 bg-opacity-25 text-blue-700 border-0 w-6/12"
5150
size="large"
5251
onClick={switchToFreePlan}
5352
style={{ background: '#0A40FF14', color: '#0A40FF' }}

src/configs.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
export const API_HOST = 'https://slack.manasecurity.com/';
2+
13
export const ANALYTICS_STATE_SEED = {
24
// Next three fields are used both in the interface and CSS classes to display stats.
35
overallRisk: 'low',

src/containers/AppsWidget.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ const AppsWidget = () => {
6969
renderedVulns = renderedVulns.concat(
7070
<Col key="promo" span={8}>
7171
<Link to="/subscription" className="text-black-important">
72-
<DashboardAppPromo message="Find vulnerabilities for 1000+ apps with PRO subscription" />
72+
<DashboardAppPromo message="Find vulnerabilities for 100+ apps with PRO subscription" />
7373
</Link>
7474
</Col>
7575
);

src/containers/CodeActivation.tsx

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
import { Button, Input } from 'antd';
1+
import { Button, Input, Alert } from 'antd';
22
import { ipcRenderer } from 'electron';
33
import React from 'react';
44

55
import { useDispatch } from 'react-redux';
66
import { useHistory } from 'react-router';
77
import persistSubscriptionThunk from '../app/persistSubscriptionThunk';
8+
import syncRepoThunk from '../app/repoThunk';
89
import { setKey } from '../features/subscriptionSlice/subscriptionSlice';
910

1011
const CodeActivation = () => {
@@ -15,6 +16,7 @@ const CodeActivation = () => {
1516
const newKey = event.target['new-key'].value;
1617
dispatch(setKey({ key: newKey }));
1718
dispatch(persistSubscriptionThunk());
19+
dispatch(syncRepoThunk(false));
1820
history.push('/subscription');
1921
};
2022

@@ -28,19 +30,21 @@ const CodeActivation = () => {
2830
<h1 className="text-6xl">Activate subscription</h1>
2931
</div>
3032

31-
<div className="bg-white border-5px mt-2 mr-2 p-4">
33+
<div className="bg-white border-5px mr-2 p-4">
3234
<form onSubmit={setNewKey}>
35+
<p className="mb-2">Activation key:</p>
3336
<Input
3437
autoFocus
3538
id="new-key"
36-
className="mb-1 mt-4"
37-
placeholder="Enter your activation key from the email"
39+
className="mb-1"
40+
placeholder="40 characters long string"
3841
size="large"
3942
/>
4043
<p className="text-gray-400 mb-4">
41-
You should receive an activation key after a successful payment. If
42-
you did not find the code, check the spam folder or contact us
43-
via <a onClick={openSupportUrl}>help@manasecurity.com</a>.
44+
You should receive an activation key after a successful payment or
45+
trial request. If you did not find the code, check the spam folder
46+
or contact us via{' '}
47+
<a onClick={openSupportUrl}>help@manasecurity.com</a>.
4448
</p>
4549
<Input
4650
className="bg-opacity-25 border-0 text-base w-6/12 mb-2 cursor-pointer hover:border-0 border-transparent hover:border-transparent"

src/containers/Dashboard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ const Dashboard = () => {
9595
</h2>
9696
<div className="mt-auto w-full lg:w-4/5">
9797
<p className={`text-2xl mb-1 risk-status-${patchVeloRiskLevel}`}>
98-
{secondsToHumanDays(patchVelocity, '~')} · You
98+
{secondsToHumanDays(patchVelocity, '>')} · You
9999
</p>
100100
<div
101101
className={`border-b-2 mb-3 min-w-chart border-risk-status-${patchVeloRiskLevel}`}

src/containers/SidebarIcon.tsx

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import React from 'react';
1+
import React, { useContext } from 'react';
22
import { useSelector } from 'react-redux';
3-
import { Route, Switch, Link } from 'react-router-dom';
3+
import { Route, Switch, Link, useHistory } from 'react-router-dom';
44

55
import { Image } from 'antd';
66

@@ -10,6 +10,8 @@ const SidebarIcon = () => {
1010
const { overallRisk } = useSelector((state) => state.analytics);
1111
const overallRiskLevel = overallRisk;
1212

13+
const history = useHistory();
14+
1315
return (
1416
<Switch>
1517
<Route exact path="/">
@@ -34,7 +36,7 @@ const SidebarIcon = () => {
3436
</Link>
3537
</Route>
3638
<Route path="/code-activation">
37-
<Link to="/subscription">
39+
<Link to="#" onClick={history.goBack}>
3840
<Image
3941
className="mt-8 pl-2 pt-3"
4042
width={42}
@@ -44,6 +46,18 @@ const SidebarIcon = () => {
4446
/>
4547
</Link>
4648
</Route>
49+
<Route path="/trial-activation">
50+
<Link to="#" onClick={history.goBack}>
51+
<Image
52+
className="mt-8 pl-2 pt-3"
53+
width={42}
54+
height={42}
55+
src={backImg}
56+
preview={false}
57+
/>
58+
</Link>
59+
</Route>
60+
4761
</Switch>
4862
);
4963
};

src/containers/TrialActivation.tsx

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
import { Button, Input } from 'antd';
2+
import { ipcRenderer } from 'electron';
3+
import React from 'react';
4+
5+
import { useHistory } from 'react-router';
6+
7+
const TrialActivation = () => {
8+
const history = useHistory();
9+
10+
const getTrial = (event) => {
11+
const email = event.target.email.value;
12+
ipcRenderer.send('url:get-trial-link', { email });
13+
history.push('/code-activation');
14+
};
15+
16+
return (
17+
<div className="overflow-y-auto overflow-x-hidden h-full pb-4">
18+
<div className="relative pt-11 pb-6">
19+
<h1 className="text-6xl">Start trial</h1>
20+
</div>
21+
<div className="bg-white border-5px mr-2 p-4">
22+
<form onSubmit={getTrial}>
23+
<p className="mb-2">Email:</p>
24+
<Input
25+
autoFocus
26+
id="email"
27+
className="mb-1"
28+
placeholder=""
29+
size="large"
30+
type="email"
31+
/>
32+
<p className="text-gray-400 mb-4">
33+
We will only use this address to contact you about security or
34+
billing changes on your account. No marketing emails, no sales
35+
emails, nothing like that.
36+
</p>
37+
<Input
38+
className="bg-opacity-25 border-0 text-base w-6/12 mb-2 cursor-pointer hover:border-0 border-transparent hover:border-transparent"
39+
size="large"
40+
style={{ background: '#0A40FF14', color: '#0A40FF' }}
41+
type="submit"
42+
value="Get activation code"
43+
/>
44+
<Button
45+
className="bg-opacity-25 border-0 text-base mb-2"
46+
size="large"
47+
onClick={() => history.goBack()}
48+
style={{ color: '#0A40FF' }}
49+
>
50+
Return to subscription plans
51+
</Button>
52+
</form>
53+
</div>
54+
</div>
55+
);
56+
};
57+
58+
export default TrialActivation;

0 commit comments

Comments
 (0)