Commit 4ace688
feat: show proposed changes with clickable entity links in approval tasks (#27201)
* feat: show proposed changes with clickable entity links in approval tasks
Governance approval tasks now display a "Proposed Changes" preview so approvers can see exactly what changed before approving. Backend runs the entity's changeDescription through the activity-feed formatter pipeline and stores a markdown bullet list in thread.message. UI renders the preview using Showdown + dangerouslySetInnerHTML and injects clickable hyperlinks for tags, tier, glossary terms, related terms, domains, owners, reviewers, and experts directly in the frontend before conversion.
* fix: drop owner links (user/team ambiguous), escape FQN HTML, widen diff-span regex
* feat(governance): structured JSON proposed-changes preview in approval tasks
- Store thread.message as JSON {field: {added: [...], removed: [...]}} instead of markdown+HTML
- Extract identifiers via tagFQN > fullyQualifiedName > displayName > name priority
- Merge across re-edits using set-cancellation (items that cancel to empty are dropped)
- Extract all change-preview logic into ChangePreviewUtils (governance/workflows/util)
- CreateApprovalTaskImpl reduced to pure Flowable orchestration
- UI: replace dangerouslySetInnerHTML with structured chip rendering (green=added, red=removed)
- Notification panel: replace raw task.message with static approval-request label
- 21 unit tests covering extractIdentifiers, buildChangeMap, mergeChangeMaps, parseChangeMap
* feat(governance): strikethrough on removed chips in proposed changes
* fix(governance): null-safe field list iteration and correct JSON string decoding in ChangePreviewUtils
* fix(governance): non-null thread.message fallback and single parseProposedChanges call
* fix(governance): O(n) set operations and resilient threshold parsing
* i18n: translate proposed-change-plural key in all 18 locale files
* Addressed comments
* fix lint issue
* Fix Playwright: use dedicated i18n key for approval notification, fallback to task.message for non-JSON
* Fix review: handle List/Map inputs in extractIdentifiers, gate proposed changes on task type, fix prototype pollution
* Fix: add trailing space to approval notification i18n key
* Fix review: empty Map/List guard, startCase field labels, chip keys with index, remove CSS capitalize, explicit JSX space
* refactor(workflows): simplify ChangePreviewUtils — single JSON path, FieldDiff record, descriptive variable names
* fix(workflows): null-safe FieldDiff compact constructor, zh-CN locale for approval notification
* i18n: translate request-approval-notification for all 17 locales
---------
Co-authored-by: anuj-kumary <anujf0510@gmail.com>1 parent cc08f80 commit 4ace688
25 files changed
Lines changed: 755 additions & 35 deletions
File tree
- openmetadata-service/src
- main/java/org/openmetadata/service/governance/workflows
- elements/nodes/userTask/impl
- util
- test/java/org/openmetadata/service/governance/workflows/util
- openmetadata-ui/src/main/resources/ui/src
- components
- Entity/Task/TaskTab
- NotificationBox
- locale/languages
Lines changed: 22 additions & 29 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
| 43 | + | |
42 | 44 | | |
43 | 45 | | |
44 | 46 | | |
| |||
57 | 59 | | |
58 | 60 | | |
59 | 61 | | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
| 62 | + | |
| 63 | + | |
77 | 64 | | |
78 | 65 | | |
79 | 66 | | |
80 | 67 | | |
81 | | - | |
82 | 68 | | |
83 | 69 | | |
84 | | - | |
85 | 70 | | |
86 | 71 | | |
87 | 72 | | |
| |||
95 | 80 | | |
96 | 81 | | |
97 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
98 | 99 | | |
99 | 100 | | |
100 | | - | |
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
125 | | - | |
126 | 125 | | |
127 | 126 | | |
128 | 127 | | |
129 | | - | |
130 | 128 | | |
131 | | - | |
| 129 | + | |
132 | 130 | | |
133 | 131 | | |
134 | | - | |
135 | 132 | | |
136 | 133 | | |
137 | | - | |
138 | 134 | | |
139 | 135 | | |
140 | | - | |
141 | 136 | | |
142 | 137 | | |
143 | 138 | | |
| |||
158 | 153 | | |
159 | 154 | | |
160 | 155 | | |
161 | | - | |
162 | 156 | | |
163 | 157 | | |
164 | 158 | | |
165 | 159 | | |
166 | 160 | | |
167 | 161 | | |
| 162 | + | |
168 | 163 | | |
169 | 164 | | |
170 | | - | |
171 | 165 | | |
172 | 166 | | |
173 | 167 | | |
| |||
179 | 173 | | |
180 | 174 | | |
181 | 175 | | |
182 | | - | |
183 | 176 | | |
184 | 177 | | |
185 | 178 | | |
| |||
Lines changed: 183 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
0 commit comments