diff --git a/admin-ui/app/components/ThemeSetting/ThemeSettings.js b/admin-ui/app/components/ThemeSetting/ThemeSettings.js index 886ba296a..2bc126251 100644 --- a/admin-ui/app/components/ThemeSetting/ThemeSettings.js +++ b/admin-ui/app/components/ThemeSetting/ThemeSettings.js @@ -1,4 +1,4 @@ -import React, { useContext, useEffect } from 'react' +import React, { useContext } from 'react' import clsx from 'clsx' import Drawer from '@material-ui/core/Drawer' import Button from '@material-ui/core/Button' diff --git a/admin-ui/app/context/theme/themeContext.js b/admin-ui/app/context/theme/themeContext.js index dcf718dc3..f3bab49e4 100644 --- a/admin-ui/app/context/theme/themeContext.js +++ b/admin-ui/app/context/theme/themeContext.js @@ -8,7 +8,6 @@ const initialState = { const themeReducer = (state, action) => { if (action.type) { - window.localStorage.setItem('initTheme', action.type) return { theme: action.type } } diff --git a/admin-ui/app/locales/en/translation.json b/admin-ui/app/locales/en/translation.json index 64203b49b..a0704d4d7 100644 --- a/admin-ui/app/locales/en/translation.json +++ b/admin-ui/app/locales/en/translation.json @@ -3,6 +3,7 @@ "accept": "Accept", "add": "Add", "add_ldap_configuration": "Add LDAP Configuration", + "add_mapping":"Add Mapping", "add_property": "Add property", "apply": "Apply", "back_home": "Back Home", @@ -18,6 +19,7 @@ "search": "Search", "submit": "Submit", "remove": "Remove", + "revert": "revert", "test": "Test", "view": "View", "yes": "Yes", @@ -74,11 +76,13 @@ "client_name": "Client name", "client_secret": "Client secret", "computation_pool_size": "Computation Pool Size", + "config_api_url": "Config API URL", "configuration_id": "Configuration Id", "connection_factory_type": "Connection Factory Type", "connection_timeout": "Connection Timeout", "consent_gathering_scripts": "OAuth Consent", "custom_properties": "Custom Properties (key/values)", + "dark_mode": "Dark Mode", "data_type": "Data Type", "default_acr": "Default Authentication Method (ACR)", "default_bucket": "Default Bucket", @@ -99,7 +103,6 @@ "enabled_oAuth_audit_logging": "Enable Oauth Audit Logging?", "enter_the_attribute_inum": "Enter the attribute inum", "grant_types": "Grants", - "redirect_regex": "Redirect Regex", "host_name": "Host Name", "hide_on_discovery": "Hide On Discovery?", "http_logging_enabled": "Enable HTTP Logging", @@ -107,16 +110,14 @@ "id_token_encrypted_response_alg": "JWS alg for encryption", "id_token_encrypted_response_enc": "JWS enc for encryption", "id_token_signed_response_alg": "JWS alg for signing", - "spontaneousScopes": "Spontaneous scopes", - "spontaneousScopesREGEX": "Spontaneous scope validation regex", "inactive": "InActive", "include_in_scim_extension": "Include In SCIM Extension?", "in_memory_configuration": "inMemoryConfiguration", "internal": "Internal", "introspection_scripts": "Introspection", - "ip_address": "IP Address", "ropcScripts": "Password Grant", "inum": "inum", + "ip_address": "IP Address", "is_active": "Active", "is_expirable_client": "Is Expirable Client?", "is_trusted_client": "Supress authorization", @@ -126,6 +127,7 @@ "authorizationSignedResponseAlg": "JWS alg for signing", "authorizationEncryptedResponseAlg": "JWS alg for encryption", "authorizationEncryptedResponseEnc": "JWS enc for encryption", + "list_paging_size": "List paging size", "location_type": "Location Type", "log_level": "Log level", "log_layout": "Log layout", @@ -160,6 +162,7 @@ "pre_authorization": "Pre-Authorization", "primary_key": "Primary Key", "programming_language": "Programming Language", + "redirect_regex": "Redirect Regex", "redirect_uris": "Redirect URIs", "redirectUrisRegex": "Redirect Regex", "redis_configuration": "redisConfiguration", @@ -201,6 +204,8 @@ "spontaneous_client_id": "Spontaneous Client Id", "spontaneous_scope_script_dns": "Spontaneous Scope Script Dns", "spontaneous_scopes": "Spontaneous Scopes", + "spontaneousScopes": "Spontaneous scopes", + "spontaneousScopesREGEX": "Spontaneous scope validation regex", "updateTokenScriptDns": "Update Token", "ssl_trust_store_file": "SSL Trust Store File", "ssl_trust_store_file_path": "sslTrustStoreFilePath", @@ -289,11 +294,11 @@ "givenName": "Given Name", "resources": "Resources", "resourceId": "Resource id", - "iconUrl": "Icon URL", "scopeSelection": "Scope Selection", "scopeOrExpression": "Scope (or Expression)", "associatedClient": "Associated Client", "creationTime": "Creation Time", + "select_date_range":"Select a date range", "scope": "Scope", "scopeExpression": "Scope Expression" }, @@ -387,7 +392,10 @@ "refresh_data": "Refresh Data", "view_attribute": "View attribute", "edit_sql": "Edit SQL", - "add_sql": "Add SQL" + "add_sql": "Add SQL", + "client_credentials_access_token_count": "Client credentials access token count", + "authz_code_access_token_count": "Authz code access token count", + "authz_code_idtoken_count": "Authz code idtoken count" }, "placeholders": { "id": "Enter id", diff --git a/admin-ui/app/locales/fr/translation.json b/admin-ui/app/locales/fr/translation.json index 8fa672640..1c0e4e6d0 100644 --- a/admin-ui/app/locales/fr/translation.json +++ b/admin-ui/app/locales/fr/translation.json @@ -11,7 +11,7 @@ "token_issued_count": "Nombre de jetons émis", "user_info": "Informations utilisateur", "product_name": "Nom du produit", - "type_licence": "Type de licence", + "license_type": "Type de licence", "customer_email": "Courriel du client", "company_name": "Nom de l'entreprise", "license_status": "Statut de la licence", @@ -28,6 +28,12 @@ }, "menus": { "adminui": "Administratrice", + "config-api": "Config-API", + "api": { + "roles": "Rôles d'accès", + "permissions": "Autorisations", + "mapping": "Mapping" + }, "cache": "Cacher", "clients": "Clientes", "configuration": "Configuration", @@ -35,7 +41,7 @@ "dashboard": "Tableau de bord", "defaults": "Valeurs par défaut", "health": "Santé", - "home": "Domicile", + "home": "Accueil", "keys": "Clés", "ldap": "Ldap", "license": "Licence", @@ -59,13 +65,14 @@ "signout": "Déconnexion", "user_management": "User Management", "maugraph": "MAU", - "users": "Users", + "users": "Utilisateurs", "user-management": "User Management" }, "actions": { "accept": "J'accepte", "add": "Ajouter", "add_ldap_configuration": "Ajouter une configuration LDAP", + "add_mapping":"Ajouter un Mapping", "add_property": "Ajouter une propriété", "apply": "Appliquer", "back_home": "Retour à la maison", @@ -76,8 +83,10 @@ "no": "Non", "previous": "Précédent", "save": "sauver", + "search": "Rechercher", "submit": "Soumettre", "remove": "Supprimer", + "revert": "rétablir", "test": "Test", "view": "Vue", "yes": "Oui", @@ -111,11 +120,13 @@ "client_name": "Nom du client", "client_secret": "Secret du client", "computation_pool_size": "Taille du pool de calcul", + "config_api_url": "Config API URL", "configuration_id": "Identifiant de configuration", "connection_factory_type": "Type d'usine de connexion", "connection_timeout": "Délai de connection dépassé", "consent_gathering_scripts": "Scripts de collecte de consentement", "custom_properties": "Propriétés personnalisées (clé/valeurs)", + "dark_mode": "Mode Nuit", "data_type": "Type de données", "default_acr": "Méthode d'authentification par défaut (ACR)", "default_bucket": "Seau par défaut", @@ -156,6 +167,7 @@ "json_web_keys": "Clés Web JSON", "jwks": "Jwks", "jwks_uri": "Jwks URI", + "list_paging_size": "Taille de la pagination de la liste", "location_type": "Type de lieu", "log_level": "Niveau de journal", "log_layout": "Disposition du journal", @@ -190,6 +202,7 @@ "pre_authorization": "Pré-autorisation", "primary_key": "Clé primaire", "programming_language": "Langage de programmation", + "redirect_regex": "Regex de redirection", "redirect_uris": "Rediriger les URIs", "redis_configuration": "redisConfiguration", "redis_provider_type": "Type de fournisseur Redis", @@ -201,6 +214,7 @@ "required_ssl": "SSL requis", "response_types": "Types de réponse", "revision": "Révision", + "ropcScripts": "Attribution du mot de passe", "rpt_scripts": "Script de modification RPT", "saml1_uri": "URI Saml1", "saml2_uri": "URI Saml2", @@ -208,6 +222,7 @@ "scopes:": "Portées", "scripts": "Scénarios", "script_type": "Type de script", + "select_date_range":"Sélectionnez une plage de dates", "sector_uri": "Identificateur de secteur URI", "sender_email": "Courriel de l'expéditeur", "sender_name": "Nom de l'expéditeur", @@ -225,6 +240,8 @@ "spontaneous_client_id": "Identifiant client spontané", "spontaneous_scope_script_dns": "DNS de script de portée spontanée", "spontaneous_scopes": "Portées spontanées", + "spontaneousScopes": "Portées spontanées", + "spontaneousScopesREGEX": "Regex de validation spontanée de la portée", "ssl_trust_store_file": "Fichier de magasin de confiance SSL", "ssl_trust_store_file_path": "sslTrustStoreFilePath", "ssl_trust_store_format": "Format de magasin de confiance SSL", @@ -311,7 +328,10 @@ "edit_ldap": "Modifier LDAP", "edit_attribute": "Modifier l'attribut", "refresh_data": "Actualiser les données", - "view_attribute": "Afficher l'attribut" + "view_attribute": "Afficher l'attribut", + "client_credentials_access_token_count": "Nombre de jetons d'accès aux informations d'identification du client", + "authz_code_access_token_count": "Code d'accès Authz token count", + "authz_code_idtoken_count": "Code d'autorisation - nombre d'idtoken" }, "placeholders": { "id": "Enter id", @@ -374,9 +394,11 @@ "sql_authentication": "Authentification SQL", "logging": "ENREGISTREMENT", "jwk_keys": "Clés JWK", + "mapping": "MAPPAGE DES RÔLES/PERMISSIONS DE L'API", "modules_properties": "Propriétés du module", "oauth_server_status_title": "État du serveur OAuth", "oidc_clients": "Clients OIDC", + "permissions": "Autorisations", "private_keys": "Clés privées", "public_keys": "Clés publiques", "profile_detail": "Détails du profil", diff --git a/admin-ui/app/locales/pt/translation.json b/admin-ui/app/locales/pt/translation.json index 7a9010380..274f7989a 100644 --- a/admin-ui/app/locales/pt/translation.json +++ b/admin-ui/app/locales/pt/translation.json @@ -28,6 +28,12 @@ }, "menus": { "adminui": "Admin", + "config-api": "Config-API", + "api": { + "roles": "Papéis de acesso", + "permissions": "Permissões", + "mapping": "Mapeamento" + }, "cache": "Cache", "clients": "Clientes", "configuration": "Configuração", @@ -65,6 +71,7 @@ "accept": "Aceitar", "add": "Adicionar", "add_ldap_configuration": "Adicionar configuração LDAP", + "add_mapping":"Add Mapping", "add_property": "Adicionar propriedade", "apply": "Aplicar", "back_home": "Voltar para casa", @@ -77,6 +84,7 @@ "save": "Salvar", "submit": "Enviar", "remove": "Remover", + "revert": "revert", "test": "Teste", "view": "Visualizar", "yes": "Sim", @@ -110,11 +118,13 @@ "client_name": "Nome do cliente", "client_secret": "Segredo do cliente", "computation_pool_size": "Tamanho do pool de computação", + "config_api_url": "Config API URL", "configuration_id": "Id de configuração", "connection_factory_type": "Tipo de conexão de fábrica", "connection_timeout": "Tempo limite de conexão", "consent_gathering_scripts": "Scripts de coleta de consentimento", "custom_properties": "Propriedades personalizadas (chave / valores)", + "dark_mode": "Dark Mode", "data_type": "Tipo de dados", "default_acr": "Método de autenticação padrão (ACR)", "default_bucket": "Bucket padrão", @@ -155,6 +165,7 @@ "json_web_keys": "JSON Web Keys", "jwks": "Jwks", "jwks_uri": "Jwks Uri", + "list_paging_size": "List paging size", "location_type": "Tipo de localização", "log_level": "Nível de registro", "log_layout": "Layout de log", @@ -210,6 +221,7 @@ "sector_uri": "URI de identificador de setor", "sender_email": "Email do Remetente", "sender_name": "Nome do remetente", + "select_date_range":"Select a date range", "sentinel_master_group_name": "sentinelMasterGroupName", "servers": "Servidores", "show_in_configuration_endpoint": "Mostrar ponto final na configuração", @@ -310,7 +322,10 @@ "edit_ldap": "Editar Ldap", "edit_attribute": "Editar Atributo", "refresh_data": "Atualizar dados", - "view_attribute": "Ver atributo" + "view_attribute": "Ver atributo", + "client_credentials_access_token_count": "Contagem de fichas de acesso de credenciais de clientes", + "authz_code_access_token_count": "Contagem do código Authz de acesso", + "authz_code_idtoken_count": "Authz code idtoken count" }, "placeholders": { "id": "Enter id", @@ -373,9 +388,11 @@ "sql_authentication": "Autenticação Sql", "logging": "EXPLORAÇÃO MADEIREIRA", "jwk_keys": "Chaves JWK", + "mapping": "API ROLES/PERMISSIONS MAPPING", "modules_properties": "Propriedades do Módulo", "oauth_server_status_title": "Status do servidor OAuth", "oidc_clients": "Clientes OIDC", + "permissions": "Permissões", "private_keys": "Chaves Privadas", "public_keys": "Chaves Públicas", "profile_detail": "Detalhes de perfil", diff --git a/admin-ui/app/redux/reducers/LogoutReducer.js b/admin-ui/app/redux/reducers/LogoutReducer.js index 72c03ef05..dad71fa07 100644 --- a/admin-ui/app/redux/reducers/LogoutReducer.js +++ b/admin-ui/app/redux/reducers/LogoutReducer.js @@ -7,13 +7,14 @@ const INIT_STATE = {} export default function logoutReducer(state = INIT_STATE, action) { if (action.type === USER_LOGGED_OUT) { - const initTheme = localStorage.getItem('initTheme') - const initLang = localStorage.getItem('initLang') const userConfig = localStorage.getItem('userConfig') localStorage.clear() - localStorage.setItem('initTheme', initTheme) - localStorage.setItem('initLang', initLang) - localStorage.setItem('userConfig', userConfig) + localStorage.setItem('initTheme', 'darkBlack') + localStorage.setItem('initLang', 'en') + + if (userConfig && userConfig !== 'null') { + localStorage.setItem('userConfig', userConfig) + } } return state } diff --git a/admin-ui/app/routes/Apps/Gluu/LanguageMenu.js b/admin-ui/app/routes/Apps/Gluu/LanguageMenu.js index 5bac2de01..c904fe966 100644 --- a/admin-ui/app/routes/Apps/Gluu/LanguageMenu.js +++ b/admin-ui/app/routes/Apps/Gluu/LanguageMenu.js @@ -1,4 +1,4 @@ -import React, { useState, useEffect } from 'react' +import React, { useState, useEffect, useContext } from 'react' import { useTranslation } from 'react-i18next' import { DropdownToggle, @@ -6,37 +6,52 @@ import { DropdownItem, ButtonDropdown, } from 'Components' +import { ThemeContext } from "Context/theme/themeContext" const LanguageMenu = ({ userInfo }) => { const [isOpen, setOpen] = useState(false) - const initLang = localStorage.getItem('initLang') + const initLang = localStorage.getItem('initLang') || 'en' + const initTheme = localStorage.getItem('initTheme') || 'darkBlack' const userConfig = JSON.parse(localStorage.getItem('userConfig')) - const userConfigLang = userConfig?.lang || {} + const userConfigLang = userConfig && userConfig !== 'null' ? userConfig?.lang : {} + const userConfigTheme = userConfig && userConfig !== 'null' ? userConfig?.theme : {} const [lang, setLang] = useState('en') + const [langUpdated, setLangUpdated] = useState(false) + const [themeUpdated, setThemeUpdated] = useState(false) const { t, i18n } = useTranslation() const { inum } = userInfo const toggle = () => setOpen(!isOpen) + const themeContext = useContext(ThemeContext) function changeLanguage(code) { i18n.changeLanguage(code) setLang(code) let lang = { ...userConfigLang } - const theme = userConfig?.theme || {} if (inum) { lang = { [inum]: code } } - const newConfig = { lang, theme } + const newConfig = { lang, theme: userConfigTheme } localStorage.setItem('userConfig', JSON.stringify(newConfig)) } useEffect(() => { const currentLang = userConfigLang[inum] ? userConfigLang[inum] : initLang - i18n.changeLanguage(currentLang) - setLang(currentLang) - }, [initLang, userConfigLang]) + const currentTheme = userConfigTheme[inum] ? userConfigTheme[inum] : initTheme + + if (currentLang !== initLang && !langUpdated) { + i18n.changeLanguage(currentLang) + setLang(currentLang) + setLangUpdated(true) + } + + if (currentTheme !== initTheme && !themeUpdated) { + themeContext.dispatch({ type: currentTheme }) + setThemeUpdated(true) + } + }, [userConfigLang, userConfigTheme, langUpdated, themeUpdated]) return ( diff --git a/admin-ui/app/routes/Dashboards/Chart/TooltipDesign.js b/admin-ui/app/routes/Dashboards/Chart/TooltipDesign.js index c7e2b2cbd..ab3a8ea15 100644 --- a/admin-ui/app/routes/Dashboards/Chart/TooltipDesign.js +++ b/admin-ui/app/routes/Dashboards/Chart/TooltipDesign.js @@ -1,11 +1,13 @@ import React from 'react' +import { useTranslation } from 'react-i18next' function TooltipDesign({ payload }) { + const { t } = useTranslation() let objValues = { client_credentials_access_token_count: - 'Client credentials access token count', - authz_code_access_token_count: 'Authz code access token count', - authz_code_idtoken_count: 'Authz code idtoken count', + t('tooltips.client_credentials_access_token_count'), + authz_code_access_token_count: t('tooltips.authz_code_access_token_count'), + authz_code_idtoken_count: t('tooltips.authz_code_idtoken_count'), } return (
diff --git a/admin-ui/plugins/admin/components/MAU/MauGraph.js b/admin-ui/plugins/admin/components/MAU/MauGraph.js index c11f7c6fe..84c5981e0 100644 --- a/admin-ui/plugins/admin/components/MAU/MauGraph.js +++ b/admin-ui/plugins/admin/components/MAU/MauGraph.js @@ -139,7 +139,7 @@ function MauGraph({ statData, permissions, clients, loading, dispatch }) { - + setStartDate(date)} KeyboardButtonProps={{ @@ -162,7 +162,7 @@ function MauGraph({ statData, permissions, clients, loading, dispatch }) { format="MM/dd/yyyy" margin="normal" id="date-picker-inline" - label="End Date" + label={t('dashboard.end_date')} value={endDate} onChange={(date) => setEndDate(date)} KeyboardButtonProps={{ diff --git a/admin-ui/plugins/admin/components/Mapping/MappingItem.js b/admin-ui/plugins/admin/components/Mapping/MappingItem.js index 1001de8c7..13b70a828 100644 --- a/admin-ui/plugins/admin/components/Mapping/MappingItem.js +++ b/admin-ui/plugins/admin/components/Mapping/MappingItem.js @@ -21,6 +21,7 @@ import GluuTypeAhead from 'Routes/Apps/Gluu/GluuTypeAhead' import applicationStyle from 'Routes/Apps/Gluu/styles/applicationstyle' import { Formik } from 'formik' import { ThemeContext } from 'Context/theme/themeContext' +import { t } from 'i18next' function MappingItem({ candidate, roles }) { const dispatch = useDispatch() @@ -146,7 +147,7 @@ function MappingItem({ candidate, roles }) { - Add + {t('actions.add')} @@ -185,7 +186,7 @@ function MappingItem({ candidate, roles }) { }} > - Remove + {t('actions.remove')} @@ -201,7 +202,7 @@ function MappingItem({ candidate, roles }) { onClick={() => revertLocalChanges()} > - Revert + {t('actions.revert')} @@ -215,7 +216,7 @@ function MappingItem({ candidate, roles }) { }} > - Save + {t('actions.save')} diff --git a/admin-ui/plugins/admin/components/Mapping/MappingPage.js b/admin-ui/plugins/admin/components/Mapping/MappingPage.js index 8fa7ea7f4..53bdd9673 100644 --- a/admin-ui/plugins/admin/components/Mapping/MappingPage.js +++ b/admin-ui/plugins/admin/components/Mapping/MappingPage.js @@ -91,7 +91,7 @@ function MappingPage({ onClick={showMappingDialog} > - Add Mapping + {t('actions.add_mapping')} diff --git a/admin-ui/plugins/admin/components/Settings/SettingsPage.js b/admin-ui/plugins/admin/components/Settings/SettingsPage.js index 97d929623..fb81d1f02 100644 --- a/admin-ui/plugins/admin/components/Settings/SettingsPage.js +++ b/admin-ui/plugins/admin/components/Settings/SettingsPage.js @@ -34,7 +34,7 @@ function SettingsPage() { - + - +
- +