Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
promises.push(this.lexConfig.getFieldConfig(comment.regarding.field).then(fieldConfig => {
// As the promise runs when its ready the comments can double up if loadEntryComments is run multiple times
if (this.comments.items.currentEntry.indexOf(comment) === -1) {
let contextGuid = '';
if (comment.contextGuid !== undefined) {
contextGuid = comment.contextGuid;
} else {
contextGuid = comment.regarding.field +
(comment.regarding.inputSystem ? '.' + comment.regarding.inputSystem : '');
if (fieldConfig.type === 'multioptionlist') {
contextGuid += '#' + comment.regarding.fieldValue;
}
comment.contextGuid = contextGuid;
}
if (contextGuid && angular.isUndefined(this.comments.counts.currentEntry.fields[contextGuid])) {
this.comments.counts.currentEntry.fields[contextGuid] = 0;
}
this.comments.items.currentEntry.push(comment);
// update the appropriate count for this field and update the total count
if (comment.status !== 'resolved') {
if (contextGuid) {
this.comments.counts.currentEntry.fields[contextGuid]++;
}
this.comments.counts.currentEntry.total++;
}
}
}));
}
_prepareOptions() {
if (angular.isUndefined(this.valueOn)) {
if (angular.isDefined(this.ngTrueValue)) {
this.valueOn = this.ngTrueValue;
console.warn('cc-toggle/cc-switch: ng-true-value/ng-false-value 参数已废弃,请使用 value-on/value-off 代替。');
} else {
this.valueOn = ToggleController.valueOn;
}
}
if (angular.isUndefined(this.valueOff)) {
if (angular.isDefined(this.ngFalseValue)) {
this.valueOff = this.ngFalseValue;
console.warn('cc-toggle/cc-switch: ng-true-value/ng-false-value 参数已废弃,请使用 value-on/value-off 代替。');
} else {
this.valueOff = ToggleController.valueOff;
}
}
function link(scope, element) {
if (angular.isUndefined(scope.scale)) {
scope.scale = 1.0;
}
if (angular.isUndefined(scope.padding)) {
scope.padding = 0.0;
}
var graph = diagramming.newGraph();
var cell = scope.shape.getElement();
var diagram;
if (cell.isLink()) {
diagram = linkStencil(cell, scope.shape.label, element, scope.scale, scope.padding, graph);
}
else {
diagram = elementStencil(cell, scope.shape.label, element, scope.scale, scope.padding, graph);
}
diagram.on('cell:pointerclick', scope.action);
var toolTip = 'Add a new ' + scope.shape.label + ' to the model';
$scope.delete = function(versionId) {
if (!angular.isUndefined(versionId)) {
versionServices.delete({
delegateId: delegateId,
versionId: versionId
}, null, function(result) {
if (result) {
$scope.searchService.search();
refreshAllAppVersions();
}
});
}
};
}, (newVal: string, oldVal: string) => {
if (angular.isUndefined(newVal)) {
this.newProject.projectCode = '';
} else if (newVal !== oldVal) {
this.newProject.projectCode = newVal.toLowerCase().replace(/ /g, '_');
}
});
const setupNavigation = function () {
if (angular.isUndefined(vm.activeSection)) {
vm.next = _pages[1];
vm.prev = { valid: false };
} else {
const nextIndex = nextPageIndex();
vm.next = nextIndex > -1 ? _pages[nextIndex] : { valid: false };
const prevIndex = prevPageIndex();
vm.prev = prevIndex > -1 ? _pages[prevIndex] : { valid: false };
}
};
function getTemplatePromise(template_url) {
var template = $templateCache.get(template_url);
if (isUndefined(template)) {
throw new Error("templateUrl was not stored in templateCache. Did you import it ?");
}
return $q.when(template);
}
augmentRoleWithUiModel(roleMembership: any) {
roleMembership.ui = { members: { selectedItem: '', searchText: '' } };
if (angular.isUndefined(roleMembership.members)) {
roleMembership.members = [];
}
}
queryForRoleAssignments(entity: any, membersType: any) {
function isControllerAsOptionValid(options) {
return !isUndefined(options.controllerAs) && isString(options.controllerAs);
}
public link(scope: any, instanceElement: angular.IAugmentedJQuery, attrs: any, ctrls: any[]): void {
let mainWrapper: JQuery = instanceElement.parent().parent();
if (!angular.isUndefined(mainWrapper) && mainWrapper.hasClass('ms-Callout-main')) {
let detachedHeader: JQuery = instanceElement.detach();
mainWrapper.prepend(detachedHeader);
}
}
}