feat: update platform plugin license filtering#1742
Conversation
There was a problem hiding this comment.
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
licenseValidstate sourced fromregion/getEnterpriseLicenseand 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, |
There was a problem hiding this comment.
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).
| licenseValid: !!res.bean.valid, | |
| licenseValid: res.bean.valid !== false, |
| <div style={{ marginTop: '24px', minHeight: '300px', display: 'flex', alignItems: 'center', justifyContent: 'center' }}> | ||
| <Empty description="暂无可用插件" /> | ||
| </div> |
There was a problem hiding this comment.
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.
| <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> | |
| ) |
No description provided.