Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-85533

Activity chooser: refactor code to adapt to prototype

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 5.1
    • Course
    • 5
    • C->HQ 2025 Sprint I2.2 Moppies

      This is the foundation issue for the new activity chooser design.

      The new activity chooser will add many new features to the current modal, such as: purpose categorisation, a new search UX, filtering, setup difficulty level, and an extra information panel about the plugins.

      Following a preliminary analysis of the existing activity chooser, it is clear that numerous unplanned additions have led to significant technical debt, compromising future maintainability. The prototype's design forces us to eliminate redundancies and reorganise misplaced code before integrating all the new features.

      This issue includes:

      • Deprecate the "activitychoosertabmode" setting. The Categories will be fixed to "all, favourites, recommended, activities and resources". This is important to reduce technical debt because this setting is generating many code redundancies right now. The activities/resources categories will be replaced in the next epic issue (MDL-85654) with the final purpose one.
      • Move all the logic related to the webservice processing to the 
        core_course/local/activitychooser/repository module. Currently, some logic is embedded in the main core_course/activitychooser module.
      • Remove redundancies in the templates. The navigation tabs and their content are hard-coded and duplicated several times. Now, the number of filters will increase from 5 to 8, and replicating HTML is no longer an option.
      • Move and refactor all logic to generate the templates' data to a new core_course/local/activity chooser/exporter module. Currently, this logic is unnecessarily complex and is embedded in the main core_course/activity chooser module.
      • Move all the activity chooser DOM manipulation to a new core_course/local/activity chooser/dialoguedom module. Right now, the DOM manipulation is embedded with the dialogue logic, which makes any UI change more complicated than it should.
      • Move the search results inside the "all" tabs. This is a requirement of the new layout and will alter the current search logic.
      • Change the modal layout to accommodate a longer list of filters by using a grid layout like the prototype. It is important to note that the goal of this point is not to match the prototype styling (this will be done in another issue), and it will focus on the general grid layout.
      • Fix, clean and create behat scenarios related to the activity chooser filtering.

      After the patch, the activity chooser will look somewhat like this:

       

            tusefomal Ferran Recio
            tusefomal Ferran Recio
            Carlos Escobedo Carlos Escobedo
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 hours, 33 minutes
                2h 33m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.