Skip to content

Commit f692a2f

Browse files
Fix prelive name config value (#143)
* Fix retrieval of name for prelive environment * Update version and fix additional variable labels * Add service method with the declared toggle name constant
1 parent 01c1259 commit f692a2f

File tree

5 files changed

+20
-12
lines changed

5 files changed

+20
-12
lines changed

app/models/FeatureToggleModel.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ package object FeatureToggleModel extends Logging {
5555
private val FEATURE_TOGGLE_RULE_DEPLOYMENT_CUSTOM_SCRIPT_SMUI2SOLR_SH_PATH = "toggle.rule-deployment.custom-script-SMUI2SOLR-SH_PATH"
5656
private val FEATURE_TOGGLE_HEADLINE = "toggle.headline"
5757
private val FEATURE_TOGGLE_DEPLOYMENT_LABEL = "toggle.rule-deployment-label"
58-
private val FEATURE_TOGGLE_DEPLOYMENT_PRELIVE_LABEL = "toggle.rule-deployment-prelive-label"
58+
private val FEATURE_TOGGLE_DEPLOYMENT_PRELIVE_LABEL = "toggle.deploy-prelive-fn-label"
5959
private val ACTIVATE_RULE_TAGGING = "toggle.rule-tagging"
6060
private val PREDEFINED_TAGS_FILE = "toggle.predefined-tags-file"
6161
private val SMUI_VERSION = "smui.version"

build.sbt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import com.typesafe.sbt.GitBranchPrompt
22

33
name := "search-management-ui"
4-
version := "4.0.9"
4+
version := "4.0.10"
55
maintainer := "Contact productful.io <hello@productful.io>"
66

77
scalaVersion := "2.12.17"

frontend/src/app/components/header-nav/header-nav.component.html

+5-5
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@
8282
<ng-container *ngFor="let singleDeploymentInfo of deploymentLogInfo; index as idxDeploy">
8383
<span class="depl-info-row-instance">
8484
<b>{{ (singleDeploymentInfo.targetSystem == 'PRELIVE' ?
85-
featureToggleService.getSync('toggle.rule-deployment-prelive-label') :
86-
featureToggleService.getSync('toggle.rule-deployment-label'))}}</b> deployment:</span>
85+
featureToggleService.getSyncToggleDeploymentLabel('PRELIVE') :
86+
featureToggleService.getSyncToggleDeploymentLabel('LIVE'))}}</b> deployment:</span>
8787
<span class="depl-info-row-datetime"><b>{{ singleDeploymentInfo.formattedDateTime }}</b></span>
8888
<span class="depl-info-row-result">
8989
<b
@@ -164,9 +164,9 @@
164164
</div>
165165
</app-smui-modal>
166166

167-
<app-smui-modal id="confirm-publish-live" title="Confirm publish to {{ featureToggleService.getSync('toggle.rule-deployment-label') }}">
167+
<app-smui-modal id="confirm-publish-live" title="Confirm publish to {{ featureToggleService.getSyncToggleDeploymentLabel('LIVE') }}">
168168
<div content>
169-
<p>Are you sure to publish current Search Rules to {{ featureToggleService.getSync('toggle.rule-deployment-label') }}?</p>
169+
<p>Are you sure to publish current Search Rules to {{ featureToggleService.getSyncToggleDeploymentLabel('LIVE') }}?</p>
170170
</div>
171171
<div footer class="btn-toolbar">
172172
<button
@@ -175,7 +175,7 @@
175175
(click)="requestPublishRulesTxtToSolr('LIVE')"
176176
>
177177
<i class="fa fa-thumbs-up smui-icon"></i>
178-
Yes, publish to {{ featureToggleService.getSync('toggle.rule-deployment-label') }}
178+
Yes, publish to {{ featureToggleService.getSyncToggleDeploymentLabel('LIVE') }}
179179
</button>
180180
<button
181181
class="btn btn-danger"

frontend/src/app/components/header-nav/header-nav.component.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -103,14 +103,14 @@ export class HeaderNavComponent implements OnInit {
103103

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

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

116116
public publishSolrConfig() {

frontend/src/app/services/feature-toggle.service.ts

+9-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const FEATURE_ACTIVATE_SPELLING = 'toggle.activate-spelling';
1010
const FEATURE_ACTIVATE_EVENTHISTORY = 'toggle.activate-eventhistory';
1111
const FEATURE_CUSTOM_UP_DOWN_MAPPINGS = 'toggle.ui-concept.custom.up-down-dropdown-mappings';
1212
const FEATURE_TOGGLE_DEPLOYMENT_LABEL = "toggle.rule-deployment-label";
13-
const FEATURE_TOGGLE_DEPLOYMENT_PRELIVE_LABEL = "toggle.rule-deployment-prelive-label";
13+
const FEATURE_TOGGLE_DEPLOYMENT_PRELIVE_LABEL = "toggle.deploy-prelive-fn-label";
1414

1515

1616
@Injectable({
@@ -90,4 +90,12 @@ export class FeatureToggleService {
9090
}
9191
}
9292

93+
getSyncToggleDeploymentLabel(stage: string): any {
94+
const s =
95+
(stage == 'PRELIVE') ?
96+
FEATURE_TOGGLE_DEPLOYMENT_PRELIVE_LABEL :
97+
FEATURE_TOGGLE_DEPLOYMENT_LABEL;
98+
return this.getSync(s);
99+
}
100+
93101
}

0 commit comments

Comments
 (0)