mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-07 13:27:46 +00:00
feat: resolving rebase conflicts
This commit is contained in:
@@ -13,7 +13,7 @@ import { TPermissionServiceFactory } from "../permission/permission-service-type
|
|||||||
import { TCreateSubOrgDTO, TListSubOrgDTO } from "./sub-org-types";
|
import { TCreateSubOrgDTO, TListSubOrgDTO } from "./sub-org-types";
|
||||||
|
|
||||||
type TSubOrgServiceFactoryDep = {
|
type TSubOrgServiceFactoryDep = {
|
||||||
orgDAL: Pick<TOrgDALFactory, "find" | "create" | "transaction" | "listSubOrganizations">;
|
orgDAL: Pick<TOrgDALFactory, "findOne" | "create" | "transaction" | "listSubOrganizations">;
|
||||||
permissionService: Pick<TPermissionServiceFactory, "getOrgPermission">;
|
permissionService: Pick<TPermissionServiceFactory, "getOrgPermission">;
|
||||||
licenseService: Pick<TLicenseServiceFactory, "getPlan">;
|
licenseService: Pick<TLicenseServiceFactory, "getPlan">;
|
||||||
membershipDAL: Pick<TMembershipDALFactory, "create">;
|
membershipDAL: Pick<TMembershipDALFactory, "create">;
|
||||||
@@ -51,7 +51,7 @@ export const subOrgServiceFactory = ({
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const existingSubOrg = await orgDAL.find({
|
const existingSubOrg = await orgDAL.findOne({
|
||||||
parentOrgId: permissionActor.orgId,
|
parentOrgId: permissionActor.orgId,
|
||||||
name
|
name
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
import { TemporaryPermissionMode } from "@app/db/schemas";
|
export enum TemporaryPermissionMode {
|
||||||
|
Relative = "relative"
|
||||||
|
}
|
||||||
|
|
||||||
export type TOrgIdentityMembership = {
|
export type TOrgIdentityMembership = {
|
||||||
id: string;
|
id: string;
|
||||||
|
|||||||
@@ -49,7 +49,13 @@ import { envConfig } from "@app/config/env";
|
|||||||
import { useOrganization, useSubscription, useUser } from "@app/context";
|
import { useOrganization, useSubscription, useUser } from "@app/context";
|
||||||
import { isInfisicalCloud } from "@app/helpers/platform";
|
import { isInfisicalCloud } from "@app/helpers/platform";
|
||||||
import { useToggle } from "@app/hooks";
|
import { useToggle } from "@app/hooks";
|
||||||
import { projectKeys, subOrganizationsQuery, useGetOrganizations, useGetOrgTrialUrl, useLogoutUser } from "@app/hooks/api";
|
import {
|
||||||
|
projectKeys,
|
||||||
|
subOrganizationsQuery,
|
||||||
|
useGetOrganizations,
|
||||||
|
useGetOrgTrialUrl,
|
||||||
|
useLogoutUser
|
||||||
|
} from "@app/hooks/api";
|
||||||
import { authKeys, selectOrganization } from "@app/hooks/api/auth/queries";
|
import { authKeys, selectOrganization } from "@app/hooks/api/auth/queries";
|
||||||
import { MfaMethod } from "@app/hooks/api/auth/types";
|
import { MfaMethod } from "@app/hooks/api/auth/types";
|
||||||
import { getAuthToken } from "@app/hooks/api/reactQuery";
|
import { getAuthToken } from "@app/hooks/api/reactQuery";
|
||||||
@@ -297,6 +303,75 @@ export const Navbar = () => {
|
|||||||
className="mt-6 cursor-default p-1 shadow-mineshaft-600 drop-shadow-md"
|
className="mt-6 cursor-default p-1 shadow-mineshaft-600 drop-shadow-md"
|
||||||
style={{ minWidth: "220px" }}
|
style={{ minWidth: "220px" }}
|
||||||
>
|
>
|
||||||
|
{subscription?.subOrganization && (
|
||||||
|
<>
|
||||||
|
<DropdownSubMenu>
|
||||||
|
<DropdownSubMenuTrigger>
|
||||||
|
<Button
|
||||||
|
onClick={async () => {}}
|
||||||
|
variant="plain"
|
||||||
|
colorSchema="secondary"
|
||||||
|
size="xs"
|
||||||
|
className="flex w-full items-center justify-start p-0 font-normal"
|
||||||
|
leftIcon={<FontAwesomeIcon icon={faCubes} className="mr-3" />}
|
||||||
|
>
|
||||||
|
<div className="flex w-full max-w-[150px] items-center justify-between truncate">
|
||||||
|
Sub Organizations
|
||||||
|
</div>
|
||||||
|
</Button>
|
||||||
|
</DropdownSubMenuTrigger>
|
||||||
|
<DropdownSubMenuContent
|
||||||
|
alignOffset={-30}
|
||||||
|
sideOffset={5}
|
||||||
|
className="mt-6 cursor-default p-1 shadow-mineshaft-600 drop-shadow-md"
|
||||||
|
style={{ minWidth: "220px" }}
|
||||||
|
>
|
||||||
|
<DropdownMenuItem
|
||||||
|
icon={<FontAwesomeIcon icon={faPlus} />}
|
||||||
|
onClick={() => setShowSubOrgForm(true)}
|
||||||
|
>
|
||||||
|
New Sub Organization
|
||||||
|
</DropdownMenuItem>
|
||||||
|
{Boolean(subOrganizations.length) && (
|
||||||
|
<div className="mt-1 h-1 border-t border-mineshaft-600" />
|
||||||
|
)}
|
||||||
|
{subOrganizations?.map((org) => {
|
||||||
|
return (
|
||||||
|
<DropdownMenuItem key={org.id}>
|
||||||
|
<Button
|
||||||
|
variant="plain"
|
||||||
|
colorSchema="secondary"
|
||||||
|
size="xs"
|
||||||
|
className="flex w-full items-center justify-start p-0 font-normal"
|
||||||
|
leftIcon={
|
||||||
|
currentOrg?.id === org.id && (
|
||||||
|
<FontAwesomeIcon
|
||||||
|
icon={faCheck}
|
||||||
|
className="mr-3 text-primary"
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
onClick={async () => {
|
||||||
|
navigate({
|
||||||
|
to: "/organization/projects",
|
||||||
|
search: (prev) => ({ ...prev, subOrganization: org.name })
|
||||||
|
});
|
||||||
|
queryClient.clear();
|
||||||
|
await router.invalidate({ sync: true }).catch(() => null);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<div className="flex w-full max-w-[150px] items-center justify-between truncate">
|
||||||
|
{org.name}
|
||||||
|
</div>
|
||||||
|
</Button>
|
||||||
|
</DropdownMenuItem>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</DropdownSubMenuContent>
|
||||||
|
</DropdownSubMenu>
|
||||||
|
<div className="mt-1 h-1 border-t border-mineshaft-600" />
|
||||||
|
</>
|
||||||
|
)}
|
||||||
<div className="px-2 py-1 text-xs text-mineshaft-400 capitalize">
|
<div className="px-2 py-1 text-xs text-mineshaft-400 capitalize">
|
||||||
organizations
|
organizations
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -4,12 +4,14 @@ import { motion } from "framer-motion";
|
|||||||
import { CreateOrgModal } from "@app/components/organization/CreateOrgModal";
|
import { CreateOrgModal } from "@app/components/organization/CreateOrgModal";
|
||||||
import { Tab, TabList, Tabs } from "@app/components/v2";
|
import { Tab, TabList, Tabs } from "@app/components/v2";
|
||||||
import { usePopUp } from "@app/hooks";
|
import { usePopUp } from "@app/hooks";
|
||||||
|
import { useOrganization } from "@app/context";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
isHidden?: boolean;
|
isHidden?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const OrgNavBar = ({ isHidden }: Props) => {
|
export const OrgNavBar = ({ isHidden }: Props) => {
|
||||||
|
const { isRootOrganization } = useOrganization();
|
||||||
const { popUp, handlePopUpToggle } = usePopUp(["createOrg"] as const);
|
const { popUp, handlePopUpToggle } = usePopUp(["createOrg"] as const);
|
||||||
|
|
||||||
const { pathname } = useLocation();
|
const { pathname } = useLocation();
|
||||||
@@ -80,13 +82,15 @@ export const OrgNavBar = ({ isHidden }: Props) => {
|
|||||||
</Tab>
|
</Tab>
|
||||||
)}
|
)}
|
||||||
</Link>
|
</Link>
|
||||||
<Link to="/organization/billing">
|
{isRootOrganization && (
|
||||||
{({ isActive }) => (
|
<Link to="/organization/billing">
|
||||||
<Tab variant="org" value={isActive ? "selected" : ""}>
|
{({ isActive }) => (
|
||||||
Usage & Billing
|
<Tab variant="org" value={isActive ? "selected" : ""}>
|
||||||
</Tab>
|
Usage & Billing
|
||||||
)}
|
</Tab>
|
||||||
</Link>
|
)}
|
||||||
|
</Link>
|
||||||
|
)}
|
||||||
<Link to="/organization/settings">
|
<Link to="/organization/settings">
|
||||||
{({ isActive }) => (
|
{({ isActive }) => (
|
||||||
<Tab variant="org" value={isActive ? "selected" : ""}>
|
<Tab variant="org" value={isActive ? "selected" : ""}>
|
||||||
|
|||||||
Reference in New Issue
Block a user