-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Conversation
This reverts commit 13424bf.
@YashJipkate, ptal at the failing tests! (I've restarted them after Sean restarted them and it still fails.) |
Hi @YashJipkate. 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! |
canPublishTopicBool: boolean; | ||
canEditTopicBool: boolean; | ||
}) { | ||
topicRightsBackendObject: any) { |
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 concerns me. Why does typing raise errors?
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 because if I type it then can_publish_topic
would raise a lint error, so I changed it to camelCase. But this also needs to changed everywhere it is being referenced and most importantly in all of the backend since it is passed as a dict with these keys. So, this comes under 'complex' criteria and I decided to type it as any
I think we should file an issue to overcome this. Note that this might be tricky because I think pylint has a rule against naming in camelCase and favors underscore_case.
What do you think?
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.
Yes, I understand the complexity. One thing I'd say is -- for anything like this, please file an issue proactively (and leave a comment here pointing to it), don't wait for a reviewer to point it out. Thanks!
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.
Okay I will keep that in mind in the future.
Raised #7176,
Thanks!
@@ -15,6 +15,9 @@ | |||
/** | |||
* @fileoverview Service for managing CSRF tokens. | |||
*/ | |||
|
|||
import * as $ from 'jquery'; |
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 a bit concerning. What's going on here?
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 actually a fix to something not going well with Karma. After the introduction of Angular and upgrading some services, this service started to come under Angular zone due to it being dependency, now the zone was not able to find AJAX directly as a global like we do in AngularJS (the same reason we cannot upgrade the constants like INTERACTION_SPECS
which are defined in a global variable).
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.
And hence we need to import it specifically, like we do for all the Angular things (like the imports in AppInit.ts are explicit and do not depend on global definitions)
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.
There needs to be a comment for things like this, which explains what is going on and that points to an authoritative link explaining the context behind such a solution. Developers won't understand it.
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.
Okay I will add a comment to it.
But about a link, I do not have one because I discovered this fix myself. There is one open question in which the problem of OP is the same as mine but he also did not get a correct answer, I myself have posted an answer on it which was this very fix. I don't know which link to provide.
Could you please give some suggestions?
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.
You can link to that thread. Also, explain in the comment what this syntax is actually doing.
(Thanks for helping other folks on StackOverflow, btw!)
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.
Done!
@seanlip @kevinlee12 The tests pass now. PTAL! |
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.
OK, lgtm!
Explanation
Upgrades:
Checklist
python scripts/pre_commit_linter.py
andbash scripts/run_frontend_tests.sh
.