Skip to content

Commit

Permalink
v2.4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
mishamana committed Jan 10, 2022
1 parent 7b7e4c0 commit 5dee5de
Show file tree
Hide file tree
Showing 23 changed files with 1,739 additions and 1,591 deletions.
Binary file modified assets/icon.icns
Binary file not shown.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@
"@babel/preset-react": "^7.12.7",
"@babel/preset-typescript": "^7.12.7",
"@babel/register": "^7.12.1",
"@pmmmwh/react-refresh-webpack-plugin": "^0.4.3",
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.4",
"@teamsupercell/typings-for-css-modules-loader": "^2.4.0",
"@testing-library/jest-dom": "^5.11.6",
"@testing-library/react": "^11.2.2",
Expand Down Expand Up @@ -238,7 +238,7 @@
"webpack": "^5.5.1",
"webpack-bundle-analyzer": "^4.1.0",
"webpack-cli": "^4.2.0",
"webpack-dev-server": "^3.11.0",
"webpack-dev-server": "^3.11.3",
"webpack-merge": "^5.4.0",
"yarn-deduplicate": "^3.1.0"
},
Expand Down
2 changes: 2 additions & 0 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import osqueryRefreshThunk from './app/osqueryRefreshThunk';
import syncRepoThunk from './app/repoThunk';
import Subscription from './containers/Subscription';
import CodeActivation from './containers/CodeActivation';
import TrialActivation from "./containers/TrialActivation";

const { Header, Sider, Content } = Layout;

Expand Down Expand Up @@ -162,6 +163,7 @@ class App extends React.Component {
{/* <Route path="/hardening" component={Hardening} /> */}
<Route path="/subscription" component={Subscription} />
<Route path="/code-activation" component={CodeActivation} />
<Route path="/trial-activation" component={TrialActivation} />
<Route path="/debug" component={Debug} />
</Switch>
</Content>
Expand Down
14 changes: 11 additions & 3 deletions src/app/repoThunk.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@ import recalculateAnalytics from '../features/analyticsSlice/utils/recalculateAn
import { refreshAnalytics } from '../features/analyticsSlice/analyticsSlice';
import { resetKey } from '../features/subscriptionSlice/subscriptionSlice';

import { API_HOST } from '../configs';

const META_REFETCH_TIMEOUT = 1 * 60 * 1000; // refetch meta files every minute.

const manaAxios = axios.create({
baseURL: 'https://slack.manasecurity.com/api/v1.0/',
baseURL: `${API_HOST}api/v1.0/`,
timeout: 30000,
});

Expand Down Expand Up @@ -198,7 +200,7 @@ const syncMissingRepo = async (
}
};

export default function syncRepoThunk() {
export default function syncRepoThunk(infinite_run = true) {
return (dispatch, getState) => {
console.log('repo sync started');

Expand All @@ -223,7 +225,13 @@ export default function syncRepoThunk() {
)
)
.then(() => dispatch(setSyncStatus({ inSync: false })))
.then(() => restartThunkWithTimeout(dispatch, syncRepoThunk))
.then(() => {
if (infinite_run) {
restartThunkWithTimeout(dispatch, syncRepoThunk);
} else {
console.log('One-time sync completed.');
}
})
.catch((error) => {
console.log(`meta fetch failure: ${error}`);
dispatch(setSyncStatus({ inSync: false }));
Expand Down
4 changes: 3 additions & 1 deletion src/components/DashboardAppPromo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ const DashboardAppPromo = (props) => {
<div className="absolute m-20px bottom-0 left-0 right-0">
<div className="absolute bottom-0 left-0">
<p className="text-base">{message}</p>
<p className="text-base text-gray-300">Upgrade to PRO</p>
<p className="text-base text-gray-300">
Start a free 14 day trial, no credit card required
</p>
</div>
</div>
</div>
Expand Down
40 changes: 17 additions & 23 deletions src/components/FreePlan.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import React from 'react';
import { Card, Row, Col, Button, Image, Tag } from 'antd';
import React, { useCallback } from 'react';
import { Card, Row, Col, Button, Image, Tag, Form, Input, Alert } from 'antd';
import { Link, useHistory } from 'react-router-dom';

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

const FreePlan = (props) => {
const { openBuyLink } = props;
const history = useHistory();
const handleOnClick = () => history.push('/trial-activation');

return (
<div className="overflow-y-auto overflow-x-hidden h-full pb-4">
<div className="relative pt-11 pb-6">
Expand All @@ -15,20 +17,21 @@ const FreePlan = (props) => {
<Row gutter={[2, 2]} className="pr-1">
<Col span={24}>
<Card className="rounded-md">
<p className="text-2xl font-bold pb-8">PRO · $59.99/year</p>
<p className="text-base pb-2">Tracks 30,000+ vulnerabilities</p>
<p className="text-base pb-2">Supports 1000+ macOS apps</p>
<p className="text-2xl font-bold pb-2">PRO · $59.99/year</p>
<p className="text-base pb-2">Supports 100+ macOS apps</p>
<p className="text-base pb-2">Priority email support</p>
<p className="text-base pb-12">30 days money back guarantee</p>
<p className="pb-4">
<p className="text-base pb-2">Cancel any time</p>
<p className="text-base">No credit card required</p>
<p className="pt-8">
<Button
className="bg-opacity-25 border-0 text-base w-4/12 mr-6"
className="bg-opacity-25 border-0 text-base w-6/12 mr-6 blue"
size="large"
style={{ background: '#0A40FF14', color: '#0A40FF' }}
onClick={openBuyLink}
onClick={handleOnClick}
>
Buy
Start a free 14 day trial
</Button>

<Link to="/code-activation" className="text-base blue">
Add activation code
</Link>
Expand All @@ -37,7 +40,7 @@ const FreePlan = (props) => {
</Col>
<Col span={24}>
<Card className="rounded-md">
<p className="text-2xl font-bold pb-8">
<p className="text-2xl font-bold pb-2">
Community · $0&nbsp;
<Image
className="mt-1"
Expand All @@ -47,17 +50,8 @@ const FreePlan = (props) => {
preview={false}
/>
</p>
<p className="text-base pb-2">Tracks 4,000+ vulnerabilities</p>
<p className="text-base pb-2">Supports 10 essential macOS apps</p>
<p className="text-base pb-12">Email support</p>

{/* <Button
disabled
size="large"
className="bg-blue-700 bg-opacity-25 text-blue-700 border-0 text-base w-4/12"
>
switch back
</Button> */}
<p className="text-base">Email support</p>
</Card>
</Col>
</Row>
Expand Down
4 changes: 2 additions & 2 deletions src/components/NoVulnsSummary.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import React from 'react';
import { Col, Image, Row } from 'antd';
import { Link } from 'react-router-dom';

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

const NoVulnsSummary = (props) => {
const { paid } = props;
if (!paid) {
const promoMessage =
'Only ten essential apps are supported in FREE plan. Find vulnerabilities for 1000+ apps with PRO subscription';
'Only 10 essential apps are covered by Community edition. Find vulnerabilities for 100+ apps with PRO subscription';
return (
<div className="mb-0.5">
<div className="dashboard-item rounded-b-none mb-px mt-1">
Expand Down
17 changes: 8 additions & 9 deletions src/components/PaidPlan.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const PaidPlan = (props) => {
<Row gutter={[2, 2]} className="pr-1">
<Col span={24}>
<Card className="rounded-md">
<p className="text-2xl font-bold pb-8">
<p className="text-2xl font-bold pb-2">
PRO · $59.99/year&nbsp;
<Image
className="mt-1"
Expand All @@ -24,10 +24,10 @@ const PaidPlan = (props) => {
preview={false}
/>
</p>
<p className="text-base pb-2">Tracks 30,000+ vulnerabilities</p>
<p className="text-base pb-2">Supports 1000+ macOS apps</p>
<p className="text-base pb-2">Supports 100+ macOS apps</p>
<p className="text-base pb-2">Priority email support</p>
<p className="text-base pb-4">30 days money back guarantee</p>
<p className="text-base pb-2">Cancel any time</p>
<p className="text-base">No credit card required</p>
{/* <p>
<Button
disabled
Expand All @@ -41,13 +41,12 @@ const PaidPlan = (props) => {
</Col>
<Col span={24}>
<Card className="rounded-md">
<p className="text-2xl font-bold pb-8">Community · $0</p>
<p className="text-base pb-2">Tracks 4,000+ vulnerabilities</p>
<p className="text-base pb-2">Supports 10 macOS apps</p>
<p className="text-base pb-4">Email support</p>
<p className="text-2xl font-bold pb-2">Community · $0</p>
<p className="text-base pb-2">Supports 10 essential macOS apps</p>
<p className="text-base pb-8">Email support</p>

<Button
className="bg-blue-700 bg-opacity-25 text-blue-700 border-0 w-4/12"
className="bg-blue-700 bg-opacity-25 text-blue-700 border-0 w-6/12"
size="large"
onClick={switchToFreePlan}
style={{ background: '#0A40FF14', color: '#0A40FF' }}
Expand Down
2 changes: 2 additions & 0 deletions src/configs.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
export const API_HOST = 'https://slack.manasecurity.com/';

export const ANALYTICS_STATE_SEED = {
// Next three fields are used both in the interface and CSS classes to display stats.
overallRisk: 'low',
Expand Down
2 changes: 1 addition & 1 deletion src/containers/AppsWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const AppsWidget = () => {
renderedVulns = renderedVulns.concat(
<Col key="promo" span={8}>
<Link to="/subscription" className="text-black-important">
<DashboardAppPromo message="Find vulnerabilities for 1000+ apps with PRO subscription" />
<DashboardAppPromo message="Find vulnerabilities for 100+ apps with PRO subscription" />
</Link>
</Col>
);
Expand Down
18 changes: 11 additions & 7 deletions src/containers/CodeActivation.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { Button, Input } from 'antd';
import { Button, Input, Alert } from 'antd';
import { ipcRenderer } from 'electron';
import React from 'react';

import { useDispatch } from 'react-redux';
import { useHistory } from 'react-router';
import persistSubscriptionThunk from '../app/persistSubscriptionThunk';
import syncRepoThunk from '../app/repoThunk';
import { setKey } from '../features/subscriptionSlice/subscriptionSlice';

const CodeActivation = () => {
Expand All @@ -15,6 +16,7 @@ const CodeActivation = () => {
const newKey = event.target['new-key'].value;
dispatch(setKey({ key: newKey }));
dispatch(persistSubscriptionThunk());
dispatch(syncRepoThunk(false));
history.push('/subscription');
};

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

<div className="bg-white border-5px mt-2 mr-2 p-4">
<div className="bg-white border-5px mr-2 p-4">
<form onSubmit={setNewKey}>
<p className="mb-2">Activation key:</p>
<Input
autoFocus
id="new-key"
className="mb-1 mt-4"
placeholder="Enter your activation key from the email"
className="mb-1"
placeholder="40 characters long string"
size="large"
/>
<p className="text-gray-400 mb-4">
You should receive an activation key after a successful payment. If
you did not find the code, check the spam folder or contact us
via <a onClick={openSupportUrl}>[email protected]</a>.
You should receive an activation key after a successful payment or
trial request. If you did not find the code, check the spam folder
or contact us via{' '}
<a onClick={openSupportUrl}>[email protected]</a>.
</p>
<Input
className="bg-opacity-25 border-0 text-base w-6/12 mb-2 cursor-pointer hover:border-0 border-transparent hover:border-transparent"
Expand Down
2 changes: 1 addition & 1 deletion src/containers/Dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ const Dashboard = () => {
</h2>
<div className="mt-auto w-full lg:w-4/5">
<p className={`text-2xl mb-1 risk-status-${patchVeloRiskLevel}`}>
{secondsToHumanDays(patchVelocity, '~')} · You
{secondsToHumanDays(patchVelocity, '>')} · You
</p>
<div
className={`border-b-2 mb-3 min-w-chart border-risk-status-${patchVeloRiskLevel}`}
Expand Down
20 changes: 17 additions & 3 deletions src/containers/SidebarIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import React, { useContext } from 'react';
import { useSelector } from 'react-redux';
import { Route, Switch, Link } from 'react-router-dom';
import { Route, Switch, Link, useHistory } from 'react-router-dom';

import { Image } from 'antd';

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

const history = useHistory();

return (
<Switch>
<Route exact path="/">
Expand All @@ -34,7 +36,7 @@ const SidebarIcon = () => {
</Link>
</Route>
<Route path="/code-activation">
<Link to="/subscription">
<Link to="#" onClick={history.goBack}>
<Image
className="mt-8 pl-2 pt-3"
width={42}
Expand All @@ -44,6 +46,18 @@ const SidebarIcon = () => {
/>
</Link>
</Route>
<Route path="/trial-activation">
<Link to="#" onClick={history.goBack}>
<Image
className="mt-8 pl-2 pt-3"
width={42}
height={42}
src={backImg}
preview={false}
/>
</Link>
</Route>

</Switch>
);
};
Expand Down
58 changes: 58 additions & 0 deletions src/containers/TrialActivation.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import { Button, Input } from 'antd';
import { ipcRenderer } from 'electron';
import React from 'react';

import { useHistory } from 'react-router';

const TrialActivation = () => {
const history = useHistory();

const getTrial = (event) => {
const email = event.target.email.value;
ipcRenderer.send('url:get-trial-link', { email });
history.push('/code-activation');
};

return (
<div className="overflow-y-auto overflow-x-hidden h-full pb-4">
<div className="relative pt-11 pb-6">
<h1 className="text-6xl">Start trial</h1>
</div>
<div className="bg-white border-5px mr-2 p-4">
<form onSubmit={getTrial}>
<p className="mb-2">Email:</p>
<Input
autoFocus
id="email"
className="mb-1"
placeholder=""
size="large"
type="email"
/>
<p className="text-gray-400 mb-4">
We will only use this address to contact you about security or
billing changes on your account. No marketing emails, no sales
emails, nothing like that.
</p>
<Input
className="bg-opacity-25 border-0 text-base w-6/12 mb-2 cursor-pointer hover:border-0 border-transparent hover:border-transparent"
size="large"
style={{ background: '#0A40FF14', color: '#0A40FF' }}
type="submit"
value="Get activation code"
/>
<Button
className="bg-opacity-25 border-0 text-base mb-2"
size="large"
onClick={() => history.goBack()}
style={{ color: '#0A40FF' }}
>
Return to subscription plans
</Button>
</form>
</div>
</div>
);
};

export default TrialActivation;
Loading

0 comments on commit 5dee5de

Please sign in to comment.