|
| 1 | +--- |
| 2 | +title: Full Angular Migration Plan - Inbox Component |
| 3 | +description: Complete migration plan for inbox component including parent dependency chain |
| 4 | +--- |
| 5 | + |
| 6 | +# Full Angular Migration Plan: Inbox Component |
| 7 | + |
| 8 | +**Date:** January 14, 2026 |
| 9 | +**By:** Husainuddin Mohammed, 223380186 |
| 10 | +**Task:** Complete full Angular migration for units/tasks/inbox |
| 11 | + |
| 12 | +--- |
| 13 | + |
| 14 | +## Component Dependency Chain |
| 15 | + |
| 16 | +``` |
| 17 | +units/index.coffee (Parent 1) |
| 18 | + ↓ |
| 19 | + Provides: unit, unitRole |
| 20 | + ↓ |
| 21 | +units/tasks/tasks.coffee (Parent 2) |
| 22 | + ↓ |
| 23 | + Provides: taskData object |
| 24 | + ↓ |
| 25 | +units/tasks/inbox/inbox.coffee (Child) |
| 26 | + ↓ |
| 27 | + Uses: unit, unitRole, taskData |
| 28 | +``` |
| 29 | + |
| 30 | +**The problem:** Inbox component needs data from two AngularJS parent states. Can't fully migrate |
| 31 | +inbox until parents are migrated. |
| 32 | + |
| 33 | +--- |
| 34 | + |
| 35 | +## What Each Parent Provides |
| 36 | + |
| 37 | +**Parent 1 (units/index.coffee):** |
| 38 | + |
| 39 | +- Loads unit object from API |
| 40 | +- Resolves user's role for this unit |
| 41 | +- Handles permissions and redirects |
| 42 | + |
| 43 | +**Parent 2 (units/tasks/tasks.coffee):** |
| 44 | + |
| 45 | +- Creates taskData object structure |
| 46 | +- Manages task selection logic |
| 47 | +- Syncs URL with selected task |
| 48 | + |
| 49 | +**Child (inbox.coffee):** |
| 50 | + |
| 51 | +- Sets task source function |
| 52 | +- Renders Angular InboxComponent |
| 53 | +- Already migrated to Angular - just needs parent cleanup |
| 54 | + |
| 55 | +--- |
| 56 | + |
| 57 | +## Migration Order: 3 PRs |
| 58 | + |
| 59 | +### PR 1: Migrate units/index (START HERE) |
| 60 | + |
| 61 | +**Status:** Already started - https://github.com/thoth-tech/doubtfire-web/pull/435 |
| 62 | + |
| 63 | +Migrate the root parent first. Replace AngularJS state with Angular resolvers that provide unit and |
| 64 | +unitRole data. |
| 65 | + |
| 66 | +**Files to change:** |
| 67 | + |
| 68 | +- Create Angular state in `doubtfire.states.ts` |
| 69 | +- Add resolvers for unit and unitRole |
| 70 | +- Delete `units/states/index/index.coffee` |
| 71 | + |
| 72 | +**Why first:** Foundation for everything below it |
| 73 | + |
| 74 | +--- |
| 75 | + |
| 76 | +### PR 2: Migrate units/tasks |
| 77 | + |
| 78 | +Replace AngularJS state with Angular equivalent that manages taskData object. |
| 79 | + |
| 80 | +**Files to change:** |
| 81 | + |
| 82 | +- Create state or service for taskData management |
| 83 | +- Update `doubtfire.states.ts` |
| 84 | +- Delete `units/states/tasks/tasks.coffee` |
| 85 | + |
| 86 | +**Why second:** Depends on PR 1 providing unit/unitRole |
| 87 | + |
| 88 | +--- |
| 89 | + |
| 90 | +### PR 3: Complete inbox migration |
| 91 | + |
| 92 | +Remove remaining AngularJS files now that parents provide data through Angular. |
| 93 | + |
| 94 | +**Files to delete:** |
| 95 | + |
| 96 | +- `units/states/tasks/inbox/inbox.coffee` |
| 97 | +- `units/states/tasks/inbox/inbox.tpl.html` |
| 98 | + |
| 99 | +**Why last:** Depends on both parent PRs |
| 100 | + |
| 101 | +--- |
| 102 | + |
| 103 | +## Visual Flow |
| 104 | + |
| 105 | +``` |
| 106 | +Current State: |
| 107 | + AngularJS State → AngularJS State → AngularJS wrapper → Angular Component |
| 108 | + (units/index) (units/tasks) (inbox.coffee) (InboxComponent) |
| 109 | +
|
| 110 | +After PR 1: |
| 111 | + Angular State → AngularJS State → AngularJS wrapper → Angular Component |
| 112 | + ✓ |
| 113 | +
|
| 114 | +After PR 2: |
| 115 | + Angular State → Angular State → AngularJS wrapper → Angular Component |
| 116 | + ✓ ✓ |
| 117 | +
|
| 118 | +After PR 3: |
| 119 | + Angular State → Angular State → Angular Component |
| 120 | + ✓ ✓ ✓ (fully migrated) |
| 121 | +``` |
| 122 | + |
| 123 | +--- |
| 124 | + |
| 125 | +## Testing Strategy |
| 126 | + |
| 127 | +Each PR needs to verify: |
| 128 | + |
| 129 | +- Unit loads correctly with proper permissions |
| 130 | +- Task selection and navigation works |
| 131 | +- URL syncing functions properly |
| 132 | +- Inbox displays tasks and allows interaction |
| 133 | +- No console errors |
| 134 | + |
| 135 | +--- |
| 136 | + |
| 137 | +## Key Principle |
| 138 | + |
| 139 | +**Bottom-up migration:** Start at the root (units/index), work down to the child (inbox). Each PR is |
| 140 | +independently testable and valuable even if later ones are delayed. |
0 commit comments