mirror of
https://github.com/gristlabs/grist-core.git
synced 2024-10-27 20:44:07 +00:00
(core) Makes EE frontend behave as core if EE isn't activated
Summary: - Makes EE decide which ActivationPage to use - Makes ProductUpgrades use core implementation if not activated - Changes banners to proxy to core implementation if EE not activated - [Fix] Enables new site creation in EE as in Core: - Core enables people to freely create new team sites. - Enterprise currently redirects to the pricing page. - This enables enterprise to also create team sites, instead of redirecting. Test Plan: Manually test in EE, unit tests in Jenkins Reviewers: paulfitz, jordigh Reviewed By: paulfitz Differential Revision: https://phab.getgrist.com/D4264
This commit is contained in:
parent
e296e168e8
commit
b98bad0b93
10
app/client/components/CoreBanners.ts
Normal file
10
app/client/components/CoreBanners.ts
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
import {AppModel} from 'app/client/models/AppModel';
|
||||||
|
import {DocPageModel} from 'app/client/models/DocPageModel';
|
||||||
|
|
||||||
|
export function buildHomeBanners(_app: AppModel) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function buildDocumentBanners(_docPageModel: DocPageModel) {
|
||||||
|
return null;
|
||||||
|
}
|
@ -82,7 +82,7 @@ function createMainPage(appModel: AppModel, appObj: App) {
|
|||||||
} else if (pageType === 'admin') {
|
} else if (pageType === 'admin') {
|
||||||
return domAsync(loadAdminPanel().then(m => dom.create(m.AdminPanel, appModel)));
|
return domAsync(loadAdminPanel().then(m => dom.create(m.AdminPanel, appModel)));
|
||||||
} else if (pageType === 'activation') {
|
} else if (pageType === 'activation') {
|
||||||
return domAsync(loadActivationPage().then(ap => dom.create(ap.ActivationPage, appModel)));
|
return domAsync(loadActivationPage().then(ap => dom.create(ap.getActivationPage(), appModel)));
|
||||||
} else {
|
} else {
|
||||||
return dom.create(pagePanelsDoc, appModel, appObj);
|
return dom.create(pagePanelsDoc, appModel, appObj);
|
||||||
}
|
}
|
||||||
|
@ -24,10 +24,10 @@ export async function buildNewSiteModal(context: Disposable, options: {
|
|||||||
appModel: AppModel,
|
appModel: AppModel,
|
||||||
plan?: PlanSelection,
|
plan?: PlanSelection,
|
||||||
onCreate?: () => void
|
onCreate?: () => void
|
||||||
}) {
|
}): Promise<void> {
|
||||||
const { onCreate } = options;
|
const { onCreate } = options;
|
||||||
|
|
||||||
return showModal(
|
showModal(
|
||||||
context,
|
context,
|
||||||
(_owner: Disposable, ctrl: IModalControl) => dom.create(NewSiteModalContent, ctrl, onCreate),
|
(_owner: Disposable, ctrl: IModalControl) => dom.create(NewSiteModalContent, ctrl, onCreate),
|
||||||
dom.cls(cssModalIndex.className),
|
dom.cls(cssModalIndex.className),
|
||||||
@ -87,12 +87,12 @@ export function buildUpgradeModal(owner: Disposable, options: {
|
|||||||
throw new UserError(t(`Billing is not supported in grist-core`));
|
throw new UserError(t(`Billing is not supported in grist-core`));
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface UpgradeButton {
|
export interface IUpgradeButton {
|
||||||
showUpgradeCard(...args: DomArg<HTMLElement>[]): DomContents;
|
showUpgradeCard(...args: DomArg<HTMLElement>[]): DomContents;
|
||||||
showUpgradeButton(...args: DomArg<HTMLElement>[]): DomContents;
|
showUpgradeButton(...args: DomArg<HTMLElement>[]): DomContents;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function buildUpgradeButton(owner: IDisposableOwner, app: AppModel): UpgradeButton {
|
export function buildUpgradeButton(owner: IDisposableOwner, app: AppModel): IUpgradeButton {
|
||||||
return {
|
return {
|
||||||
showUpgradeCard: () => null,
|
showUpgradeCard: () => null,
|
||||||
showUpgradeButton: () => null,
|
showUpgradeButton: () => null,
|
||||||
|
18
app/client/ui/DefaultActivationPage.ts
Normal file
18
app/client/ui/DefaultActivationPage.ts
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
import {AppModel} from 'app/client/models/AppModel';
|
||||||
|
import { Disposable, IDomCreator } from 'grainjs';
|
||||||
|
|
||||||
|
export type IActivationPageCreator = IDomCreator<[AppModel]>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A blank ActivationPage stand-in, as it's possible for the frontend to try and load an "activation page",
|
||||||
|
* even though there's no activation in core.
|
||||||
|
*/
|
||||||
|
export class DefaultActivationPage extends Disposable {
|
||||||
|
constructor(_appModel: AppModel) {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public buildDom() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
@ -1,10 +1,2 @@
|
|||||||
import {AppModel} from 'app/client/models/AppModel';
|
export { buildHomeBanners, buildDocumentBanners } from 'app/client/components/CoreBanners';
|
||||||
import {DocPageModel} from 'app/client/models/DocPageModel';
|
|
||||||
|
|
||||||
export function buildHomeBanners(_app: AppModel) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function buildDocumentBanners(_docPageModel: DocPageModel) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
@ -1,12 +1,7 @@
|
|||||||
import {AppModel} from 'app/client/models/AppModel';
|
import {
|
||||||
import {Disposable} from 'grainjs';
|
DefaultActivationPage, IActivationPageCreator
|
||||||
|
} from "app/client/ui/DefaultActivationPage";
|
||||||
|
|
||||||
export class ActivationPage extends Disposable {
|
export function getActivationPage(): IActivationPageCreator {
|
||||||
constructor(_appModel: AppModel) {
|
return DefaultActivationPage;
|
||||||
super();
|
|
||||||
}
|
|
||||||
|
|
||||||
public buildDom() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user