Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.subscribe(data => {
this.districtList = _.get(data, 'result.response');
this.selectedDistrict = _.find(this.districtList, { name: this.selectedDistrict['name'] });
});
}
public getButtonStatus(data, topic: string) {
const topicData = _.find(data, { name: topic.toLowerCase() });
return topicData ? topicData.resourceId : 0;
}
this.profileService.getUserLocation(requestData).subscribe(res => {
this.allBlocks = res.result.response;
const location = _.find(this.userDetails.userLocations, (locations) => {
return locations.type === 'block';
});
let locationExist: any;
if (location) {
locationExist = _.find(this.allBlocks, (locations) => {
return locations.code === location.code;
});
}
locationExist ? this.userDetailsForm.controls['block'].setValue(locationExist.code) :
this.userDetailsForm.controls['block'].setValue('');
this.blockLoader = false;
}, err => {
this.toasterService.error(this.resourceService.messages.emsg.m0005);
_.forEach(this.batchDetails.mentors, (value, key) => {
const mentor = _.find(mentorList, ['id', value]);
if (mentor) {
this.selectedMentors.push(mentor);
}
});
this.selectedParticipants = _.uniqBy(this.selectedParticipants, 'id');
export const getStatusAndMessage = (operator: ClusterOperator) => {
const conditions = _.get(operator, 'status.conditions');
const degraded: any = _.find(conditions, { type: 'Degraded', status: 'True' });
if (degraded) {
return { status: OperatorStatus.Degraded, message: degraded.message };
}
const progressing: any = _.find(conditions, { type: 'Progressing', status: 'True' });
if (progressing) {
return { status: OperatorStatus.Updating, message: progressing.message };
}
const available: any = _.find(conditions, { type: 'Available', status: 'True' });
if (available) {
return { status: OperatorStatus.Available, message: available.message };
}
return { status: OperatorStatus.Unknown, message: '' };
};
_.forEach(filterArr, (collection) => {
if (collection.length > 1) {
const groupedCollection = _.find(collection, (item) => {
return item.status === 'Draft';
});
filteredTextbook.push(groupedCollection);
} else {
filteredTextbook.push(collection[0]);
}
});
const collectionCards = this.utilService.getDataForCard(filteredTextbook, constantData, dynamicFields, metaData);
export const Item = props => {
const origin = getOrigin(props);
let progress = 0;
let step;
if (props.process && props.processes.length) {
const process = find(props.processes, ["id", props.process.id]);
progress = process ? process.progress : 1;
step = process ? process.step : "None";
progress *= 100;
} else {
step = "None";
progress = 100;
}
return (
constructor(props) {
super(props);
this.onClickTab = this.onClickTab.bind(this);
const selectedTab = _.find(props.tabs, { name: props.selectedTab }) || _.head(props.tabs);
this.state = { selectedTab };
}
_getAndStoreEntity(entityId, cb) {
let resources = this.context.editorSession.resources
let entity = find(resources, item => { return item.entityId === entityId })
if(entity) {
return cb(null, entity)
} else {
let resourceClient = this.context.resourceClient
resourceClient.getEntity(entityId, (err, entity) => {
if (err) return cb(err)
resources.push(entity)
return cb(null, entity)
})
}
}
getEntry(refId) {
let editorSession = this.context.editorSession
let resources = editorSession.resources
let entry = find(resources, r => {return r.entityId === refId})
return entry
}