Skip to content

Commit

Permalink
feat(hub-teams): update well known teams with edit team (#587)
Browse files Browse the repository at this point in the history
* feat(hub-teams): update well known teams with edit team
  • Loading branch information
benstoltz authored Jul 27, 2021
1 parent 9d056f1 commit 9791ee0
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 9 deletions.
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/teams/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,4 +148,5 @@ export const TEAMTYPES = [
"followers",
"team",
"event",
"edit",
] as const;
45 changes: 45 additions & 0 deletions packages/teams/src/well-known-teams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,51 @@ export const WELLKNOWNTEAMS: IGroupTemplate[] = [
membershipAccess: "",
tags: ["Hub Team Group"],
},
{
config: {
groupType: "Generic AGO Edit Supporting Team",
type: "edit",
availableIn: ["premium"],
requiredPrivs: [
"portal:user:createGroup",
"portal:user:addExternalMembersToGroup",
],
titleI18n: "teamTitle",
descriptionI18n: "editTeamDesc",
snippetI18n: "editTeamSnippet",
},
access: "org",
autoJoin: false,
isInvitationOnly: false,
isViewOnly: false,
sortField: "modified",
sortOrder: "desc",
capabilities: "updateitemcontrol",
membershipAccess: "org",
tags: ["Hub Team Group"],
typekeyword: ["Hub Team", "Hub Edit Supporting Team"],
},
{
config: {
groupType: "Generic Portal Edit Supporting Team",
type: "edit",
availableIn: ["portal"],
requiredPrivs: ["portal:user:createGroup"],
titleI18n: "teamTitle",
descriptionI18n: "editTeamDesc",
snippetI18n: "editTeamSnippet",
},
access: "org",
autoJoin: false,
isInvitationOnly: false,
isViewOnly: false,
sortField: "modified",
sortOrder: "desc",
capabilities: "updateitemcontrol",
membershipAccess: "org",
tags: ["Site Team Group"],
typekeyword: ["Site Team", "Site Edit Supporting Team"],
},
{
config: {
groupType: "Generic Portal Team",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ describe("getTeamsAvailableInProduct", () => {
expect(Array.isArray(chk)).toBeTruthy(
"should return array of team templates"
);
expect(chk.length).toBe(5, "should return 5 of team templates for basic");
expect(chk.length).toBe(6, "should return 5 of team templates for premium");
expect(chk[0].membershipAccess).toBe(
"org",
"core team should be set to org" // it gets updated to collaboration via getUserCreatableTeams
);
expect(chk[4].membershipAccess).toBe(
expect(chk[5].membershipAccess).toBe(
"",
"event team should be an empty string membershipAccess"
);
Expand Down
8 changes: 4 additions & 4 deletions packages/teams/test/utils/get-user-creatable-teams.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe("getUserCreatableTeams", () => {

expect(
getUserCreatableTeams(user, "premium", "9.1", "In House").length
).toBe(5, "Premium, all privs, should be 5 creatable team types");
).toBe(6, "Premium, all privs, should be 6 creatable team types");

expect(getUserCreatableTeams(user, "basic", "9.1", "In House").length).toBe(
3,
Expand All @@ -23,7 +23,7 @@ describe("getUserCreatableTeams", () => {

expect(
getUserCreatableTeams(user, "portal", "9.1", "In House").length
).toBe(3, "Portal, all privs, should be 3 creatable team types");
).toBe(4, "Portal, all privs, should be 4 creatable team types");

// remove updateGroups...
user.privileges = [
Expand All @@ -34,7 +34,7 @@ describe("getUserCreatableTeams", () => {

expect(
getUserCreatableTeams(user, "premium", "9.1", "In House").length
).toBe(4, "Premium, all privs, should be 4 creatable team types");
).toBe(5, "Premium, all privs, should be 5 creatable team types");

expect(getUserCreatableTeams(user, "premium", "9.1").length).toBe(
2,
Expand All @@ -53,7 +53,7 @@ describe("getUserCreatableTeams", () => {

expect(
getUserCreatableTeams(user, "portal", "9.1", "In House").length
).toBe(2, "Portal, all privs, should be 2 creatable team types");
).toBe(3, "Portal, all privs, should be 3 creatable team types");

// clear all privs and we should not get any groups back...
user.privileges = [];
Expand Down

0 comments on commit 9791ee0

Please sign in to comment.