Closed Rafaelki closed 2 months ago
You can set the value you want to use using person-query
property.
<mgt-person person-query="me" view="threelines"></mgt-person>
<mgt-person person-query="MeganB@M365x214355.onmicrosoft.com" view="threelines"></mgt-person>
<mgt-person person-query="Megan Bowen" view="threelines"></mgt-person>
What value are you seeking to use when you say login account?
Ping @Rafaelki, did this issue get resolved for you?
Hi @musale , sorry the late response.
I am using person-query, like
<mgt-person person-query="MeganB@M365x214355.onmicrosoft.com" view="threelines"></mgt-person>
But it fails (nothing gets rendered) if the user doesn't have an email account, ie. for users without Outlook licence.
This is because the code is making a call searching by email:
graph.microsoft.com/v1.0/users?$search=%22displayName:XXXXX%22%20OR%20%22mail:XXXXX%22&$count=true&$top=1
Would it be possible to change that query (and any other that uses mail) to use userPrincipalName as a filter instead of mail? I have tested the query in Graph explorer and works fine for both users with email and without email:
graph.microsoft.com/v1.0/users?$search=%22displayName:XXXXX%22%20OR%20%22userPrincipalName:XXXXX%22&$count=true&$top=1
@Rafaelki oh I see it. Please test if a query like this: ?search=displayName:xxxORmail:xxxORuserPrincipalName:xxx
works on GE for you. If it does, then this can be added on the query string we make.
Hi @musale, thanks for your quick answer. Yes, having the 3 clauses works as expected. Could you review if you have other queries using "mail" and apply the same fix? Thanks a lot!
@Rafaelki no other area requires this update.
Hi @musale , could you please reopen this bug? There is a space in the query so it is not working properly.
Hi @musale, just checking if you have seen this... I am not sure if the procedure after a bug is closed, do you prefer that I open a separate bug?
Reopening this as there is a space in the query so it is not working properly @musale
Describe the bug For users without email, the mgt-person component doesn't render. Would it be possible to replace the query so that it asks by login account instead of email?
To Reproduce Steps to reproduce the behavior:
Expected behavior I expect to see the avatar of the user
Environment (please complete the following information):