-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(web): Consolidate all web code into a single app (#5716)
* chore(web): Consolidate all web code into a single app - Simplify development experience, simplify imports, fix live reload issues, and reduce package dependencies - Enforce TS strict mode that wasn't previously enforced in EE code, although tsconfig.json had strict: true. - Add the necessary Novu license under the apps/web/ee folder * Update License files
1 parent
c67df9c
commit cc23b1e
Showing
407 changed files
with
15,850 additions
and
2,879 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 2 additions & 8 deletions
10
apps/web/src/components/layout/components/FreeTrialBanner.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,10 @@ | ||
import { IS_DOCKER_HOSTED } from '@novu/shared-web'; | ||
import { FreeTrialBanner as Component } from '../../../ee/billing'; | ||
|
||
export function FreeTrialBanner() { | ||
if (IS_DOCKER_HOSTED) { | ||
return null; | ||
} | ||
|
||
try { | ||
const module = require('@novu/ee-billing-web'); | ||
const Component = module.FreeTrialBanner; | ||
|
||
return <Component />; | ||
} catch (e) {} | ||
|
||
return null; | ||
return <Component />; | ||
} |
10 changes: 2 additions & 8 deletions
10
apps/web/src/components/layout/components/FreeTrialSidebarWidget.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,10 @@ | ||
import { IS_DOCKER_HOSTED } from '@novu/shared-web'; | ||
import { FreeTrialSidebarWidget as Component } from '../../../ee/billing'; | ||
|
||
export const FreeTrialSidebarWidget = () => { | ||
if (IS_DOCKER_HOSTED) { | ||
return null; | ||
} | ||
|
||
try { | ||
const module = require('@novu/ee-billing-web'); | ||
const Component = module.FreeTrialSidebarWidget; | ||
|
||
return <Component />; | ||
} catch (e) {} | ||
|
||
return null; | ||
return <Component />; | ||
}; |
12 changes: 3 additions & 9 deletions
12
apps/web/src/components/layout/components/UpgradePlanBanner.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,11 @@ | ||
import { IS_DOCKER_HOSTED } from '@novu/shared-web'; | ||
import { FC } from 'react'; | ||
import { IS_DOCKER_HOSTED } from '@novu/shared-web'; | ||
import { UpgradePlanBanner as Component } from '../../../ee/billing'; | ||
|
||
export function UpgradePlanBanner({ FeatureActivatedBanner }: { FeatureActivatedBanner: FC }) { | ||
if (IS_DOCKER_HOSTED) { | ||
return null; | ||
} | ||
|
||
try { | ||
const module = require('@novu/ee-billing-web'); | ||
const Component = module.UpgradePlanBanner; | ||
|
||
return <Component FeatureActivatedBanner={FeatureActivatedBanner} />; | ||
} catch (e) {} | ||
|
||
return null; | ||
return <Component FeatureActivatedBanner={FeatureActivatedBanner} />; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
Novu Proprietary Software License | ||
|
||
IMPORTANT – READ CAREFULLY: This License Agreement ("Agreement") is a legal agreement between you (either an individual or a single entity) and Novu Corporation ("Novu") for the software product identified below, which includes computer software and associated media, printed materials, and "online" or electronic documentation (collectively, the "Software"). | ||
|
||
By installing, copying, or otherwise using these files, you agree to be bound by the terms of this Agreement. | ||
If you do not agree to the terms of this Agreement, do not install or use the Software. | ||
|
||
Grant of License: Subject to the terms of this Agreement, Novu hereby grants you a non-exclusive, non-transferable license to use the Software solely for your internal operations. | ||
You may not rent, lease, lend, sell, redistribute, sublicense or provide commercial hosting services with the Software. | ||
|
||
- Use Restrictions: Use of the Software is conditional upon your compliance with the terms set forth below: | ||
- Approval Required: You may not use the Software without obtaining prior written approval from Novu. To request approval, you must contact Novu at [contact information]. | ||
- No Modification: You may not modify, adapt, or translate the Software. You may not reverse engineer, decompile, disassemble, or otherwise attempt to discover the source code of the Software, except to the extent that such activity is expressly permitted by applicable law notwithstanding this limitation. | ||
|
||
Intellectual Property Rights: The Software is the property of Novu and is protected by copyright laws and international copyright treaties, as well as other intellectual property laws and treaties. The Software is licensed, not sold. | ||
|
||
Termination: This Agreement is effective until terminated. Your rights under this Agreement will terminate automatically without notice from Novu if you fail to comply with any of the terms and conditions of this Agreement. Upon termination, you must cease all use of the Software and destroy all copies, full or partial, of the Software. | ||
|
||
No Warranties: Novu expressly disclaims any warranty for the Software. The Software is provided 'As Is' without any express or implied warranty of any kind, including but not limited to any warranties of merchantability, noninfringement, or fitness for a particular purpose. Novu does not warrant or assume responsibility for the accuracy or completeness of any information, text, graphics, links, or other items contained within the Software. | ||
|
||
Limitation of Liability: In no event shall Novu be liable for any damages whatsoever (including, without limitation, damages for loss of profits, business interruption, loss of information, or any other pecuniary loss) arising out of the use of or inability to use this Software, even if Novu has been advised of the possibility of such damages. | ||
|
||
By installing, copying, or otherwise using the Software, you acknowledge that you have read this Agreement, understand it, and agree to be bound by its terms and conditions. | ||
|
||
You also agree that this Agreement is the complete and exclusive statement of agreement between the parties and supersedes all proposals or prior agreements, oral or written, and any other communications between the parties relating to the subject matter of this Agreement. |
60 changes: 60 additions & 0 deletions
60
apps/web/src/ee/billing/components/BillingIntervalControl.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import { Box, SegmentedControl, useMantineTheme } from '@mantine/core'; | ||
import { colors, getGradient, shadows } from '@novu/design-system'; | ||
import React from 'react'; | ||
|
||
export const BillingIntervalControl = ({ | ||
onChange, | ||
value, | ||
}: { | ||
onChange: (value: 'month' | 'year') => void; | ||
value: 'month' | 'year'; | ||
}) => { | ||
const { colorScheme, ...theme } = useMantineTheme(); | ||
const isDark = colorScheme === 'dark'; | ||
|
||
return ( | ||
<SegmentedControl | ||
data-test-id="billing-interval-control" | ||
value={value} | ||
data={[ | ||
{ | ||
label: <Box data-test-id="billing-interval-control-monthly">Monthly</Box>, | ||
value: 'month', | ||
}, | ||
{ | ||
label: ( | ||
<Box data-test-id="billing-interval-control-annually"> | ||
Annually<span style={{ marginLeft: 4, color: colors.success }}>10% off</span> | ||
</Box> | ||
), | ||
value: 'year', | ||
}, | ||
]} | ||
onChange={(changeValue) => onChange(changeValue as 'month' | 'year')} | ||
radius="xl" | ||
styles={{ | ||
root: { | ||
width: '100%', | ||
background: isDark ? theme.colors.dark[7] : theme.white, | ||
padding: '5px', | ||
boxShadow: isDark ? shadows.dark : shadows.light, | ||
}, | ||
active: { | ||
background: `${isDark ? getGradient(colors.B20) : getGradient(colors.white)} padding-box, ${ | ||
colors.horizontal | ||
} border-box`, | ||
border: '2px solid transparent', | ||
}, | ||
label: { | ||
fontSize: '14px', | ||
fontWeight: 700, | ||
padding: `10px 8px`, | ||
color: theme.colors.gray[8], | ||
}, | ||
labelActive: { | ||
color: isDark ? theme.white : theme.colors.gray[8], | ||
}, | ||
}} | ||
/> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import React from 'react'; | ||
import { colors, Text } from '@novu/design-system'; | ||
import { Group, useMantineTheme } from '@mantine/core'; | ||
|
||
export const ContactSalesButton = ({ onContactSales, label }: { onContactSales: () => void; label?: string }) => { | ||
const { colorScheme } = useMantineTheme(); | ||
const isDark = colorScheme === 'dark'; | ||
const salesLabel = label || 'Contact sales'; | ||
|
||
return ( | ||
<Group position="center" spacing={4}> | ||
<Text color={isDark ? colors.B60 : colors.B40}>Questions?</Text> | ||
<Text gradient> | ||
<a | ||
onClick={onContactSales} | ||
style={{ | ||
cursor: 'pointer', | ||
}} | ||
> | ||
{salesLabel} | ||
</a> | ||
</Text> | ||
</Group> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import React from 'react'; | ||
import { Modal, Title, successMessage } from '@novu/design-system'; | ||
import { HubspotForm } from './HubspotForm'; | ||
import { HUBSPOT_FORM_IDS } from '../utils/hubspot.constants'; | ||
import { useAuth } from '@novu/shared-web'; | ||
import { ApiServiceLevelEnum } from '@novu/shared'; | ||
|
||
type ContactSalesModalProps = { | ||
isOpen: boolean; | ||
onClose: () => void; | ||
intendedApiServiceLevel: ApiServiceLevelEnum; | ||
}; | ||
|
||
export const ContactSalesModal = ({ isOpen, onClose, intendedApiServiceLevel }: ContactSalesModalProps) => { | ||
const { currentUser, currentOrganization } = useAuth(); | ||
if (!isOpen) { | ||
return null; | ||
} | ||
|
||
return ( | ||
<Modal | ||
styles={{ | ||
body: { | ||
paddingTop: '0px !important', | ||
}, | ||
modal: { | ||
width: 840, | ||
}, | ||
}} | ||
padding={40} | ||
withCloseButton={false} | ||
size="xl" | ||
opened={isOpen} | ||
title={undefined} | ||
onClose={onClose} | ||
> | ||
<Title mb={8}>Contact sales</Title> | ||
<HubspotForm | ||
formId={HUBSPOT_FORM_IDS.UPGRADE_CONTACT_SALES} | ||
properties={{ | ||
firstname: currentUser.firstName || '', | ||
lastname: currentUser.lastName || '', | ||
email: currentUser.email || '', | ||
app_organizationid: currentOrganization._id, | ||
'TICKET.subject': `Contact Sales - ${intendedApiServiceLevel}`, | ||
'TICKET.content': '', | ||
}} | ||
readonlyProperties={['email']} | ||
focussedProperty="TICKET.content" | ||
onFormSubmitted={() => { | ||
successMessage('Thank you for contacting us! We will be in touch soon.'); | ||
onClose(); | ||
}} | ||
/> | ||
</Modal> | ||
); | ||
}; |
Oops, something went wrong.