2023-02-19 04:17:50 +00:00
|
|
|
import { useAnalytics } from '@/angulartics.matomo/analytics-services';
|
|
|
|
|
2023-01-19 13:31:49 +00:00
|
|
|
import { HubspotForm } from '@@/HubspotForm';
|
|
|
|
import { Modal } from '@@/modals/Modal';
|
|
|
|
|
|
|
|
export function GetLicenseDialog({
|
|
|
|
onDismiss,
|
|
|
|
goToUploadLicense,
|
|
|
|
}: {
|
|
|
|
onDismiss: () => void;
|
|
|
|
goToUploadLicense: (isSubmitted: boolean) => void;
|
|
|
|
}) {
|
|
|
|
// form is loaded from hubspot, so it won't have the same styling as the rest of the app
|
|
|
|
// since it won't support darkmode, we enforce a white background and black text for the components we use
|
|
|
|
// (Modal, CloseButton, loading text)
|
2023-02-19 04:17:50 +00:00
|
|
|
const { trackEvent } = useAnalytics();
|
2023-01-19 13:31:49 +00:00
|
|
|
|
|
|
|
return (
|
|
|
|
<Modal
|
|
|
|
onDismiss={onDismiss}
|
|
|
|
aria-label="Upgrade Portainer to Business Edition"
|
|
|
|
size="lg"
|
|
|
|
className="!bg-white [&>.close-button]:!text-black"
|
|
|
|
>
|
|
|
|
<Modal.Body>
|
|
|
|
<div className="max-h-[80vh] overflow-auto">
|
|
|
|
<HubspotForm
|
|
|
|
region="na1"
|
|
|
|
portalId="4731999"
|
|
|
|
formId="1ef8ea88-3e03-46c5-8aef-c1d9f48fd06b"
|
2023-02-19 04:17:50 +00:00
|
|
|
onSubmitted={() => {
|
|
|
|
trackEvent('portainer-upgrade-license-key-requested', {
|
|
|
|
category: 'portainer',
|
|
|
|
metadata: { 'Upgrade-key-requested': true },
|
|
|
|
});
|
|
|
|
|
|
|
|
goToUploadLicense(true);
|
|
|
|
}}
|
2023-01-19 13:31:49 +00:00
|
|
|
loading={<div className="text-black">Loading...</div>}
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</Modal.Body>
|
|
|
|
</Modal>
|
|
|
|
);
|
|
|
|
}
|