Skip to content

Commit f58356f

Browse files
committed
fix(connectors): align connector scopes with oauth config and fix kb modal UX
1 parent 5b9f0d7 commit f58356f

File tree

7 files changed

+14
-18
lines changed

7 files changed

+14
-18
lines changed

apps/sim/app/workspace/[workspaceId]/knowledge/[id]/components/add-connector-modal/add-connector-modal.tsx

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ export function AddConnectorModal({ open, onOpenChange, knowledgeBaseId }: AddCo
5757
const [showOAuthModal, setShowOAuthModal] = useState(false)
5858

5959
const [apiKeyValue, setApiKeyValue] = useState('')
60+
const [apiKeyFocused, setApiKeyFocused] = useState(false)
6061
const [searchTerm, setSearchTerm] = useState('')
6162

6263
const { workspaceId } = useParams<{ workspaceId: string }>()
@@ -235,10 +236,12 @@ export function AddConnectorModal({ open, onOpenChange, knowledgeBaseId }: AddCo
235236
: 'API Key'}
236237
</Label>
237238
<Input
238-
type='password'
239+
type={apiKeyFocused ? 'text' : 'password'}
239240
autoComplete='new-password'
240241
value={apiKeyValue}
241242
onChange={(e) => setApiKeyValue(e.target.value)}
243+
onFocus={() => setApiKeyFocused(true)}
244+
onBlur={() => setApiKeyFocused(false)}
242245
placeholder={
243246
connectorConfig.auth.mode === 'apiKey' && connectorConfig.auth.placeholder
244247
? connectorConfig.auth.placeholder
@@ -345,17 +348,7 @@ export function AddConnectorModal({ open, onOpenChange, knowledgeBaseId }: AddCo
345348
>
346349
<Checkbox
347350
checked={!disabledTagIds.has(tagDef.id)}
348-
onCheckedChange={(checked) => {
349-
setDisabledTagIds((prev) => {
350-
const next = new Set(prev)
351-
if (checked) {
352-
next.delete(tagDef.id)
353-
} else {
354-
next.add(tagDef.id)
355-
}
356-
return next
357-
})
358-
}}
351+
onCheckedChange={() => {}}
359352
/>
360353
<span className='text-[var(--text-primary)]'>{tagDef.displayName}</span>
361354
<span className='text-[11px] text-[var(--text-muted)]'>

apps/sim/app/workspace/[workspaceId]/knowledge/[id]/components/connectors-section/connectors-section.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,6 @@ export function ConnectorsSection({
130130

131131
return (
132132
<div className='mt-[16px]'>
133-
<h2 className='font-medium text-[14px] text-[var(--text-secondary)]'>Connected Sources</h2>
134-
135133
{error && (
136134
<p className='mt-[8px] text-[12px] text-[var(--text-error)] leading-tight'>{error}</p>
137135
)}

apps/sim/connectors/github/github.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,11 @@ export const githubConnector: ConnectorConfig = {
158158
version: '1.0.0',
159159
icon: GithubIcon,
160160

161-
auth: { mode: 'oauth', provider: 'github', requiredScopes: ['repo'] },
161+
auth: {
162+
mode: 'apiKey',
163+
label: 'Personal Access Token',
164+
placeholder: 'ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
165+
},
162166

163167
configFields: [
164168
{

apps/sim/connectors/gmail/gmail.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ export const gmailConnector: ConnectorConfig = {
291291
auth: {
292292
mode: 'oauth',
293293
provider: 'google-email',
294-
requiredScopes: ['https://www.googleapis.com/auth/gmail.readonly'],
294+
requiredScopes: ['https://www.googleapis.com/auth/gmail.modify'],
295295
},
296296

297297
configFields: [

apps/sim/connectors/google-calendar/google-calendar.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ export const googleCalendarConnector: ConnectorConfig = {
237237
auth: {
238238
mode: 'oauth',
239239
provider: 'google-calendar',
240-
requiredScopes: ['https://www.googleapis.com/auth/calendar.readonly'],
240+
requiredScopes: ['https://www.googleapis.com/auth/calendar'],
241241
},
242242

243243
configFields: [

apps/sim/connectors/google-sheets/google-sheets.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ export const googleSheetsConnector: ConnectorConfig = {
171171
auth: {
172172
mode: 'oauth',
173173
provider: 'google-sheets',
174-
requiredScopes: ['https://www.googleapis.com/auth/spreadsheets.readonly'],
174+
requiredScopes: ['https://www.googleapis.com/auth/drive'],
175175
},
176176

177177
configFields: [

apps/sim/connectors/reddit/reddit.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@ export const redditConnector: ConnectorConfig = {
241241
auth: {
242242
mode: 'oauth',
243243
provider: 'reddit',
244+
requiredScopes: ['read'],
244245
},
245246

246247
configFields: [

0 commit comments

Comments
 (0)