Skip to content

Commit bb06bcc

Browse files
authored
Merge pull request #598 from guardian/dblatcher/remove-intended-audience-feature-switch
remove feature switch and references to it
2 parents f6ad926 + 7c72ea9 commit bb06bcc

5 files changed

Lines changed: 8 additions & 24 deletions

File tree

public/components/stub-modal/stub-modal.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ <h4 class="modal-title">{{ modalTitle }}</h4>
5353
<p>Selecting commissioning info is temporarily unavailable</p>
5454
</div>
5555
</div>
56-
<div ng-if="isIntendedAudienceEnabled">
56+
<div>
5757
<div class="label-and-icon">
5858
<label for="stub_intended_audience">
5959
<span>Intended audience</span>

public/components/stub-modal/stub-modal.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,7 @@ function StubModalInstanceCtrl($rootScope, $scope, $modalInstance, $window, conf
4444

4545
$scope.$watch('stub.articleFormat', (newValue) => {
4646
$scope.stubFormat = newValue;
47-
})
48-
49-
wfPreferencesService.getPreference('featureSwitches').then((data) => {
50-
$scope.isIntendedAudienceEnabled = data.intendedAudienceColumn
51-
;})
47+
})
5248

5349
$scope.modalTitle = ({
5450
'create': `Create ${$scope.contentName}`,
@@ -182,9 +178,8 @@ function StubModalInstanceCtrl($rootScope, $scope, $modalInstance, $window, conf
182178
$scope.warningMessages = undefined
183179

184180
function updateWarnings() {
185-
$scope.warningMessages = generateErrorMessages($scope.stub, $scope.formData.audienceOption, $scope.isIntendedAudienceEnabled)
181+
$scope.warningMessages = generateErrorMessages($scope.stub, $scope.formData.audienceOption)
186182
}
187-
$scope.$watch('isIntendedAudienceEnabled', updateWarnings, true)
188183
$scope.$watch('stub', updateWarnings, true)
189184
$scope.$watch('formData.audienceOption', updateWarnings, true)
190185

public/lib/column-service.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ import moment from 'moment';
44
import { columnDefaults } from './column-defaults'
55
import startTemplate from "components/content-list-item/content-list-item-start.html";
66
import endTemplate from "components/content-list-item/content-list-item-end.html";
7-
import { getDefaultFeatureSwitchValues } from './feature-switches.ts';
8-
9-
const columnDefaultsWithoutIntendedAudience = columnDefaults.filter(column => column.name !== 'intended-audience')
107

118

129
angular.module('wfColumnService', [])
@@ -19,16 +16,15 @@ angular.module('wfColumnService', [])
1916

2017
var self = this;
2118

22-
self.availableColums = columnDefaultsWithoutIntendedAudience;
19+
self.availableColums = columnDefaults;
2320
self.contentItemTemplate;
2421

2522
self.preferencePromise = wfPreferencesService.getAllPreferences().then(function resolve(preferencesData) {
26-
var { columnConfiguration = [], featureSwitches = getDefaultFeatureSwitchValues() } = preferencesData;
23+
var { columnConfiguration = [] } = preferencesData;
2724
if (typeof columnConfiguration[0] !== "string") {
2825
return reject();
2926
} else {
30-
var shouldExcludeIntendedAudience = !featureSwitches.intendedAudienceColumn
31-
self.availableColums = shouldExcludeIntendedAudience ? columnDefaultsWithoutIntendedAudience : columnDefaults
27+
self.availableColums = columnDefaults
3228
self.columns = self.availableColums;
3329

3430
self.columns.forEach((col) => { // set all to inactive

public/lib/feature-switches.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,7 @@ type FeatureSwitch = {
66
description: string;
77
};
88

9-
const featureSwitchList: FeatureSwitch[] = [
10-
{
11-
key: "intendedAudienceColumn",
12-
defaultValue: true,
13-
description: "Show Intended Audience",
14-
},
15-
];
9+
const featureSwitchList: FeatureSwitch[] = [];
1610

1711
export const featureSwitchKeys = featureSwitchList.map(
1812
(featureSwitch) => featureSwitch.key,

public/lib/stub-form-validation.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,9 @@ const stubHasInvalidCommissionedLength = (stub: Stub) =>
3939
const generateErrorMessages = (
4040
stub: Stub,
4141
intendedAudienceOption?: string,
42-
requireIntendedAudience?: boolean,
4342
): string[] | undefined => {
4443
const errors: string[] = [];
45-
if (requireIntendedAudience && !intendedAudienceOption) {
44+
if (!intendedAudienceOption) {
4645
errors.push(MESSAGING.intendedAudienceRequired);
4746
}
4847
if (stubIsMissingRequiredLength(stub)) {

0 commit comments

Comments
 (0)