Commit 8d076c8
Refactor EventContentBody to shared-components (#31914)
* Init of refactoring of eventcontentbody
* update stories css by copying css from element x to shared components
* Replaced old component EventContentBody with newly created mmvm component EventContentBodyViewModel
* Refactor TextualBody and EditHistoryMessage to properly manage EventContentBodyViewModel
* generated snapshot after vitest
* Update import placement for eslint to pass CI
* Fixed lint warnings
* Update css for codeblock to represent js highlight
* test: add EventContentBodyViewModel snapshot coverage
* fix: pass content ref to EventContentBodyView for link previews
* Fix: return to old code that passed tests
* Added storybook snapshots
* Removal of old component that is being unused
* Update snapshot
* Fix missing enableBigEmoji and shouldShowPillAvatar settings in EventContentBodyViewModel
* update snapshot
* narrow setProps to mutable fields and skip no-op snapshot recomputes
* Update Snapshots
* replace EventContentBodyViewModel setProps with explicit setters and update call sites
* render body in view and keep parser/replacer in snapshot
* Eslint Restruct
* Eslint Restructure
* Removed unused function, moved to shared component
* Remove Unused Module (Moved To Shared Component)
* Disable EventContent-body Test to check weather it fixes CI
* Enable EventContentBody Tests
* Remove EventTest
* Update Include in Vitest
* Added EventContentBody test
* Update Package.json
* Update Lockfile
* Update dependencies
* update lockfile
* ptimize EventContentBodyViewModel to recompute/merge only changed snapshot fields
* Update snapshots
* setEventContent and setStripReply run whenever the existing update block runs
* defined arrow functions for undefined runtime issues that might occur.
* Update test cases
* Update packages/shared-components/src/message-body/EventContentBody/EventContentBodyView.tsx
Co-authored-by: R Midhun Suresh <rmidhunsuresh@gmail.com>
* Update packages/shared-components/src/message-body/EventContentBody/EventContentBodyView.tsx
Co-authored-by: R Midhun Suresh <rmidhunsuresh@gmail.com>
* move big-emoji and pill-avatar setting watchers into EventContentBodyViewModel
* Update packages/shared-components/src/message-body/EventContentBody/index.tsx
Co-authored-by: Florian Duros <florian.duros@ormaz.fr>
* Update packages/shared-components/src/message-body/EventContentBody/EventContentBodyView.tsx
Co-authored-by: Florian Duros <florian.duros@ormaz.fr>
* Update packages/shared-components/src/message-body/EventContentBody/EventContentBody.test.tsx
Co-authored-by: Florian Duros <florian.duros@ormaz.fr>
* Update packages/shared-components/src/message-body/EventContentBody/EventContentBody.stories.tsx
Co-authored-by: Florian Duros <florian.duros@ormaz.fr>
* Update packages/shared-components/src/message-body/EventContentBody/EventContentBodyView.tsx
Co-authored-by: Florian Duros <florian.duros@ormaz.fr>
* Update packages/shared-components/src/message-body/EventContentBody/EventContentBodyView.tsx
Co-authored-by: Florian Duros <florian.duros@ormaz.fr>
* Fix dubblicate variables
* clarify applyReplacerOnString input/replacer params
* Added memo to the view
* Prettier Fix
* Update apps/web/src/viewmodels/message-body/EventContentBodyViewModel.ts
Co-authored-by: Florian Duros <florian.duros@ormaz.fr>
* Added compund variables instead of reguler values
* Added boolean default values
* remove redundant setting props from TextualBody and EditHistoryMessage
* Prettier FIx
* replace MatrixClientPeg usage with `client: MatrixClient | null` passed from context
* TextualBody now passes EventContentBodyViewModel `client` from RoomContext.
* Remove redundant as prop from EventContentBody VM usage
* Normalize EventContentBodyViewModel renderer flags to booleans
---------
Co-authored-by: R Midhun Suresh <rmidhunsuresh@gmail.com>
Co-authored-by: Florian Duros <florian.duros@ormaz.fr>1 parent 3e77974 commit 8d076c8
24 files changed
Lines changed: 1281 additions & 252 deletions
File tree
- apps/web
- src
- components/views/messages
- renderer
- viewmodels/message-body
- test
- unit-tests/components/views/messages
- viewmodels/message-body
Lines changed: 27 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | | - | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
| 49 | + | |
48 | 50 | | |
49 | 51 | | |
50 | 52 | | |
51 | 53 | | |
52 | 54 | | |
53 | 55 | | |
54 | | - | |
| 56 | + | |
55 | 57 | | |
56 | 58 | | |
57 | 59 | | |
58 | 60 | | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
59 | 82 | | |
60 | 83 | | |
61 | 84 | | |
| |||
92 | 115 | | |
93 | 116 | | |
94 | 117 | | |
| 118 | + | |
95 | 119 | | |
96 | 120 | | |
97 | 121 | | |
| |||
133 | 157 | | |
134 | 158 | | |
135 | 159 | | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
| 160 | + | |
150 | 161 | | |
151 | 162 | | |
152 | 163 | | |
| |||
Lines changed: 0 additions & 189 deletions
This file was deleted.
0 commit comments