mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Exposing custom widgets on the UI
Summary: Exposing custom widgets as a dropdown menu in custom section configuration panel. Adding new environmental variable GRIST_WIDGET_LIST_URL that points to a json file with an array of available widgets. When not present, custom widget menu is hidden, exposing only Custom URL option. Available widget list can be fetched from: https://github.com/gristlabs/grist-widget/releases/download/latest/manifest.json Test Plan: New tests, and updated old ones. Reviewers: paulfitz, dsagal Reviewed By: paulfitz Differential Revision: https://phab.getgrist.com/D3127
This commit is contained in:
@@ -12,6 +12,7 @@ import {FlexServer} from './FlexServer';
|
||||
import {ITestingHooks} from './ITestingHooks';
|
||||
import ITestingHooksTI from './ITestingHooks-ti';
|
||||
import {connect, fromCallback} from './serverUtils';
|
||||
import {WidgetRepositoryImpl} from 'app/server/lib/WidgetRepository';
|
||||
|
||||
const tiCheckers = t.createCheckers(ITestingHooksTI, {UserProfile: t.name("object")});
|
||||
|
||||
@@ -194,4 +195,12 @@ export class TestingHooks implements ITestingHooks {
|
||||
}
|
||||
return prev;
|
||||
}
|
||||
|
||||
public async setWidgetRepositoryUrl(url: string): Promise<void> {
|
||||
const repo = this._server.getWidgetRepository() as WidgetRepositoryImpl;
|
||||
if (!(repo instanceof WidgetRepositoryImpl)) {
|
||||
throw new Error("Unsupported widget repository");
|
||||
}
|
||||
repo.testOverrideUrl(url);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user