Skip to content

Commit 3fe0a28

Browse files
committed
TD-3285, vue cache storing the feature flag inconsitently, update the way its popupulting now
1 parent cb19f46 commit 3fe0a28

File tree

3 files changed

+25
-13
lines changed

3 files changed

+25
-13
lines changed

LearningHub.Nhs.WebUI/Scripts/vuesrc/contribute-resource/SelectResourceType.vue

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
</div>
66
<div class="mx-5">
77
<h3 class="nhsuk-heading-l nhsuk-u-margin-bottom-2">{{title}}</h3>
8-
<div>{{description}}</div>
8+
<div>{{description}}</div>
99
<div v-if="!contributeResourceAVFlag && title === 'File' && !isSelected" class="align-self-center">
1010
<div v-html="audioVideoUnavailableView"></div>
1111
</div>
@@ -39,7 +39,7 @@
3939
},
4040
data() {
4141
return {
42-
contributeResourceAVFlag: false
42+
contributeResourceAVFlag: true
4343
};
4444
},
4545
created() {
@@ -57,18 +57,17 @@
5757
},
5858
isSelected(): boolean {
5959
return this.resourceDetails.resourceType === this.resourceType;
60-
},
60+
},
6161
audioVideoUnavailableView(): string {
62-
var view = this.$store.state.getAVUnavailableView;
6362
return this.$store.state.getAVUnavailableView;
6463
}
6564
},
6665
methods: {
6766
getContributeResAVResourceFlag() {
68-
resourceData.getContributeAVResourceFlag().then(response => {
69-
this.contributeResourceAVFlag = response;
67+
resourceData.getContributeAVResourceFlag().then(response => {
68+
this.contributeResourceAVFlag = response;
7069
});
71-
},
70+
},
7271
getResourceTypeDescription(resourceType: ResourceType): string {
7372
switch (resourceType) {
7473
case ResourceType.ARTICLE:

LearningHub.Nhs.WebUI/Scripts/vuesrc/contribute/ContentVideo.vue

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@
105105
uploadingFile: null as File,
106106
uploadingTranscriptFile: null as File,
107107
uploadingCaptionsFile: null as File,
108+
contributeResourceAVFlag: true
108109
};
109110
},
110111
computed: {
@@ -120,15 +121,13 @@
120121
fileUpdated(): ResourceFileModel {
121122
return this.$store.state.fileUpdated;
122123
},
123-
contributeResourceAVFlag(): boolean {
124-
return this.$store.state.contributeAVResourceFlag;
125-
},
126124
audioVideoUnavailableView(): string {
127125
return this.$store.state.getAVUnavailableView;
128126
},
129127
},
130128
created() {
131129
this.setInitialValues();
130+
this.getContributeResAVResourceFlag();
132131
EventBus.$on('deleteFile', (fileTypeToBeDeleted: number) => {
133132
this.processDeleteFile(fileTypeToBeDeleted);
134133
});
@@ -142,6 +141,11 @@
142141
changeFile() {
143142
this.$emit('filechanged');
144143
},
144+
getContributeResAVResourceFlag() {
145+
resourceData.getContributeAVResourceFlag().then(response => {
146+
this.contributeResourceAVFlag = response;
147+
});
148+
},
145149
changeTranscriptFile() {
146150
$('#transcriptFileUpload').val(null);
147151
$('#transcriptFileUpload').click();

LearningHub.Nhs.WebUI/Scripts/vuesrc/contribute/GenericFileUploader.vue

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
<script lang="ts">
2323
import Vue, { PropOptions } from 'vue';
24+
import { resourceData } from '../data/resource';
2425
import { ResourceType, UploadResourceType } from '../constants';
2526
import { ContributeSettingsModel } from '../models/contribute/contributeSettingsModel';
2627
@@ -33,22 +34,30 @@
3334
data() {
3435
return {
3536
uploadResourceType: UploadResourceType,
37+
contributeResourceAVFlag: true
3638
}
3739
},
40+
created() {
41+
this.getContributeResAVResourceFlag();
42+
},
3843
computed: {
3944
contributeSettings(): ContributeSettingsModel {
4045
return this.$store.state.contributeSettings;
4146
},
4247
fileAccept(): string {
4348
return this.$store.state.resourceDetail.resourceType == ResourceType.HTML ? '.zip,.rar,.7zip' : ''
4449
},
45-
contributeResourceAVFlag(): boolean {
46-
return this.$store.state.contributeAVResourceFlag;
47-
},
4850
audioVideoUnavailableView(): string {
4951
return this.$store.state.getAVUnavailableView;
5052
},
5153
},
54+
methods: {
55+
getContributeResAVResourceFlag() {
56+
resourceData.getContributeAVResourceFlag().then(response => {
57+
this.contributeResourceAVFlag = response;
58+
});
59+
},
60+
}
5261
});
5362
</script>
5463

0 commit comments

Comments
 (0)