Skip to content

Consolidate outcomes logic into outcomes state and deprecate project-outcome-alignment#470

Open
sheshankarvapally wants to merge 1 commit intothoth-tech:10.0.xfrom
sheshankarvapally:project-outcome-alignment-clean-v2
Open

Consolidate outcomes logic into outcomes state and deprecate project-outcome-alignment#470
sheshankarvapally wants to merge 1 commit intothoth-tech:10.0.xfrom
sheshankarvapally:project-outcome-alignment-clean-v2

Conversation

@sheshankarvapally
Copy link
Copy Markdown

Title:
Consolidate outcomes logic into outcomes state and deprecate project-outcome-alignment


Summary:

This PR consolidates the outcomes feature by making the outcomes state
(doubtfire.projects.states.outcomes) the single source of truth and removing
duplicate logic previously shared with the project-outcome-alignment component.


Background:

During dependency investigation of the projects module (projects.coffee), it was found that:

  • The project-outcome-alignment component is still active, even though it is marked as "not used"
  • The same outcomes-related logic exists in both:
    • states/outcomes/outcomes.coffee
    • project-outcome-alignment/project-outcome-alignment.coffee

Both implementations handle:

  • target calculation
  • progress tracking
  • class statistics loading
  • chart refresh and update events

This duplication creates a migration blocker because there is no clear source of truth.


Changes in this PR:

  1. Outcomes state is now the source of truth

    • Retained all outcomes logic inside:
      src/app/projects/states/outcomes/outcomes.coffee
  2. Outcomes UI is now rendered directly from the state

    • Replaced:

      with direct template rendering inside outcomes.tpl.html
  3. Removed duplication from project-outcome-alignment

    • Converted it into a thin/deprecated wrapper
    • Removed controller logic to eliminate duplication
  4. Updated parent module dependencies

    • Removed:
      doubtfire.projects.project-outcome-alignment
    • Kept only active dependencies
  5. Added clear documentation in code

    • Updated misleading comments
    • Documented overlap and consolidation decision

What was NOT changed:

  • The project-outcome-alignment files are intentionally NOT deleted yet
  • The AngularJS module import (if still present) is also left untouched

Reason:
This keeps the PR safe and allows reviewers to confirm that there are no hidden dependencies before full removal.


Next Steps (Post Review):

If confirmed by reviewers, we can:

  • Remove:
    • project-outcome-alignment.coffee
    • project-outcome-alignment.tpl.html
  • Remove import from:
    src/app/doubtfire-angularjs.module.ts
  • Run a final cleanup to fully eliminate the deprecated module

Impact:

  • No functional behaviour changes expected
  • Reduces duplication in outcomes feature
  • Establishes a clear source of truth
  • Removes a confirmed migration blocker
  • Improves maintainability and clarity for future refactoring

Testing:

  • Verified outcomes page loads correctly
  • Outcome Achievement tab works
  • Outcome Alignment tab works
  • No console errors related to module loading

Additional Notes:

This PR also confirms a previous task comment stating that
"project-outcome-alignment may be a blocker". This investigation validates that
concern, as the duplication directly impacts migration clarity.

Copy link
Copy Markdown

@WaelAlahamdi WaelAlahamdi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Sheshank, I reviewed and tested this PR locally.

The changes are limited to the expected outcomes/project-outcome-alignment files and the scope looks appropriate.

I verified the functionality through:
http://localhost:4200/projects/2/outcomes

Both tabs are working correctly:

  • Outcome Achievement
  • Outcome Alignment

Approved from my side.

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.

2 participants