some cleanup

This commit is contained in:
Paul Fitzpatrick
2023-10-06 21:38:37 -04:00
parent fd1734de69
commit 4f3d0d41a0
18 changed files with 305 additions and 438 deletions

View File

@@ -78,6 +78,10 @@ export interface TopAppModel {
*/
fetchUsersAndOrgs(): Promise<void>;
/**
* Enumerate the widgets in the WidgetRepository for this installation
* of Grist.
*/
getWidgets(): Promise<ICustomWidget[]>;
}
@@ -147,6 +151,9 @@ export class TopAppModelImpl extends Disposable implements TopAppModel {
public readonly users = Observable.create<FullUser[]>(this, []);
public readonly plugins: LocalPlugin[] = [];
private readonly _gristConfig?: GristLoadConfig;
// Keep a list of available widgets, once requested, so we don't have to
// keep reloading it. Downside: browser page will need reloading to pick
// up new widgets - that seems ok.
private readonly _widgets: AsyncCreate<ICustomWidget[]>;
constructor(

View File

@@ -254,11 +254,7 @@ export interface CustomViewSectionDef {
* widgets available.
*/
widgetId: modelUtil.KoSaveableObservable<string|null>;
/**
* Custom widget information.
*/
// widgetDef: modelUtil.KoSaveableObservable<ICustomWidget|null>;
/**
/**
* Custom widget options.
*/
widgetOptions: modelUtil.KoSaveableObservable<Record<string, any>|null>;
@@ -333,7 +329,6 @@ export function createViewSectionRec(this: ViewSectionRec, docModel: DocModel):
const customViewDefaults = {
mode: 'url',
url: null,
// widgetDef: null,
access: '',
pluginId: '',
sectionId: '',
@@ -346,7 +341,6 @@ export function createViewSectionRec(this: ViewSectionRec, docModel: DocModel):
mode: customDefObj.prop('mode'),
url: customDefObj.prop('url'),
widgetId: customDefObj.prop('widgetId'),
// widgetDef: customDefObj.prop('widgetDef'),
widgetOptions: customDefObj.prop('widgetOptions'),
columnsMapping: customDefObj.prop('columnsMapping'),
access: customDefObj.prop('access'),