mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2026-01-08 05:26:19 +00:00
fix announcement notification. (#17793)
This commit is contained in:
parent
e7cfa4889c
commit
052430ee07
@ -387,6 +387,15 @@ public interface MessageDecorator<T> {
|
||||
String.format(
|
||||
"Ends At : %s", getDateString(thread.getAnnouncement().getEndTime())));
|
||||
}
|
||||
case ENTITY_DELETED -> {
|
||||
headerMessage =
|
||||
String.format(
|
||||
"[%s] **@%s** posted an update on **Announcement**",
|
||||
publisherName, thread.getUpdatedBy());
|
||||
attachmentList.add(
|
||||
String.format(
|
||||
"Announcement Deleted: %s", thread.getAnnouncement().getDescription()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -372,22 +372,31 @@ public class SubscriptionUtil {
|
||||
handleConversationNotification(category, type, event));
|
||||
// TODO: For Announcement, Immediate Consumer needs to be Notified (find information from
|
||||
// Lineage)
|
||||
case Announcement -> {
|
||||
receiverUrls.addAll(buildReceivers(action, category, type, event, event.getEntityId()));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
EntityInterface entityInterface = getEntity(event);
|
||||
receiverUrls.addAll(
|
||||
buildReceiversListFromActions(
|
||||
action,
|
||||
category,
|
||||
type,
|
||||
Entity.getCollectionDAO(),
|
||||
entityInterface.getId(),
|
||||
event.getEntityType()));
|
||||
receiverUrls.addAll(buildReceivers(action, category, type, event, entityInterface.getId()));
|
||||
}
|
||||
|
||||
return receiverUrls;
|
||||
}
|
||||
|
||||
private static Set<String> buildReceivers(
|
||||
SubscriptionAction action,
|
||||
SubscriptionDestination.SubscriptionCategory category,
|
||||
SubscriptionDestination.SubscriptionType type,
|
||||
ChangeEvent event,
|
||||
UUID id) {
|
||||
Set<String> result = new HashSet<>();
|
||||
result.addAll(
|
||||
buildReceiversListFromActions(
|
||||
action, category, type, Entity.getCollectionDAO(), id, event.getEntityType()));
|
||||
return result;
|
||||
}
|
||||
|
||||
public static List<Invocation.Builder> getTargetsForWebhookAlert(
|
||||
SubscriptionAction action,
|
||||
SubscriptionDestination.SubscriptionCategory category,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user