feat(chat,files): salon par dossier, favoris, cloisonnement des droits admin (#8)
CD — Déploiement / deploy (push) Successful in 19s
CD — Déploiement / deploy (push) Successful in 19s
- chat: salon attache a un dossier, membres = comptes ayant acces au dossier - securite: suppression du passage automatique admin sur fichiers/dossiers/ corbeille/recherche/galerie/chat ; l'admin n'accede qu'a ses partages - favoris: tri en tete dans l'explorateur + page dediee (GET /favorites) - ui: retrait des pastilles Systeme/Public sur la carte dossier - migration 007_chat : table chat_messages --------- Co-authored-by: xEsiah <[email protected]> Reviewed-on: #8 Reviewed-by: Esiah <[email protected]> Co-authored-by: Gitea Actions <-[email protected]>
This commit was merged in pull request #8.
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import { useState } from "react";
|
||||
import { NavLink, Outlet } from "react-router-dom";
|
||||
import { Button, cn } from "../ui/index.js";
|
||||
import { api } from "../lib/api.js";
|
||||
import { useSession } from "../lib/session.js";
|
||||
import { Avatar } from "./Avatar.js";
|
||||
import {
|
||||
ActivityIcon,
|
||||
CloseIcon,
|
||||
@@ -14,6 +14,7 @@ import {
|
||||
SearchNavIcon,
|
||||
SettingsIcon,
|
||||
ShieldIcon,
|
||||
StarIcon,
|
||||
TrashIcon,
|
||||
} from "./icons.js";
|
||||
|
||||
@@ -25,6 +26,7 @@ interface NavItem {
|
||||
|
||||
const NAV: NavItem[] = [
|
||||
{ to: "/files", label: "Fichiers", icon: FolderIcon },
|
||||
{ to: "/favorites", label: "Favoris", icon: StarIcon },
|
||||
{ to: "/search", label: "Recherche", icon: SearchNavIcon },
|
||||
{ to: "/gallery", label: "Galerie", icon: ImageIcon },
|
||||
{ to: "/trash", label: "Corbeille", icon: TrashIcon },
|
||||
@@ -38,9 +40,6 @@ const ADMIN_NAV: NavItem[] = [
|
||||
|
||||
const ACCOUNT_NAV: NavItem = { to: "/profile", label: "Mon compte", icon: SettingsIcon };
|
||||
|
||||
const initials = (first: string, last: string): string =>
|
||||
`${first.charAt(0)}${last.charAt(0)}`.toUpperCase() || "?";
|
||||
|
||||
const navClass = ({ isActive }: { isActive: boolean }) =>
|
||||
cn(
|
||||
"flex items-center gap-3 rounded-md px-3 py-2 text-sm font-medium transition-colors",
|
||||
@@ -127,22 +126,13 @@ export const AppShell = () => {
|
||||
{user.role_name}
|
||||
</p>
|
||||
</div>
|
||||
<span
|
||||
className="relative flex h-9 w-9 shrink-0 items-center justify-center overflow-hidden rounded-full border border-border bg-surface text-xs font-semibold text-foreground"
|
||||
aria-hidden="true"
|
||||
>
|
||||
{initials(user.first_name, user.last_name)}
|
||||
{user.has_avatar ? (
|
||||
<img
|
||||
src={`${api.avatarUrl(user.id)}?v=${encodeURIComponent(user.avatar_updated_at ?? "")}`}
|
||||
alt=""
|
||||
className="absolute inset-0 h-full w-full object-cover"
|
||||
onError={(event) => {
|
||||
event.currentTarget.style.display = "none";
|
||||
}}
|
||||
/>
|
||||
) : null}
|
||||
</span>
|
||||
<Avatar
|
||||
userId={user.id}
|
||||
firstName={user.first_name}
|
||||
lastName={user.last_name}
|
||||
hasAvatar={user.has_avatar}
|
||||
avatarUpdatedAt={user.avatar_updated_at}
|
||||
/>
|
||||
<Button
|
||||
variant="secondary"
|
||||
size="sm"
|
||||
|
||||
Reference in New Issue
Block a user