mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Catalog & Hotbar - initial groundwork (#2418)
Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
1 parent
e18a041b13
commit
99a464c61d
109 files changed
+1604
-2612
No files matched your search
@@ -0,0 +1,28 @@
|
||||
// Cleans up a store that had the state related data stored
|
||||
import { Hotbar } from "../../common/hotbar-store";
|
||||
import { clusterStore } from "../../common/cluster-store";
|
||||
import { migration } from "../migration-wrapper";
|
||||
|
||||
export default migration({
|
||||
version: "5.0.0-alpha.0",
|
||||
run(store) {
|
||||
const hotbars: Hotbar[] = [];
|
||||
|
||||
clusterStore.enabledClustersList.forEach((cluster: any) => {
|
||||
const name = cluster.workspace || "default";
|
||||
let hotbar = hotbars.find((h) => h.name === name);
|
||||
|
||||
if (!hotbar) {
|
||||
hotbar = { name, items: [] };
|
||||
hotbars.push(hotbar);
|
||||
}
|
||||
|
||||
hotbar.items.push({
|
||||
entity: { uid: cluster.id },
|
||||
params: {}
|
||||
});
|
||||
});
|
||||
|
||||
store.set("hotbars", hotbars);
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,7 @@
|
||||
// Hotbar store migrations
|
||||
|
||||
import version500alpha0 from "./5.0.0-alpha.0";
|
||||
|
||||
export default {
|
||||
...version500alpha0,
|
||||
};
|
||||
Reference in new issue
Block a user