Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove voiceover from exp schema #20675

Draft
wants to merge 39 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
f003882
Adds conversions function for exploration migration.
Nik-09 Apr 19, 2024
71a0266
Removes recorded voiceover fields from exploration states backend
Nik-09 Apr 22, 2024
d000747
Merge branch 'develop' of https://github.com/oppia/oppia into remove_…
Nik-09 Jun 8, 2024
68b14ad
Merge branch 'develop' of https://github.com/oppia/oppia into remove_…
Nik-09 Jun 9, 2024
a930682
Fixes merge conflict
Nik-09 Jul 8, 2024
17f95f4
Removed recorded voiceover from exploration
Nik-09 Jul 9, 2024
d9e5a91
Removes feature flag
Nik-09 Jul 9, 2024
2214f8b
Removes voice artist models and UI
Nik-09 Jul 10, 2024
7f21430
Removes audio translation service files and uses.
Nik-09 Jul 14, 2024
d62e948
Fixes merge conflict
Nik-09 Jul 15, 2024
e7a8ac4
Fixes backend tests
Nik-09 Jul 15, 2024
16eacbc
Fixes backend tests
Nik-09 Jul 15, 2024
9fb7eca
Merge branch 'develop' of https://github.com/oppia/oppia into remove_…
Nik-09 Jul 16, 2024
49380f3
Fixes frontend tests
Nik-09 Jul 21, 2024
439c490
Fixes merge conflict and frontend test
Nik-09 Jul 29, 2024
79c333b
Fixes frontend tests
Nik-09 Jul 29, 2024
7de0993
Fixes frontend tests
Nik-09 Aug 1, 2024
a348168
Merge branch 'develop' of https://github.com/oppia/oppia into remove_…
Nik-09 Aug 1, 2024
827700f
Fixes lint issues
Nik-09 Aug 1, 2024
789cb77
Fixes lint issues
Nik-09 Aug 3, 2024
7519f17
Merge branch 'develop' of https://github.com/oppia/oppia into remove_…
Nik-09 Aug 3, 2024
77ce7d1
Fixes merge conflict
Nik-09 Aug 7, 2024
23661e3
Fixes typescript checks
Nik-09 Aug 8, 2024
ff67301
Fixes merge conflict
Nik-09 Aug 18, 2024
4acb589
Merge branch 'develop' of https://github.com/oppia/oppia into remove_…
Nik-09 Sep 4, 2024
8072d16
Merge branch 'develop' of https://github.com/oppia/oppia into remove_…
Nik-09 Sep 21, 2024
3ea710d
Fixes frontend tests
Nik-09 Sep 23, 2024
a06d486
Fixes merge conflicts
Nik-09 Sep 30, 2024
c8a2218
Merge branch 'develop' of https://github.com/oppia/oppia into remove_…
Nik-09 Oct 7, 2024
7f34239
Fixes merge conflict
Nik-09 Oct 30, 2024
11942df
Merge branch 'develop' of https://github.com/oppia/oppia into remove_…
Nik-09 Nov 2, 2024
e89e16c
Fixes frontend tests
Nik-09 Nov 7, 2024
a8ab730
Fixes merge conflict
Nik-09 Nov 11, 2024
fc155ba
Reverts unnecessary changes.
Nik-09 Nov 24, 2024
bd34115
Merge branch 'develop' of https://github.com/oppia/oppia into remove_…
Nik-09 Nov 24, 2024
95d39fa
Merge branch 'develop' of https://github.com/oppia/oppia into remove_…
Nik-09 Dec 1, 2024
c49c609
Fixes backend and lint checks
Nik-09 Dec 1, 2024
a87e250
Fixes merge conflict
Nik-09 Dec 10, 2024
446684c
Merge branch 'develop' into remove_voiceover_from_exp_schema
seanlip Dec 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Removes feature flag
  • Loading branch information
Nik-09 committed Jul 9, 2024
commit d9e5a915549dc4470f4e456019e997f2c9572491
17 changes: 2 additions & 15 deletions core/domain/exp_services.py
Original file line number Diff line number Diff line change
Expand Up @@ -2853,22 +2853,9 @@ def is_voiceover_change_list(
bool. Whether the change_list contains only the changes which are
allowed for voice artist to do.
"""
voiceover_with_accent_feature_is_enabled = (
feature_flag_services.is_feature_flag_enabled(
feature_flag_list.FeatureNames.ADD_VOICEOVER_WITH_ACCENT.value,
None)
)

for change in change_list:
if voiceover_with_accent_feature_is_enabled:
if change.cmd != exp_domain.CMD_UPDATE_VOICEOVERS:
return False
else:
if (
change.property_name !=
exp_domain.STATE_PROPERTY_RECORDED_VOICEOVERS
):
return False
if change.cmd != exp_domain.CMD_UPDATE_VOICEOVERS:
return False
return True


Expand Down
2 changes: 0 additions & 2 deletions core/domain/exp_services_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1290,8 +1290,6 @@ def test_is_voiceover_change_list(self) -> None:
self.assertFalse(
exp_services.is_voiceover_change_list(not_voiceover_change_list))

@test_utils.enable_feature_flags(
[feature_flag_list.FeatureNames.ADD_VOICEOVER_WITH_ACCENT])
def test_changes_in_voiceover_list_with_feature_flag_enabled(self) -> None:
not_voiceover_change_list = [exp_domain.ExplorationChange({
'cmd': 'edit_exploration_property',
Expand Down
7 changes: 0 additions & 7 deletions core/domain/voiceover_services.py
Original file line number Diff line number Diff line change
Expand Up @@ -734,13 +734,6 @@ def update_exploration_voice_artist_link_model(
updated_exploration: Exploration. An instance of exploration class
representing the latest version.
"""

if not feature_flag_services.is_feature_flag_enabled(
feature_flag_list.FeatureNames.
AUTO_UPDATE_EXP_VOICE_ARTIST_LINK.value,
None):
return

is_voiceover_changes_made: bool = False
for change in change_list:
if (
Expand Down
28 changes: 0 additions & 28 deletions core/feature_flag_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,7 @@ class FeatureNames(enum.Enum):
IS_IMPROVEMENTS_TAB_ENABLED = 'is_improvements_tab_enabled'
LEARNER_GROUPS_ARE_ENABLED = 'learner_groups_are_enabled'
NEW_LESSON_PLAYER = 'new_lesson_player'
ADD_VOICEOVER_WITH_ACCENT = 'add_voiceover_with_accent'
CD_ALLOW_UNDOING_TRANSLATION_REVIEW = 'cd_allow_undoing_translation_review'
ENABLE_VOICEOVER_CONTRIBUTION = 'enable_voiceover_contribution'
AUTO_UPDATE_EXP_VOICE_ARTIST_LINK = 'auto_update_exp_voice_artist_link'
EXPLORATION_EDITOR_CAN_MODIFY_TRANSLATIONS = (
'exploration_editor_can_modify_translations')
EXPLORATION_EDITOR_CAN_TAG_MISCONCEPTIONS = (
Expand Down Expand Up @@ -96,8 +93,6 @@ class FeatureNames(enum.Enum):
FeatureNames.DIAGNOSTIC_TEST,
FeatureNames.SERIAL_CHAPTER_LAUNCH_LEARNER_VIEW,
FeatureNames.CD_ALLOW_UNDOING_TRANSLATION_REVIEW,
FeatureNames.AUTO_UPDATE_EXP_VOICE_ARTIST_LINK,
FeatureNames.ADD_VOICEOVER_WITH_ACCENT,
FeatureNames.EXPLORATION_EDITOR_CAN_MODIFY_TRANSLATIONS,
FeatureNames.ENABLE_MULTIPLE_CLASSROOMS,
]
Expand All @@ -110,7 +105,6 @@ class FeatureNames(enum.Enum):
FeatureNames.CHECKPOINT_CELEBRATION,
FeatureNames.IS_IMPROVEMENTS_TAB_ENABLED,
FeatureNames.LEARNER_GROUPS_ARE_ENABLED,
FeatureNames.ENABLE_VOICEOVER_CONTRIBUTION,
]

# Names of features that should not be used anymore, e.g. features that are
Expand Down Expand Up @@ -206,35 +200,13 @@ class FeatureNames(enum.Enum):
feature_flag_domain.ServerMode.DEV
)
),
FeatureNames.ADD_VOICEOVER_WITH_ACCENT.value: (
(
'The flag allows voice artists to add voiceovers in a specific '
'accent for the given language.',
feature_flag_domain.ServerMode.TEST
)
),
FeatureNames.CD_ALLOW_UNDOING_TRANSLATION_REVIEW.value: (
(
'This flag allows translation reviewers to undo translation '
'suggestion review on the contributor dashboard.',
feature_flag_domain.ServerMode.TEST
)
),
FeatureNames.ENABLE_VOICEOVER_CONTRIBUTION.value: (
(
'The flag controls whether voiceover contributions from the '
'voiceover tab of the exploration editor page is enabled or '
'disabled during voiceover migration.',
feature_flag_domain.ServerMode.PROD
)
),
FeatureNames.AUTO_UPDATE_EXP_VOICE_ARTIST_LINK.value: (
(
'The flag allows auto-updating of the exploration voice artists '
'link model after an exploration update.',
feature_flag_domain.ServerMode.TEST
)
),
FeatureNames.EXPLORATION_EDITOR_CAN_MODIFY_TRANSLATIONS.value: (
(
'This flag allows exploration editors to promptly update '
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,7 @@ export enum FeatureNames {
LearnerGroupsAreEnabled = 'learner_groups_are_enabled',
CdAdminDashboardNewUi = 'cd_admin_dashboard_new_ui',
NewLessonPlayer = 'new_lesson_player',
AddVoiceoverWithAccent = 'add_voiceover_with_accent',
CdAllowUndoingTranslationReview = 'cd_allow_undoing_translation_review',
EnableVoiceoverContribution = 'enable_voiceover_contribution',
AutoUpdateExpVoiceArtistLink = 'auto_update_exp_voice_artist_link',
ExplorationEditorCanModifyTranslations = 'exploration_editor_can_modify_translations',
ExplorationEditorCanTagMisconceptions = 'exploration_editor_can_tag_misconceptions',
EnableMultipleClassrooms = 'enable_multiple_classrooms',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,13 +151,7 @@ export class TranslationStatusService implements OnInit {
if (this.translationTabActiveModeService.isTranslationModeActive()) {
return this._getTranslationStatus(contentId);
} else {
if (this.platformFeatureService.status.AddVoiceoverWithAccent.isEnabled) {
return this._getEntityVoiceoverStatus(contentId);
}
this.langCode = this.translationLanguageService.getActiveLanguageCode();
let recordedVoiceovers =
this.explorationStatesService.getRecordedVoiceoversMemento(stateName);
return this._getVoiceOverStatus(recordedVoiceovers, contentId);
return this._getEntityVoiceoverStatus(contentId);
}
}

Expand All @@ -167,11 +161,7 @@ export class TranslationStatusService implements OnInit {
if (this.translationTabActiveModeService.isTranslationModeActive()) {
return this._getTranslationStatus(contentId);
} else {
if (this.platformFeatureService.status.AddVoiceoverWithAccent.isEnabled) {
return this._getEntityVoiceoverStatus(contentId);
}
let recordedVoiceovers = this.stateRecordedVoiceoversService.displayed;
return this._getVoiceOverStatus(recordedVoiceovers, contentId);
return this._getEntityVoiceoverStatus(contentId);
}
}

Expand Down Expand Up @@ -282,10 +272,7 @@ export class TranslationStatusService implements OnInit {
);
}

if (
this.translationTabActiveModeService.isVoiceoverModeActive() &&
this.platformFeatureService.status.AddVoiceoverWithAccent.isEnabled
) {
if (this.translationTabActiveModeService.isVoiceoverModeActive()) {
this.stateWiseStatusColor[stateName] =
this.getStateGraphColorInVoiceoverMode(
allContentIds,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -361,15 +361,8 @@ <h3 tabindex="0">Content</h3>
<div joyrideStep="translationTabReRecordingOverview" [stepContent]="TranslationTabReRecordingOverview"></div>
<div joyrideStep="translationTabTutorialComplete" [stepContent]="TranslationTabTutorialComplete"></div>
<div *ngIf="isVoiceoverModeActive()" id="tutorialTranslationAudioBar" class="oppia-audio-translation-bar">
<div *ngIf="!isVoiceoverContributionEnabled()">
<p class="voiceover-disabled-text-class">
The functionality for adding voiceovers is temporarily disabled due to maintenance. Try again later.
</p>
</div>
<div *ngIf="isVoiceoverContributionEnabled()">
<oppia-audio-translation-bar *ngIf="!isVoiceoverContributionWithAccentEnabled()" [isTranslationTabBusy]="isTranslationTabBusy">
</oppia-audio-translation-bar>
<oppia-voiceover-card *ngIf="isVoiceoverContributionWithAccentEnabled()"></oppia-voiceover-card>
<div>
<oppia-voiceover-card></oppia-voiceover-card>
</div>
</div>
<div *ngIf="!isVoiceoverModeActive()">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,6 @@ export class StateTranslationComponent implements OnInit, OnDestroy {
return this.translationTabActiveModeService.isVoiceoverModeActive();
}

isVoiceoverContributionEnabled(): boolean {
return this.platformFeatureService.status.EnableVoiceoverContribution
.isEnabled;
}

isVoiceoverContributionWithAccentEnabled(): boolean {
return this.platformFeatureService.status.AddVoiceoverWithAccent.isEnabled;
}

getRequiredHtml(subtitledHtml: SubtitledHtml): string {
if (this.translationTabActiveModeService.isTranslationModeActive()) {
return subtitledHtml.html;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<div class="oppia-translator-overview">
<div>
<div id="tutorialTranslationLanguage" *ngIf="inTranslationMode || !isVoiceoverContributionWithAccentEnabled()">
<div id="tutorialTranslationLanguage" *ngIf="inTranslationMode">
<span class="e2e-test-language-selector-label oppia-language-selector-label">
<strong>
<span *ngIf="inVoiceoverMode">Voiceovers</span>
<span *ngIf="inTranslationMode">Translations</span> for language:
</strong>
</span>
Expand All @@ -17,7 +16,7 @@
</option>
</select>
</div>
<div *ngIf="isVoiceoverContributionWithAccentEnabled() && inVoiceoverMode">
<div *ngIf="inVoiceoverMode">
<div class="language-selector-container">
<span class="language-selector-text">
<strong>Voiceover Language Code: </strong>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,6 @@ export class TranslatorOverviewComponent implements OnInit {
);
}

isVoiceoverContributionWithAccentEnabled(): boolean {
return this.platformFeatureService.status.AddVoiceoverWithAccent.isEnabled;
}

changeActiveMode(modeName: string): void {
if (modeName === this.VOICEOVER_MODE) {
this.translationTabActiveModeService.activateVoiceoverMode();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,7 @@
<span class="audio-controls-message">&zwnj;</span>
</div>
<div class="oppia-audio-header-select"
*ngIf="!isVoiceoverContributionWithAccentEnabled()">
<select class="audio-language-select e2e-test-audio-lang-select"
[(ngModel)]="selectedLanguage.value"
(change)="onNewLanguageSelected()">
<option *ngFor="let opt of languagesInExploration" [value]="opt.value">{{ opt.displayed }}</option>
</select>
</div>
<div class="oppia-audio-header-select"
*ngIf="isVoiceoverContributionWithAccentEnabled() && languageAccentDecriptions.length > 0">
*ngIf="languageAccentDecriptions.length > 0">
<select class="audio-language-select e2e-test-audio-lang-select"
[(ngModel)]="selectedLanguageAccentDescription"
(change)="updateSelectedLanguageAccent()">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,7 @@ export class AudioBarComponent {
}

isAudioBarAvailable(): boolean {
if (this.isVoiceoverContributionWithAccentEnabled()) {
return this.languageAccentDecriptions.length > 0;
}
return this.languagesInExploration.length > 0;
return this.languageAccentDecriptions.length > 0;
}

isLanguageRTL(): boolean {
Expand Down Expand Up @@ -207,10 +204,6 @@ export class AudioBarComponent {
return this.audioTranslationLanguageService.getCurrentAudioLanguageDescription();
}

isVoiceoverContributionWithAccentEnabled(): boolean {
return this.platformFeatureService.status.AddVoiceoverWithAccent.isEnabled;
}

// Returns null if the audio is not available in the current language.
getVoiceoverInCurrentLanguage(): Voiceover | null {
const currentAudioLanguageCode = this.getCurrentAudioLanguageCode();
Expand All @@ -230,13 +223,7 @@ export class AudioBarComponent {
}

isAudioAvailableInCurrentLanguage(): boolean {
if (this.isVoiceoverContributionWithAccentEnabled()) {
return this.voiceoverToBePlayed !== undefined;
}
return (
Boolean(this.getVoiceoverInCurrentLanguage()) ||
this.isAutogeneratedLanguageCodeSelected()
);
return this.voiceoverToBePlayed !== undefined;
}

doesCurrentAudioTranslationNeedUpdate(): boolean {
Expand Down Expand Up @@ -300,10 +287,8 @@ export class AudioBarComponent {
onPlayButtonClicked(): void {
this.isPaused = !this.isPaused;

if (this.isVoiceoverContributionWithAccentEnabled()) {
if (this.voiceoverToBePlayed) {
this.playPauseUploadedAudioTranslation();
}
if (this.voiceoverToBePlayed) {
this.playPauseUploadedAudioTranslation();
}
this.progressBarIsShown = !this.isAutogeneratedLanguageCodeSelected();
if (this.isAutogeneratedLanguageCodeSelected()) {
Expand Down Expand Up @@ -398,11 +383,8 @@ export class AudioBarComponent {

loadAndPlayAudioTranslation(): void {
this.audioLoadingIndicatorIsShown = true;
let audioTranslation = this.getVoiceoverInCurrentLanguage();

if (this.isVoiceoverContributionWithAccentEnabled()) {
audioTranslation = this.voiceoverToBePlayed;
}
let audioTranslation = this.voiceoverToBePlayed;

if (audioTranslation) {
this.audioPreloaderService.setMostRecentlyRequestedAudioFilename(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,46 +94,38 @@ export class ContentLanguageSelectorComponent implements OnInit {
}
}

if (this.isVoiceoverContributionWithAccentEnabled()) {
this.voiceoverBackendApiService
.fetchVoiceoverAdminDataAsync()
.then(response => {
this.voiceoverPlayerService.languageAccentMasterList =
response.languageAccentMasterList;
this.voiceoverPlayerService.languageCodesMapping =
response.languageCodesMapping;

this.audioTranslationLanguageService.setCurrentAudioLanguageCode(
this.selectedLanguageCode
);

this.voiceoverPlayerService.setLanguageAccentCodesDescriptions(
this.selectedLanguageCode,
this.entityVoiceoversService.getLanguageAccentCodes()
);

this.audioPreloaderService.kickOffAudioPreloader(
this.playerPositionService.getCurrentStateName()
);
});
}
}

isVoiceoverContributionWithAccentEnabled(): boolean {
return this.platformFeatureService.status.AddVoiceoverWithAccent.isEnabled;
}

onSelectLanguage(newLanguageCode: string): void {
if (this.isVoiceoverContributionWithAccentEnabled()) {
this.entityVoiceoversService.setLanguageCode(newLanguageCode);
this.voiceoverBackendApiService
.fetchVoiceoverAdminDataAsync()
.then(response => {
this.voiceoverPlayerService.languageAccentMasterList =
response.languageAccentMasterList;
this.voiceoverPlayerService.languageCodesMapping =
response.languageCodesMapping;

this.audioTranslationLanguageService.setCurrentAudioLanguageCode(
this.selectedLanguageCode
);

this.entityVoiceoversService.fetchEntityVoiceovers().then(() => {
this.voiceoverPlayerService.setLanguageAccentCodesDescriptions(
newLanguageCode,
this.selectedLanguageCode,
this.entityVoiceoversService.getLanguageAccentCodes()
);

this.audioPreloaderService.kickOffAudioPreloader(
this.playerPositionService.getCurrentStateName()
);
});
}
}

onSelectLanguage(newLanguageCode: string): void {
this.entityVoiceoversService.setLanguageCode(newLanguageCode);

this.entityVoiceoversService.fetchEntityVoiceovers().then(() => {
this.voiceoverPlayerService.setLanguageAccentCodesDescriptions(
newLanguageCode,
this.entityVoiceoversService.getLanguageAccentCodes()
);
});

if (this.shouldPromptForRefresh()) {
const modalRef = this.ngbModal.open(
Expand Down
Loading