Skip to content
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

todo #42

Open
5 of 12 tasks
noxoua opened this issue Nov 7, 2023 · 9 comments
Open
5 of 12 tasks

todo #42

noxoua opened this issue Nov 7, 2023 · 9 comments
Assignees

Comments

@noxoua
Copy link
Owner

noxoua commented Nov 7, 2023

  • Store images(thumbnail) to disk. This is necessary in order for it to be displayed in the logs, because after deleting a record, the images are also deleted.
  • Link to record
  • Link to user
  • Page with table view
  • add listeners for editable columns add HasLifecycleHooks for CanUpdateState filamentphp/filament#9495
  • add listeners for:
    • Associate,
    • Dissociate, +Bulk
    • Attach,
    • Detach, +Bulk
  • make getFilamentAvatarUrl optional
  • record history inside modal (slideover)
@noxoua noxoua added the bug Something isn't working label Nov 7, 2023
@noxoua noxoua changed the title TOOD todo Nov 7, 2023
@noxoua noxoua removed the bug Something isn't working label Nov 7, 2023
@noxoua noxoua self-assigned this Nov 7, 2023
@rahat1994
Copy link

Can I tackle items number 2 and 3?

@noxoua
Copy link
Owner Author

noxoua commented Nov 23, 2023

Can I tackle items number 2 and 3?

Of course, you can send a PR with a solution 👍

@borex
Copy link
Contributor

borex commented Feb 21, 2024

As a todo, what do you think about displaying some property from subject instead of the ID for logged objects?
I wanted to display the user name( or task title) in the activity list instead of the #id. So, I came up with the following code:

modified header.blade.php at line 80:

<span>#{{ $logger->getSubjectLabel($activity->subject) ?? $activity->subject_id }}</span>

modified UserLogger class:

...
class UserLogger extends Logger 
{
    public static ?string $model = User::class;

    public static function getLabel(): string | Htmlable | null
    {
        return UserResource::getModelLabel();
    }

    public static function getSubjectLabel($subject): string | Htmlable | null
    {
        return $subject?->name;
    }
...
}

I'm not sure if it's the best way of doing this, but it works for me. If you have time, please
check it out and let me know if it's okay or how should I implement this feature. Maybe it can be added to the this package.

@noxoua
Copy link
Owner Author

noxoua commented Feb 21, 2024

@borex , thanks for your attention to the plugin 🙏
Your approach to display the user name or task title instead of the ID in the activity list seems effective for your specific case. But not all users of the plugin may need such a feature, so integrating it directly into the plugin might not be practical.

However, to adapt this solution for your needs, you can override/create the your-project/resources/views/vendor/filament-activity-log/list/header.blade.php file in your resources. This allows you to maintain this functionality without altering the main code of the plugin.

@borex
Copy link
Contributor

borex commented Feb 22, 2024

@noxoua Thanks for your reply. I agree with what you are saying regarding other users, but the only thing that I don't like in my solution is overriding the header.blade.php file. In case this file gets modified in a newer version of the plugin I will need to keep track of it and reaply my changes again. If you would put the subject ID in a method that can be configured or overwritten then it would be much better to have the user display whatever value they want. Do you think that this could be a solution for this problem?

@noxoua
Copy link
Owner Author

noxoua commented Feb 27, 2024

@borex I rethought this and realized that you are right. Unfortunately, I don’t have enough time right now to implement this functionality. I’ll add it as soon as I can. or you can send PR. I think it's best to add a function to the logger class that all loggers extend.

@noxoua
Copy link
Owner Author

noxoua commented Mar 3, 2024

@borex added methods to the logger class - #66

@borex
Copy link
Contributor

borex commented Mar 6, 2024

@noxoua Sorry, but I didn't had time to work on this. I have just checked out the new changes and it is very nice. Thank you for implementing it.

@tonypartridge
Copy link

@noxoua what about Encrypted values? Can you parse the casts?

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

No branches or pull requests

4 participants