@@ -97,22 +97,6 @@ export const ApprovalTaskComponent: FunctionComponent<ApprovalTaskComponentProps
9797 const { t } = useTranslation ( ) ;
9898 const { isMobileViewport } = useMediaContext ( ) ;
9999
100- const getClaimDisplayName = ( claim : string ) : string => {
101- const equalIndex : number = claim . indexOf ( "=" ) ;
102-
103- if ( equalIndex === - 1 ) {
104- return claim . trim ( ) ;
105- }
106-
107- const claimUri : string = claim . substring ( 0 , equalIndex ) . trim ( ) ;
108- const displayName : string = claimUri . split ( "/" ) . pop ( ) ;
109-
110- return displayName || claim ;
111- } ;
112-
113-
114-
115-
116100 /**
117101 * Removes unnecessary commas at the end of property values and splits
118102 * up the claim values.
@@ -128,18 +112,24 @@ export const ApprovalTaskComponent: FunctionComponent<ApprovalTaskComponentProps
128112 */
129113 const populateProperties = ( key : string , value : string ) : string | JSX . Element => {
130114 if ( key === "Claims" ) {
115+ return ;
116+ }
117+ if ( key === "ClaimsUI" ) {
118+ // Remove the curly braces at the start and end of the value.
131119 value = value . replace ( / ^ \{ | \} $ / g, "" ) . trim ( ) ;
132120 const claims : string [ ] = value . split ( "," ) ;
133121
134122 return (
135123 < >
136124 { claims . map ( ( claim : string , index : number ) => {
137- const claimValue : string = claim . split ( "=" ) [ 1 ] ?. trim ( ) ;
125+ const claimParts : string [ ] = claim . split ( "=" ) ;
126+ const claimDisplayName : string = claimParts [ 0 ] ?. trim ( ) ;
127+ const claimValue : string = claimParts [ 1 ] ?. trim ( ) ;
138128
139129 return (
140130 < Table . Row key = { `${ key } -${ index } ` } >
141131 < Table . Cell className = "key-cell" >
142- { getClaimDisplayName ( claim ) }
132+ { claimDisplayName }
143133 </ Table . Cell >
144134 < Table . Cell collapsing className = "values-cell" >
145135 < Popup
0 commit comments