<commit_before>import { Component, OnInit } from '@angular/core';
import { Router, ActivatedRoute, Params } from '@angular/router';

import { ProjectService } from '@app/_services/project.service';

import { Project, Activity } from '@app/models';

@Component({
    selector: 'app-project-detail',
    templateUrl: './project-detail.component.html',
    styleUrls: ['./project-detail.component.css']
})
export class ProjectDetailComponent {
    project: Project;
    activities: ActivityModel[];
    selectedActivity: ActivityModel;

    constructor(private projectService: ProjectService,
        private router: Router,
        private activatedRoute: ActivatedRoute) { }

    ngOnInit() {
        // this.project = this.projectService.initializeProject();
        // this.activatedRoute.params.subscribe((params: Params) => {
        //     let projectId = params['id'];
        //     this.projectService.getProject(projectId).
        // TODO: Get project from the id,
        this.projectService.getProject('5946e90a1f393415a4055395').then(project => {
            this.project = project;
            this.projectService.getProjectActivities(this.project._id).then(activities => {
                this.activities = Array(0);
                activities.forEach((item, index) => this.activities.push(<ActivityModel> { id:index+1, activity: item}));
                console.log(this.activities);
            });
        });
    }

    onChange(activity) : void {
        this.selectedActivity = this.activities[activity-1];
        console.log(this.selectedActivity);
    }
}

export class ActivityModel
{
    id: number;
    activity: Activity;
}<commit_msg>removing the hardcode project id,<commit_after>import { Component, OnInit } from '@angular/core';
import { Router, ActivatedRoute, Params } from '@angular/router';

import { ProjectService } from '@app/_services/project.service';

import { Project, Activity } from '@app/models';

@Component({
    selector: 'app-project-detail',
    templateUrl: './project-detail.component.html',
    styleUrls: ['./project-detail.component.css']
})
export class ProjectDetailComponent {
    project: Project;
    activities: ActivityModel[];
    selectedActivity: ActivityModel;

    constructor(private projectService: ProjectService,
        private router: Router,
        private activatedRoute: ActivatedRoute) { }

    ngOnInit() {
        this.project = this.projectService.initializeProject();
        this.activatedRoute.params.subscribe((params: Params) => {
            let projectId = params['id'];
            this.projectService.getProject(projectId).then(project => {
                //TODO: Get project from the id,
                //this.projectService.getProject('5946e90a1f393415a4055395').then(project => {
                this.project = project;
                this.projectService.getProjectActivities(this.project._id).then(activities => {
                    this.activities = Array(0);
                    activities.forEach((item, index) => this.activities.push(<ActivityModel> { id:index+1, activity: item}));
                    console.log(this.activities);
                });
            });
        });
    }

    onChange(activity) : void {
        this.selectedActivity = this.activities[activity-1];
        console.log(this.selectedActivity);
    }
}

export class ActivityModel
{
    id: number;
    activity: Activity;
}
{'fraction_non_alphanumeric': 0.1268349970640047, 'fraction_numerical': 0.013505578391074574, 'mean_word_length': 2.8323959505061866, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 14, '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': '5622755', 'n_tokens_mistral': 945, 'n_tokens_neox': 912, 'n_words': 174}