Skip to content

Commit faada90

Browse files
committed
fix ui
1 parent 2c67d3d commit faada90

File tree

2 files changed

+370
-309
lines changed
  • apps/sim/app/workspace/[workspaceId]/w
    • [workflowId]/components/panel/components/editor/components/sub-block/components/credential-selector
    • components/sidebar/components/settings-modal/components/credential-sets

2 files changed

+370
-309
lines changed

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/credential-selector/credential-selector.tsx

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -217,15 +217,23 @@ export function CredentialSelector({
217217

218218
const { comboboxOptions, comboboxGroups } = useMemo(() => {
219219
const pollingProviderId = getPollingProviderFromOAuth(effectiveProviderId)
220+
// Handle both old ('gmail') and new ('google-email') provider IDs for backwards compatibility
221+
const matchesProvider = (csProviderId: string | null) => {
222+
if (!csProviderId || !pollingProviderId) return false
223+
if (csProviderId === pollingProviderId) return true
224+
// Handle legacy 'gmail' mapping to 'google-email'
225+
if (pollingProviderId === 'google-email' && csProviderId === 'gmail') return true
226+
return false
227+
}
220228
const filteredCredentialSets = pollingProviderId
221-
? credentialSets.filter((cs) => cs.providerId === pollingProviderId)
229+
? credentialSets.filter((cs) => matchesProvider(cs.providerId))
222230
: []
223231

224232
if (canUseCredentialSets && filteredCredentialSets.length > 0) {
225233
const groups = []
226234

227235
groups.push({
228-
section: 'Credential Sets',
236+
section: 'Polling Groups',
229237
items: filteredCredentialSets.map((cs) => ({
230238
label: cs.name,
231239
value: `${CREDENTIAL_SET.PREFIX}${cs.id}`,
@@ -239,12 +247,12 @@ export function CredentialSelector({
239247

240248
if (credentialItems.length > 0) {
241249
groups.push({
242-
section: 'My Credentials',
250+
section: 'Personal Credential',
243251
items: credentialItems,
244252
})
245253
} else {
246254
groups.push({
247-
section: 'My Credentials',
255+
section: 'Personal Credential',
248256
items: [
249257
{
250258
label: `Connect ${getProviderName(provider)} account`,

0 commit comments

Comments
 (0)