<commit_before>'use strict';

angular.module('kanbanzillaApp')
  .directive('kbcolumn', function () {
    return {
      templateUrl: 'views/column.tpl.html',
      restrict: 'A',
      replace: true,
      require: 'ngModel',
      scope: {
        displayTitle: '@',
        loading: '=',
        query: '=',
        sortOptions: '=',
        ngModel: '='
      },
      controller: ['$scope', 'Bugzilla', 'bugzillaAuth','$dialog', function ($scope, Bugzilla, bugzillaAuth, $dialog) {

        $scope.bugDescription = 'Loading...';
        $scope.lastComment = 'Loading...';
        $scope.archiveable = $scope.ngModel.statuses.indexOf('RESOLVED') !== -1;
        console.log($scope.archiveable);


        $scope.archiveAll = function () {
          // should only apply to the done column. Take all cards and archive
          // them, thus cleaning up the done column.
        };

        $scope.archiveBug = function (bug) {
          // archive an individual bug.
          Bugzilla.updateBug(bug.id, {status: 'VERIFIED'})
            .success(function (data) {
              if(data.ok === 1) {
                $scope.ngModel.bugs.splice($scope.ngModel.bugs.indexOf(bug), 1);
              }
            });
        };

        $scope.getDescription = function (bug) {
          Bugzilla.getCommentsForBug(bug.id)
            .success(function (data) {
              $scope.bugDescription = data.comments[0].text.replace(/\n/g,'<br/>');
            });
        };<commit_msg>archive removes immediately and if it fails, adds the card back to the column<commit_after>'use strict';

angular.module('kanbanzillaApp')
  .directive('kbcolumn', function () {
    return {
      templateUrl: 'views/column.tpl.html',
      restrict: 'A',
      replace: true,
      require: 'ngModel',
      scope: {
        displayTitle: '@',
        loading: '=',
        query: '=',
        sortOptions: '=',
        ngModel: '='
      },
      controller: ['$scope', 'Bugzilla', 'bugzillaAuth','$dialog', function ($scope, Bugzilla, bugzillaAuth, $dialog) {

        $scope.bugDescription = 'Loading...';
        $scope.lastComment = 'Loading...';
        $scope.archiveable = $scope.ngModel.statuses.indexOf('RESOLVED') !== -1;
        console.log($scope.archiveable);


        $scope.archiveAll = function () {
          // should only apply to the done column. Take all cards and archive
          // them, thus cleaning up the done column.
        };

        $scope.archiveBug = function (bug) {
          // archive an individual bug.
          var index = $scope.ngModel.bugs.indexOf(bug);
          $scope.ngModel.bugs.splice(index, 1);
          Bugzilla.updateBug(bug.id, {status: 'VERIFIED'})
            .success(function (data) {
              if(data.ok !== 1) {
                $scope.ngModel.bugs.splice(index, 0, bug);
              }
            })
            .error(function (data) {
                $scope.ngModel.bugs.splice(index, 0, bug);
            });
        };

        $scope.getDescription = function (bug) {
          Bugzilla.getCommentsForBug(bug.id)
            .success(function (data) {
              $scope.bugDescription = data.comments[0].text.replace(/\n/g,'<br/>');
            });
        };
{'fraction_non_alphanumeric': 0.1545144275519702, 'fraction_numerical': 0.003102699348433137, 'mean_word_length': 1.9442922374429223, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '6252436', 'n_tokens_mistral': 972, 'n_tokens_neox': 927, 'n_words': 188}