Skip to content

Commit 4c82a43

Browse files
committed
fix(admin-ui): jans-link save in admin-ui not working due changes in api #1194
1 parent c26c891 commit 4c82a43

File tree

3 files changed

+34
-32
lines changed

3 files changed

+34
-32
lines changed

admin-ui/plugins/jans-link/components/CacheRefresh/JansLinkPage.test.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ const cachRefreshState = {
1919
snapshotMaxCount: null,
2020
ldapSearchSizeLimit: null,
2121
keepExternalPerson: null,
22-
cacheRefreshServerIpAddress: null,
23-
vdsCacheRefreshPollingInterval: null,
24-
vdsCacheRefreshEnabled: null,
22+
serverIpAddress: null,
23+
pollingInterval: null,
24+
linkEnabled: null,
2525
attributeMapping: [],
26-
vdsCacheRefreshProblemCount: null,
27-
vdsCacheRefreshLastUpdateCount: null,
26+
problemCount: null,
27+
lastUpdateCount: null,
2828
},
2929
};
3030

@@ -51,8 +51,8 @@ it("Should render cache refresh management page properly", () => {
5151
render(<JansLinkPage />, {
5252
wrapper: Wrapper,
5353
});
54-
screen.getByText(`${t("menus.cacherefresh")}`);
55-
const cacheRefreshLink = screen.getByText(`${t("menus.cacherefresh")}`);
54+
55+
const cacheRefreshLink = screen.getByText(`${t("menus.cache_refresh")}`);
5656
expect(cacheRefreshLink).toBeInTheDocument();
5757

5858
const customerBackendKeyAttributesLink = screen.getByText(

admin-ui/plugins/jans-link/components/Tabs/CacheRefreshTab.js

+23-23
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ const CacheRefreshTab = () => {
3333
snapshotMaxCount = null,
3434
ldapSearchSizeLimit = null,
3535
keepExternalPerson = null,
36-
cacheRefreshServerIpAddress = null,
37-
vdsCacheRefreshPollingInterval = null,
38-
vdsCacheRefreshEnabled = null,
36+
serverIpAddress = null,
37+
pollingInterval = null,
38+
linkEnabled = null,
3939
attributeMapping = [],
40-
vdsCacheRefreshProblemCount = null,
41-
vdsCacheRefreshLastUpdateCount = null,
42-
vdsCacheRefreshLastUpdate = null,
40+
problemCount = null,
41+
lastUpdateCount = null,
42+
lastUpdate = null,
4343
} = useSelector((state) => state.cacheRefreshReducer.configuration)
4444

4545
const initialValues = {
@@ -48,13 +48,13 @@ const CacheRefreshTab = () => {
4848
snapshotMaxCount,
4949
ldapSearchSizeLimit,
5050
keepExternalPerson,
51-
cacheRefreshServerIpAddress,
52-
vdsCacheRefreshPollingInterval,
53-
vdsCacheRefreshEnabled,
51+
serverIpAddress,
52+
pollingInterval,
53+
linkEnabled,
5454
attributeMapping,
55-
vdsCacheRefreshProblemCount,
56-
vdsCacheRefreshLastUpdateCount,
57-
vdsCacheRefreshLastUpdate,
55+
problemCount,
56+
lastUpdateCount,
57+
lastUpdate,
5858
}
5959

6060
const formik = useFormik({
@@ -102,7 +102,7 @@ const CacheRefreshTab = () => {
102102
: [],
103103
},
104104
})
105-
console.log(`userAction`, userAction)
105+
106106
dispatch(
107107
putCacheRefreshConfiguration({ action: userAction })
108108
)
@@ -121,19 +121,19 @@ const CacheRefreshTab = () => {
121121
<Col sm={12}>
122122
<Row>
123123
<GluuLabel label={'fields.last_run'} size={3} />
124-
<Col sm={9}>{formik.values.vdsCacheRefreshLastUpdate}</Col>
124+
<Col sm={9}>{formik.values.lastUpdate}</Col>
125125
</Row>
126126
</Col>
127127
<Col sm={12}>
128128
<Row className='my-3'>
129129
<GluuLabel label={'fields.updates_at_last_run'} size={3} />
130-
<Col sm={9}>{formik.values.vdsCacheRefreshLastUpdateCount}</Col>
130+
<Col sm={9}>{formik.values.lastUpdateCount}</Col>
131131
</Row>
132132
</Col>
133133
<Col sm={12}>
134134
<Row className='mb-3'>
135135
<GluuLabel label={'fields.problems_at_last_run'} size={3} />
136-
<Col sm={9}>{formik.values.vdsCacheRefreshProblemCount}</Col>
136+
<Col sm={9}>{formik.values.problemCount}</Col>
137137
</Row>
138138
</Col>
139139
<Col sm={12}>
@@ -232,8 +232,8 @@ const CacheRefreshTab = () => {
232232
<Col sm={12}>
233233
<GluuInputRow
234234
label='fields.server_ip_address'
235-
name='cacheRefreshServerIpAddress'
236-
value={formik.values.cacheRefreshServerIpAddress}
235+
name='serverIpAddress'
236+
value={formik.values.serverIpAddress}
237237
formik={formik}
238238
lsize={3}
239239
rsize={9}
@@ -242,9 +242,9 @@ const CacheRefreshTab = () => {
242242
<Col sm={12}>
243243
<GluuInputRow
244244
label='fields.polling_interval_mins'
245-
name='vdsCacheRefreshPollingInterval'
245+
name='pollingInterval'
246246
type='number'
247-
value={formik.values.vdsCacheRefreshPollingInterval}
247+
value={formik.values.pollingInterval}
248248
formik={formik}
249249
lsize={3}
250250
rsize={9}
@@ -264,13 +264,13 @@ const CacheRefreshTab = () => {
264264
<Col sm={12}>
265265
<GluuCheckBoxRow
266266
label='fields.cache_refresh'
267-
name='vdsCacheRefreshEnabled'
267+
name='linkEnabled'
268268
handleOnChange={(e) => {
269-
formik.setFieldValue('vdsCacheRefreshEnabled', e.target.checked)
269+
formik.setFieldValue('linkEnabled', e.target.checked)
270270
}}
271271
lsize={3}
272272
rsize={9}
273-
value={formik.values.vdsCacheRefreshEnabled}
273+
value={formik.values.linkEnabled}
274274
/>
275275
</Col>
276276
</FormGroup>

admin-ui/plugins/jans-link/components/Tabs/InumDBServerTab.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ const InumDBServerTab = () => {
3939
servers: targetConfig?.servers || [],
4040
baseDNs: targetConfig?.baseDNs || [],
4141
bindPassword: targetConfig?.bindPassword || null,
42+
configId: targetConfig?.configId || null,
43+
bindDN: targetConfig?.bindDN || null
4244
},
4345
}
4446

@@ -62,10 +64,10 @@ const InumDBServerTab = () => {
6264
is: false,
6365
then: () =>
6466
Yup.object({
65-
configId: Yup.string().required(
67+
configId: Yup.string().min(2, 'Mininum 2 characters').required(
6668
`${t('fields.name')} ${t('messages.is_required')}`
6769
),
68-
bindDN: Yup.string().required(
70+
bindDN: Yup.string().min(2, 'Mininum 2 characters').required(
6971
`${t('fields.bind_dn')} ${t('messages.is_required')}`
7072
),
7173
maxConnections: Yup.string().required(

0 commit comments

Comments
 (0)