Merge branch 'dmp-refactoring' of https://code-repo.d4science.org/MaDgiK-CITE/argos into dmp-refactoring
This commit is contained in:
commit
2673857d74
|
@ -65,7 +65,7 @@
|
|||
<dependency>
|
||||
<groupId>gr.cite</groupId>
|
||||
<artifactId>cache</artifactId>
|
||||
<version>2.1.0</version>
|
||||
<version>2.2.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>gr.cite</groupId>
|
||||
|
|
|
@ -31,11 +31,8 @@ public class UserInterceptor implements WebRequestInterceptor {
|
|||
private final UserScope userScope;
|
||||
private final ClaimExtractor claimExtractor;
|
||||
private final CurrentPrincipalResolver currentPrincipalResolver;
|
||||
private final PlatformTransactionManager transactionManager;
|
||||
private final UserInterceptorCacheService userInterceptorCacheService;
|
||||
private final JsonHandlingService jsonHandlingService;
|
||||
private final QueryFactory queryFactory;
|
||||
private final LockByKeyManager lockByKeyManager;
|
||||
@PersistenceContext
|
||||
public EntityManager entityManager;
|
||||
|
||||
|
@ -44,19 +41,13 @@ public class UserInterceptor implements WebRequestInterceptor {
|
|||
UserScope userScope,
|
||||
ClaimExtractor claimExtractor,
|
||||
CurrentPrincipalResolver currentPrincipalResolver,
|
||||
PlatformTransactionManager transactionManager,
|
||||
UserInterceptorCacheService userInterceptorCacheService,
|
||||
JsonHandlingService jsonHandlingService,
|
||||
QueryFactory queryFactory,
|
||||
LockByKeyManager lockByKeyManager) {
|
||||
QueryFactory queryFactory) {
|
||||
this.userScope = userScope;
|
||||
this.currentPrincipalResolver = currentPrincipalResolver;
|
||||
this.claimExtractor = claimExtractor;
|
||||
this.transactionManager = transactionManager;
|
||||
this.userInterceptorCacheService = userInterceptorCacheService;
|
||||
this.jsonHandlingService = jsonHandlingService;
|
||||
this.queryFactory = queryFactory;
|
||||
this.lockByKeyManager = lockByKeyManager;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -14,7 +14,5 @@ spring:
|
|||
optional:classpath:config/tenant.yml[.yml], optional:classpath:config/tenant-${spring.profiles.active}.yml[.yml], optional:file:../config/tenant-${spring.profiles.active}.yml[.yml],
|
||||
optional:classpath:config/locale.yml[.yml], optional:classpath:config/locale-${spring.profiles.active}.yml[.yml], optional:file:../config/locale-${spring.profiles.active}.yml[.yml],
|
||||
optional:classpath:config/cors.yml[.yml], optional:classpath:config/cors-${spring.profiles.active}.yml[.yml], optional:file:../config/cors-${spring.profiles.active}.yml[.yml],
|
||||
optional:classpath:config/email.yml[.yml], optional:classpath:config/email-${spring.profiles.active}.yml[.yml], optional:file:../config/email-${spring.profiles.active}.yml[.yml],
|
||||
optional:classpath:config/queue.yml[.yml], optional:classpath:config/queue-${spring.profiles.active}.yml[.yml], optional:file:../config/queue-${spring.profiles.active}.yml[.yml],
|
||||
optional:classpath:config/cipher.yml[.yml], optional:classpath:config/cipher-${spring.profiles.active}.yml[.yml], optional:file:../config/cipher-${spring.profiles.active}.yml[.yml],
|
||||
optional:classpath:config/formatting.yml[.yml], optional:classpath:config/formatting-${spring.profiles.active}.yml[.yml], optional:file:../config/formatting-${spring.profiles.active}.yml[.yml]
|
||||
optional:classpath:config/cipher.yml[.yml], optional:classpath:config/cipher-${spring.profiles.active}.yml[.yml], optional:file:../config/cipher-${spring.profiles.active}.yml[.yml]
|
||||
|
|
|
@ -7,53 +7,32 @@ cache:
|
|||
initialCapacity: 100
|
||||
maximumSize: 500
|
||||
enableRecordStats: false
|
||||
expireAfterWriteMinutes: 10
|
||||
expireAfterAccessMinutes: 10
|
||||
refreshAfterWriteMinutes: 10
|
||||
expireAfterWriteSeconds: 600
|
||||
- names: [ tenantByCode ]
|
||||
allowNullValues: true
|
||||
initialCapacity: 100
|
||||
maximumSize: 500
|
||||
enableRecordStats: false
|
||||
expireAfterWriteMinutes: 10
|
||||
expireAfterAccessMinutes: 10
|
||||
refreshAfterWriteMinutes: 10
|
||||
expireAfterWriteSeconds: 600
|
||||
- names: [ tenantById ]
|
||||
allowNullValues: true
|
||||
initialCapacity: 100
|
||||
maximumSize: 500
|
||||
enableRecordStats: false
|
||||
expireAfterWriteMinutes: 10
|
||||
expireAfterAccessMinutes: 10
|
||||
refreshAfterWriteMinutes: 10
|
||||
expireAfterWriteSeconds: 600
|
||||
- names: [ userBySubjectId ]
|
||||
allowNullValues: true
|
||||
initialCapacity: 100
|
||||
maximumSize: 500
|
||||
enableRecordStats: false
|
||||
expireAfterWriteMinutes: 5
|
||||
expireAfterAccessMinutes: 5
|
||||
refreshAfterWriteMinutes: 5
|
||||
expireAfterWriteSeconds: 320
|
||||
- names: [ userAccessTenant ]
|
||||
allowNullValues: true
|
||||
initialCapacity: 100
|
||||
maximumSize: 500
|
||||
enableRecordStats: false
|
||||
expireAfterWriteMinutes: 5
|
||||
expireAfterAccessMinutes: 5
|
||||
refreshAfterWriteMinutes: 5
|
||||
- names: [ formattingUserProfile ]
|
||||
allowNullValues: true
|
||||
initialCapacity: 100
|
||||
maximumSize: 500
|
||||
enableRecordStats: false
|
||||
expireAfterWriteMinutes: 1
|
||||
expireAfterAccessMinutes: 1
|
||||
refreshAfterWriteMinutes: 1
|
||||
expireAfterWriteSeconds: 320
|
||||
mapCaches:
|
||||
- names: [ cacheB ]
|
||||
allowNullValues: true
|
||||
storeByValue: true
|
||||
apiKey:
|
||||
name: apikey
|
||||
keyPattern: resolve_$keyhash$:v0
|
||||
|
@ -69,9 +48,3 @@ cache:
|
|||
userAllowedTenant:
|
||||
name: userAccessTenant
|
||||
keyPattern: user_access_tenant_$user_id$_$tenant_id$:v0
|
||||
formattingUserProfileCache:
|
||||
name: formattingUserProfile
|
||||
keyPattern: formatting_user_profile$user_id$:v0
|
||||
template:
|
||||
name: template
|
||||
key-pattern: ------
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
spring:
|
||||
datasource:
|
||||
maxIdle: 10
|
||||
minIdle: 5
|
||||
maxActive: 10
|
||||
jpa:
|
||||
show-sql: true
|
||||
properties:
|
||||
hibernate:
|
||||
show_sql: true
|
||||
format_sql: false
|
|
@ -1,7 +1,11 @@
|
|||
spring:
|
||||
jpa:
|
||||
properties:
|
||||
org:
|
||||
hibernate:
|
||||
flushMode: MANUAL
|
||||
hibernate:
|
||||
globally_quoted_identifiers: true
|
||||
ddl-auto: validate
|
||||
dialect: org.hibernate.dialect.PostgreSQLDialect
|
||||
hibernate:
|
||||
|
@ -16,7 +20,7 @@ spring:
|
|||
hikari:
|
||||
connection-timeout: 30000
|
||||
minimum-idle: 3
|
||||
maximum-pool-size: 5
|
||||
maximum-pool-size: 10
|
||||
idle-timeout: 600000
|
||||
max-lifetime: 1800000
|
||||
|
||||
|
|
|
@ -1,14 +0,0 @@
|
|||
spring:
|
||||
mail:
|
||||
host: ${MAIL_HOST:}
|
||||
port: ${MAIL_PORT:}
|
||||
username: ${MAIL_USERNAME:}
|
||||
password: ${MAIL_PASSWORD:}
|
||||
properties:
|
||||
mail:
|
||||
smtp:
|
||||
auth: ${MAIL_AUTH:}
|
||||
starttls:
|
||||
enable: ${MAIL_TLS:}
|
||||
email:
|
||||
address: ${MAIL_ADDRESS:}
|
|
@ -1,6 +0,0 @@
|
|||
formatting:
|
||||
options:
|
||||
integer-format: "%,d"
|
||||
decimal-digits-round: 2
|
||||
decimal-format: "#0.00"
|
||||
date-time-format: "YYYY-MM-dd'T'HH:mm:ss"
|
|
@ -37,3 +37,5 @@ idpclient:
|
|||
- type: azp
|
||||
Authorities:
|
||||
- type: authorities
|
||||
ExternalProviderName:
|
||||
- type: identity_provider
|
|
@ -5,26 +5,26 @@ permissions:
|
|||
# Tenants
|
||||
BrowseTenant:
|
||||
roles:
|
||||
- ic-sti-superuser
|
||||
- Admin
|
||||
clients: [ ]
|
||||
allowAnonymous: false
|
||||
allowAuthenticated: false
|
||||
EditTenant:
|
||||
roles:
|
||||
- ic-sti-superuser
|
||||
- Admin
|
||||
clients: [ ]
|
||||
allowAnonymous: false
|
||||
allowAuthenticated: false
|
||||
DeleteTenant:
|
||||
roles:
|
||||
- ic-sti-superuser
|
||||
- Admin
|
||||
claims: [ ]
|
||||
clients: [ ]
|
||||
allowAnonymous: false
|
||||
allowAuthenticated: false
|
||||
AllowNoTenant:
|
||||
roles:
|
||||
- ic-sti-superuser
|
||||
- Admin
|
||||
claims: [ ]
|
||||
clients: [ ]
|
||||
allowAnonymous: false
|
||||
|
@ -32,21 +32,19 @@ permissions:
|
|||
# Users
|
||||
BrowseUser:
|
||||
roles:
|
||||
- ic-sti-superuser
|
||||
- tenantadmin
|
||||
- Admin
|
||||
clients: [ ]
|
||||
allowAnonymous: true
|
||||
allowAuthenticated: false
|
||||
EditUser:
|
||||
roles:
|
||||
- admin
|
||||
- ic-sti-superuser
|
||||
- Admin
|
||||
clients: [ ]
|
||||
allowAnonymous: false
|
||||
allowAuthenticated: false
|
||||
DeleteUser:
|
||||
roles:
|
||||
- ic-sti-superuser
|
||||
- Admin
|
||||
claims: [ ]
|
||||
clients: [ ]
|
||||
allowAnonymous: false
|
||||
|
@ -54,20 +52,19 @@ permissions:
|
|||
# UserContactInfo
|
||||
BrowseUserContactInfo:
|
||||
roles:
|
||||
- ic-sti-superuser
|
||||
- Admin
|
||||
clients: [ ]
|
||||
allowAnonymous: true
|
||||
allowAuthenticated: false
|
||||
EditUserContactInfo:
|
||||
roles:
|
||||
- ic-sti-superuser
|
||||
- user
|
||||
- Admin
|
||||
clients: [ ]
|
||||
allowAnonymous: false
|
||||
allowAuthenticated: false
|
||||
DeleteUserContactInfo:
|
||||
roles:
|
||||
- ic-sti-superuser
|
||||
- Admin
|
||||
claims: [ ]
|
||||
clients: [ ]
|
||||
allowAnonymous: false
|
||||
|
@ -94,13 +91,13 @@ permissions:
|
|||
#Tenant Configuration
|
||||
BrowseTenantConfiguration:
|
||||
roles:
|
||||
- ic-sti-superuser
|
||||
- Admin
|
||||
clients: [ ]
|
||||
allowAnonymous: false
|
||||
allowAuthenticated: false
|
||||
EditTenantConfiguration:
|
||||
roles:
|
||||
- ic-sti-superuser
|
||||
- Admin
|
||||
clients: [ ]
|
||||
allowAnonymous: false
|
||||
allowAuthenticated: false
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
web:
|
||||
security:
|
||||
idp:
|
||||
resource:
|
||||
jwt:
|
||||
audiences: [ "dmp_annotation" ]
|
|
@ -2,19 +2,13 @@ web:
|
|||
security:
|
||||
enabled: true
|
||||
authorized-endpoints: [ api ]
|
||||
allowed-endpoints: [ public, dataset, master-item, test ]
|
||||
allowed-endpoints: [ public ]
|
||||
idp:
|
||||
api-key:
|
||||
enabled: true
|
||||
authorization-header: Authorization
|
||||
client-id: ${IDP_APIKEY_CLIENT_ID}
|
||||
client-secret: ${IDP_APIKEY_CLIENT_SECRET}
|
||||
scope: ${IDP_APIKEY_SCOPE}
|
||||
enabled: false
|
||||
resource:
|
||||
token-type: JWT
|
||||
opaque:
|
||||
client-id: ${IDP_OPAQUE_CLIENT_ID}
|
||||
client-secret: ${IDP_OPAQUE_CLIENT_SECRET}
|
||||
token-type: JWT #| opaque
|
||||
jwt:
|
||||
claims: [ role, x-role ]
|
||||
issuer-uri: ${IDP_ISSUER_URI:}
|
||||
issuer-uri: ${IDP_ISSUER_URI}
|
||||
validIssuer: ${IDP_ISSUER_URI}
|
|
@ -1,3 +1,13 @@
|
|||
server:
|
||||
port: ${WEB_PORT}
|
||||
forward-headers-strategy: NONE
|
||||
tomcat:
|
||||
threads:
|
||||
max: 20
|
||||
max-connections: 10000
|
||||
|
||||
spring:
|
||||
servlet:
|
||||
multipart:
|
||||
max-file-size: 10MB
|
||||
max-request-size: 10MB
|
|
@ -1,93 +0,0 @@
|
|||
package gr.cite.annotation.cache;
|
||||
|
||||
import gr.cite.annotation.config.formatting.FormattingUserprofileCacheOptions;
|
||||
import gr.cite.annotation.event.UserTouchedEvent;
|
||||
import gr.cite.tools.cache.CacheService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.event.EventListener;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Locale;
|
||||
import java.util.UUID;
|
||||
|
||||
@Service
|
||||
public class FormattingUserprofileCacheCacheService extends CacheService<FormattingUserprofileCacheCacheService.UserFormattingProfileCacheValue> {
|
||||
|
||||
public static class UserFormattingProfileCacheValue {
|
||||
|
||||
public UserFormattingProfileCacheValue() {
|
||||
}
|
||||
|
||||
public UserFormattingProfileCacheValue(UUID userId, String zone, String culture, String language) {
|
||||
this.userId = userId;
|
||||
this.zone = zone;
|
||||
this.culture = culture;
|
||||
this.language = language;
|
||||
}
|
||||
|
||||
private UUID userId;
|
||||
private String zone;
|
||||
private String culture;
|
||||
private String language;
|
||||
|
||||
public String getZone() {
|
||||
return zone;
|
||||
}
|
||||
|
||||
public void setZone(String zone) {
|
||||
this.zone = zone;
|
||||
}
|
||||
|
||||
public String getCulture() {
|
||||
return culture;
|
||||
}
|
||||
|
||||
public void setCulture(String culture) {
|
||||
this.culture = culture;
|
||||
}
|
||||
|
||||
public String getLanguage() {
|
||||
return language;
|
||||
}
|
||||
|
||||
public void setLanguage(String language) {
|
||||
this.language = language;
|
||||
}
|
||||
|
||||
public UUID getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(UUID userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
}
|
||||
|
||||
@Autowired
|
||||
public FormattingUserprofileCacheCacheService(FormattingUserprofileCacheOptions options) {
|
||||
super(options);
|
||||
}
|
||||
|
||||
@EventListener
|
||||
public void handleUserTouchedEvent(UserTouchedEvent event) {
|
||||
if (event.getUserId() != null) this.evict(this.buildKey(event.getUserId()));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Class<UserFormattingProfileCacheValue> valueClass() {
|
||||
return UserFormattingProfileCacheValue.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String keyOf(UserFormattingProfileCacheValue value) {
|
||||
return this.buildKey(value.getUserId());
|
||||
}
|
||||
|
||||
|
||||
public String buildKey(UUID userId) {
|
||||
return this.generateKey(new HashMap<>() {{
|
||||
put("$user_id$", userId.toString().toLowerCase(Locale.ROOT));
|
||||
}});
|
||||
}
|
||||
}
|
|
@ -1,9 +0,0 @@
|
|||
package gr.cite.annotation.config.email;
|
||||
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
@EnableConfigurationProperties(EmailProperties.class)
|
||||
public class EmailConfig {
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
package gr.cite.annotation.config.email;
|
||||
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
|
||||
@ConfigurationProperties(prefix = "email")
|
||||
public class EmailProperties {
|
||||
|
||||
private final String address;
|
||||
|
||||
public EmailProperties(String address) {
|
||||
this.address = address;
|
||||
}
|
||||
|
||||
public String getAddress() {
|
||||
return address;
|
||||
}
|
||||
}
|
|
@ -1,9 +0,0 @@
|
|||
package gr.cite.annotation.config.formatting;
|
||||
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
@EnableConfigurationProperties(FormattingServiceProperties.class)
|
||||
public class FormattingServiceConfiguration {
|
||||
}
|
|
@ -1,38 +0,0 @@
|
|||
package gr.cite.annotation.config.formatting;
|
||||
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
|
||||
@ConfigurationProperties(prefix = "formatting.options")
|
||||
public class FormattingServiceProperties {
|
||||
|
||||
private final String integerFormat;
|
||||
|
||||
private final String decimalFormat;
|
||||
|
||||
private final String dateTimeFormat;
|
||||
|
||||
private final Integer decimalDigitsRound;
|
||||
|
||||
public FormattingServiceProperties(String integerFormat, String decimalFormat, String dateTimeFormat, Integer decimalDigitsRound) {
|
||||
this.integerFormat = integerFormat;
|
||||
this.decimalFormat = decimalFormat;
|
||||
this.dateTimeFormat = dateTimeFormat;
|
||||
this.decimalDigitsRound = decimalDigitsRound;
|
||||
}
|
||||
|
||||
public String getIntegerFormat() {
|
||||
return integerFormat;
|
||||
}
|
||||
|
||||
public String getDecimalFormat() {
|
||||
return decimalFormat;
|
||||
}
|
||||
|
||||
public String getDateTimeFormat() {
|
||||
return dateTimeFormat;
|
||||
}
|
||||
|
||||
public Integer getDecimalDigitsRound() {
|
||||
return decimalDigitsRound;
|
||||
}
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
package gr.cite.annotation.config.formatting;
|
||||
|
||||
import gr.cite.tools.cache.CacheOptions;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
@ConfigurationProperties(prefix = "cache.formatting-user-profile-cache")
|
||||
public class FormattingUserprofileCacheOptions extends CacheOptions {
|
||||
}
|
|
@ -1,26 +0,0 @@
|
|||
package gr.cite.annotation.service.formatting;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.util.Locale;
|
||||
import java.util.TimeZone;
|
||||
import java.util.UUID;
|
||||
|
||||
public interface FormattingService {
|
||||
|
||||
String format(int value, UUID userId, String format, Locale locale);
|
||||
|
||||
String format(int value, String format, Locale locale);
|
||||
|
||||
String format(long value, UUID userId, String format, Locale locale);
|
||||
|
||||
String format(long value, String format, Locale locale);
|
||||
|
||||
String format(double value, UUID userId, Integer decimals, String format, Locale locale);
|
||||
|
||||
String format(double value, Integer decimals, String format, Locale locale);
|
||||
|
||||
String format(Instant value, UUID userId, TimeZone timezone, String format, Locale locale);
|
||||
|
||||
String format(Instant value, TimeZone timeZone, String format, Locale locale);
|
||||
}
|
||||
|
|
@ -1,171 +0,0 @@
|
|||
package gr.cite.annotation.service.formatting;
|
||||
|
||||
import gr.cite.annotation.cache.FormattingUserprofileCacheCacheService;
|
||||
import gr.cite.annotation.config.formatting.FormattingServiceProperties;
|
||||
import gr.cite.annotation.convention.ConventionService;
|
||||
import gr.cite.annotation.locale.LocaleService;
|
||||
import gr.cite.tools.data.query.QueryFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.context.annotation.RequestScope;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.DecimalFormatSymbols;
|
||||
import java.text.NumberFormat;
|
||||
import java.time.Instant;
|
||||
import java.time.ZoneId;
|
||||
import java.time.ZoneOffset;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.time.format.FormatStyle;
|
||||
import java.util.Locale;
|
||||
import java.util.TimeZone;
|
||||
import java.util.UUID;
|
||||
|
||||
@Component
|
||||
@RequestScope
|
||||
public class FormattingServiceImpl implements FormattingService {
|
||||
|
||||
private final QueryFactory queryFactory;
|
||||
private final ConventionService conventionService;
|
||||
private final LocaleService localeService;
|
||||
private final FormattingServiceProperties properties;
|
||||
private final FormattingUserprofileCacheCacheService formattingUserprofileCacheCacheService;
|
||||
|
||||
@Autowired
|
||||
public FormattingServiceImpl(QueryFactory queryFactory,
|
||||
ConventionService conventionService,
|
||||
LocaleService localeService,
|
||||
FormattingServiceProperties properties,
|
||||
FormattingUserprofileCacheCacheService formattingUserprofileCacheCacheService
|
||||
) {
|
||||
this.queryFactory = queryFactory;
|
||||
this.conventionService = conventionService;
|
||||
this.localeService = localeService;
|
||||
this.properties = properties;
|
||||
this.formattingUserprofileCacheCacheService = formattingUserprofileCacheCacheService;
|
||||
}
|
||||
|
||||
public String format(int value, UUID userId, String format, Locale locale) {
|
||||
return this.formatNonDecimal(value, userId, format, locale);
|
||||
}
|
||||
|
||||
private String formatNonDecimal(Number value,UUID userId, String format, Locale locale) {
|
||||
Locale localeToUse = this.localeService.culture();
|
||||
if (locale != null) {
|
||||
localeToUse = locale;
|
||||
} else if (userId != null) {
|
||||
FormattingUserprofileCacheCacheService.UserFormattingProfileCacheValue profile = this.getUserProfile(userId);
|
||||
if (profile != null) {
|
||||
localeToUse = this.localeService.cultureSafe(profile.getCulture());
|
||||
}
|
||||
}
|
||||
|
||||
String formatToUse = !this.conventionService.isNullOrEmpty(format) ? format : this.properties.getIntegerFormat();
|
||||
return this.formatNonDecimal(value, formatToUse, localeToUse);
|
||||
}
|
||||
|
||||
public String format(int value, String format, Locale locale) {
|
||||
return this.formatNonDecimal(value, format, locale);
|
||||
}
|
||||
|
||||
private String formatNonDecimal(Number value, String format, Locale locale) {
|
||||
if (this.conventionService.isNullOrEmpty(format) && locale != null) return NumberFormat.getInstance(locale).format(value);
|
||||
else if (!this.conventionService.isNullOrEmpty(format) && locale == null) return String.format(format, value);
|
||||
else if (!this.conventionService.isNullOrEmpty(format) && locale != null) return String.format(locale, format, value);
|
||||
|
||||
return NumberFormat.getInstance(Locale.ROOT).format(value);
|
||||
}
|
||||
|
||||
public String format(long value, UUID userId, String format, Locale locale) {
|
||||
return this.formatNonDecimal(value, userId, format, locale);
|
||||
}
|
||||
|
||||
public String format(long value, String format, Locale locale) {
|
||||
return this.formatNonDecimal(value, format, locale);
|
||||
}
|
||||
|
||||
public String format(double value, UUID userId, Integer decimals, String format, Locale locale) {
|
||||
Locale localeToUse = this.localeService.culture();
|
||||
if (locale != null) {
|
||||
localeToUse = locale;
|
||||
} else if (userId != null) {
|
||||
FormattingUserprofileCacheCacheService.UserFormattingProfileCacheValue profile = this.getUserProfile(userId);
|
||||
if (profile != null) {
|
||||
localeToUse = this.localeService.cultureSafe(profile.getCulture());
|
||||
}
|
||||
}
|
||||
|
||||
String formatToUse = !this.conventionService.isNullOrEmpty(format) ? format : this.properties.getDecimalFormat();
|
||||
int decimalsToUse = decimals != null ? decimals : this.properties.getDecimalDigitsRound();
|
||||
return this.format(value, decimalsToUse, formatToUse, localeToUse);
|
||||
}
|
||||
|
||||
public String format(double value, Integer decimals, String format, Locale locale) {
|
||||
double val = value;
|
||||
if (decimals != null) {
|
||||
BigDecimal bd = new BigDecimal(Double.toString(value));
|
||||
bd = bd.setScale(decimals, RoundingMode.HALF_UP);
|
||||
val = bd.doubleValue();
|
||||
}
|
||||
|
||||
if (this.conventionService.isNullOrEmpty(format) && locale != null) return NumberFormat.getInstance(locale).format(val);
|
||||
else if (!this.conventionService.isNullOrEmpty(format) && locale == null) return new DecimalFormat(format).format(val);
|
||||
else if (!this.conventionService.isNullOrEmpty(format) && locale != null) return new DecimalFormat(format, new DecimalFormatSymbols(locale)).format(val);
|
||||
|
||||
return NumberFormat.getInstance(Locale.ROOT).format(val);
|
||||
}
|
||||
|
||||
public String format(Instant value, UUID userId, TimeZone timezone, String format, Locale locale) {
|
||||
FormattingUserprofileCacheCacheService.UserFormattingProfileCacheValue profile = null;
|
||||
if (userId != null && (locale == null || timezone == null)) {
|
||||
profile = this.getUserProfile(userId);
|
||||
}
|
||||
|
||||
Locale localeToUse = this.localeService.culture();
|
||||
if (locale != null) {
|
||||
localeToUse = locale;
|
||||
} else if (userId != null) {
|
||||
localeToUse = this.localeService.cultureSafe(profile.getCulture());
|
||||
}
|
||||
|
||||
TimeZone timezoneToUse = this.localeService.timezone();
|
||||
if (timezone != null) {
|
||||
timezoneToUse = timezone;
|
||||
} else if (userId != null) {
|
||||
timezoneToUse = this.localeService.timezoneSafe(profile.getZone());
|
||||
}
|
||||
|
||||
String formatToUse = !this.conventionService.isNullOrEmpty(format) ? format : this.properties.getDateTimeFormat();
|
||||
return this.format(value, timezoneToUse, formatToUse, localeToUse);
|
||||
}
|
||||
|
||||
public String format(Instant value, TimeZone timeZone, String format, Locale locale) {
|
||||
ZoneId zoneId = ZoneId.from(ZoneOffset.UTC);
|
||||
|
||||
if (timeZone != null) {
|
||||
zoneId = timeZone.toZoneId();
|
||||
}
|
||||
if (this.conventionService.isNullOrEmpty(format) && locale != null) DateTimeFormatter.ofLocalizedDateTime(FormatStyle.FULL, FormatStyle.MEDIUM).withLocale(locale).withZone(zoneId).format(value);
|
||||
else if (!this.conventionService.isNullOrEmpty(format) && locale == null) return DateTimeFormatter.ofPattern(format).withZone(zoneId).format(value);
|
||||
else if (!this.conventionService.isNullOrEmpty(format) && locale != null) return DateTimeFormatter.ofPattern(format, locale).withZone(zoneId).format(value);
|
||||
|
||||
return DateTimeFormatter.ofLocalizedDateTime(FormatStyle.FULL, FormatStyle.MEDIUM).withZone(zoneId).format(value);
|
||||
}
|
||||
|
||||
private FormattingUserprofileCacheCacheService.UserFormattingProfileCacheValue getUserProfile(UUID userId) {
|
||||
FormattingUserprofileCacheCacheService.UserFormattingProfileCacheValue cacheValue = this.formattingUserprofileCacheCacheService.lookup(this.formattingUserprofileCacheCacheService.buildKey(userId));
|
||||
if (cacheValue != null) {
|
||||
return cacheValue;
|
||||
} else {
|
||||
// UserEntity user = this.queryFactory.query(UserQuery.class).ids(userId).firstAs(new BaseFieldSet().ensure(User._culture).ensure(User._language).ensure(User._timezone).ensure(User._id));
|
||||
// if (user == null) return null;
|
||||
// cacheValue = new FormattingUserprofileCacheCacheService.UserFormattingProfileCacheValue(userId, user.getTimezone(), user.getCulture(), user.getLanguage());
|
||||
// this.formattingUserprofileCacheCacheService.put(cacheValue);
|
||||
|
||||
return cacheValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -333,7 +333,7 @@
|
|||
<dependency>
|
||||
<groupId>gr.cite</groupId>
|
||||
<artifactId>cache</artifactId>
|
||||
<version>2.1.0</version>
|
||||
<version>2.2.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
|
|
@ -5,67 +5,51 @@ cache:
|
|||
- names: [ "userBySubjectId" ]
|
||||
allowNullValues: true
|
||||
initialCapacity: 100
|
||||
maximumSize: 500
|
||||
maximumSize: 5000
|
||||
enableRecordStats: false
|
||||
expireAfterWriteMinutes: 1
|
||||
expireAfterAccessMinutes: 1
|
||||
refreshAfterWriteMinutes: 1
|
||||
expireAfterWriteSeconds: 20
|
||||
- names: [ "supportiveMaterial" ]
|
||||
allowNullValues: true
|
||||
initialCapacity: 100
|
||||
maximumSize: 500
|
||||
enableRecordStats: false
|
||||
expireAfterWriteMinutes: 10
|
||||
expireAfterAccessMinutes: 10
|
||||
refreshAfterWriteMinutes: 10
|
||||
expireAfterWriteSeconds: 600
|
||||
- names: [ "Reference" ]
|
||||
allowNullValues: true
|
||||
initialCapacity: 100
|
||||
maximumSize: 500
|
||||
enableRecordStats: false
|
||||
expireAfterWriteMinutes: 10
|
||||
expireAfterAccessMinutes: 10
|
||||
refreshAfterWriteMinutes: 10
|
||||
expireAfterWriteSeconds: 600
|
||||
- names: [ "depositConfigById" ]
|
||||
allowNullValues: true
|
||||
initialCapacity: 100
|
||||
maximumSize: 500
|
||||
enableRecordStats: false
|
||||
expireAfterWriteMinutes: 10
|
||||
expireAfterAccessMinutes: 10
|
||||
refreshAfterWriteMinutes: 10
|
||||
expireAfterWriteSeconds: 600
|
||||
- names: [ "affiliation" ]
|
||||
allowNullValues: true
|
||||
initialCapacity: 100
|
||||
maximumSize: 500
|
||||
maximumSize: 5000
|
||||
enableRecordStats: false
|
||||
expireAfterWriteMinutes: 1
|
||||
expireAfterAccessMinutes: 1
|
||||
refreshAfterWriteMinutes: 1
|
||||
expireAfterWriteSeconds: 20
|
||||
- names: [ "dashboardStatisticsByUserId" ]
|
||||
allowNullValues: true
|
||||
initialCapacity: 100
|
||||
maximumSize: 500
|
||||
enableRecordStats: false
|
||||
expireAfterWriteMinutes: 1
|
||||
expireAfterAccessMinutes: 1
|
||||
refreshAfterWriteMinutes: 1
|
||||
expireAfterWriteSeconds: 30
|
||||
- names: [ "transformer" ]
|
||||
allowNullValues: true
|
||||
initialCapacity: 100
|
||||
maximumSize: 500
|
||||
enableRecordStats: false
|
||||
expireAfterWriteMinutes: 10
|
||||
expireAfterAccessMinutes: 10
|
||||
refreshAfterWriteMinutes: 10
|
||||
expireAfterWriteSeconds: 600
|
||||
- names: [ "tokenExchangeKey" ]
|
||||
allowNullValues: true
|
||||
initialCapacity: 100
|
||||
maximumSize: 500
|
||||
enableRecordStats: false
|
||||
expireAfterWriteMinutes: 10
|
||||
expireAfterAccessMinutes: 10
|
||||
refreshAfterWriteMinutes: 10
|
||||
expireAfterWriteSeconds: 60
|
||||
mapCaches:
|
||||
userBySubjectId:
|
||||
name: userBySubjectId
|
||||
|
|
|
@ -24,8 +24,8 @@
|
|||
<button type="button" class="btn-load-more" (click)="loadLess()">{{'GENERAL.ACTIONS.LOAD-LESS' | translate}}</button>
|
||||
</div>
|
||||
<div *ngFor="let item of listingItems; let i = index">
|
||||
<app-dmp-listing-item-component *ngIf="item.dmp" [showDivider]="i != (listingItems.length - 1)" [dmp]="item.dmp" [isPublic]="isPublic"></app-dmp-listing-item-component>
|
||||
<app-description-listing-item-component *ngIf="item.description" [showDivider]="i != (listingItems.length - 1)" [description]="item.description" [isPublic]="isPublic" ></app-description-listing-item-component>
|
||||
<app-dmp-listing-item-component *ngIf="item.dmp" [showDivider]="i != (listingItems.length - 1)" [dmp]="item.dmp" [isPublic]="false"></app-dmp-listing-item-component>
|
||||
<app-description-listing-item-component *ngIf="item.description" [showDivider]="i != (listingItems.length - 1)" [description]="item.description" [isPublic]="false" ></app-description-listing-item-component>
|
||||
</div>
|
||||
<div class="text-muted d-flex justify-content-center mt-5" *ngIf="listingItems && listingItems.length > 0 && listingItems.length < pageSize">
|
||||
{{'GENERAL.ACTIONS.NO-MORE-AVAILABLE' | translate}}
|
||||
|
|
|
@ -22,6 +22,8 @@ import { ReferenceType } from '@app/core/model/reference-type/reference-type';
|
|||
import { DmpStatus } from '@app/core/common/enum/dmp-status';
|
||||
import { DescriptionStatus } from '@app/core/common/enum/description-status';
|
||||
import { IsActive } from '@app/core/common/enum/is-active.enum';
|
||||
import { AppPermission } from '@app/core/common/enum/permission.enum';
|
||||
import { DmpBlueprint, DmpBlueprintDefinition, DmpBlueprintDefinitionSection } from '@app/core/model/dmp-blueprint/dmp-blueprint';
|
||||
|
||||
@Component({
|
||||
selector: 'app-drafts',
|
||||
|
@ -135,10 +137,22 @@ export class DraftsComponent extends BaseComponent implements OnInit {
|
|||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.groupId)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.updatedAt)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.isActive)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.authorizationFlags), AppPermission.CreateNewVersionDmp].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.authorizationFlags), AppPermission.DeleteDmp].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.authorizationFlags), AppPermission.CloneDmp].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.authorizationFlags), AppPermission.FinalizeDmp].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.authorizationFlags), AppPermission.ExportDmp].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.authorizationFlags), AppPermission.InviteDmpUsers].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.authorizationFlags), AppPermission.AssignDmpUsers].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.authorizationFlags), AppPermission.EditDmp].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.descriptions), nameof<Description>(x => x.id)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.descriptions), nameof<Description>(x => x.label)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.descriptions), nameof<Description>(x => x.status)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.descriptions), nameof<Description>(x => x.isActive)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.blueprint), nameof<DmpBlueprint>(x => x.id)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.blueprint), nameof<DmpBlueprint>(x => x.label)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.blueprint), nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(x => x.id)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.blueprint), nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(x => x.label)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.dmpUsers), nameof<DmpUser>(x => x.id)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.dmpUsers), nameof<DmpUser>(x => x.user.id)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.dmpUsers), nameof<DmpUser>(x => x.role)].join('.'),
|
||||
|
@ -154,12 +168,19 @@ export class DraftsComponent extends BaseComponent implements OnInit {
|
|||
[nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.status)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.updatedAt)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.isActive)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.authorizationFlags), AppPermission.EditDescription].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.authorizationFlags), AppPermission.DeleteDescription].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.authorizationFlags), AppPermission.InviteDmpUsers].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.descriptionTemplate), nameof<DescriptionTemplate>(x => x.id)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.descriptionTemplate), nameof<DescriptionTemplate>(x => x.label)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.descriptionTemplate), nameof<DescriptionTemplate>(x => x.groupId)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.id)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.label)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.accessType)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.blueprint), nameof<DmpBlueprint>(x => x.id)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.blueprint), nameof<DmpBlueprint>(x => x.label)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.blueprint), nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(x => x.id)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.blueprint), nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(x => x.label)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.dmpUsers), nameof<DmpUser>(x => x.id)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.dmpUsers), nameof<DmpUser>(x => x.user.id)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.dmpUsers), nameof<DmpUser>(x => x.role)].join('.'),
|
||||
|
|
|
@ -26,8 +26,8 @@
|
|||
<button type="button" class="btn-load-more" (click)="loadLess()">{{'GENERAL.ACTIONS.LOAD-LESS' | translate}}</button>
|
||||
</div>
|
||||
<div *ngFor="let item of listingItems; let i = index">
|
||||
<app-dmp-listing-item-component *ngIf="item.dmp" [showDivider]="i != (listingItems.length - 1)" [dmp]="item.dmp" [isPublic]="isPublic"></app-dmp-listing-item-component>
|
||||
<app-description-listing-item-component *ngIf="item.description" [showDivider]="i != (listingItems.length - 1)" [description]="item.description" [isPublic]="isPublic" ></app-description-listing-item-component>
|
||||
<app-dmp-listing-item-component *ngIf="item.dmp" [showDivider]="i != (listingItems.length - 1)" [dmp]="item.dmp" [isPublic]="false"></app-dmp-listing-item-component>
|
||||
<app-description-listing-item-component *ngIf="item.description" [showDivider]="i != (listingItems.length - 1)" [description]="item.description" [isPublic]="false" ></app-description-listing-item-component>
|
||||
</div>
|
||||
<div class="text-muted d-flex justify-content-center mt-5" *ngIf="listingItems && listingItems.length > 0 && listingItems.length < pageSize">
|
||||
{{'GENERAL.ACTIONS.NO-MORE-AVAILABLE' | translate}}
|
||||
|
|
|
@ -5,10 +5,12 @@ import { ActivatedRoute, Router } from '@angular/router';
|
|||
import { DescriptionStatus } from '@app/core/common/enum/description-status';
|
||||
import { DmpStatus } from '@app/core/common/enum/dmp-status';
|
||||
import { IsActive } from '@app/core/common/enum/is-active.enum';
|
||||
import { AppPermission } from '@app/core/common/enum/permission.enum';
|
||||
import { RecentActivityOrder } from '@app/core/common/enum/recent-activity-order';
|
||||
import { RecentActivityItem } from '@app/core/model/dashboard/recent-activity-item';
|
||||
import { DescriptionTemplate } from '@app/core/model/description-template/description-template';
|
||||
import { Description } from '@app/core/model/description/description';
|
||||
import { DmpBlueprint, DmpBlueprintDefinition, DmpBlueprintDefinitionSection } from '@app/core/model/dmp-blueprint/dmp-blueprint';
|
||||
import { Dmp, DmpUser } from '@app/core/model/dmp/dmp';
|
||||
import { DmpReference } from '@app/core/model/dmp/dmp-reference';
|
||||
import { ReferenceType } from '@app/core/model/reference-type/reference-type';
|
||||
|
@ -134,10 +136,22 @@ export class RecentEditedActivityComponent extends BaseComponent implements OnIn
|
|||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.groupId)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.updatedAt)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.isActive)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.authorizationFlags), AppPermission.CreateNewVersionDmp].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.authorizationFlags), AppPermission.DeleteDmp].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.authorizationFlags), AppPermission.CloneDmp].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.authorizationFlags), AppPermission.FinalizeDmp].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.authorizationFlags), AppPermission.ExportDmp].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.authorizationFlags), AppPermission.InviteDmpUsers].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.authorizationFlags), AppPermission.AssignDmpUsers].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.authorizationFlags), AppPermission.EditDmp].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.descriptions), nameof<Description>(x => x.id)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.descriptions), nameof<Description>(x => x.label)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.descriptions), nameof<Description>(x => x.status)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.descriptions), nameof<Description>(x => x.isActive)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.blueprint), nameof<DmpBlueprint>(x => x.id)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.blueprint), nameof<DmpBlueprint>(x => x.label)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.blueprint), nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(x => x.id)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.blueprint), nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(x => x.label)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.dmpUsers), nameof<DmpUser>(x => x.id)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.dmpUsers), nameof<DmpUser>(x => x.user.id)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.dmpUsers), nameof<DmpUser>(x => x.role)].join('.'),
|
||||
|
@ -153,12 +167,19 @@ export class RecentEditedActivityComponent extends BaseComponent implements OnIn
|
|||
[nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.status)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.updatedAt)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.isActive)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.authorizationFlags), AppPermission.EditDescription].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.authorizationFlags), AppPermission.DeleteDescription].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.authorizationFlags), AppPermission.InviteDmpUsers].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.descriptionTemplate), nameof<DescriptionTemplate>(x => x.id)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.descriptionTemplate), nameof<DescriptionTemplate>(x => x.label)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.descriptionTemplate), nameof<DescriptionTemplate>(x => x.groupId)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.id)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.label)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.accessType)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.blueprint), nameof<DmpBlueprint>(x => x.id)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.blueprint), nameof<DmpBlueprint>(x => x.label)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.blueprint), nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(x => x.id)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.blueprint), nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(x => x.label)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.dmpUsers), nameof<DmpUser>(x => x.id)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.dmpUsers), nameof<DmpUser>(x => x.user.id)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.dmpUsers), nameof<DmpUser>(x => x.role)].join('.'),
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
<button type="button" class="btn-load-more" (click)="loadLess()">{{'GENERAL.ACTIONS.LOAD-LESS' | translate}}</button>
|
||||
</div>
|
||||
<div *ngFor="let item of listingItems; let i = index">
|
||||
<app-description-listing-item-component *ngIf="item" [showDivider]="i != (listingItems.length - 1)" [description]="item" [isPublic]="isPublic" ></app-description-listing-item-component>
|
||||
<app-description-listing-item-component *ngIf="item" [showDivider]="i != (listingItems.length - 1)" [description]="item" [isPublic]="false" ></app-description-listing-item-component>
|
||||
</div>
|
||||
<div class="text-muted d-flex justify-content-center mt-5" *ngIf="listingItems && listingItems.length > 0 && listingItems.length < pageSize">
|
||||
{{'GENERAL.ACTIONS.NO-MORE-AVAILABLE' | translate}}
|
||||
|
|
|
@ -19,6 +19,8 @@ import { BaseComponent } from '@common/base/base.component';
|
|||
import { debounceTime, takeUntil } from 'rxjs/operators';
|
||||
import { nameof } from 'ts-simple-nameof';
|
||||
import { DescriptionStatus } from '@app/core/common/enum/description-status';
|
||||
import { AppPermission } from '@app/core/common/enum/permission.enum';
|
||||
import { DmpBlueprint, DmpBlueprintDefinition, DmpBlueprintDefinitionSection } from '@app/core/model/dmp-blueprint/dmp-blueprint';
|
||||
|
||||
@Component({
|
||||
selector: 'app-recent-edited-description-activity',
|
||||
|
@ -129,12 +131,19 @@ export class RecentEditedDescriptionActivityComponent extends BaseComponent impl
|
|||
[nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.label)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.status)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.updatedAt)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.authorizationFlags), AppPermission.EditDescription].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.authorizationFlags), AppPermission.DeleteDescription].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.authorizationFlags), AppPermission.InviteDmpUsers].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.descriptionTemplate), nameof<DescriptionTemplate>(x => x.id)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.descriptionTemplate), nameof<DescriptionTemplate>(x => x.label)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.descriptionTemplate), nameof<DescriptionTemplate>(x => x.groupId)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.id)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.label)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.accessType)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.blueprint), nameof<DmpBlueprint>(x => x.id)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.blueprint), nameof<DmpBlueprint>(x => x.label)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.blueprint), nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(x => x.id)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.blueprint), nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(x => x.label)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.dmpUsers), nameof<DmpUser>(x => x.id)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.dmpUsers), nameof<DmpUser>(x => x.user.id)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.description), nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.dmpUsers), nameof<DmpUser>(x => x.role)].join('.'),
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
<button type="button" class="btn-load-more" (click)="loadLess()">{{'GENERAL.ACTIONS.LOAD-LESS' | translate}}</button> <button type="button" class="btn-load-more" (click)="loadNextOrPrevious(false)">{{'GENERAL.ACTIONS.LOAD-LESS' | translate}}</button>
|
||||
</div>
|
||||
<div *ngFor="let item of listingItems; let i = index">
|
||||
<app-dmp-listing-item-component *ngIf="item" [showDivider]="i != (listingItems.length - 1)" [dmp]="item" [isPublic]="isPublic"></app-dmp-listing-item-component>
|
||||
<app-dmp-listing-item-component *ngIf="item" [showDivider]="i != (listingItems.length - 1)" [dmp]="item" [isPublic]="false"></app-dmp-listing-item-component>
|
||||
</div>
|
||||
<!-- <div *ngFor="let activity of listingItems">
|
||||
<div class="dmp-card">
|
||||
|
|
|
@ -5,9 +5,11 @@ import { ActivatedRoute, Router } from '@angular/router';
|
|||
import { DescriptionStatus } from '@app/core/common/enum/description-status';
|
||||
import { DmpStatus } from '@app/core/common/enum/dmp-status';
|
||||
import { IsActive } from '@app/core/common/enum/is-active.enum';
|
||||
import { AppPermission } from '@app/core/common/enum/permission.enum';
|
||||
import { RecentActivityOrder } from '@app/core/common/enum/recent-activity-order';
|
||||
import { RecentActivityItem } from '@app/core/model/dashboard/recent-activity-item';
|
||||
import { Description } from '@app/core/model/description/description';
|
||||
import { DmpBlueprint, DmpBlueprintDefinition, DmpBlueprintDefinitionSection } from '@app/core/model/dmp-blueprint/dmp-blueprint';
|
||||
import { Dmp, DmpUser } from '@app/core/model/dmp/dmp';
|
||||
import { DmpReference } from '@app/core/model/dmp/dmp-reference';
|
||||
import { ReferenceType } from '@app/core/model/reference-type/reference-type';
|
||||
|
@ -138,10 +140,22 @@ export class RecentEditedDmpActivityComponent extends BaseComponent implements O
|
|||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.version)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.groupId)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.updatedAt)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.authorizationFlags), AppPermission.CreateNewVersionDmp].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.authorizationFlags), AppPermission.DeleteDmp].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.authorizationFlags), AppPermission.CloneDmp].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.authorizationFlags), AppPermission.FinalizeDmp].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.authorizationFlags), AppPermission.ExportDmp].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.authorizationFlags), AppPermission.InviteDmpUsers].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.authorizationFlags), AppPermission.AssignDmpUsers].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.authorizationFlags), AppPermission.EditDmp].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.descriptions), nameof<Description>(x => x.id)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.descriptions), nameof<Description>(x => x.label)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.descriptions), nameof<Description>(x => x.status)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.descriptions), nameof<Description>(x => x.isActive)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.blueprint), nameof<DmpBlueprint>(x => x.id)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.blueprint), nameof<DmpBlueprint>(x => x.label)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.blueprint), nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(x => x.id)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.blueprint), nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(x => x.label)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.dmpUsers), nameof<DmpUser>(x => x.id)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.dmpUsers), nameof<DmpUser>(x => x.user.id)].join('.'),
|
||||
[nameof<RecentActivityItem>(x => x.dmp), nameof<Dmp>(x => x.dmpUsers), nameof<DmpUser>(x => x.role)].join('.'),
|
||||
|
|
|
@ -110,11 +110,13 @@
|
|||
<div class="row ml-0 mr-0 mb-3">
|
||||
<span class="col-auto pl-0">{{'DMP-OVERVIEW.DOI-PROVIDED' | translate}}: </span>
|
||||
<ng-container *ngIf="selectedModel">
|
||||
<mat-select class="select-repo col" [placeholder]="selectedModel.repositoryId">
|
||||
<div class="col">
|
||||
<mat-select class="select-repo" [placeholder]="selectedModel.repositoryId">
|
||||
<mat-option *ngFor="let entityDoi of dmp.entityDois" (click)="selectDoi(entityDoi)">
|
||||
{{entityDoi.repositoryId}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</div>
|
||||
</ng-container>
|
||||
</div>
|
||||
<div class="row d-flex flex-column ml-0 mr-0 mb-3">
|
||||
|
|
|
@ -62,11 +62,7 @@
|
|||
<artifactId>oidc-authz</artifactId>
|
||||
<version>2.1.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>gr.cite</groupId>
|
||||
<artifactId>cache</artifactId>
|
||||
<version>2.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>gr.cite</groupId>
|
||||
<artifactId>exceptions-web</artifactId>
|
||||
|
|
|
@ -7,49 +7,37 @@ cache:
|
|||
initialCapacity: 100
|
||||
maximumSize: 500
|
||||
enableRecordStats: false
|
||||
expireAfterWriteMinutes: 10
|
||||
expireAfterAccessMinutes: 10
|
||||
refreshAfterWriteMinutes: 10
|
||||
expireAfterWriteSeconds: 600
|
||||
- names: [ tenantByCode ]
|
||||
allowNullValues: true
|
||||
initialCapacity: 100
|
||||
maximumSize: 500
|
||||
enableRecordStats: false
|
||||
expireAfterWriteMinutes: 10
|
||||
expireAfterAccessMinutes: 10
|
||||
refreshAfterWriteMinutes: 10
|
||||
expireAfterWriteSeconds: 600
|
||||
- names: [ tenantById ]
|
||||
allowNullValues: true
|
||||
initialCapacity: 100
|
||||
maximumSize: 500
|
||||
enableRecordStats: false
|
||||
expireAfterWriteMinutes: 10
|
||||
expireAfterAccessMinutes: 10
|
||||
refreshAfterWriteMinutes: 10
|
||||
expireAfterWriteSeconds: 600
|
||||
- names: [ userBySubjectId ]
|
||||
allowNullValues: true
|
||||
initialCapacity: 100
|
||||
maximumSize: 500
|
||||
maximumSize: 5000
|
||||
enableRecordStats: false
|
||||
expireAfterWriteMinutes: 5
|
||||
expireAfterAccessMinutes: 5
|
||||
refreshAfterWriteMinutes: 5
|
||||
expireAfterWriteSeconds: 20
|
||||
- names: [ userAccessTenant ]
|
||||
allowNullValues: true
|
||||
initialCapacity: 100
|
||||
maximumSize: 500
|
||||
enableRecordStats: false
|
||||
expireAfterWriteMinutes: 5
|
||||
expireAfterAccessMinutes: 5
|
||||
refreshAfterWriteMinutes: 5
|
||||
expireAfterWriteSeconds: 300
|
||||
- names: [ formattingUserProfile ]
|
||||
allowNullValues: true
|
||||
initialCapacity: 100
|
||||
maximumSize: 500
|
||||
enableRecordStats: false
|
||||
expireAfterWriteMinutes: 1
|
||||
expireAfterAccessMinutes: 1
|
||||
refreshAfterWriteMinutes: 1
|
||||
expireAfterWriteSeconds: 60
|
||||
mapCaches:
|
||||
- names: [ cacheB ]
|
||||
allowNullValues: true
|
||||
|
|
|
@ -149,6 +149,13 @@
|
|||
<artifactId>queue-outbox</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>gr.cite</groupId>
|
||||
<artifactId>cache</artifactId>
|
||||
<version>2.2.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<profiles>
|
||||
|
|
Loading…
Reference in New Issue