From 98cebeebe451841048cac39e306116f6a243c153 Mon Sep 17 00:00:00 2001 From: RAHEEL Date: Thu, 9 May 2024 10:37:14 +0500 Subject: [PATCH 1/3] add source categories --- .../idSource/OAuthForms/GenericOAuthForm.tsx | 18 +++++++--- .../setting/idSource/idSourceConstants.ts | 36 ++++++++++++++----- 2 files changed, 42 insertions(+), 12 deletions(-) diff --git a/client/packages/lowcoder/src/pages/setting/idSource/OAuthForms/GenericOAuthForm.tsx b/client/packages/lowcoder/src/pages/setting/idSource/OAuthForms/GenericOAuthForm.tsx index f88ec0628..0c3e86a26 100644 --- a/client/packages/lowcoder/src/pages/setting/idSource/OAuthForms/GenericOAuthForm.tsx +++ b/client/packages/lowcoder/src/pages/setting/idSource/OAuthForms/GenericOAuthForm.tsx @@ -1,5 +1,5 @@ import { useState } from "react"; -import { messageInstance, CloseEyeIcon } from "lowcoder-design"; +import { messageInstance, CloseEyeIcon, CustomSelect } from "lowcoder-design"; import { i18nObjs, trans } from "i18n"; import { FormStyled, @@ -107,7 +107,7 @@ function GenericOAuthForm(props: GenericOAuthFormProp) { setSaveLoading(true); const { issuer } = values; try { - const res = await axios.get(`${issuer}/.well-known/openid-configuration`); + const res = await axios.get(issuer); setIssuerDetails(() => { const issuer = { authType: AuthType.Generic, @@ -189,6 +189,7 @@ function GenericOAuthForm(props: GenericOAuthFormProp) { current={currentStep} items={steps} style={{marginBottom: '16px'}} + onChange={(current) => setCurrentStep(current)} /> { const valueObject = _.isObject(value) ? (value as ItemType) : false; - const required = true; + let required = (key === "clientId" || key === "clientSecret" || key === "scope"); + required = valueObject ? valueObject.isRequire ?? required : required; const label = valueObject ? valueObject.label : value as string; const tip = valueObject && valueObject.tip; const isPassword = valueObject && valueObject.isPassword; const isIcon = valueObject && valueObject.isIcon; + const isList = valueObject && valueObject.isList; return (
- ) : isIcon ? ( + ) : !isPassword && !isList && isIcon ? ( form1.setFieldValue("sourceIcon", value)} label={'Source Icon'} value={form1.getFieldValue('sourceIcon')} /> + ) : !isPassword && isList && !isIcon ? ( + ) : ( { + const value = AuthCategoriesEnum[cat as AuthCategoriesEnumKey]; + return { + label: value, + value: cat + } + } +); + + export const validatorOptions = []; export const clientIdandSecretConfig = { @@ -70,15 +90,15 @@ export const authConfig = { form: { source: { label: "Source", isRequire: true }, sourceName: { label: "Source Name", isRequire: true }, - sourceDescription: { label: "Source Description" }, - sourceIcon: { label: "Source Icon", isIcon: true }, - sourceCategory: { label: "Source Category" }, + sourceDescription: { label: "Source Description", isRequire: false }, + sourceIcon: { label: "Source Icon", isIcon: true, isRequire: true, }, + sourceCategory: { label: "Source Category", isRequire: true, isList: true, options: AuthCategories }, ...clientIdandSecretConfig, - issuer: { label: 'Issuer URI', isRequired: true }, - authorizationEndpoint: { label: 'Authorization Endpoint', isRequired: true }, - tokenEndpoint: { label: 'Token Endpoint', isRequired: true }, - userInfoEndpoint: { label: 'UserInfo Endpoint', isRequired: true }, - // jwks: { label: 'Authorize URL', isRequired: true }, + issuer: { label: 'Issuer URI', isRequire: true }, + authorizationEndpoint: { label: 'Authorization Endpoint', isRequire: true }, + tokenEndpoint: { label: 'Token Endpoint', isRequire: true }, + userInfoEndpoint: { label: 'UserInfo Endpoint', isRequire: true }, + // jwks: { label: 'Authorize URL', isRequire: true }, scope: "Scope", // baseUrl: "Base URL", // realm: "Realm", From 3d1d6d8edd75d9ee7fb6580b4815b6db8bafd592 Mon Sep 17 00:00:00 2001 From: RAHEEL Date: Thu, 9 May 2024 10:39:44 +0500 Subject: [PATCH 2/3] remove console --- .../src/pages/setting/idSource/OAuthForms/GenericOAuthForm.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/client/packages/lowcoder/src/pages/setting/idSource/OAuthForms/GenericOAuthForm.tsx b/client/packages/lowcoder/src/pages/setting/idSource/OAuthForms/GenericOAuthForm.tsx index 0c3e86a26..f925d0493 100644 --- a/client/packages/lowcoder/src/pages/setting/idSource/OAuthForms/GenericOAuthForm.tsx +++ b/client/packages/lowcoder/src/pages/setting/idSource/OAuthForms/GenericOAuthForm.tsx @@ -155,7 +155,6 @@ function GenericOAuthForm(props: GenericOAuthFormProp) { } }; saveAuthProvider(updatedDetails); - console.log('save details', updatedDetails); return updatedDetails; }); }) From dff471325f34c19de9811d279c042c48347af077 Mon Sep 17 00:00:00 2001 From: RAHEEL Date: Thu, 9 May 2024 10:55:34 +0500 Subject: [PATCH 3/3] fix comps search --- client/packages/lowcoder/src/pages/editor/right/uiCompPanel.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/packages/lowcoder/src/pages/editor/right/uiCompPanel.tsx b/client/packages/lowcoder/src/pages/editor/right/uiCompPanel.tsx index 7ad807670..068713dab 100644 --- a/client/packages/lowcoder/src/pages/editor/right/uiCompPanel.tsx +++ b/client/packages/lowcoder/src/pages/editor/right/uiCompPanel.tsx @@ -145,7 +145,7 @@ export const UICompPanel = () => { const compList = useMemo( () => Object.entries(categories) - .filter(([key]) => !(!isEmpty(searchValue) && (key as UICompCategory) === "dashboards")) + // .filter(([key]) => !(!isEmpty(searchValue) && (key as UICompCategory) === "dashboards")) .map(([key, value], index) => { let infos = value; if (!isEmpty(searchValue)) {