mirror of
https://github.com/gristlabs/grist-core.git
synced 2024-10-27 20:44:07 +00:00
60423edc17
Summary: - Reading plans from Stripe, and allowing Stripe to define custom plans. - Storing product features (aka limits) in Stripe, that override those in db. - Adding hierarchical data in Stripe. All features are defined at Product level but can be overwritten on Price levels. - New options for Support user to -- Override product for team site (if he is added as a billing manager) -- Override subscription and customer id for a team site -- Attach an "offer", an custom plan configured in stripe that a team site can use -- Enabling wire transfer for subscription by allowing subscription to be created without a payment method (which is customizable) Test Plan: Updated and new. Reviewers: georgegevoian Reviewed By: georgegevoian Differential Revision: https://phab.getgrist.com/D4201
35 lines
1.1 KiB
TypeScript
35 lines
1.1 KiB
TypeScript
import {loadUserManager} from 'app/client/lib/imports';
|
|
import {AppModel} from 'app/client/models/AppModel';
|
|
import {FullUser, Organization, UserAPI} from 'app/common/UserAPI';
|
|
|
|
export interface ManageTeamUsersOptions {
|
|
org: Organization;
|
|
user: FullUser | null;
|
|
api: UserAPI;
|
|
onSave?: (personal: boolean) => Promise<unknown>;
|
|
}
|
|
|
|
// Opens the user-manager for the given org.
|
|
export async function manageTeamUsers({org, user, api, onSave}: ManageTeamUsersOptions) {
|
|
(await loadUserManager()).showUserManagerModal(api, {
|
|
permissionData: api.getOrgAccess(org.id),
|
|
activeUser: user,
|
|
resourceType: 'organization',
|
|
resourceId: org.id,
|
|
resource: org,
|
|
onSave
|
|
});
|
|
}
|
|
|
|
export interface ManagePersonalUsersAppOptions {
|
|
app: AppModel;
|
|
onSave?: (personal: boolean) => Promise<unknown>;
|
|
}
|
|
|
|
// Opens the user-manager for the current org in the given AppModel.
|
|
export async function manageTeamUsersApp({app, onSave}: ManagePersonalUsersAppOptions) {
|
|
if (app.currentOrg) {
|
|
return manageTeamUsers({org: app.currentOrg, user: app.currentValidUser, api: app.api, onSave});
|
|
}
|
|
}
|