@@ -4,6 +4,7 @@ import { Typography } from '@material-ui/core';
44import { getComponentFromMap } from '../../../bridge/helpers/sdk_component_map' ;
55import { PConnProps } from '../../../types/PConnProps' ;
66
7+ import FieldValueList from '../../designSystemExtension/FieldValueList' ;
78import { getUserId , isUserNameAvailable } from './UserReferenceUtils' ;
89
910const DROPDOWN_LIST = 'Drop-down list' ;
@@ -12,6 +13,7 @@ const SEARCH_BOX = 'Search box';
1213interface UserReferenceProps extends PConnProps {
1314 // If any, enter additional props that only exist on URLComponent here
1415 displayAs ?: string ;
16+ displayMode ?: string ;
1517 label ?: string ;
1618 value ?: any ;
1719 testId ?: string ;
@@ -36,6 +38,7 @@ const UserReference = (props: UserReferenceProps) => {
3638 const {
3739 label = '' ,
3840 displayAs = '' ,
41+ displayMode = '' ,
3942 getPConnect,
4043 value = '' ,
4144 testId = '' ,
@@ -96,6 +99,14 @@ const UserReference = (props: UserReferenceProps) => {
9699
97100 let userReferenceComponent : any = null ;
98101
102+ if ( displayMode === 'LABELS_LEFT' ) {
103+ return < FieldValueList name = { hideLabel ? '' : label } value = { userName || '' } /> ;
104+ }
105+
106+ if ( displayMode === 'STACKED_LARGE_VAL' ) {
107+ return < FieldValueList name = { hideLabel ? '' : label } value = { userName || '' } variant = 'stacked' /> ;
108+ }
109+
99110 if ( readOnly && showAsFormattedText ) {
100111 if ( userId ) {
101112 userReferenceComponent = (
@@ -172,7 +183,6 @@ const UserReference = (props: UserReferenceProps) => {
172183 ) ;
173184 }
174185 }
175-
176186 return userReferenceComponent ;
177187} ;
178188
0 commit comments