Upgrade to electron 12 and Node 14 (#3572)

Upgrade to electron 12 and Node 14

- Compute cluster ID for tests
- Switch to temporary appData path while testing

Signed-off-by: Sebastian Malton <sebastian@malton.name>

Co-authored-by: Sebastian Malton <smalton@mirantis.com>
Co-authored-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
authored and GitHub committed 2021-08-26 12:13:31 -04:00
1 parent e2812a5bcd
commit 59933507e4
50 files changed
+1000 -1099

No files matched your search

+2 -3
View File
@@ -22,13 +22,12 @@
// Keeps window.localStorage state in external JSON-files.
// Because app creates random port between restarts => storage session wiped out each time.
import path from "path";
import { app, remote } from "electron";
import { comparer, observable, reaction, toJS, when } from "mobx";
import fse from "fs-extra";
import { StorageHelper } from "./storageHelper";
import { ClusterStore } from "../../common/cluster-store";
import logger from "../../main/logger";
import { getHostedClusterId } from "../../common/utils";
import { getHostedClusterId, getPath } from "../../common/utils";
const storage = observable({
initialized: false,
@@ -47,7 +46,7 @@ export function createStorage<T>(key: string, defaultValue: T) {
export function createAppStorage<T>(key: string, defaultValue: T, clusterId?: string | undefined) {
const { logPrefix } = StorageHelper;
const folder = path.resolve((app || remote.app).getPath("userData"), "lens-local-storage");
const folder = path.resolve(getPath("userData"), "lens-local-storage");
const fileName = `${clusterId ?? "app"}.json`;
const filePath = path.resolve(folder, fileName);