<commit_before>/*jshint undef: false, unused: false, indent: 2*/
/*global angular: false */

(function () {
  'use strict';

  angular.module('demoApp', ['ui.sortable', 'ui.bootstrap'])
    .controller('demoController', ['$scope', '$modal', 'BoardManipulator', function ($scope, $modal, BoardManipulator) {

      var board = {"name": "Kanban Board", "numberOfColumns": 3,
        "columns": [
          // {"name":"Ideas","cards":[{"name":"Come up with a POC for new Project"},{"name":"Design new framework for reporting module"}]},
          {"name": "Not started", "cards": [
            {"title": "Explore new IDE for Development",
              "details": "Testing Card Details"},
            {"title": "Get new resource for new Project",
              "details": "Testing Card Details"}
          ]},
          {"name": "In progress", "cards": [
            {"title": "Develop ui for tracker module",
              "details": "Testing Card Details"},
            {"title": "Develop backend for plan module",
              "details": "Testing Card Details"}
          ]},
          {"name": "Done", "cards": [
            {"title": "Test user module",
              "details": "Testing Card Details"},
            {"title": "End to End Testing for user group module",
              "details": "Testing Card Details"},
            {"title": "CI for user module",
              "details": "Testing Card Details"}
          ]}
        ]};

      var kanbanBoard = new Board(board.name, board.numberOfColumns);

      angular.forEach(board.columns, function (column) {

        BoardManipulator.addColumn(kanbanBoard, column.name);

        angular.forEach(column.cards, function (card) {
          BoardManipulator.addCardToColumn(kanbanBoard, column, card.title, card.details);
        })
      });

      $scope.board = kanbanBoard;

      $scope.sortOptions = {

        //restrict move across columns. move only within column.
        /*accept: function (sourceItemHandleScope, destSortableScope) {
          return sourceItemHandleScope.itemScope.sortableScope === destSortableScope;
        },*/
        itemMoved: function (event) {
          event.source.itemScope.modelValue.status = event.dest.sortableScope.$parent.column.name;
        },
        orderChanged: function (event) {
        },
        containment: '#board'
      };

      $scope.removeCard = function (column, card) {
        if (confirm('Are You sure to Delete?')) {
          BoardManipulator.removeCardFromColumn($scope.board, column, card);
        }
      };

      $scope.addNewCard = function (column) {
        var modalInstance = $modal.open({
          templateUrl: 'NewCard.html',
          controller: 'NewCardController',
          resolve: {
            column: function () {
              return column;
            }
          }<commit_msg>a minor refactor.<commit_after>/*jshint undef: false, unused: false, indent: 2*/
/*global angular: false */

(function () {
  'use strict';

  angular.module('demoApp', ['ui.sortable', 'ui.bootstrap'])
    .controller('demoController', ['$scope', '$modal', 'BoardManipulator', function ($scope, $modal, BoardManipulator) {

      var board = {"name": "Kanban Board", "numberOfColumns": 3,
        "columns": [
          // {"name":"Ideas","cards":[{"name":"Come up with a POC for new Project"},{"name":"Design new framework for reporting module"}]},
          {"name": "Not started", "cards": [
            {"title": "Explore new IDE for Development",
              "details": "Testing Card Details"},
            {"title": "Get new resource for new Project",
              "details": "Testing Card Details"}
          ]},
          {"name": "In progress", "cards": [
            {"title": "Develop ui for tracker module",
              "details": "Testing Card Details"},
            {"title": "Develop backend for plan module",
              "details": "Testing Card Details"}
          ]},
          {"name": "Done", "cards": [
            {"title": "Test user module",
              "details": "Testing Card Details"},
            {"title": "End to End Testing for user group module",
              "details": "Testing Card Details"},
            {"title": "CI for user module",
              "details": "Testing Card Details"}
          ]}
        ]};

      var kanbanBoard = new Board(board.name, board.numberOfColumns);

      angular.forEach(board.columns, function (column) {

        BoardManipulator.addColumn(kanbanBoard, column.name);

        angular.forEach(column.cards, function (card) {
          BoardManipulator.addCardToColumn(kanbanBoard, column, card.title, card.details);
        })
      });

      $scope.board = kanbanBoard;

      $scope.sortOptions = {

        //restrict move across columns. move only within column.
        /*accept: function (sourceItemHandleScope, destSortableScope) {
          return sourceItemHandleScope.itemScope.sortableScope.$id !== destSortableScope.$id;
        },*/
        itemMoved: function (event) {
          event.source.itemScope.modelValue.status = event.dest.sortableScope.$parent.column.name;
        },
        orderChanged: function (event) {
        },
        containment: '#board'
      };

      $scope.removeCard = function (column, card) {
        if (confirm('Are You sure to Delete?')) {
          BoardManipulator.removeCardFromColumn($scope.board, column, card);
        }
      };

      $scope.addNewCard = function (column) {
        var modalInstance = $modal.open({
          templateUrl: 'NewCard.html',
          controller: 'NewCardController',
          resolve: {
            column: function () {
              return column;
            }
          }
{'fraction_non_alphanumeric': 0.1431338028169014, 'fraction_numerical': 0.0007042253521126761, 'mean_word_length': 2.264942528735632, 'pattern_counts': {'":': 54, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7350228', 'n_tokens_mistral': 1526, 'n_tokens_neox': 1474, 'n_words': 402}