Assignment Overview:
This is a group assignment so you have been assigned some tasks. You have been assigned to perform maintenance activities on a legacy system assigned by the lecturer. The legacy system assigned to your group is Sahana Eden and it uses the web2py framework and Python language.
Assignment 1:


Figure: code in items.js before optimization
Before code optimization:
The code in the budget/item.js file demonstrates the use of an outdated JavaScript environment. This is evident from the reliance on jQuery for DOM manipulation and the usage of an older coding style and structure. Additionally, the presence of //<

After modification:
Hence, I have updated the items.js file to address these issues. Key improvements include caching DOM selectors. Rather than repeatedly querying the DOM with $(ā#budget_item_ā¦ā), elements are now stored
in variables to reduce the number of lookups, improving performance. Additionally, repetitive code for hiding and showing elements has been consolidated into single selectors or loops, reducing redundancy
and making the code more efficient.
To align with modern JavaScript practices, I have used arrow functions for handling tasks such as toggling cost inputs. Arrow functions are more concise and improve readability, making the code easier to maintain. An error was also fixed in the form submission handling, where the outdated and invalid
event.default() was being used. This was replaced with the correct event.preventDefault() method to ensure proper behavior.
Despite these updates, there are still errors in the modified code. These errors are likely due to compatibility issues where modern JavaScript features are being executed in an older environment that lacks support for ES6+ features. As a result, further modifications are necessary, including addressing any
environmental constraints and ensuring that the rest of the related files are updated to be compatible with the optimized code. This ongoing process will ensure a fully functional and modernized codebase without persisting errors.

Get 30% Discount on This Assignment Answer Today!


Get Solved Your Assignment( variable) and Earn A+ Grade!


The post Maintenance Activities on the Sahana Eden Legacy System | Group Assignment appeared first on Malaysia Assignment Help.