mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
Merge pull request #687 from Infisical/paywalls
Add paywall for PIT and redirect paywall to contact sales in self-hosted
This commit is contained in:
@@ -55,7 +55,7 @@ class EELicenseService {
|
|||||||
environmentLimit: null,
|
environmentLimit: null,
|
||||||
environmentsUsed: 0,
|
environmentsUsed: 0,
|
||||||
secretVersioning: true,
|
secretVersioning: true,
|
||||||
pitRecovery: true,
|
pitRecovery: false,
|
||||||
rbac: true,
|
rbac: true,
|
||||||
customRateLimits: true,
|
customRateLimits: true,
|
||||||
customAlerts: true,
|
customAlerts: true,
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
|
|
||||||
|
import { useSubscription } from "@app/context";
|
||||||
|
|
||||||
import { Button } from "../Button";
|
import { Button } from "../Button";
|
||||||
import { Modal, ModalClose, ModalContent } from "../Modal";
|
import { Modal, ModalClose, ModalContent } from "../Modal";
|
||||||
|
|
||||||
@@ -9,28 +11,35 @@ type Props = {
|
|||||||
text: string;
|
text: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const UpgradePlanModal = ({ text, isOpen, onOpenChange }: Props): JSX.Element => (
|
export const UpgradePlanModal = ({ text, isOpen, onOpenChange }: Props): JSX.Element => {
|
||||||
<Modal isOpen={isOpen} onOpenChange={onOpenChange}>
|
const { subscription } = useSubscription();
|
||||||
<ModalContent
|
const link = (subscription && subscription.slug !== null)
|
||||||
title="Unleash Infisical's Full Power"
|
? `/settings/billing/${localStorage.getItem("projectData.id") as string}`
|
||||||
footerContent={[
|
: "https://infisical.com/scheduledemo";
|
||||||
<Link
|
|
||||||
href={`/settings/billing/${localStorage.getItem("projectData.id") as string}`}
|
return (
|
||||||
key="upgrade-plan"
|
<Modal isOpen={isOpen} onOpenChange={onOpenChange}>
|
||||||
>
|
<ModalContent
|
||||||
<Button className="mr-4 ml-2 mb-2">Upgrade Plan</Button>
|
title="Unleash Infisical's Full Power"
|
||||||
</Link>,
|
footerContent={[
|
||||||
<ModalClose asChild key="upgrade-plan-cancel">
|
<Link
|
||||||
<Button colorSchema="secondary" variant="plain">
|
href={link}
|
||||||
Cancel
|
key="upgrade-plan"
|
||||||
</Button>
|
>
|
||||||
</ModalClose>
|
<Button className="mr-4 ml-2 mb-2">Upgrade Plan</Button>
|
||||||
]}
|
</Link>,
|
||||||
>
|
<ModalClose asChild key="upgrade-plan-cancel">
|
||||||
<p className="mb-2 text-bunker-300">{text}</p>
|
<Button colorSchema="secondary" variant="plain">
|
||||||
<p className="text-bunker-300">
|
Cancel
|
||||||
Upgrade and get access to this, as well as to other powerful enhancements.
|
</Button>
|
||||||
</p>
|
</ModalClose>
|
||||||
</ModalContent>
|
]}
|
||||||
</Modal>
|
>
|
||||||
);
|
<p className="mb-2 text-bunker-300">{text}</p>
|
||||||
|
<p className="text-bunker-300">
|
||||||
|
Upgrade and get access to this, as well as to other powerful enhancements.
|
||||||
|
</p>
|
||||||
|
</ModalContent>
|
||||||
|
</Modal>
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -184,11 +184,13 @@ export default function Activity() {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<UpgradePlanModal
|
{subscription && (
|
||||||
isOpen={popUp.upgradePlan.isOpen}
|
<UpgradePlanModal
|
||||||
onOpenChange={() => handlePopUpClose("upgradePlan")}
|
isOpen={popUp.upgradePlan.isOpen}
|
||||||
text="You can see more logs if you switch to Infisical's Business/Professional Plan."
|
onOpenChange={() => handlePopUpClose("upgradePlan")}
|
||||||
/>
|
text={subscription.slug === null ? "You can see more logs under an Enterprise license" : "You can see more logs if you switch to Infisical's Business/Professional Plan."}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,10 +32,11 @@ import {
|
|||||||
PopoverTrigger,
|
PopoverTrigger,
|
||||||
TableContainer,
|
TableContainer,
|
||||||
Tag,
|
Tag,
|
||||||
Tooltip
|
Tooltip,
|
||||||
|
UpgradePlanModal
|
||||||
} from "@app/components/v2";
|
} from "@app/components/v2";
|
||||||
import { leaveConfirmDefaultMessage } from "@app/const";
|
import { leaveConfirmDefaultMessage } from "@app/const";
|
||||||
import { useWorkspace } from "@app/context";
|
import { useSubscription,useWorkspace } from "@app/context";
|
||||||
import { useLeaveConfirm, usePopUp, useToggle } from "@app/hooks";
|
import { useLeaveConfirm, usePopUp, useToggle } from "@app/hooks";
|
||||||
import {
|
import {
|
||||||
useBatchSecretsOp,
|
useBatchSecretsOp,
|
||||||
@@ -97,6 +98,7 @@ const USER_ACTION_PUSH = "first_time_secrets_pushed";
|
|||||||
* They will get it back
|
* They will get it back
|
||||||
*/
|
*/
|
||||||
export const DashboardPage = ({ envFromTop }: { envFromTop: string }) => {
|
export const DashboardPage = ({ envFromTop }: { envFromTop: string }) => {
|
||||||
|
const { subscription } = useSubscription();
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { createNotification } = useNotificationContext();
|
const { createNotification } = useNotificationContext();
|
||||||
@@ -110,7 +112,8 @@ export const DashboardPage = ({ envFromTop }: { envFromTop: string }) => {
|
|||||||
"uploadedSecOpts",
|
"uploadedSecOpts",
|
||||||
"compareSecrets",
|
"compareSecrets",
|
||||||
"folderForm",
|
"folderForm",
|
||||||
"deleteFolder"
|
"deleteFolder",
|
||||||
|
"upgradePlan"
|
||||||
] as const);
|
] as const);
|
||||||
const [isSecretValueHidden, setIsSecretValueHidden] = useToggle(true);
|
const [isSecretValueHidden, setIsSecretValueHidden] = useToggle(true);
|
||||||
const [searchFilter, setSearchFilter] = useState("");
|
const [searchFilter, setSearchFilter] = useState("");
|
||||||
@@ -624,7 +627,14 @@ export const DashboardPage = ({ envFromTop }: { envFromTop: string }) => {
|
|||||||
<div className="hidden xl:block">
|
<div className="hidden xl:block">
|
||||||
<Button
|
<Button
|
||||||
variant="outline_bg"
|
variant="outline_bg"
|
||||||
onClick={() => handlePopUpOpen("secretSnapshots")}
|
onClick={() => {
|
||||||
|
if (subscription && subscription.pitRecovery) {
|
||||||
|
handlePopUpOpen("secretSnapshots");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
handlePopUpOpen("upgradePlan");
|
||||||
|
}}
|
||||||
leftIcon={<FontAwesomeIcon icon={faCodeCommit} />}
|
leftIcon={<FontAwesomeIcon icon={faCodeCommit} />}
|
||||||
isLoading={isLoadingSnapshotCount}
|
isLoading={isLoadingSnapshotCount}
|
||||||
isDisabled={!canDoRollback}
|
isDisabled={!canDoRollback}
|
||||||
@@ -886,6 +896,13 @@ export const DashboardPage = ({ envFromTop }: { envFromTop: string }) => {
|
|||||||
</ModalContent>
|
</ModalContent>
|
||||||
</Modal>
|
</Modal>
|
||||||
</FormProvider>
|
</FormProvider>
|
||||||
|
{subscription && (
|
||||||
|
<UpgradePlanModal
|
||||||
|
isOpen={popUp.upgradePlan.isOpen}
|
||||||
|
onOpenChange={(isOpen) => handlePopUpToggle("upgradePlan", isOpen)}
|
||||||
|
text={subscription.slug === null ? "You can perform point-in-time recovery under an Enterprise license" : "You can perform point-in-time recovery if you switch to Infisical's Team plan"}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -31,8 +31,6 @@ import {
|
|||||||
} from "./components";
|
} from "./components";
|
||||||
|
|
||||||
export const OrgSettingsPage = () => {
|
export const OrgSettingsPage = () => {
|
||||||
const host = window.location.origin;
|
|
||||||
|
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { currentOrg } = useOrganization();
|
const { currentOrg } = useOrganization();
|
||||||
const { currentWorkspace } = useWorkspace();
|
const { currentWorkspace } = useWorkspace();
|
||||||
|
|||||||
Reference in New Issue
Block a user