Refactor the CheckboxTreeElement to have static functions rather than call module functions for better extendability

Created on 15 January 2024, 5 months ago
Updated 16 January 2024, 5 months ago

Problem/Motivation

The CheckboxTreeElement calls many functions in the term_tree_reference.module file. It could be better to have these functions as static public functions within the class. This would allow people to extend CheckboxTreeElement if they need to add their own implementation, and would allow use of these functions but with the ability to override and extend easily if needed.

Steps to reproduce

Proposed resolution

Move all functions to public static functions within CheckboxTreeElement. Also move the flatten function called by TermReferenceTree into a public static function in TermReferenceTree.
Add a protected static function that just adds query tags to the query done by getChildren. This allows us to override the addQueryTags method to add our own query tags on a custom implementation of this.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ“Œ Task
Status

Needs review

Version

2.0

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom mjmorley

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024