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
Fixes frontend tests
  • Loading branch information
Nik-09 committed Aug 1, 2024
commit 7de0993de079e5ffc7a7e3f1a8e480ce0a35c1bf
Original file line number Diff line number Diff line change
Expand Up @@ -242,10 +242,6 @@ describe('Exploration object factory', () => {
loggerErrorSpy = spyOn(ls, 'error').and.callThrough();
});

it('should get all language codes of an exploration', () => {
expect(exploration.getAllVoiceoverLanguageCodes()).toEqual(['en', 'hi-en']);
});

it('should get the language code of an exploration', () => {
expect(exploration.getLanguageCode()).toBe('en');
});
Expand All @@ -256,43 +252,6 @@ describe('Exploration object factory', () => {
);
});

it('should correctly get all audio translations by language code', () => {
expect(exploration.getAllVoiceovers('hi-en')).toEqual({
'first state': [
Voiceover.createFromBackendDict({
filename: 'myfile3.mp3',
file_size_bytes: 430000,
needs_update: false,
duration_secs: 2.1,
}),
],
'second state': [
Voiceover.createFromBackendDict({
filename: 'myfile2.mp3',
file_size_bytes: 120000,
needs_update: false,
duration_secs: 1.2,
}),
],
});
expect(exploration.getAllVoiceovers('en')).toEqual({
'first state': [
Voiceover.createFromBackendDict({
filename: 'myfile1.mp3',
file_size_bytes: 210000,
needs_update: false,
duration_secs: 4.3,
}),
],
'second state': [],
});

expect(exploration.getAllVoiceovers('hi')).toEqual({
'first state': [],
'second state': [],
});
});

it('should correctly get the interaction from an exploration', () => {
expect(exploration.getInteraction('first state')).toEqual(
iof.createFromBackendDict(firstState.interaction)
Expand Down
1 change: 0 additions & 1 deletion core/templates/domain/state_card/state-card.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,6 @@ export class StateCard {
* directive for the current card.
* @param {Interaction} interaction - An interaction object that stores all
* the properties of the card's interaction.
* @param {RecordedVoiceovers} recordedVoiceovers
* @param {string} contentId
* @param {AudioTranslationLanguageService} audioTranslationLanguageService
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,46 +17,53 @@
*/

import {EventEmitter} from '@angular/core';

import {HttpClientTestingModule} from '@angular/common/http/testing';
import {TestBed} from '@angular/core/testing';
import {TranslationTabActiveContentIdService} from 'pages/exploration-editor-page/translation-tab/services/translation-tab-active-content-id.service';
import {StateRecordedVoiceoversService} from 'components/state-editor/state-editor-properties-services/state-recorded-voiceovers.service';
import {ExplorationStatesService} from '../../services/exploration-states.service';

describe('Translation tab active content id service', () => {
let ttacis: TranslationTabActiveContentIdService;
let explorationStatesService: ExplorationStatesService;

beforeEach(() => {
TestBed.configureTestingModule({
providers: [
{
provide: StateRecordedVoiceoversService,
useValue: {
displayed: {
getAllContentIds: () => {
return ['content', 'feedback_1'];
},
},
},
},
],
});
imports: [HttpClientTestingModule],
providers: [],
}).compileComponents();

ttacis = TestBed.inject(TranslationTabActiveContentIdService);
explorationStatesService = TestBed.inject(ExplorationStatesService);
});

it('should correctly set and get active content id', () => {
expect(ttacis.getActiveContentId()).toBeNull();
spyOn(
explorationStatesService,
'getAllContentIdsByStateName'
).and.returnValue(['content']);

ttacis.setActiveContent('content', 'html');
expect(ttacis.getActiveContentId()).toBe('content');
});

it('should throw error on setting invalid content id', () => {
expect(() => {
spyOn(
explorationStatesService,
'getAllContentIdsByStateName'
).and.returnValue(['content']);
ttacis.setActiveContent('feedback_2', 'html');
}).toThrowError('Invalid active content id: feedback_2');
});

it('should return data format correctly', () => {
expect(ttacis.getActiveDataFormat()).toBeNull();
spyOn(
explorationStatesService,
'getAllContentIdsByStateName'
).and.returnValue(['content']);
ttacis.setActiveContent('content', 'html');
expect(ttacis.getActiveDataFormat()).toBe('html');
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import {downgradeInjectable} from '@angular/upgrade/static';
import {EventEmitter} from '@angular/core';
import {Injectable} from '@angular/core';

import {StateRecordedVoiceoversService} from 'components/state-editor/state-editor-properties-services/state-recorded-voiceovers.service';
import {ExplorationStatesService} from 'pages/exploration-editor-page/services/exploration-states.service';
import {StateEditorService} from 'components/state-editor/state-editor-properties-services/state-editor.service';

Expand All @@ -29,7 +28,6 @@ import {StateEditorService} from 'components/state-editor/state-editor-propertie
})
export class TranslationTabActiveContentIdService {
constructor(
private _stateRecordedVoiceoversService: StateRecordedVoiceoversService,
private _explorationStatesService: ExplorationStatesService,
private _stateEditorService: StateEditorService
) {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2323,8 +2323,8 @@ describe('State translation component', () => {
});

it('should change active customization argument index', () => {
component.onTabClick('ca');
spyOn(translationTabActiveContentIdService, 'setActiveContent');
component.onTabClick('ca');

component.changeActiveCustomizationArgContentIndex(1);
expect(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ class MockWindowRef {
href: 'http://localhost:8181/explore/wZiXFx1iV5bz',
pathname: '/explore/wZiXFx1iV5bz',
},
navigator: {
onLine: true,
userAgent: null,
},
};
}

Expand Down Expand Up @@ -181,10 +185,6 @@ describe('Content language selector component', () => {
);

it('should correcly initialize newLanguageCode', fakeAsync(() => {
spyOn(
component,
'isVoiceoverContributionWithAccentEnabled'
).and.returnValue(true);
entityVoiceoversService.entityType = 'exploration';
entityVoiceoversService.entityId = 'exploration_id_1';
entityVoiceoversService.entityVersion = 1;
Expand Down Expand Up @@ -237,10 +237,6 @@ describe('Content language selector component', () => {
contentTranslationLanguageService,
'setCurrentContentLanguageCode'
);
spyOn(
component,
'isVoiceoverContributionWithAccentEnabled'
).and.returnValue(true);
spyOn(entityVoiceoversService, 'fetchEntityVoiceovers').and.returnValue(
Promise.resolve()
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ class MockWindowRef {
return 'http://localhost:8181/?lang=es';
},
},
navigator: {
onLine: true,
userAgent: null,
},
localStorage: {
last_uploaded_audio_lang: 'en',
removeItem: (name: string) => {},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ class MockWindowRef {
pathname: '/path/name',
reload: () => {},
},
navigator: {
onLine: true,
userAgent: null,
},
onresize: () => {},
addEventListener(event: string, callback) {
callback({returnValue: null});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ describe('Ratings and recommendations component', () => {
pathname: '/path/name',
reload: () => {},
},
navigator: {
onLine: true,
userAgent: null,
},
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ class MockWindowRef {
hash: '',
pathname: '/path/name',
},
navigator: {
onLine: true,
userAgent: null,
},
matchMedia: function (query: string) {
return {
matches: false,
Expand Down Expand Up @@ -758,27 +762,17 @@ describe('Tutor card component', () => {
spyOn(currentInteractionService, 'registerPresubmitHook').and.callFake(
callb => callb()
);
spyOn(audioTranslationManagerService, 'clearSecondaryAudioTranslations');
spyOn(audioTranslationManagerService, 'setContentAudioTranslations');
spyOn(audioPlayerService, 'clear');
spyOn(audioPreloaderService, 'clearMostRecentlyRequestedAudioFilename');
spyOn(autogeneratedAudioPlayerService, 'cancel');

componentInstance.updateDisplayedCard();
mockOnNewCardAvailableEventEmitter.emit();
tick();

expect(
audioTranslationManagerService.clearSecondaryAudioTranslations
).toHaveBeenCalled();
expect(
audioTranslationManagerService.setContentAudioTranslations
).toHaveBeenCalled();
expect(audioPlayerService.clear).toHaveBeenCalled();
expect(
audioPreloaderService.clearMostRecentlyRequestedAudioFilename
).toHaveBeenCalled();
expect(autogeneratedAudioPlayerService.cancel).toHaveBeenCalled();
}));

it('should get the static image url from the image path', () => {
Expand Down Expand Up @@ -821,7 +815,6 @@ describe('Tutor card component', () => {
new Interaction([], [], null, null, [], '', null)
);
spyOn(mockDisplayedCard, 'isCompleted').and.returnValue(true);
spyOn(audioTranslationManagerService, 'setContentAudioTranslations');
spyOn(audioPlayerService, 'clear');
spyOn(audioPreloaderService, 'clearMostRecentlyRequestedAudioFilename');
spyOn(autogeneratedAudioPlayerService, 'cancel');
Expand All @@ -842,21 +835,11 @@ describe('Tutor card component', () => {
});

it('should get content audio highlight class', () => {
spyOn(
audioTranslationManagerService,
'getCurrentComponentName'
).and.returnValue(AppConstants.COMPONENT_NAME_CONTENT);
let audioPlayerServiceSpy = spyOn(audioPlayerService, 'isPlaying');
audioPlayerServiceSpy.and.returnValue(false);
spyOn(autogeneratedAudioPlayerService, 'isPlaying').and.returnValue(true);
expect(componentInstance.getContentAudioHighlightClass()).toEqual(
ExplorationPlayerConstants.AUDIO_HIGHLIGHT_CSS_CLASS
);
expect(componentInstance.getContentAudioHighlightClass()).toBeNull();

spyOn(
componentInstance,
'isVoiceoverContributionWithAccentEnabled'
).and.returnValue(true);
audioPlayerServiceSpy.and.returnValue(true);
spyOn(voiceoverPlayerService, 'getActiveComponentName').and.returnValue(
AppConstants.COMPONENT_NAME_CONTENT
Expand Down Expand Up @@ -909,19 +892,6 @@ describe('Tutor card component', () => {
expect(componentInstance.showAudioBar()).toBeTrue();
});

it('should tell if content audio translation is available', () => {
componentInstance.conceptCardIsBeingShown = true;
componentInstance.displayedCard = mockDisplayedCard;
expect(componentInstance.isContentAudioTranslationAvailable()).toBeFalse();
componentInstance.conceptCardIsBeingShown = false;
spyOn(
mockDisplayedCard,
'isContentAudioTranslationAvailable'
).and.returnValue(true);
componentInstance.displayedCard = mockDisplayedCard;
expect(componentInstance.isContentAudioTranslationAvailable()).toBeTrue();
});

it('should check if current card is at end of transcript', () => {
componentInstance.displayedCard = mockDisplayedCard;
spyOn(mockDisplayedCard, 'isCompleted').and.returnValue(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,6 @@ describe('Content translation manager service', () => {
null
),
interaction,
RecordedVoiceovers.createEmpty(),
'content',
atls
)
Expand Down Expand Up @@ -410,7 +409,6 @@ describe('Content translation manager service', () => {
null
),
newInteraction,
RecordedVoiceovers.createEmpty(),
'content',
atls
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ class MockWindowRef {
return 'http://localhost:8181/?lang=es';
},
},
navigator: {
onLine: true,
userAgent: null,
},
localStorage: {
last_uploaded_audio_lang: 'en',
removeItem: (name: string) => {},
Expand Down
3 changes: 0 additions & 3 deletions core/templates/services/UpgradedServices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -436,9 +436,6 @@ export class UpgradedServices {
new ExplorationFeaturesService();
upgradedServices['ExpressionParserService'] = new ExpressionParserService();
upgradedServices['ExternalSaveService'] = new ExternalSaveService();
upgradedServices['EntityVoiceoversService'] = new EntityVoiceoversService(
upgradedServices['VoiceoverBackendApiService']
);
upgradedServices['GraphDetailService'] = new GraphDetailService();
upgradedServices['GraphUtilsService'] = new GraphUtilsService();
upgradedServices['I18nLanguageCodeService'] = new I18nLanguageCodeService();
Expand Down