Hotbar disabled items (#2710)

* Saving more entity data to HotbarItem

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* Adding generic MaterialTooltip component

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* Move HotbarCell to separate component

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* Abstract out HotbarEntityIcon from HotbarIcon

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* Styling disabled hotbar items

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* Migration for adding extra data to hotbar items

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* Testing migration

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* Some cleaning up

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* Bump migration version

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* Bump app version in package.json

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
Alex Andreev authored and GitHub committed 2021-05-13 10:24:58 +03:00
1 parent 2d0609ed24
commit a930d5f14f
14 files changed
+501 -204

No files matched your search

+9 -1
View File
@@ -29,6 +29,8 @@ import isNull from "lodash/isNull";
export interface HotbarItem {
entity: {
uid: string;
name?: string;
source?: string;
};
params?: {
[key: string]: string;
@@ -144,9 +146,14 @@ export class HotbarStore extends BaseStore<HotbarStoreModel> {
}
}
@action
addToHotbar(item: CatalogEntityItem, cellIndex = -1) {
const hotbar = this.getActive();
const newItem = { entity: { uid: item.id }};
const newItem = { entity: {
uid: item.id,
name: item.name,
source: item.source
}};
if (hotbar.items.find(i => i?.entity.uid === item.id)) {
return;
@@ -167,6 +174,7 @@ export class HotbarStore extends BaseStore<HotbarStoreModel> {
}
}
@action
removeFromHotbar(uid: string) {
const hotbar = this.getActive();
const index = hotbar.items.findIndex((i) => i?.entity.uid === uid);