Skip to content

feat: update platform plugin license filtering#1742

Merged
ZhangSetSail merged 1 commit intomainfrom
0407-dev
Apr 8, 2026
Merged

feat: update platform plugin license filtering#1742
ZhangSetSail merged 1 commit intomainfrom
0407-dev

Conversation

@ZhangSetSail
Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings April 8, 2026 02:51
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the platform plugin list UI to distinguish free vs commercial plugins and gate commercial plugin installation behind a valid enterprise license.

Changes:

  • Adds licenseValid state sourced from region/getEnterpriseLicense and uses it to gate commercial plugin installs.
  • Replaces the hardcoded “商业” tag with a dynamic “商业/免费” label based on plugin level.
  • Simplifies the empty plugin list state to a centered Ant Design <Empty /> display.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

this.setState({
subscribeUntil,
isServiceExpired: isExpired,
licenseValid: !!res.bean.valid,
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

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

licenseValid is derived with !!res.bean.valid, which treats valid: undefined as invalid. Elsewhere (e.g. src/layouts/TeamLayout.js) the code treats licenses as valid unless valid === false. If the backend omits valid for valid licenses, this will incorrectly block commercial plugin installs. Consider aligning the check to res.bean.valid !== false (and keep the fallback behavior consistent across the app).

Suggested change
licenseValid: !!res.bean.valid,
licenseValid: res.bean.valid !== false,

Copilot uses AI. Check for mistakes.
Comment on lines +636 to 638
<div style={{ marginTop: '24px', minHeight: '300px', display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
<Empty description="暂无可用插件" />
</div>
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

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

The empty-state UI now renders <Empty />, but defaultPluginList in state and the renderDefaultPluginCard method appear unused after this change. Consider removing the unused state/method (or reusing them) to avoid dead code and potential lint warnings.

Suggested change
<div style={{ marginTop: '24px', minHeight: '300px', display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
<Empty description="暂无可用插件" />
</div>
defaultPluginList && defaultPluginList.length > 0 ? (
<div style={{ marginTop: '24px', minHeight: '300px' }}>
{defaultPluginList.map(item => this.renderDefaultPluginCard(item))}
</div>
) : (
<div style={{ marginTop: '24px', minHeight: '300px', display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
<Empty description="暂无可用插件" />
</div>
)

Copilot uses AI. Check for mistakes.
@ZhangSetSail ZhangSetSail merged commit 4ff1eb9 into main Apr 8, 2026
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants