mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Adding confirmation before remove last widget for a table
Summary: When last widget for a table is removed, user is informed about that and can decide between removing the widget and removing both table and widget Test Plan: Updated Reviewers: georgegevoian Reviewed By: georgegevoian Differential Revision: https://phab.getgrist.com/D4295
This commit is contained in:
@@ -39,6 +39,7 @@ export interface TableRec extends IRowModel<"_grist_Tables"> {
|
||||
// If user can select this table in various places.
|
||||
// Note: Some hidden tables can still be visible on RawData view.
|
||||
isHidden: ko.Computed<boolean>;
|
||||
isSummary: ko.Computed<boolean>;
|
||||
|
||||
tableColor: string;
|
||||
disableAddRemoveRows: ko.Computed<boolean>;
|
||||
@@ -68,6 +69,8 @@ export function createTableRec(this: TableRec, docModel: DocModel): void {
|
||||
this.primaryTableId = ko.pureComputed(() =>
|
||||
this.summarySourceTable() ? this.summarySource().tableId() : this.tableId());
|
||||
|
||||
this.isSummary = this.autoDispose(ko.pureComputed(() => Boolean(this.summarySourceTable())));
|
||||
|
||||
this.groupByColumns = ko.pureComputed(() => this.columns().all().filter(c => c.summarySourceCol()));
|
||||
|
||||
this.groupDesc = ko.pureComputed(() => {
|
||||
|
||||
@@ -93,9 +93,12 @@ export interface ViewSectionRec extends IRowModel<"_grist_Views_section">, RuleO
|
||||
// in which case the UI prevents various things like hiding columns or changing the widget type.
|
||||
isRaw: ko.Computed<boolean>;
|
||||
|
||||
tableRecordCard: ko.Computed<ViewSectionRec>
|
||||
/** Is this table card viewsection (the one available after pressing spacebar) */
|
||||
isRecordCard: ko.Computed<boolean>;
|
||||
|
||||
/** Card record viewSection for associated table (might be the same section) */
|
||||
tableRecordCard: ko.Computed<ViewSectionRec>;
|
||||
|
||||
/** True if this section is disabled. Currently only used by Record Card sections. */
|
||||
disabled: modelUtil.KoSaveableObservable<boolean>;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user