SmartIT_Extensions/BMC/smart-it-full/scripts/app/person/person-infocard-directive.js

32 lines
1.3 KiB
JavaScript

"use strict";
(function () {
'use strict';
angular.module('personModule')
.directive('personInfoCard', ['$state', 'googleMapService', function ($state, googleMapService) {
return {
restrict: 'E',
scope: {
person: '=',
showThumbnail: '@',
label: '=',
profileType: '@',
context: '=',
personType: '@'
},
priority: 99,
replace: true,
templateUrl: 'views/person/person-infocard-template.html',
link: function (scope) {
scope.googleMapAvailable = googleMapService.isAvailable;
if (scope.context && scope.context.type === EntityVO.TYPE_SBEREQUEST) {
scope.context.displayId = scope.context.id;
scope.context.summary = scope.context.serviceName;
}
scope.isCustomerRequired = function () {
return scope.personType === "customer" && scope.profileType !== 'person' && (scope.profileType !== 'incident' || scope.context.serviceType !== 'Infrastructure Event');
};
}
};
}]);
}());