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 #10474: Enables strict typescript checks for some files - (8) #13204

Merged
merged 59 commits into from
Jul 5, 2021

Conversation

mridul-netizen
Copy link
Contributor

@mridul-netizen mridul-netizen commented Jun 24, 2021

Overview

  1. This PR fixes or fixes part of Make typescript checks strict #10474 .
  2. This PR does the following: [Make Typescript checks strict for some files]

Essential 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 linter/Karma presubmit checks have passed locally on your machine.
  • "Allow edits from maintainers" is checked. (See here for instructions on how to enable it.)
    • This lets reviewers restart your CircleCI tests for you.
  • The PR is made from a branch that's not called "develop".

Proof that changes are correct

image

PR Pointers

  • Make sure to follow the instructions for making a code change.
  • Oppiabot will notify you when you don't add a PR_CHANGELOG label. If you are unable to do so, please @-mention a code owner (who will be in the Reviewers list), or ask on Gitter.
  • For what code owners will expect, see the Code Owner's wiki page.
  • Make sure your PR follows conventions in the style guide, otherwise this will lead to review delays.
  • Never force push. If you do, your PR will be closed.
  • Oppiabot can assign anyone for review/help if you leave a comment like the following: "{{Question/comment}} @{{reviewer_username}} PTAL"
  • Some of the e2e tests are flaky, and can fail for reasons unrelated to your PR. We are working on fixing this, but in the meantime, if you need to restart the tests, please check the "If your build fails" wiki page.

Files Covered

    "core/templates/domain/statistics/PlaythroughObjectFactory.ts",
    "core/templates/domain/statistics/PlaythroughObjectFactorySpec.ts",
    "core/templates/domain/platform_feature/platform-feature-admin-backend-api.service.ts",
    "core/templates/domain/platform_feature/platform-feature-admin-backend-api.service.spec.ts",
    "core/templates/domain/improvements/improvements.constants.ts",
    "core/templates/domain/exploration/visualization-info.model.ts",
    "core/templates/domain/exploration/visualization-info.model.spec.ts",
    "core/templates/domain/email-dashboard/email-dashboard-backend-api.service.ts",
    "core/templates/domain/email-dashboard/email-dashboard-backend-api.service.spec.ts",
    "core/templates/domain/platform_feature/platform-parameter.model.ts",
    "core/templates/domain/platform_feature/platform-parameter.model.spec.ts",
    "extensions/rich_text_components/Tabs/directives/oppia-noninteractive-tabs.component.ts",
    "extensions/rich_text_components/Collapsible/directives/oppia-noninteractive-collapsible.component.ts",
    "extensions/objects/templates/position-of-terms-editor.component.ts",
    "extensions/objects/templates/position-of-terms-editor.component.spec.ts",
    "extensions/objects/templates/music-phrase-editor.component.ts",
    "extensions/interactions/GraphInput/directives/oppia-short-response-graph-input.component.ts",
    "extensions/interactions/GraphInput/directives/oppia-response-graph-input.component.ts",
    "core/templates/services/auth.service.ts",
    "core/templates/services/auth.service.spec.ts",
    "core/templates/filters/string-utility-filters/wrap-text-with-ellipsis.pipe.ts",
    "core/templates/filters/string-utility-filters/wrap-text-with-ellipsis.pipe.spec.ts",
    "core/templates/services/stateful/focus-manager.service.ts",
    "core/templates/services/stateful/focus-manager.service.spec.ts",
    "core/templates/domain/topics_and_skills_dashboard/topics-and-skills-dashboard-filter.model.ts",
    "core/templates/domain/topics_and_skills_dashboard/topics-and-skills-dashboard-filter.model.spec.ts",
    "core/templates/domain/story/story-summary.model.ts",
    "core/templates/domain/story/story-summary.model.spec.ts",

PasteBin to Errors - link

@oppiabot
Copy link

oppiabot bot commented Jun 30, 2021

Hi @mridul-netizen. Due to recent changes in the "develop" branch, this PR now has a merge conflict. Please follow this link if you need help resolving the conflict, so that the PR can be merged. Thanks!

Copy link
Member

@srijanreddy98 srijanreddy98 left a comment

Choose a reason for hiding this comment

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

Just a follow up to @kevintab95's comment otherwise LGTM

if (this._topicUrlFragment !== undefined) {
return this._topicUrlFragment;
}
throw new Error('Topic Url Fragment is undefined');
Copy link
Member

Choose a reason for hiding this comment

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

Do we throw errors in get methods in models normally? We expect validation methods to do these checks and report errors in the appropriate place.

I think it's fine to keep validation here. If this skips some sort of validation and ends up here, we would want to know. But, this should not be here in a getter. You should do this check in the setter. (If undefined for _topicUrlFragment is not a valid value, it shouldn't be allowed to set to undefined in the first place. Can you throw an error there?)

@oppiabot
Copy link

oppiabot bot commented Jul 2, 2021

Unassigning @srijanreddy98 since the review is done.

Copy link
Member

@kevintab95 kevintab95 left a comment

Choose a reason for hiding this comment

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

LGTM for core/templates/domain/exploration/visualization-info.model.ts. Thanks @mridul-netizen!

@oppiabot
Copy link

oppiabot bot commented Jul 2, 2021

Unassigning @kevintab95 since they have already approved the PR.

Copy link
Contributor

@aks681 aks681 left a comment

Choose a reason for hiding this comment

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

Lgtm as codeowner

@oppiabot
Copy link

oppiabot bot commented Jul 3, 2021

Hi @mridul-netizen. Due to recent changes in the "develop" branch, this PR now has a merge conflict. Please follow this link if you need help resolving the conflict, so that the PR can be merged. Thanks!

@mridul-netizen
Copy link
Contributor Author

@iamprayush @srijanreddy98 PTAL

Copy link
Contributor

@iamprayush iamprayush left a comment

Choose a reason for hiding this comment

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

LGTM for code-owner files!

@iamprayush iamprayush removed their assignment Jul 5, 2021
@srijanreddy98 srijanreddy98 merged commit a84b5ff into oppia:develop Jul 5, 2021
@mridul-netizen mridul-netizen deleted the st-8 branch July 5, 2021 15:47
vojtechjelinek added a commit to vojtechjelinek/oppia that referenced this pull request Jul 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants