Skip to content

Commit

Permalink
Revert PRs oppia#7341 and oppia#7293 to unbreak the build. (oppia#7349)
Browse files Browse the repository at this point in the history
* Revert "Add null to calls to navigateToMainTab (oppia#7341)"

This reverts commit 1a0f5b5.

* Revert "Fix typescript errors and add a new config file for compilation checks (oppia#7293)"

This reverts commit 9c272c4.
  • Loading branch information
seanlip authored Aug 10, 2019
1 parent 1a0f5b5 commit 11f8ae4
Show file tree
Hide file tree
Showing 209 changed files with 467 additions and 539 deletions.
1 change: 0 additions & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
# Angular Migration team
/typings/ @ankita240796
/tsconfig.json @ankita240796
/tsconfig-for-compile-check.json @ankita240796


# Answer classification team.
Expand Down
4 changes: 2 additions & 2 deletions core/templates/dev/head/App.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ require('domain/utilities/UrlInterpolationService.ts');

require('app.constants.ajs.ts');

// The following file uses constants in app.constants and hence needs to be
// loaded after app.constants
// The following file uses constants in app.constants.ts and hence needs to be
// loaded after app.constants.ts
require('I18nFooter.ts');

angular.module('oppia').config([
Expand Down
2 changes: 2 additions & 0 deletions core/templates/dev/head/AppInit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ const bootstrapFn = (extraProviders: StaticProvider[]) => {
};
const downgradedModule = downgradeModule(bootstrapFn);

declare var angular: any;

angular.module('oppia', [
'dndLists', 'headroom', 'infinite-scroll', 'ngAnimate',
'ngAudio', 'ngCookies', 'ngImgCrop', 'ngJoyRide', 'ngMaterial',
Expand Down
8 changes: 4 additions & 4 deletions core/templates/dev/head/AppSpec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
// TODO(#7222): Remove the following block of unnnecessary imports once
// App.ts is upgraded to Angular 8.
import { ParamChangeObjectFactory } from
'domain/exploration/ParamChangeObjectFactory';
import { RuleObjectFactory } from 'domain/exploration/RuleObjectFactory';
'domain/exploration/ParamChangeObjectFactory.ts';
import { RuleObjectFactory } from 'domain/exploration/RuleObjectFactory.ts';
import { VoiceoverObjectFactory } from
'domain/exploration/VoiceoverObjectFactory';
'domain/exploration/VoiceoverObjectFactory.ts';
import { WrittenTranslationObjectFactory } from
'domain/exploration/WrittenTranslationObjectFactory';
'domain/exploration/WrittenTranslationObjectFactory.ts';
// ^^^ This block is to be removed.

describe('Constants Generating', function() {
Expand Down
2 changes: 1 addition & 1 deletion core/templates/dev/head/app.constants.ajs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

// TODO(#7092): Delete this file once migration is complete and these AngularJS
// equivalents of the Angular constants are no longer needed.
import { AppConstants } from 'app.constants';
import { AppConstants } from 'app.constants.ts';

for (var constantName in constants) {
angular.module('oppia').constant(constantName, constants[constantName]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ angular.module('oppia').directive('audioFileUploader', [
'audio-file-uploader-form' + IdGenerationService.generateNewId());
angular.element(document).on(
'change', '.' + scope.inputFieldClassName, function(evt) {
var file = (<HTMLInputElement>evt.currentTarget).files[0];
var file = evt.currentTarget.files[0];
if (!file) {
scope.onFileCleared();
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,8 @@ angular.module('oppia').directive('imageUploader', [
'image-uploader-file-input' + IdGenerationService.generateNewId());
angular.element(document).on(
'change', '.' + scope.fileInputClassName, function(evt) {
var file = (<HTMLInputElement>evt.currentTarget).files[0];
var filename = (<HTMLInputElement>evt.target).value.split(
/(\\|\/)/g).pop();
var file = evt.currentTarget.files[0];
var filename = evt.target.value.split(/(\\|\/)/g).pop();
scope.errorMessage = validateUploadedFile(file, filename);
if (!scope.errorMessage) {
// Only fire this event if validations pass.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -420,8 +420,8 @@ angular.module('oppia').directive('questionPlayer', [
WRONG_ANSWER_PENALTY_FOR_MASTERY;
}
} else {
for (var masterySkillId in masteryChangePerQuestion) {
masteryChangePerQuestion[masterySkillId] -=
for (var skillId in masteryChangePerQuestion) {
masteryChangePerQuestion[skillId] -=
WRONG_ANSWER_PENALTY_FOR_MASTERY;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
// TODO(#7222): Remove the following block of unnnecessary imports once
// question-player-state.service.ts is upgraded to Angular 8.
import { ParamChangeObjectFactory } from
'domain/exploration/ParamChangeObjectFactory';
import { RuleObjectFactory } from 'domain/exploration/RuleObjectFactory';
'domain/exploration/ParamChangeObjectFactory.ts';
import { RuleObjectFactory } from 'domain/exploration/RuleObjectFactory.ts';
import { VoiceoverObjectFactory } from
'domain/exploration/VoiceoverObjectFactory';
'domain/exploration/VoiceoverObjectFactory.ts';
import { WrittenTranslationObjectFactory } from
'domain/exploration/WrittenTranslationObjectFactory';
'domain/exploration/WrittenTranslationObjectFactory.ts';
// ^^^ This block is to be removed.

require(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/

import { RatingComputationService } from
'components/ratings/rating-computation/rating-computation.service';
'components/ratings/rating-computation/rating-computation.service.ts';

describe('Rating computation service', () => {
let ratingComputationService: RatingComputationService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,16 @@ angular.module('oppia').directive('scoreRing', [
controller: ['$scope', '$timeout', '$window', 'COLORS_FOR_PASS_FAIL_MODE',
function($scope, $timeout, $window, COLORS_FOR_PASS_FAIL_MODE) {
var ctrl = this;

const circle = <SVGCircleElement>(
document.querySelector('.score-ring-circle'));
const radius = circle.r.baseVal.value;
const circumference = (radius * 2 * Math.PI);

var setScore = function(percent) {
const offset = circumference - percent / 100 * circumference;
circle.style.strokeDashoffset = offset.toString();
circle.style.strokeDashoffset = offset;
};

const circle = document.querySelector('.score-ring-circle');
const radius = circle.r.baseVal.value;
const circumference = radius * 2 * Math.PI;
circle.style.strokeDasharray = `${circumference} ${circumference}`;
circle.style.strokeDashoffset = circumference.toString();
circle.style.strokeDashoffset = circumference;
$scope.$watch(function() {
return ctrl.getScore();
}, function(newScore) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

/* eslint-disable max-len */
import { SolutionValidityService } from
'pages/exploration-editor-page/editor-tab/services/solution-validity.service';
'pages/exploration-editor-page/editor-tab/services/solution-validity.service.ts';
/* eslint-enable max-len */

require(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
// TODO(#7222): Remove the following block of unnnecessary imports once
// state-property.service.ts is upgraded to Angular 8.
import { ExplorationDraftObjectFactory } from
'domain/exploration/ExplorationDraftObjectFactory';
'domain/exploration/ExplorationDraftObjectFactory.ts';
// ^^^ This block is to be removed.

require('pages/exploration-editor-page/services/change-list.service.ts');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
// TODO(#7222): Remove the following block of unnnecessary imports once
// state-interaction-editor.directive.ts is upgraded to Angular 8.
import { ExplorationFeaturesService } from
'services/ExplorationFeaturesService';
'services/ExplorationFeaturesService.ts';
// ^^^ This block is to be removed.

require(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/

import { AnswerClassificationResultObjectFactory } from
'domain/classifier/AnswerClassificationResultObjectFactory';
'domain/classifier/AnswerClassificationResultObjectFactory.ts';

require('domain/exploration/OutcomeObjectFactory.ts');
require(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/

import { ClassifierObjectFactory } from
'domain/classifier/ClassifierObjectFactory';
'domain/classifier/ClassifierObjectFactory.ts';

describe('Classifier Object Factory', () => {
let classifierObjectFactory: ClassifierObjectFactory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* collection playthrough domain objects.
*/

import cloneDeep from 'lodash/cloneDeep';
import * as cloneDeep from 'lodash/cloneDeep';

import { downgradeInjectable } from '@angular/upgrade/static';
import { Injectable } from '@angular/core';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* collection rights domain objects.
*/

import cloneDeep from 'lodash/cloneDeep';
import * as cloneDeep from 'lodash/cloneDeep';

import { downgradeInjectable } from '@angular/upgrade/static';
import { Injectable } from '@angular/core';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/

import { CollectionRightsObjectFactory } from
'domain/collection/CollectionRightsObjectFactory';
'domain/collection/CollectionRightsObjectFactory.ts';

describe('Collection rights object factory', () => {
let collectionRightsObjectFactory: CollectionRightsObjectFactory = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
// TODO(#7222): Remove the following block of unnnecessary imports once
// CollectionUpdateService.ts is upgraded to Angular 8.
import { ChangeObjectFactory } from
'domain/editor/undo_redo/ChangeObjectFactory';
'domain/editor/undo_redo/ChangeObjectFactory.ts';
// ^^^ This block is to be removed.

require('domain/collection/CollectionObjectFactory.ts');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
// TODO(#7222): Remove the following block of unnnecessary imports once
// CollectionValidationService.ts is upgraded to Angular 8.
import { ChangeObjectFactory } from
'domain/editor/undo_redo/ChangeObjectFactory';
'domain/editor/undo_redo/ChangeObjectFactory.ts';
// ^^^ This block is to be removed.

require('domain/collection/CollectionNodeObjectFactory.ts');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* represents the progress of a guest playing through a collection.
*/

import cloneDeep from 'lodash/cloneDeep';
import * as cloneDeep from 'lodash/cloneDeep';

import { downgradeInjectable } from '@angular/upgrade/static';
import { Injectable } from '@angular/core';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/

import { GuestCollectionProgressObjectFactory } from
'domain/collection/GuestCollectionProgressObjectFactory';
'domain/collection/GuestCollectionProgressObjectFactory.ts';

describe('Guest collection progress object factory', () => {
let guestCollectionProgressObjectFactory:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
// TODO(#7222): Remove the following block of unnnecessary imports once
// GuestCollectionProgressService.ts is upgraded to Angular 8.
import { GuestCollectionProgressObjectFactory } from
'domain/collection/GuestCollectionProgressObjectFactory';
'domain/collection/GuestCollectionProgressObjectFactory.ts';
// ^^^ This block is to be removed.

require('domain/collection/CollectionNodeObjectFactory.ts');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { HttpClientTestingModule, HttpTestingController } from
import { TestBed, fakeAsync, flushMicrotasks } from '@angular/core/testing';

import { CreatorDashboardBackendApiService } from
'domain/creator_dashboard/CreatorDashboardBackendApiService';
'domain/creator_dashboard/CreatorDashboardBackendApiService.ts';

describe('Creator Dashboard backend API service', () => {
let creatorDashboardBackendApiService:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
// TODO(bhenning): Consolidate the backend ExplorationChange and
// CollectionChange domain objects.

import cloneDeep from 'lodash/cloneDeep';
import * as cloneDeep from 'lodash/cloneDeep';

import { downgradeInjectable } from '@angular/upgrade/static';
import { Injectable } from '@angular/core';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/

import { ChangeObjectFactory } from
'domain/editor/undo_redo/ChangeObjectFactory';
'domain/editor/undo_redo/ChangeObjectFactory.ts';

describe('Factory for Change domain objects', function() {
let changeObjectFactory: ChangeObjectFactory = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
// TODO(#7222): Remove the following block of unnnecessary imports once
// UndoRedoService.ts is upgraded to Angular 8.
import { ChangeObjectFactory } from
'domain/editor/undo_redo/ChangeObjectFactory';
'domain/editor/undo_redo/ChangeObjectFactory.ts';
// ^^^ This block is to be removed.

require('domain/editor/undo_redo/ChangeObjectFactory.ts');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* particular answer from some particular state.
*/

import cloneDeep from 'lodash/cloneDeep';
import * as cloneDeep from 'lodash/cloneDeep';

import { Injectable } from '@angular/core';
import { downgradeInjectable } from '@angular/upgrade/static';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/

import { ExplorationDraftObjectFactory, ExplorationDraft } from
'domain/exploration/ExplorationDraftObjectFactory';
'domain/exploration/ExplorationDraftObjectFactory.ts';

describe('ExplorationDraftObjectFactory', () => {
describe('exploration draft object factory', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@
// TODO(#7222): Remove the following block of unnnecessary imports once
// ExplorationObjectFactory.ts is upgraded to Angular 8.
import { ParamChangeObjectFactory } from
'domain/exploration/ParamChangeObjectFactory';
'domain/exploration/ParamChangeObjectFactory.ts';
import { ParamTypeObjectFactory } from
'domain/exploration/ParamTypeObjectFactory';
import { RuleObjectFactory } from 'domain/exploration/RuleObjectFactory';
'domain/exploration/ParamTypeObjectFactory.ts';
import { RuleObjectFactory } from 'domain/exploration/RuleObjectFactory.ts';
import { VoiceoverObjectFactory } from
'domain/exploration/VoiceoverObjectFactory';
'domain/exploration/VoiceoverObjectFactory.ts';
import { WrittenTranslationObjectFactory } from
'domain/exploration/WrittenTranslationObjectFactory';
'domain/exploration/WrittenTranslationObjectFactory.ts';
// ^^^ This block is to be removed.

require('domain/exploration/ExplorationObjectFactory.ts');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

// TODO(#7222): Remove the following block of unnnecessary imports once
// InteractionObjectFactory.ts is upgraded to Angular 8.
import { RuleObjectFactory } from 'domain/exploration/RuleObjectFactory';
import { RuleObjectFactory } from 'domain/exploration/RuleObjectFactory.ts';
// ^^^ This block is to be removed.

require('domain/exploration/AnswerGroupObjectFactory.ts');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* domain objects.
*/

import cloneDeep from 'lodash/cloneDeep';
import * as cloneDeep from 'lodash/cloneDeep';

import { Injectable } from '@angular/core';
import { downgradeInjectable } from '@angular/upgrade/static';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/

import { ParamTypeObjectFactory } from
'domain/exploration/ParamTypeObjectFactory';
'domain/exploration/ParamTypeObjectFactory.ts';

require('domain/exploration/ParamSpecObjectFactory.ts');
require('domain/exploration/ParamSpecsObjectFactory.ts');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* domain objects.
*/

import cloneDeep from 'lodash/cloneDeep';
import * as cloneDeep from 'lodash/cloneDeep';

import { Injectable } from '@angular/core';
import { downgradeInjectable } from '@angular/upgrade/static';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/

import { ParamTypeObjectFactory, ParamType } from
'domain/exploration/ParamTypeObjectFactory';
'domain/exploration/ParamTypeObjectFactory.ts';

describe('ParamType objects', () => {
let paramType: ParamTypeObjectFactory = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/

import { VoiceoverObjectFactory } from
'domain/exploration/VoiceoverObjectFactory';
'domain/exploration/VoiceoverObjectFactory.ts';

require('domain/exploration/RecordedVoiceoversObjectFactory.ts');
require('domain/exploration/VoiceoverObjectFactory.ts');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
// TODO(#7222): Remove the following block of unnnecessary imports once
// StatesObjectFactory.ts is upgraded to Angular 8.
import { ParamChangeObjectFactory } from
'domain/exploration/ParamChangeObjectFactory';
import { RuleObjectFactory } from 'domain/exploration/RuleObjectFactory';
'domain/exploration/ParamChangeObjectFactory.ts';
import { RuleObjectFactory } from 'domain/exploration/RuleObjectFactory.ts';
import { VoiceoverObjectFactory } from
'domain/exploration/VoiceoverObjectFactory';
'domain/exploration/VoiceoverObjectFactory.ts';
import { WrittenTranslationObjectFactory } from
'domain/exploration/WrittenTranslationObjectFactory';
'domain/exploration/WrittenTranslationObjectFactory.ts';
// ^^^ This block is to be removed.

require('domain/exploration/StatesObjectFactory.ts');
Expand Down
Loading

0 comments on commit 11f8ae4

Please sign in to comment.