fix(frontend): Fix table action recompute (#3221)

* fix(frontend): Fix table action recompute

* fix(frontend): fix hover colors
This commit is contained in:
Faton Ramadani
2024-02-15 17:40:13 +01:00
committed by GitHub
parent e6513acf5c
commit 455aaedd92
2 changed files with 12 additions and 2 deletions
@@ -469,7 +469,17 @@ export function getAllSubgridsAndComponentIds(
}
export function getAllGridItems(app: App): GridItem[] {
return app.grid.concat(Object.values(app.subgrids ?? {}).flat())
return app.grid
.concat(Object.values(app.subgrids ?? {}).flat())
.map((x) => {
if (x?.data?.type === 'tablecomponent') {
return [x, ...x?.data?.actionButtons?.map((x) => ({ data: x, id: x.id }))]
} else if (x?.data?.type === 'menucomponent') {
return [x, ...x?.data?.menuItems?.map((x) => ({ data: x, id: x.id }))]
}
return [x]
})
.flat()
}
export function deleteGridItem(
@@ -47,7 +47,7 @@
<div
class={classNames(
'w-full text-xs font-bold gap-1 truncate py-1.5 px-2 cursor-pointer transition-all justify-between flex items-center border border-gray-3 rounded-md',
'bg-surface hover:bg-tertiary focus:border-primary text-secondary',
'bg-surface hover:bg-surface-hover focus:border-primary text-secondary',
$selectedComponent?.includes(component.id) ? 'outline outline-blue-500 bg-red-400' : ''
)}
on:click={() => {