                              (om/set-state! owner :editing false)
                              (om/set-state! owner :adding false)))} "Save"]]))
 
+(defn should-show? [owner profiles keys]
+  (or
+   (om/get-state owner :editing)
+   (om/get-state owner :adding)
+   (some (fn [profile] (some #(seq (str (val %))) (select-keys profile keys))) profiles)))
+
 (defn description-row [property_details]
   (fn [profiles owner]
     (reify

      (render-state [_ state]
        (html
         [:div.col-md-12
          (for [profile profiles]
            (let [keys [:profile_data]]
              [:div {:class (profile-column-width)}
               (bs/panel
                (panel-heading property_details owner profile "Energy" {:add-btn false :edit-btn true} keys)
                (pf/energy owner profile keys))]))])))))

(defn passivhaus-row [property_details]
  (fn [profiles owner]

      (render-state [_ state]
        (html
         [:div.col-md-12
          (let [display? (should-show? owner (mapv #(get % :profile_data) profiles)
                                       [:flat_floors_in_block
                                        :flat_floor_position :flat_heat_loss_corridor
                                        :flat_heat_loss_corridor_other
                                        :flat_length_sheltered_wall
                                        :flat_floor_heat_loss_type])]
            (for [profile profiles]
              (let [keys [:profile_data]]
                [:div {:class (profile-column-width)}
                 (bs/panel
                  (panel-heading property_details owner profile "Flats" {:add-btn false :edit-btn true} keys)
                  (when display?
                    (pf/flats owner profile keys)))])))])))))

(defn fireplaces-row [property_details]
  (fn [profiles owner]
