Skip to content

Commit

Permalink
Merge pull request #561 from Esri/chore/nix-pre-91-well-known-teams-l…
Browse files Browse the repository at this point in the history
…ogic

chore(hub-teams): remove pre 9.1 well known teams
  • Loading branch information
benstoltz authored Jun 29, 2021
2 parents 0ad84f0 + 6bc46cd commit 49a6a12
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 348 deletions.
253 changes: 0 additions & 253 deletions packages/teams/src/pre-9-1-well-known-teams.ts

This file was deleted.

16 changes: 8 additions & 8 deletions packages/teams/src/utils/get-teams-available-in-product.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
import { HubProduct, IGroupTemplate } from "../types";
import { cloneObject } from "@esri/hub-common";
import { WELLKNOWNTEAMS } from "../well-known-teams";
import { PRE_9_1_WELLKNOWNTEAMS } from "../pre-9-1-well-known-teams";

// TODO: at next breaking change remove portalApiVersion param
/**
* Given a product, return the groups templates that are available
* @param {string} product Product name portal | basic | premium
*/
export function getTeamsAvailableInProduct(
product: HubProduct,
portalApiVersion: string
portalApiVersion: string // DEPRECATED
) {
// TODO: remove this when needed (after may 1st 2021)
// choosing the type of well known team based on the current portal version
const teams =
parseFloat(portalApiVersion) < 9.1
? PRE_9_1_WELLKNOWNTEAMS
: WELLKNOWNTEAMS;
/* tslint:disable no-console */
console.warn(
"Hub.js::getTeamsAvailableInProduct Deprecation warning portalApiVersion will be removed at v9.0.0"
);
/* tslint:enable no-console */
const teams = WELLKNOWNTEAMS;
const filterFn = (tmpl: IGroupTemplate) => {
return tmpl.config.availableIn.indexOf(product) > -1;
};
Expand Down
16 changes: 8 additions & 8 deletions packages/teams/src/utils/get-user-creatable-teams.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { IUser } from "@esri/arcgis-rest-auth";
import { cloneObject, HubProduct } from "@esri/hub-common";
import { WELLKNOWNTEAMS } from "../well-known-teams";
import { PRE_9_1_WELLKNOWNTEAMS } from "../pre-9-1-well-known-teams";
import { canUserCreateTeamInProduct } from "./can-user-create-team-in-product";
import { IGroupTemplate } from "../types";
import { removeInvalidPrivs } from "./remove-invalid-privs";
import { applyPrivPropValuesToTemplate } from "./apply-priv-prop-values-to-template";

// TODO: Remove portalApiVersion at next breaking change
/**
* Return array of group templates that the current user has licensing
* and privs to create in the current environment (AGO vs Portal)
Expand All @@ -18,15 +18,15 @@ import { applyPrivPropValuesToTemplate } from "./apply-priv-prop-values-to-templ
export function getUserCreatableTeams(
user: IUser,
environment: HubProduct,
portalApiVersion: string,
portalApiVersion: string, // Depracated, remove at next breaking change
subscriptionInfoType: string = ""
): IGroupTemplate[] {
// TODO: remove this when needed (after may 1st 2021)
// choosing the type of well known team based on the current portal version
const teams =
parseFloat(portalApiVersion) < 9.1
? PRE_9_1_WELLKNOWNTEAMS
: WELLKNOWNTEAMS;
/* tslint:disable no-console */
console.warn(
"Hub.js::getUserCreatableTeams Deprecation warning portalApiVersion will be removed at v9.0.0"
);
/* tslint:enable no-console */
const teams = WELLKNOWNTEAMS;
// Online is not properly respecting addExternalMembersToGroup for
// certain subscription types known ones so far: Trial, personal use, developer, and evaluation
const updatedUser = removeInvalidPrivs(user, subscriptionInfoType);
Expand Down
Loading

0 comments on commit 49a6a12

Please sign in to comment.