134 lines
4.3 KiB
JavaScript
134 lines
4.3 KiB
JavaScript
"use strict";
|
|
/**
|
|
* Created by igor.samulenko on 3/6/14.
|
|
*/
|
|
(function () {
|
|
'use strict';
|
|
angular.module('myitsmApp')
|
|
.directive('timelineItemRenderer', function () {
|
|
return {
|
|
restrict: 'E',
|
|
replace: true,
|
|
scope: {
|
|
item: '=',
|
|
type: '=',
|
|
parentContext: '=',
|
|
isUnflagEditAllowed: '=',
|
|
showContext: '&',
|
|
expandItem: '&',
|
|
handleLikeClick: '&',
|
|
handleAttachmentClick: '&',
|
|
saveNote: '&'
|
|
},
|
|
templateUrl: 'views/feed/timeline-item-renderer.html',
|
|
link: function (scope) {
|
|
scope.isActivityForKA = function () {
|
|
return scope.type === EntityVO.TYPE_KNOWLEDGE;
|
|
};
|
|
}
|
|
};
|
|
}).directive('feedItemRenderer', function () {
|
|
return {
|
|
restrict: 'E',
|
|
replace: true,
|
|
scope: {
|
|
item: '=',
|
|
handleAttachmentClick: '&',
|
|
handleUnpinClick: '&'
|
|
},
|
|
templateUrl: 'views/feed/feed-item-renderer.html',
|
|
link: function (scope) {
|
|
scope.titleRegExp = new RegExp(/.{1,5}/g);
|
|
}
|
|
};
|
|
}).directive('responseItemRenderer', function () {
|
|
return {
|
|
restrict: 'E',
|
|
replace: true,
|
|
scope: {
|
|
item: '='
|
|
},
|
|
templateUrl: 'views/feed/response-item-renderer.html'
|
|
};
|
|
}).directive('personTicketRenderer', function () {
|
|
return {
|
|
restrict: 'E',
|
|
replace: true,
|
|
scope: {
|
|
data: '='
|
|
},
|
|
templateUrl: 'views/person/person-ticket-renderer.html'
|
|
};
|
|
}).directive('personAssetRenderer', function () {
|
|
return {
|
|
restrict: 'E',
|
|
replace: true,
|
|
scope: {
|
|
data: '='
|
|
},
|
|
templateUrl: 'views/person/person-asset-renderer.html'
|
|
};
|
|
}).directive('personSupportGroupRenderer', function () {
|
|
return {
|
|
restrict: 'E',
|
|
replace: true,
|
|
scope: {
|
|
data: '='
|
|
},
|
|
templateUrl: 'views/person/person-support-group-renderer.html'
|
|
};
|
|
}).directive('personKnowledgeRenderer', function () {
|
|
return {
|
|
restrict: 'E',
|
|
replace: true,
|
|
scope: {
|
|
data: '='
|
|
},
|
|
templateUrl: 'views/person/person-knowledge-renderer.html'
|
|
};
|
|
}).directive('personAssetWithCheckboxRenderer', function () {
|
|
return {
|
|
restrict: 'E',
|
|
replace: true,
|
|
scope: {
|
|
data: '=',
|
|
showItemDetails: '&',
|
|
selectAssetItem: '&',
|
|
savedTemplate: '='
|
|
},
|
|
templateUrl: 'views/person/person-asset-with-checkbox-renderer.html'
|
|
};
|
|
}).directive('assetPersonRenderer', function () {
|
|
return {
|
|
restrict: 'E',
|
|
replace: true,
|
|
scope: {
|
|
data: '=',
|
|
isPeopleType: '&',
|
|
removePeople: '&',
|
|
showPersonDetails: '&',
|
|
editModeAllowed: '@'
|
|
},
|
|
templateUrl: 'views/asset/asset-person-renderer.html',
|
|
link: function (scope) {
|
|
scope.displayValue;
|
|
if (scope.data.realObject.reqType === 'supportgroup') {
|
|
scope.displayValue = scope.data.realObject.supportGroupName;
|
|
}
|
|
else if (scope.data.realObject.reqType === 'organization') {
|
|
scope.displayValue = scope.data.realObject.organizationName;
|
|
}
|
|
else if (scope.data.realObject.reqType === 'department') {
|
|
scope.displayValue = scope.data.realObject.departmentName;
|
|
}
|
|
else if (scope.data.realObject.reqType === 'company') {
|
|
scope.displayValue = scope.data.realObject.companyContactName;
|
|
}
|
|
else {
|
|
scope.displayValue = scope.data.realObject.fullName;
|
|
}
|
|
}
|
|
};
|
|
});
|
|
}());
|