 dateFormat                      = require 'dateformat'
 
 FSHelper                        = require 'app/util/fs/fshelper'
+showError                       = require 'app/util/showError'
 applyMarkdown                   = require 'app/util/applyMarkdown'
 
 CustomViews                     = require 'app/commonviews/customviews'

    stepTestAndSave: (options) =>

      console.log options
      {callback, cancelCallback, data} = options
      container = @views.container 'step-creds'

      views     = @addTo container,

        button_save     :
          title         : 'Save & Test >'
          cssClass      : 'solid compact green nav next'
          callback      : ->

            {title}  = views.input_title.getData()
            template = views.editorView.getValue()

            updateStackTemplate {
              title, template, credential, stackTemplate
            }, (err, _stackTemplate) ->
              return  if showError err

              callback {
                stackTemplate: _stackTemplate, credential, provider
              }

      return container

