Open matthid opened 2 years ago
In our custom form controls we noticed that the member IUserContext.descriptor is somehow missing from the SDK.getUser() object. We want to use the descriptor to get membership information from the API of the current user (for a UI-only block).
IUserContext.descriptor
SDK.getUser()
What we do get is an object similar to this:
{ displayName: "Full Name", id: "0000000-0000-1000-0000-000000000000", imageUrl: "https://dev.azure.com/<instance>/_apis/GraphProfile/MemberAvatars/aad.MDAwMDAwMC0wMDAwLTAwMDAtMDAwMC0wMDAwMDAwMDAwMDA=", name: "Full.Name@domain.tld" }
As our extension has different contributions, we can see that on others (for example a project/organization settings page contributions) we get the descriptor:
{ descriptor: "aad.MDAwMDAwMC0wMDAwLTAwMDAtMDAwMC0wMDAwMDAwMDAwMDA=", displayName: "Full Name", id: "0000000-0000-1000-0000-000000000000", imageUrl: "https://dev.azure.com/<instance>/_apis/GraphProfile/MemberAvatars/aad.MDAwMDAwMC0wMDAwLTAwMDAtMDAwMC0wMDAwMDAwMDAwMDA=", name: "Full.Name@domain.tld" }
However, it seems to be missing on custom form controls...
As this is not documented (the TypeScript type says the field is always there) and I don't see any other good way, I assume this is a Bug. We could:
imageUrl
id
We would love to hear a workaround or an alternative approach to solve the problem at hand with the SDK or other REST calls.
In our custom form controls we noticed that the member
IUserContext.descriptor
is somehow missing from theSDK.getUser()
object. We want to use the descriptor to get membership information from the API of the current user (for a UI-only block).What we do get is an object similar to this:
As our extension has different contributions, we can see that on others (for example a project/organization settings page contributions) we get the descriptor:
However, it seems to be missing on custom form controls...
As this is not documented (the TypeScript type says the field is always there) and I don't see any other good way, I assume this is a Bug. We could:
imageUrl
id
-entry but for some reason the Ids differ (as in the anonymized example above).We would love to hear a workaround or an alternative approach to solve the problem at hand with the SDK or other REST calls.