feature widget description (#483)

Add description to widget title popup and right panel
This commit is contained in:
CamilleLegeron
2023-05-12 15:08:28 +02:00
committed by GitHub
parent a019c406ab
commit c16204f8ad
15 changed files with 359 additions and 174 deletions

View File

@@ -53,6 +53,8 @@ export interface ViewSectionRec extends IRowModel<"_grist_Views_section">, RuleO
// Default widget title (the one that is used in titleDef).
defaultWidgetTitle: ko.PureComputed<string>;
description: modelUtil.KoSaveableObservable<string>;
// true if this record is its table's rawViewSection, i.e. a 'raw data view'
// in which case the UI prevents various things like hiding columns or changing the widget type.
isRaw: ko.Computed<boolean>;
@@ -363,6 +365,9 @@ export function createViewSectionRec(this: ViewSectionRec, docModel: DocModel):
// Widget title.
this.titleDef = modelUtil.fieldWithDefault(this.title, this.defaultWidgetTitle);
// Widget description
this.description = modelUtil.fieldWithDefault(this.description, this.description());
// true if this record is its table's rawViewSection, i.e. a 'raw data view'
// in which case the UI prevents various things like hiding columns or changing the widget type.
this.isRaw = this.autoDispose(ko.pureComputed(() => this.table().rawViewSectionRef() === this.getRowId()));