Commit 9f2fe2f
authored
refactor: unify import component logic and remove deprecated hooks (#1488)
## Description
Refactored component import functionality by removing deprecated hooks and consolidating the logic in the ComponentLibraryProvider. This change simplifies the component import flow by:
1. Removing `useComponentUploader` and `useImportComponent` hooks
2. Eliminating the `ComponentDuplicateDialog` from FlowCanvas
3. Moving file reading functionality to a dedicated utility function
4. Streamlining the component import process through the ComponentLibraryProvider
## Type of Change
- [x] Cleanup/Refactor
- [x] Improvement
## Checklist
- [x] I have tested this does not break current pipelines / runs functionality
- [ ] I have tested the changes on staging
## Test Instructions
1. [Screen Recording 2025-12-06 at 12.33.55 PM.mov <span class="graphite__hidden">(uploaded via Graphite)</span> <img class="graphite__hidden" src="https://app.graphite.com/user-attachments/thumbnails/826c55e6-636b-4532-b2dd-9b343cd11129.mov" />](https://app.graphite.com/user-attachments/video/826c55e6-636b-4532-b2dd-9b343cd11129.mov)
Test importing components by dragging and dropping YAML files onto the canvas
2. Verify that component import works through the sidebar import functionality
3. Confirm that duplicate component detection still works properly
4. Test that all 3 major ways of importing work exactly same
1. Test import via "Add component" from "Used in Pipelines"
2. Test import via "Drop on canvas"
3. Test import from "Import Dialog"
5. Ensure Drop File on Canvas works in all ways - no regression
6. Ensure Drag-drop components from component library works exactly same, no regression
## Additional Comments
This change reduces code duplication and centralizes component import logic in the ComponentLibraryProvider, making the codebase more maintainable.1 parent c8f15b3 commit 9f2fe2f
File tree
10 files changed
+141
-383
lines changed- src
- hooks
- providers/ComponentLibraryProvider
- services
- utils
10 files changed
+141
-383
lines changedLines changed: 44 additions & 71 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
26 | 25 | | |
27 | 26 | | |
28 | 27 | | |
| |||
31 | 30 | | |
32 | 31 | | |
33 | 32 | | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
52 | 51 | | |
53 | 52 | | |
54 | 53 | | |
| |||
169 | 168 | | |
170 | 169 | | |
171 | 170 | | |
| 171 | + | |
| 172 | + | |
172 | 173 | | |
173 | 174 | | |
174 | 175 | | |
| |||
465 | 466 | | |
466 | 467 | | |
467 | 468 | | |
468 | | - | |
469 | | - | |
470 | | - | |
471 | | - | |
472 | | - | |
473 | | - | |
474 | | - | |
475 | | - | |
476 | | - | |
477 | | - | |
478 | | - | |
479 | | - | |
480 | | - | |
481 | | - | |
482 | | - | |
483 | | - | |
484 | | - | |
485 | | - | |
486 | | - | |
487 | | - | |
488 | | - | |
489 | | - | |
490 | | - | |
491 | | - | |
492 | | - | |
493 | | - | |
494 | | - | |
495 | | - | |
496 | | - | |
497 | | - | |
498 | | - | |
499 | | - | |
500 | | - | |
501 | | - | |
502 | | - | |
503 | | - | |
504 | | - | |
505 | | - | |
506 | | - | |
507 | | - | |
508 | | - | |
509 | | - | |
510 | | - | |
511 | | - | |
512 | | - | |
513 | | - | |
514 | | - | |
515 | | - | |
516 | | - | |
517 | | - | |
518 | | - | |
519 | | - | |
520 | | - | |
521 | | - | |
522 | | - | |
523 | | - | |
524 | | - | |
525 | | - | |
526 | | - | |
527 | | - | |
528 | | - | |
| 469 | + | |
529 | 470 | | |
530 | 471 | | |
531 | 472 | | |
| |||
564 | 505 | | |
565 | 506 | | |
566 | 507 | | |
| 508 | + | |
567 | 509 | | |
568 | 510 | | |
569 | 511 | | |
570 | | - | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
571 | 550 | | |
572 | 551 | | |
573 | 552 | | |
| |||
1030 | 1009 | | |
1031 | 1010 | | |
1032 | 1011 | | |
1033 | | - | |
1034 | | - | |
1035 | | - | |
1036 | | - | |
1037 | | - | |
1038 | | - | |
1039 | 1012 | | |
1040 | 1013 | | |
1041 | 1014 | | |
| |||
Lines changed: 5 additions & 44 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
| 34 | + | |
| 35 | + | |
38 | 36 | | |
39 | 37 | | |
40 | 38 | | |
| |||
121 | 119 | | |
122 | 120 | | |
123 | 121 | | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
| 122 | + | |
143 | 123 | | |
144 | | - | |
| 124 | + | |
145 | 125 | | |
146 | 126 | | |
147 | 127 | | |
148 | 128 | | |
149 | 129 | | |
150 | | - | |
| 130 | + | |
151 | 131 | | |
152 | 132 | | |
153 | 133 | | |
| |||
351 | 331 | | |
352 | 332 | | |
353 | 333 | | |
354 | | - | |
355 | | - | |
356 | | - | |
357 | | - | |
358 | | - | |
359 | | - | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
367 | | - | |
368 | | - | |
369 | | - | |
370 | | - | |
371 | | - | |
372 | | - | |
373 | 334 | | |
This file was deleted.
0 commit comments