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
Migration of Individual Pages from Webpack/AngularJS to Lazy-Loaded Angular Modules #19435
Comments
Hi @DubeySandeep, |
@jnvtnguyen I've assigned you to |
@DubeySandeep Alright, do I create a pull request when I finish the Moderator migration? |
Hey @DubeySandeep, can I work on a page too? |
@jnvtnguyen Yes! Also, you can create a draft PR if after completing all the steps mentioned above you are not able to fix any issue raised during testing! (This will help me check the changes and guied you better!) |
Hi @Vir-8 Thanks for showing interest in this issue! :) I've assigned you to |
Sure thing, thanks! |
Hi, I will work on the |
Sure @DubeySandeep .Thank you for assigning me to issue #19453. |
Hi @DubeySandeep |
@retrogtx I've assigned you to |
Hi @DubeySandeep , I am new to open source. I would like to contribute to the community and I would like to start from here. Can I be assigned with something? Also, Is there any other way I can communicate with you? As github discussion is kinda confusing for me. Thank you in advance. |
Hi @DubeySandeep , can I be assigned something? |
@DubeySandeep Sure thing, I'd love to work on migrating another page |
@shivanandan17 @arnavchhokra Thanks for showing interest in this issue, as this issue is critcal and needs to be resolved quickly, I'm only assigning it to someone completed devlopment env setup. Can you please share a screenshot presenting a running development env? |
@Vir-8 I've assigned you to Note: |
@arnavchhokra Thanks for sharing the screenshot, I've assigned you to |
Hello @DubeySandeep can i be assigned to something too? |
@KaterinaNakou2003 I've assigned you to |
Unassigned @Happyashbunny because of lack of activity! @abhisheksatpathy @pritam2317 Any update on the assigned part of the issue? |
@DubeySandeep Thank you!! |
Hi @DubeySandeep by tomorrow, I will create a pull request; only the backend testing portion is left. |
…ar Router (#19901) * Registered the COLLECTION_PLAYER page * Removed backend handler and updated the associated tests. * Removed URL to handler linkage in main.py * Added access validator * Deleted Redundant File collection-player-page.mainpage.html * Created Route Guard * Component Upgraded * Created Root Component Files * Updated Main Module * Updated Components in Module * Added module to App Routing * Updated Webpack Configuration * Added required spec files * Fixed a error * Fixed lint and frontend karma errors * Update authors since 7f6c6b6 (#19878) * Update core/templates/pages/about-page/about-page.constants.ts * Update AUTHORS * Update CONTRIBUTORS * Update contributors * Fixed lint and frontend karma errors * Fixed lint, frontend errors and backend errors. * resolved minor issues * Added access validator * Created Route Guard * resolved minor issues * Added access validator * Created Route Guard * Fixed lint, frontend errors and backend errors. * resolved minor issues * format code with prettier * format code with prettier * format code with prettier * format code with prettier --------- Co-authored-by: amaanlari <amaanlari@outlook.comm> Co-authored-by: Sean Lip <sean@seanlip.org>
@DubeySandeep ran into some errors, resolving them as of the moment. I'm really sorry for the delays, my mid-semester exams were going on. |
@DubeySandeep could you assign me subtopic viewer in the meantime? |
Hello @DubeySandeep |
@abhisheksatpathy I've reviewed your PR and looks like it needs some work, for now, let's focus on that PR and once it's in a good state I'll assign you another task from this issue. I hope that's fine! @Ahmed-Bhouri I've assigned you to @Lawful2002 Thanks for helping with this issue :), leave a comment when assigning anyone the task it helps better track the issue. |
@pritam2317 Any update on the assigned task? |
@DubeySandeep Sorry for the delay; I was busy writing a proposal. I'll create a PR within tommorow. |
* registered with frontend * removed backend handler for the page * correspoding tests for the backend handler removed * removed the link to the old handler * added access validator class for diagnostic test player * added url for the validator * added test class for diagnostic test player * removed redundant mainpage file * added service on frontend to call access validators defined on backend * removed 'downgradeComponent' page component * corrected constant.ts reference to diagnostic test player, added root page ts file * added diagnostic test player root template * removed excess imports and ngbootstrap form dtp module * added routes within the module * added the page to the app routing module * removed the module from webpack config * fix linter errors * fixed linter error * fix linter errorrs * added frontend tests for root component and validator service method * fixed url reference to validation service * fixed pytype check error * fixed merge conflict * fixed linter error * fixed MyPy type checks * removed unnecessary auth guard for diagnostics test player * implemented conditional rendering of the page, based on the feature flag value set in backend * backent test error fixed * added backend test for DiagnosticTestPlayerAccessValidationHandler * removed unused import in the module * correct the component name being tested by the karma test * added unit test for diagnostic test player root component * fixed linter errors * reverted unwanted changes * linter check fixed * delegated error handling * fix linter errors * modified unit tests to match the code changes in component * ran prettier for code formatting * refactored code to include a route guard (instead of error 404 logic inside component) * minor typo fix * reverted relave paths to to alias-based paths for consistency
* registered the page in constant file * removed the backend handler for the page * removed handler linked in main.py * removed linked test to the page * added access validator * added tests for access validator * facilitator dashboard access validation handler added to main.py * fixed indentation * added validatation function to access validation backend api service * added test for validation service method * facilitator dashboard root page added * added unit tests for facilitator dashboard root page * removed downgrade of the component * cleaned up facilitator dashboard module file * added router module * registered the facilitator dashboard page to routing module * removed the page from webpack * minor refactor * modified linters checks * liter checks fixed * fixed unit test * fixed minor misspellings * added route guard for navigation for error page * added unit tests for route guard * minor renaming of classes and file * fixed unit tests * fixed typo * adds passive event listener to facilitator dashboard page
* Translate exploration text * fixes frontend coverage * fixes frontend coverage * fixes frontend coverage * fixes frontend coverage * fixes frontend coverage * fixes frontend test * fixes frontend test * fixes frontend test * fixes frontend statement * fixes frontend statement * fixes frontend statement * fixes frontend statement * fixes frontend statement * lazy loading of collection editor page * lazy loading of collection editor page * fixes linter checks * fixes backend issue * Fixes backend test * Address review comments * fixes access-validation test * fixes access validators test * fixes handler name * Fixes backend coverage * fixes webpack configuration
Hi @DubeySandeep, My PR got closed(stale) as I have exams going on rn. I will open another PR on migration of topic viewer page asap! Sorry for the troubles |
Description:
This issue aims to move individual page compilations from using Webpack (as AngularJS modules) to lazy-loaded Angular modules. This migration ensures each page has its own Angular module and is loaded only when needed, enhancing application performance. It also facilitates the shift from the AngularJS compilation process to Angular modules. Completing this migration will allow for the removal of Webpack and AngularJS-related code from our codebase.
Routes requiring these changes:
Ready for work:
exploration_editor (@srijanreddy98)
Story Editor (webpack section)
Topic Editor (webpack section)
Assigned(0):
In-review(5):
Subtopic Viewer (webpack section)
Review Test (webpack section) @Ahmed-Bhouri Fix part of issue #19435: Migrate the Review Test page #20117
Topic Viewer (webpack section) @abhisheksatpathy Fix part of #19435: Topic Viewer Page migration #20050
Skill Editor (webpack section) @shivanandan17 Fix part of issue #19435: Migrate Skill Editor Page #19882
Topics and Skills Dashboard (webpack section) @jnvtnguyen Fix part of #19435: Migrate topics and skills dashboard and creator dashboard #19819
Creator dashboard (webpack section) @jnvtnguyen Fix part of #19435: Migrate topics and skills dashboard and creator dashboard #19819
Completed(15):
Collection Editor (webpack section) @pritam2317 Fix part of #19435: Migrate collection editor page #20116
Facilitator Dashboard (webpack section) @sagar-subedi Fix part of #19435: Migrate Facilitator Dashboard #20022
Diagnostic test player (webpack section) Fix part of #19435: Migrate diagnostic test player page #19811
Voiceover admin @Nik-09 Introduces voice artist card in voiceover admin page #19884
Collection Player (webpack section) @amaanlari Fix part of issue #19435: Migrate the Collection Player page to Angular Router #19901
Learner Group Creator (webpack section) @AFZL210 Fix part of #19435: Migrate Learner Group Creator page #19826
Contributor dashboard Admin(webpack section) @shivanandan17 [16th Jan] Fix part of issue #19435: Migrate contributor dashboard Admin Page #19703
Blog Dashboard (webpack section) @AFZL210 Fix part of #19435: Blog dashboard page migration #19815
Learner Group Editor (webpack section) @AFZL210 Fix part of #19435: Learner group editor page migration #19761
Classroom Admin (webpack section) @Vir-8 Fix part of #19435: Learner dashboard and curriculum admin page migration #19508
Email Dashboard (webpack section) @sagar-subedi Fix part of #19435: Migrate Email Dashboard #19627
Learner dashboard (webpack section) @Vir-8 Fix part of #19435: Learner dashboard and curriculum admin page migration #19508
Contributor dashboard (webpack section) @jnvtnguyen Fix part of #19435: Migrate Contributor Dashboard #19467
Blog admin (webpack section) @Vir-8 #Fix part of #19435: Migrate Blog Admin page #19471
Moderator (webpack section) @jnvtnguyen Fix part of issue #19435: Migrate Moderator Page #19449
Required changes:
Before making any changes, please navigate to the relevant page on your local machine (on the develop branch) and check that you understand how to reach it. Try out the behaviour of that page to get some idea of how it works, so that you can verify that the page continues to work fine after the changes below.
Backend changes:
Register the Page:
PAGES_REGISTERED_WITH_FRONTEND
. ReferenceRemove Backend Handler:
<page-name>.mainpage.html
. ReferenceRemove URL-to-handler linkage in
main.py
:main.py
, remove the line that links url to the old handler which is removed in the above step. ReferenceNote: For each task, a link to the relevant URL-to-handler linkage in main.py is provided under the 'Route' bullet.
Add access validator
Frontend changes:
Delete Redundant File:
<page-name>.mainpage.html
file. ReferenceCreate Route Guard:
canActivate
function make a call to the newly created access-validator function and returntrue
if the user has permission else route to the error page and return false. ReferenceComponent Upgrade:
downgradeComponent
from thepage
component. ReferenceCreate Root Component Files:
<module-name>.root.component.ts
with title and meta. Reference<module-name>.root.component.html
. The template should use the relevant page-component. ReferenceUpdate Main Module:
providers
, Browser*Module, any HTTP module, and everything related to the router module. ReferencengDoBootstrap
from the module class and all code below the module class. ReferenceUpdate Components in Module:
declarations
of<module-name>.module.ts
:downgradeComponent
from the bottom. ReferencessmartRouterLink
torouterLink
. ReferenceAdd Module to App Routing:
app.routing.module.ts
withIsLoggedInGuard
[if required]. ReferenceUpdate Webpack Configuration:
How to test all the changes:
Helpful Tips
Reference Pull Request (PR): While working on your changes, refer to the PR at #18855. Your updates may not require all the modifications in that PR, but they will likely overlap.
Seeking Help: If you encounter persistent errors after applying your changes and can't resolve them despite multiple attempts, you can seek assistance from @DubeySandeep and others. To do this effectively:
Prepare a Draft PR: Initiate a draft pull request on GitHub incorporating all your changes.
Document Your Attempts: Create a debugging doc to fully describe the issues you are running into and the solutions you've tried, so that others can help you more easily.
Reach Out for Help: Contact @DubeySandeep via email (dubeysandeep.in@gmail.com). Include in your communication:
Need help with #19435
"In addition, please leave a comment on this issue thread with the above details as well.
To remove webpack requirements for the codebase, firstly we need to get #19435 resolved though even after this we will be left with some pages which cannot be removed using the steps mentioned in #19435. This issue list outs all the remaining tasks (excluding #19435) required to be completed before removing webpack:
/console-errors
page as it's no more needed./maintenance
page via OppiaRootHandler nad move the maintenance page to angular.The text was updated successfully, but these errors were encountered: