feat: various improvements

wip: frontend

feat: enable cascade on foreign keys

wip1

wip2

fix chapters issues

wip4
This commit is contained in:
swve 2023-11-29 22:29:48 +01:00
parent 2bf80030d7
commit 187f75e583
71 changed files with 879 additions and 568 deletions

View file

@ -8,12 +8,15 @@ import Avvvatars from 'avvvatars-react';
import Image from 'next/image';
import AuthenticatedClientElement from '@components/Security/AuthenticatedClientElement';
import { getOrganizationContextInfo } from '@services/organizations/orgs';
import useSWR, { mutate } from "swr";
import { getAPIUrl } from '@services/config/config';
import { swrFetcher } from '@services/utils/ts/requests';
async function SettingsLayout({ children, params }: { children: React.ReactNode, params: any }) {
function SettingsLayout({ children, params }: { children: React.ReactNode, params: any }) {
const auth: any = React.useContext(AuthContext);
const orgslug = params.orgslug;
let org = await getOrganizationContextInfo(orgslug, {});
const { data: org, error: error } = useSWR(`${getAPIUrl()}orgs/slug/${orgslug}`, swrFetcher);
return (
<>
@ -33,7 +36,10 @@ async function SettingsLayout({ children, params }: { children: React.ReactNode,
<li><Link href="/settings/account/profile">Profile</Link></li>
<li><Link href="/settings/account/passwords">Passwords</Link></li>
</ul>
<AuthenticatedClientElement checkMethod='roles' orgId={org.org_id} >
<AuthenticatedClientElement
ressourceType='organization'
action='update'
checkMethod='roles' >
<MenuTitle>Organization</MenuTitle>
<ul>
<li><Link href="/settings/organization/general">General</Link></li>