Small fixes for user field

This commit is contained in:
Marius Minkevicius 2020-10-12 17:40:07 +03:00
parent d446566c43
commit 98b0275a90
2 changed files with 2 additions and 2 deletions

View File

@ -123,7 +123,7 @@ export class ListFormService implements IListFormService {
//Need group lookups
for (let j = 0; j < val.length; j++) {
let y = val[j];
if (y.Key.indexOf("c:0") == 0) {
if (y.Key && y.Key.indexOf("c:0") == 0) {
let res = await searchSvc.resolvePeople(ctx, y.Key, siteUrl);
y.Key = res.Description;
}

View File

@ -5,7 +5,7 @@ import { Link } from 'office-ui-fabric-react/lib/Link';
const SPFieldUserDisplay: React.SFC<ISPFormFieldProps> = (props) => {
if ((props.value) && (props.value.length > 0)) {
const baseUrl = `${props.fieldSchema.ListFormUrl}?PageType=4&ListId=${props.fieldSchema.UserInfoListId}`;
return <div>{props.value.map((val) => <div><Link href={`{baseUrl}&ID=${val.id}`}>{val.title}</Link></div>)}</div>;
return <div>{props.value.map((val) => <div><Link href={`${baseUrl}&ID=${val.id}`}>{val.title}</Link></div>)}</div>;
} else {
return <div></div>;
}