Skip to content

Commit

Permalink
Entity log doesn't show entities were created by user with tenant. Co…
Browse files Browse the repository at this point in the history
…mments added jmix-framework#976
  • Loading branch information
dtaimanov committed Oct 5, 2022
1 parent 59a2d45 commit 594a262
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ protected EntityLogAttr getAttrToSave(EntityLogAttr entityLogAttr, EntityLogItem
protected void saveItem(EntityLogItem item) {
String storeName = metadata.getClass(item.getEntity()).getStore().getName();

entityEventManager.publishEntitySavingEvent(item, true);
entityEventManager.publishEntitySavingEvent(item, true);//workaround for jmix-framework/jmix#1069
if (item.getDbGeneratedIdEntity() == null) {
if (Stores.isMain(storeName)) {
entityManager.persist(item);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ protected ScheduledExecution registerExecutionStart(ScheduledTask task, long now
execution.setServer(serverInfo.getServerId());


entityEventManager.publishEntitySavingEvent(execution, true);
entityEventManager.publishEntitySavingEvent(execution, true);//workaround for jmix-framework/jmix#1069
em.persist(execution);
tx.commit();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ protected void persistSendingMessage(SendingMessage message, MessagePersistingCo
message.setContentText(null);
}

entityEventManager.publishEntitySavingEvent(message, true);
entityEventManager.publishEntitySavingEvent(message, true);//workaround for jmix-framework/jmix#1069
entityManager.persist(message);

message.getAttachments().forEach(attachment -> {
Expand All @@ -272,7 +272,7 @@ protected void persistSendingMessage(SendingMessage message, MessagePersistingCo
attachment.setContent(null);
}

entityEventManager.publishEntitySavingEvent(attachment, true);
entityEventManager.publishEntitySavingEvent(attachment, true);//workaround for jmix-framework/jmix#1069
entityManager.persist(attachment);
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ protected Report saveReport(Report report) {
report.setGroup(group);
}
} else {
entityEventManager.publishEntitySavingEvent(group, true);
entityEventManager.publishEntitySavingEvent(group, true);//workaround for jmix-framework/jmix#1069
em.persist(group);
}
}
Expand All @@ -148,7 +148,7 @@ protected Report saveReport(Report report) {

if (existingReport != null) {
report.setVersion(existingReport.getVersion());
entityEventManager.publishEntitySavingEvent(report, false);
entityEventManager.publishEntitySavingEvent(report, false);//workaround for jmix-framework/jmix#1069
report = em.merge(report);
if (existingReport.getTemplates() != null) {
existingTemplates = existingReport.getTemplates();
Expand All @@ -161,7 +161,7 @@ protected Report saveReport(Report report) {
report.setTemplates(null);
} else {
report.setVersion(0);
entityEventManager.publishEntitySavingEvent(report, true);
entityEventManager.publishEntitySavingEvent(report, true);//workaround for jmix-framework/jmix#1069
report = em.merge(report);
}

Expand All @@ -186,7 +186,7 @@ protected Report saveReport(Report report) {
}

loadedTemplate.setReport(report);
entityEventManager.publishEntitySavingEvent(loadedTemplate, entityStates.isNew(loadedTemplate));
entityEventManager.publishEntitySavingEvent(loadedTemplate, entityStates.isNew(loadedTemplate));//workaround for jmix-framework/jmix#1069
savedTemplates.add(em.merge(loadedTemplate));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public void saveSetting(String name, @Nullable String value) {
us.setUsername(authentication.getUser().getUsername());
us.setName(name);
us.setValue(value);
entityEventManager.publishEntitySavingEvent(us, true);
entityEventManager.publishEntitySavingEvent(us, true);//workaround for jmix-framework/jmix#1069
entityManager.persist(us);
} else {
us.setValue(value);
Expand Down Expand Up @@ -173,7 +173,7 @@ public void copySettings(UserDetails fromUser, UserDetails toUser) {
} catch (Exception e) {
newSetting.setValue(currSetting.getValue());
}
entityEventManager.publishEntitySavingEvent(newSetting, true);
entityEventManager.publishEntitySavingEvent(newSetting, true);//workaround for jmix-framework/jmix#1069
entityManager.persist(newSetting);
}
});
Expand Down Expand Up @@ -235,7 +235,7 @@ protected Map<UUID, UiTablePresentation> copyPresentations(UserDetails fromUser,
newPresentation.setName(presentation.getName());
newPresentation.setSettings(presentation.getSettings());
presentationMap.put(presentation.getId(), newPresentation);
entityEventManager.publishEntitySavingEvent(newPresentation, true);
entityEventManager.publishEntitySavingEvent(newPresentation, true);//workaround for jmix-framework/jmix#1069
entityManager.persist(newPresentation);
}
return presentationMap;
Expand Down

0 comments on commit 594a262

Please sign in to comment.