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

import {AbstractPageComponent} from '../abstract-page/abstract-page.component';
import {RAMServices} from '../../services/ram-services';

import {IIdentity} from '../../../../commons/RamAPI2';

@Component({
    selector: 'landing-home',
    templateUrl: 'welcome-home.component.html',
    directives: [ROUTER_DIRECTIVES]
})

export class WelcomeHomeComponent extends AbstractPageComponent {

    private identity: IIdentity = null;

    constructor(route: ActivatedRoute,
                router: Router,
                services: RAMServices) {
        super(route, router, services);
        this.setBannerTitle('Relationship Access Manager');
    }

    public onInit(params: {path: Params, query: Params}) {

        const dashboard = params.path['dashboard'];

        // logged in identity
        this.services.rest.findMyIdentity().subscribe(identity => {

            this.identity = identity;

            if (dashboard === 'auth') {
                this.goToAuthorisationsPage();
            } else if (dashboard === 'sps') {
                this.goToSoftwareProviderServicesPage();
            }

        });

    }

    public goToAuthorisationsPage() {
        if (this.isAuthenticated()) {
            if (this.isAgencyUser()) {
                this.services.route.goToAgencySelectBusinessForAuthorisationsPage();
            } else {
                this.services.route.goToRelationshipsPage(this.identity.idValue);
            }
        } else {
            this.clearGlobalMessages();
            this.addGlobalMessage('You are not currently logged in.');
        }
    }

    public goToSoftwareProviderServicesPage() {
        if (this.isAuthenticated()) {
            if (this.isAgencyUser()) {
                this.services.route.goToAgencySelectBusinessForSoftwareProviderServicesPage();
            } else {
                this.services.route.goToBusinessesPage();
            }
        } else {
            this.clearGlobalMessages();
            this.addGlobalMessage('You are not currently logged in.');
        }
    }

    private isAuthenticated() {
        return this.identity !== null;
    }

    // todo handle agency (ie consider using Principal)
    // todo determine if agency user or not
    private isAgencyUser() {
        return true;
    }

}<commit_msg>Hard code to non-agency user<commit_after>import {Component} from '@angular/core';
import {ROUTER_DIRECTIVES, ActivatedRoute, Router, Params} from '@angular/router';

import {AbstractPageComponent} from '../abstract-page/abstract-page.component';
import {RAMServices} from '../../services/ram-services';

import {IIdentity} from '../../../../commons/RamAPI2';

@Component({
    selector: 'landing-home',
    templateUrl: 'welcome-home.component.html',
    directives: [ROUTER_DIRECTIVES]
})

export class WelcomeHomeComponent extends AbstractPageComponent {

    private identity: IIdentity = null;

    constructor(route: ActivatedRoute,
                router: Router,
                services: RAMServices) {
        super(route, router, services);
        this.setBannerTitle('Relationship Access Manager');
    }

    public onInit(params: {path: Params, query: Params}) {

        const dashboard = params.path['dashboard'];

        // logged in identity
        this.services.rest.findMyIdentity().subscribe(identity => {

            this.identity = identity;

            if (dashboard === 'auth') {
                this.goToAuthorisationsPage();
            } else if (dashboard === 'sps') {
                this.goToSoftwareProviderServicesPage();
            }

        });

    }

    public goToAuthorisationsPage() {
        if (this.isAuthenticated()) {
            if (this.isAgencyUser()) {
                this.services.route.goToAgencySelectBusinessForAuthorisationsPage();
            } else {
                this.services.route.goToRelationshipsPage(this.identity.idValue);
            }
        } else {
            this.clearGlobalMessages();
            this.addGlobalMessage('You are not currently logged in.');
        }
    }

    public goToSoftwareProviderServicesPage() {
        if (this.isAuthenticated()) {
            if (this.isAgencyUser()) {
                this.services.route.goToAgencySelectBusinessForSoftwareProviderServicesPage();
            } else {
                this.services.route.goToBusinessesPage();
            }
        } else {
            this.clearGlobalMessages();
            this.addGlobalMessage('You are not currently logged in.');
        }
    }

    private isAuthenticated() {
        return this.identity !== null;
    }

    // todo handle agency (ie consider using Principal)
    // todo determine if agency user or not
    private isAgencyUser() {
        return false;
    }

}
{'fraction_non_alphanumeric': 0.11518003273322422, 'fraction_numerical': 0.0004091653027823241, 'mean_word_length': 2.246347941567065, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '3315131', 'n_tokens_mistral': 1318, 'n_tokens_neox': 1261, 'n_words': 268}