Skip to content

Commit

Permalink
Edit Mode: Add input widgets to configurable mini widgets check
Browse files Browse the repository at this point in the history
Signed-off-by: Arturo Manzoli <[email protected]>
  • Loading branch information
ArturoManzoli committed Feb 5, 2025
1 parent 90c9c6f commit 6c51ab2
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/components/EditMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@
<v-divider vertical class="opacity-10 mr-1" />
<div
class="icon-btn mdi mdi-cog"
:class="{ 'opacity-20 cursor-not-allowed': !isMiniWidgetConfigurable[widget.component as MiniWidgetType] }"
:class="{ 'opacity-20 cursor-not-allowed': !isCogIconEnabled(widget) }"
@click="store.miniWidgetManagerVars(widget.hash).configMenuOpen = true"
/>
<div class="icon-btn mdi mdi-trash-can" @click="store.deleteMiniWidget(widget)" />
Expand Down Expand Up @@ -431,7 +431,7 @@
<v-divider vertical class="opacity-10 mr-1" />
<div
class="icon-btn mdi mdi-cog"
:class="{ 'opacity-20 cursor-not-allowed': !isMiniWidgetConfigurable[widget.component as MiniWidgetType] }"
:class="{ 'opacity-20 cursor-not-allowed': !isCogIconEnabled(widget) }"
@click="store.miniWidgetManagerVars(widget.hash).configMenuOpen = true"
/>
<div class="icon-btn mdi mdi-trash-can" @click="store.deleteMiniWidget(widget)" />
Expand Down Expand Up @@ -489,7 +489,7 @@
<v-divider vertical class="opacity-10 mr-1" />
<div
class="icon-btn mdi mdi-cog"
:class="{ 'opacity-20 cursor-not-allowed': !isMiniWidgetConfigurable[widget.component as WidgetType] }"
:class="{ 'opacity-20 cursor-not-allowed': !isCogIconEnabled(widget) }"
@click="store.miniWidgetManagerVars(widget.hash).configMenuOpen = true"
/>
<div class="icon-btn mdi mdi-trash-can" @click="store.deleteMiniWidget(widget)" />
Expand Down Expand Up @@ -729,6 +729,7 @@ import {
InternalWidgetSetupInfo,
isMiniWidgetConfigurable,
isWidgetConfigurable,
MiniWidget,
MiniWidgetContainer,
MiniWidgetType,
WidgetType,
Expand Down Expand Up @@ -813,6 +814,13 @@ watch(
}
)
const isCogIconEnabled = (widget: MiniWidget): boolean => {
return (
Object.values(CustomWidgetElementType).includes(widget.component as unknown as CustomWidgetElementType) ||
isMiniWidgetConfigurable[widget.component]
)
}
const findUniqueName = (name: string): string => {
let newName = name
let i = 1
Expand Down

0 comments on commit 6c51ab2

Please sign in to comment.