summaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/view-models/modals/error-modal/error-view-model.ts
blob: f622a6f53b9660026c09e96aeb2065f4de46bdfb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
'use strict';
import {CookieService} from "app/services";

interface IErrorViewModelScope {
    mailto:string;
}

export class ErrorViewModel {

    static ADMIN_EMAIL = 'dl-asdcaccessrequest@att.com';
    static SUBJECT_PRFIEX = 'SDC Access Request for';

    static '$inject' = ['$scope', 'Sdc.Services.CookieService', '$window'];

    constructor($scope:IErrorViewModelScope, cookieService:CookieService, $window) {
        let userDetails = cookieService.getFirstName() + ' ' + cookieService.getLastName() + ' (' + cookieService.getUserId() + ')';
        $scope.mailto = ErrorViewModel.ADMIN_EMAIL + '?subject=' + $window.encodeURIComponent(ErrorViewModel.SUBJECT_PRFIEX + ' ' + userDetails);
    }
}