diff --git a/app/models/FeatureToggleModel.scala b/app/models/FeatureToggleModel.scala index 0780281f..3d2de0b9 100644 --- a/app/models/FeatureToggleModel.scala +++ b/app/models/FeatureToggleModel.scala @@ -54,6 +54,8 @@ package object FeatureToggleModel extends Logging { private val FEATURE_TOGGLE_RULE_DEPLOYMENT_CUSTOM_SCRIPT = "toggle.rule-deployment.custom-script" private val FEATURE_TOGGLE_RULE_DEPLOYMENT_CUSTOM_SCRIPT_SMUI2SOLR_SH_PATH = "toggle.rule-deployment.custom-script-SMUI2SOLR-SH_PATH" private val FEATURE_TOGGLE_HEADLINE = "toggle.headline" + private val FEATURE_TOGGLE_DEPLOYMENT_LABEL = "toggle.rule-deployment-label" + private val FEATURE_TOGGLE_DEPLOYMENT_PRELIVE_LABEL = "toggle.rule-deployment-prelive-label" private val ACTIVATE_RULE_TAGGING = "toggle.rule-tagging" private val PREDEFINED_TAGS_FILE = "toggle.predefined-tags-file" private val SMUI_VERSION = "smui.version" @@ -160,7 +162,11 @@ package object FeatureToggleModel extends Logging { } } ) - ) + ), + JsFeatureToggle(FEATURE_TOGGLE_DEPLOYMENT_LABEL, new JsStringFeatureToggleValue( + appConfig.getOptional[String](FEATURE_TOGGLE_DEPLOYMENT_LABEL).getOrElse("LIVE"))), + JsFeatureToggle(FEATURE_TOGGLE_DEPLOYMENT_PRELIVE_LABEL, new JsStringFeatureToggleValue( + appConfig.getOptional[String](FEATURE_TOGGLE_DEPLOYMENT_PRELIVE_LABEL).getOrElse("PRELIVE"))) ) } @@ -216,6 +222,14 @@ package object FeatureToggleModel extends Logging { appConfig.getOptional[Boolean](FEATURE_TOGGLE_RULE_DEPLOYMENT_PRE_LIVE_PRESENT).getOrElse(false) } + def getSmuiRuleDeploymentLabel: String = { + appConfig.getOptional[String](FEATURE_TOGGLE_DEPLOYMENT_LABEL).getOrElse("LIVE") + } + + def getSmuiRuleDeploymentPreliveLabel: String = { + appConfig.getOptional[String](FEATURE_TOGGLE_DEPLOYMENT_PRELIVE_LABEL).getOrElse("PRELIVE") + } + } } diff --git a/app/models/SearchManagementRepository.scala b/app/models/SearchManagementRepository.scala index 0a98be15..aa8b6771 100644 --- a/app/models/SearchManagementRepository.scala +++ b/app/models/SearchManagementRepository.scala @@ -48,17 +48,17 @@ class SearchManagementRepository @Inject()(dbapi: DBApi, toggleService: FeatureT val solrIndexIdId = SolrIndexId(solrIndexId) val inputTags = InputTag.loadAll.filter(_.solrIndexId== Option(solrIndexIdId)) if (inputTags.size > 0) { - throw new Exception("Can't delete Solr Index that has " + inputTags.size + "tags existing"); + throw new Exception("Can't delete rules collection that has " + inputTags.size + "tags existing"); } val canonicalSpellings = CanonicalSpelling.loadAllForIndex(solrIndexIdId) if (canonicalSpellings.size > 0) { - throw new Exception("Can't delete Solr Index that has " + canonicalSpellings.size + " canonical spellings existing"); + throw new Exception("Can't delete rules collection that has " + canonicalSpellings.size + " canonical spellings existing"); } val searchInputs = SearchInput.loadAllForIndex(solrIndexIdId) if (searchInputs.size > 0) { - throw new Exception("Can't delete Solr Index that has " + searchInputs.size + " inputs existing"); + throw new Exception("Can't delete rules collection that has " + searchInputs.size + " inputs existing"); } // TODO consider reconfirmation and deletion of history entries (if some exist) (see https://github.com/querqy/smui/issues/97) diff --git a/build.sbt b/build.sbt index 968d24f0..085a7ed6 100644 --- a/build.sbt +++ b/build.sbt @@ -1,7 +1,7 @@ import com.typesafe.sbt.GitBranchPrompt name := "search-management-ui" -version := "4.0.8" +version := "4.0.9" maintainer := "Contact productful.io " scalaVersion := "2.12.17" diff --git a/conf/application.conf b/conf/application.conf index 01c3b759..d5ecd582 100644 --- a/conf/application.conf +++ b/conf/application.conf @@ -89,6 +89,12 @@ toggle.rule-deployment.custom-script-SMUI2SOLR-SH_PATH=${?SMUI_TOGGLE_DEPL_CUSTO toggle.headline="Search Management UI" toggle.headline=${?SMUI_HEADLINE} +toggle.rule-deployment-label="LIVE" +toggle.rule-deployment-label=${?SMUI_TOGGLE_DEPL_NAME} + +toggle.deploy-prelive-fn-label="PRELIVE" +toggle.deploy-prelive-fn-label=${?SMUI_TOGGLE_PRELIVE_NAME} + toggle.rule-tagging=false toggle.rule-tagging=${?SMUI_RULE_TAGGING_ACTIVE} diff --git a/frontend/src/app/components/header-nav/header-nav.component.html b/frontend/src/app/components/header-nav/header-nav.component.html index 0b2734a9..be10b907 100644 --- a/frontend/src/app/components/header-nav/header-nav.component.html +++ b/frontend/src/app/components/header-nav/header-nav.component.html @@ -71,7 +71,7 @@
- In order to push the rules, please create a Solr collection first. + In order to push the rules, please create a rules collection first.
- {{ singleDeploymentInfo.targetSystem }} deployment: + + {{ (singleDeploymentInfo.targetSystem == 'PRELIVE' ? + featureToggleService.getSync('toggle.rule-deployment-prelive-label') : + featureToggleService.getSync('toggle.rule-deployment-label'))}} deployment: {{ singleDeploymentInfo.formattedDateTime }}