(
&mut self,
source_collection_id: Uuid,
node_id: Uuid,
target_collection_id: Uuid,
target_parent_folder_id: Option<Uuid>,
cx: &mut Context<Self>,
)
| 583 | }; |
| 584 | |
| 585 | let Some(node) = find_node_mut(&mut collection.nodes, node_id) else { |
| 586 | return false; |
| 587 | }; |
| 588 | |
| 589 | match node { |
| 590 | CollectionNode::Folder(folder) => folder.name = new_name.to_string(), |
| 591 | CollectionNode::Request(request) => request.request.set_name(new_name.to_string()), |
| 592 | } |
| 593 | |
| 594 | self.bump_revision(); |
| 595 | self.save_to_file(); |
| 596 | cx.emit(CollectionsEvent::CollectionUpdated(collection_id)); |
| 597 | cx.notify(); |
| 598 | true |
| 599 | } |
| 600 | |
| 601 | pub fn toggle_collection_expanded(&mut self, id: Uuid, cx: &mut Context<Self>) { |
| 602 | if let Some(collection) = self.collections.iter_mut().find(|c| c.id == id) { |
| 603 | collection.expanded = !collection.expanded; |
| 604 | self.bump_revision(); |
| 605 | self.save_to_file(); |
| 606 | cx.emit(CollectionsEvent::CollectionUpdated(id)); |
| 607 | cx.notify(); |
| 608 | } |
| 609 | } |
| 610 | |
| 611 | pub fn toggle_node_expanded( |
| 612 | &mut self, |
nothing calls this directly
no test coverage detected