fix sorting tabs, added webApiPermissionRequests
This commit is contained in:
parent
c62c5e01eb
commit
2dd81b2df4
|
@ -3,8 +3,14 @@
|
|||
"solution": {
|
||||
"name": "react-teams-tabs-pnpjs-client-side-solution",
|
||||
"id": "1e68649b-930f-4502-a858-12aa997bda01",
|
||||
"version": "1.0.0.0",
|
||||
"includeClientSideAssets": true
|
||||
"version": "3.0.0.0",
|
||||
"includeClientSideAssets": true,
|
||||
"webApiPermissionRequests": [
|
||||
{
|
||||
"resource": "Microsoft Graph",
|
||||
"scope": "Group.ReadWrite.All"
|
||||
}
|
||||
]
|
||||
},
|
||||
"paths": {
|
||||
"zippedPackage": "solution/react-teams-tabs-pnpjs.sppkg"
|
||||
|
|
|
@ -60,6 +60,7 @@ export default class ReactTeamsTabsPnpjs extends React.Component<IReactTeamsTabs
|
|||
tmpTabs.push({ key: tab.id, name: tab.displayName, url: tab.webUrl, target: '_blank' });
|
||||
});
|
||||
tmpChannels.push({ name: channel.displayName + " (" + tmpTabs.length + ")", links: tmpTabs });
|
||||
tmpChannels.sort(this.mySorter);
|
||||
this.setState({ pivotArray: tmpChannels });
|
||||
});
|
||||
});
|
||||
|
@ -73,4 +74,17 @@ export default class ReactTeamsTabsPnpjs extends React.Component<IReactTeamsTabs
|
|||
|
||||
|
||||
}
|
||||
|
||||
public mySorter(a: any, b: any) {
|
||||
var x = a.name.toLowerCase();
|
||||
var y = b.name.toLowerCase();
|
||||
//fix to manage general channel at first position, like Teams order
|
||||
//verify language general label
|
||||
if (x.startsWith("general")) {
|
||||
return -1;
|
||||
} else if (y.startsWith("general")) {
|
||||
return 1;
|
||||
}
|
||||
return ((x < y) ? -1 : ((x > y) ? 1 : 0));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue