-
-
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
Improving the dev workflow: Milestone 1.2.3 Enable checks for directive scope #4980
Conversation
Update Fork
Update Fork
Update Fork
Update Fork
Update Fork
Update Fork
Update fork
Update fork
Update fork
Update fork
Update fork
Update Fork
Update fork
Update fork
Update fork
Update fork
Update fork
Update fork
Codecov Report
@@ Coverage Diff @@
## develop #4980 +/- ##
===========================================
+ Coverage 45.04% 45.16% +0.12%
===========================================
Files 392 397 +5
Lines 23705 23789 +84
Branches 3848 3849 +1
===========================================
+ Hits 10678 10745 +67
- Misses 13027 13044 +17
Continue to review full report at Codecov.
|
@seanlip and @kevinlee12: I have added a regex check for $scope.$parent. The only problem I am facing at the moment is the removal of $scope.$parent statements from RandomSelector and Copier. The pattern checks, therefore, will fail at the moment. I have tested the object templates locally. |
Can you explain your debugging process for RandomSelector and Copier, similar to what I showed you for how to debug the issue with the object templates? It would help to understand how far you've gotten. |
return scope.objType; | ||
}; | ||
element.html('<' + directiveName + | ||
' customization-args="customizationArgs"' + |
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.
Don't forget the spacing :)
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, 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.
I meant the indentation :)
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.
Whoops! Fixed.
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.
@kevinlee12 and @seanlip: I have fixed all directive scopes now. Just a single doubt. Thanks!
return scope.objType; | ||
}; | ||
element.html('<' + directiveName + | ||
' customization-args="customizationArgs"' + |
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, thanks!
}, true); | ||
|
||
$scope.$watch('$parent.objType', function() { | ||
$scope.objType = $scope.$parent.objType; | ||
$scope.objType = $scope.getObjType(); |
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 had a doubt here. How do we modify lines 47 and 51 to remove $scope.$parent?
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 don't know, but it looks like you might have addressed this :) (Though this needs careful and thorough manual testing of get/update/etc. operations.)
In general try to get rid of the $parent in the line above too, and have a lint check to forbid use of $parent
anywhere (not just scope.$parent).
Thanks!
…irective-scope-check
Functionality and code, it looks good up to this point, though please check if you can remove $parent from app.js. |
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.
lgtm, thanks for tackling this one!
@apb7, feel free to merge once tests pass. |
Merging, thanks @kevinlee12! |
…ve scope (oppia#4980) * isolate RandomSelector scope * change RandomSelector & Copier scope * Fix directive scope * modify scopes * isolate scopes * isolate scopes * isolate scopes(3) * Revert and fix * Run all e2e * isolate UnicodeStringEditor scope * Run all tests * isolate NormalizedStringEditor * isolate SanitizedUrlEditor * isolate BooleanEditor * isolate CodeStringEditor * isolate FractionEditor * isolate GraphEditor and GraphPropertyEditor * isolate HtmlEditor * Modify previous scopes, isolate IntEditor, ListOfUnicodeStringEditor * isolate LogicQuestionEditor * isolate LogicErrorCategoryEditor * isolate ImageWithRegionsEditor * isolate MathLatexStringEditor * isolate MusicPhraseEditor * isolate NonnegativeIntEditor * isolate ParameterNameEditor * isolate RealEditor * isolate SetOfHtmlStringEditor * isolate SetOfUnicodeStringEditor * isolate CoordTwoDimEditor * isolate FilepathEditor * Remove optional binding * isolate mobileFriendlyTooltip * isolate Copier * Revert: isolate Copier * isolate RandomSelector * isolate Copier * Fix SetOfHtmlStringEditor * Alphabetize scopes * Fix SetOfHtmlStringEditor * Fix ImageWithRegionsEditor * Fix GraphEditor * Fix SetOfHtmlStringEditor * Add regex check for . * Passed values via ObjectEditorDirective and made corresponding fixes * Remove parent from FractionEditor * Add functions to pass other values * Remove . from editor objects and fix scopes * Fix hanging indentation * Remove scope.parent statement from PencilCodeEditor * Fix Copier and RandomSelector directives * Remove scope.parent from RandomSelector * Add spaces * Remove watch blocks from Copier * Modify NumberWithUnitsEditor * Enable directive scope check * Remove parent from Copier * Add parent regexp in pre-commit script * Remove parent from directives * Fix indentation
Explanation
Fixes #4955
Checklist
python scripts/pre_commit_linter.py
andbash scripts/run_frontend_tests.sh
.