-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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 #7145
Merged
Merged
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
13424bf
Untested work on PlaythroughIssueObjectFactory.ts
YashJipkate 5c8bec3
Revert "Untested work on PlaythroughIssueObjectFactory.ts"
YashJipkate 3b51282
Merge branch 'develop' into ser-up-more
YashJipkate 3ae97e8
TopicRightsObjectFactory
YashJipkate 7f22747
Lint fix
YashJipkate ffa8a7e
Removed unnecessary constructor statement
YashJipkate 952d5c0
ClassifierObjectFactory
YashJipkate 41987d5
AnswerClassificationResultObjectFactory
YashJipkate 9990fe5
PredictionResultObjectFactory
YashJipkate 027340d
WrittenTranslationObjectFactory
YashJipkate cc0ec34
RuleObjectFactory
YashJipkate 906fd76
AudioTranslationObjectFactory
YashJipkate 5b56005
ExplorationDraftObjectFactory
YashJipkate 1502ad2
Fix failing FE in TopicRightsObjectFactory
YashJipkate f3a0997
Merge branch 'develop' into ser-up-more
YashJipkate 5e96b0f
Add force bootstrap to all pages
YashJipkate 6f906ef
function() -> () =>
YashJipkate feb8a4c
Merge
YashJipkate 56f61f0
Merge proper
YashJipkate 64f9fea
Merge branch 'develop' into ser-up-more
YashJipkate 69681da
Update mocking method
YashJipkate 04d7091
Merge branch 'develop' into ser-up-more
YashJipkate 727a6bf
More typing
YashJipkate abb470f
Audit and newline
YashJipkate d8e573b
Merge branch 'develop' into ser-up-more
YashJipkate 6fa6c50
Merge develop
YashJipkate 0ca2eae
Merge branch 'develop' into ser-up-more
YashJipkate 5c75b38
Stronger typing
YashJipkate 0e557bf
Fix FE
YashJipkate dff56fd
Address comments
YashJipkate e26e464
Remove newlines, TODO for imports, modify MockOutcome
YashJipkate aa5133d
Fix matcher case, modify TODO for imports
YashJipkate 951982b
Stronger typing in RuleObjectFactory
YashJipkate de7d2ad
Fix e2e
YashJipkate ce5cec8
Fix AJAX errors in Karma
YashJipkate b5c2ef9
Merge develop
YashJipkate b6f243f
Fix FE
YashJipkate 3df1a3d
Add comment in csrftoken
YashJipkate File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix matcher case, modify TODO for imports
- Loading branch information
commit aa5133d3df1db3f5556586c7893d4e541b3729de
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,20 +38,20 @@ export class TopicRights { | |
isPublished() { | ||
return this._published; | ||
} | ||
canPublishTopic = function() { | ||
canPublishTopic() { | ||
return this._canPublishTopic; | ||
} | ||
canEditName = function() { | ||
canEditName() { | ||
return this._canPublishTopic; | ||
} | ||
markTopicAsPublished = function() { | ||
markTopicAsPublished() { | ||
if (this._canPublishTopic) { | ||
this._published = true; | ||
} else { | ||
throw new Error('User is not allowed to publish this topic.'); | ||
} | ||
} | ||
markTopicAsUnpublished = function() { | ||
markTopicAsUnpublished() { | ||
if (this._canPublishTopic) { | ||
this._published = false; | ||
} else { | ||
|
@@ -61,7 +61,12 @@ export class TopicRights { | |
// Reassigns all values within this topic to match the existing | ||
// topic rights. This is performed as a deep copy such that none of the | ||
// internal, bindable objects are changed within this topic rights. | ||
copyFromTopicRights = function(otherTopicRights) { | ||
copyFromTopicRights( | ||
otherTopicRights: { | ||
isPublished: () => boolean; | ||
canEditTopic: () => boolean; | ||
canPublishTopic: () => boolean; | ||
}) { | ||
this._published = otherTopicRights.isPublished(); | ||
this._canEditTopic = otherTopicRights.canEditTopic(); | ||
this._canPublishTopic = otherTopicRights.canPublishTopic(); | ||
|
@@ -74,11 +79,16 @@ export class TopicRights { | |
export class TopicRightsObjectFactory { | ||
// This function takes a JSON object which represents a backend | ||
// topic python dict. | ||
createFromBackendDict(topicRightsBackendObject) { | ||
createFromBackendDict( | ||
topicRightsBackendObject: { | ||
published: boolean; | ||
canPublishTopicBool: boolean; | ||
canEditTopicBool: boolean; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I had to change |
||
}) { | ||
return new TopicRights( | ||
topicRightsBackendObject.published, | ||
topicRightsBackendObject.can_publish_topic, | ||
topicRightsBackendObject.can_edit_topic | ||
topicRightsBackendObject.canPublishTopicBool, | ||
topicRightsBackendObject.canEditTopicBool | ||
); | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I understand why these need to be added here. They don't seem to be used in the test?
There should probably be documentation somewhere to explain -- either here if it's specific to this, or in our wiki if it's a general principle to follow. In any case I think it would be nice to add a comment above line 25 explaining why lines 26-29 are needed. Do the same in all other similar files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not specific to this file, this is the case in many files. What's happening is that since we do not use isolated tests, these spec files depended upon the upgraded services and therefore angular mock could not interpret them.
This would be more suited to the wiki than a comment. I'll add this to the Angular wiki.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this something that would be removed after the full migration to Angular 8?
If so, we should add a TODO to remove them in the future, like Vojta did for some of the webpack requires. I realize that that might be repetitive, but we should do that anyway to make clear that this isn't a long-term practice to be followed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The statements can be removed once the corresponding non-spec file is upgraded.
Added the TODOs!