mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Raw renames
Summary: A new way for renaming tables. - There is a new popup to rename section (where you can also rename the table) - Renaming/Deleting page doesn't modify/delete the table. - Renaming table can rename a page if the names match (and the page contains a section with that table). - User can rename table in Raw Data UI in two ways - either on the listing or by using the section name popup - As before, there is no way to change tableId - it is derived from a table name. - When the section name is empty the table name is shown instead. - White space for section name is allowed (to discuss) - so the user can just paste ' '. - Empty name for a page is not allowed (but white space is). - Some bugs related to deleting tables with attached summary tables (and with undoing this operation) were fixed (but not all of them yet). Test Plan: Updated tests. Reviewers: georgegevoian Reviewed By: georgegevoian Subscribers: georgegevoian Differential Revision: https://phab.getgrist.com/D3360
This commit is contained in:
@@ -131,13 +131,15 @@ export class TimeLayout {
|
||||
public fields: TimeQuery;
|
||||
public columns: TimeQuery;
|
||||
public views: TimeQuery;
|
||||
public sections: TimeQuery;
|
||||
|
||||
constructor(public tc: TimeCursor) {
|
||||
this.tables = new TimeQuery(tc, '_grist_Tables', ['tableId', 'primaryViewId']);
|
||||
this.tables = new TimeQuery(tc, '_grist_Tables', ['tableId', 'primaryViewId', 'rawViewSectionRef']);
|
||||
this.fields = new TimeQuery(tc, '_grist_Views_section_field',
|
||||
['parentId', 'parentPos', 'colRef']);
|
||||
this.columns = new TimeQuery(tc, '_grist_Tables_column', ['parentId', 'colId']);
|
||||
this.views = new TimeQuery(tc, '_grist_Views', ['id', 'name']);
|
||||
this.sections = new TimeQuery(tc, '_grist_Views_section', ['id', 'title']);
|
||||
}
|
||||
|
||||
/** update from TimeCursor */
|
||||
@@ -146,6 +148,7 @@ export class TimeLayout {
|
||||
await this.columns.update();
|
||||
await this.fields.update();
|
||||
await this.views.update();
|
||||
await this.sections.update();
|
||||
}
|
||||
|
||||
public getColumnOrder(tableId: string): string[] {
|
||||
@@ -158,7 +161,7 @@ export class TimeLayout {
|
||||
}
|
||||
|
||||
public getTableName(tableId: string): string {
|
||||
const primaryViewId = this.tables.one({tableId}).primaryViewId;
|
||||
return this.views.one({id: primaryViewId}).name;
|
||||
const rawViewSectionRef = this.tables.one({tableId}).rawViewSectionRef;
|
||||
return this.sections.one({id: rawViewSectionRef}).title;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user