Skip to content

Commit

Permalink
feat(admin-ui): resolved merge conflict #412
Browse files Browse the repository at this point in the history
  • Loading branch information
syntrydy committed Sep 5, 2022
2 parents daa519f + 07d7408 commit ea5c1e6
Show file tree
Hide file tree
Showing 29 changed files with 518 additions and 57 deletions.
128 changes: 128 additions & 0 deletions CHANGELOG.md

Large diffs are not rendered by default.

115 changes: 115 additions & 0 deletions admin-ui/CHANGELOG.md

Large diffs are not rendered by default.

28 changes: 20 additions & 8 deletions admin-ui/app/components/ThemeSetting/ThemeSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,34 @@ import lightBlueThumbnail from 'Images/theme-thumbnail/lightBlue.jpg'
import lightGreenThumbnail from 'Images/theme-thumbnail/lightGreen.jpg'
import styles from './styles'

export function ThemeSettings() {
export function ThemeSettings({ userInfo }) {
const classes = styles()
const [open, setOpen] = React.useState(false)
const theme = useContext(ThemeContext)

const onChangeTheme = (value) => {
theme.dispatch({ type: value })
return
}
const themeContext = useContext(ThemeContext)

const themeList = [
{ value: 'darkBlack', thumbnail: darkBlackThumbnail, text: 'Dark Black' },
{ value: 'darkBlue', thumbnail: darkBlueThumbnail, text: 'Dark Blue' },
{ value: 'lightBlue', thumbnail: lightBlueThumbnail, text: 'Light Blue' },
{ value: 'lightGreen', thumbnail: lightGreenThumbnail, text: 'Light Green' },
]
const existingConfig = JSON.parse(localStorage.getItem('userConfig'))
const lang = existingConfig?.lang || {}
const theme = existingConfig?.theme || {}

const onChangeTheme = (value) => {
const { inum } = userInfo

if (inum) {
theme[inum] = value
}

const newConfig = { lang, theme }
localStorage.setItem('userConfig', JSON.stringify(newConfig))

themeContext.dispatch({ type: value })
return
}

const toggleDrawer = (open) => (event) => {
if (event.type === 'keydown' && (event.key === 'Tab' || event.key === 'Shift')) {
Expand All @@ -50,7 +62,7 @@ export function ThemeSettings() {
{themeList.map(text => (
<Box
className={clsx(classes.selectItem, {
[classes.selectedItem]: theme.state.theme === text.value
[classes.selectedItem]: themeContext.state.theme === text.value
})}
onClick={() => onChangeTheme(text.value)}
key={text.value}
Expand Down
1 change: 0 additions & 1 deletion admin-ui/app/context/theme/themeContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ const initialState = {

const themeReducer = (state, action) => {
if (action.type) {
window.localStorage.setItem('initTheme', action.type)
return { theme: action.type }
}

Expand Down
20 changes: 14 additions & 6 deletions admin-ui/app/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -18,6 +19,7 @@
"search": "Search",
"submit": "Submit",
"remove": "Remove",
"revert": "revert",
"test": "Test",
"view": "View",
"yes": "Yes",
Expand Down Expand Up @@ -72,11 +74,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",
Expand All @@ -97,22 +101,18 @@
"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",
"id": "id",
"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",
"ropcScripts": "Password Grant",
"inum": "inum",
"is_active": "Active",
"is_expirable_client": "Is Expirable Client?",
Expand All @@ -123,6 +123,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",
Expand Down Expand Up @@ -157,6 +158,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",
Expand All @@ -169,6 +171,7 @@
"required_ssl": "Required SSL",
"response_types": "Response types",
"revision": "Revision",
"ropcScripts": "Password Grant",
"rpt_scripts": "RPT Modification Script",
"saml1_uri": "Saml1 URI",
"saml2_uri": "Saml2 URI",
Expand Down Expand Up @@ -196,6 +199,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",
Expand Down Expand Up @@ -283,11 +288,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"
},
Expand Down Expand Up @@ -380,7 +385,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",
Expand Down
30 changes: 26 additions & 4 deletions admin-ui/app/locales/fr/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -28,14 +28,20 @@
},
"menus": {
"adminui": "Administratrice",
"config-api": "Config-API",
"api": {
"roles": "Rôles d'accès",
"permissions": "Autorisations",
"mapping": "Mapping"
},
"cache": "Cacher",
"clients": "Clientes",
"configuration": "Configuration",
"couchbase": "Base de canapé",
"dashboard": "Tableau de bord",
"defaults": "Valeurs par défaut",
"health": "Santé",
"home": "Domicile",
"home": "Accueil",
"keys": "Clés",
"ldap": "Ldap",
"license": "Licence",
Expand All @@ -58,13 +64,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",
Expand All @@ -75,8 +82,10 @@
"no": "Non",
"previous": "Précédent",
"save": "sauver",
"search": "Rechercher",
"submit": "Soumettre",
"remove": "Supprimer",
"revert": "rétablir",
"test": "Test",
"view": "Vue",
"yes": "Oui",
Expand Down Expand Up @@ -108,11 +117,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",
Expand Down Expand Up @@ -152,6 +163,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",
Expand Down Expand Up @@ -186,6 +198,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",
Expand All @@ -197,13 +210,15 @@
"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",
"scope_type": "Type de portée",
"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",
Expand All @@ -219,6 +234,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",
Expand Down Expand Up @@ -304,7 +321,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",
Expand Down Expand Up @@ -367,9 +387,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",
Expand Down
19 changes: 18 additions & 1 deletion admin-ui/app/locales/pt/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -64,6 +70,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",
Expand All @@ -76,6 +83,7 @@
"save": "Salvar",
"submit": "Enviar",
"remove": "Remover",
"revert": "revert",
"test": "Teste",
"view": "Visualizar",
"yes": "Sim",
Expand Down Expand Up @@ -107,11 +115,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",
Expand Down Expand Up @@ -151,6 +161,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",
Expand Down Expand Up @@ -206,6 +217,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",
Expand Down Expand Up @@ -303,7 +315,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",
Expand Down Expand Up @@ -366,9 +381,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",
Expand Down
Loading

0 comments on commit ea5c1e6

Please sign in to comment.