Skip to content

fix(editor): Always show auth mode dropdown in credential modal#26280

Merged
elsmr merged 3 commits intomasterfrom
node-4511-always-show-dropdown-for-auth-mode-selection
Mar 3, 2026
Merged

fix(editor): Always show auth mode dropdown in credential modal#26280
elsmr merged 3 commits intomasterfrom
node-4511-always-show-dropdown-for-auth-mode-selection

Conversation

@elsmr
Copy link
Member

@elsmr elsmr commented Feb 26, 2026

Summary

Even when there are only 2 options, show the dropdown instead of a link.

image

Related Linear tickets, Github issues, and Community forum posts

https://linear.app/n8n/issue/NODE-4511/always-show-dropdown-for-auth-mode-selection

Review / Merge checklist

  • PR title and summary are descriptive. (conventions)
  • Docs updated or follow-up ticket created.
  • Tests included.
  • PR Labeled with release/backport (if the PR is an urgent fix that needs to be backported)

@elsmr elsmr added release/backport Pull request is a backport or needs to be backported. Backport to Beta labels Feb 26, 2026
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cubic analysis

No issues found across 7 files

Linked issue analysis

Linked issue: NODE-4511: Always show dropdown for auth mode selection

Status Acceptance criteria Notes
Always show dropdown for auth mode selection (use dropdown even when only 2 options) Removed switch link and render dropdown when options.length >= 2
Preserve dropdown behavior for 3+ auth options Tests still assert and exercise dropdown for 3+ options
Update unit tests to expect dropdown instead of switch link Unit tests updated to open dropdown and click menu items
Update e2e Playwright tests/helpers to use dropdown selection instead of switch link Playwright test now selects via dropdown and helper removed switch link getter
Architecture diagram
sequenceDiagram
    *   participant User
    *   participant CC as CredentialConfig (Vue)
    *   participant CMS as CredentialModeSelector (Vue)
    *   participant Stores as Pinia Stores (Credentials/NDV)

    Note over User,Stores: Credential Modal Initialization (New or Edit)

    CC->>Stores: Check permissions & mode
    Stores-->>CC: canWrite: true, mode: 'new' | 'edit'

    CC->>CC: CHANGED: Evaluate visibility (canWrite only)
    
    opt canWrite is true
        CC->>CMS: Render with CredentialType
        CMS->>Stores: Get node configuration & auth options
        Stores-->>CMS: List of auth modes (e.g., OAuth2, Header Auth)

        CMS->>CMS: CHANGED: Calculate dropdown visibility (options >= 2)
        
        alt Options >= 2
            CMS->>User: Display Dropdown Trigger
        else Single Option
            CMS->>User: Hide Selector
        end
    end

    Note over User,CMS: User Interaction

    User->>CMS: Click Dropdown Trigger
    CMS->>User: Show Dropdown Menu Items

    User->>CMS: Select Auth Mode
    CMS->>CC: CHANGED: Emit update:authType(selectedMode)
    CC->>Stores: Update node parameters / credential state
    CC->>User: Refresh fields for selected auth mode
Loading

@codecov
Copy link

codecov bot commented Feb 26, 2026

Codecov Report

❌ Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...mponents/CredentialEdit/CredentialModeSelector.vue 66.66% 0 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@codecov
Copy link

codecov bot commented Feb 26, 2026

Bundle Report

Changes will decrease total bundle size by 1.82kB (-0.0%) ⬇️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
editor-ui-esm 42.44MB -1.82kB (-0.0%) ⬇️

Affected Assets, Files, and Routes:

view changes for bundle: editor-ui-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
assets/index-*.js -1.37kB 1.14MB -0.12%
assets/index-*.css -222 bytes 770.98kB -0.03%
assets/_MapCache-*.js -231 bytes 574.33kB -0.04%

Files in assets/index-*.js:

  • ./src/features/credentials/components/CredentialEdit/CredentialConfig.vue → Total Size: 374 bytes

  • ./src/features/credentials/components/CredentialEdit/CredentialModeSelector.vue → Total Size: 398 bytes

@n8n-assistant n8n-assistant bot added the n8n team Authored by the n8n team label Feb 26, 2026
@blacksmith-sh

This comment has been minimized.

@elsmr elsmr added this pull request to the merge queue Mar 3, 2026
Merged via the queue into master with commit 8ac25b8 Mar 3, 2026
44 checks passed
@elsmr elsmr deleted the node-4511-always-show-dropdown-for-auth-mode-selection branch March 3, 2026 09:08
@n8n-assistant n8n-assistant bot mentioned this pull request Mar 4, 2026
This was referenced Mar 4, 2026
@n8n-assistant n8n-assistant bot mentioned this pull request Mar 4, 2026
@n8n-assistant
Copy link
Contributor

n8n-assistant bot commented Mar 4, 2026

Got released with n8n@2.10.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Backport to Beta Backport to Stable n8n team Authored by the n8n team release/backport Pull request is a backport or needs to be backported. Released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants