<commit_before>AppConfig      = require 'shared/services/app_config'
AbilityService = require 'shared/services/ability_service'
ModalService   = require 'shared/services/modal_service'

angular.module('loomioApp').directive 'installSlackCard', ->
  scope: {group: '='}
  templateUrl: 'generated/components/install_slack/card/install_slack_card.html'
  controller: ['$scope', ($scope) ->
    $scope.show = ->
      AbilityService.canAdministerGroup($scope.group) &&
      _.find AppConfig.identityProviders, (provider) -> provider.name == name

    $scope.groupIdentity = ->
      $scope.group.groupIdentityFor('slack')

    $scope.install = ->
      ModalService.open 'InstallSlackModal', group: -> $scope.group

    $scope.canRemoveIdentity = ->
      AbilityService.canAdministerGroup($scope.group)

    $scope.remove = ->
      ModalService.open 'ConfirmModal', confirm: ->
        submit:     $scope.groupIdentity().destroy
        text:
          title:    'install_slack.card.confirm_remove_title'
          helptext: 'install_slack.card.confirm_remove_helptext'
          flash:    'install_slack.card.identity_removed'
  ]<commit_msg>fix install slack card<commit_after>AppConfig      = require 'shared/services/app_config'
AbilityService = require 'shared/services/ability_service'
ModalService   = require 'shared/services/modal_service'

angular.module('loomioApp').directive 'installSlackCard', ->
  scope: {group: '='}
  templateUrl: 'generated/components/install_slack/card/install_slack_card.html'
  controller: ['$scope', ($scope) ->
    $scope.show = ->
      AbilityService.canAdministerGroup($scope.group) &&
      _.find AppConfig.identityProviders, (provider) -> provider.name == 'slack'

    $scope.groupIdentity = ->
      $scope.group.groupIdentityFor('slack')

    $scope.install = ->
      ModalService.open 'InstallSlackModal', group: -> $scope.group

    $scope.canRemoveIdentity = ->
      AbilityService.canAdministerGroup($scope.group)

    $scope.remove = ->
      ModalService.open 'ConfirmModal', confirm: ->
        submit:     $scope.groupIdentity().destroy
        text:
          title:    'install_slack.card.confirm_remove_title'
          helptext: 'install_slack.card.confirm_remove_helptext'
          flash:    'install_slack.card.identity_removed'
  ]
{'fraction_non_alphanumeric': 0.1297909407665505, 'fraction_numerical': 0.0, 'mean_word_length': 3.594, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 23, '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': '6962083', 'n_tokens_mistral': 690, 'n_tokens_neox': 681, 'n_words': 97}