Skip to content

Commit

Permalink
fix: 🐛 datatable recipient (#120)
Browse files Browse the repository at this point in the history
* refactor: ♻️ added contributor as a recipient

* fix: 🐛 incorrect text for uploader and contributor

* refactor: ♻️ changed userId to authorId

* feat: ♻️ added uploader as a follower

* refactor: ♻️ fixed sonar issues

* refactor: ♻️ check duplication issue directly on staging

* refactor: ♻️ removed redundant code
  • Loading branch information
prakhar-s authored Jan 30, 2024
1 parent 29a5913 commit 6ecf9c6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1072,9 +1072,9 @@ public Activity logDatatableActivities(HttpServletRequest request, Long userId,

if (dataTableNullActivityList.contains(loggingData.getActivityType())) {
activity = new Activity(null, loggingData.getActivityDescription(), null, null,
loggingData.getActivityType(), userId, new Date(), new Date(), loggingData.getRootObjectId(),
ActivityEnums.DATATABLE.getValue(), loggingData.getSubRootObjectId(),
ActivityEnums.DATATABLE.getValue(), true);
loggingData.getActivityType(), loggingData.getMailData().getDataTableMailData().getAuthorId(),
new Date(), new Date(), loggingData.getRootObjectId(), ActivityEnums.DATATABLE.getValue(),
loggingData.getSubRootObjectId(), ActivityEnums.DATATABLE.getValue(), true);
} else if (dataTableUserGroupActivityList.contains(loggingData.getActivityType())) {
activity = new Activity(null, loggingData.getActivityDescription(), loggingData.getActivityId(),
ActivityEnums.USERGROUP.getValue(), loggingData.getActivityType(), userId, new Date(),
Expand All @@ -1096,6 +1096,10 @@ public Activity logDatatableActivities(HttpServletRequest request, Long userId,
activity = activityDao.save(activity);

if (activity != null && loggingData.getMailData() != null) {

userService = headers.addUserHeader(userService, request.getHeader(HttpHeaders.AUTHORIZATION));
userService.updateFollow("content.eml.Datatable", loggingData.getRootObjectId().toString());

String mailType = dataTableUserGroupActivityList.contains(loggingData.getActivityType())
? activity.getActivityType() + " Datatable"
: activity.getActivityType();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ public class MailServiceImpl implements MailService {
List<String> userGroupActivityList = new ArrayList<String>(
Arrays.asList("Posted resource", "Removed resoruce", "Featured", "UnFeatured"));

List<String> dataTableUserGroupActivityList = new ArrayList<>(
Arrays.asList("Posted resource", "Removed resoruce", "Featured", "UnFeatured"));

public MailServiceImpl() {
Properties props = PropertyFileUtil.fetchProperty("config.properties");
siteName = props.getProperty("siteName");
Expand Down Expand Up @@ -158,6 +161,7 @@ public void sendMail(MAIL_TYPE type, String objectType, Long objectId, Long user
}
if (userGroupActivityList.contains(activity.getActivityType())) {
userGroup = mapper.readValue(activity.getActivityDescription(), UserGroupActivity.class);

}

Map<String, Object> data = null;
Expand Down

0 comments on commit 6ecf9c6

Please sign in to comment.