fix(ui): broken permission page fixed

This commit is contained in:
=
2024-06-13 15:16:00 +05:30
parent 81513e4a75
commit d3932d8f08
4 changed files with 5 additions and 1 deletions
@@ -70,6 +70,7 @@ export const MultiEnvProjectPermission = ({
}, [allRule]); }, [allRule]);
const handlePermissionChange = (val: Permission) => { const handlePermissionChange = (val: Permission) => {
if(!val) return
switch (val) { switch (val) {
case Permission.NoAccess: { case Permission.NoAccess: {
const permissions = getValue("permissions"); const permissions = getValue("permissions");
@@ -106,7 +107,7 @@ export const MultiEnvProjectPermission = ({
className={twMerge( className={twMerge(
"rounded-md bg-mineshaft-800 px-10 py-6", "rounded-md bg-mineshaft-800 px-10 py-6",
(selectedPermissionCategory !== Permission.NoAccess || isCustom) && (selectedPermissionCategory !== Permission.NoAccess || isCustom) &&
"border-l-2 border-primary-600" "border-l-2 border-primary-600"
)} )}
> >
<div className="flex items-center space-x-4"> <div className="flex items-center space-x-4">
@@ -53,6 +53,7 @@ export const SecretRollbackPermission = ({ isNonEditable, setValue, control }: P
}, [selectedPermissionCategory]); }, [selectedPermissionCategory]);
const handlePermissionChange = (val: Permission) => { const handlePermissionChange = (val: Permission) => {
if(!val) return;
if (val === Permission.Custom) setIsCustom.on(); if (val === Permission.Custom) setIsCustom.on();
else setIsCustom.off(); else setIsCustom.off();
@@ -98,6 +98,7 @@ export const SingleProjectPermission = ({
}, [selectedPermissionCategory]); }, [selectedPermissionCategory]);
const handlePermissionChange = (val: Permission) => { const handlePermissionChange = (val: Permission) => {
if(!val) return;
if (val === Permission.Custom) setIsCustom.on(); if (val === Permission.Custom) setIsCustom.on();
else setIsCustom.off(); else setIsCustom.off();
@@ -52,6 +52,7 @@ export const WsProjectPermission = ({ isNonEditable, setValue, control }: Props)
}, [selectedPermissionCategory]); }, [selectedPermissionCategory]);
const handlePermissionChange = (val: Permission) => { const handlePermissionChange = (val: Permission) => {
if(!val) return;
if (val === Permission.Custom) setIsCustom.on(); if (val === Permission.Custom) setIsCustom.on();
else setIsCustom.off(); else setIsCustom.off();