mirror of
https://github.com/gristlabs/grist-core.git
synced 2024-10-27 20:44:07 +00:00
0a5afd1f98
Summary: - Add org-wide currentSort and currentView, saved as user preferences. - Add per-workspace currentSort and currentView, backed by localStorage. - Move localStorage-based observables to a separate file. - Move hard-coded data about example docs to a separate file. - Add UI for toggling sort and view mode. - Removed unused features of buttonSelect to simplify it, and added support for light style of buttons. - Added `parse` helper method to StringUnion, and use it in a few places where it simplifies code. - Set `needRealOrg: true` in HomeDBManager.updateOrg() to fix saving prefs for mergedOrg. Test Plan: WIP: Fixed some affected tests. New tests not yet written. Reviewers: paulfitz Reviewed By: paulfitz Differential Revision: https://phab.getgrist.com/D2587
24 lines
588 B
TypeScript
24 lines
588 B
TypeScript
import {StringUnion} from 'app/common/StringUnion';
|
|
|
|
export const SortPref = StringUnion("name", "date");
|
|
export type SortPref = typeof SortPref.type;
|
|
|
|
export const ViewPref = StringUnion("list", "icons");
|
|
export type ViewPref = typeof ViewPref.type;
|
|
|
|
|
|
// A collection of preferences related to a user or org (or combination).
|
|
export interface Prefs {
|
|
// TODO replace this with real preferences.
|
|
placeholder?: string;
|
|
}
|
|
|
|
export type UserPrefs = Prefs;
|
|
|
|
export interface UserOrgPrefs extends Prefs {
|
|
docMenuSort?: SortPref;
|
|
docMenuView?: ViewPref;
|
|
}
|
|
|
|
export type OrgPrefs = Prefs;
|