Improve admin user experience by showing all stores and removing store selection

Fixes admin store visibility and removes unnecessary store selection for admins.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 91318273-c764-4fd4-be04-bdc12c38af32
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/0715008c-7244-40f4-befc-26c014852236/9d9e1107-c416-4124-a939-a91c612c56a1.jpg
This commit is contained in:
michaelschal committed 2025-07-09 23:27:52 +00:00
1 parent 2194d5914e
commit 98a9a98d1b
2 files changed
+6 -3

No files matched your search

+2 -3
View File
@@ -680,7 +680,7 @@ export default function Administration() {
<TableCell>{user.email || "-"}</TableCell>
<TableCell>{getRoleBadge(user.role)}</TableCell>
<TableCell>
{stores.find(s => s.id === user.storeId)?.name || "-"}
{user.role === 'administrator' ? "Tous" : (stores.find(s => s.id === user.storeId)?.name || "-")}
</TableCell>
<TableCell>
<Badge variant={user.isActive ? "default" : "secondary"}>
@@ -874,14 +874,13 @@ export default function Administration() {
render={({ field }) => (
<FormItem>
<FormLabel>Magasin</FormLabel>
<Select value={field.value?.toString() || "none"} onValueChange={(value) => field.onChange(value === "none" ? undefined : parseInt(value))}>
<Select value={field.value?.toString()} onValueChange={(value) => field.onChange(parseInt(value))}>
<FormControl>
<SelectTrigger>
<SelectValue placeholder="Sélectionner un magasin" />
</SelectTrigger>
</FormControl>
<SelectContent>
<SelectItem value="none">Aucun magasin (accès à tous)</SelectItem>
{stores.map((store) => (
<SelectItem key={store.id} value={store.id.toString()}>
{store.name}
+4
View File
@@ -170,6 +170,10 @@ Preferred communication style: Simple, everyday language.
- ✅ Enhanced deletion confirmations in sales history and administration panels
- ✅ Improved visual feedback with detailed confirmation dialogs showing item details
- ✅ Added proper modal management with shadcn/ui AlertDialog components
- ✅ Fixed critical admin user permissions bug preventing profile modifications
- ✅ Added server-side protection against accidental admin role changes
- ✅ Enhanced UI with disabled role field for self-editing administrators
- ✅ Improved admin interface - "Tous" displayed for admin store access, no redundant store selector for admin profiles
### Database Backup & Recovery System (January 9, 2025)
- ✅ Added complete database backup and restore functionality in administration panel