<commit_before>import { Component, OnInit, OnDestroy } from '@angular/core';
import { Response } from '@angular/http';
import { Subscription } from 'rxjs/Rx';
import { EventManager, JhiLanguageService, AlertService } from 'ng-jhipster';

import { OAuthClient } from './oauth-client.model';
import { OAuthClientService } from './oauth-client.service';
import { Principal } from '../../shared';

@Component({
    selector: 'jhi-oauth-client',
    templateUrl: './oauth-client.component.html'
})
export class OAuthClientComponent implements OnInit, OnDestroy {
    oauthClients: OAuthClient[];
    currentAccount: any;
    eventSubscriber: Subscription;
    objectKeys = Object.keys;

    times = {
        day: 86400,
        hour: 3600,
        minute: 60,
        second: 1
    };

    constructor(
        private jhiLanguageService: JhiLanguageService,
        private oauthClientService: OAuthClientService,
        private alertService: AlertService,
        private eventManager: EventManager,
        private principal: Principal
    ) {
        this.jhiLanguageService.setLocations(['oauthClient']);
    }

    loadAll() {
        this.oauthClientService.query().subscribe(
            (res: Response) => {
                this.oauthClients = res.json();
            },
            (res: Response) => this.onError(res.json())
        );
    }
    ngOnInit() {
        this.loadAll();
        this.principal.identity().then((account) => {
            this.currentAccount = account;
        });
        this.registerChangeInOAuthClients();
    }

    ngOnDestroy() {
        this.eventManager.destroy(this.eventSubscriber);
    }

    trackId(index: number, item: OAuthClient) {
        return item.clientId;
    }

    registerChangeInOAuthClients() {
        this.eventSubscriber = this.eventManager.subscribe('oauthClientListModification', () => this.loadAll());
    }

    private onError(error) {
        this.alertService.error(error.message, null, null);
    }
}<commit_msg>Add back missing convertSeconds function<commit_after>import { Component, OnInit, OnDestroy } from '@angular/core';
import { Response } from '@angular/http';
import { Subscription } from 'rxjs/Rx';
import { EventManager, JhiLanguageService, AlertService } from 'ng-jhipster';

import { OAuthClient } from './oauth-client.model';
import { OAuthClientService } from './oauth-client.service';
import { Principal } from '../../shared';

@Component({
    selector: 'jhi-oauth-client',
    templateUrl: './oauth-client.component.html'
})
export class OAuthClientComponent implements OnInit, OnDestroy {
    oauthClients: OAuthClient[];
    currentAccount: any;
    eventSubscriber: Subscription;
    objectKeys = Object.keys;

    times = {
        day: 86400,
        hour: 3600,
        minute: 60,
        second: 1
    };

    constructor(
        private jhiLanguageService: JhiLanguageService,
        private oauthClientService: OAuthClientService,
        private alertService: AlertService,
        private eventManager: EventManager,
        private principal: Principal
    ) {
        this.jhiLanguageService.setLocations(['oauthClient']);
    }

    loadAll() {
        this.oauthClientService.query().subscribe(
            (res: Response) => {
                this.oauthClients = res.json();
            },
            (res: Response) => this.onError(res.json())
        );
    }
    ngOnInit() {
        this.loadAll();
        this.principal.identity().then((account) => {
            this.currentAccount = account;
        });
        this.registerChangeInOAuthClients();
    }

    ngOnDestroy() {
        this.eventManager.destroy(this.eventSubscriber);
    }

    trackId(index: number, item: OAuthClient) {
        return item.clientId;
    }

    registerChangeInOAuthClients() {
        this.eventSubscriber = this.eventManager.subscribe('oauthClientListModification', () => this.loadAll());
    }

    private onError(error) {
        this.alertService.error(error.message, null, null);
    }

    private convertSeconds(seconds: number) {
        let time_string: string = '';
        let plural: string = '';
        for(var key in this.times){
            if(Math.floor(seconds / this.times[key]) > 0){
                if(Math.floor(seconds / this.times[key]) >1 ){
                    plural = 's';
                }
                else{
                    plural = '';
                }

                time_string += Math.floor(seconds / this.times[key]).toString() + ' ' + key.toString() + plural + ' ';
                seconds = seconds - this.times[key] * Math.floor(seconds / this.times[key]);

            }
        }
        return time_string;
    }
}
{'fraction_non_alphanumeric': 0.1252140410958904, 'fraction_numerical': 0.005565068493150685, 'mean_word_length': 2.4184345281638624, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '7250276', 'n_tokens_mistral': 1353, 'n_tokens_neox': 1303, 'n_words': 257}