Commit 8ab7b55
feat: add property edit and delete option (#249)
* feat: add property edit option
* Add "No past dates" option to the edit dialog for Date/DateTime fields
* Refactored the code to use Angular Material's proper dialog data injection pattern and the updateField action to use a typed interface instead of individual properties
* Remove comments
* Add custom exception
* Refactor to reuse DomainModelEditor.GetProperty and keep Roslyn-specific logic out of controllers
* Refactor: transfer the property extraction to the Model editor, add new GetModelFields in the DomainModelEditor
* feat: Add property delete option, refactor: move redundant logic from ModelsController to the DomainModelEditor, introduce a common methods that finds the SyntaxTree root to reduce code duplication and improve reusability in the DomainModelEditor and DbContextEditor
* refactor: remove redundant code
* Refactor: fix the PropertyCheckUtils to use Roslyn check instead of Regex
* Refactor
* Refactor: remove redundant property to delete check, change the return type for the non-found properties
* Change the Regex with Roslyn in the UpdatePropertyNameInOnModelCreating
* Refactor the DbContextEditor Update and Delete methods to use common method to improve reusability
* Refactor: make the PropertyNameExists an extension method and move it in ClassDeclarationSyntaxExtensions
* fix: add required import
* Remove Roslyn logic from the controller
---------
Co-authored-by: Mihail <mihailkitrozoski@codechem.com>1 parent 48b2a1f commit 8ab7b55
21 files changed
Lines changed: 946 additions & 149 deletions
File tree
- CCUI.DAPPI/src/app
- add-field-dialog
- builder
- fields-list
- state/collection
- validators
- Dappi.Core/Extensions
- Dappi.HeadlessCms
- Controllers
- Core
- Exceptions
- Extensions
- Middleware
- Models
- Services
Lines changed: 36 additions & 24 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
31 | 18 | | |
32 | | - | |
| 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 | + | |
33 | 44 | | |
34 | 45 | | |
35 | 46 | | |
36 | 47 | | |
37 | 48 | | |
38 | | - | |
| 49 | + | |
39 | 50 | | |
40 | 51 | | |
41 | 52 | | |
| |||
237 | 248 | | |
238 | 249 | | |
239 | 250 | | |
| 251 | + | |
240 | 252 | | |
241 | | - | |
| 253 | + | |
242 | 254 | | |
243 | 255 | | |
244 | 256 | | |
Lines changed: 40 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 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 | + | |
72 | 111 | | |
73 | 112 | | |
74 | 113 | | |
| |||
157 | 196 | | |
158 | 197 | | |
159 | 198 | | |
| 199 | + | |
160 | 200 | | |
161 | 201 | | |
162 | 202 | | |
| |||
Lines changed: 112 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
40 | 51 | | |
41 | 52 | | |
42 | 53 | | |
| |||
59 | 70 | | |
60 | 71 | | |
61 | 72 | | |
| 73 | + | |
| 74 | + | |
62 | 75 | | |
63 | 76 | | |
64 | 77 | | |
| |||
179 | 192 | | |
180 | 193 | | |
181 | 194 | | |
182 | | - | |
| 195 | + | |
183 | 196 | | |
184 | 197 | | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
185 | 205 | | |
186 | 206 | | |
187 | | - | |
| 207 | + | |
188 | 208 | | |
189 | 209 | | |
190 | 210 | | |
| |||
193 | 213 | | |
194 | 214 | | |
195 | 215 | | |
196 | | - | |
| 216 | + | |
197 | 217 | | |
198 | 218 | | |
199 | | - | |
| 219 | + | |
200 | 220 | | |
201 | 221 | | |
202 | | - | |
203 | | - | |
204 | | - | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
205 | 225 | | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
206 | 234 | | |
207 | 235 | | |
208 | 236 | | |
| |||
272 | 300 | | |
273 | 301 | | |
274 | 302 | | |
275 | | - | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
276 | 308 | | |
277 | 309 | | |
278 | 310 | | |
| |||
333 | 365 | | |
334 | 366 | | |
335 | 367 | | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
336 | 386 | | |
337 | 387 | | |
338 | 388 | | |
| |||
368 | 418 | | |
369 | 419 | | |
370 | 420 | | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
371 | 429 | | |
372 | | - | |
| 430 | + | |
373 | 431 | | |
374 | 432 | | |
375 | 433 | | |
376 | 434 | | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
377 | 480 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
49 | 53 | | |
50 | 54 | | |
51 | 55 | | |
| |||
0 commit comments