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

Refactoring code in src/admin/admin.js (<4 nesting levels) #37

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Jdwashin9
Copy link

Resolves #27 (less than 4 levels of nesting, as opposed to under 5 levels). I made the logic for the more deeply nested functions into separate functions that were less embedded. For example, I coded the functions initlogout_message and showlogout_alert() and then called them in startLogoutTimer() so it included their logic. This considerably simplified the if (!logoutMessage) method and the logoutTimer variable. I also made the config_AjaxifyHooks(hooks, Settings) function and hooked it on to updatePageTitle(data.url), setupRestartLinks(), showCorrectNavTab(), startLogoutTimer(), setupToolTips(), and initializeSettings(Settings). Finally, I called config_AjaxifyHooks(hooks, Settings) inside the document ready function (moved to the bottom of my code).

@Jdwashin9
Copy link
Author

I used ChatGPT4 to write the following lines: 15-35, 45, 47, 50, 56-57, 72, 74-83, 100, 107, 209-231

@AZHenley AZHenley closed this Jan 21, 2025
@AZHenley AZHenley reopened this Jan 21, 2025
@coveralls
Copy link

Pull Request Test Coverage Report for Build 13220937056

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 82.671%

Totals Coverage Status
Change from base Build 12896760049: 0.0%
Covered Lines: 22323
Relevant Lines: 25582

💛 - Coveralls

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.

Refactoring code in src/admin/admin.js
3 participants