MCPcopy Create free account
hub / github.com/bajrangCoder/setu / render_request_response_split

Method render_request_response_split

src/views/main_view.rs:2558–2611  ·  view source on GitHub ↗
(
        &self,
        url_input: Option<Entity<InputState>>,
        method_dropdown: Entity<MethodDropdownState>,
        request: Entity<RequestEntity>,
        is_loading: bool,
        this: En

Source from the content-addressed store, hash-verified

2556 .to_string()
2557 .trim()
2558 .to_string();
2559 let request_name = if request_name.is_empty() {
2560 "New Request".to_string()
2561 } else {
2562 request_name
2563 };
2564
2565 this_click.update(cx, |view, cx| {
2566 let mut request = request_click.clone();
2567 request.set_name(request_name);
2568 view.save_saved_request_to_destination(
2569 selection.destination,
2570 request,
2571 cx,
2572 );
2573 });
2574 close_dialog(window, cx);
2575 }),
2576 )
2577 .child(
2578 Button::new("save-to-collection-cancel")
2579 .label("Cancel")
2580 .on_click(|_, window, cx| {
2581 close_dialog(window, cx);
2582 }),
2583 )
2584 })
2585 });
2586 }
2587
2588 pub fn import_collection_from_file(&mut self, window: &mut Window, cx: &mut Context<Self>) {
2589 let this = cx.entity().clone();
2590 let options = PathPromptOptions {
2591 files: true,
2592 directories: false,
2593 multiple: false,
2594 prompt: Some("Select a Postman collection or environment".into()),
2595 };
2596 let paths_receiver = cx.prompt_for_paths(options);
2597
2598 cx.spawn_in(window, async move |_weak_this, cx| {
2599 let Ok(platform_result) = paths_receiver.await else {
2600 log::error!("Collection import file picker channel closed unexpectedly");
2601 return;
2602 };
2603
2604 let Ok(paths_opt) = platform_result else {
2605 let _ = cx.update(|window, app| {
2606 window.push_notification(
2607 (NotificationType::Error, "Failed to open file picker"),
2608 app,
2609 );
2610 });
2611 return;
2612 };
2613
2614 let Some(paths) = paths_opt else {

Callers 1

renderMethod · 0.80

Calls 2

childMethod · 0.80
render_request_panelMethod · 0.80

Tested by

no test coverage detected