<commit_before>class VendorBaseView extends KDTabPaneView

  constructor:(options={}, data)->

    data?.description or= "We are still working on #{data.name} provider."
    options.cssClass    = KD.utils.curry "vendor-view", options.cssClass
    options.pistachio or= """
      {{> this.header}}
      {p{ #(description)}}
      {{> this.loader}}
      {{> this.content}}
    """

    super options, data

    @header = new KDHeaderView
      title : @getData().name
      type : "medium"

    @content = new KDView
    @loader  = new KDLoaderView
      showLoader : @getOption('vendorId')?
      size       :
        width    : 40

  createFormView:->

    @form = ComputeProvider.generateAddCredentialFormFor @_vendor

    @form.on "Cancel", -> @unsetClass 'in'
    @form.on "CredentialAdded", (credential)=>
      credential.owner = yes
      @form.unsetClass 'in'
      @addItem credential

    @content.addSubView @form

  viewAppended:->
    super
    @on 'PaneDidShow', =>
      @loader.show()  if @getOption('vendorId')?
      @form?.unsetClass 'in'
      KD.utils.wait 1000, =>
        @form?.setClass 'in'
        @loader.hide()<commit_msg>VendorBaseView: fetch all credentials for given vendor when the pane selected<commit_after>class VendorBaseView extends KDTabPaneView

  constructor:(options={}, data)->

    data?.description or= "We are still working on #{data.name} provider."
    options.cssClass    = KD.utils.curry "vendor-view", options.cssClass
    options.pistachio or= """
      {{> this.header}}
      {p{ #(description)}}
      {{> this.loader}}
      {{> this.content}}
    """

    super options, data

    @header = new KDHeaderView
      title : @getData().name
      type : "medium"

    @content = new KDView
    @loader  = new KDLoaderView
      showLoader : @getOption('vendorId')?
      size       :
        width    : 40

  createFormView:->

    @form = ComputeProvider.generateAddCredentialFormFor @_vendor

    @form.on "Cancel", -> @unsetClass 'in'
    @form.on "CredentialAdded", (credential)=>
      credential.owner = yes
      @form.unsetClass 'in'
      @addItem credential

    @content.addSubView @form

  viewAppended:->
    super
    @on 'PaneDidShow', @bound 'paneSelected'

  paneSelected:->

    ComputeProvider.credentialsFor @_vendor, (err, credentials = [])=>

      @loader.hide()

      unless KD.showError err

        if credentials.length > 0
          credential = credentials.first
          @content.addSubView new KDView
            partial: "#{credential.title}"
        else
          @form.setClass 'in'
{'fraction_non_alphanumeric': 0.12942090944422852, 'fraction_numerical': 0.003497862417411582, 'mean_word_length': 2.584958217270195, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 24, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4218625', 'n_tokens_mistral': 826, 'n_tokens_neox': 779, 'n_words': 183}