Skip to content
Merged
Show file tree
Hide file tree
Changes from 58 commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
69ae0e0
fix(admin-ui): unable to add Custom and Module properties in Scripts …
faisalsiddique4400 Oct 30, 2025
38a4851
code rabbit suggestions
faisalsiddique4400 Oct 30, 2025
a7c8332
code rabbit suggestions
faisalsiddique4400 Oct 30, 2025
5a84bf4
code rabbit suggestions
faisalsiddique4400 Oct 30, 2025
4809e95
pagination count issues fixed
faisalsiddique4400 Oct 30, 2025
eae25f9
fix(admin-ui): unable to map permission to a role using GUI (#2400)
faisalsiddique4400 Oct 30, 2025
94b105b
fix(admin-ui): adding uniformity in cancel and back buttons present …
faisalsiddique4400 Oct 30, 2025
4317ea8
Merge branch 'main' of github-faisal:GluuFederation/flex into admin-u…
faisalsiddique4400 Oct 30, 2025
b9fd682
Code rabbit suggestions
faisalsiddique4400 Oct 30, 2025
9bc53ff
Code rabbit suggestions
faisalsiddique4400 Oct 30, 2025
847a607
Code rabbit suggestions
faisalsiddique4400 Oct 30, 2025
793a56a
Code rabbit suggestions
faisalsiddique4400 Oct 30, 2025
7181998
Code rabbit suggestions
faisalsiddique4400 Oct 30, 2025
241e9c6
Code rabbit suggestions
faisalsiddique4400 Oct 30, 2025
5dc0919
Code rabbit suggestions
faisalsiddique4400 Oct 30, 2025
68f742d
buttons swapping
faisalsiddique4400 Oct 31, 2025
ea5aa6b
Code Rabbit fixes
faisalsiddique4400 Oct 31, 2025
0cd0df3
Code Rabbit fixes
faisalsiddique4400 Oct 31, 2025
7af2074
Code Rabbit fixes
faisalsiddique4400 Oct 31, 2025
4e86e97
Code Rabbit fixes
faisalsiddique4400 Oct 31, 2025
1bff777
Code Rabbit fixes
faisalsiddique4400 Oct 31, 2025
a288f10
Code Rabbit fixes
faisalsiddique4400 Oct 31, 2025
cb7b80e
feat(admin): adding uniformity in cancel and back buttons present in …
faisalsiddique4400 Oct 31, 2025
4c5e6d3
Merge branch 'main' into admin-ui-issue-2361-scim
faisalsiddique4400 Oct 31, 2025
89271ec
Saperating footer components
faisalsiddique4400 Nov 3, 2025
75b0358
Code rabbit changes
faisalsiddique4400 Nov 3, 2025
c90eec1
Code rabbit changes
faisalsiddique4400 Nov 3, 2025
b2b52b0
Code rabbit changes
faisalsiddique4400 Nov 3, 2025
8aba204
Code rabbit changes
faisalsiddique4400 Nov 3, 2025
f5fc2be
file notations fixes
faisalsiddique4400 Nov 3, 2025
00b2d45
file notations fixes
faisalsiddique4400 Nov 3, 2025
b9dad66
Rename Gluuformfooter.tsx to GluuFormFooter.tsx
faisalsiddique4400 Nov 3, 2025
d14e1b6
code rabbit fixes
faisalsiddique4400 Nov 3, 2025
1376956
code rabbit fixes
faisalsiddique4400 Nov 3, 2025
a838993
code rabbit fixes
faisalsiddique4400 Nov 3, 2025
820046c
feat(admin): adding uniformity in cancel and back buttons present in …
faisalsiddique4400 Nov 3, 2025
885a512
feat(admin): adding uniformity in cancel and back buttons present in …
faisalsiddique4400 Nov 3, 2025
3c45274
code rabbit changes
faisalsiddique4400 Nov 3, 2025
477a8f9
code rabbit changes
faisalsiddique4400 Nov 3, 2025
c9bfbd9
feat(admin): adding uniformity in cancel and back buttons present in …
faisalsiddique4400 Nov 3, 2025
d8957fd
feat(admin): adding uniformity in cancel and back buttons present in …
faisalsiddique4400 Nov 3, 2025
f832c3e
feat(admin): adding uniformity in cancel and back buttons present in …
faisalsiddique4400 Nov 3, 2025
7222454
commit text not getting rollover issue
faisalsiddique4400 Nov 3, 2025
3a48972
feat(admin): adding uniformity in cancel and back buttons present in …
faisalsiddique4400 Nov 3, 2025
254c9fe
feat(admin): adding uniformity in cancel and back buttons present in …
faisalsiddique4400 Nov 4, 2025
0ab196c
Merge branch 'admin-ui-issue-2361-fido' into admin-ui-issue-2361-scripts
faisalsiddique4400 Nov 4, 2025
a85d632
Code rabbit changes
faisalsiddique4400 Nov 4, 2025
78bccda
Code rabbit changes
faisalsiddique4400 Nov 4, 2025
d69d7ef
Code rabbit changes
faisalsiddique4400 Nov 4, 2025
4dbdc82
Code rabbit changes
faisalsiddique4400 Nov 4, 2025
acb2273
Merge branch 'main' into admin-ui-issue-2361-scim
faisalsiddique4400 Nov 5, 2025
c131426
Code rabbit changes
faisalsiddique4400 Nov 5, 2025
b99c7d7
Merge branch 'admin-ui-issue-2361-scim' into admin-ui-issue-2361-fido
faisalsiddique4400 Nov 5, 2025
093b231
Merge branch 'admin-ui-issue-2361-fido' into admin-ui-issue-2361-scripts
faisalsiddique4400 Nov 5, 2025
2ea443e
Code rabbit changes
faisalsiddique4400 Nov 5, 2025
e993a85
Code rabbit changes
faisalsiddique4400 Nov 5, 2025
b17c0a3
Merge branch 'admin-ui-issue-2361-fido' into admin-ui-issue-2361-scripts
faisalsiddique4400 Nov 5, 2025
4b25dea
Comments on the PR resolved
faisalsiddique4400 Nov 6, 2025
48718a7
Merge branch 'main' into admin-ui-issue-2361-scripts
faisalsiddique4400 Nov 7, 2025
1acac87
Comments on the PR resolved
faisalsiddique4400 Nov 7, 2025
35fccb2
Merge conflicts resolved
faisalsiddique4400 Nov 7, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions admin-ui/app/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"configuration_copied": "Configuration copied",
"copy_configuration": "Copy configuration",
"apply": "Apply",
"back": "Back",
"back_home": "Back Home",
"cancel": "Cancel",
"currentMonth": "Current Month",
Expand Down
1 change: 1 addition & 0 deletions admin-ui/app/locales/es/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"configuration_copied": "Configuración copiada",
"copy_configuration": "Copiar configuración",
"apply": "Aplicar",
"back": "Atrás",
"back_home": "Volver al inicio",
"cancel": "Cancelar",
"currentMonth": "Mes actual",
Expand Down
1 change: 1 addition & 0 deletions admin-ui/app/locales/fr/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@
"reject": "Rejeter",
"add_header": "Ajouter un en-tête",
"apply": "Appliquer",
"back": "Retour",
"back_home": "Retour à la maison",
"cancel": "Annuler",
"clear": "Effacer",
Expand Down
1 change: 1 addition & 0 deletions admin-ui/app/locales/pt/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@
"add_mapping": "Add Mapping",
"add_property": "Adicionar propriedade",
"apply": "Aplicar",
"back": "Voltar",
"back_home": "Voltar para casa",
"add_server": "Adicionar servidor",
"add_base_dn": "Adicionar DN básico",
Expand Down
16 changes: 9 additions & 7 deletions admin-ui/app/routes/Apps/Gluu/GluuCommitDialog.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState, useEffect, useContext } from 'react'
import React, { useState, useEffect, useContext, useRef } from 'react'
import {
FormGroup,
Col,
Expand Down Expand Up @@ -50,13 +50,15 @@ const GluuCommitDialog = ({
modal,
})

const prevModalRef = useRef<boolean>(false)
useEffect(() => {
if (userMessage.length >= 10 && userMessage.length <= 512) {
setActive(true)
} else {
setActive(false)
setActive(userMessage.length >= 10 && userMessage.length <= 512)

if (modal && !prevModalRef.current) {
setUserMessage('')
}
}, [userMessage])
prevModalRef.current = modal
}, [userMessage, modal])

function handleAccept() {
if (formik) {
Expand All @@ -77,7 +79,7 @@ const GluuCommitDialog = ({
const renderBadges = (values: any) => {
return (
<div className="d-flex flex-column gap-1 align-items-start">
{values.map((data: any, index: any) => (
{values.map((data: any) => (
<Badge
color={`primary-${selectedTheme} `}
style={{ width: 'fit-content' }}
Expand Down
220 changes: 220 additions & 0 deletions admin-ui/app/routes/Apps/Gluu/GluuFormFooter.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,220 @@
import { useContext, useMemo, useCallback, memo } from 'react'
import { useNavigate } from 'react-router-dom'
import { Button, Divider } from 'Components'
import { useTranslation } from 'react-i18next'
import applicationStyle from 'Routes/Apps/Gluu/styles/applicationstyle'
import { ThemeContext } from 'Context/theme/themeContext'
import { Box } from '@mui/material'

interface ButtonLabelProps {
isLoading: boolean
iconClass: string
label: string
loadingIconClass?: string
}

interface GluuFormFooterBaseProps {
showBack?: boolean
backButtonLabel?: string
onBack?: () => void
disableBack?: boolean
showCancel?: boolean
cancelButtonLabel?: string
onCancel?: () => void
disableCancel?: boolean
showApply?: boolean
disableApply?: boolean
applyButtonLabel?: string
isLoading?: boolean
className?: string
}

type GluuFormFooterProps = GluuFormFooterBaseProps &
(
| { applyButtonType?: 'submit'; onApply?: () => void }
| { applyButtonType: 'button'; onApply: () => void }
)

const ButtonLabel = memo((props: ButtonLabelProps) => {
const { isLoading, iconClass, label, loadingIconClass = 'fa fa-spinner fa-spin' } = props
return (
<>
<i className={`${isLoading ? loadingIconClass : iconClass} me-2`} />
{label}
</>
)
})

ButtonLabel.displayName = 'ButtonLabel'

const BUTTON_STYLE = { ...applicationStyle.buttonStyle, ...applicationStyle.buttonFlexIconStyles }

const GluuFormFooter = ({
showBack,
backButtonLabel,
onBack,
disableBack = false,
showCancel,
cancelButtonLabel,
onCancel,
disableCancel,
showApply,
onApply,
disableApply,
applyButtonType = 'submit',
applyButtonLabel,
isLoading = false,
className = '',
}: GluuFormFooterProps) => {
const { t } = useTranslation()
const theme = useContext(ThemeContext)
const selectedTheme = useMemo(() => theme?.state.theme || 'darkBlack', [theme?.state.theme])
const navigate = useNavigate()

const handleBackClick = useCallback(() => {
if (onBack) {
onBack()
return
}
navigate('/home/dashboard')
}, [onBack, navigate])

const handleCancelClick = useCallback(() => {
if (onCancel) {
onCancel()
}
}, [onCancel])

const buttonStates = useMemo(() => {
const hasAnyButton = Boolean(showBack) || Boolean(showCancel) || Boolean(showApply)
const hasAllThreeButtons = Boolean(showBack) && Boolean(showCancel) && Boolean(showApply)
const hasBackAndCancel = Boolean(showBack) && Boolean(showCancel) && !showApply

return {
showBack: Boolean(showBack),
showCancel: Boolean(showCancel),
showApply: Boolean(showApply),
hasAnyButton,
hasAllThreeButtons,
hasBackAndCancel,
}
}, [showBack, showCancel, showApply])

const buttonColor = useMemo(() => `primary-${selectedTheme}`, [selectedTheme])

const backLabel = useMemo(() => backButtonLabel || t('actions.back'), [backButtonLabel, t])
const cancelLabel = useMemo(
() => cancelButtonLabel || t('actions.cancel'),
[cancelButtonLabel, t],
)
const applyLabel = useMemo(() => applyButtonLabel || t('actions.apply'), [applyButtonLabel, t])

const buttonLayout = useMemo(() => {
if (!buttonStates.hasAnyButton) {
return { back: '', cancel: '', apply: '' }
}

const layout = {
back: buttonStates.showBack ? 'd-flex' : '',
cancel: buttonStates.showCancel ? 'd-flex' : '',
apply: buttonStates.showApply ? 'd-flex' : '',
}

if (buttonStates.showApply) {
layout.apply += ' ms-auto'
if (buttonStates.hasAllThreeButtons) {
layout.apply += ' me-0'
}
} else if (buttonStates.showCancel) {
layout.cancel += ' ms-auto'
}

return layout
}, [buttonStates])

if (!buttonStates.hasAnyButton) {
return null
}

return (
<>
<Divider />
<Box
display="flex"
my={2}
justifyContent="space-between"
alignItems="center"
gap={1}
className={className}
>
{buttonStates.showBack && (
<Button
color={buttonColor}
style={BUTTON_STYLE}
type="button"
onClick={handleBackClick}
className={buttonLayout.back}
disabled={disableBack}
aria-label={backLabel}
>
<ButtonLabel isLoading={false} iconClass="fa fa-arrow-circle-left" label={backLabel} />
</Button>
)}

{buttonStates.showApply && (
<Box className={buttonLayout.apply}>
{applyButtonType === 'submit' ? (
<Button
type="submit"
color={buttonColor}
style={BUTTON_STYLE}
disabled={disableApply || isLoading}
aria-label={applyLabel}
>
<ButtonLabel
isLoading={isLoading}
iconClass="fa fa-check-circle"
label={applyLabel}
/>
</Button>
) : (
<Button
type="button"
color={buttonColor}
style={BUTTON_STYLE}
onClick={onApply}
disabled={disableApply || isLoading}
aria-label={applyLabel}
>
<ButtonLabel
isLoading={isLoading}
iconClass="fa fa-check-circle"
label={applyLabel}
/>
</Button>
)}
</Box>
)}

{buttonStates.showCancel && (
<Button
color={buttonColor}
style={BUTTON_STYLE}
type="button"
onClick={handleCancelClick}
className={`${buttonLayout.cancel}${buttonStates.hasAllThreeButtons ? ' ms-4' : ''}`}
disabled={disableCancel || isLoading}
aria-label={cancelLabel}
>
<ButtonLabel isLoading={false} iconClass="fa fa-undo" label={cancelLabel} />
</Button>
)}
</Box>
</>
)
}

const GluuFormFooterMemoized = memo(GluuFormFooter)
GluuFormFooterMemoized.displayName = 'GluuFormFooter'

export default GluuFormFooterMemoized
5 changes: 2 additions & 3 deletions admin-ui/app/routes/Apps/Gluu/GluuProperties.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,8 @@ function GluuProperties({
}
}
const removeProperty = (position: any) => {
let data = [...properties]
delete data[position]
data = data.filter((element: Property | undefined) => element != null)
const data = [...properties]
data.splice(position, 1)
setProperties(data)

// Sync with formik
Expand Down
22 changes: 15 additions & 7 deletions admin-ui/app/routes/Apps/Gluu/GluuTypeAhead.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const theme = createTheme({

interface GluuTypeAheadProps {
label: string
labelKey?: string
labelKey?: string | ((option: Option) => string)
name: string
value?: Option[]
options: Option[]
Expand Down Expand Up @@ -70,10 +70,13 @@ const GluuTypeAhead = memo(function GluuTypeAhead({
}: GluuTypeAheadProps) {
const { t } = useTranslation()

const selectedValue = useMemo(
() => (value !== undefined ? value : (formik?.values?.[name] as Option[]) || []),
[value, formik, name],
)
const selectedValue = useMemo(() => {
if (value !== undefined) {
return value
}
const fieldValue = formik?.values?.[name]
return Array.isArray(fieldValue) ? (fieldValue as Option[]) : []
}, [value, formik?.values?.[name], name])

const handleChange = useCallback(
(selected: Option[]) => {
Expand All @@ -86,10 +89,15 @@ const GluuTypeAhead = memo(function GluuTypeAhead({
onChange(selected)
}
},
[formik, name, onChange],
[formik?.setFieldValue, name, onChange],
)

const resolvedLabelKey = useMemo(() => labelKey || name, [labelKey, name])
const resolvedLabelKey = useMemo(() => {
if (typeof labelKey === 'function' || typeof labelKey === 'string') {
return labelKey
}
return 'name'
}, [labelKey])

return (
<FormGroup row>
Expand Down
Loading