                            to setup your stack for your team."
           button_addNew :
             title       : 'Add New Credential'
-            cssClass    : 'solid medium green'
+            cssClass    : 'solid compact green'
             callback    : ->
-              handleNewCredential views, provider
+              handleNewCredential views, provider, this
         credentialList  : provider
         button_cancel   :
           title         : '< Select another provider'

module.exports = class StacksCustomViews extends CustomViews


  handleNewCredential = (views, provider) ->

    {controller} = views.credentialList
    view = controller.getView()
    view.hide()

    form = controller.showAddCredentialFormFor provider
    form.on 'Cancel', view.bound 'show'

    # After adding credential, we are sharing it with the current
    # group, so anyone in this group can use this credential ~ GG

      {slug} = kd.singletons.groupsController.getCurrentGroup()
      credential.shareWith {target: slug}, (err) ->
        console.warn 'Failed to share credential:', err  if err
        button.disable()
        view.show()


