Commit a63c53c
committed
[2.x] fix(flags): drop literal 'undefined' from Inappropriate reason and lazy-load FlagPostModal
Two related changes to the Inappropriate flag-post path:
1. When no Community Guidelines URL is configured, the reason text
rendered the literal token "{undefined}" — the translator
stringifies undefined values passed into a rich placeholder. Use
a separate translation key with no link placeholder when the URL
is unset, instead of trying to pass `undefined` as the `<a>` slot.
2. The flag modal was imported eagerly via a side-effect import in
forum.ts and a static import in addFlagControl.js, so its ~4 KB
was always shipped in the main forum bundle even for users who
never report a post. Switch to the documented lazy-load pattern
(`app.modal.show(() => import('./components/FlagPostModal'), ...)`)
and declare the chunk directory via `Extend\Frontend::jsDirectory`
so the chunked sub-bundle is published.
Closes #45741 parent d03ba16 commit a63c53c
5 files changed
Lines changed: 8 additions & 7 deletions
File tree
- extensions/flags
- js/src/forum
- components
- locale
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | | - | |
8 | 6 | | |
9 | 7 | | |
10 | 8 | | |
11 | 9 | | |
12 | 10 | | |
13 | 11 | | |
14 | | - | |
| 12 | + | |
15 | 13 | | |
16 | 14 | | |
17 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | | - | |
96 | | - | |
97 | | - | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
98 | 100 | | |
99 | 101 | | |
100 | 102 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | 8 | | |
10 | 9 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
0 commit comments