From 9a2736d9de82ee881edc23c15dc761d47053cd8a Mon Sep 17 00:00:00 2001 From: Alexander Borg Date: Fri, 19 Sep 2025 13:41:07 +0200 Subject: [PATCH] Fix jwt-token --- management/src/pages/System.jsx | 1 + management/src/pages/Users.jsx | 23 ++++++++++++----------- management/src/utils/tempTranslations.js | 20 ++++++++++++++++---- 3 files changed, 29 insertions(+), 15 deletions(-) diff --git a/management/src/pages/System.jsx b/management/src/pages/System.jsx index 5495ace..2178d42 100644 --- a/management/src/pages/System.jsx +++ b/management/src/pages/System.jsx @@ -1,6 +1,7 @@ import React, { useState, useEffect } from 'react' import api from '../services/api' import toast from 'react-hot-toast' +import { t } from '../utils/tempTranslations' // Temporary translation system import { CogIcon, ServerIcon, diff --git a/management/src/pages/Users.jsx b/management/src/pages/Users.jsx index 36843ec..c959029 100644 --- a/management/src/pages/Users.jsx +++ b/management/src/pages/Users.jsx @@ -1,6 +1,7 @@ import React, { useState, useEffect } from 'react' import api from '../services/api' import toast from 'react-hot-toast' +import { t } from '../utils/tempTranslations' // Temporary translation system import { UsersIcon, MagnifyingGlassIcon } from '@heroicons/react/24/outline' const Users = () => { @@ -18,7 +19,7 @@ const Users = () => { const response = await api.get('/management/users') setUsers(response.data.data || []) } catch (error) { - toast.error('Failed to load users') + toast.error(t('users.loadError')) console.error('Error loading users:', error) } finally { setLoading(false) @@ -55,8 +56,8 @@ const Users = () => { return (
-

Users

-

Manage user accounts across all tenants

+

{t('users.title')}

+

{t('users.description')}

@@ -64,7 +65,7 @@ const Users = () => { setSearchTerm(e.target.value)} className="pl-10 pr-4 py-2 border border-gray-300 rounded-lg w-full max-w-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500" @@ -77,19 +78,19 @@ const Users = () => { - User + {t('users.user')} - Role + {t('users.role')} - Status + {t('users.status')} - Last Login + {t('users.lastLogin')} - Created + {t('users.created')} @@ -135,9 +136,9 @@ const Users = () => { {filteredUsers.length === 0 && (
-

No users found

+

{t('users.noUsers')}

- {searchTerm ? 'Try adjusting your search criteria.' : 'No users have been created yet.'} + {searchTerm ? t('users.noUsersSearch') : t('users.noUsersDescription')}

)} diff --git a/management/src/utils/tempTranslations.js b/management/src/utils/tempTranslations.js index 663945e..67d0c9d 100644 --- a/management/src/utils/tempTranslations.js +++ b/management/src/utils/tempTranslations.js @@ -59,11 +59,16 @@ const translations = { activeTenants: 'Active Tenants' }, users: { - title: 'User Management', + title: 'Users', + description: 'Manage user accounts across all tenants', noUsers: 'No users found', + noUsersDescription: 'No users have been created yet.', + noUsersSearch: 'Try adjusting your search criteria.', addUser: 'Add User', editUser: 'Edit User', deleteUser: 'Delete User', + searchPlaceholder: 'Search users...', + user: 'User', username: 'Username', email: 'Email', role: 'Role', @@ -71,7 +76,8 @@ const translations = { status: 'Status', lastLogin: 'Last Login', created: 'Created', - actions: 'Actions' + actions: 'Actions', + loadError: 'Failed to load users' }, dashboard: { title: 'Dashboard', @@ -181,11 +187,16 @@ const translations = { activeTenants: 'Aktiva hyresgäster' }, users: { - title: 'Användarhantering', + title: 'Användare', + description: 'Hantera användarkonton över alla hyresgäster', noUsers: 'Inga användare hittades', + noUsersDescription: 'Inga användare har skapats ännu.', + noUsersSearch: 'Prova att justera dina sökkriterier.', addUser: 'Lägg till användare', editUser: 'Redigera användare', deleteUser: 'Ta bort användare', + searchPlaceholder: 'Sök användare...', + user: 'Användare', username: 'Användarnamn', email: 'E-post', role: 'Roll', @@ -193,7 +204,8 @@ const translations = { status: 'Status', lastLogin: 'Senaste inloggning', created: 'Skapad', - actions: 'Åtgärder' + actions: 'Åtgärder', + loadError: 'Misslyckades att ladda användare' }, dashboard: { title: 'Instrumentpanel',