Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor(props: ICollectionDataItemProps) {
super(props);
// Create an empty item with all properties
let emptyItem = this.generateEmptyItem();
this.state = {
crntItem: clone(this.props.item) || {...emptyItem},
errorMsgs: [],
showCallout: false
};
}
const p1 = new Promise((resolve, reject) => {
const filters: string[] = [];
let searchResults = clone(this._searchResults);
const filteredResults: ISearchResult[] = [];
if (refinementFilters.length > 0) {
refinementFilters.map((filter) => {
filters.push(filter.Value.RefinementToken);
});
searchResults.RelevantResults.map((searchResult) => {
const filtered = intersection(filters, searchResult.RefinementTokenValues.split(','));
if (filtered.length > 0) {
filteredResults.push(searchResult);
}
});
searchResults = {
RelevantResults: filteredResults,
public getItems(): Promise {
const items: ITodoItem[] = lodash.clone(this._items[this._selectedList.Id]);
return new Promise((resolve) => {
setTimeout(() => resolve(items), 500);
});
}
public componentDidUpdate(prevProps: ICollectionDataItemProps): void {
if (this.props.item !== prevProps.item) {
this.setState({
crntItem: clone(this.props.item)
});
}
}
this.setState((prevState: IFieldUserRendererState, componentProps: IFieldUserRendererProps) => {
const newUsers = _.clone(prevState.users);
newUsers[index] = this._getUserFromPrincipalAndProps(this.props.users[index], userProfileProps);
return { users: newUsers };
});
}
private getDefaultCheckedItems() {
return this.props.checkedItems ? clone(this.props.checkedItems) : new Array();
}