<commit_before>import { Component, EventEmitter, Input, Output } from '@angular/core';
import { Task } from '../../shared/classes/backend/task';
import { DeleteTaskRB } from '../../shared/classes/backend/deleteTaskRB';
import { WeekService } from '../../shared/services/week.service';
import { FinishingTaskRB } from '../../shared/classes/backend/finishingTaskRB';
import { StartTaskRB } from '../../shared/classes/backend/startTaskRB';
import { ErrorModalComponent } from '../../modals/error-modal/error-modal.component';
import { STATUS_CODE_NOT_MODIFIED, NetworkService } from '../../shared/services/network.service';

@Component({
    selector: 'my-task-table',
    templateUrl: 'task-table.component.html',
    styleUrls: ['task-table.component.scss'],
})

export class TaskTableComponent {
    @Input() public tasks: Task[];
    @Output() public refresh = new EventEmitter();

    public confirmDeleteVisible = false;

    public taskId = '';
    public comment = '';
    public startTime = TaskTableComponent.getActualTime();

    public selectedTask: Task;
    private requestDeleteTask: Task;

    private static getActualTime(): string {
        let date = new Date();
        let minutes = date.getMinutes() - date.getMinutes() % 15 + '';
        if (minutes === '0') {
            minutes = '00';
        }

        return date.getHours() + ':' + minutes;
    }

    constructor(
        private weekService: WeekService,
        private networkService: NetworkService,
    ) {}

    public onCreateTask(): void {
        let startTask = new StartTaskRB(this.weekService.getSelectedDay(), this.taskId, this.comment, this.startTime);
        this.networkService.startTask(startTask)
            .subscribe(
                () => this.refresh.emit(),
                error => {
                    if (error.status === STATUS_CODE_NOT_MODIFIED) {
                        ErrorModalComponent.show('The task can not be created');
                    }
                });

        this.taskId = '';
        this.comment = '';
        this.startTime = TaskTableComponent.getActualTime();
    }

    public onRequestDeleteTask(task: Task): void {
        this.confirmDeleteVisible = true;<commit_msg>Not reset data when task was not created.<commit_after>import { Component, EventEmitter, Input, Output } from '@angular/core';
import { Task } from '../../shared/classes/backend/task';
import { DeleteTaskRB } from '../../shared/classes/backend/deleteTaskRB';
import { WeekService } from '../../shared/services/week.service';
import { FinishingTaskRB } from '../../shared/classes/backend/finishingTaskRB';
import { StartTaskRB } from '../../shared/classes/backend/startTaskRB';
import { ErrorModalComponent } from '../../modals/error-modal/error-modal.component';
import { STATUS_CODE_NOT_MODIFIED, NetworkService } from '../../shared/services/network.service';

@Component({
    selector: 'my-task-table',
    templateUrl: 'task-table.component.html',
    styleUrls: ['task-table.component.scss'],
})

export class TaskTableComponent {
    @Input() public tasks: Task[];
    @Output() public refresh = new EventEmitter();

    public confirmDeleteVisible = false;

    public taskId = '';
    public comment = '';
    public startTime = TaskTableComponent.getActualTime();

    public selectedTask: Task;
    private requestDeleteTask: Task;

    private static getActualTime(): string {
        let date = new Date();
        let minutes = date.getMinutes() - date.getMinutes() % 15 + '';
        if (minutes === '0') {
            minutes = '00';
        }

        return date.getHours() + ':' + minutes;
    }

    constructor(
        private weekService: WeekService,
        private networkService: NetworkService,
    ) {}

    public onCreateTask(): void {
        let startTask = new StartTaskRB(this.weekService.getSelectedDay(), this.taskId, this.comment, this.startTime);
        this.networkService.startTask(startTask)
            .subscribe(
                () => {
                    this.refresh.emit();
                    this.taskId = '';
                    this.comment = '';
                    this.startTime = TaskTableComponent.getActualTime();
                },
                error => {
                    if (error.status === STATUS_CODE_NOT_MODIFIED) {
                        ErrorModalComponent.show('The task can not be created');
                    }
                }
            );
    }

    public onRequestDeleteTask(task: Task): void {
        this.confirmDeleteVisible = true;
{'fraction_non_alphanumeric': 0.13557076617354824, 'fraction_numerical': 0.00220799293442261, 'mean_word_length': 2.444866920152091, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '974757', 'n_tokens_mistral': 1211, 'n_tokens_neox': 1185, 'n_words': 270}