<commit_before>(function() {
    'use strict';

    angular.module('BlurAdmin.pages.viewtasks').controller('ViewTasksPageCtrl', ViewTasksPageCtrl);


    function ViewTasksPageCtrl($scope, $timeout, $http, AuthenticationService) {

        /* Get tasks list from API, these are the tast that currently available*/

        $http.get('https://04z6zajmp1.execute-api.us-east-1.amazonaws.com/dev/allTask').then(function tasksList(response) {
            $scope.list1 = response.data.data.Items;
            //print($scope.list6);
        });


        /*Get users current tasks*/
        var userID = {
            "id": '<EMAIL>'
        };


        $scope.list4 = [];
        var dd = {
            "id": "<EMAIL>",
            "task": $scope.list4
        };



        var addUserTasks = function() {
            $http.post('https://04z6zajmp1.execute-api.us-east-1.amazonaws.com/dev/updateUserTask', dd).then(function(response) {
                if (response.data.status == "success") {
                    print("task added");
                    //getUserCurrenTasks();
                } else {
                    print("error");
                }
            });
        };

        var getUserCurrenTasks = function() {
            $http.post('https://04z6zajmp1.execute-api.us-east-1.amazonaws.com/dev/getUserTask', userID).then(function(response) {
                if (response.data.status == "success") {
                    $scope.list4 =response.data.data.Item.task;
                    //print(JSON.stringify(response.data.data.Item.task));
                    print("Tasks retrieved");
                    print($scope.list4);
                } else if (response.data.status == "error") {
                    print("User authentication error");
                }
            });
        };
        getUserCurrenTasks();

        // $scope.list1 = [{
        //     'id': 'Node'
        // }, {
        //     'id': 'Angular'
        // }, {
        //     'id': 'React'
        // }, {
        //     'id': 'Bootstrap'
        // }, {
        //     'id': 'Leadership'
        // }];


        $scope.hideMe = function() {
            return $scope.list4.length > 0;
        };

        //task delete button funcction
        $scope.delete = function(item) {
            $scope.list4.splice($scope.list4.indexOf(item), 1);
        };

        //Actions for save button
        $scope.savetasks = function() {
            print(dd);
            addUserTasks();
        };

    }

    function print($print) {
        console.log($print);
    }
})();
<commit_msg>task notification added<commit_after>(function() {
    'use strict';

    angular.module('BlurAdmin.pages.viewtasks').controller('ViewTasksPageCtrl', ViewTasksPageCtrl);


    function ViewTasksPageCtrl($scope, $timeout, $http, AuthenticationService, toastr, toastrConfig) {

        var defaultConfig = angular.copy(toastrConfig);
        var openedToasts = [];
        $scope.options = {
            autoDismiss: false,
            positionClass: 'toast-top-right',
            type: 'success',
            timeOut: '5000',
            extendedTimeOut: '2000',
            allowHtml: false,
            closeButton: true,
            tapToDismiss: true,
            progressBar: false,
            newestOnTop: true,
            maxOpened: 0,
            preventDuplicates: false,
            preventOpenDuplicates: false,
            title: "",
            msg: "My plan updated"
        };

        /* Get tasks list from API, these are the tast that currently available*/

        $http.get('https://ezh9ingj6l.execute-api.us-east-1.amazonaws.com/dev/allTask').then(function tasksList(response) {
            $scope.list1 = response.data.data.Items;
            //print($scope.list6);
        });


        /*Get users current tasks*/
        var userID = {
            "id": '<EMAIL>'
        };


        $scope.list4 = [];



        //add user task function, from this new tasks will add to the plan
        var addUserTasks = function() {
            var newTask = {
                "id": "<EMAIL>",
                "task": $scope.list4
            };

            $http.post('https://ezh9ingj6l.execute-api.us-east-1.amazonaws.com/dev/updateUserTask', newTask).then(function(response) {
                if (response.data.status == "success") {
                    angular.extend(toastrConfig, $scope.options);
                    openedToasts.push(toastr[$scope.options.type]($scope.options.msg, $scope.options.title));
                    var strOptions = {};
                    for (var o in $scope.options)
                        if (o != 'msg' && o != 'title') strOptions[o] = $scope.options[o];
                    print("task added");
                } else {
                    $scope.options['msg'] = "Error in adding task";
                    $scope.options['type'] = "error";
                    angular.extend(toastrConfig, $scope.options);
                    openedToasts.push(toastr[$scope.options.type]($scope.options.msg, $scope.options.title));
                    var strOptions = {};
                    for (var o in $scope.options)
                        if (o != 'msg' && o != 'title') strOptions[o] = $scope.options[o];
                }
            });
        };

        var getUserCurrenTasks = function() {
            $http.post('https://ezh9ingj6l.execute-api.us-east-1.amazonaws.com/dev/getUserTask', userID).then(function(response) {
                if (response.data.status == "success") {
                    $scope.list4 = response.data.data.Item.task;
                    print("Tasks retrieved");
                } else if (response.data.status == "error") {
                    print("User authentication error");
                }
            });
        };
        getUserCurrenTasks();

        $scope.hideMe = function() {
            return $scope.list4.length > 0;
        };

        //task delete button funcction
        $scope.delete = function(item) {
            $scope.list4.splice($scope.list4.indexOf(item), 1);
        };

        //Actions for save button
        $scope.savetasks = function() {
            addUserTasks();
        };

    }

    function print($print) {
        console.log($print);
    }
})();

{'fraction_non_alphanumeric': 0.1428115015974441, 'fraction_numerical': 0.00878594249201278, 'mean_word_length': 1.5523848348960456, 'pattern_counts': {'":': 6, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 6, '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': '2394840', 'n_tokens_mistral': 1790, 'n_tokens_neox': 1702, 'n_words': 305}