mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) New URL that opens Create site popup.
Summary: Adding new url parameter for team site creation Test Plan: Updated tests. Reviewers: georgegevoian Reviewed By: georgegevoian Differential Revision: https://phab.getgrist.com/D3554
This commit is contained in:
@@ -226,6 +226,13 @@ export class AppModelImpl extends Disposable implements AppModel {
|
||||
) {
|
||||
super();
|
||||
this._recordSignUpIfIsNewUser();
|
||||
|
||||
const state = urlState().state.get();
|
||||
if (state.createTeam) {
|
||||
// Remove params from the URL.
|
||||
urlState().pushUrl({createTeam: false, params: {}}, {avoidReload: true, replace: true}).catch(() => {});
|
||||
this.showNewSiteModal(state.params?.planType);
|
||||
}
|
||||
}
|
||||
|
||||
public get planName() {
|
||||
@@ -244,10 +251,11 @@ export class AppModelImpl extends Disposable implements AppModel {
|
||||
}
|
||||
}
|
||||
|
||||
public showNewSiteModal() {
|
||||
public showNewSiteModal(selectedPlan?: string) {
|
||||
if (this.planName) {
|
||||
buildNewSiteModal(this, {
|
||||
planName: this.planName,
|
||||
selectedPlan,
|
||||
onCreate: () => this.topAppModel.fetchUsersAndOrgs().catch(reportError)
|
||||
});
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import {BillingPlanManagers} from 'app/client/ui/BillingPlanManagers';
|
||||
import {createForbiddenPage} from 'app/client/ui/errorPages';
|
||||
import {leftPanelBasic} from 'app/client/ui/LeftPanelCommon';
|
||||
import {pagePanels} from 'app/client/ui/PagePanels';
|
||||
import {showTeamUpgradeConfirmation} from 'app/client/ui/ProductUpgrades';
|
||||
import {NEW_DEAL, showTeamUpgradeConfirmation} from 'app/client/ui/ProductUpgrades';
|
||||
import {createTopBarHome} from 'app/client/ui/TopBar';
|
||||
import {cssBreadcrumbs, cssBreadcrumbsLink, separator} from 'app/client/ui2018/breadcrumbs';
|
||||
import {bigBasicButton, bigBasicButtonLink, bigPrimaryButton} from 'app/client/ui2018/buttons';
|
||||
@@ -273,8 +273,8 @@ export class BillingPage extends Disposable {
|
||||
!canManage ? null :
|
||||
makeActionLink('Manage billing', 'Settings', this._model.getCustomerPortalUrl(), testId('portal-link')),
|
||||
!wasTeam ? null :
|
||||
makeActionButton('Downgrade plan', 'Settings',
|
||||
() => this._confirmDowngradeToTeamFree(), testId('downgrade-free-link')),
|
||||
dom.maybe(NEW_DEAL(), () => makeActionButton('Downgrade plan', 'Settings',
|
||||
() => this._confirmDowngradeToTeamFree(), testId('downgrade-free-link'))),
|
||||
!canRenew ? null :
|
||||
makeActionLink('Renew subscription', 'Settings', this._model.renewPlan(), testId('renew-link')),
|
||||
!canUpgrade ? null :
|
||||
|
||||
@@ -4,6 +4,7 @@ import {Disposable, DomContents, IDisposableOwner, Observable, observable} from
|
||||
|
||||
export function buildNewSiteModal(context: Disposable, options: {
|
||||
planName: string,
|
||||
selectedPlan?: string,
|
||||
onCreate?: () => void
|
||||
}) {
|
||||
window.location.href = commonUrls.plans;
|
||||
|
||||
Reference in New Issue
Block a user