From 910c56064f134a535e7c7cd9f193b6ea9b576855 Mon Sep 17 00:00:00 2001 From: "CITE\\amentis" Date: Mon, 14 Oct 2024 10:43:40 +0300 Subject: [PATCH] tenant config colors add cssOverride --- .../CssColorsTenantConfigurationEntity.java | 28 +++--------- .../CssColorsTenantConfigurationBuilder.java | 4 +- .../CssColorsTenantConfigurationPersist.java | 44 ++++--------------- .../CssColorsTenantConfiguration.java | 33 +++----------- .../TenantConfigurationServiceImpl.java | 4 +- 5 files changed, 22 insertions(+), 91 deletions(-) diff --git a/backend/core/src/main/java/org/opencdmp/commons/types/tenantconfiguration/CssColorsTenantConfigurationEntity.java b/backend/core/src/main/java/org/opencdmp/commons/types/tenantconfiguration/CssColorsTenantConfigurationEntity.java index f54090d26..c4302b5e6 100644 --- a/backend/core/src/main/java/org/opencdmp/commons/types/tenantconfiguration/CssColorsTenantConfigurationEntity.java +++ b/backend/core/src/main/java/org/opencdmp/commons/types/tenantconfiguration/CssColorsTenantConfigurationEntity.java @@ -2,9 +2,7 @@ package org.opencdmp.commons.types.tenantconfiguration; public class CssColorsTenantConfigurationEntity { private String primaryColor; - private String primaryColor2; - private String primaryColor3; - private String secondaryColor; + private String cssOverride; public String getPrimaryColor() { return primaryColor; @@ -14,27 +12,11 @@ public class CssColorsTenantConfigurationEntity { this.primaryColor = primaryColor; } - public String getPrimaryColor2() { - return primaryColor2; + public String getCssOverride() { + return cssOverride; } - public void setPrimaryColor2(String primaryColor2) { - this.primaryColor2 = primaryColor2; - } - - public String getPrimaryColor3() { - return primaryColor3; - } - - public void setPrimaryColor3(String primaryColor3) { - this.primaryColor3 = primaryColor3; - } - - public String getSecondaryColor() { - return secondaryColor; - } - - public void setSecondaryColor(String secondaryColor) { - this.secondaryColor = secondaryColor; + public void setCssOverride(String cssOverride) { + this.cssOverride = cssOverride; } } diff --git a/backend/core/src/main/java/org/opencdmp/model/builder/tenantconfiguration/CssColorsTenantConfigurationBuilder.java b/backend/core/src/main/java/org/opencdmp/model/builder/tenantconfiguration/CssColorsTenantConfigurationBuilder.java index 6a129bc97..6f93646f0 100644 --- a/backend/core/src/main/java/org/opencdmp/model/builder/tenantconfiguration/CssColorsTenantConfigurationBuilder.java +++ b/backend/core/src/main/java/org/opencdmp/model/builder/tenantconfiguration/CssColorsTenantConfigurationBuilder.java @@ -44,9 +44,7 @@ public class CssColorsTenantConfigurationBuilder extends BaseBuilder { @@ -82,14 +60,8 @@ public class CssColorsTenantConfigurationPersist { .must(() -> !this.isEmpty(item.getPrimaryColor())) .failOn(CssColorsTenantConfigurationPersist._primaryColor).failWith(messageSource.getMessage("Validation_Required", new Object[]{CssColorsTenantConfigurationPersist._primaryColor}, LocaleContextHolder.getLocale())), this.spec() - .must(() -> !this.isEmpty(item.getPrimaryColor2())) - .failOn(CssColorsTenantConfigurationPersist._primaryColor2).failWith(messageSource.getMessage("Validation_Required", new Object[]{CssColorsTenantConfigurationPersist._primaryColor2}, LocaleContextHolder.getLocale())), - this.spec() - .must(() -> !this.isEmpty(item.getPrimaryColor3())) - .failOn(CssColorsTenantConfigurationPersist._primaryColor3).failWith(messageSource.getMessage("Validation_Required", new Object[]{CssColorsTenantConfigurationPersist._primaryColor3}, LocaleContextHolder.getLocale())), - this.spec() - .must(() -> !this.isEmpty(item.getSecondaryColor())) - .failOn(CssColorsTenantConfigurationPersist._secondaryColor).failWith(messageSource.getMessage("Validation_Required", new Object[]{CssColorsTenantConfigurationPersist._secondaryColor}, LocaleContextHolder.getLocale())) + .must(() -> !this.isEmpty(item.getCssOverride())) + .failOn(CssColorsTenantConfigurationPersist._cssOverride).failWith(messageSource.getMessage("Validation_Required", new Object[]{CssColorsTenantConfigurationPersist._cssOverride}, LocaleContextHolder.getLocale())) ); } } diff --git a/backend/core/src/main/java/org/opencdmp/model/tenantconfiguration/CssColorsTenantConfiguration.java b/backend/core/src/main/java/org/opencdmp/model/tenantconfiguration/CssColorsTenantConfiguration.java index 6f748f04e..d73b5a351 100644 --- a/backend/core/src/main/java/org/opencdmp/model/tenantconfiguration/CssColorsTenantConfiguration.java +++ b/backend/core/src/main/java/org/opencdmp/model/tenantconfiguration/CssColorsTenantConfiguration.java @@ -3,12 +3,9 @@ package org.opencdmp.model.tenantconfiguration; public class CssColorsTenantConfiguration { private String primaryColor; public static final String _primaryColor = "primaryColor"; - private String primaryColor2; - public static final String _primaryColor2 = "primaryColor2"; - private String primaryColor3; - public static final String _primaryColor3 = "primaryColor3"; - private String secondaryColor; - public static final String _secondaryColor = "secondaryColor"; + + private String cssOverride; + public static final String _cssOverride = "cssOverride"; public String getPrimaryColor() { return primaryColor; @@ -18,27 +15,11 @@ public class CssColorsTenantConfiguration { this.primaryColor = primaryColor; } - public String getPrimaryColor2() { - return primaryColor2; + public String getCssOverride() { + return cssOverride; } - public void setPrimaryColor2(String primaryColor2) { - this.primaryColor2 = primaryColor2; - } - - public String getPrimaryColor3() { - return primaryColor3; - } - - public void setPrimaryColor3(String primaryColor3) { - this.primaryColor3 = primaryColor3; - } - - public String getSecondaryColor() { - return secondaryColor; - } - - public void setSecondaryColor(String secondaryColor) { - this.secondaryColor = secondaryColor; + public void setCssOverride(String cssOverride) { + this.cssOverride = cssOverride; } } diff --git a/backend/core/src/main/java/org/opencdmp/service/tenantconfiguration/TenantConfigurationServiceImpl.java b/backend/core/src/main/java/org/opencdmp/service/tenantconfiguration/TenantConfigurationServiceImpl.java index 7d8a112c5..c9c8fccbb 100644 --- a/backend/core/src/main/java/org/opencdmp/service/tenantconfiguration/TenantConfigurationServiceImpl.java +++ b/backend/core/src/main/java/org/opencdmp/service/tenantconfiguration/TenantConfigurationServiceImpl.java @@ -238,9 +238,7 @@ public class TenantConfigurationServiceImpl implements TenantConfigurationServic CssColorsTenantConfigurationEntity data = new CssColorsTenantConfigurationEntity(); if (persist == null) return data; data.setPrimaryColor(persist.getPrimaryColor()); - data.setPrimaryColor2(persist.getPrimaryColor2()); - data.setPrimaryColor3(persist.getPrimaryColor3()); - data.setSecondaryColor(persist.getSecondaryColor()); + data.setCssOverride(persist.getCssOverride()); return data; }