Skip to content

Commit

Permalink
Fix part of oppia#3825: Rename Group 1 services to UpperCamelCase (op…
Browse files Browse the repository at this point in the history
…pia#3948)

Fix part of oppia#3825: Rename Group 1 services to UpperCamelCase
  • Loading branch information
abarya authored and shubha1593 committed Oct 10, 2017
1 parent a481e7a commit ab15c39
Show file tree
Hide file tree
Showing 23 changed files with 77 additions and 77 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -1643,7 +1643,7 @@ Security:
Infrastructure:
* Adjust backend tests to not use datetime.datetime.now(), since it gives different results in different locales.
* Add a hook for inserting custom HTML before the end of the 'body' tag.
* Broadcast parameter values to the messengerService for explorationCompleted and stateTransition events.
* Broadcast parameter values to the MessengerService for explorationCompleted and stateTransition events.
* Speed up the recommendations job by making fewer calls to the datastore.
* Update FontAwesome to version 4.4.0.
* Add created_on and last_updated fields to reconstituted version snapshots.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

oppia.factory('UrlInterpolationService', [
'alertsService', 'utilsService', function(alertsService, utilsService) {
'alertsService', 'UtilsService', function(alertsService, UtilsService) {
var validateResourcePath = function(resourcePath) {
if (!resourcePath) {
alertsService.fatalWarning('Empty path passed in method.');
Expand Down Expand Up @@ -120,7 +120,7 @@ oppia.factory('UrlInterpolationService', [
var escapedInterpolationValues = {};
for (var varName in interpolationValues) {
var value = interpolationValues[varName];
if (!utilsService.isString(value)) {
if (!UtilsService.isString(value)) {
alertsService.fatalWarning(
'Parameters passed into interpolateUrl must be strings.');
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ describe('Expression evaluator service', function() {
ees = $injector.get('ExpressionEvaluatorService');
eps = $injector.get('ExpressionParserService');
ests = $injector.get('ExpressionSyntaxTreeService');
isString = $injector.get('utilsService').isString;
isString = $injector.get('UtilsService').isString;
}));

var ENVS = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ describe('Expression type parser service', function() {
etps = $injector.get('ExpressionTypeParserService');
eps = $injector.get('ExpressionParserService');
ests = $injector.get('ExpressionSyntaxTreeService');
isString = $injector.get('utilsService').isString;
isString = $injector.get('UtilsService').isString;
}));

var ENVS = [
Expand Down
8 changes: 4 additions & 4 deletions core/templates/dev/head/filters.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,9 @@ oppia.filter('truncateAtFirstEllipsis', [function() {
}]);

oppia.filter('wrapTextWithEllipsis', [
'$filter', 'utilsService', function($filter, utilsService) {
'$filter', 'UtilsService', function($filter, UtilsService) {
return function(input, characterCount) {
if (utilsService.isString(input)) {
if (UtilsService.isString(input)) {
input = $filter('normalizeWhitespace')(input);
if (input.length <= characterCount || characterCount < 3) {
// String fits within the criteria; no wrapping is necessary.
Expand Down Expand Up @@ -256,9 +256,9 @@ oppia.filter('parameterizeRuleDescription', [

// Filter that removes whitespace from the beginning and end of a string, and
// replaces interior whitespace with a single space character.
oppia.filter('normalizeWhitespace', ['utilsService', function(utilsService) {
oppia.filter('normalizeWhitespace', ['UtilsService', function(UtilsService) {
return function(input) {
if (utilsService.isString(input)) {
if (UtilsService.isString(input)) {
// Remove whitespace from the beginning and end of the string, and
// replace interior whitespace with a single space character.
input = input.trim();
Expand Down
2 changes: 1 addition & 1 deletion core/templates/dev/head/pages/admin/admin.html
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
<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/utilsService.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>
<script src="{{TEMPLATE_DIR_PREFIX}}/services/HtmlEscaperService.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion core/templates/dev/head/pages/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ <h2>

<script src="{{TEMPLATE_DIR_PREFIX}}/services/alertsService.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/UtilsService.js"></script>
<script src="{{TEMPLATE_DIR_PREFIX}}/services/DebouncerService.js"></script>
<script src="{{TEMPLATE_DIR_PREFIX}}/services/IdGenerationService.js"></script>
<script src="{{TEMPLATE_DIR_PREFIX}}/services/ValidatorsService.js"></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1765,7 +1765,7 @@ oppia.factory('explorationWarningsService', [
}
]);

oppia.factory('lostChangesService', ['utilsService', function(utilsService) {
oppia.factory('lostChangesService', ['UtilsService', function(UtilsService) {
var CMD_ADD_STATE = 'add_state';
var CMD_RENAME_STATE = 'rename_state';
var CMD_DELETE_STATE = 'delete_state';
Expand Down Expand Up @@ -1808,13 +1808,13 @@ oppia.factory('lostChangesService', ['utilsService', function(utilsService) {
'added' : (newValue.length === oldValue.length) ?
'edited' : 'deleted';
} else {
if (!utilsService.isEmpty(oldValue)) {
if (!utilsService.isEmpty(newValue)) {
if (!UtilsService.isEmpty(oldValue)) {
if (!UtilsService.isEmpty(newValue)) {
result = 'edited';
} else {
result = 'deleted';
}
} else if (!utilsService.isEmpty(newValue)) {
} else if (!UtilsService.isEmpty(newValue)) {
result = 'added';
}
}
Expand Down Expand Up @@ -1895,9 +1895,9 @@ oppia.factory('lostChangesService', ['utilsService', function(utilsService) {

case 'widget_customization_args':
var lostChangeValue = '';
if (utilsService.isEmpty(oldValue)) {
if (UtilsService.isEmpty(oldValue)) {
lostChangeValue = 'Added Interaction Customizations';
} else if (utilsService.isEmpty(newValue)) {
} else if (UtilsService.isEmpty(newValue)) {
lostChangeValue = 'Removed Interaction Customizations';
} else {
lostChangeValue = 'Edited Interaction Customizations';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@
<script src="{{TEMPLATE_DIR_PREFIX}}/components/summary_tile/ExplorationSummaryTileDirective.js"></script>
<script src="{{TEMPLATE_DIR_PREFIX}}/components/RatingComputationService.js"></script>
<script src="{{TEMPLATE_DIR_PREFIX}}/services/explorationServices.js"></script>
<script src="{{TEMPLATE_DIR_PREFIX}}/services/messengerService.js"></script>
<script src="{{TEMPLATE_DIR_PREFIX}}/services/MessengerService.js"></script>
<script src="{{TEMPLATE_DIR_PREFIX}}/services/AudioPlayerService.js"></script>
<script src="{{TEMPLATE_DIR_PREFIX}}/services/AssetsBackendApiService.js"></script>
<script src="{{TEMPLATE_DIR_PREFIX}}/services/AutogeneratedAudioPlayerService.js"></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ oppia.directive('conversationSkin', [
template: '<div ng-include="directiveTemplate"></div>',
controller: [
'$scope', '$timeout', '$rootScope', '$window', '$translate', '$http',
'messengerService', 'ExplorationPlayerService', 'urlService',
'MessengerService', 'ExplorationPlayerService', 'urlService',
'FocusManagerService', 'LearnerViewRatingService',
'windowDimensionsService', 'PlayerTranscriptService',
'LearnerParamsService', 'PlayerPositionService',
Expand All @@ -258,7 +258,7 @@ oppia.directive('conversationSkin', [
'FatigueDetectionService',
function(
$scope, $timeout, $rootScope, $window, $translate, $http,
messengerService, ExplorationPlayerService, urlService,
MessengerService, ExplorationPlayerService, urlService,
FocusManagerService, LearnerViewRatingService,
windowDimensionsService, PlayerTranscriptService,
LearnerParamsService, PlayerPositionService,
Expand Down Expand Up @@ -320,7 +320,7 @@ oppia.directive('conversationSkin', [
// Sometimes setting iframe height to the exact content height
// still produces scrollbar, so adding 50 extra px.
newHeight += 50;
messengerService.sendMessage(messengerService.HEIGHT_CHANGE, {
MessengerService.sendMessage(MessengerService.HEIGHT_CHANGE, {
height: newHeight,
scroll: scroll
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ oppia.constant('STATS_REPORTING_URLS', {
});

oppia.factory('StatsReportingService', [
'$http', 'StopwatchObjectFactory', 'messengerService',
'$http', 'StopwatchObjectFactory', 'MessengerService',
'UrlInterpolationService', 'STATS_REPORTING_URLS', 'siteAnalyticsService',
function(
$http, StopwatchObjectFactory, messengerService,
$http, StopwatchObjectFactory, MessengerService,
UrlInterpolationService, STATS_REPORTING_URLS, siteAnalyticsService) {
var explorationId = null;
var explorationTitle = null;
Expand Down Expand Up @@ -77,7 +77,7 @@ oppia.factory('StatsReportingService', [
session_id: sessionId
});

messengerService.sendMessage(messengerService.EXPLORATION_LOADED, {
MessengerService.sendMessage(MessengerService.EXPLORATION_LOADED, {
explorationVersion: explorationVersion,
explorationTitle: explorationTitle
});
Expand All @@ -101,7 +101,7 @@ oppia.factory('StatsReportingService', [
});

// Broadcast information about the state transition to listeners.
messengerService.sendMessage(messengerService.STATE_TRANSITION, {
MessengerService.sendMessage(MessengerService.STATE_TRANSITION, {
explorationVersion: explorationVersion,
jsonAnswer: JSON.stringify(answer),
newStateName: newStateName,
Expand All @@ -127,7 +127,7 @@ oppia.factory('StatsReportingService', [
version: explorationVersion
});

messengerService.sendMessage(messengerService.EXPLORATION_COMPLETED, {
MessengerService.sendMessage(MessengerService.EXPLORATION_COMPLETED, {
explorationVersion: explorationVersion,
paramValues: params
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ <h3>Suggest a Change</h3>

<script src="{{TEMPLATE_DIR_PREFIX}}/services/autoplayedVideosService.js"></script>
<script src="{{TEMPLATE_DIR_PREFIX}}/services/explorationServices.js"></script>
<script src="{{TEMPLATE_DIR_PREFIX}}/services/messengerService.js"></script>
<script src="{{TEMPLATE_DIR_PREFIX}}/services/MessengerService.js"></script>
<script src="{{TEMPLATE_DIR_PREFIX}}/services/AudioPlayerService.js"></script>
<script src="{{TEMPLATE_DIR_PREFIX}}/services/AutogeneratedAudioPlayerService.js"></script>
<script src="{{TEMPLATE_DIR_PREFIX}}/services/SpeechSynthesisChunkerService.js"></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ oppia.directive('activityTilesInfinityGrid', [
'/pages/library/' +
'activity_tiles_infinity_grid_directive.html'),
controller: [
'$scope', '$rootScope', 'searchService',
function($scope, $rootScope, searchService) {
'$scope', '$rootScope', 'SearchService',
function($scope, $rootScope, SearchService) {
$scope.endOfPageIsReached = false;
$scope.allActivitiesInOrder = [];
// Called when the first batch of search results is retrieved from the
Expand All @@ -40,7 +40,7 @@ oppia.directive('activityTilesInfinityGrid', [
$scope.showMoreActivities = function() {
if (!$rootScope.loadingMessage && !$scope.endOfPageIsReached) {
$scope.searchResultsAreLoading = true;
searchService.loadMoreData(function(data, endOfPageIsReached) {
SearchService.loadMoreData(function(data, endOfPageIsReached) {
$scope.allActivitiesInOrder =
$scope.allActivitiesInOrder.concat(
data.activity_list);
Expand Down
6 changes: 3 additions & 3 deletions core/templates/dev/head/pages/library/Library.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ oppia.constant('LIBRARY_PAGE_MODES', {

oppia.controller('Library', [
'$scope', '$http', '$modal', '$rootScope', '$window', '$timeout',
'i18nIdService', 'urlService', 'ALL_CATEGORIES', 'searchService',
'i18nIdService', 'urlService', 'ALL_CATEGORIES', 'SearchService',
'windowDimensionsService', 'UrlInterpolationService', 'LIBRARY_PAGE_MODES',
'LIBRARY_TILE_WIDTH_PX', 'alertsService',
'LearnerDashboardIdsBackendApiService',
'LearnerDashboardActivityIdsObjectFactory', 'LearnerPlaylistService',
function(
$scope, $http, $modal, $rootScope, $window, $timeout,
i18nIdService, urlService, ALL_CATEGORIES, searchService,
i18nIdService, urlService, ALL_CATEGORIES, SearchService,
windowDimensionsService, UrlInterpolationService, LIBRARY_PAGE_MODES,
LIBRARY_TILE_WIDTH_PX, alertsService,
LearnerDashboardIdsBackendApiService,
Expand Down Expand Up @@ -242,7 +242,7 @@ oppia.controller('Library', [
selectedCategories[categories[i]] = true;
}

var targetSearchQueryUrl = searchService.getSearchUrlQueryString(
var targetSearchQueryUrl = SearchService.getSearchUrlQueryString(
'', selectedCategories, {});
$window.location.href = '/search/find?q=' + targetSearchQueryUrl;
}
Expand Down
16 changes: 8 additions & 8 deletions core/templates/dev/head/pages/library/SearchBarDirective.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ oppia.directive('searchBar', [
'search_bar_directive.html'),
controller: [
'$scope', '$rootScope', '$timeout', '$window', '$location',
'$translate', 'searchService', 'DebouncerService', 'HtmlEscaperService',
'$translate', 'SearchService', 'DebouncerService', 'HtmlEscaperService',
'urlService', 'i18nIdService',
function(
$scope, $rootScope, $timeout, $window, $location, $translate,
searchService, DebouncerService, HtmlEscaperService, urlService,
SearchService, DebouncerService, HtmlEscaperService, urlService,
i18nIdService) {
$scope.isSearchInProgress = searchService.isSearchInProgress;
$scope.isSearchInProgress = SearchService.isSearchInProgress;
$scope.SEARCH_DROPDOWN_CATEGORIES = (
GLOBALS.SEARCH_DROPDOWN_CATEGORIES.map(
function(categoryName) {
Expand Down Expand Up @@ -138,11 +138,11 @@ oppia.directive('searchBar', [
});

var onSearchQueryChangeExec = function() {
searchService.executeSearchQuery(
SearchService.executeSearchQuery(
$scope.searchQuery, $scope.selectionDetails.categories.selections,
$scope.selectionDetails.languageCodes.selections);

var searchUrlQueryString = searchService.getSearchUrlQueryString(
var searchUrlQueryString = SearchService.getSearchUrlQueryString(
$scope.searchQuery, $scope.selectionDetails.categories.selections,
$scope.selectionDetails.languageCodes.selections
);
Expand All @@ -159,19 +159,19 @@ oppia.directive('searchBar', [
}

var updateSearchFieldsBasedOnUrlQuery = function() {
var oldQueryString = searchService.getCurrentUrlQueryString();
var oldQueryString = SearchService.getCurrentUrlQueryString();

$scope.selectionDetails.categories.selections = {};
$scope.selectionDetails.languageCodes.selections = {};

$scope.searchQuery =
searchService.updateSearchFieldsBasedOnUrlQuery(
SearchService.updateSearchFieldsBasedOnUrlQuery(
$window.location.search, $scope.selectionDetails);

updateSelectionDetails('categories');
updateSelectionDetails('languageCodes');

var newQueryString = searchService.getCurrentUrlQueryString();
var newQueryString = SearchService.getCurrentUrlQueryString();

if (oldQueryString !== newQueryString) {
onSearchQueryChangeExec();
Expand Down
2 changes: 1 addition & 1 deletion core/templates/dev/head/pages/library/library.html
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ <h2 ng-class="{'active': activeGroupIndex === $index}" class="oppia-library-grou

{% block footer_js %}
{{ super() }}
<script src="{{TEMPLATE_DIR_PREFIX}}/services/searchService.js"></script>
<script src="{{TEMPLATE_DIR_PREFIX}}/services/SearchService.js"></script>
<script src="{{TEMPLATE_DIR_PREFIX}}/components/RatingComputationService.js"></script>
<script src="{{TEMPLATE_DIR_PREFIX}}/domain/learner_dashboard/LearnerDashboardIdsBackendApiService.js"></script>
<script src="{{TEMPLATE_DIR_PREFIX}}/domain/learner_dashboard/LearnerDashboardActivityIdsObjectFactory.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion core/templates/dev/head/pages/maintenance/maintenance.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ <h2>The Oppia site is temporarily unavailable.</h2>
<script src="{{TEMPLATE_DIR_PREFIX}}/app.js"></script>
<script src="{{TEMPLATE_DIR_PREFIX}}/i18n.js"></script>
<script src="{{TEMPLATE_DIR_PREFIX}}/services/alertsService.js"></script>
<script src="{{TEMPLATE_DIR_PREFIX}}/services/utilsService.js"></script>
<script src="{{TEMPLATE_DIR_PREFIX}}/services/UtilsService.js"></script>
<script src="{{TEMPLATE_DIR_PREFIX}}/services/explorationContextService.js"></script>
<script src="{{TEMPLATE_DIR_PREFIX}}/services/IdGenerationService.js"></script>
<script src="{{TEMPLATE_DIR_PREFIX}}/services/DebouncerService.js"></script>
Expand Down
6 changes: 3 additions & 3 deletions core/templates/dev/head/pages/preferences/Preferences.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@

oppia.controller('Preferences', [
'$scope', '$http', '$rootScope', '$modal', '$timeout', '$translate',
'alertsService', 'UrlInterpolationService', 'utilsService',
'alertsService', 'UrlInterpolationService', 'UtilsService',
'DASHBOARD_TYPE_CREATOR', 'DASHBOARD_TYPE_LEARNER',
function(
$scope, $http, $rootScope, $modal, $timeout, $translate, alertsService,
UrlInterpolationService, utilsService, DASHBOARD_TYPE_CREATOR,
UrlInterpolationService, UtilsService, DASHBOARD_TYPE_CREATOR,
DASHBOARD_TYPE_LEARNER) {
var _PREFERENCES_DATA_URL = '/preferenceshandler/data';
$rootScope.loadingMessage = 'Loading';
Expand Down Expand Up @@ -63,7 +63,7 @@ oppia.controller('Preferences', [

if (subjectInterests instanceof Array) {
for (var i = 0; i < subjectInterests.length; i++) {
if (utilsService.isString(subjectInterests[i])) {
if (UtilsService.isString(subjectInterests[i])) {
if (!TAG_REGEX.test(subjectInterests[i])) {
$scope.subjectInterestsWarningText = (
'Subject interests should use only lowercase letters.');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* be attempted due to cross-domain security issues.)
*/

oppia.factory('messengerService', ['$log', '$window', function($log, $window) {
oppia.factory('MessengerService', ['$log', '$window', function($log, $window) {
var isPositiveInteger = function(n) {
return (typeof n === 'number' && n % 1 === 0 && n > 0);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

oppia.constant('SEARCH_DATA_URL', '/searchhandler/data');

oppia.factory('searchService', [
oppia.factory('SearchService', [
'$http', '$rootScope', '$translate', 'SEARCH_DATA_URL',
function($http, $rootScope, $translate, SEARCH_DATA_URL) {
var _lastQuery = null;
Expand Down
Loading

0 comments on commit ab15c39

Please sign in to comment.