Merge branch 'dmp-refactoring' of https://code-repo.d4science.org/MaDgiK-CITE/argos into dmp-refactoring
# Conflicts: # dmp-frontend/src/app/ui/user-profile/user-profile.component.scss
This commit is contained in:
commit
4043a67c9c
|
@ -150,7 +150,7 @@ public class GlobalExceptionHandler {
|
||||||
Map.entry("error", "System error")
|
Map.entry("error", "System error")
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
String serialization = this.jsonHandlingService.toJsonSafe(result);
|
String serialization = this.jsonHandlingService.toJsonSafe(result);
|
||||||
return new HandledException(statusCode, serialization, logLevel);
|
return new HandledException(statusCode, serialization, logLevel);
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,7 +72,7 @@ public class AnnotationController {
|
||||||
|
|
||||||
this.censorFactory.censor(AnnotationCensor.class).censor(lookup.getProject(), null);
|
this.censorFactory.censor(AnnotationCensor.class).censor(lookup.getProject(), null);
|
||||||
|
|
||||||
AnnotationQuery query = lookup.enrich(this.queryFactory).authorize(AuthorizationFlags.OwnerOrPermissionAssociated);
|
AnnotationQuery query = lookup.enrich(this.queryFactory).disableTracking().authorize(AuthorizationFlags.OwnerOrPermissionAssociated);
|
||||||
List<AnnotationEntity> data = query.collect();
|
List<AnnotationEntity> data = query.collect();
|
||||||
List<Annotation> models = this.builderFactory.builder(AnnotationBuilder.class).authorize(AuthorizationFlags.OwnerOrPermissionAssociated).build(lookup.getProject(), data);
|
List<Annotation> models = this.builderFactory.builder(AnnotationBuilder.class).authorize(AuthorizationFlags.OwnerOrPermissionAssociated).build(lookup.getProject(), data);
|
||||||
long count = (lookup.getMetadata() != null && lookup.getMetadata().getCountAll()) ? query.count() : models.size();
|
long count = (lookup.getMetadata() != null && lookup.getMetadata().getCountAll()) ? query.count() : models.size();
|
||||||
|
@ -88,7 +88,7 @@ public class AnnotationController {
|
||||||
|
|
||||||
this.censorFactory.censor(AnnotationCensor.class).censor(fieldSet, null);
|
this.censorFactory.censor(AnnotationCensor.class).censor(fieldSet, null);
|
||||||
|
|
||||||
AnnotationQuery query = this.queryFactory.query(AnnotationQuery.class).authorize(AuthorizationFlags.OwnerOrPermissionAssociated).ids(id);
|
AnnotationQuery query = this.queryFactory.query(AnnotationQuery.class).disableTracking().authorize(AuthorizationFlags.OwnerOrPermissionAssociated).ids(id);
|
||||||
Annotation model = this.builderFactory.builder(AnnotationBuilder.class).authorize(AuthorizationFlags.OwnerOrPermissionAssociated).build(fieldSet, query.firstAs(fieldSet));
|
Annotation model = this.builderFactory.builder(AnnotationBuilder.class).authorize(AuthorizationFlags.OwnerOrPermissionAssociated).build(fieldSet, query.firstAs(fieldSet));
|
||||||
if (model == null)
|
if (model == null)
|
||||||
throw new MyNotFoundException(messageSource.getMessage("General_ItemNotFound", new Object[]{id, Annotation.class.getSimpleName()}, LocaleContextHolder.getLocale()));
|
throw new MyNotFoundException(messageSource.getMessage("General_ItemNotFound", new Object[]{id, Annotation.class.getSimpleName()}, LocaleContextHolder.getLocale()));
|
||||||
|
|
|
@ -30,18 +30,15 @@ public class PrincipalController {
|
||||||
|
|
||||||
private final CurrentPrincipalResolver currentPrincipalResolver;
|
private final CurrentPrincipalResolver currentPrincipalResolver;
|
||||||
private final AccountBuilder accountBuilder;
|
private final AccountBuilder accountBuilder;
|
||||||
private final ClaimExtractor claimExtractor;
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public PrincipalController(
|
public PrincipalController(
|
||||||
CurrentPrincipalResolver currentPrincipalResolver,
|
CurrentPrincipalResolver currentPrincipalResolver,
|
||||||
AccountBuilder accountBuilder,
|
AccountBuilder accountBuilder,
|
||||||
AuditService auditService,
|
AuditService auditService) {
|
||||||
ClaimExtractor claimExtractor) {
|
|
||||||
this.currentPrincipalResolver = currentPrincipalResolver;
|
this.currentPrincipalResolver = currentPrincipalResolver;
|
||||||
this.accountBuilder = accountBuilder;
|
this.accountBuilder = accountBuilder;
|
||||||
this.auditService = auditService;
|
this.auditService = auditService;
|
||||||
this.claimExtractor = claimExtractor;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("me")
|
@GetMapping("me")
|
||||||
|
@ -76,17 +73,4 @@ public class PrincipalController {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("my-tenants")
|
|
||||||
public List<String> myTenants() {
|
|
||||||
logger.debug("my-tenants");
|
|
||||||
|
|
||||||
MyPrincipal principal = this.currentPrincipalResolver.currentPrincipal();
|
|
||||||
List<String> tenants = this.claimExtractor.asStrings(principal, ClaimNames.TenantCodesClaimName);
|
|
||||||
|
|
||||||
this.auditService.track(AuditableAction.Tenants_Lookup);
|
|
||||||
//auditService.trackIdentity(AuditableAction.IdentityTracking_Action);
|
|
||||||
|
|
||||||
return tenants == null ? null : tenants.stream().distinct().collect(Collectors.toList());
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,7 @@ import gr.cite.annotation.authorization.Permission;
|
||||||
import gr.cite.annotation.common.enums.IsActive;
|
import gr.cite.annotation.common.enums.IsActive;
|
||||||
import gr.cite.annotation.common.scope.tenant.TenantScope;
|
import gr.cite.annotation.common.scope.tenant.TenantScope;
|
||||||
import gr.cite.annotation.common.scope.user.UserScope;
|
import gr.cite.annotation.common.scope.user.UserScope;
|
||||||
|
import gr.cite.annotation.data.TenantEntityManager;
|
||||||
import gr.cite.annotation.data.TenantUserEntity;
|
import gr.cite.annotation.data.TenantUserEntity;
|
||||||
import gr.cite.annotation.data.UserEntity;
|
import gr.cite.annotation.data.UserEntity;
|
||||||
import gr.cite.annotation.data.tenant.TenantScopedBaseEntity;
|
import gr.cite.annotation.data.tenant.TenantScopedBaseEntity;
|
||||||
|
@ -52,6 +53,7 @@ public class TenantInterceptor implements WebRequestInterceptor {
|
||||||
private final UserAllowedTenantCacheService userAllowedTenantCacheService;
|
private final UserAllowedTenantCacheService userAllowedTenantCacheService;
|
||||||
private final ErrorThesaurusProperties errors;
|
private final ErrorThesaurusProperties errors;
|
||||||
private final QueryUtilsService queryUtilsService;
|
private final QueryUtilsService queryUtilsService;
|
||||||
|
public final TenantEntityManager tenantEntityManager;
|
||||||
@PersistenceContext
|
@PersistenceContext
|
||||||
public EntityManager entityManager;
|
public EntityManager entityManager;
|
||||||
|
|
||||||
|
@ -64,7 +66,7 @@ public class TenantInterceptor implements WebRequestInterceptor {
|
||||||
ApplicationContext applicationContext,
|
ApplicationContext applicationContext,
|
||||||
TenantScopeProperties tenantScopeProperties,
|
TenantScopeProperties tenantScopeProperties,
|
||||||
UserAllowedTenantCacheService userAllowedTenantCacheService,
|
UserAllowedTenantCacheService userAllowedTenantCacheService,
|
||||||
ErrorThesaurusProperties errors, QueryUtilsService queryUtilsService) {
|
ErrorThesaurusProperties errors, QueryUtilsService queryUtilsService, TenantEntityManager tenantEntityManager) {
|
||||||
this.tenantScope = tenantScope;
|
this.tenantScope = tenantScope;
|
||||||
this.userScope = userScope;
|
this.userScope = userScope;
|
||||||
this.currentPrincipalResolver = currentPrincipalResolver;
|
this.currentPrincipalResolver = currentPrincipalResolver;
|
||||||
|
@ -74,6 +76,7 @@ public class TenantInterceptor implements WebRequestInterceptor {
|
||||||
this.userAllowedTenantCacheService = userAllowedTenantCacheService;
|
this.userAllowedTenantCacheService = userAllowedTenantCacheService;
|
||||||
this.errors = errors;
|
this.errors = errors;
|
||||||
this.queryUtilsService = queryUtilsService;
|
this.queryUtilsService = queryUtilsService;
|
||||||
|
this.tenantEntityManager = tenantEntityManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -103,16 +106,7 @@ public class TenantInterceptor implements WebRequestInterceptor {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isUserAllowedTenant) {
|
if (isUserAllowedTenant) {
|
||||||
if(!tenantScope.isDefaultTenant()) {
|
this.tenantEntityManager.reloadTenantFilters();
|
||||||
this.entityManager
|
|
||||||
.unwrap(Session.class)
|
|
||||||
.enableFilter(TenantScopedBaseEntity.TENANT_FILTER)
|
|
||||||
.setParameter(TenantScopedBaseEntity.TENANT_FILTER_TENANT_PARAM, tenantScope.getTenant().toString());
|
|
||||||
} else {
|
|
||||||
this.entityManager
|
|
||||||
.unwrap(Session.class)
|
|
||||||
.enableFilter(TenantScopedBaseEntity.DEFAULT_TENANT_FILTER);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if (isAllowedNoTenant || this.isWhiteListedEndpoint(request)) {
|
if (isAllowedNoTenant || this.isWhiteListedEndpoint(request)) {
|
||||||
tenantScope.setTenant(null, null);
|
tenantScope.setTenant(null, null);
|
||||||
|
@ -181,8 +175,8 @@ public class TenantInterceptor implements WebRequestInterceptor {
|
||||||
@Override
|
@Override
|
||||||
public void postHandle(@NonNull WebRequest request, ModelMap model) {
|
public void postHandle(@NonNull WebRequest request, ModelMap model) {
|
||||||
this.tenantScope.setTenant(null, null);
|
this.tenantScope.setTenant(null, null);
|
||||||
|
this.tenantEntityManager.disableTenantFilters();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void afterCompletion(@NonNull WebRequest request, Exception ex) {
|
public void afterCompletion(@NonNull WebRequest request, Exception ex) {
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,7 +63,7 @@ public class UserInterceptor implements WebRequestInterceptor {
|
||||||
this.userScope.setUserId(userId);
|
this.userScope.setUserId(userId);
|
||||||
}
|
}
|
||||||
private UUID findExistingUserFromDb(String subjectId) {
|
private UUID findExistingUserFromDb(String subjectId) {
|
||||||
UserCredentialEntity userCredential = this.queryFactory.query(UserCredentialQuery.class).externalIds(subjectId).firstAs(new BaseFieldSet().ensure(UserCredential._user));
|
UserCredentialEntity userCredential = this.queryFactory.query(UserCredentialQuery.class).disableTracking().externalIds(subjectId).firstAs(new BaseFieldSet().ensure(UserCredential._user));
|
||||||
if (userCredential != null) {
|
if (userCredential != null) {
|
||||||
return userCredential.getUserId();
|
return userCredential.getUserId();
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,7 +52,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>gr.cite</groupId>
|
<groupId>gr.cite</groupId>
|
||||||
<artifactId>data-tools</artifactId>
|
<artifactId>data-tools</artifactId>
|
||||||
<version>2.1.2</version>
|
<version>2.1.4</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>gr.cite</groupId>
|
<groupId>gr.cite</groupId>
|
||||||
|
@ -77,7 +77,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>gr.cite</groupId>
|
<groupId>gr.cite</groupId>
|
||||||
<artifactId>exceptions</artifactId>
|
<artifactId>exceptions</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>2.1.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>gr.cite</groupId>
|
<groupId>gr.cite</groupId>
|
||||||
|
@ -93,7 +93,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>gr.cite</groupId>
|
<groupId>gr.cite</groupId>
|
||||||
<artifactId>cipher</artifactId>
|
<artifactId>cipher</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>2.1.0</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
|
@ -48,7 +48,7 @@ public class AuthorizationContentResolverImpl implements AuthorizationContentRes
|
||||||
List<UUID> idsToResolve = this.getAffiliatedFromCache(ids, userId, affiliatedResources, AnnotationEntity._entityId);
|
List<UUID> idsToResolve = this.getAffiliatedFromCache(ids, userId, affiliatedResources, AnnotationEntity._entityId);
|
||||||
if (idsToResolve.isEmpty()) return affiliatedResources;
|
if (idsToResolve.isEmpty()) return affiliatedResources;
|
||||||
|
|
||||||
List<EntityUserEntity> entityUsers = this.queryFactory.query(EntityUserQuery.class).entityIds(ids).userIds(userId).isActive(IsActive.Active).collectAs(new BaseFieldSet().ensure(EntityUser._id).ensure(EntityUser._entityId));
|
List<EntityUserEntity> entityUsers = this.queryFactory.query(EntityUserQuery.class).disableTracking().entityIds(ids).userIds(userId).isActive(IsActive.Active).collectAs(new BaseFieldSet().ensure(EntityUser._id).ensure(EntityUser._entityId));
|
||||||
|
|
||||||
for (UUID entityId : entityUsers.stream().map(EntityUserEntity::getEntityId).distinct().toList()){
|
for (UUID entityId : entityUsers.stream().map(EntityUserEntity::getEntityId).distinct().toList()){
|
||||||
affiliatedResources.get(entityId).setAffiliated(true);
|
affiliatedResources.get(entityId).setAffiliated(true);
|
||||||
|
@ -79,8 +79,8 @@ public class AuthorizationContentResolverImpl implements AuthorizationContentRes
|
||||||
List<UUID> idsToResolve = this.getAffiliatedFromCache(ids, userId, affiliatedResources, AnnotationEntity.class.getSimpleName());
|
List<UUID> idsToResolve = this.getAffiliatedFromCache(ids, userId, affiliatedResources, AnnotationEntity.class.getSimpleName());
|
||||||
if (idsToResolve.isEmpty()) return affiliatedResources;
|
if (idsToResolve.isEmpty()) return affiliatedResources;
|
||||||
|
|
||||||
List<AnnotationEntity> annotationEntities = this.queryFactory.query(AnnotationQuery.class).ids(ids).collectAs(new BaseFieldSet().ensure(Annotation._id).ensure(Annotation._entityId).ensure(Annotation._id));
|
List<AnnotationEntity> annotationEntities = this.queryFactory.query(AnnotationQuery.class).disableTracking().ids(ids).collectAs(new BaseFieldSet().ensure(Annotation._id).ensure(Annotation._entityId).ensure(Annotation._id));
|
||||||
List<EntityUserEntity> entityUsers = this.queryFactory.query(EntityUserQuery.class).entityIds(annotationEntities.stream().map(AnnotationEntity::getEntityId).distinct().toList()).userIds(userId).isActive(IsActive.Active).collectAs(new BaseFieldSet().ensure(EntityUser._id).ensure(EntityUser._entityId));
|
List<EntityUserEntity> entityUsers = this.queryFactory.query(EntityUserQuery.class).disableTracking().entityIds(annotationEntities.stream().map(AnnotationEntity::getEntityId).distinct().toList()).userIds(userId).isActive(IsActive.Active).collectAs(new BaseFieldSet().ensure(EntityUser._id).ensure(EntityUser._entityId));
|
||||||
Map<UUID, List<EntityUserEntity>> dmpUsersMap = entityUsers.stream().collect(Collectors.groupingBy(EntityUserEntity::getEntityId));
|
Map<UUID, List<EntityUserEntity>> dmpUsersMap = entityUsers.stream().collect(Collectors.groupingBy(EntityUserEntity::getEntityId));
|
||||||
|
|
||||||
for (AnnotationEntity annotation : annotationEntities){
|
for (AnnotationEntity annotation : annotationEntities){
|
||||||
|
|
|
@ -70,7 +70,7 @@ public class XmlHandlingService {
|
||||||
public <T> T fromXml(Class<T> type, String xmlString) throws JAXBException, InstantiationException, IllegalAccessException, ParserConfigurationException, IOException, SAXException {
|
public <T> T fromXml(Class<T> type, String xmlString) throws JAXBException, InstantiationException, IllegalAccessException, ParserConfigurationException, IOException, SAXException {
|
||||||
if (XmlSerializable.class.isAssignableFrom(type)){
|
if (XmlSerializable.class.isAssignableFrom(type)){
|
||||||
XmlSerializable<T> object = (XmlSerializable<T>)type.newInstance();
|
XmlSerializable<T> object = (XmlSerializable<T>)type.newInstance();
|
||||||
return (T) object.fromXml(this.getDocument(xmlString).getDocumentElement());
|
return object.fromXml(this.getDocument(xmlString).getDocumentElement());
|
||||||
} else {
|
} else {
|
||||||
JAXBContext jaxbContext = JAXBContext.newInstance(type);
|
JAXBContext jaxbContext = JAXBContext.newInstance(type);
|
||||||
Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller();
|
Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller();
|
||||||
|
|
|
@ -25,7 +25,7 @@ public class LockByKeyManager {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static ConcurrentHashMap<String, LockWrapper> locks = new ConcurrentHashMap<String, LockWrapper>();
|
private static final ConcurrentHashMap<String, LockWrapper> locks = new ConcurrentHashMap<String, LockWrapper>();
|
||||||
|
|
||||||
public void lock(String key) {
|
public void lock(String key) {
|
||||||
LockWrapper lockWrapper = locks.compute(key, (k, v) -> v == null ? new LockWrapper() : v.addThreadInQueue());
|
LockWrapper lockWrapper = locks.compute(key, (k, v) -> v == null ? new LockWrapper() : v.addThreadInQueue());
|
||||||
|
|
|
@ -8,7 +8,7 @@ import java.util.LinkedHashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public class FakeRequestAttributes implements RequestAttributes {
|
public class FakeRequestAttributes implements RequestAttributes {
|
||||||
private Map<String, Object> requestAttributeMap = new HashMap<>();
|
private final Map<String, Object> requestAttributeMap = new HashMap<>();
|
||||||
private final Map<String, Runnable> requestDestructionCallbacks = new LinkedHashMap<>(8);
|
private final Map<String, Runnable> requestDestructionCallbacks = new LinkedHashMap<>(8);
|
||||||
private volatile boolean requestActive = true;
|
private volatile boolean requestActive = true;
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package gr.cite.annotation.common.scope.tenant;
|
package gr.cite.annotation.common.scope.tenant;
|
||||||
|
|
||||||
|
import gr.cite.annotation.data.TenantEntityManager;
|
||||||
import gr.cite.annotation.data.tenant.TenantScopedBaseEntity;
|
import gr.cite.annotation.data.tenant.TenantScopedBaseEntity;
|
||||||
import jakarta.persistence.EntityManager;
|
import jakarta.persistence.EntityManager;
|
||||||
import org.hibernate.Session;
|
import org.hibernate.Session;
|
||||||
|
@ -27,11 +28,11 @@ public class TenantScope {
|
||||||
}
|
}
|
||||||
|
|
||||||
public Boolean isMultitenant() {
|
public Boolean isMultitenant() {
|
||||||
return multitenancy.isMultitenant();
|
return this.multitenancy.isMultitenant();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDefaultTenantCode() {
|
public String getDefaultTenantCode() {
|
||||||
return multitenancy.getDefaultTenantCode();
|
return this.multitenancy.getDefaultTenantCode();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Boolean isSet() {
|
public Boolean isSet() {
|
||||||
|
@ -62,55 +63,18 @@ public class TenantScope {
|
||||||
return this.tenantCode.get();
|
return this.tenantCode.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTempTenant(EntityManager entityManager, UUID tenant, String tenantCode) {
|
public void setTempTenant(TenantEntityManager entityManager, UUID tenant, String tenantCode) throws InvalidApplicationException {
|
||||||
this.tenant.set(tenant);
|
this.tenant.set(tenant);
|
||||||
this.tenantCode.set(tenantCode);
|
this.tenantCode.set(tenantCode);
|
||||||
|
|
||||||
entityManager
|
entityManager.reloadTenantFilters();
|
||||||
.unwrap(Session.class)
|
|
||||||
.disableFilter(TenantScopedBaseEntity.TENANT_FILTER);
|
|
||||||
|
|
||||||
entityManager
|
|
||||||
.unwrap(Session.class)
|
|
||||||
.disableFilter(TenantScopedBaseEntity.DEFAULT_TENANT_FILTER);
|
|
||||||
if (this.tenant.get() != null || this.isDefaultTenant()) {
|
|
||||||
if(!this.isDefaultTenant()) {
|
|
||||||
entityManager
|
|
||||||
.unwrap(Session.class)
|
|
||||||
.enableFilter(TenantScopedBaseEntity.TENANT_FILTER)
|
|
||||||
.setParameter(TenantScopedBaseEntity.TENANT_FILTER_TENANT_PARAM, this.tenant.get().toString());
|
|
||||||
} else {
|
|
||||||
entityManager
|
|
||||||
.unwrap(Session.class)
|
|
||||||
.enableFilter(TenantScopedBaseEntity.DEFAULT_TENANT_FILTER);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void removeTempTenant(EntityManager entityManager) {
|
public void removeTempTenant(TenantEntityManager entityManager) throws InvalidApplicationException {
|
||||||
this.tenant.set(this.initialTenant.get());
|
this.tenant.set(this.initialTenant.get());
|
||||||
this.tenantCode.set(this.initialTenantCode.get());
|
this.tenantCode.set(this.initialTenantCode.get());
|
||||||
|
|
||||||
|
entityManager.reloadTenantFilters();
|
||||||
entityManager
|
|
||||||
.unwrap(Session.class)
|
|
||||||
.disableFilter(TenantScopedBaseEntity.TENANT_FILTER);
|
|
||||||
|
|
||||||
entityManager
|
|
||||||
.unwrap(Session.class)
|
|
||||||
.disableFilter(TenantScopedBaseEntity.DEFAULT_TENANT_FILTER);
|
|
||||||
if (this.initialTenant.get() != null || this.isDefaultTenant()) {
|
|
||||||
if(!this.isDefaultTenant()) {
|
|
||||||
entityManager
|
|
||||||
.unwrap(Session.class)
|
|
||||||
.enableFilter(TenantScopedBaseEntity.TENANT_FILTER)
|
|
||||||
.setParameter(TenantScopedBaseEntity.TENANT_FILTER_TENANT_PARAM, this.tenant.get().toString());
|
|
||||||
} else {
|
|
||||||
entityManager
|
|
||||||
.unwrap(Session.class)
|
|
||||||
.enableFilter(TenantScopedBaseEntity.DEFAULT_TENANT_FILTER);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTenant(UUID tenant, String tenantCode) {
|
public void setTenant(UUID tenant, String tenantCode) {
|
||||||
|
@ -122,6 +86,3 @@ public class TenantScope {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,7 @@ import org.springframework.context.i18n.LocaleContextHolder;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
@ -33,10 +34,10 @@ public class UuidValidator extends BaseValidator<UUID> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected List<Specification> specifications(UUID item) {
|
protected List<Specification> specifications(UUID item) {
|
||||||
return Arrays.asList(
|
return Collections.singletonList(
|
||||||
this.spec()
|
this.spec()
|
||||||
.must(() -> this.isValidGuid(item))
|
.must(() -> this.isValidGuid(item))
|
||||||
.failOn("uuid").failWith(messageSource.getMessage("Validation_Required", new Object[]{"uuid"}, LocaleContextHolder.getLocale()))
|
.failOn("uuid").failWith(messageSource.getMessage("Validation_Required", new Object[]{"uuid"}, LocaleContextHolder.getLocale()))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,9 +33,9 @@ public class TenantEntityManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
public <T> T merge(T entity) throws InvalidApplicationException {
|
public <T> T merge(T entity) throws InvalidApplicationException {
|
||||||
if (tenantScope.isMultitenant() && (entity instanceof TenantScoped tenantScopedEntity)) {
|
if (this.tenantScope.isMultitenant() && (entity instanceof TenantScoped tenantScopedEntity)) {
|
||||||
if (!tenantScope.isDefaultTenant()) {
|
if (!this.tenantScope.isDefaultTenant()) {
|
||||||
if (tenantScopedEntity.getTenantId() == null || !tenantScopedEntity.getTenantId().equals(tenantScope.getTenant())) throw new MyForbiddenException(this.errors.getTenantTampering().getCode(), this.errors.getTenantTampering().getMessage());
|
if (tenantScopedEntity.getTenantId() == null || !tenantScopedEntity.getTenantId().equals(this.tenantScope.getTenant())) throw new MyForbiddenException(this.errors.getTenantTampering().getCode(), this.errors.getTenantTampering().getMessage());
|
||||||
} else if (tenantScopedEntity.getTenantId() != null) {
|
} else if (tenantScopedEntity.getTenantId() != null) {
|
||||||
throw new MyForbiddenException(this.errors.getTenantTampering().getCode(), this.errors.getTenantTampering().getMessage());
|
throw new MyForbiddenException(this.errors.getTenantTampering().getCode(), this.errors.getTenantTampering().getMessage());
|
||||||
}
|
}
|
||||||
|
@ -44,9 +44,9 @@ public class TenantEntityManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void remove(Object entity) throws InvalidApplicationException {
|
public void remove(Object entity) throws InvalidApplicationException {
|
||||||
if (tenantScope.isMultitenant() && (entity instanceof TenantScoped tenantScopedEntity)) {
|
if (this.tenantScope.isMultitenant() && (entity instanceof TenantScoped tenantScopedEntity)) {
|
||||||
if (!tenantScope.isDefaultTenant()) {
|
if (!this.tenantScope.isDefaultTenant()) {
|
||||||
if (tenantScopedEntity.getTenantId() == null || !tenantScopedEntity.getTenantId().equals(tenantScope.getTenant())) throw new MyForbiddenException(this.errors.getTenantTampering().getCode(), this.errors.getTenantTampering().getMessage());
|
if (tenantScopedEntity.getTenantId() == null || !tenantScopedEntity.getTenantId().equals(this.tenantScope.getTenant())) throw new MyForbiddenException(this.errors.getTenantTampering().getCode(), this.errors.getTenantTampering().getMessage());
|
||||||
} else if (tenantScopedEntity.getTenantId() != null) {
|
} else if (tenantScopedEntity.getTenantId() != null) {
|
||||||
throw new MyForbiddenException(this.errors.getTenantTampering().getCode(), this.errors.getTenantTampering().getMessage());
|
throw new MyForbiddenException(this.errors.getTenantTampering().getCode(), this.errors.getTenantTampering().getMessage());
|
||||||
}
|
}
|
||||||
|
@ -57,12 +57,22 @@ public class TenantEntityManager {
|
||||||
public <T> T find(Class<T> entityClass, Object primaryKey) throws InvalidApplicationException {
|
public <T> T find(Class<T> entityClass, Object primaryKey) throws InvalidApplicationException {
|
||||||
T entity = this.entityManager.find(entityClass, primaryKey);
|
T entity = this.entityManager.find(entityClass, primaryKey);
|
||||||
|
|
||||||
if (tenantScope.isMultitenant() && (entity instanceof TenantScoped tenantScopedEntity)) {
|
if (this.tenantScope.isMultitenant() && (entity instanceof TenantScoped tenantScopedEntity)) {
|
||||||
if (tenantScopedEntity.getTenantId() != null && !tenantScopedEntity.getTenantId().equals(tenantScope.getTenant())) return null;
|
if (tenantScopedEntity.getTenantId() != null && !tenantScopedEntity.getTenantId().equals(this.tenantScope.getTenant())) return null;
|
||||||
}
|
}
|
||||||
return entity;
|
return entity;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public <T> T find(Class<T> entityClass, Object primaryKey, boolean disableTracking) throws InvalidApplicationException {
|
||||||
|
T entity = this.entityManager.find(entityClass, primaryKey);
|
||||||
|
|
||||||
|
if (this.tenantScope.isMultitenant() && (entity instanceof TenantScoped tenantScopedEntity)) {
|
||||||
|
if (tenantScopedEntity.getTenantId() != null && !tenantScopedEntity.getTenantId().equals(this.tenantScope.getTenant())) return null;
|
||||||
|
}
|
||||||
|
if (disableTracking) this.entityManager.detach(entity);
|
||||||
|
return entity;
|
||||||
|
}
|
||||||
|
|
||||||
public void flush() {
|
public void flush() {
|
||||||
this.entityManager.flush();
|
this.entityManager.flush();
|
||||||
}
|
}
|
||||||
|
@ -81,13 +91,16 @@ public class TenantEntityManager {
|
||||||
this.entityManager.clear();
|
this.entityManager.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void enableTenantFilters() throws InvalidApplicationException {
|
public void reloadTenantFilters() throws InvalidApplicationException {
|
||||||
if (!tenantScope.isSet()) return;
|
this.disableTenantFilters();
|
||||||
if(!tenantScope.isDefaultTenant()) {
|
|
||||||
|
if (!this.tenantScope.isSet()) return;
|
||||||
|
|
||||||
|
if (!this.tenantScope.isDefaultTenant()) {
|
||||||
this.entityManager
|
this.entityManager
|
||||||
.unwrap(Session.class)
|
.unwrap(Session.class)
|
||||||
.enableFilter(TenantScopedBaseEntity.TENANT_FILTER)
|
.enableFilter(TenantScopedBaseEntity.TENANT_FILTER)
|
||||||
.setParameter(TenantScopedBaseEntity.TENANT_FILTER_TENANT_PARAM, tenantScope.getTenant().toString());
|
.setParameter(TenantScopedBaseEntity.TENANT_FILTER_TENANT_PARAM, this.tenantScope.getTenant().toString());
|
||||||
} else {
|
} else {
|
||||||
this.entityManager
|
this.entityManager
|
||||||
.unwrap(Session.class)
|
.unwrap(Session.class)
|
||||||
|
@ -95,7 +108,24 @@ public class TenantEntityManager {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void disableTenantFilters(){
|
public void loadExplictTenantFilters() throws InvalidApplicationException {
|
||||||
|
this.disableTenantFilters();
|
||||||
|
|
||||||
|
if (!this.tenantScope.isSet()) return;
|
||||||
|
|
||||||
|
if (!this.tenantScope.isDefaultTenant()) {
|
||||||
|
this.entityManager
|
||||||
|
.unwrap(Session.class)
|
||||||
|
.enableFilter(TenantScopedBaseEntity.TENANT_FILTER_EXPLICT)
|
||||||
|
.setParameter(TenantScopedBaseEntity.TENANT_FILTER_TENANT_PARAM, this.tenantScope.getTenant().toString());
|
||||||
|
} else {
|
||||||
|
this.entityManager
|
||||||
|
.unwrap(Session.class)
|
||||||
|
.enableFilter(TenantScopedBaseEntity.DEFAULT_TENANT_FILTER);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void disableTenantFilters() {
|
||||||
this.entityManager
|
this.entityManager
|
||||||
.unwrap(Session.class)
|
.unwrap(Session.class)
|
||||||
.disableFilter(TenantScopedBaseEntity.TENANT_FILTER);
|
.disableFilter(TenantScopedBaseEntity.TENANT_FILTER);
|
||||||
|
@ -103,14 +133,17 @@ public class TenantEntityManager {
|
||||||
this.entityManager
|
this.entityManager
|
||||||
.unwrap(Session.class)
|
.unwrap(Session.class)
|
||||||
.disableFilter(TenantScopedBaseEntity.DEFAULT_TENANT_FILTER);
|
.disableFilter(TenantScopedBaseEntity.DEFAULT_TENANT_FILTER);
|
||||||
|
|
||||||
|
this.entityManager
|
||||||
|
.unwrap(Session.class)
|
||||||
|
.disableFilter(TenantScopedBaseEntity.TENANT_FILTER_EXPLICT);
|
||||||
}
|
}
|
||||||
|
|
||||||
public EntityManager getEntityManager() {
|
public EntityManager getEntityManager() {
|
||||||
return entityManager;
|
return this.entityManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setEntityManager(EntityManager entityManager) {
|
public void setEntityManager(EntityManager entityManager) {
|
||||||
this.entityManager = entityManager;
|
this.entityManager = entityManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,44 +1,44 @@
|
||||||
package gr.cite.annotation.data.tenant;
|
//package gr.cite.annotation.data.tenant;
|
||||||
|
//
|
||||||
import gr.cite.annotation.common.scope.tenant.TenantScope;
|
//import gr.cite.annotation.common.scope.tenant.TenantScope;
|
||||||
import jakarta.persistence.EntityManager;
|
//import jakarta.persistence.EntityManager;
|
||||||
import org.aspectj.lang.JoinPoint;
|
//import org.aspectj.lang.JoinPoint;
|
||||||
import org.aspectj.lang.annotation.AfterReturning;
|
//import org.aspectj.lang.annotation.AfterReturning;
|
||||||
import org.aspectj.lang.annotation.Aspect;
|
//import org.aspectj.lang.annotation.Aspect;
|
||||||
import org.hibernate.Session;
|
//import org.hibernate.Session;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
//import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Component;
|
//import org.springframework.stereotype.Component;
|
||||||
|
//
|
||||||
import javax.management.InvalidApplicationException;
|
//import javax.management.InvalidApplicationException;
|
||||||
|
//
|
||||||
@Aspect
|
//@Aspect
|
||||||
@Component
|
//@Component
|
||||||
public class TenantFilterAspect {
|
//public class TenantFilterAspect {
|
||||||
|
//
|
||||||
private final TenantScope tenantScope;
|
// private final TenantScope tenantScope;
|
||||||
|
//
|
||||||
@Autowired
|
// @Autowired
|
||||||
public TenantFilterAspect(
|
// public TenantFilterAspect(
|
||||||
TenantScope tenantScope
|
// TenantScope tenantScope
|
||||||
) {
|
// ) {
|
||||||
this.tenantScope = tenantScope;
|
// this.tenantScope = tenantScope;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@AfterReturning(
|
// @AfterReturning(
|
||||||
pointcut = "bean(entityManagerFactory) && execution(* createEntityManager(..))",
|
// pointcut = "bean(entityManagerFactory) && execution(* createEntityManager(..))",
|
||||||
returning = "retVal")
|
// returning = "retVal")
|
||||||
public void getSessionAfter(JoinPoint joinPoint, Object retVal) throws InvalidApplicationException {
|
// public void getSessionAfter(JoinPoint joinPoint, Object retVal) throws InvalidApplicationException {
|
||||||
if (retVal instanceof EntityManager && tenantScope.isSet()) {
|
// if (retVal instanceof EntityManager && tenantScope.isSet()) {
|
||||||
Session session = ((EntityManager) retVal).unwrap(Session.class);
|
// Session session = ((EntityManager) retVal).unwrap(Session.class);
|
||||||
if(!tenantScope.isDefaultTenant()) {
|
// if(!tenantScope.isDefaultTenant()) {
|
||||||
session
|
// session
|
||||||
.enableFilter(TenantScopedBaseEntity.TENANT_FILTER)
|
// .enableFilter(TenantScopedBaseEntity.TENANT_FILTER)
|
||||||
.setParameter(TenantScopedBaseEntity.TENANT_FILTER_TENANT_PARAM, tenantScope.getTenant().toString());
|
// .setParameter(TenantScopedBaseEntity.TENANT_FILTER_TENANT_PARAM, tenantScope.getTenant().toString());
|
||||||
} else {
|
// } else {
|
||||||
session
|
// session
|
||||||
.enableFilter(TenantScopedBaseEntity.DEFAULT_TENANT_FILTER);
|
// .enableFilter(TenantScopedBaseEntity.DEFAULT_TENANT_FILTER);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
}
|
//}
|
||||||
|
|
|
@ -16,22 +16,25 @@ import java.util.UUID;
|
||||||
//@Getter
|
//@Getter
|
||||||
//@Setter
|
//@Setter
|
||||||
//@NoArgsConstructor
|
//@NoArgsConstructor
|
||||||
@FilterDef(name = TenantScopedBaseEntity.TENANT_FILTER, parameters = {@ParamDef(name = TenantScopedBaseEntity.TENANT_FILTER_TENANT_PARAM, type = String.class)})
|
@FilterDef(name = TenantScopedBaseEntity.TENANT_FILTER, parameters = @ParamDef(name = TenantScopedBaseEntity.TENANT_FILTER_TENANT_PARAM, type = String.class))
|
||||||
|
@FilterDef(name = TenantScopedBaseEntity.TENANT_FILTER_EXPLICT, parameters = @ParamDef(name = TenantScopedBaseEntity.TENANT_FILTER_TENANT_PARAM, type = String.class))
|
||||||
@FilterDef(name = TenantScopedBaseEntity.DEFAULT_TENANT_FILTER)
|
@FilterDef(name = TenantScopedBaseEntity.DEFAULT_TENANT_FILTER)
|
||||||
@Filter(name = TenantScopedBaseEntity.DEFAULT_TENANT_FILTER, condition = "(tenant = tenant is null)")
|
|
||||||
@Filter(name = TenantScopedBaseEntity.TENANT_FILTER, condition = "(tenant = (cast(:tenantId as uuid)) or tenant is null)")
|
@Filter(name = TenantScopedBaseEntity.TENANT_FILTER, condition = "(tenant = (cast(:tenantId as uuid)) or tenant is null)")
|
||||||
|
@Filter(name = TenantScopedBaseEntity.TENANT_FILTER_EXPLICT, condition = "(tenant = (cast(:tenantId as uuid)))")
|
||||||
|
@Filter(name = TenantScopedBaseEntity.DEFAULT_TENANT_FILTER, condition = "(tenant = tenant is null)")
|
||||||
@EntityListeners(TenantListener.class)
|
@EntityListeners(TenantListener.class)
|
||||||
public abstract class TenantScopedBaseEntity implements TenantScoped, Serializable {
|
public abstract class TenantScopedBaseEntity implements TenantScoped, Serializable {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
public static final String TENANT_FILTER = "tenantFilter";
|
public static final String TENANT_FILTER = "tenantFilter";
|
||||||
public static final String DEFAULT_TENANT_FILTER = "defaultTenantFilter";
|
public static final String DEFAULT_TENANT_FILTER = "defaultTenantFilter";
|
||||||
|
public static final String TENANT_FILTER_EXPLICT = "tenantFilterExplict";
|
||||||
public static final String TENANT_FILTER_TENANT_PARAM = "tenantId";
|
public static final String TENANT_FILTER_TENANT_PARAM = "tenantId";
|
||||||
|
|
||||||
@Column(name = "tenant", columnDefinition = "uuid", nullable = true)
|
@Column(name = "tenant", columnDefinition = "uuid", nullable = true)
|
||||||
private UUID tenantId;
|
private UUID tenantId;
|
||||||
public static final String _tenantId = "tenantId";
|
public static final String _tenantId = "tenantId";
|
||||||
public UUID getTenantId() {
|
public UUID getTenantId() {
|
||||||
return tenantId;
|
return this.tenantId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -4,6 +4,7 @@ import gr.cite.annotation.integrationevent.inbox.InboxProperties;
|
||||||
import gr.cite.annotation.integrationevent.inbox.InboxRepositoryImpl;
|
import gr.cite.annotation.integrationevent.inbox.InboxRepositoryImpl;
|
||||||
import gr.cite.queueinbox.InboxConfigurer;
|
import gr.cite.queueinbox.InboxConfigurer;
|
||||||
import gr.cite.queueinbox.repository.InboxRepository;
|
import gr.cite.queueinbox.repository.InboxRepository;
|
||||||
|
import jakarta.persistence.EntityManagerFactory;
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||||
import org.springframework.context.ApplicationContext;
|
import org.springframework.context.ApplicationContext;
|
||||||
|
@ -15,18 +16,20 @@ import org.springframework.context.annotation.Configuration;
|
||||||
@ConditionalOnProperty(prefix = "queue.task.listener", name = "enable", matchIfMissing = false)
|
@ConditionalOnProperty(prefix = "queue.task.listener", name = "enable", matchIfMissing = false)
|
||||||
public class InboxIntegrationEventConfigurer extends InboxConfigurer {
|
public class InboxIntegrationEventConfigurer extends InboxConfigurer {
|
||||||
|
|
||||||
private ApplicationContext applicationContext;
|
private final ApplicationContext applicationContext;
|
||||||
|
|
||||||
private InboxProperties inboxProperties;
|
private final InboxProperties inboxProperties;
|
||||||
|
|
||||||
public InboxIntegrationEventConfigurer(ApplicationContext applicationContext, InboxProperties inboxProperties) {
|
private final EntityManagerFactory entityManagerFactory;
|
||||||
|
public InboxIntegrationEventConfigurer(ApplicationContext applicationContext, InboxProperties inboxProperties, EntityManagerFactory entityManagerFactory) {
|
||||||
this.applicationContext = applicationContext;
|
this.applicationContext = applicationContext;
|
||||||
this.inboxProperties = inboxProperties;
|
this.inboxProperties = inboxProperties;
|
||||||
|
this.entityManagerFactory = entityManagerFactory;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
public InboxRepository inboxRepositoryCreator() {
|
public InboxRepository inboxRepositoryCreator() {
|
||||||
return new InboxRepositoryImpl(this.applicationContext, this.inboxProperties);
|
return new InboxRepositoryImpl(this.applicationContext, this.inboxProperties, this.entityManagerFactory);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,6 +9,7 @@ import gr.cite.queueoutbox.repository.OutboxRepository;
|
||||||
import gr.cite.rabbitmq.IntegrationEventMessageConstants;
|
import gr.cite.rabbitmq.IntegrationEventMessageConstants;
|
||||||
import gr.cite.rabbitmq.RabbitProperties;
|
import gr.cite.rabbitmq.RabbitProperties;
|
||||||
import gr.cite.rabbitmq.broker.MessageHydrator;
|
import gr.cite.rabbitmq.broker.MessageHydrator;
|
||||||
|
import jakarta.persistence.EntityManagerFactory;
|
||||||
import org.springframework.amqp.core.MessageProperties;
|
import org.springframework.amqp.core.MessageProperties;
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||||
|
@ -25,12 +26,14 @@ import java.util.UUID;
|
||||||
@EnableConfigurationProperties({OutboxProperties.class})
|
@EnableConfigurationProperties({OutboxProperties.class})
|
||||||
@ConditionalOnProperty(prefix = "queue.task.publisher", name = "enable", matchIfMissing = false)
|
@ConditionalOnProperty(prefix = "queue.task.publisher", name = "enable", matchIfMissing = false)
|
||||||
public class OutboxIntegrationEventConfigurer extends OutboxConfigurer {
|
public class OutboxIntegrationEventConfigurer extends OutboxConfigurer {
|
||||||
private ApplicationContext applicationContext;
|
private final ApplicationContext applicationContext;
|
||||||
private OutboxProperties outboxProperties;
|
private final OutboxProperties outboxProperties;
|
||||||
|
private final EntityManagerFactory entityManagerFactory;
|
||||||
|
|
||||||
public OutboxIntegrationEventConfigurer(ApplicationContext applicationContext, OutboxProperties outboxProperties) {
|
public OutboxIntegrationEventConfigurer(ApplicationContext applicationContext, OutboxProperties outboxProperties, EntityManagerFactory entityManagerFactory) {
|
||||||
this.applicationContext = applicationContext;
|
this.applicationContext = applicationContext;
|
||||||
this.outboxProperties = outboxProperties;
|
this.outboxProperties = outboxProperties;
|
||||||
|
this.entityManagerFactory = entityManagerFactory;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
|
@ -66,7 +69,7 @@ public class OutboxIntegrationEventConfigurer extends OutboxConfigurer {
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
public OutboxRepository outboxRepositoryCreator() {
|
public OutboxRepository outboxRepositoryCreator() {
|
||||||
return new OutboxRepositoryImpl(this.applicationContext, this.outboxProperties);
|
return new OutboxRepositoryImpl(this.applicationContext, this.outboxProperties, this.entityManagerFactory);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -44,13 +44,15 @@ public class InboxRepositoryImpl implements InboxRepository {
|
||||||
private final JsonHandlingService jsonHandlingService;
|
private final JsonHandlingService jsonHandlingService;
|
||||||
|
|
||||||
private final InboxProperties inboxProperties;
|
private final InboxProperties inboxProperties;
|
||||||
|
private final EntityManagerFactory entityManagerFactory;
|
||||||
|
|
||||||
public InboxRepositoryImpl(
|
public InboxRepositoryImpl(
|
||||||
ApplicationContext applicationContext,
|
ApplicationContext applicationContext,
|
||||||
InboxProperties inboxProperties
|
InboxProperties inboxProperties, EntityManagerFactory entityManagerFactory
|
||||||
) {
|
) {
|
||||||
this.applicationContext = applicationContext;
|
this.applicationContext = applicationContext;
|
||||||
this.jsonHandlingService = this.applicationContext.getBean(JsonHandlingService.class);
|
this.entityManagerFactory = entityManagerFactory;
|
||||||
|
this.jsonHandlingService = this.applicationContext.getBean(JsonHandlingService.class);
|
||||||
this.inboxProperties = inboxProperties;
|
this.inboxProperties = inboxProperties;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,8 +64,7 @@ public class InboxRepositoryImpl implements InboxRepository {
|
||||||
try (FakeRequestScope ignored = new FakeRequestScope()) {
|
try (FakeRequestScope ignored = new FakeRequestScope()) {
|
||||||
try {
|
try {
|
||||||
QueryFactory queryFactory = this.applicationContext.getBean(QueryFactory.class);
|
QueryFactory queryFactory = this.applicationContext.getBean(QueryFactory.class);
|
||||||
EntityManagerFactory entityManagerFactory = this.applicationContext.getBean(EntityManagerFactory.class);
|
entityManager = this.entityManagerFactory.createEntityManager();
|
||||||
entityManager = entityManagerFactory.createEntityManager();
|
|
||||||
|
|
||||||
transaction = entityManager.getTransaction();
|
transaction = entityManager.getTransaction();
|
||||||
transaction.begin();
|
transaction.begin();
|
||||||
|
@ -120,9 +121,7 @@ public class InboxRepositoryImpl implements InboxRepository {
|
||||||
|
|
||||||
try (FakeRequestScope ignored = new FakeRequestScope()) {
|
try (FakeRequestScope ignored = new FakeRequestScope()) {
|
||||||
try {
|
try {
|
||||||
EntityManagerFactory entityManagerFactory = this.applicationContext.getBean(EntityManagerFactory.class);
|
entityManager = this.entityManagerFactory.createEntityManager();
|
||||||
|
|
||||||
entityManager = entityManagerFactory.createEntityManager();
|
|
||||||
transaction = entityManager.getTransaction();
|
transaction = entityManager.getTransaction();
|
||||||
|
|
||||||
transaction.begin();
|
transaction.begin();
|
||||||
|
@ -166,9 +165,7 @@ public class InboxRepositoryImpl implements InboxRepository {
|
||||||
|
|
||||||
try (FakeRequestScope ignored = new FakeRequestScope()) {
|
try (FakeRequestScope ignored = new FakeRequestScope()) {
|
||||||
try {
|
try {
|
||||||
EntityManagerFactory entityManagerFactory = this.applicationContext.getBean(EntityManagerFactory.class);
|
entityManager = this.entityManagerFactory.createEntityManager();
|
||||||
|
|
||||||
entityManager = entityManagerFactory.createEntityManager();
|
|
||||||
transaction = entityManager.getTransaction();
|
transaction = entityManager.getTransaction();
|
||||||
|
|
||||||
transaction.begin();
|
transaction.begin();
|
||||||
|
@ -214,9 +211,8 @@ public class InboxRepositoryImpl implements InboxRepository {
|
||||||
try (FakeRequestScope ignored = new FakeRequestScope()) {
|
try (FakeRequestScope ignored = new FakeRequestScope()) {
|
||||||
try {
|
try {
|
||||||
queueMessage = this.createQueueInboxEntity(inboxCreatorParams);
|
queueMessage = this.createQueueInboxEntity(inboxCreatorParams);
|
||||||
EntityManagerFactory entityManagerFactory = this.applicationContext.getBean(EntityManagerFactory.class);
|
|
||||||
|
|
||||||
entityManager = entityManagerFactory.createEntityManager();
|
entityManager = this.entityManagerFactory.createEntityManager();
|
||||||
transaction = entityManager.getTransaction();
|
transaction = entityManager.getTransaction();
|
||||||
|
|
||||||
transaction.begin();
|
transaction.begin();
|
||||||
|
@ -275,9 +271,7 @@ public class InboxRepositoryImpl implements InboxRepository {
|
||||||
try (FakeRequestScope ignored = new FakeRequestScope()) {
|
try (FakeRequestScope ignored = new FakeRequestScope()) {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
EntityManagerFactory entityManagerFactory = this.applicationContext.getBean(EntityManagerFactory.class);
|
entityManager = this.entityManagerFactory.createEntityManager();
|
||||||
|
|
||||||
entityManager = entityManagerFactory.createEntityManager();
|
|
||||||
transaction = entityManager.getTransaction();
|
transaction = entityManager.getTransaction();
|
||||||
|
|
||||||
TenantEntityManager tenantEntityManager = this.applicationContext.getBean(TenantEntityManager.class);
|
TenantEntityManager tenantEntityManager = this.applicationContext.getBean(TenantEntityManager.class);
|
||||||
|
|
|
@ -22,13 +22,8 @@ import gr.cite.tools.data.query.QueryFactory;
|
||||||
import gr.cite.tools.fieldset.BaseFieldSet;
|
import gr.cite.tools.fieldset.BaseFieldSet;
|
||||||
import gr.cite.tools.logging.LoggerService;
|
import gr.cite.tools.logging.LoggerService;
|
||||||
import gr.cite.tools.validation.ValidatorFactory;
|
import gr.cite.tools.validation.ValidatorFactory;
|
||||||
import jakarta.persistence.EntityManager;
|
|
||||||
import jakarta.persistence.EntityManagerFactory;
|
|
||||||
import jakarta.persistence.EntityTransaction;
|
|
||||||
import jakarta.persistence.OptimisticLockException;
|
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
|
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
|
||||||
import org.springframework.context.ApplicationContext;
|
|
||||||
import org.springframework.context.annotation.Scope;
|
import org.springframework.context.annotation.Scope;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
@ -80,16 +75,16 @@ public class AnnotationEntitiesRemovalIntegrationEventHandlerImpl implements Ann
|
||||||
EventProcessingStatus status = EventProcessingStatus.Success;
|
EventProcessingStatus status = EventProcessingStatus.Success;
|
||||||
try {
|
try {
|
||||||
if (this.tenantScope.isMultitenant() && properties.getTenantId() != null) {
|
if (this.tenantScope.isMultitenant() && properties.getTenantId() != null) {
|
||||||
TenantEntity tenant = queryFactory.query(TenantQuery.class).ids(properties.getTenantId()).firstAs(new BaseFieldSet().ensure(Tenant._id).ensure(Tenant._code));
|
TenantEntity tenant = queryFactory.query(TenantQuery.class).disableTracking().ids(properties.getTenantId()).firstAs(new BaseFieldSet().ensure(Tenant._id).ensure(Tenant._code));
|
||||||
if (tenant == null) {
|
if (tenant == null) {
|
||||||
logger.error("missing tenant from event message");
|
logger.error("missing tenant from event message");
|
||||||
return EventProcessingStatus.Error;
|
return EventProcessingStatus.Error;
|
||||||
}
|
}
|
||||||
this.tenantScope.setTempTenant(tenantEntityManager.getEntityManager(), properties.getTenantId(), tenant.getCode());
|
this.tenantScope.setTempTenant(tenantEntityManager, properties.getTenantId(), tenant.getCode());
|
||||||
} else if (this.tenantScope.isMultitenant()) {
|
} else if (this.tenantScope.isMultitenant()) {
|
||||||
// logger.error("missing tenant from event message");
|
// logger.error("missing tenant from event message");
|
||||||
// return EventProcessingStatus.Error;
|
// return EventProcessingStatus.Error;
|
||||||
this.tenantScope.setTempTenant(tenantEntityManager.getEntityManager(), null, this.tenantScope.getDefaultTenantCode());
|
this.tenantScope.setTempTenant(tenantEntityManager, null, this.tenantScope.getDefaultTenantCode());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -117,9 +112,9 @@ public class AnnotationEntitiesRemovalIntegrationEventHandlerImpl implements Ann
|
||||||
logger.error("Problem getting list of queue outbox. Skipping: {}", ex.getMessage(), ex);
|
logger.error("Problem getting list of queue outbox. Skipping: {}", ex.getMessage(), ex);
|
||||||
} finally {
|
} finally {
|
||||||
currentPrincipalResolver.pop();
|
currentPrincipalResolver.pop();
|
||||||
tenantScope.removeTempTenant(this.tenantEntityManager.getEntityManager());
|
|
||||||
try {
|
try {
|
||||||
this.tenantEntityManager.enableTenantFilters();
|
tenantScope.removeTempTenant(this.tenantEntityManager);
|
||||||
|
this.tenantEntityManager.reloadTenantFilters();
|
||||||
} catch (InvalidApplicationException e) {
|
} catch (InvalidApplicationException e) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,6 @@ package gr.cite.annotation.integrationevent.inbox.annotationentitiestouch;
|
||||||
import gr.cite.annotation.audit.AuditableAction;
|
import gr.cite.annotation.audit.AuditableAction;
|
||||||
import gr.cite.annotation.common.JsonHandlingService;
|
import gr.cite.annotation.common.JsonHandlingService;
|
||||||
import gr.cite.annotation.common.enums.IsActive;
|
import gr.cite.annotation.common.enums.IsActive;
|
||||||
import gr.cite.annotation.common.scope.fake.FakeRequestScope;
|
|
||||||
import gr.cite.annotation.common.scope.tenant.TenantScope;
|
import gr.cite.annotation.common.scope.tenant.TenantScope;
|
||||||
import gr.cite.annotation.data.EntityUserEntity;
|
import gr.cite.annotation.data.EntityUserEntity;
|
||||||
import gr.cite.annotation.data.TenantEntity;
|
import gr.cite.annotation.data.TenantEntity;
|
||||||
|
@ -14,7 +13,6 @@ import gr.cite.annotation.integrationevent.inbox.IntegrationEventProperties;
|
||||||
import gr.cite.annotation.model.Tenant;
|
import gr.cite.annotation.model.Tenant;
|
||||||
import gr.cite.annotation.query.EntityUserQuery;
|
import gr.cite.annotation.query.EntityUserQuery;
|
||||||
import gr.cite.annotation.query.TenantQuery;
|
import gr.cite.annotation.query.TenantQuery;
|
||||||
import gr.cite.annotation.service.tenant.TenantService;
|
|
||||||
import gr.cite.commons.web.oidc.principal.CurrentPrincipalResolver;
|
import gr.cite.commons.web.oidc.principal.CurrentPrincipalResolver;
|
||||||
import gr.cite.commons.web.oidc.principal.extractor.ClaimExtractorProperties;
|
import gr.cite.commons.web.oidc.principal.extractor.ClaimExtractorProperties;
|
||||||
import gr.cite.tools.auditing.AuditService;
|
import gr.cite.tools.auditing.AuditService;
|
||||||
|
@ -23,13 +21,8 @@ import gr.cite.tools.data.query.QueryFactory;
|
||||||
import gr.cite.tools.fieldset.BaseFieldSet;
|
import gr.cite.tools.fieldset.BaseFieldSet;
|
||||||
import gr.cite.tools.logging.LoggerService;
|
import gr.cite.tools.logging.LoggerService;
|
||||||
import gr.cite.tools.validation.ValidatorFactory;
|
import gr.cite.tools.validation.ValidatorFactory;
|
||||||
import jakarta.persistence.EntityManager;
|
|
||||||
import jakarta.persistence.EntityManagerFactory;
|
|
||||||
import jakarta.persistence.EntityTransaction;
|
|
||||||
import jakarta.persistence.OptimisticLockException;
|
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
|
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
|
||||||
import org.springframework.context.ApplicationContext;
|
|
||||||
import org.springframework.context.annotation.Scope;
|
import org.springframework.context.annotation.Scope;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
@ -81,16 +74,16 @@ public class AnnotationEntitiesTouchedIntegrationEventHandlerImpl implements Ann
|
||||||
EventProcessingStatus status = EventProcessingStatus.Success;
|
EventProcessingStatus status = EventProcessingStatus.Success;
|
||||||
try {
|
try {
|
||||||
if (this.tenantScope.isMultitenant() && properties.getTenantId() != null) {
|
if (this.tenantScope.isMultitenant() && properties.getTenantId() != null) {
|
||||||
TenantEntity tenant = queryFactory.query(TenantQuery.class).ids(properties.getTenantId()).firstAs(new BaseFieldSet().ensure(Tenant._id).ensure(Tenant._code));
|
TenantEntity tenant = queryFactory.query(TenantQuery.class).disableTracking().ids(properties.getTenantId()).firstAs(new BaseFieldSet().ensure(Tenant._id).ensure(Tenant._code));
|
||||||
if (tenant == null) {
|
if (tenant == null) {
|
||||||
logger.error("missing tenant from event message");
|
logger.error("missing tenant from event message");
|
||||||
return EventProcessingStatus.Error;
|
return EventProcessingStatus.Error;
|
||||||
}
|
}
|
||||||
this.tenantScope.setTempTenant(tenantEntityManager.getEntityManager(), properties.getTenantId(), tenant.getCode());
|
this.tenantScope.setTempTenant(tenantEntityManager, properties.getTenantId(), tenant.getCode());
|
||||||
} else if (this.tenantScope.isMultitenant()) {
|
} else if (this.tenantScope.isMultitenant()) {
|
||||||
// logger.error("missing tenant from event message");
|
// logger.error("missing tenant from event message");
|
||||||
// return EventProcessingStatus.Error;
|
// return EventProcessingStatus.Error;
|
||||||
this.tenantScope.setTempTenant(tenantEntityManager.getEntityManager(), null, this.tenantScope.getDefaultTenantCode());
|
this.tenantScope.setTempTenant(tenantEntityManager, null, this.tenantScope.getDefaultTenantCode());
|
||||||
}
|
}
|
||||||
|
|
||||||
currentPrincipalResolver.push(InboxPrincipal.build(properties, claimExtractorProperties));
|
currentPrincipalResolver.push(InboxPrincipal.build(properties, claimExtractorProperties));
|
||||||
|
@ -136,9 +129,9 @@ public class AnnotationEntitiesTouchedIntegrationEventHandlerImpl implements Ann
|
||||||
logger.error("Problem getting list of queue outbox. Skipping: {}", ex.getMessage(), ex);
|
logger.error("Problem getting list of queue outbox. Skipping: {}", ex.getMessage(), ex);
|
||||||
} finally {
|
} finally {
|
||||||
currentPrincipalResolver.pop();
|
currentPrincipalResolver.pop();
|
||||||
tenantScope.removeTempTenant(this.tenantEntityManager.getEntityManager());
|
|
||||||
try {
|
try {
|
||||||
this.tenantEntityManager.enableTenantFilters();
|
tenantScope.removeTempTenant(this.tenantEntityManager);
|
||||||
|
this.tenantEntityManager.reloadTenantFilters();
|
||||||
} catch (InvalidApplicationException e) {
|
} catch (InvalidApplicationException e) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@ public class TenantRemovalConsistencyHandler implements ConsistencyHandler<Tenan
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Boolean isConsistent(TenantRemovalConsistencyPredicates consistencyPredicates) {
|
public Boolean isConsistent(TenantRemovalConsistencyPredicates consistencyPredicates) {
|
||||||
long count = this.queryFactory.query(TenantQuery.class).ids(consistencyPredicates.getTenantId()).count();
|
long count = this.queryFactory.query(TenantQuery.class).disableTracking().ids(consistencyPredicates.getTenantId()).count();
|
||||||
return count > 0;
|
return count > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ public class UserRemovalConsistencyHandler implements ConsistencyHandler<UserRem
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Boolean isConsistent(UserRemovalConsistencyPredicates consistencyPredicates) {
|
public Boolean isConsistent(UserRemovalConsistencyPredicates consistencyPredicates) {
|
||||||
long count = this.queryFactory.query(UserQuery.class).ids(consistencyPredicates.getUserId()).count();
|
long count = this.queryFactory.query(UserQuery.class).disableTracking().ids(consistencyPredicates.getUserId()).count();
|
||||||
return count != 0;
|
return count != 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,6 +26,7 @@ import org.springframework.context.annotation.Scope;
|
||||||
import org.springframework.context.i18n.LocaleContextHolder;
|
import org.springframework.context.i18n.LocaleContextHolder;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import javax.management.InvalidApplicationException;
|
||||||
import java.util.AbstractMap;
|
import java.util.AbstractMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
@ -81,16 +82,16 @@ public class UserRemovalIntegrationEventHandlerImpl implements UserRemovalIntegr
|
||||||
EventProcessingStatus status = EventProcessingStatus.Success;
|
EventProcessingStatus status = EventProcessingStatus.Success;
|
||||||
try {
|
try {
|
||||||
if (this.tenantScope.isMultitenant() && properties.getTenantId() != null) {
|
if (this.tenantScope.isMultitenant() && properties.getTenantId() != null) {
|
||||||
TenantEntity tenant = queryFactory.query(TenantQuery.class).ids(properties.getTenantId()).firstAs(new BaseFieldSet().ensure(Tenant._id).ensure(Tenant._code));
|
TenantEntity tenant = queryFactory.query(TenantQuery.class).disableTracking().ids(properties.getTenantId()).firstAs(new BaseFieldSet().ensure(Tenant._id).ensure(Tenant._code));
|
||||||
if (tenant == null) {
|
if (tenant == null) {
|
||||||
logger.error("missing tenant from event message");
|
logger.error("missing tenant from event message");
|
||||||
return EventProcessingStatus.Error;
|
return EventProcessingStatus.Error;
|
||||||
}
|
}
|
||||||
this.tenantScope.setTempTenant(tenantEntityManager.getEntityManager(), properties.getTenantId(), tenant.getCode());
|
this.tenantScope.setTempTenant(tenantEntityManager, properties.getTenantId(), tenant.getCode());
|
||||||
} else if (this.tenantScope.isMultitenant()) {
|
} else if (this.tenantScope.isMultitenant()) {
|
||||||
// logger.error("missing tenant from event message");
|
// logger.error("missing tenant from event message");
|
||||||
// return EventProcessingStatus.Error;
|
// return EventProcessingStatus.Error;
|
||||||
this.tenantScope.setTempTenant(tenantEntityManager.getEntityManager(), null, this.tenantScope.getDefaultTenantCode());
|
this.tenantScope.setTempTenant(tenantEntityManager, null, this.tenantScope.getDefaultTenantCode());
|
||||||
}
|
}
|
||||||
|
|
||||||
currentPrincipalResolver.push(InboxPrincipal.build(properties, claimExtractorProperties));
|
currentPrincipalResolver.push(InboxPrincipal.build(properties, claimExtractorProperties));
|
||||||
|
@ -98,7 +99,7 @@ public class UserRemovalIntegrationEventHandlerImpl implements UserRemovalIntegr
|
||||||
if (!(userRemovalConsistencyHandler.isConsistent(new UserRemovalConsistencyPredicates(event.getUserId())))) {
|
if (!(userRemovalConsistencyHandler.isConsistent(new UserRemovalConsistencyPredicates(event.getUserId())))) {
|
||||||
status = EventProcessingStatus.Postponed;
|
status = EventProcessingStatus.Postponed;
|
||||||
currentPrincipalResolver.pop();
|
currentPrincipalResolver.pop();
|
||||||
tenantScope.removeTempTenant(this.tenantEntityManager.getEntityManager());
|
tenantScope.removeTempTenant(this.tenantEntityManager);
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -113,7 +114,11 @@ public class UserRemovalIntegrationEventHandlerImpl implements UserRemovalIntegr
|
||||||
logger.error("Problem getting list of queue outbox. Skipping: {}", ex.getMessage(), ex);
|
logger.error("Problem getting list of queue outbox. Skipping: {}", ex.getMessage(), ex);
|
||||||
} finally {
|
} finally {
|
||||||
currentPrincipalResolver.pop();
|
currentPrincipalResolver.pop();
|
||||||
tenantScope.removeTempTenant(this.tenantEntityManager.getEntityManager());
|
try {
|
||||||
|
tenantScope.removeTempTenant(this.tenantEntityManager);
|
||||||
|
} catch (InvalidApplicationException e) {
|
||||||
|
logger.error( e.getMessage(), e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
|
|
|
@ -15,6 +15,7 @@ import org.springframework.context.i18n.LocaleContextHolder;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
@ -230,10 +231,10 @@ public class UserTouchedIntegrationEvent extends TrackedEvent {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected List<Specification> specifications(UserCredential item) {
|
protected List<Specification> specifications(UserCredential item) {
|
||||||
return Arrays.asList(
|
return Collections.singletonList(
|
||||||
this.spec()
|
this.spec()
|
||||||
.must(() -> !this.isEmpty(item.getSubjectId()))
|
.must(() -> !this.isEmpty(item.getSubjectId()))
|
||||||
.failOn(UserCredential._subjectId).failWith(messageSource.getMessage("Validation_Required", new Object[]{UserCredential._subjectId}, LocaleContextHolder.getLocale()))
|
.failOn(UserCredential._subjectId).failWith(messageSource.getMessage("Validation_Required", new Object[]{UserCredential._subjectId}, LocaleContextHolder.getLocale()))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -272,10 +273,10 @@ public class UserTouchedIntegrationEvent extends TrackedEvent {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected List<Specification> specifications(TenantUser item) {
|
protected List<Specification> specifications(TenantUser item) {
|
||||||
return Arrays.asList(
|
return Collections.singletonList(
|
||||||
this.spec()
|
this.spec()
|
||||||
.must(() -> !this.isNull(item.getTenant()))
|
.must(() -> !this.isNull(item.getTenant()))
|
||||||
.failOn(TenantUser._tenant).failWith(messageSource.getMessage("Validation_Required", new Object[]{TenantUser._tenant}, LocaleContextHolder.getLocale()))
|
.failOn(TenantUser._tenant).failWith(messageSource.getMessage("Validation_Required", new Object[]{TenantUser._tenant}, LocaleContextHolder.getLocale()))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,6 +23,7 @@ import org.springframework.beans.factory.config.ConfigurableBeanFactory;
|
||||||
import org.springframework.context.annotation.Scope;
|
import org.springframework.context.annotation.Scope;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import javax.management.InvalidApplicationException;
|
||||||
import java.util.AbstractMap;
|
import java.util.AbstractMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
@ -71,16 +72,16 @@ public class UserTouchedIntegrationEventHandlerImpl implements UserTouchedIntegr
|
||||||
EventProcessingStatus status = EventProcessingStatus.Success;
|
EventProcessingStatus status = EventProcessingStatus.Success;
|
||||||
try {
|
try {
|
||||||
if (this.tenantScope.isMultitenant() && properties.getTenantId() != null) {
|
if (this.tenantScope.isMultitenant() && properties.getTenantId() != null) {
|
||||||
TenantEntity tenant = queryFactory.query(TenantQuery.class).ids(properties.getTenantId()).firstAs(new BaseFieldSet().ensure(Tenant._id).ensure(Tenant._code));
|
TenantEntity tenant = queryFactory.query(TenantQuery.class).disableTracking().ids(properties.getTenantId()).firstAs(new BaseFieldSet().ensure(Tenant._id).ensure(Tenant._code));
|
||||||
if (tenant == null) {
|
if (tenant == null) {
|
||||||
logger.error("missing tenant from event message");
|
logger.error("missing tenant from event message");
|
||||||
return EventProcessingStatus.Error;
|
return EventProcessingStatus.Error;
|
||||||
}
|
}
|
||||||
this.tenantScope.setTempTenant(tenantEntityManager.getEntityManager(), properties.getTenantId(), tenant.getCode());
|
this.tenantScope.setTempTenant(tenantEntityManager, properties.getTenantId(), tenant.getCode());
|
||||||
} else if (this.tenantScope.isMultitenant()) {
|
} else if (this.tenantScope.isMultitenant()) {
|
||||||
// logger.error("missing tenant from event message");
|
// logger.error("missing tenant from event message");
|
||||||
// return EventProcessingStatus.Error;
|
// return EventProcessingStatus.Error;
|
||||||
this.tenantScope.setTempTenant(tenantEntityManager.getEntityManager(), null, this.tenantScope.getDefaultTenantCode());
|
this.tenantScope.setTempTenant(tenantEntityManager, null, this.tenantScope.getDefaultTenantCode());
|
||||||
}
|
}
|
||||||
|
|
||||||
currentPrincipalResolver.push(InboxPrincipal.build(properties, claimExtractorProperties));
|
currentPrincipalResolver.push(InboxPrincipal.build(properties, claimExtractorProperties));
|
||||||
|
@ -96,7 +97,11 @@ public class UserTouchedIntegrationEventHandlerImpl implements UserTouchedIntegr
|
||||||
logger.error("Problem getting list of queue outbox. Skipping: {}", ex.getMessage(), ex);
|
logger.error("Problem getting list of queue outbox. Skipping: {}", ex.getMessage(), ex);
|
||||||
} finally {
|
} finally {
|
||||||
currentPrincipalResolver.pop();
|
currentPrincipalResolver.pop();
|
||||||
tenantScope.removeTempTenant(this.tenantEntityManager.getEntityManager());
|
try {
|
||||||
|
tenantScope.removeTempTenant(this.tenantEntityManager);
|
||||||
|
} catch (InvalidApplicationException e) {
|
||||||
|
logger.error(e.getMessage(), e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
|
|
|
@ -33,17 +33,16 @@ public class OutboxRepositoryImpl implements OutboxRepository {
|
||||||
|
|
||||||
private static final LoggerService logger = new LoggerService(LoggerFactory.getLogger(OutboxRepositoryImpl.class));
|
private static final LoggerService logger = new LoggerService(LoggerFactory.getLogger(OutboxRepositoryImpl.class));
|
||||||
|
|
||||||
private final JsonHandlingService jsonHandlingService;
|
|
||||||
|
|
||||||
private final OutboxProperties outboxProperties;
|
private final OutboxProperties outboxProperties;
|
||||||
|
private final EntityManagerFactory entityManagerFactory;
|
||||||
|
|
||||||
public OutboxRepositoryImpl(
|
public OutboxRepositoryImpl(
|
||||||
ApplicationContext applicationContext,
|
ApplicationContext applicationContext,
|
||||||
OutboxProperties outboxProperties
|
OutboxProperties outboxProperties, EntityManagerFactory entityManagerFactory
|
||||||
) {
|
) {
|
||||||
this.applicationContext = applicationContext;
|
this.applicationContext = applicationContext;
|
||||||
this.jsonHandlingService = this.applicationContext.getBean(JsonHandlingService.class);
|
|
||||||
this.outboxProperties = outboxProperties;
|
this.outboxProperties = outboxProperties;
|
||||||
|
this.entityManagerFactory = entityManagerFactory;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -54,8 +53,7 @@ public class OutboxRepositoryImpl implements OutboxRepository {
|
||||||
try (FakeRequestScope ignored = new FakeRequestScope()) {
|
try (FakeRequestScope ignored = new FakeRequestScope()) {
|
||||||
try {
|
try {
|
||||||
QueryFactory queryFactory = this.applicationContext.getBean(QueryFactory.class);
|
QueryFactory queryFactory = this.applicationContext.getBean(QueryFactory.class);
|
||||||
EntityManagerFactory entityManagerFactory = this.applicationContext.getBean(EntityManagerFactory.class);
|
entityManager = this.entityManagerFactory.createEntityManager();
|
||||||
entityManager = entityManagerFactory.createEntityManager();
|
|
||||||
|
|
||||||
transaction = entityManager.getTransaction();
|
transaction = entityManager.getTransaction();
|
||||||
transaction.begin();
|
transaction.begin();
|
||||||
|
@ -115,9 +113,7 @@ public class OutboxRepositoryImpl implements OutboxRepository {
|
||||||
|
|
||||||
try (FakeRequestScope ignored = new FakeRequestScope()) {
|
try (FakeRequestScope ignored = new FakeRequestScope()) {
|
||||||
try {
|
try {
|
||||||
EntityManagerFactory entityManagerFactory = this.applicationContext.getBean(EntityManagerFactory.class);
|
entityManager = this.entityManagerFactory.createEntityManager();
|
||||||
|
|
||||||
entityManager = entityManagerFactory.createEntityManager();
|
|
||||||
transaction = entityManager.getTransaction();
|
transaction = entityManager.getTransaction();
|
||||||
|
|
||||||
transaction.begin();
|
transaction.begin();
|
||||||
|
@ -161,9 +157,7 @@ public class OutboxRepositoryImpl implements OutboxRepository {
|
||||||
|
|
||||||
try (FakeRequestScope ignored = new FakeRequestScope()) {
|
try (FakeRequestScope ignored = new FakeRequestScope()) {
|
||||||
try {
|
try {
|
||||||
EntityManagerFactory entityManagerFactory = this.applicationContext.getBean(EntityManagerFactory.class);
|
entityManager = this.entityManagerFactory.createEntityManager();
|
||||||
|
|
||||||
entityManager = entityManagerFactory.createEntityManager();
|
|
||||||
transaction = entityManager.getTransaction();
|
transaction = entityManager.getTransaction();
|
||||||
|
|
||||||
transaction.begin();
|
transaction.begin();
|
||||||
|
@ -209,9 +203,7 @@ public class OutboxRepositoryImpl implements OutboxRepository {
|
||||||
try (FakeRequestScope ignored = new FakeRequestScope()) {
|
try (FakeRequestScope ignored = new FakeRequestScope()) {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
EntityManagerFactory entityManagerFactory = this.applicationContext.getBean(EntityManagerFactory.class);
|
entityManager = this.entityManagerFactory.createEntityManager();
|
||||||
|
|
||||||
entityManager = entityManagerFactory.createEntityManager();
|
|
||||||
transaction = entityManager.getTransaction();
|
transaction = entityManager.getTransaction();
|
||||||
transaction.begin();
|
transaction.begin();
|
||||||
|
|
||||||
|
@ -265,9 +257,7 @@ public class OutboxRepositoryImpl implements OutboxRepository {
|
||||||
try (FakeRequestScope ignored = new FakeRequestScope()) {
|
try (FakeRequestScope ignored = new FakeRequestScope()) {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
EntityManagerFactory entityManagerFactory = this.applicationContext.getBean(EntityManagerFactory.class);
|
entityManager = this.entityManagerFactory.createEntityManager();
|
||||||
|
|
||||||
entityManager = entityManagerFactory.createEntityManager();
|
|
||||||
transaction = entityManager.getTransaction();
|
transaction = entityManager.getTransaction();
|
||||||
transaction.begin();
|
transaction.begin();
|
||||||
|
|
||||||
|
@ -309,9 +299,7 @@ public class OutboxRepositoryImpl implements OutboxRepository {
|
||||||
try (FakeRequestScope ignored = new FakeRequestScope()) {
|
try (FakeRequestScope ignored = new FakeRequestScope()) {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
EntityManagerFactory entityManagerFactory = this.applicationContext.getBean(EntityManagerFactory.class);
|
entityManager = this.entityManagerFactory.createEntityManager();
|
||||||
|
|
||||||
entityManager = entityManagerFactory.createEntityManager();
|
|
||||||
transaction = entityManager.getTransaction();
|
transaction = entityManager.getTransaction();
|
||||||
transaction.begin();
|
transaction.begin();
|
||||||
|
|
||||||
|
@ -353,9 +341,8 @@ public class OutboxRepositoryImpl implements OutboxRepository {
|
||||||
try (FakeRequestScope ignored = new FakeRequestScope()) {
|
try (FakeRequestScope ignored = new FakeRequestScope()) {
|
||||||
try {
|
try {
|
||||||
queueMessage = this.mapEvent((OutboxIntegrationEvent) item);
|
queueMessage = this.mapEvent((OutboxIntegrationEvent) item);
|
||||||
EntityManagerFactory entityManagerFactory = this.applicationContext.getBean(EntityManagerFactory.class);
|
|
||||||
|
|
||||||
entityManager = entityManagerFactory.createEntityManager();
|
entityManager = this.entityManagerFactory.createEntityManager();
|
||||||
transaction = entityManager.getTransaction();
|
transaction = entityManager.getTransaction();
|
||||||
|
|
||||||
transaction.begin();
|
transaction.begin();
|
||||||
|
|
|
@ -100,7 +100,7 @@ public class AnnotationBuilder extends BaseBuilder<Annotation, AnnotationEntity>
|
||||||
.map(AnnotationEntity::getSubjectId)
|
.map(AnnotationEntity::getSubjectId)
|
||||||
.distinct()
|
.distinct()
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
UserQuery query = this.queryFactory.query(UserQuery.class).ids(userIds);
|
UserQuery query = this.queryFactory.query(UserQuery.class).disableTracking().ids(userIds);
|
||||||
Map<UUID, List<User>> users = this.builderFactory.builder(UserBuilder.class).authorize(this.authorize).asMasterKey(query, clone, User::getId);
|
Map<UUID, List<User>> users = this.builderFactory.builder(UserBuilder.class).authorize(this.authorize).asMasterKey(query, clone, User::getId);
|
||||||
|
|
||||||
users.forEach((key, val) -> {
|
users.forEach((key, val) -> {
|
||||||
|
|
|
@ -33,7 +33,7 @@ public abstract class BaseBuilder<M, D> implements Builder {
|
||||||
M model = null;
|
M model = null;
|
||||||
return null; //TODO
|
return null; //TODO
|
||||||
}
|
}
|
||||||
List<M> models = this.build(directives, Arrays.asList(data));
|
List<M> models = this.build(directives, List.of(data));
|
||||||
return models.stream().findFirst().orElse(null); //TODO
|
return models.stream().findFirst().orElse(null); //TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,6 @@ import gr.cite.annotation.common.scope.user.UserScope;
|
||||||
import gr.cite.annotation.data.AnnotationEntity;
|
import gr.cite.annotation.data.AnnotationEntity;
|
||||||
import gr.cite.annotation.data.EntityUserEntity;
|
import gr.cite.annotation.data.EntityUserEntity;
|
||||||
import gr.cite.annotation.model.Annotation;
|
import gr.cite.annotation.model.Annotation;
|
||||||
import gr.cite.annotation.model.EntityUser;
|
|
||||||
import gr.cite.annotation.query.utils.BuildSubQueryInput;
|
import gr.cite.annotation.query.utils.BuildSubQueryInput;
|
||||||
import gr.cite.annotation.query.utils.QueryUtilsService;
|
import gr.cite.annotation.query.utils.QueryUtilsService;
|
||||||
import gr.cite.commons.web.authz.service.AuthorizationService;
|
import gr.cite.commons.web.authz.service.AuthorizationService;
|
||||||
|
@ -175,6 +174,16 @@ public class AnnotationQuery extends QueryBase<AnnotationEntity> {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public AnnotationQuery enableTracking() {
|
||||||
|
this.noTracking = false;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public AnnotationQuery disableTracking() {
|
||||||
|
this.noTracking = false;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Boolean isFalseQuery() {
|
protected Boolean isFalseQuery() {
|
||||||
return this.isEmpty(this.ids) || this.isEmpty(this.excludedIds) || this.isEmpty(this.isActives) || this.isEmpty(this.entityIds);
|
return this.isEmpty(this.ids) || this.isEmpty(this.excludedIds) || this.isEmpty(this.isActives) || this.isEmpty(this.entityIds);
|
||||||
|
|
|
@ -29,9 +29,9 @@ public class EntityUserQuery extends QueryBase<EntityUserEntity> {
|
||||||
|
|
||||||
private Collection<UUID> ids, entityIds, userIds;
|
private Collection<UUID> ids, entityIds, userIds;
|
||||||
|
|
||||||
private Collection<IsActive> isActives;;
|
private Collection<IsActive> isActives;
|
||||||
|
|
||||||
private final AuthorizationService authService;
|
private final AuthorizationService authService;
|
||||||
|
|
||||||
private final UserScope userScope;
|
private final UserScope userScope;
|
||||||
|
|
||||||
|
@ -107,6 +107,16 @@ public class EntityUserQuery extends QueryBase<EntityUserEntity> {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public EntityUserQuery enableTracking() {
|
||||||
|
this.noTracking = false;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EntityUserQuery disableTracking() {
|
||||||
|
this.noTracking = false;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Boolean isFalseQuery() {
|
protected Boolean isFalseQuery() {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -120,6 +120,16 @@ public class QueueInboxQuery extends QueryBase<QueueInboxEntity> {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public QueueInboxQuery enableTracking() {
|
||||||
|
this.noTracking = false;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public QueueInboxQuery disableTracking() {
|
||||||
|
this.noTracking = false;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Class<QueueInboxEntity> entityClass() {
|
protected Class<QueueInboxEntity> entityClass() {
|
||||||
return QueueInboxEntity.class;
|
return QueueInboxEntity.class;
|
||||||
|
|
|
@ -125,6 +125,16 @@ public class QueueOutboxQuery extends QueryBase<QueueOutboxEntity> {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public QueueOutboxQuery enableTracking() {
|
||||||
|
this.noTracking = false;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public QueueOutboxQuery disableTracking() {
|
||||||
|
this.noTracking = false;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Class<QueueOutboxEntity> entityClass() {
|
protected Class<QueueOutboxEntity> entityClass() {
|
||||||
return QueueOutboxEntity.class;
|
return QueueOutboxEntity.class;
|
||||||
|
|
|
@ -68,6 +68,16 @@ public class TenantQuery extends QueryBase<TenantEntity> {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public TenantQuery enableTracking() {
|
||||||
|
this.noTracking = false;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public TenantQuery disableTracking() {
|
||||||
|
this.noTracking = false;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Boolean isFalseQuery() {
|
protected Boolean isFalseQuery() {
|
||||||
return this.isEmpty(this.ids) || this.isEmpty(this.isActives);
|
return this.isEmpty(this.ids) || this.isEmpty(this.isActives);
|
||||||
|
|
|
@ -114,6 +114,16 @@ public class TenantUserQuery extends QueryBase<TenantUserEntity> {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public TenantUserQuery enableTracking() {
|
||||||
|
this.noTracking = false;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public TenantUserQuery disableTracking() {
|
||||||
|
this.noTracking = false;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Class<TenantUserEntity> entityClass() {
|
protected Class<TenantUserEntity> entityClass() {
|
||||||
return TenantUserEntity.class;
|
return TenantUserEntity.class;
|
||||||
|
|
|
@ -125,6 +125,16 @@ public class UserCredentialQuery extends QueryBase<UserCredentialEntity> {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public UserCredentialQuery enableTracking() {
|
||||||
|
this.noTracking = false;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public UserCredentialQuery disableTracking() {
|
||||||
|
this.noTracking = false;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Boolean isFalseQuery() {
|
protected Boolean isFalseQuery() {
|
||||||
return
|
return
|
||||||
|
|
|
@ -84,6 +84,16 @@ public class UserQuery extends QueryBase<UserEntity> {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public UserQuery enableTracking() {
|
||||||
|
this.noTracking = false;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public UserQuery disableTracking() {
|
||||||
|
this.noTracking = false;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Class<UserEntity> entityClass() {
|
protected Class<UserEntity> entityClass() {
|
||||||
return UserEntity.class;
|
return UserEntity.class;
|
||||||
|
|
|
@ -23,7 +23,6 @@ import gr.cite.tools.fieldset.BaseFieldSet;
|
||||||
import gr.cite.tools.fieldset.FieldSet;
|
import gr.cite.tools.fieldset.FieldSet;
|
||||||
import gr.cite.tools.logging.LoggerService;
|
import gr.cite.tools.logging.LoggerService;
|
||||||
import gr.cite.tools.logging.MapLogEntry;
|
import gr.cite.tools.logging.MapLogEntry;
|
||||||
import jakarta.transaction.Transactional;
|
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.context.MessageSource;
|
import org.springframework.context.MessageSource;
|
||||||
import org.springframework.context.i18n.LocaleContextHolder;
|
import org.springframework.context.i18n.LocaleContextHolder;
|
||||||
|
@ -69,7 +68,6 @@ public class AnnotationServiceImpl implements AnnotationService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
|
||||||
public Annotation persist(AnnotationPersist model, FieldSet fields) throws MyForbiddenException, MyValidationException, MyApplicationException, MyNotFoundException {
|
public Annotation persist(AnnotationPersist model, FieldSet fields) throws MyForbiddenException, MyValidationException, MyApplicationException, MyNotFoundException {
|
||||||
logger.debug(new MapLogEntry("persisting annotation").And("model", model).And("fields", fields));
|
logger.debug(new MapLogEntry("persisting annotation").And("model", model).And("fields", fields));
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,6 @@ import gr.cite.tools.fieldset.BaseFieldSet;
|
||||||
import gr.cite.tools.fieldset.FieldSet;
|
import gr.cite.tools.fieldset.FieldSet;
|
||||||
import gr.cite.tools.logging.LoggerService;
|
import gr.cite.tools.logging.LoggerService;
|
||||||
import gr.cite.tools.logging.MapLogEntry;
|
import gr.cite.tools.logging.MapLogEntry;
|
||||||
import jakarta.transaction.Transactional;
|
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.context.MessageSource;
|
import org.springframework.context.MessageSource;
|
||||||
import org.springframework.context.i18n.LocaleContextHolder;
|
import org.springframework.context.i18n.LocaleContextHolder;
|
||||||
|
@ -85,7 +84,6 @@ public class UserServiceImpl implements UserService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
|
||||||
public User persist(UserTouchedIntegrationEvent model, FieldSet fields) throws MyForbiddenException, MyValidationException, MyApplicationException, MyNotFoundException, InvalidApplicationException, JsonProcessingException {
|
public User persist(UserTouchedIntegrationEvent model, FieldSet fields) throws MyForbiddenException, MyValidationException, MyApplicationException, MyNotFoundException, InvalidApplicationException, JsonProcessingException {
|
||||||
logger.debug(new MapLogEntry("persisting user").And("model", model).And("fields", fields));
|
logger.debug(new MapLogEntry("persisting user").And("model", model).And("fields", fields));
|
||||||
|
|
||||||
|
@ -185,7 +183,7 @@ public class UserServiceImpl implements UserService {
|
||||||
try {
|
try {
|
||||||
TenantEntity tenant = tenantEntities.stream().filter(x -> x.getId().equals(model.getTenant())).findFirst().orElse(null);
|
TenantEntity tenant = tenantEntities.stream().filter(x -> x.getId().equals(model.getTenant())).findFirst().orElse(null);
|
||||||
if (tenant == null) throw new MyNotFoundException(messageSource.getMessage("General_ItemNotFound", new Object[]{model.getTenant(), Tenant.class.getSimpleName()}, LocaleContextHolder.getLocale()));
|
if (tenant == null) throw new MyNotFoundException(messageSource.getMessage("General_ItemNotFound", new Object[]{model.getTenant(), Tenant.class.getSimpleName()}, LocaleContextHolder.getLocale()));
|
||||||
this.tenantScope.setTempTenant(this.entityManager.getEntityManager(), tenant.getId(), tenant.getCode());
|
this.tenantScope.setTempTenant(this.entityManager, tenant.getId(), tenant.getCode());
|
||||||
data = new TenantUserEntity();
|
data = new TenantUserEntity();
|
||||||
data.setId(UUID.randomUUID());
|
data.setId(UUID.randomUUID());
|
||||||
data.setUserId(userId);
|
data.setUserId(userId);
|
||||||
|
@ -195,7 +193,7 @@ public class UserServiceImpl implements UserService {
|
||||||
data.setIsActive(IsActive.Active);
|
data.setIsActive(IsActive.Active);
|
||||||
entityManager.persist(data);
|
entityManager.persist(data);
|
||||||
} finally {
|
} finally {
|
||||||
this.tenantScope.removeTempTenant(this.entityManager.getEntityManager());
|
this.tenantScope.removeTempTenant(this.entityManager);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
updatedCreatedIds.add(data.getId());
|
updatedCreatedIds.add(data.getId());
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-parent</artifactId>
|
<artifactId>spring-boot-starter-parent</artifactId>
|
||||||
<version>3.2.1</version>
|
<version>3.2.5</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<modules>
|
<modules>
|
||||||
|
@ -43,7 +43,7 @@
|
||||||
<groupId>org.hibernate.orm</groupId>
|
<groupId>org.hibernate.orm</groupId>
|
||||||
<artifactId>hibernate-core</artifactId>
|
<artifactId>hibernate-core</artifactId>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
<version>6.3.1.Final</version>
|
<version>6.5.2.Final</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.hibernate.orm</groupId>
|
<groupId>org.hibernate.orm</groupId>
|
||||||
|
@ -71,7 +71,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.fasterxml.jackson.datatype</groupId>
|
<groupId>com.fasterxml.jackson.datatype</groupId>
|
||||||
<artifactId>jackson-datatype-jsr310</artifactId>
|
<artifactId>jackson-datatype-jsr310</artifactId>
|
||||||
<version>2.13.3</version>
|
<version>2.17.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
|
@ -107,7 +107,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>gr.cite</groupId>
|
<groupId>gr.cite</groupId>
|
||||||
<artifactId>data-tools</artifactId>
|
<artifactId>data-tools</artifactId>
|
||||||
<version>2.1.2</version>
|
<version>2.1.4</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
|
@ -119,7 +119,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>gr.cite</groupId>
|
<groupId>gr.cite</groupId>
|
||||||
<artifactId>validation</artifactId>
|
<artifactId>validation</artifactId>
|
||||||
<version>3.0.2</version>
|
<version>3.0.3</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
|
@ -149,6 +149,12 @@
|
||||||
<artifactId>queue-outbox</artifactId>
|
<artifactId>queue-outbox</artifactId>
|
||||||
<version>2.1.1</version>
|
<version>2.1.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>gr.cite</groupId>
|
||||||
|
<artifactId>cache</artifactId>
|
||||||
|
<version>2.2.0</version>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<profiles>
|
<profiles>
|
||||||
|
|
|
@ -20,7 +20,7 @@ public class PageEntity {
|
||||||
private List<SectionEntity> sections;
|
private List<SectionEntity> sections;
|
||||||
|
|
||||||
public List<SectionEntity> getSections() {
|
public List<SectionEntity> getSections() {
|
||||||
return sections;
|
return this.sections;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSections(List<SectionEntity> sections) {
|
public void setSections(List<SectionEntity> sections) {
|
||||||
|
@ -28,7 +28,7 @@ public class PageEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getId() {
|
public String getId() {
|
||||||
return id;
|
return this.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setId(String id) {
|
public void setId(String id) {
|
||||||
|
@ -36,7 +36,7 @@ public class PageEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getOrdinal() {
|
public int getOrdinal() {
|
||||||
return ordinal;
|
return this.ordinal;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setOrdinal(int ordinal) {
|
public void setOrdinal(int ordinal) {
|
||||||
|
@ -44,7 +44,7 @@ public class PageEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getTitle() {
|
public String getTitle() {
|
||||||
return title;
|
return this.title;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTitle(String title) {
|
public void setTitle(String title) {
|
||||||
|
|
|
@ -43,6 +43,7 @@ import org.opencdmp.data.tenant.TenantScopedBaseEntity;
|
||||||
import org.opencdmp.errorcode.ErrorThesaurusProperties;
|
import org.opencdmp.errorcode.ErrorThesaurusProperties;
|
||||||
import org.opencdmp.event.EventBroker;
|
import org.opencdmp.event.EventBroker;
|
||||||
import org.opencdmp.event.UserTouchedEvent;
|
import org.opencdmp.event.UserTouchedEvent;
|
||||||
|
import org.opencdmp.integrationevent.outbox.annotationentitytouch.AnnotationEntityTouchedIntegrationEventHandler;
|
||||||
import org.opencdmp.integrationevent.outbox.notification.NotifyIntegrationEvent;
|
import org.opencdmp.integrationevent.outbox.notification.NotifyIntegrationEvent;
|
||||||
import org.opencdmp.integrationevent.outbox.notification.NotifyIntegrationEventHandler;
|
import org.opencdmp.integrationevent.outbox.notification.NotifyIntegrationEventHandler;
|
||||||
import org.opencdmp.integrationevent.outbox.userremoval.UserRemovalIntegrationEventHandler;
|
import org.opencdmp.integrationevent.outbox.userremoval.UserRemovalIntegrationEventHandler;
|
||||||
|
@ -112,7 +113,7 @@ public class UserServiceImpl implements UserService {
|
||||||
private final UserRemovalIntegrationEventHandler userRemovalIntegrationEventHandler;
|
private final UserRemovalIntegrationEventHandler userRemovalIntegrationEventHandler;
|
||||||
private final AuthorizationProperties authorizationProperties;
|
private final AuthorizationProperties authorizationProperties;
|
||||||
private final TenantScope tenantScope;
|
private final TenantScope tenantScope;
|
||||||
|
private final AnnotationEntityTouchedIntegrationEventHandler annotationEntityTouchedIntegrationEventHandler;
|
||||||
@Autowired
|
@Autowired
|
||||||
public UserServiceImpl(
|
public UserServiceImpl(
|
||||||
TenantEntityManager entityManager,
|
TenantEntityManager entityManager,
|
||||||
|
@ -125,7 +126,7 @@ public class UserServiceImpl implements UserService {
|
||||||
EventBroker eventBroker,
|
EventBroker eventBroker,
|
||||||
JsonHandlingService jsonHandlingService,
|
JsonHandlingService jsonHandlingService,
|
||||||
XmlHandlingService xmlHandlingService, QueryFactory queryFactory,
|
XmlHandlingService xmlHandlingService, QueryFactory queryFactory,
|
||||||
UserScope userScope, KeycloakService keycloakService, ActionConfirmationService actionConfirmationService, NotificationProperties notificationProperties, NotifyIntegrationEventHandler eventHandler, ValidatorFactory validatorFactory, ElasticService elasticService, UserTouchedIntegrationEventHandler userTouchedIntegrationEventHandler, UserRemovalIntegrationEventHandler userRemovalIntegrationEventHandler, AuthorizationProperties authorizationProperties, TenantScope tenantScope) {
|
UserScope userScope, KeycloakService keycloakService, ActionConfirmationService actionConfirmationService, NotificationProperties notificationProperties, NotifyIntegrationEventHandler eventHandler, ValidatorFactory validatorFactory, ElasticService elasticService, UserTouchedIntegrationEventHandler userTouchedIntegrationEventHandler, UserRemovalIntegrationEventHandler userRemovalIntegrationEventHandler, AuthorizationProperties authorizationProperties, TenantScope tenantScope, AnnotationEntityTouchedIntegrationEventHandler annotationEntityTouchedIntegrationEventHandler) {
|
||||||
this.entityManager = entityManager;
|
this.entityManager = entityManager;
|
||||||
this.authorizationService = authorizationService;
|
this.authorizationService = authorizationService;
|
||||||
this.deleterFactory = deleterFactory;
|
this.deleterFactory = deleterFactory;
|
||||||
|
@ -148,6 +149,7 @@ public class UserServiceImpl implements UserService {
|
||||||
this.userRemovalIntegrationEventHandler = userRemovalIntegrationEventHandler;
|
this.userRemovalIntegrationEventHandler = userRemovalIntegrationEventHandler;
|
||||||
this.authorizationProperties = authorizationProperties;
|
this.authorizationProperties = authorizationProperties;
|
||||||
this.tenantScope = tenantScope;
|
this.tenantScope = tenantScope;
|
||||||
|
this.annotationEntityTouchedIntegrationEventHandler = annotationEntityTouchedIntegrationEventHandler;
|
||||||
}
|
}
|
||||||
|
|
||||||
//region persist
|
//region persist
|
||||||
|
@ -739,6 +741,14 @@ public class UserServiceImpl implements UserService {
|
||||||
for (DescriptionEntity description : descriptions){
|
for (DescriptionEntity description : descriptions){
|
||||||
this.elasticService.persistDescription(description);
|
this.elasticService.persistDescription(description);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (DmpEntity dmp : dmps){
|
||||||
|
this.annotationEntityTouchedIntegrationEventHandler.handleDmp(dmp.getId());
|
||||||
|
}
|
||||||
|
|
||||||
|
for (DescriptionEntity description : descriptions){
|
||||||
|
this.annotationEntityTouchedIntegrationEventHandler.handleDescription(description.getId());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void confirmRemoveCredential(String token) throws InvalidApplicationException {
|
public void confirmRemoveCredential(String token) throws InvalidApplicationException {
|
||||||
|
|
|
@ -7,6 +7,43 @@ import { AnalyticsProviderType, AnalyticsProviders } from "@app/core/model/confi
|
||||||
export class AnalyticsService {
|
export class AnalyticsService {
|
||||||
|
|
||||||
public static Dashboard: string = 'Home Dashboard';
|
public static Dashboard: string = 'Home Dashboard';
|
||||||
|
public static About: string = 'About';
|
||||||
|
public static DescriptionTemplateEditor: string = 'Admin: DMP Blueprints';
|
||||||
|
public static DescriptionTemplateListing: string = 'Admin: DMP Templates';
|
||||||
|
public static DmpBlueprintEditor: string = 'Admin: DMP Blueprints';
|
||||||
|
public static DmpBlueprintListing: string = 'Admin: DMP Templates';
|
||||||
|
public static LanguagesEditor: string = 'Admin: Languages';
|
||||||
|
public static PrefillingSourcesEditor: string = 'Admin: PrefillingSources';
|
||||||
|
public static ReferencesEditor: string = 'Admin: References';
|
||||||
|
public static TenantsEditor: string = 'Admin: Tenants';
|
||||||
|
public static TenantConfigurationsColorsEditor: string = 'Admin: TenantConfigurations';
|
||||||
|
public static TenantConfigurationsUserLocaleEditor: string = 'Admin: TenantConfigurations';
|
||||||
|
public static DepositEditor: string = 'Admin: TenantConfigurations';
|
||||||
|
public static FileTransformerEditor: string = 'Admin: TenantConfigurations';
|
||||||
|
public static LogoEditor: string = 'Admin: TenantConfigurations';
|
||||||
|
public static ContactContent: string = 'Contact Content';
|
||||||
|
public static RecentEditedActivity: string = 'Recent DMP Activity';
|
||||||
|
public static DescriptionEditor: string = 'Description Editor';
|
||||||
|
public static DescriptionListing: string = 'Descriptions';
|
||||||
|
public static DatasetCriteriaDialog: string = 'Dataset Criteria';
|
||||||
|
public static DescriptionListingItem: string = 'Description Listing Item';
|
||||||
|
public static DescriptionOverview: string = 'Description Overview';
|
||||||
|
public static DmpEditor: string = 'DMP Editor';
|
||||||
|
public static DmpListing: string = 'DMPs';
|
||||||
|
public static DmpCriteriaDialog: string = 'DMP Criteria';
|
||||||
|
public static DmpListingItem: string = 'DMP Listing Item';
|
||||||
|
public static StartNewDmpDialog: string = 'Start New DMP Dialog';
|
||||||
|
public static DmpUploadDialog: string = 'DMP Upload Dialog';
|
||||||
|
public static DmpOverview: string = 'DMP Overview';
|
||||||
|
public static FAQ: string = 'FAQ';
|
||||||
|
public static Glossary: string = 'Glossary';
|
||||||
|
public static Navbar: string = 'Navbar';
|
||||||
|
public static Sidebar: string = 'Sidebar';
|
||||||
|
public static SidebarFooter: string = 'Sidebar Footer';
|
||||||
|
public static Terms: string = 'Terms of Service';
|
||||||
|
public static UserGuideContent: string = 'User Guide Content';
|
||||||
|
public static UserProfile: string = 'User Profile';
|
||||||
|
public static NotificationTempplateEditor: string = 'Admin: Notification Tempplates';
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private configurationService: ConfigurationService,
|
private configurationService: ConfigurationService,
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
import { SupportiveMaterialFieldType } from '@app/core/common/enum/supportive-material-field-type';
|
import { SupportiveMaterialFieldType } from '@app/core/common/enum/supportive-material-field-type';
|
||||||
import { LanguageService } from '@app/core/services/language/language.service';
|
import { LanguageService } from '@app/core/services/language/language.service';
|
||||||
import { MatomoService } from '@app/core/services/matomo/matomo-service';
|
import { AnalyticsService } from '@app/core/services/matomo/analytics-service';
|
||||||
import { SupportiveMaterialService } from '@app/core/services/supportive-material/supportive-material.service';
|
import { SupportiveMaterialService } from '@app/core/services/supportive-material/supportive-material.service';
|
||||||
import { BaseComponent } from '@common/base/base.component';
|
import { BaseComponent } from '@common/base/base.component';
|
||||||
import { TranslateService, LangChangeEvent } from '@ngx-translate/core';
|
import { TranslateService, LangChangeEvent } from '@ngx-translate/core';
|
||||||
|
@ -23,13 +23,13 @@ export class AboutComponent extends BaseComponent implements OnInit {
|
||||||
private supportiveMaterialService: SupportiveMaterialService,
|
private supportiveMaterialService: SupportiveMaterialService,
|
||||||
private sanitizer: DomSanitizer,
|
private sanitizer: DomSanitizer,
|
||||||
private languageService: LanguageService,
|
private languageService: LanguageService,
|
||||||
private matomoService: MatomoService,
|
|
||||||
private translate: TranslateService,
|
private translate: TranslateService,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
|
private analyticsService: AnalyticsService
|
||||||
) { super(); }
|
) { super(); }
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.matomoService.trackPageView('About');
|
this.analyticsService.trackPageView(AnalyticsService.About);
|
||||||
this.translate.onLangChange.subscribe((event: LangChangeEvent) => {
|
this.translate.onLangChange.subscribe((event: LangChangeEvent) => {
|
||||||
this.router.navigate(['/reload'], { skipLocationChange: true }).then(() => this.router.navigate(['/about']));
|
this.router.navigate(['/reload'], { skipLocationChange: true }).then(() => this.router.navigate(['/about']));
|
||||||
});
|
});
|
||||||
|
|
|
@ -22,7 +22,6 @@ import { LanguageInfoService } from '@app/core/services/culture/language-info-se
|
||||||
import { DescriptionTemplateTypeService } from '@app/core/services/description-template-type/description-template-type.service';
|
import { DescriptionTemplateTypeService } from '@app/core/services/description-template-type/description-template-type.service';
|
||||||
import { DescriptionTemplateService } from '@app/core/services/description-template/description-template.service';
|
import { DescriptionTemplateService } from '@app/core/services/description-template/description-template.service';
|
||||||
import { LoggingService } from '@app/core/services/logging/logging-service';
|
import { LoggingService } from '@app/core/services/logging/logging-service';
|
||||||
import { MatomoService } from '@app/core/services/matomo/matomo-service';
|
|
||||||
import { UserService } from '@app/core/services/user/user.service';
|
import { UserService } from '@app/core/services/user/user.service';
|
||||||
import { FileUtils } from '@app/core/services/utilities/file-utils.service';
|
import { FileUtils } from '@app/core/services/utilities/file-utils.service';
|
||||||
import { QueryParamsService } from '@app/core/services/utilities/query-params.service';
|
import { QueryParamsService } from '@app/core/services/utilities/query-params.service';
|
||||||
|
@ -45,6 +44,7 @@ import { LockTargetType } from '@app/core/common/enum/lock-target-type';
|
||||||
import { Title } from '@angular/platform-browser';
|
import { Title } from '@angular/platform-browser';
|
||||||
import { SingleAutoCompleteConfiguration } from '@app/library/auto-complete/single/single-auto-complete-configuration';
|
import { SingleAutoCompleteConfiguration } from '@app/library/auto-complete/single/single-auto-complete-configuration';
|
||||||
import { DescriptionTemplateTypeStatus } from '@app/core/common/enum/description-template-type-status';
|
import { DescriptionTemplateTypeStatus } from '@app/core/common/enum/description-template-type-status';
|
||||||
|
import { AnalyticsService } from '@app/core/services/matomo/analytics-service';
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
@ -138,10 +138,10 @@ export class DescriptionTemplateEditorComponent extends BaseEditor<DescriptionTe
|
||||||
private logger: LoggingService,
|
private logger: LoggingService,
|
||||||
private descriptionTemplateEditorService: DescriptionTemplateEditorService,
|
private descriptionTemplateEditorService: DescriptionTemplateEditorService,
|
||||||
private fileUtils: FileUtils,
|
private fileUtils: FileUtils,
|
||||||
private matomoService: MatomoService,
|
|
||||||
private languageInfoService: LanguageInfoService,
|
private languageInfoService: LanguageInfoService,
|
||||||
public userService: UserService,
|
public userService: UserService,
|
||||||
public titleService: Title
|
public titleService: Title,
|
||||||
|
private analyticsService: AnalyticsService
|
||||||
) {
|
) {
|
||||||
const descriptionLabel:string = route.snapshot.data['entity']?.label;
|
const descriptionLabel:string = route.snapshot.data['entity']?.label;
|
||||||
if (descriptionLabel) {
|
if (descriptionLabel) {
|
||||||
|
@ -153,7 +153,7 @@ export class DescriptionTemplateEditorComponent extends BaseEditor<DescriptionTe
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
this.matomoService.trackPageView('Admin: DMP Blueprints');
|
this.analyticsService.trackPageView(AnalyticsService.DescriptionTemplateEditor);
|
||||||
super.ngOnInit();
|
super.ngOnInit();
|
||||||
this.singleAutocompleteDescriptionTemplateTypeConfiguration = this.descriptionTemplateTypeService.getSingleAutocompleteConfiguration([DescriptionTemplateTypeStatus.Finalized]);
|
this.singleAutocompleteDescriptionTemplateTypeConfiguration = this.descriptionTemplateTypeService.getSingleAutocompleteConfiguration([DescriptionTemplateTypeStatus.Finalized]);
|
||||||
this.initModelFlags(this.route.snapshot.data['action']);
|
this.initModelFlags(this.route.snapshot.data['action']);
|
||||||
|
|
|
@ -5,7 +5,6 @@ import { ActivatedRoute, Router } from '@angular/router';
|
||||||
import { IsActive } from '@app/core/common/enum/is-active.enum';
|
import { IsActive } from '@app/core/common/enum/is-active.enum';
|
||||||
import { DescriptionTemplate } from '@app/core/model/description-template/description-template';
|
import { DescriptionTemplate } from '@app/core/model/description-template/description-template';
|
||||||
import { AuthService } from '@app/core/services/auth/auth.service';
|
import { AuthService } from '@app/core/services/auth/auth.service';
|
||||||
import { MatomoService } from '@app/core/services/matomo/matomo-service';
|
|
||||||
import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service';
|
import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service';
|
||||||
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
|
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
|
||||||
import { FileUtils } from '@app/core/services/utilities/file-utils.service';
|
import { FileUtils } from '@app/core/services/utilities/file-utils.service';
|
||||||
|
@ -30,6 +29,7 @@ import { DescriptionTemplateLookup } from '@app/core/query/description-template.
|
||||||
import { IsActiveTypePipe } from '@common/formatting/pipes/is-active-type.pipe';
|
import { IsActiveTypePipe } from '@common/formatting/pipes/is-active-type.pipe';
|
||||||
import { DescriptionTemplateVersionStatus } from '@app/core/common/enum/description-template-version-status';
|
import { DescriptionTemplateVersionStatus } from '@app/core/common/enum/description-template-version-status';
|
||||||
import { SumarizeTextPipe } from '@app/core/pipes/sumarize-text.pipe';
|
import { SumarizeTextPipe } from '@app/core/pipes/sumarize-text.pipe';
|
||||||
|
import { AnalyticsService } from '@app/core/services/matomo/analytics-service';
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
@ -72,13 +72,13 @@ export class DescriptionTemplateListingComponent extends BaseListingComponent<De
|
||||||
protected queryParamsService: QueryParamsService,
|
protected queryParamsService: QueryParamsService,
|
||||||
private descriptionTemplateService: DescriptionTemplateService,
|
private descriptionTemplateService: DescriptionTemplateService,
|
||||||
public authService: AuthService,
|
public authService: AuthService,
|
||||||
private matomoService: MatomoService,
|
|
||||||
private pipeService: PipeService,
|
private pipeService: PipeService,
|
||||||
public enumUtils: EnumUtils,
|
public enumUtils: EnumUtils,
|
||||||
private language: TranslateService,
|
private language: TranslateService,
|
||||||
private dialog: MatDialog,
|
private dialog: MatDialog,
|
||||||
private fileUtils: FileUtils,
|
private fileUtils: FileUtils,
|
||||||
private sumarizeTextPipe: SumarizeTextPipe
|
private sumarizeTextPipe: SumarizeTextPipe,
|
||||||
|
private analyticsService: AnalyticsService
|
||||||
) {
|
) {
|
||||||
super(router, route, uiNotificationService, httpErrorHandlingService, queryParamsService);
|
super(router, route, uiNotificationService, httpErrorHandlingService, queryParamsService);
|
||||||
// Lookup setup
|
// Lookup setup
|
||||||
|
@ -88,7 +88,7 @@ export class DescriptionTemplateListingComponent extends BaseListingComponent<De
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.matomoService.trackPageView('Admin: DMP Templates');
|
this.analyticsService.trackPageView(AnalyticsService.DescriptionTemplateListing);
|
||||||
super.ngOnInit();
|
super.ngOnInit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,6 @@ import { ConfigurationService } from '@app/core/services/configuration/configura
|
||||||
import { DescriptionTemplateService } from '@app/core/services/description-template/description-template.service';
|
import { DescriptionTemplateService } from '@app/core/services/description-template/description-template.service';
|
||||||
import { LockService } from '@app/core/services/lock/lock.service';
|
import { LockService } from '@app/core/services/lock/lock.service';
|
||||||
import { LoggingService } from '@app/core/services/logging/logging-service';
|
import { LoggingService } from '@app/core/services/logging/logging-service';
|
||||||
import { MatomoService } from '@app/core/services/matomo/matomo-service';
|
|
||||||
import { PrefillingSourceService } from '@app/core/services/prefilling-source/prefilling-source.service';
|
import { PrefillingSourceService } from '@app/core/services/prefilling-source/prefilling-source.service';
|
||||||
import { ReferenceTypeService } from '@app/core/services/reference-type/reference-type.service';
|
import { ReferenceTypeService } from '@app/core/services/reference-type/reference-type.service';
|
||||||
import { SemanticsService } from '@app/core/services/semantic/semantics.service';
|
import { SemanticsService } from '@app/core/services/semantic/semantics.service';
|
||||||
|
@ -47,6 +46,7 @@ import { DmpBlueprintEditorResolver } from './dmp-blueprint-editor.resolver';
|
||||||
import { DmpBlueprintEditorService } from './dmp-blueprint-editor.service';
|
import { DmpBlueprintEditorService } from './dmp-blueprint-editor.service';
|
||||||
import { DmpBlueprintVersionStatus } from '@app/core/common/enum/dmp-blueprint-version-status';
|
import { DmpBlueprintVersionStatus } from '@app/core/common/enum/dmp-blueprint-version-status';
|
||||||
import { Title } from '@angular/platform-browser';
|
import { Title } from '@angular/platform-browser';
|
||||||
|
import { AnalyticsService } from '@app/core/services/matomo/analytics-service';
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
@ -131,12 +131,12 @@ export class DmpBlueprintEditorComponent extends BaseEditor<DmpBlueprintEditorMo
|
||||||
private logger: LoggingService,
|
private logger: LoggingService,
|
||||||
private dmpBlueprintEditorService: DmpBlueprintEditorService,
|
private dmpBlueprintEditorService: DmpBlueprintEditorService,
|
||||||
private fileUtils: FileUtils,
|
private fileUtils: FileUtils,
|
||||||
private matomoService: MatomoService,
|
|
||||||
public descriptionTemplateService: DescriptionTemplateService,
|
public descriptionTemplateService: DescriptionTemplateService,
|
||||||
public referenceTypeService: ReferenceTypeService,
|
public referenceTypeService: ReferenceTypeService,
|
||||||
public semanticsService: SemanticsService,
|
public semanticsService: SemanticsService,
|
||||||
public prefillingSourceService: PrefillingSourceService,
|
public prefillingSourceService: PrefillingSourceService,
|
||||||
public titleService: Title
|
public titleService: Title,
|
||||||
|
private analyticsService: AnalyticsService
|
||||||
) {
|
) {
|
||||||
const descriptionLabel:string = route.snapshot.data['entity']?.label;
|
const descriptionLabel:string = route.snapshot.data['entity']?.label;
|
||||||
if (descriptionLabel) {
|
if (descriptionLabel) {
|
||||||
|
@ -148,7 +148,7 @@ export class DmpBlueprintEditorComponent extends BaseEditor<DmpBlueprintEditorMo
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
this.matomoService.trackPageView('Admin: DMP Blueprints');
|
this.analyticsService.trackPageView(AnalyticsService.DmpBlueprintEditor);
|
||||||
this.initModelFlags(this.route.snapshot.data['action']);
|
this.initModelFlags(this.route.snapshot.data['action']);
|
||||||
super.ngOnInit();
|
super.ngOnInit();
|
||||||
this.route.data.subscribe(d => {
|
this.route.data.subscribe(d => {
|
||||||
|
|
|
@ -8,7 +8,6 @@ import { DmpBlueprint } from '@app/core/model/dmp-blueprint/dmp-blueprint';
|
||||||
import { DmpBlueprintLookup } from '@app/core/query/dmp-blueprint.lookup';
|
import { DmpBlueprintLookup } from '@app/core/query/dmp-blueprint.lookup';
|
||||||
import { AuthService } from '@app/core/services/auth/auth.service';
|
import { AuthService } from '@app/core/services/auth/auth.service';
|
||||||
import { DmpBlueprintService } from '@app/core/services/dmp/dmp-blueprint.service';
|
import { DmpBlueprintService } from '@app/core/services/dmp/dmp-blueprint.service';
|
||||||
import { MatomoService } from '@app/core/services/matomo/matomo-service';
|
|
||||||
import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service';
|
import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service';
|
||||||
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
|
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
|
||||||
import { FileUtils } from '@app/core/services/utilities/file-utils.service';
|
import { FileUtils } from '@app/core/services/utilities/file-utils.service';
|
||||||
|
@ -29,6 +28,7 @@ import { nameof } from 'ts-simple-nameof';
|
||||||
import { ImportDmpBlueprintDialogComponent } from './import-dmp-blueprint/import-dmp-blueprint.dialog.component';
|
import { ImportDmpBlueprintDialogComponent } from './import-dmp-blueprint/import-dmp-blueprint.dialog.component';
|
||||||
import { IsActiveTypePipe } from '@common/formatting/pipes/is-active-type.pipe';
|
import { IsActiveTypePipe } from '@common/formatting/pipes/is-active-type.pipe';
|
||||||
import { DmpBlueprintVersionStatus } from '@app/core/common/enum/dmp-blueprint-version-status';
|
import { DmpBlueprintVersionStatus } from '@app/core/common/enum/dmp-blueprint-version-status';
|
||||||
|
import { AnalyticsService } from '@app/core/services/matomo/analytics-service';
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
@ -70,12 +70,12 @@ export class DmpBlueprintListingComponent extends BaseListingComponent<DmpBluepr
|
||||||
protected queryParamsService: QueryParamsService,
|
protected queryParamsService: QueryParamsService,
|
||||||
private dmpBlueprintService: DmpBlueprintService,
|
private dmpBlueprintService: DmpBlueprintService,
|
||||||
public authService: AuthService,
|
public authService: AuthService,
|
||||||
private matomoService: MatomoService,
|
|
||||||
private pipeService: PipeService,
|
private pipeService: PipeService,
|
||||||
public enumUtils: EnumUtils,
|
public enumUtils: EnumUtils,
|
||||||
private language: TranslateService,
|
private language: TranslateService,
|
||||||
private dialog: MatDialog,
|
private dialog: MatDialog,
|
||||||
private fileUtils: FileUtils
|
private fileUtils: FileUtils,
|
||||||
|
private analyticsService: AnalyticsService
|
||||||
) {
|
) {
|
||||||
super(router, route, uiNotificationService, httpErrorHandlingService, queryParamsService);
|
super(router, route, uiNotificationService, httpErrorHandlingService, queryParamsService);
|
||||||
// Lookup setup
|
// Lookup setup
|
||||||
|
@ -85,7 +85,7 @@ export class DmpBlueprintListingComponent extends BaseListingComponent<DmpBluepr
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.matomoService.trackPageView('Admin: DMP Templates');
|
this.analyticsService.trackPageView(AnalyticsService.DmpBlueprintListing);
|
||||||
super.ngOnInit();
|
super.ngOnInit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,6 @@ import { AppPermission } from '@app/core/common/enum/permission.enum';
|
||||||
import { Language, LanguagePersist } from '@app/core/model/language/language';
|
import { Language, LanguagePersist } from '@app/core/model/language/language';
|
||||||
import { AuthService } from '@app/core/services/auth/auth.service';
|
import { AuthService } from '@app/core/services/auth/auth.service';
|
||||||
import { LoggingService } from '@app/core/services/logging/logging-service';
|
import { LoggingService } from '@app/core/services/logging/logging-service';
|
||||||
import { MatomoService } from '@app/core/services/matomo/matomo-service';
|
|
||||||
import { FileUtils } from '@app/core/services/utilities/file-utils.service';
|
import { FileUtils } from '@app/core/services/utilities/file-utils.service';
|
||||||
import { QueryParamsService } from '@app/core/services/utilities/query-params.service';
|
import { QueryParamsService } from '@app/core/services/utilities/query-params.service';
|
||||||
import { MultipleAutoCompleteConfiguration } from '@app/library/auto-complete/multiple/multiple-auto-complete-configuration';
|
import { MultipleAutoCompleteConfiguration } from '@app/library/auto-complete/multiple/multiple-auto-complete-configuration';
|
||||||
|
@ -32,6 +31,7 @@ import { MatCheckboxChange } from '@angular/material/checkbox';
|
||||||
import { ConfigurationService } from '@app/core/services/configuration/configuration.service';
|
import { ConfigurationService } from '@app/core/services/configuration/configuration.service';
|
||||||
import { LockService } from '@app/core/services/lock/lock.service';
|
import { LockService } from '@app/core/services/lock/lock.service';
|
||||||
import { Title } from '@angular/platform-browser';
|
import { Title } from '@angular/platform-browser';
|
||||||
|
import { AnalyticsService } from '@app/core/services/matomo/analytics-service';
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
@ -87,8 +87,8 @@ export class LanguageEditorComponent extends BaseEditor<LanguageEditorModel, Lan
|
||||||
private logger: LoggingService,
|
private logger: LoggingService,
|
||||||
private languageEditorService: LanguageEditorService,
|
private languageEditorService: LanguageEditorService,
|
||||||
private fileUtils: FileUtils,
|
private fileUtils: FileUtils,
|
||||||
private matomoService: MatomoService,
|
private titleService: Title,
|
||||||
private titleService: Title
|
private analyticsService: AnalyticsService
|
||||||
) {
|
) {
|
||||||
const descriptionLabel:string = route.snapshot.data['entity']?.code;
|
const descriptionLabel:string = route.snapshot.data['entity']?.code;
|
||||||
if (descriptionLabel) {
|
if (descriptionLabel) {
|
||||||
|
@ -100,7 +100,7 @@ export class LanguageEditorComponent extends BaseEditor<LanguageEditorModel, Lan
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
this.matomoService.trackPageView('Admin: Languages');
|
this.analyticsService.trackPageView(AnalyticsService.LanguagesEditor);
|
||||||
super.ngOnInit();
|
super.ngOnInit();
|
||||||
this.languageHttpService.queryAvailableCodes(this.languageHttpService.buildAutocompleteLookup())
|
this.languageHttpService.queryAvailableCodes(this.languageHttpService.buildAutocompleteLookup())
|
||||||
.pipe(takeUntil(this._destroyed))
|
.pipe(takeUntil(this._destroyed))
|
||||||
|
|
|
@ -13,7 +13,6 @@ import { AppPermission } from '@app/core/common/enum/permission.enum';
|
||||||
import { PrefillingSource, PrefillingSourcePersist } from '@app/core/model/prefilling-source/prefilling-source';
|
import { PrefillingSource, PrefillingSourcePersist } from '@app/core/model/prefilling-source/prefilling-source';
|
||||||
import { AuthService } from '@app/core/services/auth/auth.service';
|
import { AuthService } from '@app/core/services/auth/auth.service';
|
||||||
import { LoggingService } from '@app/core/services/logging/logging-service';
|
import { LoggingService } from '@app/core/services/logging/logging-service';
|
||||||
import { MatomoService } from '@app/core/services/matomo/matomo-service';
|
|
||||||
import { QueryParamsService } from '@app/core/services/utilities/query-params.service';
|
import { QueryParamsService } from '@app/core/services/utilities/query-params.service';
|
||||||
import { BaseEditor } from '@common/base/base-editor';
|
import { BaseEditor } from '@common/base/base-editor';
|
||||||
import { FormService } from '@common/forms/form-service';
|
import { FormService } from '@common/forms/form-service';
|
||||||
|
@ -31,6 +30,7 @@ import { MatCheckboxChange } from '@angular/material/checkbox';
|
||||||
import { ConfigurationService } from '@app/core/services/configuration/configuration.service';
|
import { ConfigurationService } from '@app/core/services/configuration/configuration.service';
|
||||||
import { LockService } from '@app/core/services/lock/lock.service';
|
import { LockService } from '@app/core/services/lock/lock.service';
|
||||||
import { Title } from '@angular/platform-browser';
|
import { Title } from '@angular/platform-browser';
|
||||||
|
import { AnalyticsService } from '@app/core/services/matomo/analytics-service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-prefilling-source-editor-component',
|
selector: 'app-prefilling-source-editor-component',
|
||||||
|
@ -77,8 +77,8 @@ export class PrefillingSourceEditorComponent extends BaseEditor<PrefillingSource
|
||||||
private prefillingSourceService: PrefillingSourceService,
|
private prefillingSourceService: PrefillingSourceService,
|
||||||
private logger: LoggingService,
|
private logger: LoggingService,
|
||||||
private prefillingSourceEditorService: PrefillingSourceEditorService,
|
private prefillingSourceEditorService: PrefillingSourceEditorService,
|
||||||
private matomoService: MatomoService,
|
private titleService: Title,
|
||||||
private titleService: Title
|
private analyticsService: AnalyticsService
|
||||||
) {
|
) {
|
||||||
const descriptionLabel:string = route.snapshot.data['entity']?.label;
|
const descriptionLabel:string = route.snapshot.data['entity']?.label;
|
||||||
if (descriptionLabel) {
|
if (descriptionLabel) {
|
||||||
|
@ -90,7 +90,7 @@ export class PrefillingSourceEditorComponent extends BaseEditor<PrefillingSource
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
this.matomoService.trackPageView('Admin: PrefillingSources');
|
this.analyticsService.trackPageView(AnalyticsService.PrefillingSourcesEditor);
|
||||||
super.ngOnInit();
|
super.ngOnInit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,6 @@ import { ReferenceSourceType } from '@app/core/common/enum/reference-source-type
|
||||||
import { Reference, ReferencePersist } from '@app/core/model/reference/reference';
|
import { Reference, ReferencePersist } from '@app/core/model/reference/reference';
|
||||||
import { AuthService } from '@app/core/services/auth/auth.service';
|
import { AuthService } from '@app/core/services/auth/auth.service';
|
||||||
import { LoggingService } from '@app/core/services/logging/logging-service';
|
import { LoggingService } from '@app/core/services/logging/logging-service';
|
||||||
import { MatomoService } from '@app/core/services/matomo/matomo-service';
|
|
||||||
import { ReferenceTypeService } from '@app/core/services/reference-type/reference-type.service';
|
import { ReferenceTypeService } from '@app/core/services/reference-type/reference-type.service';
|
||||||
import { FileUtils } from '@app/core/services/utilities/file-utils.service';
|
import { FileUtils } from '@app/core/services/utilities/file-utils.service';
|
||||||
import { QueryParamsService } from '@app/core/services/utilities/query-params.service';
|
import { QueryParamsService } from '@app/core/services/utilities/query-params.service';
|
||||||
|
@ -33,6 +32,7 @@ import { ReferenceEditorService } from './reference-editor.service';
|
||||||
import { LockService } from '@app/core/services/lock/lock.service';
|
import { LockService } from '@app/core/services/lock/lock.service';
|
||||||
import { ConfigurationService } from '@app/core/services/configuration/configuration.service';
|
import { ConfigurationService } from '@app/core/services/configuration/configuration.service';
|
||||||
import { Title } from '@angular/platform-browser';
|
import { Title } from '@angular/platform-browser';
|
||||||
|
import { AnalyticsService } from '@app/core/services/matomo/analytics-service';
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
@ -88,9 +88,9 @@ export class ReferenceEditorComponent extends BaseEditor<ReferenceEditorModel, R
|
||||||
private logger: LoggingService,
|
private logger: LoggingService,
|
||||||
private referenceEditorService: ReferenceEditorService,
|
private referenceEditorService: ReferenceEditorService,
|
||||||
private fileUtils: FileUtils,
|
private fileUtils: FileUtils,
|
||||||
private matomoService: MatomoService,
|
|
||||||
public referenceTypeService: ReferenceTypeService,
|
public referenceTypeService: ReferenceTypeService,
|
||||||
public titleService: Title
|
public titleService: Title,
|
||||||
|
private analyticsService: AnalyticsService
|
||||||
) {
|
) {
|
||||||
|
|
||||||
const descriptionLabel:string = route.snapshot.data['entity']?.label;
|
const descriptionLabel:string = route.snapshot.data['entity']?.label;
|
||||||
|
@ -103,7 +103,7 @@ export class ReferenceEditorComponent extends BaseEditor<ReferenceEditorModel, R
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
this.matomoService.trackPageView('Admin: References');
|
this.analyticsService.trackPageView(AnalyticsService.ReferencesEditor);
|
||||||
super.ngOnInit();
|
super.ngOnInit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,6 @@ import { MatDialog } from '@angular/material/dialog';
|
||||||
import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service';
|
import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service';
|
||||||
import { AppPermission } from '@app/core/common/enum/permission.enum';
|
import { AppPermission } from '@app/core/common/enum/permission.enum';
|
||||||
import { AuthService } from '@app/core/services/auth/auth.service';
|
import { AuthService } from '@app/core/services/auth/auth.service';
|
||||||
import { MatomoService } from '@app/core/services/matomo/matomo-service';
|
|
||||||
import { FormService } from '@common/forms/form-service';
|
import { FormService } from '@common/forms/form-service';
|
||||||
import { ConfirmationDialogComponent } from '@common/modules/confirmation-dialog/confirmation-dialog.component';
|
import { ConfirmationDialogComponent } from '@common/modules/confirmation-dialog/confirmation-dialog.component';
|
||||||
import { HttpError, HttpErrorHandlingService } from '@common/modules/errors/error-handling/http-error-handling.service';
|
import { HttpError, HttpErrorHandlingService } from '@common/modules/errors/error-handling/http-error-handling.service';
|
||||||
|
@ -22,6 +21,7 @@ import { TenantConfigurationType } from '@app/core/common/enum/tenant-configurat
|
||||||
import { HttpErrorResponse } from '@angular/common/http';
|
import { HttpErrorResponse } from '@angular/common/http';
|
||||||
import { ResponseErrorCode } from '@app/core/common/enum/respone-error-code';
|
import { ResponseErrorCode } from '@app/core/common/enum/respone-error-code';
|
||||||
import { LoggingService } from '@app/core/services/logging/logging-service';
|
import { LoggingService } from '@app/core/services/logging/logging-service';
|
||||||
|
import { AnalyticsService } from '@app/core/services/matomo/analytics-service';
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
@ -61,7 +61,7 @@ export class CssColorsEditorComponent extends BasePendingChangesComponent implem
|
||||||
private logger: LoggingService,
|
private logger: LoggingService,
|
||||||
private tenantConfigurationService: TenantConfigurationService,
|
private tenantConfigurationService: TenantConfigurationService,
|
||||||
private cssColorsEditorService: CssColorsEditorService,
|
private cssColorsEditorService: CssColorsEditorService,
|
||||||
private matomoService: MatomoService
|
private analyticsService: AnalyticsService
|
||||||
) {
|
) {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
@ -71,7 +71,7 @@ export class CssColorsEditorComponent extends BasePendingChangesComponent implem
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
this.matomoService.trackPageView('Admin: TenantConfigurations');
|
this.analyticsService.trackPageView(AnalyticsService.TenantConfigurationsColorsEditor);
|
||||||
this.getItem((entity) => {
|
this.getItem((entity) => {
|
||||||
this.prepareForm(entity);
|
this.prepareForm(entity);
|
||||||
if (this.formGroup && this.editorModel.belongsToCurrentTenant == false) {
|
if (this.formGroup && this.editorModel.belongsToCurrentTenant == false) {
|
||||||
|
|
|
@ -6,7 +6,6 @@ import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/serv
|
||||||
// import { BreadcrumbItem } from '@app/ui/misc/breadcrumb/definition/breadcrumb-item';
|
// import { BreadcrumbItem } from '@app/ui/misc/breadcrumb/definition/breadcrumb-item';
|
||||||
import { AppPermission } from '@app/core/common/enum/permission.enum';
|
import { AppPermission } from '@app/core/common/enum/permission.enum';
|
||||||
import { AuthService } from '@app/core/services/auth/auth.service';
|
import { AuthService } from '@app/core/services/auth/auth.service';
|
||||||
import { MatomoService } from '@app/core/services/matomo/matomo-service';
|
|
||||||
import { FormService } from '@common/forms/form-service';
|
import { FormService } from '@common/forms/form-service';
|
||||||
import { ConfirmationDialogComponent } from '@common/modules/confirmation-dialog/confirmation-dialog.component';
|
import { ConfirmationDialogComponent } from '@common/modules/confirmation-dialog/confirmation-dialog.component';
|
||||||
import { HttpError, HttpErrorHandlingService } from '@common/modules/errors/error-handling/http-error-handling.service';
|
import { HttpError, HttpErrorHandlingService } from '@common/modules/errors/error-handling/http-error-handling.service';
|
||||||
|
@ -29,6 +28,7 @@ import { CultureService } from '@app/core/services/culture/culture-service';
|
||||||
import { LanguageService } from '@app/core/services/language/language.service';
|
import { LanguageService } from '@app/core/services/language/language.service';
|
||||||
import { SingleAutoCompleteConfiguration } from '@app/library/auto-complete/single/single-auto-complete-configuration';
|
import { SingleAutoCompleteConfiguration } from '@app/library/auto-complete/single/single-auto-complete-configuration';
|
||||||
import { DefaultUserLocaleService } from '@app/core/services/default-user-locale/default-user-locale.service';
|
import { DefaultUserLocaleService } from '@app/core/services/default-user-locale/default-user-locale.service';
|
||||||
|
import { AnalyticsService } from '@app/core/services/matomo/analytics-service';
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
@ -78,7 +78,7 @@ export class DefaultUserLocaleEditorComponent extends BasePendingChangesComponen
|
||||||
private languageService: LanguageService,
|
private languageService: LanguageService,
|
||||||
private defaultUserLocaleEditorService: DefaultUserLocaleEditorService,
|
private defaultUserLocaleEditorService: DefaultUserLocaleEditorService,
|
||||||
private defaultUserLocaleService: DefaultUserLocaleService,
|
private defaultUserLocaleService: DefaultUserLocaleService,
|
||||||
private matomoService: MatomoService
|
private analyticsService: AnalyticsService
|
||||||
) {
|
) {
|
||||||
super();
|
super();
|
||||||
this.languages = this.languageService.getAvailableLanguagesCodes().sort((x, y) => x.localeCompare(y));
|
this.languages = this.languageService.getAvailableLanguagesCodes().sort((x, y) => x.localeCompare(y));
|
||||||
|
@ -93,7 +93,9 @@ export class DefaultUserLocaleEditorComponent extends BasePendingChangesComponen
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
this.singleTimezoneAutocompleteConfiguration = this.defaultUserLocaleService.singleTimezoneAutocompleteConfiguration;
|
this.singleTimezoneAutocompleteConfiguration = this.defaultUserLocaleService.singleTimezoneAutocompleteConfiguration;
|
||||||
this.singleCultureAutocompleteConfiguration = this.defaultUserLocaleService.singleCultureAutocompleteConfiguration;
|
this.singleCultureAutocompleteConfiguration = this.defaultUserLocaleService.singleCultureAutocompleteConfiguration;
|
||||||
this.matomoService.trackPageView('Admin: TenantConfigurations');
|
|
||||||
|
this.analyticsService.trackPageView(AnalyticsService.TenantConfigurationsUserLocaleEditor);
|
||||||
|
|
||||||
this.getItem((entity) => {
|
this.getItem((entity) => {
|
||||||
this.prepareForm(entity);
|
this.prepareForm(entity);
|
||||||
if (this.formGroup && this.editorModel.belongsToCurrentTenant == false) {
|
if (this.formGroup && this.editorModel.belongsToCurrentTenant == false) {
|
||||||
|
|
|
@ -5,7 +5,6 @@ import { MatDialog } from '@angular/material/dialog';
|
||||||
import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service';
|
import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service';
|
||||||
import { AppPermission } from '@app/core/common/enum/permission.enum';
|
import { AppPermission } from '@app/core/common/enum/permission.enum';
|
||||||
import { AuthService } from '@app/core/services/auth/auth.service';
|
import { AuthService } from '@app/core/services/auth/auth.service';
|
||||||
import { MatomoService } from '@app/core/services/matomo/matomo-service';
|
|
||||||
import { FormService } from '@common/forms/form-service';
|
import { FormService } from '@common/forms/form-service';
|
||||||
import { ConfirmationDialogComponent } from '@common/modules/confirmation-dialog/confirmation-dialog.component';
|
import { ConfirmationDialogComponent } from '@common/modules/confirmation-dialog/confirmation-dialog.component';
|
||||||
import { HttpError, HttpErrorHandlingService } from '@common/modules/errors/error-handling/http-error-handling.service';
|
import { HttpError, HttpErrorHandlingService } from '@common/modules/errors/error-handling/http-error-handling.service';
|
||||||
|
@ -22,6 +21,7 @@ import { TenantConfigurationType } from '@app/core/common/enum/tenant-configurat
|
||||||
import { HttpErrorResponse } from '@angular/common/http';
|
import { HttpErrorResponse } from '@angular/common/http';
|
||||||
import { ResponseErrorCode } from '@app/core/common/enum/respone-error-code';
|
import { ResponseErrorCode } from '@app/core/common/enum/respone-error-code';
|
||||||
import { LoggingService } from '@app/core/services/logging/logging-service';
|
import { LoggingService } from '@app/core/services/logging/logging-service';
|
||||||
|
import { AnalyticsService } from '@app/core/services/matomo/analytics-service';
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
@ -61,7 +61,7 @@ export class DepositEditorComponent extends BasePendingChangesComponent implemen
|
||||||
private logger: LoggingService,
|
private logger: LoggingService,
|
||||||
private tenantConfigurationService: TenantConfigurationService,
|
private tenantConfigurationService: TenantConfigurationService,
|
||||||
private depositEditorService: DepositEditorService,
|
private depositEditorService: DepositEditorService,
|
||||||
private matomoService: MatomoService
|
private analyticsService: AnalyticsService
|
||||||
) {
|
) {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
@ -71,7 +71,8 @@ export class DepositEditorComponent extends BasePendingChangesComponent implemen
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
this.matomoService.trackPageView('Admin: TenantConfigurations');
|
this.analyticsService.trackPageView(AnalyticsService.DepositEditor);
|
||||||
|
|
||||||
this.getItem((entity) => {
|
this.getItem((entity) => {
|
||||||
this.prepareForm(entity);
|
this.prepareForm(entity);
|
||||||
if (this.formGroup && this.editorModel.belongsToCurrentTenant == false) {
|
if (this.formGroup && this.editorModel.belongsToCurrentTenant == false) {
|
||||||
|
|
|
@ -5,7 +5,6 @@ import { MatDialog } from '@angular/material/dialog';
|
||||||
import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service';
|
import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service';
|
||||||
import { AppPermission } from '@app/core/common/enum/permission.enum';
|
import { AppPermission } from '@app/core/common/enum/permission.enum';
|
||||||
import { AuthService } from '@app/core/services/auth/auth.service';
|
import { AuthService } from '@app/core/services/auth/auth.service';
|
||||||
import { MatomoService } from '@app/core/services/matomo/matomo-service';
|
|
||||||
import { FormService } from '@common/forms/form-service';
|
import { FormService } from '@common/forms/form-service';
|
||||||
import { ConfirmationDialogComponent } from '@common/modules/confirmation-dialog/confirmation-dialog.component';
|
import { ConfirmationDialogComponent } from '@common/modules/confirmation-dialog/confirmation-dialog.component';
|
||||||
import { HttpError, HttpErrorHandlingService } from '@common/modules/errors/error-handling/http-error-handling.service';
|
import { HttpError, HttpErrorHandlingService } from '@common/modules/errors/error-handling/http-error-handling.service';
|
||||||
|
@ -22,6 +21,7 @@ import { TenantConfigurationType } from '@app/core/common/enum/tenant-configurat
|
||||||
import { HttpErrorResponse } from '@angular/common/http';
|
import { HttpErrorResponse } from '@angular/common/http';
|
||||||
import { ResponseErrorCode } from '@app/core/common/enum/respone-error-code';
|
import { ResponseErrorCode } from '@app/core/common/enum/respone-error-code';
|
||||||
import { LoggingService } from '@app/core/services/logging/logging-service';
|
import { LoggingService } from '@app/core/services/logging/logging-service';
|
||||||
|
import { AnalyticsService } from '@app/core/services/matomo/analytics-service';
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
@ -61,7 +61,7 @@ export class FileTransformerEditorComponent extends BasePendingChangesComponent
|
||||||
private logger: LoggingService,
|
private logger: LoggingService,
|
||||||
private tenantConfigurationService: TenantConfigurationService,
|
private tenantConfigurationService: TenantConfigurationService,
|
||||||
private fileTransformerEditorService: FileTransformerEditorService,
|
private fileTransformerEditorService: FileTransformerEditorService,
|
||||||
private matomoService: MatomoService
|
private analyticsService: AnalyticsService
|
||||||
) {
|
) {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
@ -71,7 +71,7 @@ export class FileTransformerEditorComponent extends BasePendingChangesComponent
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
this.matomoService.trackPageView('Admin: TenantConfigurations');
|
this.analyticsService.trackPageView(AnalyticsService.FileTransformerEditor);
|
||||||
this.getItem((entity) => {
|
this.getItem((entity) => {
|
||||||
this.prepareForm(entity);
|
this.prepareForm(entity);
|
||||||
if (this.formGroup && this.editorModel.belongsToCurrentTenant == false) {
|
if (this.formGroup && this.editorModel.belongsToCurrentTenant == false) {
|
||||||
|
|
|
@ -5,7 +5,6 @@ import { MatDialog } from '@angular/material/dialog';
|
||||||
import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service';
|
import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service';
|
||||||
import { AppPermission } from '@app/core/common/enum/permission.enum';
|
import { AppPermission } from '@app/core/common/enum/permission.enum';
|
||||||
import { AuthService } from '@app/core/services/auth/auth.service';
|
import { AuthService } from '@app/core/services/auth/auth.service';
|
||||||
import { MatomoService } from '@app/core/services/matomo/matomo-service';
|
|
||||||
import { FormService } from '@common/forms/form-service';
|
import { FormService } from '@common/forms/form-service';
|
||||||
import { ConfirmationDialogComponent } from '@common/modules/confirmation-dialog/confirmation-dialog.component';
|
import { ConfirmationDialogComponent } from '@common/modules/confirmation-dialog/confirmation-dialog.component';
|
||||||
import { HttpError, HttpErrorHandlingService } from '@common/modules/errors/error-handling/http-error-handling.service';
|
import { HttpError, HttpErrorHandlingService } from '@common/modules/errors/error-handling/http-error-handling.service';
|
||||||
|
@ -26,6 +25,7 @@ import { StorageFileService } from '@app/core/services/storage-file/storage-file
|
||||||
import { Guid } from '@common/types/guid';
|
import { Guid } from '@common/types/guid';
|
||||||
import { FileUtils } from '@app/core/services/utilities/file-utils.service';
|
import { FileUtils } from '@app/core/services/utilities/file-utils.service';
|
||||||
import * as FileSaver from 'file-saver';
|
import * as FileSaver from 'file-saver';
|
||||||
|
import { AnalyticsService } from '@app/core/services/matomo/analytics-service';
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
@ -69,9 +69,10 @@ export class LogoEditorComponent extends BasePendingChangesComponent implements
|
||||||
private logger: LoggingService,
|
private logger: LoggingService,
|
||||||
private tenantConfigurationService: TenantConfigurationService,
|
private tenantConfigurationService: TenantConfigurationService,
|
||||||
private logoEditorService: LogoEditorService,
|
private logoEditorService: LogoEditorService,
|
||||||
private matomoService: MatomoService,
|
|
||||||
private fileUtils: FileUtils,
|
private fileUtils: FileUtils,
|
||||||
private storageFileService: StorageFileService
|
private storageFileService: StorageFileService,
|
||||||
|
private analyticsService: AnalyticsService
|
||||||
|
|
||||||
) {
|
) {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
@ -81,7 +82,7 @@ export class LogoEditorComponent extends BasePendingChangesComponent implements
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
this.matomoService.trackPageView('Admin: TenantConfigurations');
|
this.analyticsService.trackPageView(AnalyticsService.LogoEditor);
|
||||||
this.getItem((entity) => {
|
this.getItem((entity) => {
|
||||||
this.prepareForm(entity);
|
this.prepareForm(entity);
|
||||||
if (this.formGroup && this.editorModel.belongsToCurrentTenant == false) {
|
if (this.formGroup && this.editorModel.belongsToCurrentTenant == false) {
|
||||||
|
|
|
@ -13,7 +13,6 @@ import { AppPermission } from '@app/core/common/enum/permission.enum';
|
||||||
import { Tenant, TenantPersist } from '@app/core/model/tenant/tenant';
|
import { Tenant, TenantPersist } from '@app/core/model/tenant/tenant';
|
||||||
import { AuthService } from '@app/core/services/auth/auth.service';
|
import { AuthService } from '@app/core/services/auth/auth.service';
|
||||||
import { LoggingService } from '@app/core/services/logging/logging-service';
|
import { LoggingService } from '@app/core/services/logging/logging-service';
|
||||||
import { MatomoService } from '@app/core/services/matomo/matomo-service';
|
|
||||||
import { FileUtils } from '@app/core/services/utilities/file-utils.service';
|
import { FileUtils } from '@app/core/services/utilities/file-utils.service';
|
||||||
import { QueryParamsService } from '@app/core/services/utilities/query-params.service';
|
import { QueryParamsService } from '@app/core/services/utilities/query-params.service';
|
||||||
import { BaseEditor } from '@common/base/base-editor';
|
import { BaseEditor } from '@common/base/base-editor';
|
||||||
|
@ -29,6 +28,7 @@ import { TenantEditorService } from './tenant-editor.service';
|
||||||
import { TenantEditorModel } from './tenant-editor.model';
|
import { TenantEditorModel } from './tenant-editor.model';
|
||||||
import { LockService } from '@app/core/services/lock/lock.service';
|
import { LockService } from '@app/core/services/lock/lock.service';
|
||||||
import { ConfigurationService } from '@app/core/services/configuration/configuration.service';
|
import { ConfigurationService } from '@app/core/services/configuration/configuration.service';
|
||||||
|
import { AnalyticsService } from '@app/core/services/matomo/analytics-service';
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
@ -84,13 +84,13 @@ export class TenantEditorComponent extends BaseEditor<TenantEditorModel, Tenant>
|
||||||
private logger: LoggingService,
|
private logger: LoggingService,
|
||||||
private tenantEditorService: TenantEditorService,
|
private tenantEditorService: TenantEditorService,
|
||||||
private fileUtils: FileUtils,
|
private fileUtils: FileUtils,
|
||||||
private matomoService: MatomoService
|
private analyticsService: AnalyticsService
|
||||||
) {
|
) {
|
||||||
super(dialog, language, formService, router, uiNotificationService, httpErrorHandlingService, filterService, datePipe, route, queryParamsService, lockService, authService, configurationService);
|
super(dialog, language, formService, router, uiNotificationService, httpErrorHandlingService, filterService, datePipe, route, queryParamsService, lockService, authService, configurationService);
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
this.matomoService.trackPageView('Admin: Tenants');
|
this.analyticsService.trackPageView(AnalyticsService.TenantsEditor);
|
||||||
super.ngOnInit();
|
super.ngOnInit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,8 +9,8 @@ import { ValidationErrorModel } from '@common/forms/validation/error-model/valid
|
||||||
import { TranslateService } from '@ngx-translate/core';
|
import { TranslateService } from '@ngx-translate/core';
|
||||||
import { takeUntil } from 'rxjs/operators';
|
import { takeUntil } from 'rxjs/operators';
|
||||||
import { FormService } from '@common/forms/form-service';
|
import { FormService } from '@common/forms/form-service';
|
||||||
import { MatomoService } from '@app/core/services/matomo/matomo-service';
|
|
||||||
import { HttpClient } from '@angular/common/http';
|
import { HttpClient } from '@angular/common/http';
|
||||||
|
import { AnalyticsService } from '@app/core/services/matomo/analytics-service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-contact-content',
|
selector: 'app-contact-content',
|
||||||
|
@ -31,13 +31,13 @@ export class ContactContentComponent extends BaseComponent implements OnInit {
|
||||||
private language: TranslateService,
|
private language: TranslateService,
|
||||||
private formService: FormService,
|
private formService: FormService,
|
||||||
private httpClient: HttpClient,
|
private httpClient: HttpClient,
|
||||||
private matomoService: MatomoService
|
private analyticsService: AnalyticsService
|
||||||
) {
|
) {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.matomoService.trackPageView('Contact Content');
|
this.analyticsService.trackPageView(AnalyticsService.ContactContent);
|
||||||
if (this.isDialog) {
|
if (this.isDialog) {
|
||||||
this.formGroup = this.form;
|
this.formGroup = this.form;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -7,7 +7,6 @@ import { DashboardStatistics } from '@app/core/model/dashboard/dashboard-statist
|
||||||
import { AuthService } from '@app/core/services/auth/auth.service';
|
import { AuthService } from '@app/core/services/auth/auth.service';
|
||||||
import { ConfigurationService } from '@app/core/services/configuration/configuration.service';
|
import { ConfigurationService } from '@app/core/services/configuration/configuration.service';
|
||||||
import { DashboardService } from '@app/core/services/dashboard/dashboard.service';
|
import { DashboardService } from '@app/core/services/dashboard/dashboard.service';
|
||||||
import { MatomoService } from '@app/core/services/matomo/matomo-service';
|
|
||||||
import { ReferenceTypeService } from '@app/core/services/reference-type/reference-type.service';
|
import { ReferenceTypeService } from '@app/core/services/reference-type/reference-type.service';
|
||||||
import { GuidedTour, Orientation } from '@app/library/guided-tour/guided-tour.constants';
|
import { GuidedTour, Orientation } from '@app/library/guided-tour/guided-tour.constants';
|
||||||
import { GuidedTourService } from '@app/library/guided-tour/guided-tour.service';
|
import { GuidedTourService } from '@app/library/guided-tour/guided-tour.service';
|
||||||
|
@ -43,7 +42,6 @@ export class DashboardComponent extends BaseComponent implements OnInit {
|
||||||
private dialog: MatDialog,
|
private dialog: MatDialog,
|
||||||
private language: TranslateService,
|
private language: TranslateService,
|
||||||
private guidedTourService: GuidedTourService,
|
private guidedTourService: GuidedTourService,
|
||||||
private matomoService: MatomoService,
|
|
||||||
private analyticsService: AnalyticsService,
|
private analyticsService: AnalyticsService,
|
||||||
public referenceTypeService: ReferenceTypeService,
|
public referenceTypeService: ReferenceTypeService,
|
||||||
private fb: UntypedFormBuilder,
|
private fb: UntypedFormBuilder,
|
||||||
|
@ -65,7 +63,6 @@ export class DashboardComponent extends BaseComponent implements OnInit {
|
||||||
});
|
});
|
||||||
|
|
||||||
this.analyticsService.trackPageView(AnalyticsService.Dashboard);
|
this.analyticsService.trackPageView(AnalyticsService.Dashboard);
|
||||||
// this.matomoService.trackPageView('Home Dashboard');
|
|
||||||
|
|
||||||
if (!this.isAuthenticated()) {
|
if (!this.isAuthenticated()) {
|
||||||
this.dashboardService.getPublicDashboardStatistics()
|
this.dashboardService.getPublicDashboardStatistics()
|
||||||
|
|
|
@ -12,7 +12,6 @@ import { Reference } from '@app/core/model/reference/reference';
|
||||||
import { RecentActivityItemLookup } from '@app/core/query/recent-activity-item-lookup.lookup';
|
import { RecentActivityItemLookup } from '@app/core/query/recent-activity-item-lookup.lookup';
|
||||||
import { DashboardService } from "@app/core/services/dashboard/dashboard.service";
|
import { DashboardService } from "@app/core/services/dashboard/dashboard.service";
|
||||||
import { DmpService } from '@app/core/services/dmp/dmp.service';
|
import { DmpService } from '@app/core/services/dmp/dmp.service';
|
||||||
import { MatomoService } from '@app/core/services/matomo/matomo-service';
|
|
||||||
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
|
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
|
||||||
import { BaseComponent } from '@common/base/base.component';
|
import { BaseComponent } from '@common/base/base.component';
|
||||||
import { debounceTime, takeUntil } from 'rxjs/operators';
|
import { debounceTime, takeUntil } from 'rxjs/operators';
|
||||||
|
@ -24,6 +23,7 @@ import { DescriptionStatus } from '@app/core/common/enum/description-status';
|
||||||
import { IsActive } from '@app/core/common/enum/is-active.enum';
|
import { IsActive } from '@app/core/common/enum/is-active.enum';
|
||||||
import { AppPermission } from '@app/core/common/enum/permission.enum';
|
import { AppPermission } from '@app/core/common/enum/permission.enum';
|
||||||
import { DmpBlueprint, DmpBlueprintDefinition, DmpBlueprintDefinitionSection } from '@app/core/model/dmp-blueprint/dmp-blueprint';
|
import { DmpBlueprint, DmpBlueprintDefinition, DmpBlueprintDefinitionSection } from '@app/core/model/dmp-blueprint/dmp-blueprint';
|
||||||
|
import { AnalyticsService } from '@app/core/services/matomo/analytics-service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-drafts',
|
selector: 'app-drafts',
|
||||||
|
@ -58,14 +58,14 @@ export class DraftsComponent extends BaseComponent implements OnInit {
|
||||||
private authentication: AuthService,
|
private authentication: AuthService,
|
||||||
private dashboardService: DashboardService,
|
private dashboardService: DashboardService,
|
||||||
private location: Location,
|
private location: Location,
|
||||||
private matomoService: MatomoService,
|
private dmpService: DmpService,
|
||||||
private dmpService: DmpService
|
private analyticsService: AnalyticsService
|
||||||
) {
|
) {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.matomoService.trackPageView('Recent DMP Activity');
|
this.analyticsService.trackPageView(AnalyticsService.RecentEditedActivity);
|
||||||
this.route.queryParams.subscribe(params => {
|
this.route.queryParams.subscribe(params => {
|
||||||
if (this.isActive) {
|
if (this.isActive) {
|
||||||
let page = (params['page'] === undefined) ? 1 : +params['page'];
|
let page = (params['page'] === undefined) ? 1 : +params['page'];
|
||||||
|
|
|
@ -19,7 +19,7 @@ import { RecentActivityItemLookup } from '@app/core/query/recent-activity-item-l
|
||||||
import { AuthService } from '@app/core/services/auth/auth.service';
|
import { AuthService } from '@app/core/services/auth/auth.service';
|
||||||
import { DashboardService } from '@app/core/services/dashboard/dashboard.service';
|
import { DashboardService } from '@app/core/services/dashboard/dashboard.service';
|
||||||
import { DmpService } from '@app/core/services/dmp/dmp.service';
|
import { DmpService } from '@app/core/services/dmp/dmp.service';
|
||||||
import { MatomoService } from '@app/core/services/matomo/matomo-service';
|
import { AnalyticsService } from '@app/core/services/matomo/analytics-service';
|
||||||
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
|
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
|
||||||
import { BaseComponent } from '@common/base/base.component';
|
import { BaseComponent } from '@common/base/base.component';
|
||||||
import { Lookup } from '@common/model/lookup';
|
import { Lookup } from '@common/model/lookup';
|
||||||
|
@ -74,14 +74,14 @@ export class RecentEditedActivityComponent extends BaseComponent implements OnIn
|
||||||
private authentication: AuthService,
|
private authentication: AuthService,
|
||||||
private dashboardService: DashboardService,
|
private dashboardService: DashboardService,
|
||||||
private location: Location,
|
private location: Location,
|
||||||
private matomoService: MatomoService,
|
private dmpService: DmpService,
|
||||||
private dmpService: DmpService
|
private analyticsService: AnalyticsService
|
||||||
) {
|
) {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.matomoService.trackPageView('Recent DMP Activity');
|
this.analyticsService.trackPageView(AnalyticsService.RecentEditedActivity);
|
||||||
this.route.queryParams.subscribe(params => {
|
this.route.queryParams.subscribe(params => {
|
||||||
if (this.isActive) {
|
if (this.isActive) {
|
||||||
let page = (params['page'] === undefined) ? 0 : + params['page'];
|
let page = (params['page'] === undefined) ? 0 : + params['page'];
|
||||||
|
|
|
@ -13,7 +13,6 @@ import { Reference } from '@app/core/model/reference/reference';
|
||||||
import { RecentActivityItemLookup } from '@app/core/query/recent-activity-item-lookup.lookup';
|
import { RecentActivityItemLookup } from '@app/core/query/recent-activity-item-lookup.lookup';
|
||||||
import { AuthService } from '@app/core/services/auth/auth.service';
|
import { AuthService } from '@app/core/services/auth/auth.service';
|
||||||
import { DashboardService } from '@app/core/services/dashboard/dashboard.service';
|
import { DashboardService } from '@app/core/services/dashboard/dashboard.service';
|
||||||
import { MatomoService } from '@app/core/services/matomo/matomo-service';
|
|
||||||
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
|
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
|
||||||
import { BaseComponent } from '@common/base/base.component';
|
import { BaseComponent } from '@common/base/base.component';
|
||||||
import { debounceTime, takeUntil } from 'rxjs/operators';
|
import { debounceTime, takeUntil } from 'rxjs/operators';
|
||||||
|
@ -21,6 +20,7 @@ import { nameof } from 'ts-simple-nameof';
|
||||||
import { DescriptionStatus } from '@app/core/common/enum/description-status';
|
import { DescriptionStatus } from '@app/core/common/enum/description-status';
|
||||||
import { AppPermission } from '@app/core/common/enum/permission.enum';
|
import { AppPermission } from '@app/core/common/enum/permission.enum';
|
||||||
import { DmpBlueprint, DmpBlueprintDefinition, DmpBlueprintDefinitionSection } from '@app/core/model/dmp-blueprint/dmp-blueprint';
|
import { DmpBlueprint, DmpBlueprintDefinition, DmpBlueprintDefinitionSection } from '@app/core/model/dmp-blueprint/dmp-blueprint';
|
||||||
|
import { AnalyticsService } from '@app/core/services/matomo/analytics-service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-recent-edited-description-activity',
|
selector: 'app-recent-edited-description-activity',
|
||||||
|
@ -56,13 +56,13 @@ export class RecentEditedDescriptionActivityComponent extends BaseComponent impl
|
||||||
private authentication: AuthService,
|
private authentication: AuthService,
|
||||||
private dashboardService: DashboardService,
|
private dashboardService: DashboardService,
|
||||||
private location: Location,
|
private location: Location,
|
||||||
private matomoService: MatomoService
|
private analyticsService: AnalyticsService
|
||||||
) {
|
) {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.matomoService.trackPageView('Recent DMP Activity');
|
this.analyticsService.trackPageView(AnalyticsService.RecentEditedActivity);
|
||||||
this.route.queryParams.subscribe(params => {
|
this.route.queryParams.subscribe(params => {
|
||||||
if (this.isActive) {
|
if (this.isActive) {
|
||||||
let page = (params['page'] === undefined) ? 1 : +params['page'];
|
let page = (params['page'] === undefined) ? 1 : +params['page'];
|
||||||
|
|
|
@ -17,7 +17,7 @@ import { Reference } from '@app/core/model/reference/reference';
|
||||||
import { RecentActivityItemLookup } from '@app/core/query/recent-activity-item-lookup.lookup';
|
import { RecentActivityItemLookup } from '@app/core/query/recent-activity-item-lookup.lookup';
|
||||||
import { AuthService } from '@app/core/services/auth/auth.service';
|
import { AuthService } from '@app/core/services/auth/auth.service';
|
||||||
import { DashboardService } from '@app/core/services/dashboard/dashboard.service';
|
import { DashboardService } from '@app/core/services/dashboard/dashboard.service';
|
||||||
import { MatomoService } from '@app/core/services/matomo/matomo-service';
|
import { AnalyticsService } from '@app/core/services/matomo/analytics-service';
|
||||||
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
|
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
|
||||||
import { BaseComponent } from '@common/base/base.component';
|
import { BaseComponent } from '@common/base/base.component';
|
||||||
import { debounceTime, takeUntil } from 'rxjs/operators';
|
import { debounceTime, takeUntil } from 'rxjs/operators';
|
||||||
|
@ -63,13 +63,13 @@ export class RecentEditedDmpActivityComponent extends BaseComponent implements O
|
||||||
private authentication: AuthService,
|
private authentication: AuthService,
|
||||||
private dashboardService: DashboardService,
|
private dashboardService: DashboardService,
|
||||||
private location: Location,
|
private location: Location,
|
||||||
private matomoService: MatomoService,
|
private analyticsService: AnalyticsService
|
||||||
) {
|
) {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.matomoService.trackPageView('Recent DMP Activity');
|
this.analyticsService.trackPageView(AnalyticsService.RecentEditedActivity);
|
||||||
this.route.queryParams.subscribe(params => {
|
this.route.queryParams.subscribe(params => {
|
||||||
if (this.isActive) {
|
if (this.isActive) {
|
||||||
let page = (params['page'] === undefined) ? 1 : +params['page'];
|
let page = (params['page'] === undefined) ? 1 : +params['page'];
|
||||||
|
|
|
@ -22,7 +22,6 @@ import { DmpService } from '@app/core/services/dmp/dmp.service';
|
||||||
import { FileTransformerService } from '@app/core/services/file-transformer/file-transformer.service';
|
import { FileTransformerService } from '@app/core/services/file-transformer/file-transformer.service';
|
||||||
import { LockService } from '@app/core/services/lock/lock.service';
|
import { LockService } from '@app/core/services/lock/lock.service';
|
||||||
import { LoggingService } from '@app/core/services/logging/logging-service';
|
import { LoggingService } from '@app/core/services/logging/logging-service';
|
||||||
import { MatomoService } from '@app/core/services/matomo/matomo-service';
|
|
||||||
import {
|
import {
|
||||||
SnackBarNotificationLevel,
|
SnackBarNotificationLevel,
|
||||||
UiNotificationService
|
UiNotificationService
|
||||||
|
@ -49,6 +48,7 @@ import { ToCEntry } from './table-of-contents/models/toc-entry';
|
||||||
import { ToCEntryType } from './table-of-contents/models/toc-entry-type.enum';
|
import { ToCEntryType } from './table-of-contents/models/toc-entry-type.enum';
|
||||||
import { TableOfContentsValidationService } from './table-of-contents/services/table-of-contents-validation-service';
|
import { TableOfContentsValidationService } from './table-of-contents/services/table-of-contents-validation-service';
|
||||||
import { TableOfContentsComponent } from './table-of-contents/table-of-contents.component';
|
import { TableOfContentsComponent } from './table-of-contents/table-of-contents.component';
|
||||||
|
import { AnalyticsService } from '@app/core/services/matomo/analytics-service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-description-editor-component',
|
selector: 'app-description-editor-component',
|
||||||
|
@ -98,12 +98,12 @@ export class DescriptionEditorComponent extends BaseEditor<DescriptionEditorMode
|
||||||
private descriptionEditorService: DescriptionEditorService,
|
private descriptionEditorService: DescriptionEditorService,
|
||||||
private descriptionTemplateService: DescriptionTemplateService,
|
private descriptionTemplateService: DescriptionTemplateService,
|
||||||
private fileUtils: FileUtils,
|
private fileUtils: FileUtils,
|
||||||
private matomoService: MatomoService,
|
|
||||||
private dmpService: DmpService,
|
private dmpService: DmpService,
|
||||||
public visibilityRulesService: VisibilityRulesService,
|
public visibilityRulesService: VisibilityRulesService,
|
||||||
public fileTransformerService: FileTransformerService,
|
public fileTransformerService: FileTransformerService,
|
||||||
public tocValidationService: TableOfContentsValidationService,
|
public tocValidationService: TableOfContentsValidationService,
|
||||||
public titleService: Title
|
public titleService: Title,
|
||||||
|
private analyticsService: AnalyticsService
|
||||||
) {
|
) {
|
||||||
const descriptionLabel: string = route.snapshot.data['entity']?.label;
|
const descriptionLabel: string = route.snapshot.data['entity']?.label;
|
||||||
if (descriptionLabel) {
|
if (descriptionLabel) {
|
||||||
|
@ -115,7 +115,7 @@ export class DescriptionEditorComponent extends BaseEditor<DescriptionEditorMode
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
this.matomoService.trackPageView('Description Editor');
|
this.analyticsService.trackPageView(AnalyticsService.DescriptionEditor);
|
||||||
super.ngOnInit();
|
super.ngOnInit();
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -3,8 +3,8 @@ import { Component, Inject, OnInit, ViewChild } from '@angular/core';
|
||||||
import { UntypedFormGroup } from '@angular/forms';
|
import { UntypedFormGroup } from '@angular/forms';
|
||||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||||
import { DatasetCriteria } from '@app/core/query/dataset/dataset-criteria';
|
import { DatasetCriteria } from '@app/core/query/dataset/dataset-criteria';
|
||||||
import { MatomoService } from '@app/core/services/matomo/matomo-service';
|
|
||||||
import { DatasetCriteriaComponent } from '../dataset-criteria.component';
|
import { DatasetCriteriaComponent } from '../dataset-criteria.component';
|
||||||
|
import { AnalyticsService } from '@app/core/services/matomo/analytics-service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'dataset-criteria-dialog-component',
|
selector: 'dataset-criteria-dialog-component',
|
||||||
|
@ -19,13 +19,13 @@ export class DatasetCriteriaDialogComponent implements OnInit {
|
||||||
constructor(
|
constructor(
|
||||||
public dialogRef: MatDialogRef<DatasetCriteriaDialogComponent>,
|
public dialogRef: MatDialogRef<DatasetCriteriaDialogComponent>,
|
||||||
private httpClient: HttpClient,
|
private httpClient: HttpClient,
|
||||||
private matomoService: MatomoService,
|
private analyticsService: AnalyticsService,
|
||||||
@Inject(MAT_DIALOG_DATA) public data: { isPublic: boolean, status: Number, criteria: DatasetCriteria, formGroup: UntypedFormGroup, updateDataFn: Function }
|
@Inject(MAT_DIALOG_DATA) public data: { isPublic: boolean, status: Number, criteria: DatasetCriteria, formGroup: UntypedFormGroup, updateDataFn: Function }
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.matomoService.trackPageView('Dataset Criteria');
|
this.analyticsService.trackPageView(AnalyticsService.DatasetCriteriaDialog);
|
||||||
this.criteria.setCriteria(this.data.criteria);
|
this.criteria.setCriteria(this.data.criteria);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -44,10 +44,10 @@
|
||||||
<div *ngIf="listingItems && listingItems.length > 0 || this.lookup.like" class="col-md-12">
|
<div *ngIf="listingItems && listingItems.length > 0 || this.lookup.like" class="col-md-12">
|
||||||
<div class="row pt-4">
|
<div class="row pt-4">
|
||||||
<!-- Sort by -->
|
<!-- Sort by -->
|
||||||
<div class="col-12 col-xl-auto d-flex align-items-center">
|
<div class="col-auto d-flex align-items-center order-1">
|
||||||
<span class="mb-1 mb-xl-4">{{'DMP-LISTING.SORT-BY' | translate}}:</span>
|
<span class="mb-1 mb-xl-4">{{'DMP-LISTING.SORT-BY' | translate}}:</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12 col-xl-auto">
|
<div class="col-12 col-xl-auto order-3 order-xl-2">
|
||||||
<mat-form-field class="sort-form w-100">
|
<mat-form-field class="sort-form w-100">
|
||||||
<mat-select placeholder="{{'GENERAL.CRITERIA.LIKE'| translate}}" [formControl]="formGroup.get('order')" (selectionChange)="orderByChanged()">
|
<mat-select placeholder="{{'GENERAL.CRITERIA.LIKE'| translate}}" [formControl]="formGroup.get('order')" (selectionChange)="orderByChanged()">
|
||||||
<mat-option *ngIf="!isPublic" [value]="order.UpdatedAt">{{enumUtils.toRecentActivityOrderString(order.UpdatedAt)}}</mat-option>
|
<mat-option *ngIf="!isPublic" [value]="order.UpdatedAt">{{enumUtils.toRecentActivityOrderString(order.UpdatedAt)}}</mat-option>
|
||||||
|
@ -58,8 +58,14 @@
|
||||||
</mat-select>
|
</mat-select>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col-auto order-2 order-xl-3">
|
||||||
|
<button mat-icon-button (click)="toggleSortDirection()" [matTooltip]="sortingTooltipText">
|
||||||
|
<mat-icon *ngIf="isAscending">keyboard_double_arrow_up</mat-icon>
|
||||||
|
<mat-icon *ngIf="isDescending">keyboard_double_arrow_down</mat-icon>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
<!-- End of Sort by -->
|
<!-- End of Sort by -->
|
||||||
<div class="col-12 col-xl-auto ml-auto">
|
<div class="col-12 col-xl-auto ml-auto order-4">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<!-- Guided Tour -->
|
<!-- Guided Tour -->
|
||||||
<div class="col-12 col-xl-auto d-flex align-items-center">
|
<div class="col-12 col-xl-auto d-flex align-items-center">
|
||||||
|
|
|
@ -21,7 +21,6 @@ import { DmpLookup } from '@app/core/query/dmp.lookup';
|
||||||
import { AuthService } from '@app/core/services/auth/auth.service';
|
import { AuthService } from '@app/core/services/auth/auth.service';
|
||||||
import { DescriptionService } from '@app/core/services/description/description.service';
|
import { DescriptionService } from '@app/core/services/description/description.service';
|
||||||
import { DmpService } from '@app/core/services/dmp/dmp.service';
|
import { DmpService } from '@app/core/services/dmp/dmp.service';
|
||||||
import { MatomoService } from '@app/core/services/matomo/matomo-service';
|
|
||||||
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
|
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
|
||||||
import { GuidedTour, Orientation } from '@app/library/guided-tour/guided-tour.constants';
|
import { GuidedTour, Orientation } from '@app/library/guided-tour/guided-tour.constants';
|
||||||
import { GuidedTourService } from '@app/library/guided-tour/guided-tour.service';
|
import { GuidedTourService } from '@app/library/guided-tour/guided-tour.service';
|
||||||
|
@ -35,6 +34,8 @@ import { debounceTime, takeUntil } from 'rxjs/operators';
|
||||||
import { nameof } from 'ts-simple-nameof';
|
import { nameof } from 'ts-simple-nameof';
|
||||||
import { StartNewDescriptionDialogComponent } from '../start-new-description-dialog/start-new-description-dialog.component';
|
import { StartNewDescriptionDialogComponent } from '../start-new-description-dialog/start-new-description-dialog.component';
|
||||||
import { DmpBlueprint, DmpBlueprintDefinition, DmpBlueprintDefinitionSection } from '@app/core/model/dmp-blueprint/dmp-blueprint';
|
import { DmpBlueprint, DmpBlueprintDefinition, DmpBlueprintDefinitionSection } from '@app/core/model/dmp-blueprint/dmp-blueprint';
|
||||||
|
import { SortDirection } from '@common/modules/hybrid-listing/hybrid-listing.component';
|
||||||
|
import { AnalyticsService } from '@app/core/services/matomo/analytics-service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-description-listing-component',
|
selector: 'app-description-listing-component',
|
||||||
|
@ -73,6 +74,23 @@ export class DescriptionListingComponent extends BaseComponent implements OnInit
|
||||||
dmpText: string;
|
dmpText: string;
|
||||||
descriptionText: string;
|
descriptionText: string;
|
||||||
|
|
||||||
|
private _sortDirection: SortDirection = SortDirection.Descending; //SortDirection.Descending: "-"
|
||||||
|
set sortDirection(sortDirection: SortDirection) {
|
||||||
|
this._sortDirection = sortDirection;
|
||||||
|
}
|
||||||
|
get isAscending(): boolean {
|
||||||
|
return this._sortDirection == SortDirection.Ascending;
|
||||||
|
}
|
||||||
|
get isDescending(): boolean {
|
||||||
|
return this._sortDirection == SortDirection.Descending;
|
||||||
|
}
|
||||||
|
get sortingDirectionPrefix(): string {
|
||||||
|
return this.isAscending ? "+" : "-";
|
||||||
|
}
|
||||||
|
get sortingTooltipText(): string {
|
||||||
|
return this.isAscending ? this.language.instant('DESCRIPTION-LISTING.ACTIONS.TOGGLE-ΑSCENDING') : this.language.instant('DESCRIPTION-LISTING.ACTIONS.TOGGLE-DESCENDING');
|
||||||
|
}
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private descriptionService: DescriptionService,
|
private descriptionService: DescriptionService,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
|
@ -84,14 +102,14 @@ export class DescriptionListingComponent extends BaseComponent implements OnInit
|
||||||
private authentication: AuthService,
|
private authentication: AuthService,
|
||||||
private guidedTourService: GuidedTourService,
|
private guidedTourService: GuidedTourService,
|
||||||
private httpClient: HttpClient,
|
private httpClient: HttpClient,
|
||||||
private matomoService: MatomoService,
|
private analyticsService: AnalyticsService,
|
||||||
private fb: UntypedFormBuilder,
|
private fb: UntypedFormBuilder,
|
||||||
) {
|
) {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.matomoService.trackPageView('Descriptions');
|
this.analyticsService.trackPageView(AnalyticsService.DescriptionListing);
|
||||||
this.isPublic = this.router.url === '/explore-descriptions';
|
this.isPublic = this.router.url === '/explore-descriptions';
|
||||||
if (this.isPublic) {
|
if (this.isPublic) {
|
||||||
//TODO: refactor
|
//TODO: refactor
|
||||||
|
@ -184,11 +202,11 @@ export class DescriptionListingComponent extends BaseComponent implements OnInit
|
||||||
|
|
||||||
orderByChanged(){
|
orderByChanged(){
|
||||||
if (this.formGroup.get('order').value == RecentActivityOrder.Status){
|
if (this.formGroup.get('order').value == RecentActivityOrder.Status){
|
||||||
this.lookup.order = { items: ['-' + nameof<Dmp>(x => x.status)] };
|
this.lookup.order = { items: [this.sortingDirectionPrefix + nameof<Dmp>(x => x.status)] };
|
||||||
} else if(this.formGroup.get('order').value == RecentActivityOrder.Label){
|
} else if(this.formGroup.get('order').value == RecentActivityOrder.Label){
|
||||||
this.lookup.order = { items: ['-' + nameof<Dmp>(x => x.label)] };
|
this.lookup.order = { items: [this.sortingDirectionPrefix + nameof<Dmp>(x => x.label)] };
|
||||||
}else{
|
}else{
|
||||||
this.lookup.order = { items: ['-' + nameof<Dmp>(x => x.updatedAt)] };
|
this.lookup.order = { items: [this.sortingDirectionPrefix + nameof<Dmp>(x => x.updatedAt)] };
|
||||||
}
|
}
|
||||||
this.refresh(this.lookup);
|
this.refresh(this.lookup);
|
||||||
}
|
}
|
||||||
|
@ -394,4 +412,8 @@ export class DescriptionListingComponent extends BaseComponent implements OnInit
|
||||||
return this.lookup.like !== undefined && this.lookup.like !== null;
|
return this.lookup.like !== undefined && this.lookup.like !== null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
toggleSortDirection(): void {
|
||||||
|
this.sortDirection = this.isAscending ? this.sortDirection = SortDirection.Descending : this.sortDirection = SortDirection.Ascending;
|
||||||
|
this.orderByChanged();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,6 +28,7 @@ import { DescriptionStatus } from '../../../../core/common/enum/description-stat
|
||||||
import { DescriptionCopyDialogComponent } from '../../description-copy-dialog/description-copy-dialog.component';
|
import { DescriptionCopyDialogComponent } from '../../description-copy-dialog/description-copy-dialog.component';
|
||||||
import { AppPermission } from '@app/core/common/enum/permission.enum';
|
import { AppPermission } from '@app/core/common/enum/permission.enum';
|
||||||
import { FileTransformerEntityType } from '@app/core/common/enum/file-transformer-entity-type';
|
import { FileTransformerEntityType } from '@app/core/common/enum/file-transformer-entity-type';
|
||||||
|
import { AnalyticsService } from '@app/core/services/matomo/analytics-service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-description-listing-item-component',
|
selector: 'app-description-listing-item-component',
|
||||||
|
@ -69,12 +70,13 @@ export class DescriptionListingItemComponent extends BaseComponent implements On
|
||||||
public referenceTypeService: ReferenceTypeService,
|
public referenceTypeService: ReferenceTypeService,
|
||||||
public fileTransformerService: FileTransformerService,
|
public fileTransformerService: FileTransformerService,
|
||||||
private fb: UntypedFormBuilder,
|
private fb: UntypedFormBuilder,
|
||||||
|
private analyticsService: AnalyticsService,
|
||||||
) {
|
) {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.matomoService.trackPageView('Description Listing Item');
|
this.analyticsService.trackPageView(AnalyticsService.DescriptionListingItem);
|
||||||
if (this.description.isActive === IsActive.Inactive) {
|
if (this.description.isActive === IsActive.Inactive) {
|
||||||
this.isDeleted = true;
|
this.isDeleted = true;
|
||||||
} else if (this.description.status === DescriptionStatus.Draft) {
|
} else if (this.description.status === DescriptionStatus.Draft) {
|
||||||
|
|
|
@ -89,8 +89,8 @@
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12" *ngFor="let dmpReference of researchers let last = last">
|
<div class="col-12" *ngFor="let dmpReference of researchers let last = last">
|
||||||
<span *ngIf="isOrcid(dmpReference.reference)">
|
<span *ngIf="isOrcid(dmpReference.reference)">
|
||||||
<a href="{{ getOrcidPathForResearcher(dmpReference.reference?.reference) }}" target="blank" class="researcher">
|
<a href="{{ getOrcidPathForResearcher(dmpReference.reference?.reference) }}" target="blank" class="researcher align-items-center">
|
||||||
<div class="id-btn"> </div>
|
<div class="id-btn" [matTooltip]="unauthorizedTootipText"> </div>
|
||||||
<div *ngIf="!last">{{ dmpReference.reference?.label }}, </div>
|
<div *ngIf="!last">{{ dmpReference.reference?.label }}, </div>
|
||||||
<div *ngIf="last">{{ dmpReference.reference?.label }}</div>
|
<div *ngIf="last">{{ dmpReference.reference?.label }}</div>
|
||||||
</a>
|
</a>
|
||||||
|
|
|
@ -52,8 +52,9 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.id-btn {
|
.id-btn {
|
||||||
background: url("../../../../assets/images/orcid.png") no-repeat center;
|
background: url("../../../../assets/images/orcid_unauth.png") no-repeat center;
|
||||||
width: 1em;
|
width: 1rem;
|
||||||
|
height: 1rem;
|
||||||
margin-right: 0.3em;
|
margin-right: 0.3em;
|
||||||
align-self: center;
|
align-self: center;
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,6 +41,7 @@ import { IsActive } from '@app/core/common/enum/is-active.enum';
|
||||||
import { DmpInvitationDialogComponent } from '@app/ui/dmp/invitation/dialog/dmp-invitation-dialog.component';
|
import { DmpInvitationDialogComponent } from '@app/ui/dmp/invitation/dialog/dmp-invitation-dialog.component';
|
||||||
import { DmpBlueprint, DmpBlueprintDefinition, DmpBlueprintDefinitionSection } from '@app/core/model/dmp-blueprint/dmp-blueprint';
|
import { DmpBlueprint, DmpBlueprintDefinition, DmpBlueprintDefinitionSection } from '@app/core/model/dmp-blueprint/dmp-blueprint';
|
||||||
import { FileTransformerEntityType } from '@app/core/common/enum/file-transformer-entity-type';
|
import { FileTransformerEntityType } from '@app/core/common/enum/file-transformer-entity-type';
|
||||||
|
import { AnalyticsService } from '@app/core/services/matomo/analytics-service';
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
@ -92,13 +93,15 @@ export class DescriptionOverviewComponent extends BaseComponent implements OnIni
|
||||||
public fileTransformerService: FileTransformerService,
|
public fileTransformerService: FileTransformerService,
|
||||||
private referenceTypeService: ReferenceTypeService,
|
private referenceTypeService: ReferenceTypeService,
|
||||||
private fb: UntypedFormBuilder,
|
private fb: UntypedFormBuilder,
|
||||||
private lockService: LockService
|
private lockService: LockService,
|
||||||
|
private analyticsService: AnalyticsService,
|
||||||
) {
|
) {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.matomoService.trackPageView('Description Overview');
|
this.analyticsService.trackPageView(AnalyticsService.DescriptionOverview);
|
||||||
|
|
||||||
this.canDelete = false;
|
this.canDelete = false;
|
||||||
this.canEdit = false;
|
this.canEdit = false;
|
||||||
this.canFinalize = false;
|
this.canFinalize = false;
|
||||||
|
@ -174,6 +177,10 @@ export class DescriptionOverviewComponent extends BaseComponent implements OnIni
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get unauthorizedTootipText(): string {
|
||||||
|
return this.language.instant('DESCRIPTION-OVERVIEW.INFOS.UNAUTHORIZED-ORCID');
|
||||||
|
}
|
||||||
|
|
||||||
checkLockStatus(id: Guid) {
|
checkLockStatus(id: Guid) {
|
||||||
this.lockService.checkLockStatus(id).pipe(takeUntil(this._destroyed))
|
this.lockService.checkLockStatus(id).pipe(takeUntil(this._destroyed))
|
||||||
.subscribe(lockStatus => {
|
.subscribe(lockStatus => {
|
||||||
|
|
|
@ -31,7 +31,6 @@ import { DmpBlueprintService } from '@app/core/services/dmp/dmp-blueprint.servic
|
||||||
import { DmpService } from '@app/core/services/dmp/dmp.service';
|
import { DmpService } from '@app/core/services/dmp/dmp.service';
|
||||||
import { LockService } from '@app/core/services/lock/lock.service';
|
import { LockService } from '@app/core/services/lock/lock.service';
|
||||||
import { LoggingService } from '@app/core/services/logging/logging-service';
|
import { LoggingService } from '@app/core/services/logging/logging-service';
|
||||||
import { MatomoService } from '@app/core/services/matomo/matomo-service';
|
|
||||||
import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service';
|
import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service';
|
||||||
import { UserService } from '@app/core/services/user/user.service';
|
import { UserService } from '@app/core/services/user/user.service';
|
||||||
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
|
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
|
||||||
|
@ -52,6 +51,7 @@ import { DmpEditorModel, DmpFieldIndicator } from './dmp-editor.model';
|
||||||
import { DmpEditorResolver } from './dmp-editor.resolver';
|
import { DmpEditorResolver } from './dmp-editor.resolver';
|
||||||
import { DmpEditorService } from './dmp-editor.service';
|
import { DmpEditorService } from './dmp-editor.service';
|
||||||
import { Title } from '@angular/platform-browser';
|
import { Title } from '@angular/platform-browser';
|
||||||
|
import { AnalyticsService } from '@app/core/services/matomo/analytics-service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-dmp-editor',
|
selector: 'app-dmp-editor',
|
||||||
|
@ -160,14 +160,14 @@ export class DmpEditorComponent extends BaseEditor<DmpEditorModel, Dmp> implemen
|
||||||
private dmpService: DmpService,
|
private dmpService: DmpService,
|
||||||
private logger: LoggingService,
|
private logger: LoggingService,
|
||||||
public dmpBlueprintService: DmpBlueprintService,
|
public dmpBlueprintService: DmpBlueprintService,
|
||||||
private matomoService: MatomoService,
|
|
||||||
// public visibilityRulesService: VisibilityRulesService,
|
// public visibilityRulesService: VisibilityRulesService,
|
||||||
private languageInfoService: LanguageInfoService,
|
private languageInfoService: LanguageInfoService,
|
||||||
public enumUtils: EnumUtils,
|
public enumUtils: EnumUtils,
|
||||||
public descriptionTemplateService: DescriptionTemplateService,
|
public descriptionTemplateService: DescriptionTemplateService,
|
||||||
public userService: UserService,
|
public userService: UserService,
|
||||||
public descriptionService: DescriptionService,
|
public descriptionService: DescriptionService,
|
||||||
public titleService: Title
|
public titleService: Title,
|
||||||
|
private analyticsService: AnalyticsService,
|
||||||
) {
|
) {
|
||||||
const descriptionLabel:string = route.snapshot.data['entity']?.label;
|
const descriptionLabel:string = route.snapshot.data['entity']?.label;
|
||||||
if (descriptionLabel) {
|
if (descriptionLabel) {
|
||||||
|
@ -179,7 +179,8 @@ export class DmpEditorComponent extends BaseEditor<DmpEditorModel, Dmp> implemen
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
this.matomoService.trackPageView('DMP Editor');
|
this.analyticsService.trackPageView(AnalyticsService.DmpEditor);
|
||||||
|
|
||||||
super.ngOnInit();
|
super.ngOnInit();
|
||||||
|
|
||||||
if (this.isNew === false && this.step === 0) this.nextStep();
|
if (this.isNew === false && this.step === 0) this.nextStep();
|
||||||
|
|
|
@ -2,8 +2,8 @@ import { Inject, Component, ViewChild, OnInit, Output, EventEmitter } from '@ang
|
||||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||||
import { DmpCriteriaComponent } from './dmp-criteria.component';
|
import { DmpCriteriaComponent } from './dmp-criteria.component';
|
||||||
import { UntypedFormGroup } from '@angular/forms';
|
import { UntypedFormGroup } from '@angular/forms';
|
||||||
import { MatomoService } from '@app/core/services/matomo/matomo-service';
|
|
||||||
import { HttpClient } from '@angular/common/http';
|
import { HttpClient } from '@angular/common/http';
|
||||||
|
import { AnalyticsService } from '@app/core/services/matomo/analytics-service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'dmp-criteria-dialog-component',
|
selector: 'dmp-criteria-dialog-component',
|
||||||
|
@ -18,13 +18,14 @@ export class DmpCriteriaDialogComponent implements OnInit {
|
||||||
constructor(
|
constructor(
|
||||||
public dialogRef: MatDialogRef<DmpCriteriaDialogComponent>,
|
public dialogRef: MatDialogRef<DmpCriteriaDialogComponent>,
|
||||||
private httpClient: HttpClient,
|
private httpClient: HttpClient,
|
||||||
private matomoService: MatomoService,
|
private analyticsService: AnalyticsService,
|
||||||
|
|
||||||
@Inject(MAT_DIALOG_DATA) public data: { showGrant: boolean, isPublic: boolean, criteria: DmpCriteria, formGroup: UntypedFormGroup, updateDataFn: Function }
|
@Inject(MAT_DIALOG_DATA) public data: { showGrant: boolean, isPublic: boolean, criteria: DmpCriteria, formGroup: UntypedFormGroup, updateDataFn: Function }
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.matomoService.trackPageView('DMP Criteria');
|
this.analyticsService.trackPageView(AnalyticsService.DmpCriteriaDialog);
|
||||||
this.criteria.setCriteria(this.data.criteria);
|
this.criteria.setCriteria(this.data.criteria);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,10 +29,10 @@
|
||||||
<div *ngIf="listingItems && listingItems.length > 0 || this.lookup.like" class="col-md-12">
|
<div *ngIf="listingItems && listingItems.length > 0 || this.lookup.like" class="col-md-12">
|
||||||
<div class="row pt-4">
|
<div class="row pt-4">
|
||||||
<!-- Sort by -->
|
<!-- Sort by -->
|
||||||
<div class="col-12 col-xl-auto d-flex align-items-center">
|
<div class="col-auto d-flex align-items-center order-1">
|
||||||
<span class="mb-1 mb-xl-4">{{'DMP-LISTING.SORT-BY' | translate}}:</span>
|
<span class="mb-1 mb-xl-4">{{'DMP-LISTING.SORT-BY' | translate}}:</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12 col-xl-auto">
|
<div class="col-12 col-xl-auto order-3 order-xl-2">
|
||||||
<mat-form-field class="sort-form w-100">
|
<mat-form-field class="sort-form w-100">
|
||||||
<mat-select placeholder="{{'GENERAL.CRITERIA.LIKE'| translate}}" [formControl]="formGroup.get('order')" (selectionChange)="orderByChanged()">
|
<mat-select placeholder="{{'GENERAL.CRITERIA.LIKE'| translate}}" [formControl]="formGroup.get('order')" (selectionChange)="orderByChanged()">
|
||||||
<mat-option *ngIf="!isPublic" [value]="order.UpdatedAt">{{enumUtils.toRecentActivityOrderString(order.UpdatedAt)}}</mat-option>
|
<mat-option *ngIf="!isPublic" [value]="order.UpdatedAt">{{enumUtils.toRecentActivityOrderString(order.UpdatedAt)}}</mat-option>
|
||||||
|
@ -42,7 +42,13 @@
|
||||||
</mat-select>
|
</mat-select>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12 col-xl-auto ml-auto">
|
<div class="col-auto order-2 order-xl-3">
|
||||||
|
<button mat-icon-button (click)="toggleSortDirection()" [matTooltip]="sortingTooltipText">
|
||||||
|
<mat-icon *ngIf="isAscending">keyboard_double_arrow_up</mat-icon>
|
||||||
|
<mat-icon *ngIf="isDescending">keyboard_double_arrow_down</mat-icon>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div class="col-12 col-xl-auto ml-auto order-4">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12 col-xl-auto d-flex align-items-center">
|
<div class="col-12 col-xl-auto d-flex align-items-center">
|
||||||
<span *ngIf="!isPublic" class="center-content mb-1 mb-xl-4" (click)="restartTour()">{{ 'GENERAL.ACTIONS.TAKE-A-TOUR'| translate }}</span>
|
<span *ngIf="!isPublic" class="center-content mb-1 mb-xl-4" (click)="restartTour()">{{ 'GENERAL.ACTIONS.TAKE-A-TOUR'| translate }}</span>
|
||||||
|
|
|
@ -9,7 +9,6 @@ import { ActivatedRoute, Router } from '@angular/router';
|
||||||
import { RecentActivityOrder } from '@app/core/common/enum/recent-activity-order';
|
import { RecentActivityOrder } from '@app/core/common/enum/recent-activity-order';
|
||||||
import { AuthService } from '@app/core/services/auth/auth.service';
|
import { AuthService } from '@app/core/services/auth/auth.service';
|
||||||
import { DmpService } from '@app/core/services/dmp/dmp.service';
|
import { DmpService } from '@app/core/services/dmp/dmp.service';
|
||||||
import { MatomoService } from '@app/core/services/matomo/matomo-service';
|
|
||||||
import { UiNotificationService } from '@app/core/services/notification/ui-notification-service';
|
import { UiNotificationService } from '@app/core/services/notification/ui-notification-service';
|
||||||
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
|
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
|
||||||
import { GuidedTour, Orientation } from '@app/library/guided-tour/guided-tour.constants';
|
import { GuidedTour, Orientation } from '@app/library/guided-tour/guided-tour.constants';
|
||||||
|
@ -34,6 +33,8 @@ import { ReferenceType } from '@app/core/model/reference-type/reference-type';
|
||||||
import { AppPermission } from '@app/core/common/enum/permission.enum';
|
import { AppPermission } from '@app/core/common/enum/permission.enum';
|
||||||
import { DmpStatus } from '@app/core/common/enum/dmp-status';
|
import { DmpStatus } from '@app/core/common/enum/dmp-status';
|
||||||
import { DescriptionStatus } from '@app/core/common/enum/description-status';
|
import { DescriptionStatus } from '@app/core/common/enum/description-status';
|
||||||
|
import { SortDirection } from '@common/modules/hybrid-listing/hybrid-listing.component';
|
||||||
|
import { AnalyticsService } from '@app/core/services/matomo/analytics-service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-dmp-listing-component',
|
selector: 'app-dmp-listing-component',
|
||||||
|
@ -59,6 +60,23 @@ export class DmpListingComponent extends BaseComponent implements OnInit { //IBr
|
||||||
scrollbar: boolean;
|
scrollbar: boolean;
|
||||||
order = RecentActivityOrder;
|
order = RecentActivityOrder;
|
||||||
|
|
||||||
|
private _sortDirection: SortDirection = SortDirection.Descending; //SortDirection.Descending: "-"
|
||||||
|
set sortDirection(sortDirection: SortDirection) {
|
||||||
|
this._sortDirection = sortDirection;
|
||||||
|
}
|
||||||
|
get isAscending(): boolean {
|
||||||
|
return this._sortDirection == SortDirection.Ascending;
|
||||||
|
}
|
||||||
|
get isDescending(): boolean {
|
||||||
|
return this._sortDirection == SortDirection.Descending;
|
||||||
|
}
|
||||||
|
get sortingDirectionPrefix(): string {
|
||||||
|
return this.isAscending ? "+" : "-";
|
||||||
|
}
|
||||||
|
get sortingTooltipText(): string {
|
||||||
|
return this.isAscending ? this.language.instant('DMP-LISTING.ACTIONS.TOGGLE-ΑSCENDING') : this.language.instant('DMP-LISTING.ACTIONS.TOGGLE-DESCENDING');
|
||||||
|
}
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private dmpService: DmpService,
|
private dmpService: DmpService,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
|
@ -71,13 +89,15 @@ export class DmpListingComponent extends BaseComponent implements OnInit { //IBr
|
||||||
private authService: AuthService,
|
private authService: AuthService,
|
||||||
private guidedTourService: GuidedTourService,
|
private guidedTourService: GuidedTourService,
|
||||||
private httpClient: HttpClient,
|
private httpClient: HttpClient,
|
||||||
private matomoService: MatomoService
|
private analyticsService: AnalyticsService,
|
||||||
|
|
||||||
) {
|
) {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.matomoService.trackPageView('DMPs');
|
this.analyticsService.trackPageView(AnalyticsService.DmpListing);
|
||||||
|
|
||||||
this.isPublic = this.router.url.startsWith('/explore-plans');
|
this.isPublic = this.router.url.startsWith('/explore-plans');
|
||||||
if (this.isPublic) {
|
if (this.isPublic) {
|
||||||
//TODO refactor
|
//TODO refactor
|
||||||
|
@ -167,11 +187,11 @@ export class DmpListingComponent extends BaseComponent implements OnInit { //IBr
|
||||||
|
|
||||||
orderByChanged(){
|
orderByChanged(){
|
||||||
if (this.formGroup.get('order').value == RecentActivityOrder.Status){
|
if (this.formGroup.get('order').value == RecentActivityOrder.Status){
|
||||||
this.lookup.order = { items: ['-' + nameof<Dmp>(x => x.status)] };
|
this.lookup.order = { items: [this.sortingDirectionPrefix + nameof<Dmp>(x => x.status)] };
|
||||||
} else if(this.formGroup.get('order').value == RecentActivityOrder.Label){
|
} else if(this.formGroup.get('order').value == RecentActivityOrder.Label){
|
||||||
this.lookup.order = { items: ['-' + nameof<Dmp>(x => x.label)] };
|
this.lookup.order = { items: [this.sortingDirectionPrefix + nameof<Dmp>(x => x.label)] };
|
||||||
}else{
|
}else{
|
||||||
this.lookup.order = { items: ['-' + nameof<Dmp>(x => x.updatedAt)] };
|
this.lookup.order = { items: [this.sortingDirectionPrefix + nameof<Dmp>(x => x.updatedAt)] };
|
||||||
}
|
}
|
||||||
this.refresh(this.lookup);
|
this.refresh(this.lookup);
|
||||||
}
|
}
|
||||||
|
@ -386,4 +406,9 @@ export class DmpListingComponent extends BaseComponent implements OnInit { //IBr
|
||||||
public hasLikeCriteria(): boolean {
|
public hasLikeCriteria(): boolean {
|
||||||
return this.lookup.like !== undefined && this.lookup.like !== null;
|
return this.lookup.like !== undefined && this.lookup.like !== null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
toggleSortDirection(): void {
|
||||||
|
this.sortDirection = this.isAscending ? this.sortDirection = SortDirection.Descending : this.sortDirection = SortDirection.Ascending;
|
||||||
|
this.orderByChanged();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,6 @@ import { DmpBlueprintService } from '@app/core/services/dmp/dmp-blueprint.servic
|
||||||
import { DmpService } from '@app/core/services/dmp/dmp.service';
|
import { DmpService } from '@app/core/services/dmp/dmp.service';
|
||||||
import { FileTransformerService } from '@app/core/services/file-transformer/file-transformer.service';
|
import { FileTransformerService } from '@app/core/services/file-transformer/file-transformer.service';
|
||||||
import { LockService } from '@app/core/services/lock/lock.service';
|
import { LockService } from '@app/core/services/lock/lock.service';
|
||||||
import { MatomoService } from '@app/core/services/matomo/matomo-service';
|
|
||||||
import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service';
|
import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service';
|
||||||
import { ReferenceTypeService } from '@app/core/services/reference-type/reference-type.service';
|
import { ReferenceTypeService } from '@app/core/services/reference-type/reference-type.service';
|
||||||
import { ReferenceService } from '@app/core/services/reference/reference.service';
|
import { ReferenceService } from '@app/core/services/reference/reference.service';
|
||||||
|
@ -30,6 +29,7 @@ import { AppPermission } from '@app/core/common/enum/permission.enum';
|
||||||
import { FileTransformerEntityType } from '@app/core/common/enum/file-transformer-entity-type';
|
import { FileTransformerEntityType } from '@app/core/common/enum/file-transformer-entity-type';
|
||||||
import { DmpVersionStatus } from '@app/core/common/enum/dmp-version-status';
|
import { DmpVersionStatus } from '@app/core/common/enum/dmp-version-status';
|
||||||
import { DmpDeleteDialogComponent } from '../../dmp-delete-dialog/dmp-delete-dialog.component';
|
import { DmpDeleteDialogComponent } from '../../dmp-delete-dialog/dmp-delete-dialog.component';
|
||||||
|
import { AnalyticsService } from '@app/core/services/matomo/analytics-service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-dmp-listing-item-component',
|
selector: 'app-dmp-listing-item-component',
|
||||||
|
@ -61,16 +61,17 @@ export class DmpListingItemComponent extends BaseComponent implements OnInit {
|
||||||
private lockService: LockService,
|
private lockService: LockService,
|
||||||
private location: Location,
|
private location: Location,
|
||||||
private httpClient: HttpClient,
|
private httpClient: HttpClient,
|
||||||
private matomoService: MatomoService,
|
|
||||||
public referenceService: ReferenceService,
|
public referenceService: ReferenceService,
|
||||||
public referenceTypeService: ReferenceTypeService,
|
public referenceTypeService: ReferenceTypeService,
|
||||||
public fileTransformerService: FileTransformerService,
|
public fileTransformerService: FileTransformerService,
|
||||||
private fileUtils: FileUtils) {
|
private fileUtils: FileUtils,
|
||||||
|
private analyticsService: AnalyticsService,
|
||||||
|
) {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.matomoService.trackPageView('DMP Listing Item');
|
this.analyticsService.trackPageView(AnalyticsService.DmpListingItem);
|
||||||
if (this.dmp.status == DmpStatus.Draft) {
|
if (this.dmp.status == DmpStatus.Draft) {
|
||||||
this.isDraft = true;
|
this.isDraft = true;
|
||||||
this.isFinalized = false;
|
this.isFinalized = false;
|
||||||
|
|
|
@ -3,12 +3,12 @@ import { Component, Inject } from '@angular/core';
|
||||||
import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog';
|
import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
import { DmpService } from '@app/core/services/dmp/dmp.service';
|
import { DmpService } from '@app/core/services/dmp/dmp.service';
|
||||||
import { MatomoService } from '@app/core/services/matomo/matomo-service';
|
|
||||||
import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service';
|
import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service';
|
||||||
import { BaseComponent } from '@common/base/base.component';
|
import { BaseComponent } from '@common/base/base.component';
|
||||||
import { TranslateService } from '@ngx-translate/core';
|
import { TranslateService } from '@ngx-translate/core';
|
||||||
import { takeUntil } from 'rxjs/operators';
|
import { takeUntil } from 'rxjs/operators';
|
||||||
import { DmpUploadDialogComponent } from '../upload-dialogue/dmp-upload-dialog.component';
|
import { DmpUploadDialogComponent } from '../upload-dialogue/dmp-upload-dialog.component';
|
||||||
|
import { AnalyticsService } from '@app/core/services/matomo/analytics-service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-start-new-dmp',
|
selector: 'app-start-new-dmp',
|
||||||
|
@ -28,14 +28,14 @@ export class StartNewDmpDialogComponent extends BaseComponent {
|
||||||
private language: TranslateService,
|
private language: TranslateService,
|
||||||
private dmpService: DmpService,
|
private dmpService: DmpService,
|
||||||
private httpClient: HttpClient,
|
private httpClient: HttpClient,
|
||||||
private matomoService: MatomoService
|
private analyticsService: AnalyticsService,
|
||||||
) {
|
) {
|
||||||
super();
|
super();
|
||||||
this.isDialog = data.isDialog;
|
this.isDialog = data.isDialog;
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.matomoService.trackPageView('Start New DMP Dialog');
|
this.analyticsService.trackPageView(AnalyticsService.StartNewDmpDialog);
|
||||||
}
|
}
|
||||||
|
|
||||||
cancel() {
|
cancel() {
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { Component, Inject } from '@angular/core';
|
||||||
import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog';
|
import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog';
|
||||||
import { DescriptionTemplate } from '@app/core/model/description-template/description-template';
|
import { DescriptionTemplate } from '@app/core/model/description-template/description-template';
|
||||||
import { DmpService } from '@app/core/services/dmp/dmp.service';
|
import { DmpService } from '@app/core/services/dmp/dmp.service';
|
||||||
import { MatomoService } from '@app/core/services/matomo/matomo-service';
|
import { AnalyticsService } from '@app/core/services/matomo/analytics-service';
|
||||||
import { MultipleAutoCompleteConfiguration } from '@app/library/auto-complete/multiple/multiple-auto-complete-configuration';
|
import { MultipleAutoCompleteConfiguration } from '@app/library/auto-complete/multiple/multiple-auto-complete-configuration';
|
||||||
import { BaseComponent } from '@common/base/base.component';
|
import { BaseComponent } from '@common/base/base.component';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
|
@ -34,14 +34,15 @@ export class DmpUploadDialogComponent extends BaseComponent {
|
||||||
private _service: DmpService,
|
private _service: DmpService,
|
||||||
private dialog: MatDialog,
|
private dialog: MatDialog,
|
||||||
private httpClient: HttpClient,
|
private httpClient: HttpClient,
|
||||||
private matomoService: MatomoService,
|
private analyticsService: AnalyticsService,
|
||||||
|
|
||||||
@Inject(MAT_DIALOG_DATA) public data: any,
|
@Inject(MAT_DIALOG_DATA) public data: any,
|
||||||
) {
|
) {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.matomoService.trackPageView('DMP Upload Dialog');
|
this.analyticsService.trackPageView(AnalyticsService.DmpUploadDialog);
|
||||||
}
|
}
|
||||||
|
|
||||||
cancel() {
|
cancel() {
|
||||||
|
|
|
@ -78,8 +78,8 @@
|
||||||
<ng-container *ngFor="let dmpReference of researchers let last = last">
|
<ng-container *ngFor="let dmpReference of researchers let last = last">
|
||||||
<ng-container *ngIf="isOrcid(dmpReference.reference)">
|
<ng-container *ngIf="isOrcid(dmpReference.reference)">
|
||||||
<div class="d-inline-block">
|
<div class="d-inline-block">
|
||||||
<a href="{{ getOrcidPathForResearcher(dmpReference.reference?.reference) }}" target="blank" class="researcher">
|
<a href="{{ getOrcidPathForResearcher(dmpReference.reference?.reference) }}" target="blank" class="researcher align-items-center">
|
||||||
<span class="id-btn"> </span>
|
<span class="id-btn" [matTooltip]="unauthorizedTootipText"> </span>
|
||||||
<span *ngIf="!last">{{ dmpReference.reference?.label }},</span><span> </span>
|
<span *ngIf="!last">{{ dmpReference.reference?.label }},</span><span> </span>
|
||||||
<span *ngIf="last">{{ dmpReference.reference?.label }}</span>
|
<span *ngIf="last">{{ dmpReference.reference?.label }}</span>
|
||||||
</a>
|
</a>
|
||||||
|
|
|
@ -36,8 +36,9 @@
|
||||||
// ********BUTTONS********
|
// ********BUTTONS********
|
||||||
|
|
||||||
.id-btn {
|
.id-btn {
|
||||||
background: url("../../../../assets/images/orcid.png") no-repeat center;
|
background: url("../../../../assets/images/orcid_unauth.png") no-repeat center;
|
||||||
width: 1em;
|
width: 1rem;
|
||||||
|
height: 1rem;
|
||||||
margin-right: 0.3em;
|
margin-right: 0.3em;
|
||||||
align-self: center;
|
align-self: center;
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,6 +49,7 @@ import { DmpEditorResolver } from '../dmp-editor-blueprint/dmp-editor.resolver';
|
||||||
import { FileTransformerEntityType } from '@app/core/common/enum/file-transformer-entity-type';
|
import { FileTransformerEntityType } from '@app/core/common/enum/file-transformer-entity-type';
|
||||||
import { DmpVersionStatus } from '@app/core/common/enum/dmp-version-status';
|
import { DmpVersionStatus } from '@app/core/common/enum/dmp-version-status';
|
||||||
import { DmpDeleteDialogComponent } from '../dmp-delete-dialog/dmp-delete-dialog.component';
|
import { DmpDeleteDialogComponent } from '../dmp-delete-dialog/dmp-delete-dialog.component';
|
||||||
|
import { AnalyticsService } from '@app/core/services/matomo/analytics-service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-dmp-overview',
|
selector: 'app-dmp-overview',
|
||||||
|
@ -103,13 +104,14 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit {
|
||||||
public referenceService: ReferenceService,
|
public referenceService: ReferenceService,
|
||||||
public enumUtils: EnumUtils,
|
public enumUtils: EnumUtils,
|
||||||
public fileTransformerService: FileTransformerService,
|
public fileTransformerService: FileTransformerService,
|
||||||
private referenceTypeService: ReferenceTypeService
|
private referenceTypeService: ReferenceTypeService,
|
||||||
|
private analyticsService: AnalyticsService,
|
||||||
) {
|
) {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.matomoService.trackPageView('DMP Overview');
|
this.analyticsService.trackPageView(AnalyticsService.DmpOverview);
|
||||||
// Gets dmp data using parameter id
|
// Gets dmp data using parameter id
|
||||||
this.route.params
|
this.route.params
|
||||||
.pipe(takeUntil(this._destroyed))
|
.pipe(takeUntil(this._destroyed))
|
||||||
|
@ -201,6 +203,10 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get unauthorizedTootipText(): string {
|
||||||
|
return this.language.instant('DMP-OVERVIEW.INFOS.UNAUTHORIZED-ORCID');
|
||||||
|
}
|
||||||
|
|
||||||
onFetchingDeletedCallbackError(redirectRoot: string) {
|
onFetchingDeletedCallbackError(redirectRoot: string) {
|
||||||
this.uiNotificationService.snackBarNotification(this.language.instant('DMP-OVERVIEW.ERROR.DELETED-DMP'), SnackBarNotificationLevel.Error);
|
this.uiNotificationService.snackBarNotification(this.language.instant('DMP-OVERVIEW.ERROR.DELETED-DMP'), SnackBarNotificationLevel.Error);
|
||||||
this.router.navigate([redirectRoot]);
|
this.router.navigate([redirectRoot]);
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
import { Component, OnInit, Input } from '@angular/core';
|
import { Component, OnInit, Input } from '@angular/core';
|
||||||
import { SafeResourceUrl, DomSanitizer } from '@angular/platform-browser';
|
import { SafeResourceUrl, DomSanitizer } from '@angular/platform-browser';
|
||||||
import { LanguageService } from '@app/core/services/language/language.service';
|
import { LanguageService } from '@app/core/services/language/language.service';
|
||||||
import { MatomoService } from '@app/core/services/matomo/matomo-service';
|
|
||||||
import { SupportiveMaterialService } from '@app/core/services/supportive-material/supportive-material.service';
|
import { SupportiveMaterialService } from '@app/core/services/supportive-material/supportive-material.service';
|
||||||
import { BaseComponent } from '@common/base/base.component';
|
import { BaseComponent } from '@common/base/base.component';
|
||||||
import { takeUntil } from 'rxjs/operators';
|
import { takeUntil } from 'rxjs/operators';
|
||||||
import { SupportiveMaterialFieldType } from '@app/core/common/enum/supportive-material-field-type';
|
import { SupportiveMaterialFieldType } from '@app/core/common/enum/supportive-material-field-type';
|
||||||
|
import { AnalyticsService } from '@app/core/services/matomo/analytics-service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-faq-content',
|
selector: 'app-faq-content',
|
||||||
|
@ -23,11 +23,11 @@ export class FaqContentComponent extends BaseComponent implements OnInit {
|
||||||
private supportiveMaterialService: SupportiveMaterialService,
|
private supportiveMaterialService: SupportiveMaterialService,
|
||||||
private sanitizer: DomSanitizer,
|
private sanitizer: DomSanitizer,
|
||||||
private languageService: LanguageService,
|
private languageService: LanguageService,
|
||||||
private matomoService: MatomoService
|
private analyticsService: AnalyticsService,
|
||||||
) { super(); }
|
) { super(); }
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.matomoService.trackPageView('FAQ');
|
this.analyticsService.trackPageView(AnalyticsService.FAQ);
|
||||||
|
|
||||||
this.supportiveMaterialService.getPayload(SupportiveMaterialFieldType.Faq, this.languageService.getCurrentLanguage())
|
this.supportiveMaterialService.getPayload(SupportiveMaterialFieldType.Faq, this.languageService.getCurrentLanguage())
|
||||||
.pipe(takeUntil(this._destroyed))
|
.pipe(takeUntil(this._destroyed))
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
import { SupportiveMaterialFieldType } from '@app/core/common/enum/supportive-material-field-type';
|
import { SupportiveMaterialFieldType } from '@app/core/common/enum/supportive-material-field-type';
|
||||||
import { LanguageService } from '@app/core/services/language/language.service';
|
import { LanguageService } from '@app/core/services/language/language.service';
|
||||||
import { MatomoService } from '@app/core/services/matomo/matomo-service';
|
import { AnalyticsService } from '@app/core/services/matomo/analytics-service';
|
||||||
import { SupportiveMaterialService } from '@app/core/services/supportive-material/supportive-material.service';
|
import { SupportiveMaterialService } from '@app/core/services/supportive-material/supportive-material.service';
|
||||||
import { BaseComponent } from '@common/base/base.component';
|
import { BaseComponent } from '@common/base/base.component';
|
||||||
import { LangChangeEvent, TranslateService } from '@ngx-translate/core';
|
import { LangChangeEvent, TranslateService } from '@ngx-translate/core';
|
||||||
|
@ -25,13 +25,14 @@ export class GlossaryContentComponent extends BaseComponent implements OnInit {
|
||||||
private supportiveMaterialService: SupportiveMaterialService,
|
private supportiveMaterialService: SupportiveMaterialService,
|
||||||
private sanitizer: DomSanitizer,
|
private sanitizer: DomSanitizer,
|
||||||
private languageService: LanguageService,
|
private languageService: LanguageService,
|
||||||
private matomoService: MatomoService,
|
|
||||||
private translate: TranslateService,
|
private translate: TranslateService,
|
||||||
private router: Router
|
private router: Router,
|
||||||
|
private analyticsService: AnalyticsService,
|
||||||
) { super(); }
|
) { super(); }
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.matomoService.trackPageView('Glossary');
|
this.analyticsService.trackPageView(AnalyticsService.Glossary);
|
||||||
|
|
||||||
this.translate.onLangChange.subscribe((event: LangChangeEvent) => {
|
this.translate.onLangChange.subscribe((event: LangChangeEvent) => {
|
||||||
this.router.navigate(['/reload'], { skipLocationChange: true }).then(() => this.router.navigate(['/glossary']));
|
this.router.navigate(['/reload'], { skipLocationChange: true }).then(() => this.router.navigate(['/glossary']));
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,6 @@ import { AppRole } from '@app/core/common/enum/app-role';
|
||||||
import { User } from '@app/core/model/user/user';
|
import { User } from '@app/core/model/user/user';
|
||||||
import { AuthService, LoginStatus } from '@app/core/services/auth/auth.service';
|
import { AuthService, LoginStatus } from '@app/core/services/auth/auth.service';
|
||||||
import { LanguageService } from '@app/core/services/language/language.service';
|
import { LanguageService } from '@app/core/services/language/language.service';
|
||||||
import { MatomoService } from '@app/core/services/matomo/matomo-service';
|
|
||||||
import { ProgressIndicationService } from '@app/core/services/progress-indication/progress-indication-service';
|
import { ProgressIndicationService } from '@app/core/services/progress-indication/progress-indication-service';
|
||||||
import { SideNavService } from '@app/core/services/sidenav/side-nav.sevice';
|
import { SideNavService } from '@app/core/services/sidenav/side-nav.sevice';
|
||||||
import { BaseComponent } from '@common/base/base.component';
|
import { BaseComponent } from '@common/base/base.component';
|
||||||
|
@ -26,6 +25,7 @@ import { nameof } from 'ts-simple-nameof';
|
||||||
import { StorageFile } from '@app/core/model/storage-file/storage-file';
|
import { StorageFile } from '@app/core/model/storage-file/storage-file';
|
||||||
import { StorageFileService } from '@app/core/services/storage-file/storage-file.service';
|
import { StorageFileService } from '@app/core/services/storage-file/storage-file.service';
|
||||||
import { DomSanitizer, SafeUrl } from '@angular/platform-browser';
|
import { DomSanitizer, SafeUrl } from '@angular/platform-browser';
|
||||||
|
import { AnalyticsService } from '@app/core/services/matomo/analytics-service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-navbar',
|
selector: 'app-navbar',
|
||||||
|
@ -56,13 +56,13 @@ export class NavbarComponent extends BaseComponent implements OnInit {
|
||||||
private dialog: MatDialog,
|
private dialog: MatDialog,
|
||||||
private progressIndicationService: ProgressIndicationService,
|
private progressIndicationService: ProgressIndicationService,
|
||||||
private languageService: LanguageService,
|
private languageService: LanguageService,
|
||||||
private matomoService: MatomoService,
|
|
||||||
private sidenavService: SideNavService,
|
private sidenavService: SideNavService,
|
||||||
private tenantConfigurationService: TenantConfigurationService,
|
private tenantConfigurationService: TenantConfigurationService,
|
||||||
private inappNotificationService: InAppNotificationService,
|
private inappNotificationService: InAppNotificationService,
|
||||||
private configurationService: ConfigurationService,
|
private configurationService: ConfigurationService,
|
||||||
private storageFileService: StorageFileService,
|
private storageFileService: StorageFileService,
|
||||||
private sanitizer: DomSanitizer
|
private sanitizer: DomSanitizer,
|
||||||
|
private analyticsService: AnalyticsService,
|
||||||
) {
|
) {
|
||||||
super();
|
super();
|
||||||
this.location = location;
|
this.location = location;
|
||||||
|
@ -72,7 +72,8 @@ export class NavbarComponent extends BaseComponent implements OnInit {
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.matomoService.trackPageView('Navbar');
|
this.analyticsService.trackPageView(AnalyticsService.Navbar);
|
||||||
|
|
||||||
this.currentRoute = this.router.url;
|
this.currentRoute = this.router.url;
|
||||||
// this.listTitles = GENERAL_ROUTES.filter(listTitle => listTitle);
|
// this.listTitles = GENERAL_ROUTES.filter(listTitle => listTitle);
|
||||||
// this.listTitles.push(DMP_ROUTES.filter(listTitle => listTitle));
|
// this.listTitles.push(DMP_ROUTES.filter(listTitle => listTitle));
|
||||||
|
|
|
@ -16,7 +16,7 @@ import { takeUntil } from 'rxjs/operators';
|
||||||
import { AuthService } from "@app/core/services/auth/auth.service";
|
import { AuthService } from "@app/core/services/auth/auth.service";
|
||||||
import { UserGuideDialogComponent } from '@app/ui/user-guide/dialog/user-guide-dialog.component';
|
import { UserGuideDialogComponent } from '@app/ui/user-guide/dialog/user-guide-dialog.component';
|
||||||
import { HttpClient } from '@angular/common/http';
|
import { HttpClient } from '@angular/common/http';
|
||||||
import { MatomoService } from '@app/core/services/matomo/matomo-service';
|
import { AnalyticsService } from '@app/core/services/matomo/analytics-service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-sidebar-footer',
|
selector: 'app-sidebar-footer',
|
||||||
|
@ -37,13 +37,14 @@ export class SidebarFooterComponent extends BaseComponent implements OnInit {
|
||||||
private formService: FormService,
|
private formService: FormService,
|
||||||
private authentication: AuthService,
|
private authentication: AuthService,
|
||||||
private httpClient: HttpClient,
|
private httpClient: HttpClient,
|
||||||
private matomoService: MatomoService
|
private analyticsService: AnalyticsService,
|
||||||
) {
|
) {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.matomoService.trackPageView('Sidebar Footer');
|
this.analyticsService.trackPageView(AnalyticsService.SidebarFooter);
|
||||||
|
|
||||||
this.contactEmailFormModel = new ContactEmailFormModel();
|
this.contactEmailFormModel = new ContactEmailFormModel();
|
||||||
this.formGroup = this.contactEmailFormModel.buildForm();
|
this.formGroup = this.contactEmailFormModel.buildForm();
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { SafeResourceUrl, DomSanitizer } from '@angular/platform-browser';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
import { SupportiveMaterialFieldType } from '@app/core/common/enum/supportive-material-field-type';
|
import { SupportiveMaterialFieldType } from '@app/core/common/enum/supportive-material-field-type';
|
||||||
import { LanguageService } from '@app/core/services/language/language.service';
|
import { LanguageService } from '@app/core/services/language/language.service';
|
||||||
import { MatomoService } from '@app/core/services/matomo/matomo-service';
|
import { AnalyticsService } from '@app/core/services/matomo/analytics-service';
|
||||||
import { SupportiveMaterialService } from '@app/core/services/supportive-material/supportive-material.service';
|
import { SupportiveMaterialService } from '@app/core/services/supportive-material/supportive-material.service';
|
||||||
import { BaseComponent } from '@common/base/base.component';
|
import { BaseComponent } from '@common/base/base.component';
|
||||||
import { TranslateService, LangChangeEvent } from '@ngx-translate/core';
|
import { TranslateService, LangChangeEvent } from '@ngx-translate/core';
|
||||||
|
@ -23,13 +23,14 @@ export class TermsComponent extends BaseComponent implements OnInit {
|
||||||
private supportiveMaterialService: SupportiveMaterialService,
|
private supportiveMaterialService: SupportiveMaterialService,
|
||||||
private sanitizer: DomSanitizer,
|
private sanitizer: DomSanitizer,
|
||||||
private languageService: LanguageService,
|
private languageService: LanguageService,
|
||||||
private matomoService: MatomoService,
|
|
||||||
private translate: TranslateService,
|
private translate: TranslateService,
|
||||||
private router: Router
|
private router: Router,
|
||||||
|
private analyticsService: AnalyticsService,
|
||||||
) { super(); }
|
) { super(); }
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.matomoService.trackPageView('Terms of Service');
|
this.analyticsService.trackPageView(AnalyticsService.Terms);
|
||||||
|
|
||||||
this.translate.onLangChange.subscribe((event: LangChangeEvent) => {
|
this.translate.onLangChange.subscribe((event: LangChangeEvent) => {
|
||||||
this.router.navigate(['/reload'], { skipLocationChange: true }).then(() => this.router.navigate(['/terms-and-conditions']));
|
this.router.navigate(['/reload'], { skipLocationChange: true }).then(() => this.router.navigate(['/terms-and-conditions']));
|
||||||
});
|
});
|
||||||
|
|
|
@ -3,7 +3,6 @@ import { HttpClient } from '@angular/common/http';
|
||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { MatDialog } from '@angular/material/dialog';
|
import { MatDialog } from '@angular/material/dialog';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
import { MatomoService } from '@app/core/services/matomo/matomo-service';
|
|
||||||
import { TranslateService } from '@ngx-translate/core';
|
import { TranslateService } from '@ngx-translate/core';
|
||||||
import { AppRole } from '../../core/common/enum/app-role';
|
import { AppRole } from '../../core/common/enum/app-role';
|
||||||
import { AuthService, LoginStatus } from '../../core/services/auth/auth.service';
|
import { AuthService, LoginStatus } from '../../core/services/auth/auth.service';
|
||||||
|
@ -11,6 +10,7 @@ import { LanguageDialogComponent } from '../language/dialog/language-dialog.comp
|
||||||
import { UserDialogComponent } from '../navbar/user-dialog/user-dialog.component';
|
import { UserDialogComponent } from '../navbar/user-dialog/user-dialog.component';
|
||||||
import { AppPermission } from '@app/core/common/enum/permission.enum';
|
import { AppPermission } from '@app/core/common/enum/permission.enum';
|
||||||
import { takeUntil } from 'rxjs/operators';
|
import { takeUntil } from 'rxjs/operators';
|
||||||
|
import { AnalyticsService } from '@app/core/services/matomo/analytics-service';
|
||||||
|
|
||||||
declare interface RouteInfo {
|
declare interface RouteInfo {
|
||||||
path: string;
|
path: string;
|
||||||
|
@ -49,12 +49,12 @@ export class SidebarComponent implements OnInit {
|
||||||
public router: Router,
|
public router: Router,
|
||||||
private location: Location,
|
private location: Location,
|
||||||
private httpClient: HttpClient,
|
private httpClient: HttpClient,
|
||||||
private matomoService: MatomoService
|
private analyticsService: AnalyticsService,
|
||||||
) {
|
) { }
|
||||||
}
|
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.matomoService.trackPageView('Sidebar');
|
this.analyticsService.trackPageView(AnalyticsService.Sidebar);
|
||||||
|
|
||||||
this.currentRoute = this.router.url;
|
this.currentRoute = this.router.url;
|
||||||
|
|
||||||
this.authentication.getAuthenticationStateObservable().pipe().subscribe(authenticationState => {
|
this.authentication.getAuthenticationStateObservable().pipe().subscribe(authenticationState => {
|
||||||
|
|
|
@ -6,7 +6,6 @@ import { TranslateService } from '@ngx-translate/core';
|
||||||
import { ActivatedRoute, Router } from '@angular/router';
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
import { ConfigurationService } from '@app/core/services/configuration/configuration.service';
|
import { ConfigurationService } from '@app/core/services/configuration/configuration.service';
|
||||||
import { AuthService } from '@app/core/services/auth/auth.service';
|
import { AuthService } from '@app/core/services/auth/auth.service';
|
||||||
import { MatomoService } from '@app/core/services/matomo/matomo-service';
|
|
||||||
import { SupportiveMaterialService } from '@app/core/services/supportive-material/supportive-material.service';
|
import { SupportiveMaterialService } from '@app/core/services/supportive-material/supportive-material.service';
|
||||||
import { SupportiveMaterialFieldType } from '@app/core/common/enum/supportive-material-field-type';
|
import { SupportiveMaterialFieldType } from '@app/core/common/enum/supportive-material-field-type';
|
||||||
import { SupportiveMaterial, SupportiveMaterialPersist } from '@app/core/model/supportive-material/supportive-material';
|
import { SupportiveMaterial, SupportiveMaterialPersist } from '@app/core/model/supportive-material/supportive-material';
|
||||||
|
@ -74,7 +73,6 @@ export class SupportiveMaterialEditorComponent extends BaseEditor<SupportiveMate
|
||||||
private logger: LoggingService,
|
private logger: LoggingService,
|
||||||
private supportiveMaterialEditorService: SupportiveMaterialEditorService,
|
private supportiveMaterialEditorService: SupportiveMaterialEditorService,
|
||||||
private fileUtils: FileUtils,
|
private fileUtils: FileUtils,
|
||||||
private matomoService: MatomoService
|
|
||||||
) {
|
) {
|
||||||
super(dialog, language, formService, router, uiNotificationService, httpErrorHandlingService, filterService, datePipe, route, queryParamsService, lockService, authService, configurationService);
|
super(dialog, language, formService, router, uiNotificationService, httpErrorHandlingService, filterService, datePipe, route, queryParamsService, lockService, authService, configurationService);
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@ import { Router } from '@angular/router';
|
||||||
import { SupportiveMaterialFieldType } from '@app/core/common/enum/supportive-material-field-type';
|
import { SupportiveMaterialFieldType } from '@app/core/common/enum/supportive-material-field-type';
|
||||||
import { ConfigurationService } from '@app/core/services/configuration/configuration.service';
|
import { ConfigurationService } from '@app/core/services/configuration/configuration.service';
|
||||||
import { LanguageService } from '@app/core/services/language/language.service';
|
import { LanguageService } from '@app/core/services/language/language.service';
|
||||||
import { MatomoService } from '@app/core/services/matomo/matomo-service';
|
import { AnalyticsService } from '@app/core/services/matomo/analytics-service';
|
||||||
import { SupportiveMaterialService } from '@app/core/services/supportive-material/supportive-material.service';
|
import { SupportiveMaterialService } from '@app/core/services/supportive-material/supportive-material.service';
|
||||||
import { BaseComponent } from '@common/base/base.component';
|
import { BaseComponent } from '@common/base/base.component';
|
||||||
import { LangChangeEvent, TranslateService } from '@ngx-translate/core';
|
import { LangChangeEvent, TranslateService } from '@ngx-translate/core';
|
||||||
|
@ -35,14 +35,15 @@ export class UserGuideContentComponent extends BaseComponent implements OnInit {
|
||||||
private sanitizer: DomSanitizer,
|
private sanitizer: DomSanitizer,
|
||||||
private languageService: LanguageService,
|
private languageService: LanguageService,
|
||||||
private httpClient: HttpClient,
|
private httpClient: HttpClient,
|
||||||
private matomoService: MatomoService,
|
|
||||||
private configurationService: ConfigurationService,
|
private configurationService: ConfigurationService,
|
||||||
private translate: TranslateService,
|
private translate: TranslateService,
|
||||||
private router: Router
|
private router: Router,
|
||||||
|
private analyticsService: AnalyticsService,
|
||||||
) { super(); }
|
) { super(); }
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.matomoService.trackPageView('User Guide Content');
|
this.analyticsService.trackPageView(AnalyticsService.UserGuideContent);
|
||||||
|
|
||||||
this.scrollEvent = ((ev) => this.scroll(ev));
|
this.scrollEvent = ((ev) => this.scroll(ev));
|
||||||
this.tocScrollEvent = ((ev) => {
|
this.tocScrollEvent = ((ev) => {
|
||||||
this.activeToc(ev);
|
this.activeToc(ev);
|
||||||
|
|
|
@ -11,7 +11,6 @@ import { AuthService } from '@app/core/services/auth/auth.service';
|
||||||
import { ConfigurationService } from '@app/core/services/configuration/configuration.service';
|
import { ConfigurationService } from '@app/core/services/configuration/configuration.service';
|
||||||
import { CultureService } from '@app/core/services/culture/culture-service';
|
import { CultureService } from '@app/core/services/culture/culture-service';
|
||||||
import { LanguageService } from '@app/core/services/language/language.service';
|
import { LanguageService } from '@app/core/services/language/language.service';
|
||||||
import { MatomoService } from '@app/core/services/matomo/matomo-service';
|
|
||||||
import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service';
|
import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service';
|
||||||
import { UserService } from '@app/core/services/user/user.service';
|
import { UserService } from '@app/core/services/user/user.service';
|
||||||
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
|
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
|
||||||
|
@ -39,6 +38,7 @@ import { SingleAutoCompleteConfiguration } from '@app/library/auto-complete/sing
|
||||||
import { ReferenceSourceType } from '@app/core/common/enum/reference-source-type';
|
import { ReferenceSourceType } from '@app/core/common/enum/reference-source-type';
|
||||||
import { ReferenceType } from '@app/core/model/reference-type/reference-type';
|
import { ReferenceType } from '@app/core/model/reference-type/reference-type';
|
||||||
import { Tenant } from '@app/core/model/tenant/tenant';
|
import { Tenant } from '@app/core/model/tenant/tenant';
|
||||||
|
import { AnalyticsService } from '@app/core/services/matomo/analytics-service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-user-profile',
|
selector: 'app-user-profile',
|
||||||
|
@ -84,13 +84,13 @@ export class UserProfileComponent extends BaseComponent implements OnInit, OnDes
|
||||||
private dialog: MatDialog,
|
private dialog: MatDialog,
|
||||||
public enumUtils: EnumUtils,
|
public enumUtils: EnumUtils,
|
||||||
private httpClient: HttpClient,
|
private httpClient: HttpClient,
|
||||||
private matomoService: MatomoService,
|
|
||||||
private formBuilder: UntypedFormBuilder,
|
private formBuilder: UntypedFormBuilder,
|
||||||
private keycloakService: KeycloakService,
|
private keycloakService: KeycloakService,
|
||||||
private principalService: PrincipalService,
|
private principalService: PrincipalService,
|
||||||
private formService: FormService,
|
private formService: FormService,
|
||||||
private referenceService: ReferenceService,
|
private referenceService: ReferenceService,
|
||||||
private referenceTypeService: ReferenceTypeService
|
private referenceTypeService: ReferenceTypeService,
|
||||||
|
private analyticsService: AnalyticsService,
|
||||||
) {
|
) {
|
||||||
super();
|
super();
|
||||||
this.languages = this.languageService.getAvailableLanguagesCodes();
|
this.languages = this.languageService.getAvailableLanguagesCodes();
|
||||||
|
@ -118,7 +118,8 @@ export class UserProfileComponent extends BaseComponent implements OnInit, OnDes
|
||||||
this.tenantFormGroup = this.formBuilder.group({
|
this.tenantFormGroup = this.formBuilder.group({
|
||||||
tenantCode: [this.authService.selectedTenant(), [Validators.required]]
|
tenantCode: [this.authService.selectedTenant(), [Validators.required]]
|
||||||
});
|
});
|
||||||
this.matomoService.trackPageView('User Profile');
|
this.analyticsService.trackPageView(AnalyticsService.UserProfile);
|
||||||
|
|
||||||
this.organisationsSingleAutoCompleteConfiguration = this.referenceService.getSingleAutocompleteSearchConfiguration(this.referenceTypeService.getOrganizationReferenceType(), null);
|
this.organisationsSingleAutoCompleteConfiguration = this.referenceService.getSingleAutocompleteSearchConfiguration(this.referenceTypeService.getOrganizationReferenceType(), null);
|
||||||
this.route.params
|
this.route.params
|
||||||
.pipe(takeUntil(this._destroyed))
|
.pipe(takeUntil(this._destroyed))
|
||||||
|
|
|
@ -633,7 +633,9 @@
|
||||||
"CLONE": "Clone",
|
"CLONE": "Clone",
|
||||||
"DELETE": "Delete",
|
"DELETE": "Delete",
|
||||||
"DEPOSIT": "Deposit",
|
"DEPOSIT": "Deposit",
|
||||||
"EXPORT": "Export"
|
"EXPORT": "Export",
|
||||||
|
"TOGGLE-DESCENDING": "Order by ascending",
|
||||||
|
"TOGGLE-ΑSCENDING": "Order by descending"
|
||||||
},
|
},
|
||||||
"EMPTY-LIST": "Nothing here yet."
|
"EMPTY-LIST": "Nothing here yet."
|
||||||
},
|
},
|
||||||
|
@ -709,6 +711,9 @@
|
||||||
},
|
},
|
||||||
"ROLES": {
|
"ROLES": {
|
||||||
"ALL-SECTIONS": "All Sections"
|
"ALL-SECTIONS": "All Sections"
|
||||||
|
},
|
||||||
|
"INFOS": {
|
||||||
|
"UNAUTHORIZED-ORCID": "This ORCID is entered by the Plan creators, without further acknowledgement of the owner."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"DESCRIPTION-OVERVIEW": {
|
"DESCRIPTION-OVERVIEW": {
|
||||||
|
@ -759,6 +764,9 @@
|
||||||
"FINALISE-POPUP": {},
|
"FINALISE-POPUP": {},
|
||||||
"ROLES": {
|
"ROLES": {
|
||||||
"ALL-SECTIONS": "All Sections"
|
"ALL-SECTIONS": "All Sections"
|
||||||
|
},
|
||||||
|
"INFOS": {
|
||||||
|
"UNAUTHORIZED-ORCID": "This ORCID is entered by the Plan creators, without further acknowledgement of the owner."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"DESCRIPTION-LISTING": {
|
"DESCRIPTION-LISTING": {
|
||||||
|
@ -780,7 +788,9 @@
|
||||||
"EXPORT": "Export",
|
"EXPORT": "Export",
|
||||||
"INVITE-SHORT": "Invite",
|
"INVITE-SHORT": "Invite",
|
||||||
"DELETE": "Delete",
|
"DELETE": "Delete",
|
||||||
"COPY-DESCRIPTION": "Copy Description"
|
"COPY-DESCRIPTION": "Copy Description",
|
||||||
|
"TOGGLE-DESCENDING": "Order by ascending",
|
||||||
|
"TOGGLE-ΑSCENDING": "Order by descending"
|
||||||
},
|
},
|
||||||
"STATES": {
|
"STATES": {
|
||||||
"EDITED": "Edited",
|
"EDITED": "Edited",
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 230 B |
Binary file not shown.
After Width: | Height: | Size: 230 B |
|
@ -18,7 +18,6 @@ import { FilterService } from '@common/modules/text-filter/filter-service';
|
||||||
import { DatePipe } from '@angular/common';
|
import { DatePipe } from '@angular/common';
|
||||||
import { QueryParamsService } from '@app/core/services/utilities/query-params.service';
|
import { QueryParamsService } from '@app/core/services/utilities/query-params.service';
|
||||||
import { NotificationServiceEnumUtils } from '@notification-service/core/formatting/enum-utils.service';
|
import { NotificationServiceEnumUtils } from '@notification-service/core/formatting/enum-utils.service';
|
||||||
import { MatomoService } from '@app/core/services/matomo/matomo-service';
|
|
||||||
import { NotificationTemplateEditorService } from './notification-template-editor.service';
|
import { NotificationTemplateEditorService } from './notification-template-editor.service';
|
||||||
import { Guid } from '@common/types/guid';
|
import { Guid } from '@common/types/guid';
|
||||||
import { NotificationTemplateEditorResolver } from './notification-template-editor.resolver';
|
import { NotificationTemplateEditorResolver } from './notification-template-editor.resolver';
|
||||||
|
@ -37,6 +36,7 @@ import { NotificationType } from '@notification-service/core/enum/notification-t
|
||||||
import { EmailOverrideMode } from '@notification-service/core/enum/email-override-mode';
|
import { EmailOverrideMode } from '@notification-service/core/enum/email-override-mode';
|
||||||
import { NotificationDataType } from '@notification-service/core/enum/notification-data-type';
|
import { NotificationDataType } from '@notification-service/core/enum/notification-data-type';
|
||||||
import { Title } from '@angular/platform-browser';
|
import { Title } from '@angular/platform-browser';
|
||||||
|
import { AnalyticsService } from '@app/core/services/matomo/analytics-service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-notification-template-editor',
|
selector: 'app-notification-template-editor',
|
||||||
|
@ -99,8 +99,8 @@ export class NotificationTemplateEditorComponent extends BaseEditor<Notification
|
||||||
private notificationTemplateService: NotificationTemplateService,
|
private notificationTemplateService: NotificationTemplateService,
|
||||||
private notificationTemplateEditorService: NotificationTemplateEditorService,
|
private notificationTemplateEditorService: NotificationTemplateEditorService,
|
||||||
private logger: LoggingService,
|
private logger: LoggingService,
|
||||||
private matomoService: MatomoService,
|
private titleService: Title,
|
||||||
private titleService: Title
|
private analyticsService: AnalyticsService,
|
||||||
) {
|
) {
|
||||||
const descriptionLabel:string = route.snapshot.data['entity']?.notificationType;
|
const descriptionLabel:string = route.snapshot.data['entity']?.notificationType;
|
||||||
if (descriptionLabel) {
|
if (descriptionLabel) {
|
||||||
|
@ -112,7 +112,8 @@ export class NotificationTemplateEditorComponent extends BaseEditor<Notification
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
this.matomoService.trackPageView('Admin: Notification Tempplates');
|
this.analyticsService.trackPageView(AnalyticsService.NotificationTempplateEditor);
|
||||||
|
|
||||||
super.ngOnInit();
|
super.ngOnInit();
|
||||||
this.languageHttpService.query(this.languageHttpService.buildAutocompleteLookup())
|
this.languageHttpService.query(this.languageHttpService.buildAutocompleteLookup())
|
||||||
.pipe(takeUntil(this._destroyed))
|
.pipe(takeUntil(this._destroyed))
|
||||||
|
|
|
@ -76,7 +76,7 @@ public class InAppNotificationController {
|
||||||
this.censorFactory.censor(InAppNotificationCensor.class).censor(lookup.getProject(), userId);
|
this.censorFactory.censor(InAppNotificationCensor.class).censor(lookup.getProject(), userId);
|
||||||
|
|
||||||
if (userId == null) throw new MyForbiddenException(this.errors.getNonPersonPrincipal().getCode(), this.errors.getNonPersonPrincipal().getMessage());
|
if (userId == null) throw new MyForbiddenException(this.errors.getNonPersonPrincipal().getCode(), this.errors.getNonPersonPrincipal().getMessage());
|
||||||
InAppNotificationQuery query = lookup.enrich(this.queryFactory).userId(userId);
|
InAppNotificationQuery query = lookup.enrich(this.queryFactory).disableTracking().userId(userId);
|
||||||
List<InAppNotificationEntity> data = query.collectAs(lookup.getProject());
|
List<InAppNotificationEntity> data = query.collectAs(lookup.getProject());
|
||||||
List<InAppNotification> models = this.builderFactory.builder(InAppNotificationBuilder.class).build(lookup.getProject(), data);
|
List<InAppNotification> models = this.builderFactory.builder(InAppNotificationBuilder.class).build(lookup.getProject(), data);
|
||||||
long count = (lookup.getMetadata() != null && lookup.getMetadata().getCountAll()) ? query.count() : models.size();
|
long count = (lookup.getMetadata() != null && lookup.getMetadata().getCountAll()) ? query.count() : models.size();
|
||||||
|
@ -88,7 +88,7 @@ public class InAppNotificationController {
|
||||||
|
|
||||||
@GetMapping("{id}")
|
@GetMapping("{id}")
|
||||||
@Transactional
|
@Transactional
|
||||||
public InAppNotification Get(@PathVariable UUID id, FieldSet fieldSet, Locale locale) throws MyApplicationException, MyForbiddenException, MyNotFoundException, InvalidApplicationException {
|
public InAppNotification Get(@PathVariable UUID id, FieldSet fieldSet) throws MyApplicationException, MyForbiddenException, MyNotFoundException, InvalidApplicationException {
|
||||||
logger.debug(new MapLogEntry("retrieving" + InAppNotification.class.getSimpleName()).And("id", id).And("fields", fieldSet));
|
logger.debug(new MapLogEntry("retrieving" + InAppNotification.class.getSimpleName()).And("id", id).And("fields", fieldSet));
|
||||||
|
|
||||||
UUID userId = this.userScope.getUserId();
|
UUID userId = this.userScope.getUserId();
|
||||||
|
|
|
@ -64,7 +64,7 @@ public class NotificationController {
|
||||||
|
|
||||||
this.censorFactory.censor(NotificationCensor.class).censor(lookup.getProject());
|
this.censorFactory.censor(NotificationCensor.class).censor(lookup.getProject());
|
||||||
|
|
||||||
NotificationQuery query = lookup.enrich(this.queryFactory).authorize(AuthorizationFlags.OwnerOrPermission);
|
NotificationQuery query = lookup.enrich(this.queryFactory).disableTracking().authorize(AuthorizationFlags.OwnerOrPermission);
|
||||||
List<NotificationEntity> data = query.collectAs(lookup.getProject());
|
List<NotificationEntity> data = query.collectAs(lookup.getProject());
|
||||||
List<Notification> models = this.builderFactory.builder(NotificationBuilder.class).authorize(AuthorizationFlags.OwnerOrPermission).build(lookup.getProject(), data);
|
List<Notification> models = this.builderFactory.builder(NotificationBuilder.class).authorize(AuthorizationFlags.OwnerOrPermission).build(lookup.getProject(), data);
|
||||||
long count = (lookup.getMetadata() != null && lookup.getMetadata().getCountAll()) ? query.count() : models.size();
|
long count = (lookup.getMetadata() != null && lookup.getMetadata().getCountAll()) ? query.count() : models.size();
|
||||||
|
|
|
@ -65,7 +65,7 @@ public class NotificationTemplateController {
|
||||||
|
|
||||||
this.censorFactory.censor(NotificationTemplateCensor.class).censor(lookup.getProject());
|
this.censorFactory.censor(NotificationTemplateCensor.class).censor(lookup.getProject());
|
||||||
|
|
||||||
NotificationTemplateQuery query = lookup.enrich(this.queryFactory).authorize(AuthorizationFlags.OwnerOrPermission);
|
NotificationTemplateQuery query = lookup.enrich(this.queryFactory).disableTracking().authorize(AuthorizationFlags.OwnerOrPermission);
|
||||||
List<NotificationTemplateEntity> data = query.collectAs(lookup.getProject());
|
List<NotificationTemplateEntity> data = query.collectAs(lookup.getProject());
|
||||||
List<NotificationTemplate> models = this.builderFactory.builder(NotificationTemplateBuilder.class).authorize(AuthorizationFlags.OwnerOrPermission).build(lookup.getProject(), data);
|
List<NotificationTemplate> models = this.builderFactory.builder(NotificationTemplateBuilder.class).authorize(AuthorizationFlags.OwnerOrPermission).build(lookup.getProject(), data);
|
||||||
long count = (lookup.getMetadata() != null && lookup.getMetadata().getCountAll()) ? query.count() : models.size();
|
long count = (lookup.getMetadata() != null && lookup.getMetadata().getCountAll()) ? query.count() : models.size();
|
||||||
|
|
|
@ -29,18 +29,15 @@ public class PrincipalController {
|
||||||
|
|
||||||
private final CurrentPrincipalResolver currentPrincipalResolver;
|
private final CurrentPrincipalResolver currentPrincipalResolver;
|
||||||
private final AccountBuilder accountBuilder;
|
private final AccountBuilder accountBuilder;
|
||||||
private final ClaimExtractor claimExtractor;
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public PrincipalController(
|
public PrincipalController(
|
||||||
CurrentPrincipalResolver currentPrincipalResolver,
|
CurrentPrincipalResolver currentPrincipalResolver,
|
||||||
AccountBuilder accountBuilder,
|
AccountBuilder accountBuilder,
|
||||||
AuditService auditService,
|
AuditService auditService) {
|
||||||
ClaimExtractor claimExtractor) {
|
|
||||||
this.currentPrincipalResolver = currentPrincipalResolver;
|
this.currentPrincipalResolver = currentPrincipalResolver;
|
||||||
this.accountBuilder = accountBuilder;
|
this.accountBuilder = accountBuilder;
|
||||||
this.auditService = auditService;
|
this.auditService = auditService;
|
||||||
this.claimExtractor = claimExtractor;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("me")
|
@GetMapping("me")
|
||||||
|
|
|
@ -86,7 +86,7 @@ public class TenantConfigurationController {
|
||||||
|
|
||||||
this.censorFactory.censor(TenantConfigurationCensor.class).censor(lookup.getProject(), null);
|
this.censorFactory.censor(TenantConfigurationCensor.class).censor(lookup.getProject(), null);
|
||||||
|
|
||||||
TenantConfigurationQuery query = lookup.enrich(this.queryFactory).authorize(AuthorizationFlags.OwnerOrPermission);
|
TenantConfigurationQuery query = lookup.enrich(this.queryFactory).disableTracking().authorize(AuthorizationFlags.OwnerOrPermission);
|
||||||
|
|
||||||
List<TenantConfigurationEntity> data = query.collectAs(lookup.getProject());
|
List<TenantConfigurationEntity> data = query.collectAs(lookup.getProject());
|
||||||
List<TenantConfiguration> models = this.builderFactory.builder(TenantConfigurationBuilder.class).authorize(AuthorizationFlags.OwnerOrPermission).build(lookup.getProject(), data);
|
List<TenantConfiguration> models = this.builderFactory.builder(TenantConfigurationBuilder.class).authorize(AuthorizationFlags.OwnerOrPermission).build(lookup.getProject(), data);
|
||||||
|
@ -103,7 +103,7 @@ public class TenantConfigurationController {
|
||||||
|
|
||||||
this.censorFactory.censor(TenantConfigurationCensor.class).censor(fieldSet, null);
|
this.censorFactory.censor(TenantConfigurationCensor.class).censor(fieldSet, null);
|
||||||
|
|
||||||
TenantConfigurationQuery query = this.queryFactory.query(TenantConfigurationQuery.class).disableTracking()authorize(AuthorizationFlags.OwnerOrPermission).ids(id);
|
TenantConfigurationQuery query = this.queryFactory.query(TenantConfigurationQuery.class).disableTracking().authorize(AuthorizationFlags.OwnerOrPermission).ids(id);
|
||||||
TenantConfiguration model = this.builderFactory.builder(TenantConfigurationBuilder.class).authorize(AuthorizationFlags.OwnerOrPermission).build(fieldSet, query.firstAs(fieldSet));
|
TenantConfiguration model = this.builderFactory.builder(TenantConfigurationBuilder.class).authorize(AuthorizationFlags.OwnerOrPermission).build(fieldSet, query.firstAs(fieldSet));
|
||||||
if (model == null)
|
if (model == null)
|
||||||
throw new MyNotFoundException(messageSource.getMessage("General_ItemNotFound", new Object[]{id, TenantConfiguration.class.getSimpleName()}, LocaleContextHolder.getLocale()));
|
throw new MyNotFoundException(messageSource.getMessage("General_ItemNotFound", new Object[]{id, TenantConfiguration.class.getSimpleName()}, LocaleContextHolder.getLocale()));
|
||||||
|
|
|
@ -76,7 +76,7 @@ public class UserNotificationPreferenceController {
|
||||||
|
|
||||||
this.censorFactory.censor(UserNotificationPreferenceCensor.class).censor(lookup.getProject(), null);
|
this.censorFactory.censor(UserNotificationPreferenceCensor.class).censor(lookup.getProject(), null);
|
||||||
|
|
||||||
UserNotificationPreferenceQuery query = lookup.enrich(this.queryFactory);
|
UserNotificationPreferenceQuery query = lookup.enrich(this.queryFactory).disableTracking();
|
||||||
List<UserNotificationPreferenceEntity> data = query.collectAs(lookup.getProject());
|
List<UserNotificationPreferenceEntity> data = query.collectAs(lookup.getProject());
|
||||||
List<UserNotificationPreference> models = this.builderFactory.builder(UserNotificationPreferenceBuilder.class).authorize(AuthorizationFlags.OwnerOrPermission).build(lookup.getProject(), data);
|
List<UserNotificationPreference> models = this.builderFactory.builder(UserNotificationPreferenceBuilder.class).authorize(AuthorizationFlags.OwnerOrPermission).build(lookup.getProject(), data);
|
||||||
long count = (lookup.getMetadata() != null && lookup.getMetadata().getCountAll()) ? query.count() : models.size();
|
long count = (lookup.getMetadata() != null && lookup.getMetadata().getCountAll()) ? query.count() : models.size();
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-parent</artifactId>
|
<artifactId>spring-boot-starter-parent</artifactId>
|
||||||
<version>3.2.1</version>
|
<version>3.2.5</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<modules>
|
<modules>
|
||||||
|
@ -43,7 +43,7 @@
|
||||||
<groupId>org.hibernate.orm</groupId>
|
<groupId>org.hibernate.orm</groupId>
|
||||||
<artifactId>hibernate-core</artifactId>
|
<artifactId>hibernate-core</artifactId>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
<version>6.3.1.Final</version>
|
<version>6.5.2.Final</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.hibernate.orm</groupId>
|
<groupId>org.hibernate.orm</groupId>
|
||||||
|
@ -71,7 +71,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.fasterxml.jackson.datatype</groupId>
|
<groupId>com.fasterxml.jackson.datatype</groupId>
|
||||||
<artifactId>jackson-datatype-jsr310</artifactId>
|
<artifactId>jackson-datatype-jsr310</artifactId>
|
||||||
<version>2.13.3</version>
|
<version>2.17.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
|
@ -107,7 +107,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>gr.cite</groupId>
|
<groupId>gr.cite</groupId>
|
||||||
<artifactId>data-tools</artifactId>
|
<artifactId>data-tools</artifactId>
|
||||||
<version>2.1.2</version>
|
<version>2.1.4</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
|
@ -119,7 +119,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>gr.cite</groupId>
|
<groupId>gr.cite</groupId>
|
||||||
<artifactId>validation</artifactId>
|
<artifactId>validation</artifactId>
|
||||||
<version>3.0.2</version>
|
<version>3.0.3</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|
Loading…
Reference in New Issue