Rules fix + rules PUT rib

This commit is contained in:
Vins 2024-02-20 09:29:53 +01:00
parent b2c9405ce1
commit 5f742dc6ea
5 changed files with 52 additions and 12 deletions

View File

@ -17,4 +17,5 @@ export enum AppRuleNames {
deedTypes = "deed-types", deedTypes = "deed-types",
offices = "offices", offices = "offices",
documents = "documents", documents = "documents",
rib = "rib",
} }

View File

@ -122,11 +122,20 @@ export default class BurgerModal extends React.Component<IProps, IState> {
]} ]}
/> />
</Rules> </Rules>
<Rules
mode={RulesMode.NECESSARY}
rules={[
{
action: AppRuleActions.update,
name: AppRuleNames.rib,
},
]}>
<NavigationLink <NavigationLink
path={Module.getInstance().get().modules.pages.OfficesRib.props.path} path={Module.getInstance().get().modules.pages.OfficesRib.props.path}
text="Gestion du RIB" text="Gestion du RIB"
routesActive={[Module.getInstance().get().modules.pages.OfficesRib.props.path]} routesActive={[Module.getInstance().get().modules.pages.OfficesRib.props.path]}
/> />
</Rules>
<NavigationLink path={Module.getInstance().get().modules.pages.MyAccount.props.path} text="Mon compte" /> <NavigationLink path={Module.getInstance().get().modules.pages.MyAccount.props.path} text="Mon compte" />
<NavigationLink target="_blank" path="/CGU_LeCoffre_io.pdf" text="CGU" /> <NavigationLink target="_blank" path="/CGU_LeCoffre_io.pdf" text="CGU" />
<div className={classes["separator"]} /> <div className={classes["separator"]} />

View File

@ -96,11 +96,20 @@ export default class ProfileModal extends React.Component<IProps, IState> {
]} ]}
/> />
</Rules> </Rules>
<Rules
mode={RulesMode.NECESSARY}
rules={[
{
action: AppRuleActions.update,
name: AppRuleNames.rib,
},
]}>
<NavigationLink <NavigationLink
path={Module.getInstance().get().modules.pages.OfficesRib.props.path} path={Module.getInstance().get().modules.pages.OfficesRib.props.path}
text="Gestion du RIB" text="Gestion du RIB"
routesActive={[Module.getInstance().get().modules.pages.OfficesRib.props.path]} routesActive={[Module.getInstance().get().modules.pages.OfficesRib.props.path]}
/> />
</Rules>
<NavigationLink target="_blank" path="/CGU_LeCoffre_io.pdf" text="CGU" /> <NavigationLink target="_blank" path="/CGU_LeCoffre_io.pdf" text="CGU" />
<div className={classes["separator"]} /> <div className={classes["separator"]} />
<LogOutButton /> <LogOutButton />

View File

@ -47,9 +47,17 @@ export default function RolesInformations(props: IProps) {
const rules = await Rules.getInstance().get({ const rules = await Rules.getInstance().get({
where: { where: {
OR: [
{
namespace: "notary", namespace: "notary",
}, },
{
namespace: "collaborator",
},
],
},
}); });
if (!role) return; if (!role) return;
setRoleSelected(role); setRoleSelected(role);
if (!role.rules) return; if (!role.rules) return;

View File

@ -1,5 +1,18 @@
import { AppRuleActions, AppRuleNames } from "@Front/Api/Entities/rule";
import Rules, { RulesMode } from "@Front/Components/Elements/Rules";
import Rib from "@Front/Components/Layouts/Rib"; import Rib from "@Front/Components/Layouts/Rib";
export default function Route() { export default function Route() {
return <Rib />; return (
<Rules
mode={RulesMode.NECESSARY}
rules={[
{
action: AppRuleActions.update,
name: AppRuleNames.rib,
},
]}>
<Rib />
</Rules>
);
} }