Skip to content

Commit

Permalink
Merge pull request #1334 from GluuFederation/admin-ui-issue-1333
Browse files Browse the repository at this point in the history
feat(admin-ui): implement navigation path for tab view in a page #1333
  • Loading branch information
duttarnab authored Sep 21, 2023
2 parents 142b580 + dbb8675 commit 3b3a3e0
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 10 deletions.
4 changes: 3 additions & 1 deletion admin-ui/app/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,9 @@
"cache_refresh": "Cache Refresh",
"customer_backend_key_attributes": "Customer Backend Key/Attributes",
"source_backend_ldap_servers": "Source Backend LDAP Servers",
"inum_db_server": "Inum DB Server"
"inum_db_server": "Inum DB Server",
"static_configuration": "Static Configuration",
"dynamic_configuration": "Dynamic Configuration"
},
"messages": {
"add_permission": "Add Permission",
Expand Down
4 changes: 3 additions & 1 deletion admin-ui/app/locales/fr/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@
"cache_refresh": "Actualisation du cache",
"customer_backend_key_attributes": "Clé/attributs du backend client",
"source_backend_ldap_servers": "Serveurs LDAP dorsaux sources",
"inum_db_server": "Serveur de base de données Inum"
"inum_db_server": "Serveur de base de données Inum",
"static_configuration": "Configuration statique",
"dynamic_configuration": "Configuration dynamique"
},
"actions": {
"accept": "J'accepte",
Expand Down
4 changes: 3 additions & 1 deletion admin-ui/app/locales/pt/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@
"cache_refresh": "Atualização de Cache",
"customer_backend_key_attributes": "Chave/atributos de back-end do cliente",
"source_backend_ldap_servers": "Servidores LDAP de back-end de origem",
"inum_db_server": "Servidor DB Inum"
"inum_db_server": "Servidor DB Inum",
"static_configuration": "Configuração estática",
"dynamic_configuration": "Configuração Dinâmica"
},
"actions": {
"accept": "Aceitar",
Expand Down
2 changes: 1 addition & 1 deletion admin-ui/plugins/auth-server/redux/features/scopeSlice.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const scopeSlice = createSlice({
handleUpdateScopeResponse: (state, action) => {
state.loading = false
if (action.payload.data) {
state.items = action.payload.data.entries
state.items = action.payload.data.entries || []
state.totalItems = action.payload.data.totalEntriesCount
state.entriesCount = action.payload.data.entriesCount
} else {
Expand Down
13 changes: 8 additions & 5 deletions admin-ui/plugins/fido/components/Fido.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ import {
} from '../redux/features/fidoSlice'
import applicationStyle from 'Routes/Apps/Gluu/styles/applicationstyle'

const tabNames = ['Dynamic Configuration', 'Static Configuration']

const fidoApiPayload = ({ fidoConfiguration, data }) => {
const payload = fidoConfiguration.fido
payload.authenticatorCertsFolder = data.authenticatorCertsFolder
Expand Down Expand Up @@ -84,16 +82,21 @@ export default function Fido() {
dispatch(getFidoConfiguration())
}, [])

const tabNames = [
{ name: t("menus.static_configuration"), path: '/fido/fidomanagement/static-configuration' },
{ name: t("menus.dynamic_configuration"), path: '/fido/fidomanagement/dynamic-configuration' },
];

const tabToShow = (tabName) => {
switch (tabName) {
case 'Static Configuration':
case t("menus.static_configuration"):
return (
<StaticConfiguration
handleSubmit={handleStaticConfigurationSubmit}
fidoConfiguration={fidoConfiguration}
/>
)
case 'Dynamic Configuration':
case t("menus.dynamic_configuration"):
return (
<DynamicConfiguration
handleSubmit={handleDyamicConfigurationSubmit}
Expand All @@ -119,7 +122,7 @@ export default function Fido() {
<Card className='mb-3' style={applicationStyle.mainCard}>
<CardBody>
{!fidoConfiguration?.loading && (
<GluuTabs tabNames={tabNames} tabToShow={tabToShow} />
<GluuTabs tabNames={tabNames} tabToShow={tabToShow} withNavigation={true} />
)}
</CardBody>
</Card>
Expand Down
12 changes: 11 additions & 1 deletion admin-ui/plugins/fido/plugin-metadata.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { reducer as fidoReducer } from './redux/features/fidoSlice'
import fidoSaga from './redux/sagas/FidoSaga'
import { FIDO_READ, FIDO_WRITE } from '../../app/utils/PermChecker'
import { FIDO_READ, FIDO_WRITE } from 'Utils/PermChecker'
import Fido from './components/Fido'

const PLUGIN_BASE_PATH = '/fido'
Expand All @@ -19,6 +19,16 @@ const pluginMetadata = {
component: Fido,
path: PLUGIN_BASE_PATH + '/fidomanagement',
permission: FIDO_WRITE,
},
{
component: Fido,
path: PLUGIN_BASE_PATH + '/fidomanagement' + '/static-configuration',
permission: FIDO_WRITE,
},
{
component: Fido,
path: PLUGIN_BASE_PATH + '/fidomanagement' + '/dynamic-configuration',
permission: FIDO_WRITE,
}
],
reducers: [{ name: 'fidoReducer', reducer: fidoReducer }],
Expand Down

0 comments on commit 3b3a3e0

Please sign in to comment.