mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Initial page for custom widget
Summary: Adding a custom widget will show the initial page with some information instead of a blank page. Test Plan: Existing tests Reviewers: dsagal Reviewed By: dsagal Subscribers: dsagal Differential Revision: https://phab.getgrist.com/D2978
This commit is contained in:
@@ -57,12 +57,15 @@ export class CustomView extends Disposable {
|
||||
private _updateData: () => void; // debounced call to let the view know linked data changed.
|
||||
private _updateCursor: () => void; // debounced call to let the view know linked cursor changed.
|
||||
private _rpc: Rpc; // rpc connection to view.
|
||||
private _emptyWidgetPage: string;
|
||||
|
||||
public create(gristDoc: GristDoc, viewSectionModel: ViewSectionRec) {
|
||||
BaseView.call(this as any, gristDoc, viewSectionModel);
|
||||
|
||||
this._customDef = this.viewSection.customDef;
|
||||
|
||||
this._emptyWidgetPage = new URL("custom-widget.html", gristDoc.app.topAppModel.getUntrustedContentOrigin()).href;
|
||||
|
||||
this.autoDisposeCallback(() => {
|
||||
if (this._customSection) {
|
||||
this._customSection.dispose();
|
||||
@@ -227,7 +230,7 @@ export class CustomView extends Disposable {
|
||||
// in a simple and unambiguous way.
|
||||
let fullUrl: string;
|
||||
if (!baseUrl) {
|
||||
fullUrl = baseUrl;
|
||||
fullUrl = this._emptyWidgetPage;
|
||||
} else {
|
||||
const url = new URL(baseUrl);
|
||||
url.searchParams.append('access', access);
|
||||
|
||||
Reference in New Issue
Block a user