mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
resolve rebase
This commit is contained in:
@@ -10,7 +10,7 @@ import { withProjectPermission } from "@app/hoc";
|
||||
import { useGetWorkspaceIdentityMembershipDetails } from "@app/hooks/api";
|
||||
|
||||
import { IdentityProjectAdditionalPrivilegeSection } from "./components/IdentityProjectAdditionalPrivilegeSection";
|
||||
import { IdentityRoleDetailsSection } from "./components/IdentityRoleDetailsSectiona";
|
||||
import { IdentityRoleDetailsSection } from "./components/IdentityRoleDetailsSection";
|
||||
|
||||
export const IdentityDetailsPage = withProjectPermission(
|
||||
() => {
|
||||
|
||||
@@ -167,7 +167,7 @@ export const IdentityProjectAdditionalPrivilegeModifySection = ({
|
||||
onGoBack();
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
createNotification({ type: "error", text: "Failed to update role" });
|
||||
createNotification({ type: "error", text: "Failed to update privilege" });
|
||||
}
|
||||
};
|
||||
|
||||
@@ -177,7 +177,7 @@ export const IdentityProjectAdditionalPrivilegeModifySection = ({
|
||||
privilegeTemporaryAccess?.isTemporary &&
|
||||
new Date() > new Date(privilegeTemporaryAccess.temporaryAccessEndTime || "");
|
||||
let text = "Permanent";
|
||||
let toolTipText = "Non expiry access";
|
||||
let toolTipText = "Non-Expiring Access";
|
||||
|
||||
if (isTemporary) {
|
||||
if (isExpired) {
|
||||
@@ -206,7 +206,14 @@ export const IdentityProjectAdditionalPrivilegeModifySection = ({
|
||||
<IconButton ariaLabel="go-back" variant="plain" onClick={onGoBack}>
|
||||
<FontAwesomeIcon icon={faChevronLeft} />
|
||||
</IconButton>
|
||||
<h3 className="text-lg font-semibold text-mineshaft-100">Edit Additional Privilege</h3>
|
||||
<div>
|
||||
<h3 className="text-lg font-semibold text-mineshaft-100">
|
||||
Edit Additional Privileges
|
||||
</h3>
|
||||
<p className="text-sm text-mineshaft-400">
|
||||
Additional privileges take precedence over roles when permissions conflict
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex items-center space-x-4">
|
||||
{isDirty && (
|
||||
@@ -242,7 +249,7 @@ export const IdentityProjectAdditionalPrivilegeModifySection = ({
|
||||
leftIcon={<FontAwesomeIcon icon={faPlus} />}
|
||||
isDisabled={isDisabled}
|
||||
>
|
||||
New policy
|
||||
New Policy
|
||||
</Button>
|
||||
</ModalTrigger>
|
||||
<ModalContent title="New Policy" subTitle="Policies grant additional permissions.">
|
||||
@@ -297,7 +304,7 @@ export const IdentityProjectAdditionalPrivilegeModifySection = ({
|
||||
>
|
||||
<div className="flex flex-col space-y-4">
|
||||
<div className="border-b border-b-gray-700 pb-2 text-sm text-mineshaft-300">
|
||||
Configure timed access
|
||||
Configure Timed Access
|
||||
</div>
|
||||
{isExpired && <Tag colorSchema="red">Expired</Tag>}
|
||||
<Controller
|
||||
|
||||
@@ -61,7 +61,7 @@ export const IdentityProjectAdditionalPrivilegeSection = ({ identityMembershipDe
|
||||
handlePopUpClose("deletePrivilege");
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
createNotification({ type: "error", text: "Failed to delete role" });
|
||||
createNotification({ type: "error", text: "Failed to delete privilege" });
|
||||
}
|
||||
};
|
||||
|
||||
@@ -105,7 +105,7 @@ export const IdentityProjectAdditionalPrivilegeSection = ({ identityMembershipDe
|
||||
I={ProjectPermissionActions.Edit}
|
||||
a={ProjectPermissionSub.Identity}
|
||||
renderTooltip
|
||||
allowedLabel="New privilege"
|
||||
allowedLabel="Add Privilege"
|
||||
>
|
||||
{(isAllowed) => (
|
||||
<IconButton
|
||||
@@ -144,7 +144,7 @@ export const IdentityProjectAdditionalPrivilegeSection = ({ identityMembershipDe
|
||||
new Date() > new Date(privilegeDetails.temporaryAccessEndTime || "");
|
||||
|
||||
let text = "Permanent";
|
||||
let toolTipText = "Non expiry access";
|
||||
let toolTipText = "Non-Expiring Access";
|
||||
if (privilegeDetails.isTemporary) {
|
||||
if (isExpired) {
|
||||
text = "Access Expired";
|
||||
@@ -194,7 +194,7 @@ export const IdentityProjectAdditionalPrivilegeSection = ({ identityMembershipDe
|
||||
I={ProjectPermissionActions.Edit}
|
||||
a={ProjectPermissionSub.Identity}
|
||||
renderTooltip
|
||||
allowedLabel="Remove role"
|
||||
allowedLabel="Remove Role"
|
||||
>
|
||||
{(isAllowed) => (
|
||||
<IconButton
|
||||
@@ -227,7 +227,7 @@ export const IdentityProjectAdditionalPrivilegeSection = ({ identityMembershipDe
|
||||
</TBody>
|
||||
</Table>
|
||||
{!isLoading && !userProjectPrivileges?.length && (
|
||||
<EmptyState title="This user has no additional privileges" icon={faFolder} />
|
||||
<EmptyState title="This identity has no additional privileges" icon={faFolder} />
|
||||
)}
|
||||
</TableContainer>
|
||||
</div>
|
||||
|
||||
@@ -56,7 +56,7 @@ export const IdentityRoleDetailsSection = ({
|
||||
identityId: identityMembershipDetails.identity.id,
|
||||
roles: updatedRole
|
||||
});
|
||||
createNotification({ type: "success", text: "Successfully removed the role" });
|
||||
createNotification({ type: "success", text: "Successfully removed role" });
|
||||
handlePopUpClose("deleteRole");
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
@@ -111,7 +111,7 @@ export const IdentityRoleDetailsSection = ({
|
||||
new Date() > new Date(roleDetails.temporaryAccessEndTime || "");
|
||||
|
||||
let text = "Permanent";
|
||||
let toolTipText = "Non expiry access";
|
||||
let toolTipText = "Non-Expiring Access";
|
||||
if (roleDetails.isTemporary) {
|
||||
if (isExpired) {
|
||||
text = "Access Expired";
|
||||
@@ -154,7 +154,7 @@ export const IdentityRoleDetailsSection = ({
|
||||
I={ProjectPermissionActions.Edit}
|
||||
a={ProjectPermissionSub.Member}
|
||||
renderTooltip
|
||||
allowedLabel="Remove role"
|
||||
allowedLabel="Remove Role"
|
||||
>
|
||||
{(isAllowed) => (
|
||||
<IconButton
|
||||
@@ -198,7 +198,10 @@ export const IdentityRoleDetailsSection = ({
|
||||
isOpen={popUp.modifyRole.isOpen}
|
||||
onOpenChange={(isOpen) => handlePopUpToggle("modifyRole", isOpen)}
|
||||
>
|
||||
<ModalContent title="Roles" subTitle="Select one of the pre-defined or custom roles.">
|
||||
<ModalContent
|
||||
title="Roles"
|
||||
subTitle="Select one or more of the pre-defined or custom roles to configure project permissions."
|
||||
>
|
||||
<IdentityRoleModify identityProjectMembership={identityMembershipDetails} />
|
||||
</ModalContent>
|
||||
</Modal>
|
||||
@@ -122,7 +122,7 @@ export const IdentityRoleModify = ({ identityProjectMembership }: Props) => {
|
||||
});
|
||||
createNotification({ text: "Successfully updated roles", type: "success" });
|
||||
} catch (err) {
|
||||
createNotification({ text: "Failed to update role", type: "error" });
|
||||
createNotification({ text: "Failed to update roles", type: "error" });
|
||||
}
|
||||
};
|
||||
|
||||
@@ -177,7 +177,7 @@ export const IdentityRoleModify = ({ identityProjectMembership }: Props) => {
|
||||
new Date(temporaryAccess.temporaryAccessEndTime || ""),
|
||||
"yyyy-MM-dd HH:mm:ss"
|
||||
)}`
|
||||
: "Non expiry access"
|
||||
: "Non-Expiring Access"
|
||||
}
|
||||
>
|
||||
<Button
|
||||
@@ -212,7 +212,7 @@ export const IdentityRoleModify = ({ identityProjectMembership }: Props) => {
|
||||
>
|
||||
<div className="flex flex-col space-y-4">
|
||||
<div className="border-b border-b-gray-700 pb-2 text-sm text-mineshaft-300">
|
||||
Configure timed access
|
||||
Configure Timed Access
|
||||
</div>
|
||||
{isExpired && <Tag colorSchema="red">Expired</Tag>}
|
||||
<Controller
|
||||
@@ -283,7 +283,7 @@ export const IdentityRoleModify = ({ identityProjectMembership }: Props) => {
|
||||
variant="outline_bg"
|
||||
className="border border-mineshaft-500 bg-mineshaft-600 py-3 hover:border-red/70 hover:bg-red/20"
|
||||
ariaLabel="delete-role"
|
||||
isDisabled={isIdentityEditDisabled}
|
||||
isDisabled={isIdentityEditDisabled || selectedRoleList.fields.length === 1}
|
||||
onClick={() => {
|
||||
if (selectedRoleList.fields.length > 1) {
|
||||
selectedRoleList.remove(index);
|
||||
@@ -297,7 +297,7 @@ export const IdentityRoleModify = ({ identityProjectMembership }: Props) => {
|
||||
})}
|
||||
</div>
|
||||
<div className="mt-4 flex justify-between space-x-2">
|
||||
<ProjectPermissionCan I={ProjectPermissionActions.Edit} a={ProjectPermissionSub.Member}>
|
||||
<ProjectPermissionCan I={ProjectPermissionActions.Edit} a={ProjectPermissionSub.Identity}>
|
||||
{(isAllowed) => (
|
||||
<Button
|
||||
variant="outline_bg"
|
||||
@@ -68,7 +68,7 @@ export const MemberProjectAdditionalPrivilegeSection = ({ membershipDetails }: P
|
||||
handlePopUpClose("deletePrivilege");
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
createNotification({ type: "error", text: "Failed to delete role" });
|
||||
createNotification({ type: "error", text: "Failed to delete privilege" });
|
||||
}
|
||||
};
|
||||
|
||||
@@ -113,7 +113,7 @@ export const MemberProjectAdditionalPrivilegeSection = ({ membershipDetails }: P
|
||||
I={ProjectPermissionActions.Edit}
|
||||
a={ProjectPermissionSub.Member}
|
||||
renderTooltip
|
||||
allowedLabel="New privilege"
|
||||
allowedLabel="Add Privilege"
|
||||
>
|
||||
{(isAllowed) => (
|
||||
<IconButton
|
||||
@@ -151,7 +151,7 @@ export const MemberProjectAdditionalPrivilegeSection = ({ membershipDetails }: P
|
||||
new Date() > new Date(privilegeDetails.temporaryAccessEndTime || "");
|
||||
|
||||
let text = "Permanent";
|
||||
let toolTipText = "Non expiry access";
|
||||
let toolTipText = "Non-Expiring Access";
|
||||
if (privilegeDetails.isTemporary) {
|
||||
if (isExpired) {
|
||||
text = "Access Expired";
|
||||
@@ -201,7 +201,7 @@ export const MemberProjectAdditionalPrivilegeSection = ({ membershipDetails }: P
|
||||
I={ProjectPermissionActions.Edit}
|
||||
a={ProjectPermissionSub.Member}
|
||||
renderTooltip
|
||||
allowedLabel="Remove role"
|
||||
allowedLabel="Remove Role"
|
||||
>
|
||||
{(isAllowed) => (
|
||||
<IconButton
|
||||
|
||||
@@ -175,7 +175,7 @@ export const MembershipProjectAdditionalPrivilegeModifySection = ({
|
||||
privilegeTemporaryAccess?.isTemporary &&
|
||||
new Date() > new Date(privilegeTemporaryAccess.temporaryAccessEndTime || "");
|
||||
let text = "Permanent";
|
||||
let toolTipText = "Non expiry access";
|
||||
let toolTipText = "Non-Expiring Access";
|
||||
|
||||
if (isTemporary) {
|
||||
if (isExpired) {
|
||||
@@ -240,7 +240,7 @@ export const MembershipProjectAdditionalPrivilegeModifySection = ({
|
||||
leftIcon={<FontAwesomeIcon icon={faPlus} />}
|
||||
isDisabled={isDisabled}
|
||||
>
|
||||
New policy
|
||||
New Policy
|
||||
</Button>
|
||||
</ModalTrigger>
|
||||
<ModalContent title="New Policy" subTitle="Policies grant additional permissions.">
|
||||
@@ -295,7 +295,7 @@ export const MembershipProjectAdditionalPrivilegeModifySection = ({
|
||||
>
|
||||
<div className="flex flex-col space-y-4">
|
||||
<div className="border-b border-b-gray-700 pb-2 text-sm text-mineshaft-300">
|
||||
Configure timed access
|
||||
Configure Timed Access
|
||||
</div>
|
||||
{isExpired && <Tag colorSchema="red">Expired</Tag>}
|
||||
<Controller
|
||||
|
||||
@@ -65,7 +65,7 @@ export const MemberRoleDetailsSection = ({
|
||||
roles: updatedRole,
|
||||
membershipId: membershipDetails.id
|
||||
});
|
||||
createNotification({ type: "success", text: "Successfully removed the role" });
|
||||
createNotification({ type: "success", text: "Successfully removed role" });
|
||||
handlePopUpClose("deleteRole");
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
@@ -82,7 +82,7 @@ export const MemberRoleDetailsSection = ({
|
||||
I={ProjectPermissionActions.Edit}
|
||||
a={ProjectPermissionSub.Member}
|
||||
renderTooltip
|
||||
allowedLabel="Edit role(s)"
|
||||
allowedLabel="Edit Role(s)"
|
||||
>
|
||||
{(isAllowed) => (
|
||||
<IconButton
|
||||
@@ -122,7 +122,7 @@ export const MemberRoleDetailsSection = ({
|
||||
new Date() > new Date(roleDetails.temporaryAccessEndTime || "");
|
||||
|
||||
let text = "Permanent";
|
||||
let toolTipText = "Non expiry access";
|
||||
let toolTipText = "Non-Expiring Access";
|
||||
if (roleDetails.isTemporary) {
|
||||
if (isExpired) {
|
||||
text = "Access Expired";
|
||||
@@ -165,7 +165,7 @@ export const MemberRoleDetailsSection = ({
|
||||
I={ProjectPermissionActions.Edit}
|
||||
a={ProjectPermissionSub.Member}
|
||||
renderTooltip
|
||||
allowedLabel="Remove role"
|
||||
allowedLabel="Remove Role"
|
||||
>
|
||||
{(isAllowed) => (
|
||||
<IconButton
|
||||
@@ -209,7 +209,10 @@ export const MemberRoleDetailsSection = ({
|
||||
isOpen={popUp.modifyRole.isOpen}
|
||||
onOpenChange={(isOpen) => handlePopUpToggle("modifyRole", isOpen)}
|
||||
>
|
||||
<ModalContent title="Roles" subTitle="Select one of the pre-defined or custom roles.">
|
||||
<ModalContent
|
||||
title="Roles"
|
||||
subTitle="Select one or more of the pre-defined or custom roles to configure project permissions."
|
||||
>
|
||||
<MemberRoleModify projectMember={membershipDetails} onOpenUpgradeModal={() => {}} />
|
||||
</ModalContent>
|
||||
</Modal>
|
||||
|
||||
@@ -136,7 +136,7 @@ export const MemberRoleModify = ({ projectMember, onOpenUpgradeModal }: Props) =
|
||||
});
|
||||
createNotification({ text: "Successfully updated roles", type: "success" });
|
||||
} catch (err) {
|
||||
createNotification({ text: "Failed to update role", type: "error" });
|
||||
createNotification({ text: "Failed to update roles", type: "error" });
|
||||
}
|
||||
};
|
||||
|
||||
@@ -191,7 +191,7 @@ export const MemberRoleModify = ({ projectMember, onOpenUpgradeModal }: Props) =
|
||||
new Date(temporaryAccess.temporaryAccessEndTime || ""),
|
||||
"yyyy-MM-dd HH:mm:ss"
|
||||
)}`
|
||||
: "Non expiry access"
|
||||
: "Non-Expiring Access"
|
||||
}
|
||||
>
|
||||
<Button
|
||||
@@ -226,7 +226,7 @@ export const MemberRoleModify = ({ projectMember, onOpenUpgradeModal }: Props) =
|
||||
>
|
||||
<div className="flex flex-col space-y-4">
|
||||
<div className="border-b border-b-gray-700 pb-2 text-sm text-mineshaft-300">
|
||||
Configure timed access
|
||||
Configure Timed Access
|
||||
</div>
|
||||
{isExpired && <Tag colorSchema="red">Expired</Tag>}
|
||||
<Controller
|
||||
@@ -297,7 +297,7 @@ export const MemberRoleModify = ({ projectMember, onOpenUpgradeModal }: Props) =
|
||||
variant="outline_bg"
|
||||
className="border border-mineshaft-500 bg-mineshaft-600 py-3 hover:border-red/70 hover:bg-red/20"
|
||||
ariaLabel="delete-role"
|
||||
isDisabled={isMemberEditDisabled}
|
||||
isDisabled={isMemberEditDisabled || selectedRoleList.fields.length === 1}
|
||||
onClick={() => {
|
||||
if (selectedRoleList.fields.length > 1) {
|
||||
selectedRoleList.remove(index);
|
||||
|
||||
@@ -300,7 +300,7 @@ export const IdentityRbacSection = ({ identityProjectMember, onOpenUpgradeModal
|
||||
variant="outline_bg"
|
||||
className="border border-mineshaft-500 bg-mineshaft-600 py-3 hover:border-red/70 hover:bg-red/20"
|
||||
ariaLabel="delete-role"
|
||||
isDisabled={isMemberEditDisabled}
|
||||
isDisabled={isMemberEditDisabled || selectedRoleList.fields.length === 1}
|
||||
onClick={() => {
|
||||
if (selectedRoleList.fields.length > 1) {
|
||||
selectedRoleList.remove(index);
|
||||
|
||||
@@ -300,7 +300,7 @@ export const MemberRbacSection = ({ projectMember, onOpenUpgradeModal }: Props)
|
||||
variant="outline_bg"
|
||||
className="border border-mineshaft-500 bg-mineshaft-600 py-3 hover:border-red/70 hover:bg-red/20"
|
||||
ariaLabel="delete-role"
|
||||
isDisabled={isMemberEditDisabled}
|
||||
isDisabled={isMemberEditDisabled || selectedRoleList.fields.length === 1}
|
||||
onClick={() => {
|
||||
if (selectedRoleList.fields.length > 1) {
|
||||
selectedRoleList.remove(index);
|
||||
|
||||
Reference in New Issue
Block a user