(core) Implementing search on raw data view

Summary:
Search now works on Raw Data Page.
- Search bar option 'Search on all pages' will change to 'Search on all tables' when on the Raw data page, and will allow searching through all tables.
- Little CSS adjustment for an overlay on Raw page (removes z-index as it is not needed, and conflicts with searchbar).
- Search bar option ('search on all') gets white background, little padding, and is moved 2 pixels up, this is needed for Raw page.

Test Plan: new and updated tests

Reviewers: georgegevoian

Reviewed By: georgegevoian

Differential Revision: https://phab.getgrist.com/D3376
This commit is contained in:
Jarosław Sadziński
2022-04-13 19:26:59 +02:00
parent 007a862333
commit dea1a8ba1b
6 changed files with 234 additions and 46 deletions

View File

@@ -27,6 +27,8 @@ export function tools(owner: Disposable, gristDoc: GristDoc, leftPanelOpen: Obse
gristDoc.docModel.rules.getNumRows() > 0);
}
owner.autoDispose(gristDoc.docModel.rules.tableData.tableActionEmitter.addListener(updateCanViewAccessRules));
// TODO: Create global observable to enable raw tools (TO REMOVE once raw data ui has landed)
(window as any).enableRawTools = Observable.create(null, false);
updateCanViewAccessRules();
return cssTools(
cssTools.cls('-collapsed', (use) => !use(leftPanelOpen)),
@@ -47,15 +49,16 @@ export function tools(owner: Disposable, gristDoc: GristDoc, leftPanelOpen: Obse
testId('access-rules'),
),
// Raw data - for now hidden.
// cssPageEntry(
// cssPageEntry.cls('-selected', (use) => use(gristDoc.activeViewId) === 'data'),
// cssPageLink(
// cssPageIcon('Database'),
// cssLinkText('Raw data'),
// testId('raw'),
// urlState().setLinkUrl({docPage: 'data'})
// )
// ),
dom.maybe((window as any).enableRawTools, () =>
cssPageEntry(
cssPageEntry.cls('-selected', (use) => use(gristDoc.activeViewId) === 'data'),
cssPageLink(
cssPageIcon('Database'),
cssLinkText('Raw data'),
testId('raw'),
urlState().setLinkUrl({docPage: 'data'})
),
)),
cssPageEntry(
cssPageLink(cssPageIcon('Log'), cssLinkText('Document History'), testId('log'),
dom.on('click', () => gristDoc.showTool('docHistory')))