bugfix/Web UI Props caching does not work

This commit is contained in:
Marko Milić 2023-04-04 09:02:21 +02:00
parent 193354ba54
commit 8d664b5492
3 changed files with 2 additions and 4 deletions

View File

@ -349,7 +349,6 @@ class WebUI extends MdcLoggable{
def apiDocumentation: CssSel = {
val title = "Sandbox Introduction"
val propsValue = getWebUiPropsValue("webui_sandbox_introduction", "")
val htmlDescription = if (APIUtil.glossaryDocsRequireRole){
val userId = AuthUser.getCurrentResourceUserUserId

View File

@ -37,7 +37,7 @@ object MappedWebUiPropsProvider extends WebUiPropsProvider {
// 2) Get requested + language if any
// 3) Get requested if any
// 4) Get default value
override def getWebUiPropsValue(requestedPropertyName: String, defaultValue: String): String = saveConnectorMetric {
override def getWebUiPropsValue(requestedPropertyName: String, defaultValue: String, language: String = I18NUtil.currentLocale().toString()): String = saveConnectorMetric {
import scala.concurrent.duration._
var cacheKey = (randomUUID().toString, randomUUID().toString, randomUUID().toString)
CacheKeyFromArguments.buildCacheKey {
@ -49,7 +49,6 @@ object MappedWebUiPropsProvider extends WebUiPropsProvider {
}
// In case there is a translation we must use it
val language = I18NUtil.currentLocale().toString()
val webUiPropsPropertyName = s"${brandSpecificPropertyName}_${language}"
val translatedAndOrBrandPropertyName = WebUiProps.find(By(WebUiProps.Name, webUiPropsPropertyName)).isDefined match {
case true => webUiPropsPropertyName

View File

@ -23,7 +23,7 @@ trait WebUiPropsProvider {
def delete(webUiPropsId: String):Box[Boolean]
def getWebUiPropsValue(nameOfProperty: String, defaultValue: String): String
def getWebUiPropsValue(nameOfProperty: String, defaultValue: String, language: String): String
}