mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Adding Catalog initially to first hotbar
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
parent
f0ff4110d8
commit
80803f78a6
@ -26,6 +26,7 @@ import * as uuid from "uuid";
|
|||||||
import isNull from "lodash/isNull";
|
import isNull from "lodash/isNull";
|
||||||
import { toJS } from "./utils";
|
import { toJS } from "./utils";
|
||||||
import { CatalogEntity } from "./catalog";
|
import { CatalogEntity } from "./catalog";
|
||||||
|
import { catalogEntity } from "../main/catalog-sources/general";
|
||||||
|
|
||||||
export interface HotbarItem {
|
export interface HotbarItem {
|
||||||
entity: {
|
entity: {
|
||||||
@ -92,7 +93,13 @@ export class HotbarStore extends BaseStore<HotbarStoreModel> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get initialItems() {
|
get initialItems() {
|
||||||
return [...Array.from(Array(defaultHotbarCells).fill(null))];
|
const { metadata: { uid, name, source } } = catalogEntity;
|
||||||
|
const initialItem = { entity: { uid, name, source }};
|
||||||
|
|
||||||
|
return [
|
||||||
|
initialItem,
|
||||||
|
...Array.from(Array(defaultHotbarCells - 1).fill(null))
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@action protected async fromStore(data: Partial<HotbarStoreModel> = {}) {
|
@action protected async fromStore(data: Partial<HotbarStoreModel> = {}) {
|
||||||
|
|||||||
@ -24,43 +24,47 @@ import { GeneralEntity } from "../../common/catalog-entities/general";
|
|||||||
import { catalogURL, preferencesURL } from "../../common/routes";
|
import { catalogURL, preferencesURL } from "../../common/routes";
|
||||||
import { catalogEntityRegistry } from "../catalog";
|
import { catalogEntityRegistry } from "../catalog";
|
||||||
|
|
||||||
|
export const catalogEntity = new GeneralEntity({
|
||||||
|
metadata: {
|
||||||
|
uid: "catalog-entity",
|
||||||
|
name: "Catalog",
|
||||||
|
source: "app",
|
||||||
|
labels: {}
|
||||||
|
},
|
||||||
|
spec: {
|
||||||
|
path: catalogURL(),
|
||||||
|
icon: {
|
||||||
|
material: "view_list",
|
||||||
|
background: "#3d90ce"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
status: {
|
||||||
|
phase: "active",
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const preferencesEntity = new GeneralEntity({
|
||||||
|
metadata: {
|
||||||
|
uid: "preferences-entity",
|
||||||
|
name: "Preferences",
|
||||||
|
source: "app",
|
||||||
|
labels: {}
|
||||||
|
},
|
||||||
|
spec: {
|
||||||
|
path: preferencesURL(),
|
||||||
|
icon: {
|
||||||
|
material: "settings",
|
||||||
|
background: "#3d90ce"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
status: {
|
||||||
|
phase: "active",
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
const generalEntities = observable([
|
const generalEntities = observable([
|
||||||
new GeneralEntity({
|
catalogEntity,
|
||||||
metadata: {
|
preferencesEntity
|
||||||
uid: "catalog-entity",
|
|
||||||
name: "Catalog",
|
|
||||||
source: "local",
|
|
||||||
labels: {}
|
|
||||||
},
|
|
||||||
spec: {
|
|
||||||
path: catalogURL(),
|
|
||||||
icon: {
|
|
||||||
material: "view_list",
|
|
||||||
background: "#3d90ce"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
status: {
|
|
||||||
phase: "active",
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
new GeneralEntity({
|
|
||||||
metadata: {
|
|
||||||
uid: "preferences-entity",
|
|
||||||
name: "Preferences",
|
|
||||||
source: "local",
|
|
||||||
labels: {}
|
|
||||||
},
|
|
||||||
spec: {
|
|
||||||
path: preferencesURL(),
|
|
||||||
icon: {
|
|
||||||
material: "settings",
|
|
||||||
background: "#3d90ce"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
status: {
|
|
||||||
phase: "active",
|
|
||||||
}
|
|
||||||
})
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
export function addGeneralEntities() {
|
export function addGeneralEntities() {
|
||||||
|
|||||||
@ -130,5 +130,6 @@
|
|||||||
margin-left: 1px;
|
margin-left: 1px;
|
||||||
margin-top: 1px;
|
margin-top: 1px;
|
||||||
text-shadow: none;
|
text-shadow: none;
|
||||||
|
font-size: 180%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user