 (defn- render-display [this state refs props]
   (let [wrapped-config (:loaded-config @state)
         config (wrapped-config "methodConfiguration")
-        editing? (:editing? @state)]
+        editing? (:editing? @state)
+        restore-on-cancel #(this :load-new-method-template %)]
     [:div {}
      [comps/Blocker {:banner (:blocker @state)}]
      [:div {:style {:padding "1em 2em"}}
-      (render-side-bar state refs config editing? props)
+      (render-side-bar (utils/restructure state refs config editing? props restore-on-cancel))
       (when-not editing?
         [:div {:style {:float "right"}}
          (launch/render-button {:workspace-id (:workspace-id props)

                     (swap! state assoc :error status-text)))}))})


(defn- render-side-bar [state refs config editing? props]
  [:div {:style {:width 290 :float "left"}}
   [:div {:ref "sidebar"}]
   (style/create-unselectable :div {:style {:position (when-not (:sidebar-visible? @state) "fixed")
                                            :top (when-not (:sidebar-visible? @state) 4)
                                            :width 290}}
     (let [locked? (:locked? @state)
           can-edit? (access-greater-than? (:access-level props) "READER")]
       [:div {:style {:lineHeight 1}}
        (when (and can-edit? (not editing?))
          [:div {}
           [comps/SidebarButton {:style :light :color :button-primary
                                 :text "Edit Configuration" :icon :edit
                                 :disabled? (when locked? "The workspace is locked")
                                 :onClick #(swap! state assoc :editing? true)}]
           [comps/SidebarButton {:style :light :color :exception-state :margin :top
                                 :text "Delete" :icon :delete
                                 :disabled? (when locked? "The workspace is locked")

        (when editing?
          [comps/SidebarButton {:color :success-state
                                :text "Save" :icon :done
                                :onClick (fn []
                                           (commit state refs config props)
                                           (stop-editing state))}])
        (when editing?
          [comps/SidebarButton {:color :exception-state :margin :top
                                :text "Cancel Editing" :icon :cancel
                                :onClick (fn []
                                           (restore-on-cancel (:prev-snapshot-id @state))
                                           (stop-editing state))}])]))])


(defn- input-output-list [values ref-prefix invalid-values editing? all-values]
