From 411a91122bcef60512fc41e0a7ea0c48f4475b85 Mon Sep 17 00:00:00 2001 From: johnnyjoy Date: Thu, 24 Apr 2025 10:11:35 +0800 Subject: [PATCH] fix: linter error --- .../CreateIdentityProviderDialog.tsx | 32 +++++++++++++------ 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/web/src/components/CreateIdentityProviderDialog.tsx b/web/src/components/CreateIdentityProviderDialog.tsx index 025ecefb8..d24164735 100644 --- a/web/src/components/CreateIdentityProviderDialog.tsx +++ b/web/src/components/CreateIdentityProviderDialog.tsx @@ -23,11 +23,11 @@ const templateList: IdentityProvider[] = [ tokenUrl: "https://github.com/login/oauth/access_token", userInfoUrl: "https://api.github.com/user", scopes: ["read:user"], - fieldMapping: { + fieldMapping: FieldMapping.fromPartial({ identifier: "login", displayName: "name", email: "email", - }, + }), }, }, }, @@ -44,11 +44,11 @@ const templateList: IdentityProvider[] = [ tokenUrl: "https://gitlab.com/oauth/token", userInfoUrl: "https://gitlab.com/oauth/userinfo", scopes: ["openid"], - fieldMapping: { + fieldMapping: FieldMapping.fromPartial({ identifier: "name", displayName: "name", email: "email", - }, + }), }, }, }, @@ -65,11 +65,11 @@ const templateList: IdentityProvider[] = [ tokenUrl: "https://oauth2.googleapis.com/token", userInfoUrl: "https://www.googleapis.com/oauth2/v2/userinfo", scopes: ["https://www.googleapis.com/auth/userinfo.email", "https://www.googleapis.com/auth/userinfo.profile"], - fieldMapping: { + fieldMapping: FieldMapping.fromPartial({ identifier: "email", displayName: "name", email: "email", - }, + }), }, }, }, @@ -86,11 +86,11 @@ const templateList: IdentityProvider[] = [ tokenUrl: "", userInfoUrl: "", scopes: [], - fieldMapping: { + fieldMapping: FieldMapping.fromPartial({ identifier: "", displayName: "", email: "", - }, + }), }, }, }, @@ -117,11 +117,11 @@ const CreateIdentityProviderDialog: React.FC = (props: Props) => { tokenUrl: "", userInfoUrl: "", scopes: [], - fieldMapping: { + fieldMapping: FieldMapping.fromPartial({ identifier: "", displayName: "", email: "", - }, + }), }); const [oauth2Scopes, setOAuth2Scopes] = useState(""); const [selectedTemplate, setSelectedTemplate] = useState("GitHub"); @@ -418,6 +418,18 @@ const CreateIdentityProviderDialog: React.FC = (props: Props) => { } fullWidth /> + + Avatar URL + + + setPartialOAuth2Config({ fieldMapping: { ...oauth2Config.fieldMapping, avatarUrl: e.target.value } as FieldMapping }) + } + fullWidth + /> )}