From 33c19c477657f90c366b93749b6117611e0301dd Mon Sep 17 00:00:00 2001 From: paulb Date: Thu, 8 Feb 2024 18:27:12 +0100 Subject: [PATCH 1/9] Implement configurable index name --- app/models/FeatureToggleModel.scala | 16 +++++++++++++++- conf/application.conf | 6 ++++++ .../header-nav/header-nav.component.html | 13 ++++++++----- .../header-nav/header-nav.component.ts | 8 ++++---- .../src/app/services/feature-toggle.service.ts | 3 +++ 5 files changed, 36 insertions(+), 10 deletions(-) diff --git a/app/models/FeatureToggleModel.scala b/app/models/FeatureToggleModel.scala index 0780281f..81941d98 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("Solr"))), + JsFeatureToggle(FEATURE_TOGGLE_DEPLOYMENT_PRELIVE_LABEL, new JsStringFeatureToggleValue( + appConfig.getOptional[String](FEATURE_TOGGLE_DEPLOYMENT_PRELIVE_LABEL).getOrElse("Solr-test"))) ) } @@ -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("Solr") + } + + def getSmuiRuleDeploymentPreliveLabel: String = { + appConfig.getOptional[String](FEATURE_TOGGLE_DEPLOYMENT_PRELIVE_LABEL).getOrElse("Solr-test") + } + } } diff --git a/conf/application.conf b/conf/application.conf index 2d99c368..21fdb1bf 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="Solr" +toggle.rule-deployment-label=${?SMUI_TOGGLE_DEPL_NAME} + +toggle.deploy-prelive-fn-label="Solr-test" +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 feccbf02..f946854c 100644 --- a/frontend/src/app/components/header-nav/header-nav.component.html +++ b/frontend/src/app/components/header-nav/header-nav.component.html @@ -76,7 +76,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 }} - +
-

Are you sure to publish current Search Rules to LIVE?

+

Are you sure to publish current Search Rules to {{ featureToggleService.getSync('toggle.rule-deployment-label') }}?