From bd356c30df16a535c5b25d36b24635ddd348c00b Mon Sep 17 00:00:00 2001 From: Thomas Gasmyr Date: Wed, 15 Sep 2021 11:43:54 +0100 Subject: [PATCH] fix(admin-ui): problem in saving some fields #221 --- app/locales/en/translation.json | 2 +- app/routes/Apps/Gluu/GluuTypeAheadWithAdd.js | 11 ++++++----- .../auth-server/components/Clients/ClientEditPage.js | 1 + 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/app/locales/en/translation.json b/app/locales/en/translation.json index bf3e4742e..3d4f29616 100644 --- a/app/locales/en/translation.json +++ b/app/locales/en/translation.json @@ -83,7 +83,7 @@ "inum": "Inum", "is_active": "Is Active", "is_expirable_client": "Is Expirable Client?", - "is_trusted_client": "Is Trusted Client", + "is_trusted_client": "Skip Authorization Flow?", "json_web_keys": "JSON Web Keys", "jwks": "Jwks", "jwks_uri": "Jwks Uri", diff --git a/app/routes/Apps/Gluu/GluuTypeAheadWithAdd.js b/app/routes/Apps/Gluu/GluuTypeAheadWithAdd.js index ba8830b5a..bca8bac51 100644 --- a/app/routes/Apps/Gluu/GluuTypeAheadWithAdd.js +++ b/app/routes/Apps/Gluu/GluuTypeAheadWithAdd.js @@ -22,17 +22,17 @@ function GluuTypeAheadWithAdd({ const newItem = document.getElementById(inputId).value document.getElementById(inputId).value = '' if (validator(newItem)) { - setItems((currItems) => [...currItems, newItem]) - setOpts((currOpts) => [...currOpts, newItem]) + items.push(newItem) + opts.push(newItem) + setItems(items) formik.setFieldValue(name, items) } } const handleChange = (name, selected) => { - console.log(selected) - setItems(selected) setOpts(selected) - formik.setFieldValue(name, items) + setItems(selected) + formik.setFieldValue(name, selected); } return ( @@ -63,6 +63,7 @@ function GluuTypeAheadWithAdd({ onChange={(selected) => { handleChange(name, selected) }} + id={name} name={name} multiple={true} diff --git a/plugins/auth-server/components/Clients/ClientEditPage.js b/plugins/auth-server/components/Clients/ClientEditPage.js index 54c8df516..ca4fbfe11 100644 --- a/plugins/auth-server/components/Clients/ClientEditPage.js +++ b/plugins/auth-server/components/Clients/ClientEditPage.js @@ -45,6 +45,7 @@ function ClientEditPage({ const history = useHistory() function handleSubmit(data) { if (data) { + console.log("================================"+JSON.stringify(data)) buildPayload(userAction, data.action_message, data) dispatch(editClient(userAction)) history.push('/auth-server/clients')