mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-14 14:34:09 +00:00
Merge branch 'ENG-2635' of https://github.com/Infisical/infisical into ENG-2635
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { faMobile } from "@fortawesome/free-solid-svg-icons";
|
||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||
import { Link, Outlet, useRouterState } from "@tanstack/react-router";
|
||||
import { Link, Outlet, useNavigate, useRouterState } from "@tanstack/react-router";
|
||||
import { motion } from "framer-motion";
|
||||
|
||||
import { UpgradePlanModal } from "@app/components/license/UpgradePlanModal";
|
||||
import {
|
||||
BreadcrumbContainer,
|
||||
Menu,
|
||||
@@ -31,6 +32,19 @@ export const ProjectLayout = () => {
|
||||
const { t } = useTranslation();
|
||||
const workspaceId = currentWorkspace?.id || "";
|
||||
const projectSlug = currentWorkspace?.slug || "";
|
||||
const { subscription } = useSubscription();
|
||||
const navigate = useNavigate();
|
||||
const hasIdentityLimitCrossed =
|
||||
subscription?.identityLimit && subscription?.identitiesUsed > subscription.identityLimit + 10;
|
||||
const hasUserLimitCrossed =
|
||||
subscription?.memberLimit && subscription?.membersUsed > subscription.memberLimit + 10;
|
||||
const shouldUpgrade = Boolean(hasUserLimitCrossed || hasIdentityLimitCrossed);
|
||||
let upgradeText = "";
|
||||
if (hasUserLimitCrossed) {
|
||||
upgradeText = `You've reached the maximum number of organisation users (${subscription?.memberLimit}).`;
|
||||
} else if (hasIdentityLimitCrossed) {
|
||||
upgradeText = `You've reached the maximum number of organisation identities (${subscription?.identityLimit}).`;
|
||||
}
|
||||
|
||||
const isSecretManager = currentWorkspace?.type === ProjectType.SecretManager;
|
||||
const isCertManager = currentWorkspace?.type === ProjectType.CertificateManager;
|
||||
@@ -47,7 +61,6 @@ export const ProjectLayout = () => {
|
||||
});
|
||||
|
||||
// we only show the secret rotations v1 tab if they have existing rotations
|
||||
const { subscription } = useSubscription();
|
||||
const { data: secretRotations } = useGetSecretRotations({
|
||||
workspaceId,
|
||||
options: {
|
||||
@@ -297,6 +310,17 @@ export const ProjectLayout = () => {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{shouldUpgrade && (
|
||||
<UpgradePlanModal
|
||||
isOpen={shouldUpgrade}
|
||||
text={upgradeText}
|
||||
onOpenChange={(isOpen) => {
|
||||
if (!isOpen) {
|
||||
navigate({ to: "/organization/access-management" });
|
||||
}
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
<div className="z-[200] flex h-screen w-screen flex-col items-center justify-center bg-bunker-800 md:hidden">
|
||||
<FontAwesomeIcon icon={faMobile} className="mb-8 text-7xl text-gray-300" />
|
||||
<p className="max-w-sm px-6 text-center text-lg text-gray-200">
|
||||
|
||||
@@ -45,6 +45,7 @@ export const OrgAuthTab = withPermission(
|
||||
const { data: samlConfig, isPending: isLoadingSamlConfig } = useGetSSOConfig(
|
||||
currentOrg?.id ?? ""
|
||||
);
|
||||
|
||||
const { data: ldapConfig, isPending: isLoadingLdapConfig } = useGetLDAPConfig(
|
||||
currentOrg?.id ?? ""
|
||||
);
|
||||
@@ -54,7 +55,8 @@ export const OrgAuthTab = withPermission(
|
||||
!enabledLoginMethods || enabledLoginMethods.includes(method);
|
||||
|
||||
const isOidcConfigured = oidcConfig && (oidcConfig.discoveryURL || oidcConfig.issuer);
|
||||
const isSamlConfigured = samlConfig && samlConfig.entryPoint;
|
||||
const isSamlConfigured =
|
||||
samlConfig && (samlConfig.entryPoint || samlConfig.issuer || samlConfig.cert);
|
||||
const isLdapConfigured = ldapConfig && ldapConfig.url;
|
||||
|
||||
const shouldShowCreateIdentityProviderView =
|
||||
|
||||
@@ -63,7 +63,7 @@ const ssoAuthProviders = [
|
||||
const schema = z
|
||||
.object({
|
||||
authProvider: z.string().min(1, "SSO Type is required"),
|
||||
entryPoint: z.string().default(""),
|
||||
entryPoint: z.string().min(1, "Entry Point is required").default(""),
|
||||
issuer: z.string().default(""),
|
||||
cert: z.string().default("")
|
||||
})
|
||||
@@ -301,6 +301,7 @@ export const SSOModal = ({ popUp, handlePopUpClose, handlePopUpToggle, hideDelet
|
||||
label={renderLabels(authProvider).entryPoint}
|
||||
errorText={error?.message}
|
||||
isError={Boolean(error)}
|
||||
isRequired
|
||||
>
|
||||
<Input
|
||||
{...field}
|
||||
|
||||
+5
-1
@@ -252,8 +252,12 @@ export const SecretDetailSidebar = ({
|
||||
switch (userType) {
|
||||
case ActorType.PLATFORM:
|
||||
return "System-generated";
|
||||
case ActorType.IDENTITY:
|
||||
return userName || "Deleted Identity";
|
||||
case ActorType.USER:
|
||||
return userName || "Deleted User";
|
||||
default:
|
||||
return userName;
|
||||
return "Unknown";
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user