mirror of
https://github.com/portainer/portainer.git
synced 2025-08-04 21:35:23 +02:00
feat(system/upgrade): add get license dialog [EE-4743] (#8249)
This commit is contained in:
parent
5942f4ff58
commit
406ff8812c
12 changed files with 369 additions and 25 deletions
|
@ -5,13 +5,14 @@ import { useUser } from '@/react/hooks/useUser';
|
|||
import { UploadLicenseDialog } from './UploadLicenseDialog';
|
||||
import { LoadingDialog } from './LoadingDialog';
|
||||
import { NonAdminUpgradeDialog } from './NonAdminUpgradeDialog';
|
||||
import { GetLicenseDialog } from './GetLicenseDialog';
|
||||
|
||||
type Step = 'uploadLicense' | 'loading' | 'getLicense';
|
||||
|
||||
export function UpgradeDialog({ onDismiss }: { onDismiss: () => void }) {
|
||||
const { isAdmin } = useUser();
|
||||
const [currentStep, setCurrentStep] = useState<Step>('uploadLicense');
|
||||
|
||||
const [isGetLicenseSubmitted, setIsGetLicenseSubmitted] = useState(false);
|
||||
const component = getDialog();
|
||||
|
||||
return component;
|
||||
|
@ -23,13 +24,22 @@ export function UpgradeDialog({ onDismiss }: { onDismiss: () => void }) {
|
|||
|
||||
switch (currentStep) {
|
||||
case 'getLicense':
|
||||
throw new Error('Not implemented');
|
||||
// return <GetLicense setCurrentStep={setCurrentStep} />;
|
||||
return (
|
||||
<GetLicenseDialog
|
||||
goToUploadLicense={(isSubmitted) => {
|
||||
setCurrentStep('uploadLicense');
|
||||
setIsGetLicenseSubmitted(isSubmitted);
|
||||
}}
|
||||
onDismiss={onDismiss}
|
||||
/>
|
||||
);
|
||||
case 'uploadLicense':
|
||||
return (
|
||||
<UploadLicenseDialog
|
||||
goToLoading={() => setCurrentStep('loading')}
|
||||
onDismiss={onDismiss}
|
||||
goToGetLicense={() => setCurrentStep('getLicense')}
|
||||
isGetLicenseSubmitted={isGetLicenseSubmitted}
|
||||
/>
|
||||
);
|
||||
case 'loading':
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue