Skip to content

Commit

Permalink
Fix prelive name config value (#143)
Browse files Browse the repository at this point in the history
* Fix retrieval of name for prelive environment

* Update version and fix additional variable labels

* Add service method with the declared toggle name constant
  • Loading branch information
Paul-Blanchaert authored Feb 21, 2024
1 parent 01c1259 commit f692a2f
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 12 deletions.
2 changes: 1 addition & 1 deletion app/models/FeatureToggleModel.scala
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ package object FeatureToggleModel extends Logging {
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 FEATURE_TOGGLE_DEPLOYMENT_PRELIVE_LABEL = "toggle.deploy-prelive-fn-label"
private val ACTIVATE_RULE_TAGGING = "toggle.rule-tagging"
private val PREDEFINED_TAGS_FILE = "toggle.predefined-tags-file"
private val SMUI_VERSION = "smui.version"
Expand Down
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import com.typesafe.sbt.GitBranchPrompt

name := "search-management-ui"
version := "4.0.9"
version := "4.0.10"
maintainer := "Contact productful.io <[email protected]>"

scalaVersion := "2.12.17"
Expand Down
10 changes: 5 additions & 5 deletions frontend/src/app/components/header-nav/header-nav.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@
<ng-container *ngFor="let singleDeploymentInfo of deploymentLogInfo; index as idxDeploy">
<span class="depl-info-row-instance">
<b>{{ (singleDeploymentInfo.targetSystem == 'PRELIVE' ?
featureToggleService.getSync('toggle.rule-deployment-prelive-label') :
featureToggleService.getSync('toggle.rule-deployment-label'))}}</b> deployment:</span>
featureToggleService.getSyncToggleDeploymentLabel('PRELIVE') :
featureToggleService.getSyncToggleDeploymentLabel('LIVE'))}}</b> deployment:</span>
<span class="depl-info-row-datetime"><b>{{ singleDeploymentInfo.formattedDateTime }}</b></span>
<span class="depl-info-row-result">
<b
Expand Down Expand Up @@ -164,9 +164,9 @@
</div>
</app-smui-modal>

<app-smui-modal id="confirm-publish-live" title="Confirm publish to {{ featureToggleService.getSync('toggle.rule-deployment-label') }}">
<app-smui-modal id="confirm-publish-live" title="Confirm publish to {{ featureToggleService.getSyncToggleDeploymentLabel('LIVE') }}">
<div content>
<p>Are you sure to publish current Search Rules to {{ featureToggleService.getSync('toggle.rule-deployment-label') }}?</p>
<p>Are you sure to publish current Search Rules to {{ featureToggleService.getSyncToggleDeploymentLabel('LIVE') }}?</p>
</div>
<div footer class="btn-toolbar">
<button
Expand All @@ -175,7 +175,7 @@
(click)="requestPublishRulesTxtToSolr('LIVE')"
>
<i class="fa fa-thumbs-up smui-icon"></i>
Yes, publish to {{ featureToggleService.getSync('toggle.rule-deployment-label') }}
Yes, publish to {{ featureToggleService.getSyncToggleDeploymentLabel('LIVE') }}
</button>
<button
class="btn btn-danger"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,14 @@ export class HeaderNavComponent implements OnInit {

public publishToPreliveButtonText(): string {
return this.deploymentRunningForStage === 'PRELIVE'
? 'Publishing to ' + this.featureToggleService.getSync('toggle.rule-deployment-prelive-label') + '...'
: 'Publish to ' + this.featureToggleService.getSync('toggle.rule-deployment-prelive-label') + '';
? 'Publishing to ' + this.featureToggleService.getSyncToggleDeploymentLabel('PRELIVE') + '...'
: 'Publish to ' + this.featureToggleService.getSyncToggleDeploymentLabel('PRELIVE') + '';
}

public publishToLiveButtonText(): string {
return this.deploymentRunningForStage === 'LIVE'
? 'Publishing to ' + this.featureToggleService.getSync('toggle.rule-deployment-label') + '...'
: 'Publish to ' + this.featureToggleService.getSync('toggle.rule-deployment-label') + '';
? 'Publishing to ' + this.featureToggleService.getSyncToggleDeploymentLabel('LIVE') + '...'
: 'Publish to ' + this.featureToggleService.getSyncToggleDeploymentLabel('LIVE') + '';
}

public publishSolrConfig() {
Expand Down
10 changes: 9 additions & 1 deletion frontend/src/app/services/feature-toggle.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const FEATURE_ACTIVATE_SPELLING = 'toggle.activate-spelling';
const FEATURE_ACTIVATE_EVENTHISTORY = 'toggle.activate-eventhistory';
const FEATURE_CUSTOM_UP_DOWN_MAPPINGS = 'toggle.ui-concept.custom.up-down-dropdown-mappings';
const FEATURE_TOGGLE_DEPLOYMENT_LABEL = "toggle.rule-deployment-label";
const FEATURE_TOGGLE_DEPLOYMENT_PRELIVE_LABEL = "toggle.rule-deployment-prelive-label";
const FEATURE_TOGGLE_DEPLOYMENT_PRELIVE_LABEL = "toggle.deploy-prelive-fn-label";


@Injectable({
Expand Down Expand Up @@ -90,4 +90,12 @@ export class FeatureToggleService {
}
}

getSyncToggleDeploymentLabel(stage: string): any {
const s =
(stage == 'PRELIVE') ?
FEATURE_TOGGLE_DEPLOYMENT_PRELIVE_LABEL :
FEATURE_TOGGLE_DEPLOYMENT_LABEL;
return this.getSync(s);
}

}

0 comments on commit f692a2f

Please sign in to comment.