mazer-dev / pejota

The ERP and CRM, multi language, for freelancers and solo entrepreneurs. Clients, Projects, Contracts, Task, Timesheet manager. Built on top of PHP, Laravel, FilamentPHP, Livewire and Sqlite.
98 stars 22 forks source link

Add another fields to tasks histories #19

Open nunomazer opened 4 months ago

nunomazer commented 4 months ago

Add in histories (activities) more fields of tasks:

Pay attention that the create action (first insert of the record) do not need to generate an activity

GabrielDantasDs commented 3 months ago

Hi @nunomazer, I see there a lot of new fields in activity for tasks, all of them need been shown in histories tables ? or activity has to have your own screen with all this info ?

GabrielDantasDs commented 3 months ago

Also, regarding the fields, I realized that Spatie doesn't support changing the field names. To maintain the change history, I need to keep the original names of the fields. Therefore, it is not possible to save client_id, project_id, and status_id with different names. Is there a better approach for this, or did I miss something in the Spatie documentation?

nunomazer commented 3 months ago

Hi @GabrielDantasDs

Yes all this fields should be in the change history, this way we gonna have a real tracking of what is done in tasks.

The way to do with Spatie's package is simple, see the docs, if I'm not wrong it's almost automatic depending on model configuration.

About client and project id, you can add a properties: ->withProperties(['key' => 'value']) ... this way when client id or project id are dirty, you add related names as proprties

GabrielDantasDs commented 3 months ago

Thanks Professor. Now i be able to save all fields like you said, but the history table have more then 10 columns now, and look like little weird in the frontend, some columns break the line and go to below line, like this image, i lost something or that is it ?

Screenshot from 2024-07-23 21-41-43

obs: i limit all columns to 10 characters and add tooltip on hover.

nunomazer commented 3 months ago

I think you can create only one column on frontend that shows partial information of the changes, and at clicking on the row, open a modal that shows all the fields changed in a formated way