Skip to content

fix: Modify the data source configuration, clicking the save button in the upper right corner will make the changes effective#1807

Open
xuanlid wants to merge 1 commit into
opentiny:developfrom
xuanlid:fix/datasource
Open

fix: Modify the data source configuration, clicking the save button in the upper right corner will make the changes effective#1807
xuanlid wants to merge 1 commit into
opentiny:developfrom
xuanlid:fix/datasource

Conversation

@xuanlid
Copy link
Copy Markdown
Contributor

@xuanlid xuanlid commented May 20, 2026

English | 简体中文

PR

数据源

PR Checklist

Please check if your PR fulfills the following requirements:

  • The commit message follows our Commit Message Guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • Built its own designer, fully self-validated

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

Background and solution

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Summary by CodeRabbit

  • Refactor
    • Improved remote data source configuration handling to better manage settings and configuration retrieval.

Review Change Stack

@github-actions github-actions Bot added the bug Something isn't working label May 20, 2026
@xuanlid xuanlid changed the title fix: 在仅需修改数据源“请求参数JSON”配置或“请求处理”相关配置时,点右上角保存有效 fix: Modify the data source configuration, clicking the save button in the upper right corner will make the changes effective May 20, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 20, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 3b04d225-db6c-4e81-8a58-7ab856df79e1

📥 Commits

Reviewing files that changed from the base of the PR and between 59e8548 and 98cb7e0.

📒 Files selected for processing (3)
  • packages/plugins/datasource/src/DataSourceForm.vue
  • packages/plugins/datasource/src/DataSourceSettingRemote.vue
  • packages/plugins/datasource/src/DataSourceSettings.vue

Walkthrough

This PR refactors how remote data source configuration flows through the form component hierarchy. Instead of reading static remote config from application state during save, the form now derives the config on-demand from the remote settings component, ensuring the saved payload always includes current values.

Changes

Remote Config Derivation in Data Source Form

Layer / File(s) Summary
Remote config extraction from settings
packages/plugins/datasource/src/DataSourceSettingRemote.vue
A new getRemoteConfig() method rebuilds the remote request configuration by parsing the stored options.params string back into an object and merging current remote options with remote adapter editor values. Component emits declaration is extended to include update:modelValue.
Config exposure through parent container
packages/plugins/datasource/src/DataSourceSettings.vue
Template ref remoteRef captures the remote child component instance. A new getRemoteConfig() method safely delegates to the child's getRemoteConfig() with fallback to {}, and both are exposed in the component instance API.
Form save payload uses derived config
packages/plugins/datasource/src/DataSourceForm.vue
The save() method now derives a local remoteConfig from settingRef.getRemoteConfig() at call time and spreads this into add/update request payloads, replacing prior reads from dataSourceState.remoteConfig.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related issues

Poem

🐰 Configs dance through components with grace,
No state store needed in this place,
Just ask the settings, get what you need,
And save flows fresh with each deed!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title describes fixing save functionality for data source configuration changes, which aligns with the core implementation—exposing getRemoteConfig() to properly save remote configuration when modified.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants