fix: remove unused billing plan logic from CreateFromDSLModal component

pull/21398/head
twwu 11 months ago
parent 58842898e1
commit 55906c8375

@ -12,8 +12,6 @@ import {
DSLImportMode, DSLImportMode,
DSLImportStatus, DSLImportStatus,
} from '@/models/app' } from '@/models/app'
import { useProviderContextSelector } from '@/context/provider-context'
import AppsFull from '@/app/components/billing/apps-full-in-dialog'
import { usePluginDependencies } from '@/app/components/workflow/plugin-dependency/hooks' import { usePluginDependencies } from '@/app/components/workflow/plugin-dependency/hooks'
import { noop } from 'lodash-es' import { noop } from 'lodash-es'
import Uploader from './uploader' import Uploader from './uploader'
@ -70,9 +68,10 @@ const CreateFromDSLModal = ({
setFileContent('') setFileContent('')
} }
const plan = useProviderContextSelector(state => state.plan) // todo: TBD billing plan
const enableBilling = useProviderContextSelector(state => state.enableBilling) // const plan = useProviderContextSelector(state => state.plan)
const isAppsFull = (enableBilling && plan.usage.buildApps >= plan.total.buildApps) // const enableBilling = useProviderContextSelector(state => state.enableBilling)
// const isAppsFull = (enableBilling && plan.usage.buildApps >= plan.total.buildApps)
const isCreatingRef = useRef(false) const isCreatingRef = useRef(false)
@ -182,14 +181,12 @@ const CreateFromDSLModal = ({
} }
const buttonDisabled = useMemo(() => { const buttonDisabled = useMemo(() => {
if (isAppsFull)
return true
if (currentTab === CreateFromDSLModalTab.FROM_FILE) if (currentTab === CreateFromDSLModalTab.FROM_FILE)
return !currentFile return !currentFile
if (currentTab === CreateFromDSLModalTab.FROM_URL) if (currentTab === CreateFromDSLModalTab.FROM_URL)
return !dslUrlValue return !dslUrlValue
return false return false
}, [isAppsFull, currentTab, currentFile, dslUrlValue]) }, [currentTab, currentFile, dslUrlValue])
return ( return (
<> <>
@ -226,11 +223,6 @@ const CreateFromDSLModal = ({
) )
} }
</div> </div>
{isAppsFull && (
<div className='px-6'>
<AppsFull className='mt-0' loc='app-create-dsl' />
</div>
)}
<div className='flex justify-end gap-x-2 p-6 pt-5'> <div className='flex justify-end gap-x-2 p-6 pt-5'>
<Button onClick={onClose}> <Button onClick={onClose}>
{t('app.newApp.Cancel')} {t('app.newApp.Cancel')}

Loading…
Cancel
Save