<commit_before>import { Component } from '@angular/core';

import {
  AlertController,
  IonicPage,
  ModalController,
  NavController,
  NavParams,
  ToastController,
} from 'ionic-angular';

import { RoomsProvider } from '../../providers/providers';

@IonicPage({ })
@Component({
  selector: 'page-professor-room',
  templateUrl: 'professor-room.html',
})
export class ProfessorRoomPage {
  rooms: any;

  constructor(
    public alertCtrl: AlertController,
    public navCtrl: NavController,
    public navParams: NavParams,
    public modalCtrl: ModalController,
    public rs: RoomsProvider,
    public toastCtrl: ToastController,
  ) { }

  ionViewDidLoad() {
    this.rs.find()
      .subscribe((rooms) => {
        this.rooms = rooms.data;
      });
  }

  newRoom() {
    this.modalCtrl.create('NewRoomPage', null, {cssClass: 'new-room-modal'}).present();
  }

  students(room) {
    this.navCtrl.push('AddStudentsPage', { room });
  }

  activate(room) {
    const online = this.rooms.filter(x => x.online && x._id !== room._id);

    if (online.length > 0) {
      online.forEach((r) => {
        this.rs.activate(r, false);
      });
    }
    this.rs.activate(room, room.online)
      .then(() => this.presentToast(`Turma #${room.code} ativada`));
  }

  goToActivities(room) {
    this.navCtrl.push('ProfessorAttendanceListPage', { room });
  }

  remove(room) {
    this.rs.remove(room)
      .then(() => this.presentToast(`Turma #${room.code} removida`));
  }

  presentToast(message) {
    let toast = this.toastCtrl.create({
      message,
      duration: 3000,
    });
    return toast.present();
  }

  askToRemove(room) {
    let confirm = this.alertCtrl.create({
      title: 'Remover turma?',
      message: 'Essa operação não pode ser desfeita.',
      buttons: [
        {
          text: 'Cancelar',
          handler: () => {
            this.presentToast('Remoção cancelada');
          }
        },
        {
          text: 'OK',
          handler: () => {
            this.remove(room);
          }
        }
      ]
    });
    confirm.present();
  }
}<commit_msg>refactor(room): let to const<commit_after>import { Component } from '@angular/core';

import {
  AlertController,
  IonicPage,
  ModalController,
  NavController,
  NavParams,
  ToastController,
} from 'ionic-angular';

import { RoomsProvider } from '../../providers/providers';

@IonicPage({ })
@Component({
  selector: 'page-professor-room',
  templateUrl: 'professor-room.html',
})
export class ProfessorRoomPage {
  rooms: any;

  constructor(
    public alertCtrl: AlertController,
    public navCtrl: NavController,
    public navParams: NavParams,
    public modalCtrl: ModalController,
    public rs: RoomsProvider,
    public toastCtrl: ToastController,
  ) { }

  ionViewDidLoad() {
    this.rs.find()
      .subscribe((rooms) => {
        this.rooms = rooms.data;
      });
  }

  newRoom() {
    this.modalCtrl.create('NewRoomPage', null, {cssClass: 'new-room-modal'}).present();
  }

  students(room) {
    this.navCtrl.push('AddStudentsPage', { room });
  }

  activate(room) {
    const online = this.rooms.filter(x => x.online && x._id !== room._id);

    if (online.length > 0) {
      online.forEach((r) => {
        this.rs.activate(r, false);
      });
    }
    this.rs.activate(room, room.online)
      .then(() => this.presentToast(`Turma #${room.code} ativada`));
  }

  goToActivities(room) {
    this.navCtrl.push('ProfessorAttendanceListPage', { room });
  }

  remove(room) {
    this.rs.remove(room)
      .then(() => this.presentToast(`Turma #${room.code} removida`));
  }

  presentToast(message) {
    const toast = this.toastCtrl.create({
      message,
      duration: 2000,
    });
    return toast.present();
  }

  askToRemove(room) {
    const confirm = this.alertCtrl.create({
      title: 'Remover turma?',
      message: 'Essa operação não pode ser desfeita.',
      buttons: [
        {
          text: 'Cancelar',
          handler: () => {
            this.presentToast('Remoção cancelada');
          }
        },
        {
          text: 'OK',
          handler: () => {
            this.remove(room);
          }
        }
      ]
    });
    confirm.present();
  }
}
{'fraction_non_alphanumeric': 0.15554500118736642, 'fraction_numerical': 0.0023747328425552127, 'mean_word_length': 2.5041597337770383, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 19, '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': '2639151', 'n_tokens_mistral': 1406, 'n_tokens_neox': 1354, 'n_words': 247}