Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There is a bug in the TeamPresenceWebPart.tsx #1

Closed
Ofer-Gal opened this issue Feb 20, 2020 · 4 comments
Closed

There is a bug in the TeamPresenceWebPart.tsx #1

Ofer-Gal opened this issue Feb 20, 2020 · 4 comments
Assignees

Comments

@Ofer-Gal
Copy link

public componentDidMount(): void{
console.log("Group ID:"+this.groupID); //:39 Group ID:null
if(this.groupID.length > 0) //Cannot read property 'length' of null
{
this._loadMembersAndPresence(this.groupID);
}

}

@mpaukkon mpaukkon self-assigned this Feb 22, 2020
@mpaukkon
Copy link
Owner

This is now fixed.

@Ofer-Gal
Copy link
Author

When running in /_layouts/15/workbench.aspx on a site with 6 members and me the owner, The line 81 client.api("/groups/"+groupID+"/members").get().then(membersResponse => { showes in the debugger: https://graph.microsoft.com/v1.0/groups/503e6aad-6f34-42ee-b933-4cad58424e00/members 403 (Forbidden)
but running the same call in graph explorer, does show all the members.
I deployed to Sharepoint and added the web part in the team's site. But it is hitting the same 403 error.
Is there something I can do to allow this line to work?
how did you test it?

@mpaukkon
Copy link
Owner

You need to approve API permissions for SharePoint Framework on SharePoint Admin Center. There should be Group.Read.All and Presence.Read.All Microsoft Graph permissions pending.
Direct link to API management:
https://-admin.sharepoint.com/_layouts/15/online/AdminHome.aspx#/webApiPermissionManagement

@Ofer-Gal
Copy link
Author

Thanks.
Now I see the graphics on the workbench but not in an embedded web part.
The console shows:
Access to XMLHttpRequest at 'https://waconatm.officeapps.live.com/apc/trans.gif?416e472b0562559419456648fea6d81b' from origin 'https://{mytenant}.sharepoint.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource
This is weird because everything is under https://{mytenant}.sharepoint.com even the workbench

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants