mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Add types to store table size configs in user preferences store
Signed-off-by: Alex Culliere <alozhkin@mirantis.com>
This commit is contained in:
parent
f06fb7892b
commit
74785e2fbc
10
src/common/table-size-config.ts
Normal file
10
src/common/table-size-config.ts
Normal file
@ -0,0 +1,10 @@
|
||||
import { ClusterId } from "./cluster-store";
|
||||
|
||||
export type TableId = string;
|
||||
export type TableSizeRecord = Record<TableId, number[]>;
|
||||
|
||||
/**
|
||||
* Stores a configuration of table column sizes, set by the user,
|
||||
* for each table by `TableId`, for each cluster by `ClusterId`
|
||||
*/
|
||||
export type TableSizeConfig = Record<ClusterId, TableSizeRecord>;
|
||||
@ -9,6 +9,7 @@ import { getAppVersion } from "./utils/app-version";
|
||||
import { kubeConfigDefaultPath, loadConfig } from "./kube-helpers";
|
||||
import { appEventBus } from "./event-bus";
|
||||
import logger from "../main/logger";
|
||||
import { TableSizeConfig } from "./table-size-config";
|
||||
import path from "path";
|
||||
|
||||
export interface UserStoreModel {
|
||||
@ -29,7 +30,8 @@ export interface UserPreferences {
|
||||
downloadBinariesPath?: string;
|
||||
kubectlBinariesPath?: string;
|
||||
openAtLogin?: boolean;
|
||||
hiddenTableColumns?: Record<string, string[]>;
|
||||
tableSizeConfig?: TableSizeConfig;
|
||||
hiddenTableColumns?: Record<string, string[]>
|
||||
}
|
||||
|
||||
export class UserStore extends BaseStore<UserStoreModel> {
|
||||
@ -57,6 +59,7 @@ export class UserStore extends BaseStore<UserStoreModel> {
|
||||
downloadKubectlBinaries: true, // Download kubectl binaries matching cluster version
|
||||
openAtLogin: false,
|
||||
hiddenTableColumns: {},
|
||||
tableSizeConfig: {},
|
||||
};
|
||||
|
||||
protected async handleOnLoad() {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user