From 3fe0a2804d9713bc52a3fcc8efab318417a76e68 Mon Sep 17 00:00:00 2001 From: binon Date: Mon, 15 Apr 2024 13:46:24 +0100 Subject: [PATCH] TD-3285, vue cache storing the feature flag inconsitently, update the way its popupulting now --- .../contribute-resource/SelectResourceType.vue | 13 ++++++------- .../Scripts/vuesrc/contribute/ContentVideo.vue | 10 +++++++--- .../vuesrc/contribute/GenericFileUploader.vue | 15 ++++++++++++--- 3 files changed, 25 insertions(+), 13 deletions(-) diff --git a/LearningHub.Nhs.WebUI/Scripts/vuesrc/contribute-resource/SelectResourceType.vue b/LearningHub.Nhs.WebUI/Scripts/vuesrc/contribute-resource/SelectResourceType.vue index 66470779b..d43ed711a 100644 --- a/LearningHub.Nhs.WebUI/Scripts/vuesrc/contribute-resource/SelectResourceType.vue +++ b/LearningHub.Nhs.WebUI/Scripts/vuesrc/contribute-resource/SelectResourceType.vue @@ -5,7 +5,7 @@

{{title}}

-
{{description}}
+
{{description}}
@@ -39,7 +39,7 @@ }, data() { return { - contributeResourceAVFlag: false + contributeResourceAVFlag: true }; }, created() { @@ -57,18 +57,17 @@ }, isSelected(): boolean { return this.resourceDetails.resourceType === this.resourceType; - }, + }, audioVideoUnavailableView(): string { - var view = this.$store.state.getAVUnavailableView; return this.$store.state.getAVUnavailableView; } }, methods: { getContributeResAVResourceFlag() { - resourceData.getContributeAVResourceFlag().then(response => { - this.contributeResourceAVFlag = response; + resourceData.getContributeAVResourceFlag().then(response => { + this.contributeResourceAVFlag = response; }); - }, + }, getResourceTypeDescription(resourceType: ResourceType): string { switch (resourceType) { case ResourceType.ARTICLE: diff --git a/LearningHub.Nhs.WebUI/Scripts/vuesrc/contribute/ContentVideo.vue b/LearningHub.Nhs.WebUI/Scripts/vuesrc/contribute/ContentVideo.vue index 78c51e873..fd2631c6c 100644 --- a/LearningHub.Nhs.WebUI/Scripts/vuesrc/contribute/ContentVideo.vue +++ b/LearningHub.Nhs.WebUI/Scripts/vuesrc/contribute/ContentVideo.vue @@ -105,6 +105,7 @@ uploadingFile: null as File, uploadingTranscriptFile: null as File, uploadingCaptionsFile: null as File, + contributeResourceAVFlag: true }; }, computed: { @@ -120,15 +121,13 @@ fileUpdated(): ResourceFileModel { return this.$store.state.fileUpdated; }, - contributeResourceAVFlag(): boolean { - return this.$store.state.contributeAVResourceFlag; - }, audioVideoUnavailableView(): string { return this.$store.state.getAVUnavailableView; }, }, created() { this.setInitialValues(); + this.getContributeResAVResourceFlag(); EventBus.$on('deleteFile', (fileTypeToBeDeleted: number) => { this.processDeleteFile(fileTypeToBeDeleted); }); @@ -142,6 +141,11 @@ changeFile() { this.$emit('filechanged'); }, + getContributeResAVResourceFlag() { + resourceData.getContributeAVResourceFlag().then(response => { + this.contributeResourceAVFlag = response; + }); + }, changeTranscriptFile() { $('#transcriptFileUpload').val(null); $('#transcriptFileUpload').click(); diff --git a/LearningHub.Nhs.WebUI/Scripts/vuesrc/contribute/GenericFileUploader.vue b/LearningHub.Nhs.WebUI/Scripts/vuesrc/contribute/GenericFileUploader.vue index 1b2011fc1..01cab1336 100644 --- a/LearningHub.Nhs.WebUI/Scripts/vuesrc/contribute/GenericFileUploader.vue +++ b/LearningHub.Nhs.WebUI/Scripts/vuesrc/contribute/GenericFileUploader.vue @@ -21,6 +21,7 @@