diff --git a/src/Pages/Shared/UpgradeToEnterprise/UpgradeToEnterpriseDialog.tsx b/src/Pages/Shared/UpgradeToEnterprise/UpgradeToEnterpriseDialog.tsx
new file mode 100644
index 0000000000..e8f27a0619
--- /dev/null
+++ b/src/Pages/Shared/UpgradeToEnterprise/UpgradeToEnterpriseDialog.tsx
@@ -0,0 +1,99 @@
+import {
+ Button,
+ ButtonComponentType,
+ ButtonStyleType,
+ ButtonVariantType,
+ ComponentSizeType,
+ CONTACT_SALES_LINK,
+ GenericModal,
+ Icon,
+} from '@devtron-labs/devtron-fe-common-lib'
+
+const ENTERPRISE_PLAN_OFFERINGS = [
+ 'Unlimited clusters',
+ 'Managed Devtron installation',
+ 'Priority support',
+ 'Contribute to our roadmap',
+ 'Early access to enterprise features & more…',
+]
+
+const UpgradeToEnterpriseDialog = ({ open, handleClose }: { open: boolean; handleClose: () => void }) => (
+
+
+
+
+
+
+ }
+ variant={ButtonVariantType.secondary}
+ style={ButtonStyleType.negativeGrey}
+ onClick={handleClose}
+ ariaLabel="close-upgrade-dialog"
+ showAriaLabelInTippy={false}
+ size={ComponentSizeType.medium}
+ />
+
+
+
Upgrade to Enterprise Plan
+
+
+ Freemium plan allows managing the Devtron host cluster along with one additional
+ cluster.
+
+ Switch to Enterprise plan to scale without limits.
+
+
+
+
+
+
What’s included
+
+ {ENTERPRISE_PLAN_OFFERINGS.map((description) => (
+
+
+ {description}
+
+ ))}
+
+
+
+
+
+ Unlock Devtron's Full Potential
+
+ Scale your infrastructure, accelerate your teams, and get the resources you need to
+ grow.
+
+
+
}
+ component={ButtonComponentType.anchor}
+ anchorProps={{
+ href: CONTACT_SALES_LINK,
+ }}
+ />
+
+
+
+
+
+)
+
+export default UpgradeToEnterpriseDialog
diff --git a/src/Pages/Shared/UpgradeToEnterprise/index.ts b/src/Pages/Shared/UpgradeToEnterprise/index.ts
new file mode 100644
index 0000000000..901be71fc1
--- /dev/null
+++ b/src/Pages/Shared/UpgradeToEnterprise/index.ts
@@ -0,0 +1 @@
+export { default as UpgradeToEnterpriseDialog } from './UpgradeToEnterpriseDialog'
diff --git a/src/components/CIPipelineN/Build.tsx b/src/components/CIPipelineN/Build.tsx
index 2230457a55..bc951302ff 100644
--- a/src/components/CIPipelineN/Build.tsx
+++ b/src/components/CIPipelineN/Build.tsx
@@ -55,12 +55,14 @@ export const Build = ({
...mat,
value: '',
regex: event.target.value,
+ gitURL: mat?.url,
}
}
return {
...mat,
regex: '',
value: event.target.value,
+ gitURL: mat?.url,
}
}
return mat
diff --git a/src/components/ClusterNodes/ClusterList/ClusterSelectionBody.tsx b/src/components/ClusterNodes/ClusterList/ClusterSelectionBody.tsx
index f3fe72409e..4af37d6f37 100644
--- a/src/components/ClusterNodes/ClusterList/ClusterSelectionBody.tsx
+++ b/src/components/ClusterNodes/ClusterList/ClusterSelectionBody.tsx
@@ -78,7 +78,7 @@ const ClusterSelectionBody: React.FC
= ({
image={NoClusterEmptyState}
title="No clusters found"
subTitle="Add a cluster to view and debug Kubernetes resources in the cluster"
- renderButton={renderNewClusterButton(refreshData)}
+ renderButton={renderNewClusterButton(refreshData, 0)}
/>
)
}
diff --git a/src/components/ResourceBrowser/PageHeader.buttons.tsx b/src/components/ResourceBrowser/PageHeader.buttons.tsx
index 6a0ccb2e69..58918308f8 100644
--- a/src/components/ResourceBrowser/PageHeader.buttons.tsx
+++ b/src/components/ResourceBrowser/PageHeader.buttons.tsx
@@ -30,6 +30,7 @@ import {
CreateClusterProps,
CreateClusterTypeEnum,
} from '@Pages/GlobalConfigurations/ClustersAndEnvironments/CreateCluster/types'
+import { UpgradeToEnterpriseDialog } from '@Pages/Shared/UpgradeToEnterprise'
import { ReactComponent as Add } from '../../assets/icons/ic-add.svg'
import { URLS } from '../../config'
@@ -70,9 +71,24 @@ export const renderCreateResourceButton = (clusterId: string, callback: CreateRe
)
-export const NewClusterButton = ({ handleReloadClusterList }: Pick) => {
+export const NewClusterButton = ({
+ handleReloadClusterList,
+ clusterCount,
+}: Pick & { clusterCount: number }) => {
const { replace } = useHistory()
- const { isSuperAdmin } = useMainContext()
+ const { isSuperAdmin, licenseData } = useMainContext()
+ const isFreemium = licenseData?.isFreemium ?? false
+ const isClusterAdditionAllowed = !isFreemium || clusterCount < licenseData?.moduleLimits?.maxAllowedClusters
+
+ const [showUpgradeToEnterprise, setShowUpgradeToEnterprise] = useState(false)
+
+ const handleOpenUpgradeDialog = () => {
+ setShowUpgradeToEnterprise(true)
+ }
+
+ const handleCloseUpgradeDialog = () => {
+ setShowUpgradeToEnterprise(false)
+ }
const handleCloseCreateClusterModal = () => {
replace(URLS.RESOURCE_BROWSER)
@@ -86,28 +102,39 @@ export const NewClusterButton = ({ handleReloadClusterList }: Pick}
- linkProps={{
- to: generatePath(URLS.RESOURCE_BROWSER_CREATE_CLUSTER, {
- type: CreateClusterTypeEnum.CONNECT_CLUSTER,
- }),
- }}
+ {...(isClusterAdditionAllowed
+ ? {
+ component: ButtonComponentType.link,
+ linkProps: {
+ to: generatePath(URLS.RESOURCE_BROWSER_CREATE_CLUSTER, {
+ type: CreateClusterTypeEnum.CONNECT_CLUSTER,
+ }),
+ },
+ }
+ : {
+ component: ButtonComponentType.button,
+ onClick: handleOpenUpgradeDialog,
+ })}
/>
-