     (render-state [_ {:keys [show-modal?]}]
       (let [project (:project project-data)
             inputs (inputs/get-inputs-from-app-state owner)
-            credentials (or (:jira inputs)
-                            (:jira project))
             project-id (project-model/id project)
             jira-input-path (fn [& args] (apply conj state/inputs-path :jira args))
             track-event (fn [event-type component]

    om/IRenderState
    (render-state [_ {:keys [show-modal?]}]
      (let [project (:project project-data)
            inputs (inputs/get-inputs-from-app-state owner)
            token (or (get-in inputs [:jira :circle_token])
                      (get-in project [:jira :circle_token]))
            project-id (project-model/id project)
            jira-input-path (conj state/inputs-path :jira :circle_token)
            track-event (fn [event-type component]

                                                                   (raise! owner [:saved-project-settings {:project-id project-id
                                                                                                           :merge-paths [jira-input-path]}]))}))}]})))]))]])))))

(defn jira-basic-modal
  [{:keys [project close-fn track-fn jira-input-path]} owner]
  (let [project-id (project-model/id project)
        inputs (inputs/get-inputs-from-app-state owner)
        credentials (or (:jira inputs)
                        (:jira project))]
    (modal/modal-dialog
           {:title "Add JIRA credentials"
            :body (html
                   [:div
                    [:p "Configure JIRA to create issues from CircleCI’s build page."]
                    (form/form {}
                               (om/build form/text-field {:label "JIRA username"
                                                          :value (:username credentials)
                                                          :on-change #(utils/edit-input owner (jira-input-path :username) %)})
                               (om/build form/text-field {:label "JIRA password"
                                                          :password? true
                                                          :value (:password credentials)
                                                          :on-change #(utils/edit-input owner (jira-input-path :password) %)})
                               (om/build form/text-field {:label "JIRA base hostname"
                                                          :value (:base_url credentials)
                                                          :on-change #(utils/edit-input owner (jira-input-path :base_url) %)}))])
            :actions [(button/button {:on-click close-fn} "Cancel")
                      (button/managed-button
                       {:failed-text "Failed"
                        :success-text "Saved"
                        :loading-text "Saving..."
                        :kind :primary
                        :on-click (fn [_]
                                    (raise! owner
                                            [:saved-project-settings {:project-id project-id
                                                                      :merge-paths [[:jira]]
                                                                      :on-success close-fn}])
                                    (track-fn :save-clicked))}
                       "Save")]
            :close-fn close-fn})))

(defmethod jira-integration :basic [project-data owner]
  (reify
    om/IInitState
