Skip to content

feat: refactor modals to use Dialog component and add tests for ApiKeyModal and ProviderConfigModal#35550

Merged
CodingOnStar merged 3 commits intomainfrom
fix/portal2dialog
Apr 24, 2026
Merged

feat: refactor modals to use Dialog component and add tests for ApiKeyModal and ProviderConfigModal#35550
CodingOnStar merged 3 commits intomainfrom
fix/portal2dialog

Conversation

@CodingOnStar
Copy link
Copy Markdown
Contributor

@CodingOnStar CodingOnStar commented Apr 24, 2026

Important

  1. Make sure you have read our contribution guidelines
  2. Ensure there is an associated issue and you have been assigned to it
  3. Use the correct syntax to link this PR: Fixes #<issue number>.

Summary

  • Replaced Modal with Dialog in ApiKeyModal and ProviderConfigModal for improved UI consistency.
  • Updated handling of modal open/close states.
  • Added comprehensive tests for ProviderConfigModal, covering various tracing provider configurations.
  • Enhanced ApiKeyModal tests to validate form schema handling and submission logic.

Checklist

  • This change requires a documentation update, included: Dify Document
  • I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.
  • I ran make lint && make type-check (backend) and cd web && pnpm exec vp staged (frontend) to appease the lint gods

Fixes #35456
Fixes #35548

…yModal and ProviderConfigModal

- Replaced Modal with Dialog in ApiKeyModal and ProviderConfigModal for improved UI consistency.
- Updated handling of modal open/close states.
- Added comprehensive tests for ProviderConfigModal, covering various tracing provider configurations.
- Enhanced ApiKeyModal tests to validate form schema handling and submission logic.
@github-actions github-actions Bot added the web This relates to changes on the web. label Apr 24, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 24, 2026

Codecov Report

❌ Patch coverage is 97.77778% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 85.59%. Comparing base (be4c828) to head (c41e9a6).
⚠️ Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
...omponents/plugins/plugin-auth/authorized/index.tsx 93.75% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #35550      +/-   ##
==========================================
- Coverage   85.59%   85.59%   -0.01%     
==========================================
  Files        4444     4452       +8     
  Lines      208236   208636     +400     
  Branches    38896    39044     +148     
==========================================
+ Hits       178238   178577     +339     
- Misses      26853    26914      +61     
  Partials     3145     3145              
Flag Coverage Δ
dify-ui 93.01% <ø> (ø)
web 86.49% <97.77%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

…Modal and ProviderConfigModal

- Updated state management for modal visibility in ApiKeyModal and ProviderConfigModal to use controlled components.
- Refactored modal open/close logic for better clarity and consistency.
- Improved tests for ApiKeyModal to ensure proper handling of open state and interactions.
- Enhanced ProviderConfigModal tests to cover additional scenarios and edge cases.
@CodingOnStar CodingOnStar marked this pull request as ready for review April 24, 2026 08:36
@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. javascript Pull requests that update javascript code labels Apr 24, 2026
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Apr 24, 2026
@CodingOnStar
Copy link
Copy Markdown
Contributor Author

#35456
#35548

@CodingOnStar CodingOnStar enabled auto-merge April 24, 2026 08:39
@CodingOnStar CodingOnStar added this pull request to the merge queue Apr 24, 2026
Merged via the queue into main with commit 7002512 Apr 24, 2026
34 checks passed
@CodingOnStar CodingOnStar deleted the fix/portal2dialog branch April 24, 2026 08:52
asukaminato0721 pushed a commit to asukaminato0721/dify that referenced this pull request Apr 24, 2026
…yModal and ProviderConfigModal (langgenius#35550)

Co-authored-by: CodingOnStar <hanxujiang@dify.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

javascript Pull requests that update javascript code lgtm This PR has been approved by a maintainer size:L This PR changes 100-499 lines, ignoring generated files. web This relates to changes on the web.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tracing provider config form closes when clicking inside the form when add api-key the modal auto closed

2 participants