introduced auth strategy actions to allow user creation in UI

This commit is contained in:
dswbx
2025-01-17 10:19:26 +01:00
parent d4f647c0db
commit b61634e261
23 changed files with 464 additions and 108 deletions

View File

@@ -28,14 +28,9 @@ function AuthRolesEditInternal({ params }) {
if (!formRef.current?.isValid()) return;
const data = formRef.current?.getData();
const success = await actions.roles.patch(roleName, data);
/*notifications.show({
id: `role-${roleName}-update`,
position: "top-right",
title: success ? "Update success" : "Update failed",
message: success ? "Role updated successfully" : "Failed to update role",
color: !success ? "red" : undefined
});*/
if (success) {
navigate(routes.auth.roles.list());
}
}
async function handleDelete() {

View File

@@ -90,9 +90,16 @@ const renderValue = ({ value, property }) => {
}
if (property === "permissions") {
const max = 3;
let permissions = value || [];
const count = permissions.length;
if (count > max) {
permissions = [...permissions.slice(0, max), `+${count - max}`];
}
return (
<div className="flex flex-row gap-1">
{[...(value || [])].map((p, i) => (
{permissions.map((p, i) => (
<span
key={i}
className="inline-block px-2 py-1.5 text-sm bg-primary/5 rounded font-mono leading-none"