commit
1e48143db0
4 changed files with 15 additions and 6 deletions
|
@ -46,7 +46,7 @@
|
|||
<input ui-select2="eventSelectOptions" id="enabledEventTypes" ng-model="eventsConfig.enabledEventTypes" data-placeholder="Select event types..."/>
|
||||
</div>
|
||||
|
||||
<span tooltip-trigger="mouseover mouseout" tooltip-placement="right" tooltip="Configure what event types are saved. By default events related to login and users modifying their accounts are persisted." class="fa fa-info-circle"></span>
|
||||
<span tooltip-trigger="mouseover mouseout" tooltip-placement="right" tooltip="Configure what event types are saved." class="fa fa-info-circle"></span>
|
||||
</div>
|
||||
|
||||
<div class="form-group" data-ng-show="access.manageEvents && eventsConfig.eventsEnabled">
|
||||
|
|
|
@ -250,11 +250,11 @@ public class ModelToRepresentation {
|
|||
}
|
||||
|
||||
if (realm.getEventsListeners() != null) {
|
||||
rep.setEventsListeners(new LinkedList<String>(realm.getEventsListeners()));
|
||||
rep.setEventsListeners(new LinkedList<>(realm.getEventsListeners()));
|
||||
}
|
||||
|
||||
if(realm.getEnabledEventTypes() != null) {
|
||||
rep.setEnabledEventTypes(new LinkedList<String>(realm.getEnabledEventTypes()));
|
||||
rep.setEnabledEventTypes(new LinkedList<>(realm.getEnabledEventTypes()));
|
||||
}
|
||||
|
||||
rep.setAdminEventsEnabled(realm.isAdminEventsEnabled());
|
||||
|
|
|
@ -210,10 +210,10 @@ public class RealmManager implements RealmImporter {
|
|||
realm.setEventsEnabled(rep.isEventsEnabled());
|
||||
realm.setEventsExpiration(rep.getEventsExpiration() != null ? rep.getEventsExpiration() : 0);
|
||||
if (rep.getEventsListeners() != null) {
|
||||
realm.setEventsListeners(new HashSet<String>(rep.getEventsListeners()));
|
||||
realm.setEventsListeners(new HashSet<>(rep.getEventsListeners()));
|
||||
}
|
||||
if(rep.getEnabledEventTypes() != null) {
|
||||
realm.setEnabledEventTypes(new HashSet<String>(rep.getEnabledEventTypes()));
|
||||
realm.setEnabledEventTypes(new HashSet<>(rep.getEnabledEventTypes()));
|
||||
}
|
||||
|
||||
realm.setAdminEventsEnabled(rep.isAdminEventsEnabled());
|
||||
|
|
|
@ -368,7 +368,16 @@ public class RealmAdminResource {
|
|||
public RealmEventsConfigRepresentation getRealmEventsConfig() {
|
||||
auth.init(RealmAuth.Resource.EVENTS).requireView();
|
||||
|
||||
return ModelToRepresentation.toEventsConfigReprensetation(realm);
|
||||
RealmEventsConfigRepresentation config = ModelToRepresentation.toEventsConfigReprensetation(realm);
|
||||
if (config.getEnabledEventTypes() == null || config.getEnabledEventTypes().isEmpty()) {
|
||||
config.setEnabledEventTypes(new LinkedList<String>());
|
||||
for (EventType e : EventType.values()) {
|
||||
if (e.isSaveByDefault()) {
|
||||
config.getEnabledEventTypes().add(e.name());
|
||||
}
|
||||
}
|
||||
}
|
||||
return config;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue