(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:
Jarosław Sadziński
2022-08-03 12:48:01 +02:00
parent c359547f6b
commit 40c9b8b7e8
5 changed files with 35 additions and 8 deletions

View File

@@ -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)
});
}