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

Fix part of #3825: Rename angular services in Group 5 #4111

Merged
merged 11 commits into from
Nov 25, 2017
Merged
Prev Previous commit
Next Next commit
Rename explorationContextService to ExplorationContextService.
  • Loading branch information
shubha1593 committed Nov 25, 2017
commit ca366ecddd2c828d5e60063ed0b929b7799e32e5
14 changes: 7 additions & 7 deletions core/templates/dev/head/app.js
Original file line number Diff line number Diff line change
@@ -78,12 +78,12 @@ oppia.config(['$provide', function($provide) {
$provide.decorator('taOptions', [
'$delegate', '$document', '$modal', '$timeout', 'FocusManagerService',
'taRegisterTool', 'rteHelperService', 'AlertsService',
'explorationContextService', 'PAGE_CONTEXT',
'ExplorationContextService', 'PAGE_CONTEXT',
'UrlInterpolationService',
function(
taOptions, $document, $modal, $timeout, FocusManagerService,
taRegisterTool, rteHelperService, AlertsService,
explorationContextService, PAGE_CONTEXT,
ExplorationContextService, PAGE_CONTEXT,
UrlInterpolationService) {
taOptions.disableSanitizer = true;
taOptions.forceTextAngularSanitize = false;
@@ -163,7 +163,7 @@ oppia.config(['$provide', function($provide) {

rteHelperService.getRichTextComponents().forEach(function(componentDefn) {
var buttonDisplay = rteHelperService.createToolbarIcon(componentDefn);
var canUseFs = explorationContextService.getPageContext() ===
var canUseFs = ExplorationContextService.getPageContext() ===
PAGE_CONTEXT.EDITOR;

taRegisterTool(componentDefn.id, {
@@ -451,10 +451,10 @@ oppia.factory('oppiaDatetimeFormatter', ['$filter', function($filter) {
}]);

oppia.factory('rteHelperService', [
'$filter', '$log', '$interpolate', 'explorationContextService',
'$filter', '$log', '$interpolate', 'ExplorationContextService',
'RTE_COMPONENT_SPECS', 'HtmlEscaperService', 'UrlInterpolationService',
function(
$filter, $log, $interpolate, explorationContextService,
$filter, $log, $interpolate, ExplorationContextService,
RTE_COMPONENT_SPECS, HtmlEscaperService, UrlInterpolationService) {
var _RICH_TEXT_COMPONENTS = [];

@@ -509,7 +509,7 @@ oppia.factory('rteHelperService', [
// Returns a DOM node.
createRteElement: function(componentDefn, customizationArgsDict) {
var el = $('<img/>');
if (explorationContextService.isInExplorationContext()) {
if (ExplorationContextService.isInExplorationContext()) {
// TODO(sll): This extra key was introduced in commit
// 19a934ce20d592a3fc46bd97a2f05f41d33e3d66 in order to retrieve an
// image for RTE previews. However, it has had the unfortunate side-
@@ -518,7 +518,7 @@ oppia.factory('rteHelperService', [
// convertRteToHtml(), but we need to find a less invasive way to
// handle previews.
customizationArgsDict = angular.extend(customizationArgsDict, {
explorationId: explorationContextService.getExplorationId()
explorationId: ExplorationContextService.getExplorationId()
});
}
var componentPreviewUrlTemplate = componentDefn.previewUrlTemplate;
6 changes: 3 additions & 3 deletions core/templates/dev/head/components/SolutionEditorDirective.js
Original file line number Diff line number Diff line change
@@ -21,14 +21,14 @@ oppia.directive('solutionEditor', [
'EditorStateService', 'explorationStatesService',
'explorationWarningsService', 'AlertsService',
'SolutionObjectFactory', 'SolutionVerificationService',
'explorationContextService', 'oppiaExplorationHtmlFormatterService',
'ExplorationContextService', 'oppiaExplorationHtmlFormatterService',
'stateInteractionIdService', 'stateCustomizationArgsService',
'INFO_MESSAGE_SOLUTION_IS_INVALID',
function($modal, UrlInterpolationService, stateSolutionService,
EditorStateService, explorationStatesService,
explorationWarningsService, AlertsService,
SolutionObjectFactory, SolutionVerificationService,
explorationContextService, oppiaExplorationHtmlFormatterService,
ExplorationContextService, oppiaExplorationHtmlFormatterService,
stateInteractionIdService, stateCustomizationArgsService,
INFO_MESSAGE_SOLUTION_IS_INVALID) {
return {
@@ -122,7 +122,7 @@ oppia.directive('solutionEditor', [
var currentStateName = EditorStateService.getActiveStateName();
var state = explorationStatesService.getState(currentStateName);
SolutionVerificationService.verifySolution(
explorationContextService.getExplorationId(),
ExplorationContextService.getExplorationId(),
state,
correctAnswer,
function () {
Original file line number Diff line number Diff line change
@@ -250,15 +250,15 @@ oppia.directive('versionDiffVisualization', [
controller: [
'$scope', '$http', '$modalInstance', '$timeout', 'newStateName',
'oldStateName', 'newState', 'oldState', 'headers',
'explorationContextService', 'UrlInterpolationService',
'ExplorationContextService', 'UrlInterpolationService',
function(
$scope, $http, $modalInstance, $timeout, newStateName,
oldStateName, newState, oldState, headers,
explorationContextService, UrlInterpolationService) {
ExplorationContextService, UrlInterpolationService) {
var STATE_YAML_URL = UrlInterpolationService.interpolateUrl(
'/createhandler/state_yaml/<exploration_id>', {
exploration_id: (
explorationContextService.getExplorationId())
ExplorationContextService.getExplorationId())
});

$scope.headers = headers;
Original file line number Diff line number Diff line change
@@ -34,16 +34,16 @@ oppia.directive('audioTranslationsEditor', [
'/components/forms/audio_translations_editor_directive.html'),
controller: [
'$scope', '$modal', '$sce', 'stateContentService', 'editabilityService',
'LanguageUtilService', 'AlertsService', 'explorationContextService',
'LanguageUtilService', 'AlertsService', 'ExplorationContextService',
'AssetsBackendApiService',
function(
$scope, $modal, $sce, stateContentService, editabilityService,
LanguageUtilService, AlertsService, explorationContextService,
LanguageUtilService, AlertsService, ExplorationContextService,
AssetsBackendApiService) {
$scope.isEditable = editabilityService.isEditable;
$scope.audioTranslations = (
$scope.subtitledHtml.getBindableAudioTranslations());
var explorationId = explorationContextService.getExplorationId();
var explorationId = ExplorationContextService.getExplorationId();

$scope.getAudioLanguageDescription = (
LanguageUtilService.getAudioLanguageDescription);
@@ -86,11 +86,11 @@ oppia.directive('audioTranslationsEditor', [
controller: [
'$scope', '$modalInstance', 'LanguageUtilService',
'allowedAudioLanguageCodes', 'AlertsService',
'explorationContextService', 'IdGenerationService',
'ExplorationContextService', 'IdGenerationService',
function(
$scope, $modalInstance, LanguageUtilService,
allowedAudioLanguageCodes, AlertsService,
explorationContextService, IdGenerationService) {
ExplorationContextService, IdGenerationService) {
var ERROR_MESSAGE_BAD_FILE_UPLOAD = (
'There was an error uploading the audio file.');
var BUTTON_TEXT_SAVE = 'Save';
@@ -145,7 +145,7 @@ oppia.directive('audioTranslationsEditor', [
$scope.saveInProgress = true;
var generatedFilename = generateNewFilename();
var explorationId = (
explorationContextService.getExplorationId());
ExplorationContextService.getExplorationId());
AssetsBackendApiService.saveAudio(
explorationId, generatedFilename, uploadedFile
).then(function() {
2 changes: 1 addition & 1 deletion core/templates/dev/head/pages/admin/admin.html
Original file line number Diff line number Diff line change
@@ -100,7 +100,7 @@
<script src="{{TEMPLATE_DIR_PREFIX}}/pages/admin/misc_tab/AdminMiscTabDirective.js"></script>
<script src="{{TEMPLATE_DIR_PREFIX}}/directives.js"></script>
<script src="{{TEMPLATE_DIR_PREFIX}}/services/AlertsService.js"></script>
<script src="{{TEMPLATE_DIR_PREFIX}}/services/explorationContextService.js"></script>
<script src="{{TEMPLATE_DIR_PREFIX}}/services/ExplorationContextService.js"></script>
<script src="{{TEMPLATE_DIR_PREFIX}}/services/UtilsService.js"></script>
<script src="{{TEMPLATE_DIR_PREFIX}}/services/IdGenerationService.js"></script>
<script src="{{TEMPLATE_DIR_PREFIX}}/services/DebouncerService.js"></script>
2 changes: 1 addition & 1 deletion core/templates/dev/head/pages/base.html
Original file line number Diff line number Diff line change
@@ -204,7 +204,7 @@ <h2>
<script src="{{TEMPLATE_DIR_PREFIX}}/pages/Base.js"></script>

<script src="{{TEMPLATE_DIR_PREFIX}}/services/AlertsService.js"></script>
<script src="{{TEMPLATE_DIR_PREFIX}}/services/explorationContextService.js"></script>
<script src="{{TEMPLATE_DIR_PREFIX}}/services/ExplorationContextService.js"></script>
<script src="{{TEMPLATE_DIR_PREFIX}}/services/UtilsService.js"></script>
<script src="{{TEMPLATE_DIR_PREFIX}}/services/DebouncerService.js"></script>
<script src="{{TEMPLATE_DIR_PREFIX}}/services/IdGenerationService.js"></script>
Original file line number Diff line number Diff line change
@@ -29,14 +29,14 @@ oppia.directive('editorNavigation', [
'explorationWarningsService',
'stateEditorTutorialFirstTimeService',
'ThreadDataService', 'siteAnalyticsService',
'explorationContextService', 'WindowDimensionsService',
'ExplorationContextService', 'WindowDimensionsService',
function(
$scope, $rootScope, $timeout, $modal,
RouterService, explorationRightsService,
explorationWarningsService,
stateEditorTutorialFirstTimeService,
ThreadDataService, siteAnalyticsService,
explorationContextService, WindowDimensionsService) {
ExplorationContextService, WindowDimensionsService) {
$scope.postTutorialHelpPopoverIsShown = false;
$scope.isLargeScreen = (WindowDimensionsService.getWidth() >= 1024);

@@ -54,7 +54,7 @@ oppia.directive('editorNavigation', [
$scope.userIsLoggedIn = GLOBALS.userIsLoggedIn;

$scope.showUserHelpModal = function() {
var explorationId = explorationContextService.getExplorationId();
var explorationId = ExplorationContextService.getExplorationId();
siteAnalyticsService.registerClickHelpButtonEvent(explorationId);
var modalInstance = $modal.open({
templateUrl: UrlInterpolationService.getDirectiveTemplateUrl(
@@ -63,12 +63,12 @@ oppia.directive('editorNavigation', [
backdrop: true,
controller: [
'$scope', '$modalInstance',
'siteAnalyticsService', 'explorationContextService',
'siteAnalyticsService', 'ExplorationContextService',
function(
$scope, $modalInstance,
siteAnalyticsService, explorationContextService) {
siteAnalyticsService, ExplorationContextService) {
var explorationId = (
explorationContextService.getExplorationId());
ExplorationContextService.getExplorationId());

$scope.beginTutorial = function() {
siteAnalyticsService
Original file line number Diff line number Diff line change
@@ -668,14 +668,14 @@ oppia.factory('explorationStatesService', [
'explorationInitStateNameService', 'AlertsService', 'changeListService',
'EditorStateService', 'ValidatorsService', 'StatesObjectFactory',
'SolutionValidityService', 'AngularNameService',
'AnswerClassificationService', 'explorationContextService',
'AnswerClassificationService', 'ExplorationContextService',
'UrlInterpolationService',
function(
$log, $modal, $filter, $location, $rootScope, $injector, $q,
explorationInitStateNameService, AlertsService, changeListService,
EditorStateService, ValidatorsService, StatesObjectFactory,
SolutionValidityService, AngularNameService,
AnswerClassificationService, explorationContextService,
AnswerClassificationService, ExplorationContextService,
UrlInterpolationService) {
var _states = null;
// Properties that have a different backend representation from the
@@ -802,7 +802,7 @@ oppia.factory('explorationStatesService', [
if (solution) {
var result = (
AnswerClassificationService.getMatchingClassificationResult(
explorationContextService.getExplorationId(),
ExplorationContextService.getExplorationId(),
stateName,
_states.getState(stateName),
solution.correctAnswer,
Original file line number Diff line number Diff line change
@@ -43,7 +43,7 @@ oppia.controller('ExplorationEditor', [
'editabilityService', 'explorationStatesService', 'RouterService',
'graphDataService', 'stateEditorTutorialFirstTimeService',
'explorationParamSpecsService', 'explorationParamChangesService',
'explorationWarningsService', '$templateCache', 'explorationContextService',
'explorationWarningsService', '$templateCache', 'ExplorationContextService',
'ExplorationAdvancedFeaturesService', '$modal', 'changeListService',
'autosaveInfoModalsService', 'siteAnalyticsService',
'UserEmailPreferencesService', 'ParamChangesObjectFactory',
@@ -58,7 +58,7 @@ oppia.controller('ExplorationEditor', [
editabilityService, explorationStatesService, RouterService,
graphDataService, stateEditorTutorialFirstTimeService,
explorationParamSpecsService, explorationParamChangesService,
explorationWarningsService, $templateCache, explorationContextService,
explorationWarningsService, $templateCache, ExplorationContextService,
ExplorationAdvancedFeaturesService, $modal, changeListService,
autosaveInfoModalsService, siteAnalyticsService,
UserEmailPreferencesService, ParamChangesObjectFactory,
@@ -72,7 +72,7 @@ oppia.controller('ExplorationEditor', [
*********************************************************/
$rootScope.loadingMessage = 'Loading';

$scope.explorationId = explorationContextService.getExplorationId();
$scope.explorationId = ExplorationContextService.getExplorationId();
$scope.explorationUrl = '/create/' + $scope.explorationId;
$scope.explorationDownloadUrl = (
'/createhandler/download/' + $scope.explorationId);
@@ -379,10 +379,10 @@ oppia.controller('ExplorationEditor', [
backdrop: true,
controller: [
'$scope', '$modalInstance', 'siteAnalyticsService',
'explorationContextService',
'ExplorationContextService',
function($scope, $modalInstance, siteAnalyticsService,
explorationContextService) {
var explorationId = explorationContextService.getExplorationId();
ExplorationContextService) {
var explorationId = ExplorationContextService.getExplorationId();

siteAnalyticsService.registerTutorialModalOpenEvent(explorationId);

Original file line number Diff line number Diff line change
@@ -80,8 +80,8 @@ oppia.factory('ExplorationSaveService', [
'post_publish_modal_directive.html'),
backdrop: true,
controller: [
'$scope', '$modalInstance', 'explorationContextService',
function($scope, $modalInstance, explorationContextService) {
'$scope', '$modalInstance', 'ExplorationContextService',
function($scope, $modalInstance, ExplorationContextService) {
$scope.congratsImgUrl = UrlInterpolationService.getStaticImageUrl(
'/general/congrats.svg');
$scope.DEFAULT_TWITTER_SHARE_MESSAGE_EDITOR = (
@@ -90,7 +90,7 @@ oppia.factory('ExplorationSaveService', [
$modalInstance.dismiss('cancel');
};
$scope.explorationId = (
explorationContextService.getExplorationId());
ExplorationContextService.getExplorationId());
}
]
});
Original file line number Diff line number Diff line change
@@ -22,15 +22,15 @@ oppia.factory('ResponsesService', [
'AnswerGroupsCacheService', 'EditorStateService', 'changeListService',
'explorationStatesService', 'graphDataService', 'OutcomeObjectFactory',
'stateSolutionService', 'SolutionVerificationService', 'AlertsService',
'explorationContextService', 'explorationWarningsService',
'ExplorationContextService', 'explorationWarningsService',
'INFO_MESSAGE_SOLUTION_IS_VALID', 'INFO_MESSAGE_SOLUTION_IS_INVALID',
'INFO_MESSAGE_SOLUTION_IS_INVALID_FOR_CURRENT_RULE',
function(
$rootScope, stateInteractionIdService, INTERACTION_SPECS,
AnswerGroupsCacheService, EditorStateService, changeListService,
explorationStatesService, graphDataService, OutcomeObjectFactory,
stateSolutionService, SolutionVerificationService, AlertsService,
explorationContextService, explorationWarningsService,
ExplorationContextService, explorationWarningsService,
INFO_MESSAGE_SOLUTION_IS_VALID, INFO_MESSAGE_SOLUTION_IS_INVALID,
INFO_MESSAGE_SOLUTION_IS_INVALID_FOR_CURRENT_RULE) {
var _answerGroupsMemento = null;
@@ -72,7 +72,7 @@ oppia.factory('ResponsesService', [
explorationStatesService.isSolutionValid(
EditorStateService.getActiveStateName()));
SolutionVerificationService.verifySolution(
explorationContextService.getExplorationId(),
ExplorationContextService.getExplorationId(),
explorationStatesService.getState(currentStateName),
stateSolutionService.savedMemento.correctAnswer,
function() {
Original file line number Diff line number Diff line change
@@ -17,10 +17,10 @@
*/

oppia.factory('SolutionVerificationService', [
'$injector', 'stateInteractionIdService', 'explorationContextService',
'$injector', 'stateInteractionIdService', 'ExplorationContextService',
'EditorStateService', 'AngularNameService', 'AnswerClassificationService',
function(
$injector, stateInteractionIdService, explorationContextService,
$injector, stateInteractionIdService, ExplorationContextService,
EditorStateService, AngularNameService, AnswerClassificationService) {
return {
verifySolution: function(
Loading