-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Added change log tab for campaign detail page #14676
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
Added change log tab for campaign detail page #14676
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## 7.x #14676 +/- ##
============================================
+ Coverage 65.62% 65.69% +0.07%
- Complexity 34953 34959 +6
============================================
Files 2299 2300 +1
Lines 140589 140616 +27
============================================
+ Hits 92262 92380 +118
+ Misses 48327 48236 -91
🚀 New features to boost your workflow:
|
@shinde-rahul isn't this already possible with #13373? |
…-rahul/mautic into campaign-audit-log-with-changelog
@escopecz we did not see that PR #13373. It looks like a great feature. From the description, I think it is a bit different to this. The audit log there is more targeted for an overview of all the changes. Here we would see the changes that were made to the campaign. For the editor user to double check or debug what was done. In the same way as we do it with e.g. the contacts. So I see an added benefit with this feature. |
@adiux what I worry a little with this is adding duplicated features in various places in Mautic. I agree that this is more convenient when the users only want to see the campaign and campaign event changes. I'm thinking whether we could instead create a @shinde-rahul is this ready for review? I can see that reviewers were requested but the PR is still in the Draft stage. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shinde-rahul Looking at the screenshots, I'm missing the username. I can see the column header is there but instead of username it shows action that was taken. Can you please explain what's going on? |
@imaabasiee, thanks for catching this. I have corrected the names. @escopecz, The wrong variable got committed since starting. I apologize for this oversight. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I cannot find anything in the code. Nicely done! You can ignore my JS rant. It's just an FYI for future PRs. But I'd like @andersonjeccel input on the icons in the translation text. I think we should be using the icons from the icon set in Mautic for unified look and feel. But it's not my expertise.
mQuery("#campaign-auditlog a[data-activate-details='all']").on('click', function() { | ||
let $icon = mQuery(this).find('span').first(); | ||
if ($icon.hasClass('ri-arrow-down-s-line')) { | ||
mQuery("#campaign-auditlog a[data-activate-details!='all']").each(function () { | ||
const detailsId = mQuery(this).data('activate-details'); | ||
if (detailsId && mQuery('#auditlog-details-' + detailsId).length) { | ||
mQuery('#auditlog-details-' + detailsId).removeClass('hide'); | ||
mQuery(this).addClass('active'); | ||
} | ||
}); | ||
$icon.removeClass('ri-arrow-down-s-line').addClass('ri-arrow-up-s-line'); | ||
} else { | ||
mQuery("#campaign-auditlog a[data-activate-details!='all']").each(function () { | ||
const detailsId = mQuery(this).data('activate-details'); | ||
if (detailsId && mQuery('#auditlog-details-' + detailsId).length) { | ||
mQuery('#auditlog-details-' + detailsId).addClass('hide'); | ||
mQuery(this).removeClass('active'); | ||
} | ||
}); | ||
$icon.removeClass('ri-arrow-up-s-line').addClass('ri-arrow-down-s-line'); | ||
} | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just a small optimization but just so you'd know about it. Every time you create a jQuery object it does quite an expensive operation of finding the right HTML element(s). So it's better to find it once and store it in a variable than finding it over and over.
Notice that for example mQuery('#auditlog-details-' + detailsId)
could be stored into a variable and used in other places.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @escopecz for pointing that out. That's a good point.
For simple stuff like selecting an element, I would even go one step further and don't use mQuery. So that we can get rid of this dependency at some point. But that might just be my point of view.
So it would be something like:
const auditlog = document.getElementById('#auditlog-details-' + detailsId);
Also just an FYI, can be ignored.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excelent point!
mautic.campaign.event.create="Campaign created" | ||
mautic.campaign.event.update="Campaign updated" | ||
mautic.campaign.timeline.toggle_details="Toggle details." | ||
mautic.campaign.changelog.event_removed="❌ Event Removed" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@andersonjeccel ping
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…-rahul/mautic into campaign-audit-log-with-changelog
Hi @shinde-rahul This is current audit log data: 126 1 Admin Mautic form form 1 update a:6:{s:4:"name";a:2:{i:0;N;i:1;s:9:"test form";}s:7:"noIndex";a:2:{i:0;N;i:1;b:0;}s:10:"postAction";a:2:{i:0;s:7:"message";i:1;s:6:"return";}s:6:"fields";a:1:{s:43:"new064002cb3e22524fe280a7e35892c22eff5bfd7f";a:5:{s:5:"label";a:2:{i:0;N;i:1;s:6:"Submit";}s:5:"alias";a:2:{i:0;N;i:1;s:6:"submit";}s:4:"type";a:2:{i:0;N;i:1;s:6:"button";}s:15:"inputAttributes";a:2:{i:0;N;i:1;s:21:"class="btn btn-ghost"";}s:5:"order";a:2:{i:0;i:0;i:1;i:1;}}}s:5:"alias";a:2:{i:0;N;i:1;s:9:"test_form";}s:12:"dateModified";a:2:{i:0;N;i:1;s:25:"2025-04-16T16:22:02+00:00";}} 127 1 Admin Mautic campaign campaign 3 update a:1:{s:5:"forms";a:1:{s:5:"added";a:1:{i:1;s:9:"test form";}}} |
Description
User Story
As an admin user,
I want to see a detailed history of changes made to a campaign,
So that I can audit and debug modifications effectively.
Details:
Currently, the Recent Activity section only indicates that a campaign was updated but does not provide details on what was changed. To improve auditing and debugging, the system should track and display a versioned change log that includes:
📋 Steps to test this PR: