Skip to content

Conversation

@qlsl1198
Copy link

  • Extend text-copy plugin to support all text-based field types
  • Add copy button setting for Input.TextArea, Input.URL, Input.JSON, InputNumber, Markdown, MarkdownVditor, RichText
  • Create reusable addCopyButtonSetting function to reduce code duplication
  • Maintain backward compatibility with existing Input field functionality
  • Fix MariaDB field context menu missing copy button option

Fixes #7145

This is a ...

  • New feature
  • Improvement
  • Bug fix
  • Others

Motivation

Users reported that the "display a copy button" option was missing for fields in MariaDB connections. The issue occurred because the text-copy plugin only registered copy button settings for Input fields, but MariaDB and other databases often use different field types like Input.TextArea, Input.URL, Input.JSON, etc. This limited the copy functionality to only basic input fields.

Description

Key changes:

  • Extended the text-copy plugin to support 8 text-based field types instead of just Input
  • Created a reusable addCopyButtonSetting function to reduce code duplication
  • Added support for: Input.TextArea, Input.URL, Input.JSON, InputNumber, Markdown, MarkdownVditor, RichText
  • Maintained backward compatibility with existing Input field functionality

Potential risks:

  • Low risk. The changes only extend existing functionality without modifying core behavior
  • All changes are additive and maintain existing API contracts

Testing suggestions:

  1. Connect to MariaDB (or any database)
  2. Create fields of different types (TextArea, URL, JSON, Number, Markdown, RichText)
  3. Open context menu for each field type and verify "Display copy button" option appears
  4. Enable copy button for different field types and verify functionality works
  5. Test with both new and existing Input fields to ensure backward compatibility

Related issues

Fixes #7145

Showcase

Before: Only Input fields had "Display copy button" option in context menu
After: All text-based field types (Input, TextArea, URL, JSON, Number, Markdown, RichText) have "Display copy button" option

Changelog

Language Changelog
🇺🇸 English Extended copy button functionality to all text-based field types
🇨🇳 Chinese 扩展了所有文本字段类型的复制按钮功能

Docs

Language Link
🇺🇸 English Not needed - bug fix only
🇨🇳 Chinese 不需要 - 仅修复bug

Checklists

  • All changes have been self-tested and work as expected
  • Test cases are updated/provided or not needed
  • Doc is updated/provided or not needed
  • Component demo is updated/provided or not needed
  • Changelog is provided or not needed
  • Request a code review if it is necessary

@qlsl1198 qlsl1198 force-pushed the fix/issue-7145-copy-button-all-fields branch from 5011000 to d609a8c Compare October 16, 2025 02:04
)

- Extend text-copy plugin to support all text-based field types
- Add copy button setting for Input.TextArea, Input.URL, Input.JSON, InputNumber, Markdown, MarkdownVditor, RichText
- Create reusable addCopyButtonSetting function to reduce code duplication
- Maintain backward compatibility with existing Input field functionality
- Fix MariaDB field context menu missing copy button option

[skip changelog-review]

Fixes nocobase#7145
@qlsl1198 qlsl1198 force-pushed the fix/issue-7145-copy-button-all-fields branch from d609a8c to fe73360 Compare October 16, 2025 02:05
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.

"display a copy button" for all fields

1 participant