diff --git a/frontend/src/component/admin/project-roles/CreateProjectRole/CreateProjectRole.tsx b/frontend/src/component/admin/project-roles/CreateProjectRole/CreateProjectRole.tsx index 2237d763ff..b9a5fb4aed 100644 --- a/frontend/src/component/admin/project-roles/CreateProjectRole/CreateProjectRole.tsx +++ b/frontend/src/component/admin/project-roles/CreateProjectRole/CreateProjectRole.tsx @@ -48,7 +48,7 @@ const CreateProjectRole = () => { confetti: true, type: 'success', }); - } catch (e) { + } catch (e: any) { setToastApiError(e.toString()); } } @@ -64,7 +64,7 @@ const CreateProjectRole = () => { }; const handleCancel = () => { - history.push('/admin/roles'); + history.goBack(); }; return ( @@ -72,9 +72,9 @@ const CreateProjectRole = () => { loading={loading} title="Create project role" description="A project role can be -customised to limit access -to resources within a project" - documentationLink="https://docs.getunleash.io/" + customised to limit access + to resources within a project" + documentationLink="https://docs.getunleash.io/how-to/how-to-create-and-assign-custom-project-roles" formatApiCode={formatApiCode} > { const { uiConfig } = useUiConfig(); const { setToastData, setToastApiError } = useToast(); - const { id } = useParams(); + const { id } = useParams<{ id: string }>(); const { role } = useProjectRole(id); const history = useHistory(); @@ -68,7 +68,7 @@ const EditProjectRole = () => { const { refetch } = useProjectRole(id); const { editRole, loading } = useProjectRolesApi(); - const handleSubmit = async e => { + const handleSubmit = async (e: Event) => { e.preventDefault(); const payload = getProjectRolePayload(); @@ -81,18 +81,19 @@ const EditProjectRole = () => { refetch(); history.push('/admin/roles'); setToastData({ + type: 'success', title: 'Project role updated', text: 'Your role changes will automatically be applied to the users with this role.', confetti: true, }); - } catch (e) { + } catch (e: any) { setToastApiError(e.toString()); } } }; const handleCancel = () => { - history.push('/admin/roles'); + history.goBack(); }; return ( @@ -102,7 +103,7 @@ const EditProjectRole = () => { description="A project role can be customised to limit access to resources within a project" - documentationLink="https://docs.getunleash.io/" + documentationLink="https://docs.getunleash.io/how-to/how-to-create-and-assign-custom-project-roles" formatApiCode={formatApiCode} > void; + validateNameUniqueness?: () => void; getRoleKey: (permission: { id: number; environment?: string }) => string; }