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

Upgrade more services to Angular 8 - III #7214

Merged
merged 141 commits into from
Jul 25, 2019
Merged

Upgrade more services to Angular 8 - III #7214

merged 141 commits into from
Jul 25, 2019

Conversation

YashJipkate
Copy link
Contributor

@YashJipkate YashJipkate commented Jul 24, 2019

Explanation

This PR upgrades:

  • AdminTaskManagerService
  • AngularNameService
  • AnswerStatsObjectFactory
  • AudioTranslationManagerService
  • AutoplayedVideosService
  • CodeNormalizerService
  • ContinueRulesService
  • EditabilityService
  • ImprovementsService
  • NumberAttemptsService
  • NumberAttemptsService
  • PlayerCorrectnessFeedbackEnabledService
  • RatingComputationService
  • SchemaDefaultValueService
  • SchemaUndefinedLastElementService
  • SolutionValidityService
  • SuggestionModalService
  • VoiceoverObjectFactory

Checklist

  • The PR title starts with "Fix #bugnum: ", followed by a short, clear summary of the changes. (If this PR fixes part of an issue, prefix the title with "Fix part of #bugnum: ...".)
  • The PR explanation includes the words "Fixes #bugnum: ..." (or "Fixes part of #bugnum" if the PR only partially fixes an issue).
  • The linter/Karma presubmit checks have passed.
    • These should run automatically, but if not, you can manually trigger them locally using python scripts/pre_commit_linter.py and bash scripts/run_frontend_tests.sh.
  • The PR is made from a branch that's not called "develop".
  • The PR has an appropriate "CHANGELOG: ..." label (If you are unsure of which label to add, ask the reviewers for guidance).
  • The PR follows the style guide.
  • The PR addresses the points mentioned in the codeowner checks for the files/folders changed. (See the codeowner's wiki page.)
  • The PR is assigned to an appropriate reviewer.
    • If you're a new contributor, please ask on Gitter for someone to assign a reviewer and don't tick this checkbox.
    • If you're not sure who the appropriate reviewer is, please assign to the issue's "owner" -- see the "talk-to" label on the issue. Do not only request the review but also add the reviewer as an assignee.

Copy link
Contributor

@kevinlee12 kevinlee12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great for the most part, just two comments, PTAL!

@YashJipkate YashJipkate reopened this Jul 24, 2019
Copy link
Contributor

@kevinlee12 kevinlee12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@kevinlee12 kevinlee12 removed their assignment Jul 24, 2019
@kevinlee12
Copy link
Contributor

@seanlip @vojtechjelinek ptal!

Copy link
Member

@seanlip seanlip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @YashJipkate, took a pass -- PTAL. Thanks!

import { downgradeInjectable } from '@angular/upgrade/static';

export interface IAnswerStatsBackendDict {
// TODO(YashJipkate): Replace 'any' with the exact type. This has been kept as
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remember to update the list in #7176 -- we've discussed that in previous PRs and I shouldn't need to send a reminder about this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

// TODO(YashJipkate): Replace 'any' with the exact type. This has been kept as
// 'any' because 'schema' is a complex dict requiring very careful
// backtracking.
// https://github.com/oppia/oppia/issues/7165
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto. Update #7165 with a checkbox list. Do this for past PRs as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

@@ -34,6 +42,27 @@ require('App.ts');
require('pages/exploration-editor-page/services/exploration-states.service.ts');
require('services/StateTopAnswersStatsService.ts');

class MockAnswerStats {
answer: any;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where are the comments for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, this is in AngularJS, therefore I did not add comments.
I'll add them too.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah -- I think AngularJS/Angular is the same as far as TypeScript is concerned, so yep, please add the necessary todos/comments for any code you touch.

@@ -26,6 +26,15 @@ describe('Rule spec services', function() {
angular.mock.module('oppia');
});

beforeEach(angular.mock.module('oppia', function($provide) {
$provide.value('CodeNormalizerService', new CodeNormalizerService());
// This service is not mocked by using its actual class instance since the
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand what this comment is trying to say, sorry. Can you elaborate more please?

In particular, what exactly do you mean by "iterative way"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, the rulesSpec uses a loop to go through the services and initializes them in an 'iterative' way and therefore needs to have consistency and thus have to be all initialized the same way.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a much better explanation (especially re the consistency and the need to initialize them in the same way). Please say that in the comment :)

@seanlip seanlip assigned YashJipkate and unassigned seanlip Jul 24, 2019
Copy link
Member

@seanlip seanlip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. @vojtechjelinek, PTAL, then this can be merged.

Copy link
Contributor

@vojtechjelinek vojtechjelinek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Just on speed-related comment!

@YashJipkate
Copy link
Contributor Author

@seanlip @kevinlee12 @vojtechjelinek The tests now pass. PTAL!

@seanlip seanlip merged commit 88e062c into oppia:develop Jul 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants