<commit_before>'use strict';
if (typeof define !== 'function') { var define = require('amdefine')(module); }
/* jshint unused: false */
define([
           'angular', 'moment',
           'camunda-tasklist-ui/utils',
           'camunda-tasklist-ui/api',
           'angular-bootstrap',
           'text!camunda-tasklist-ui/task/task.html',
           'text!camunda-tasklist-ui/task/form.html',
           'text!camunda-tasklist-ui/task/history.html'
], function(angular,   moment) {
  var taskModule = angular.module('cam.tasklist.task', [
    require('camunda-tasklist-ui/utils').name,
    require('camunda-tasklist-ui/api').name,
    'ui.bootstrap',
    'cam.form',
    'angularMoment'
  ]);

  /**
   * @module cam.tasklist.task
   */

  /**
   * @memberof cam.tasklist
   */

  taskModule.directive('camTasklistTask', [
          '$modal', '$rootScope', 'camUID',
  function($modal,   $rootScope,   camUID) {
    $rootScope.batchActions = {};
    $rootScope.batchActions.selected = [];

    return {
      link: function(scope, element) {
        scope.task = scope.task || $rootScope.currentTask;

        scope.elUID = camUID();

        element.find('.nav li').eq(0).addClass('active');
        element.find('.tab-pane').eq(0).addClass('active');

        $rootScope.$on('tasklist.task.current', function() {
          scope.task = $rootScope.currentTask;
        });
      },
      template: require('text!camunda-tasklist-ui/task/task.html')
    };
  }]);

  // should be moved to the form module...
  taskModule.directive('camTasklistTaskForm', [
          'camAPI', '$rootScope', 'camUID',
  function(camAPI,   $rootScope,   camUID) {
    return {
      link: function(scope, element) {
        scope.elUID = camUID();

        scope.labelsWidth = 3;
        scope.fieldsWidth = 12 - scope.labelsWidth;

        $rootScope.$watch('currentTask', function() {
          console.info('Current task is now', $rootScope.currentTask);
          // scope.fields = camTaskFormData();
        });
      },
      template: require('text!camunda-tasklist-ui/task/form.html')
    };
  }]);

  taskModule.directive('camTasklistTaskHistory', [
          'camAPI', '$rootScope', '$timeout',
  function(camAPI,   $rootScope,   $timeout) {
    return {
      link: function(scope, element) {
        scope.history = [];
        scope.days = [];

        $rootScope.$on('tasklist.task.current', function() {
          // scope.history = camTaskHistoryData(null, null);
          scope.history = [];
          scope.now = new Date();<commit_msg>improve(pile): prevent loading selected task multiple times<commit_after>'use strict';
if (typeof define !== 'function') { var define = require('amdefine')(module); }
/* jshint unused: false */
define([
           'angular', 'moment',
           'camunda-tasklist-ui/utils',
           'camunda-tasklist-ui/api',
           'angular-bootstrap',
           'text!camunda-tasklist-ui/task/task.html',
           'text!camunda-tasklist-ui/task/form.html',
           'text!camunda-tasklist-ui/task/history.html'
], function(angular,   moment) {
  var taskModule = angular.module('cam.tasklist.task', [
    require('camunda-tasklist-ui/utils').name,
    require('camunda-tasklist-ui/api').name,
    'ui.bootstrap',
    'cam.form',
    'angularMoment'
  ]);

  /**
   * @module cam.tasklist.task
   */

  /**
   * @memberof cam.tasklist
   */

  taskModule.directive('camTasklistTask', [
          '$modal', '$rootScope', 'camUID',
  function($modal,   $rootScope,   camUID) {
    $rootScope.batchActions = {};
    $rootScope.batchActions.selected = [];

    return {
      link: function(scope, element) {
        scope.task = scope.task || $rootScope.currentTask;

        scope.elUID = camUID();

        element.find('.nav li').eq(0).addClass('active');
        element.find('.tab-pane').eq(0).addClass('active');

        $rootScope.$watch('currentTask', function() {
          if (!$rootScope.currentTask || (scope.task && scope.task.id === $rootScope.currentTask.id)) {
            return;
          }
          scope.task = $rootScope.currentTask;
          console.info('Current task is now', scope.task);
        });
      },
      template: require('text!camunda-tasklist-ui/task/task.html')
    };
  }]);

  // should be moved to the form module...
  taskModule.directive('camTasklistTaskForm', [
          'camAPI', '$rootScope', 'camUID',
  function(camAPI,   $rootScope,   camUID) {
    return {
      link: function(scope, element) {
        scope.task = scope.task || $rootScope.currentTask;

        scope.elUID = camUID();

        scope.labelsWidth = 3;
        scope.fieldsWidth = 12 - scope.labelsWidth;

        $rootScope.$watch('currentTask', function() {
          if (!$rootScope.currentTask || (scope.task && scope.task.id === $rootScope.currentTask.id)) {
            return;
          }
          scope.task = $rootScope.currentTask;
          console.info('Current task is now, get the form', scope.task);
          // scope.fields = camTaskFormData();
        });
      },
      template: require('text!camunda-tasklist-ui/task/form.html')
    };
  }]);

  taskModule.directive('camTasklistTaskHistory', [
          'camAPI', '$rootScope', '$timeout',
  function(camAPI,   $rootScope,   $timeout) {
    return {
      link: function(scope, element) {
        scope.history = [];
        scope.days = [];

        $rootScope.$on('tasklist.task.current', function() {
          // scope.history = camTaskHistoryData(null, null);
          scope.history = [];
          scope.now = new Date();
{'fraction_non_alphanumeric': 0.16741674167416742, 'fraction_numerical': 0.0018001800180018, 'mean_word_length': 2.483385579937304, 'pattern_counts': {'":': 0, '<': 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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7470331', 'n_tokens_mistral': 1716, 'n_tokens_neox': 1683, 'n_words': 270}