(core) New UI for raw data views

Summary:
Creating new UI for raw data views based on design.
- Renaming left for follow up diff
- Link in the menu is hidden for now
To access raw UI, use /p/data URL.

Test Plan: new tests

Reviewers: georgegevoian

Reviewed By: georgegevoian

Subscribers: dsagal

Differential Revision: https://phab.getgrist.com/D3306
This commit is contained in:
Jarosław Sadziński
2022-03-11 11:48:36 +01:00
parent 2d0978559b
commit eff78ae2e1
10 changed files with 517 additions and 83 deletions

View File

@@ -63,9 +63,9 @@ export function localStorageBoolObs(key: string, defValue = false): Observable<b
/**
* Helper to create a string observable whose state is stored in localStorage.
*/
export function localStorageObs(key: string): Observable<string|null> {
export function localStorageObs(key: string, defaultValue?: string): Observable<string|null> {
const store = getStorage();
const obs = Observable.create<string|null>(null, store.getItem(key));
const obs = Observable.create<string|null>(null, store.getItem(key) ?? defaultValue ?? null);
obs.addListener((val) => (val === null) ? store.removeItem(key) : store.setItem(key, val));
return obs;
}