Skip to content

feat: improve JSON properties display and enable dynamic resource configuration #103

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

OsamahDev1
Copy link

Summary

Enhances JSON properties display with smart component selection and enables custom resource classes. Fixes "[object Object]" display issue by automatically using formatted textareas for JSON data while maintaining KeyValue for simple properties. Fully backward compatible.


🐛 Fixes & ✨ Enhancements

1. Enhanced JSON Properties Display

Building on PR #101 with significant improvements:

  • Smart detection: Auto-selects Textarea for JSON, KeyValue for simple data
  • Pretty formatting: Properly indented JSON with Unicode support
  • Better dates: Consistent datetime formatting
  • Robust handling: Improved error handling for malformed JSON

2. Dynamic Resource Configuration

  • Fixes: Hardcoded resource references preventing custom resources
  • Solution: Pages now use getResource() method from config
  • Enables: Custom resource classes via configuration

📸 Before vs After

Before: "settings": "[object Object]"
After:

"settings": {
    "payment": {
        "price": 1
    },
    "workflow_code": "approval-v1"
}

…figuration

- Add intelligent component selection (Textarea vs KeyValue) based on data complexity
- Implement smart JSON detection for nested objects and arrays
- Add pretty-printed JSON formatting with Unicode support
- Improve date formatting consistency in properties display
- Enable dynamic resource configuration via config setting
- Add protected helper methods for better inheritance support

Fixes JSON properties displaying as "[object Object]"
Enables custom resource classes through configuration
@alexsyvolap
Copy link

@rmsramos can you check this, please? or someone else can check this. this is very important in my project. thanks.

@alexsyvolap
Copy link

Hello. Can someone check this?

@webard
Copy link
Contributor

webard commented Jun 26, 2025

I created a fork of this repository because my PR is waiting long time. I merged your PR info my repo: https://github.com/filamerce/filament-activitylog

@rmsramos
Copy link
Owner

rmsramos commented Jul 3, 2025

Hi @OsamahDev1, could you please check your contribution again? I approved some PRs and your contribution ended up causing a conflict.
I promise I'll release it as soon as I resolve the conflict.

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.

4 participants