Skip to content

Commit

Permalink
fix(admin-ui): jans-link save in admin-ui not working due changes in …
Browse files Browse the repository at this point in the history
…api #1194
  • Loading branch information
jv18creator committed Jul 14, 2023
1 parent 32b169d commit 8551fc7
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ const cachRefreshState = {
snapshotMaxCount: null,
ldapSearchSizeLimit: null,
keepExternalPerson: null,
cacheRefreshServerIpAddress: null,
vdsCacheRefreshPollingInterval: null,
vdsCacheRefreshEnabled: null,
serverIpAddress: null,
pollingInterval: null,
linkEnabled: null,
attributeMapping: [],
vdsCacheRefreshProblemCount: null,
vdsCacheRefreshLastUpdateCount: null,
problemCount: null,
lastUpdateCount: null,
},
};

Expand All @@ -51,8 +51,8 @@ it("Should render cache refresh management page properly", () => {
render(<JansLinkPage />, {
wrapper: Wrapper,
});
screen.getByText(`${t("menus.cacherefresh")}`);
const cacheRefreshLink = screen.getByText(`${t("menus.cacherefresh")}`);

const cacheRefreshLink = screen.getByText(`${t("menus.cache_refresh")}`);
expect(cacheRefreshLink).toBeInTheDocument();

const customerBackendKeyAttributesLink = screen.getByText(
Expand Down
46 changes: 23 additions & 23 deletions admin-ui/plugins/jans-link/components/Tabs/CacheRefreshTab.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ const CacheRefreshTab = () => {
snapshotMaxCount = null,
ldapSearchSizeLimit = null,
keepExternalPerson = null,
cacheRefreshServerIpAddress = null,
vdsCacheRefreshPollingInterval = null,
vdsCacheRefreshEnabled = null,
serverIpAddress = null,
pollingInterval = null,
linkEnabled = null,
attributeMapping = [],
vdsCacheRefreshProblemCount = null,
vdsCacheRefreshLastUpdateCount = null,
vdsCacheRefreshLastUpdate = null,
problemCount = null,
lastUpdateCount = null,
lastUpdate = null,
} = useSelector((state) => state.cacheRefreshReducer.configuration)

const initialValues = {
Expand All @@ -48,13 +48,13 @@ const CacheRefreshTab = () => {
snapshotMaxCount,
ldapSearchSizeLimit,
keepExternalPerson,
cacheRefreshServerIpAddress,
vdsCacheRefreshPollingInterval,
vdsCacheRefreshEnabled,
serverIpAddress,
pollingInterval,
linkEnabled,
attributeMapping,
vdsCacheRefreshProblemCount,
vdsCacheRefreshLastUpdateCount,
vdsCacheRefreshLastUpdate,
problemCount,
lastUpdateCount,
lastUpdate,
}

const formik = useFormik({
Expand Down Expand Up @@ -102,7 +102,7 @@ const CacheRefreshTab = () => {
: [],
},
})
console.log(`userAction`, userAction)

dispatch(
putCacheRefreshConfiguration({ action: userAction })
)
Expand All @@ -121,19 +121,19 @@ const CacheRefreshTab = () => {
<Col sm={12}>
<Row>
<GluuLabel label={'fields.last_run'} size={3} />
<Col sm={9}>{formik.values.vdsCacheRefreshLastUpdate}</Col>
<Col sm={9}>{formik.values.lastUpdate}</Col>
</Row>
</Col>
<Col sm={12}>
<Row className='my-3'>
<GluuLabel label={'fields.updates_at_last_run'} size={3} />
<Col sm={9}>{formik.values.vdsCacheRefreshLastUpdateCount}</Col>
<Col sm={9}>{formik.values.lastUpdateCount}</Col>
</Row>
</Col>
<Col sm={12}>
<Row className='mb-3'>
<GluuLabel label={'fields.problems_at_last_run'} size={3} />
<Col sm={9}>{formik.values.vdsCacheRefreshProblemCount}</Col>
<Col sm={9}>{formik.values.problemCount}</Col>
</Row>
</Col>
<Col sm={12}>
Expand Down Expand Up @@ -232,8 +232,8 @@ const CacheRefreshTab = () => {
<Col sm={12}>
<GluuInputRow
label='fields.server_ip_address'
name='cacheRefreshServerIpAddress'
value={formik.values.cacheRefreshServerIpAddress}
name='serverIpAddress'
value={formik.values.serverIpAddress}
formik={formik}
lsize={3}
rsize={9}
Expand All @@ -242,9 +242,9 @@ const CacheRefreshTab = () => {
<Col sm={12}>
<GluuInputRow
label='fields.polling_interval_mins'
name='vdsCacheRefreshPollingInterval'
name='pollingInterval'
type='number'
value={formik.values.vdsCacheRefreshPollingInterval}
value={formik.values.pollingInterval}
formik={formik}
lsize={3}
rsize={9}
Expand All @@ -264,13 +264,13 @@ const CacheRefreshTab = () => {
<Col sm={12}>
<GluuCheckBoxRow
label='fields.cache_refresh'
name='vdsCacheRefreshEnabled'
name='linkEnabled'
handleOnChange={(e) => {
formik.setFieldValue('vdsCacheRefreshEnabled', e.target.checked)
formik.setFieldValue('linkEnabled', e.target.checked)
}}
lsize={3}
rsize={9}
value={formik.values.vdsCacheRefreshEnabled}
value={formik.values.linkEnabled}
/>
</Col>
</FormGroup>
Expand Down
6 changes: 4 additions & 2 deletions admin-ui/plugins/jans-link/components/Tabs/InumDBServerTab.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ const InumDBServerTab = () => {
servers: targetConfig?.servers || [],
baseDNs: targetConfig?.baseDNs || [],
bindPassword: targetConfig?.bindPassword || null,
configId: targetConfig?.configId || null,
bindDN: targetConfig?.bindDN || null
},
}

Expand All @@ -62,10 +64,10 @@ const InumDBServerTab = () => {
is: false,
then: () =>
Yup.object({
configId: Yup.string().required(
configId: Yup.string().min(2, 'Mininum 2 characters').required(
`${t('fields.name')} ${t('messages.is_required')}`
),
bindDN: Yup.string().required(
bindDN: Yup.string().min(2, 'Mininum 2 characters').required(
`${t('fields.bind_dn')} ${t('messages.is_required')}`
),
maxConnections: Yup.string().required(
Expand Down

0 comments on commit 8551fc7

Please sign in to comment.