Chore/Remove Previous Subscription (#5282)

Remove cancel subscription functionality from account controller and UI components; update email background and logo URLs across multiple email templates.
This commit is contained in:
Henry Heng
2025-10-01 12:32:30 +01:00
committed by GitHub
parent a86f618186
commit 580957e4aa
19 changed files with 28 additions and 173 deletions
-2
View File
@@ -7,7 +7,6 @@ const resendVerificationEmail = (body) => client.post('/account/resend-verificat
const forgotPassword = (body) => client.post('/account/forgot-password', body)
const resetPassword = (body) => client.post('/account/reset-password', body)
const getBillingData = () => client.post('/account/billing')
const cancelSubscription = (body) => client.post('/account/cancel-subscription', body)
const logout = () => client.post('/account/logout')
const getBasicAuth = () => client.get('/account/basic-auth')
const checkBasicAuth = (body) => client.post('/account/basic-auth', body)
@@ -20,7 +19,6 @@ export default {
resendVerificationEmail,
forgotPassword,
resetPassword,
cancelSubscription,
logout,
getBasicAuth,
checkBasicAuth
-104
View File
@@ -77,7 +77,6 @@ const AccountSettings = () => {
const [confirmPassword, setConfirmPassword] = useState('')
const [usage, setUsage] = useState(null)
const [isBillingLoading, setIsBillingLoading] = useState(false)
const [isMigrateLoading, setIsMigrateLoading] = useState(false)
const [seatsQuantity, setSeatsQuantity] = useState(0)
const [prorationInfo, setProrationInfo] = useState(null)
const [isUpdatingSeats, setIsUpdatingSeats] = useState(false)
@@ -173,45 +172,6 @@ const AccountSettings = () => {
return currentPlan?.title || ''
}, [getPricingPlansApi.data, currentUser?.activeOrganizationProductId])
const handleMigrateEmail = async () => {
setIsMigrateLoading(true)
try {
const obj = {
email: migrateEmail
}
const resp = await accountApi.cancelSubscription(obj)
if (resp.status === 200) {
enqueueSnackbar({
message: `Instruction to cancel subscription has been sent to ${migrateEmail}`,
options: {
key: new Date().getTime() + Math.random(),
variant: 'success',
action: (key) => (
<Button style={{ color: 'white' }} onClick={() => closeSnackbar(key)}>
<IconX />
</Button>
)
}
})
}
} catch (error) {
enqueueSnackbar({
message: 'Failed to access billing portal',
options: {
key: new Date().getTime() + Math.random(),
variant: 'error',
action: (key) => (
<Button style={{ color: 'white' }} onClick={() => closeSnackbar(key)}>
<IconX />
</Button>
)
}
})
} finally {
setIsMigrateLoading(false)
}
}
const handleBillingPortalClick = async () => {
setIsBillingLoading(true)
try {
@@ -817,70 +777,6 @@ const AccountSettings = () => {
</Box>
</SettingsSection>
)}
<SettingsSection title='Cancel Previous Subscription'>
<Box
sx={{
width: '100%',
display: 'grid',
gridTemplateColumns: 'repeat(3, 1fr)'
}}
>
<Box
sx={{
gridColumn: 'span 2 / span 2',
display: 'flex',
flexDirection: 'column',
alignItems: 'start',
justifyContent: 'center',
gap: 1,
px: 2.5,
py: 2
}}
>
<Typography variant='body2'>Migrate from existing cloud subscription?</Typography>
<Typography variant='body2' color='text.secondary'>
{`If you have an existing cloud app like <your-app>.app.flowiseai.com, after finished migrating your work, you can cancel the previous subscription. We'll send you an email with a link to cancel your previous subscription.`}
</Typography>
<Box sx={{ display: 'flex', flexDirection: 'column', gap: 1, width: '100%' }}>
<OutlinedInput
id='email'
type='string'
fullWidth
placeholder='Email Address'
name='email'
onChange={(e) => setMigrateEmail(e.target.value)}
value={migrateEmail}
/>
</Box>
</Box>
<Box
sx={{
display: 'flex',
alignItems: 'center',
justifyContent: 'end',
px: 2.5,
py: 2,
gap: 2
}}
>
<Button
variant='outlined'
disabled={!currentUser.isOrganizationAdmin || isMigrateLoading}
onClick={handleMigrateEmail}
sx={{ borderRadius: 2, height: 40 }}
>
{isMigrateLoading ? (
<Box sx={{ display: 'flex', alignItems: 'center', gap: 1 }}>
<CircularProgress size={16} color='inherit' />
Loading
</Box>
) : (
'Send Instructions'
)}
</Button>
</Box>
</Box>
</SettingsSection>
</>
)}
</Stack>
-12
View File
@@ -241,18 +241,6 @@ const SignInPage = () => {
Forgot password?
</Link>
</Typography>
{isCloud && (
<Typography variant='body2' sx={{ color: theme.palette.grey[600], mt: 1, textAlign: 'right' }}>
<a
href='https://docs.flowiseai.com/migration-guide/cloud-migration'
target='_blank'
rel='noopener noreferrer'
style={{ color: theme.palette.primary.main }}
>
Migrate from existing account?
</a>
</Typography>
)}
</Box>
<LoadingButton
loading={loading}