diff --git a/frontend/src/components/objectgrid.svelte b/frontend/src/components/objectgrid.svelte index e018a66..eb2d750 100644 --- a/frontend/src/components/objectgrid.svelte +++ b/frontend/src/components/objectgrid.svelte @@ -5,6 +5,7 @@ export let key = '_id'; export let activePath = []; export let hideObjectIndicators = false; + export let getRootMenu = () => undefined; const columns = [ { key: 'key', label: 'Key' }, @@ -23,7 +24,7 @@ newItem.key = item[key]; newItem.type = getType(item[key]); newItem.children = dissectObject(item); - newItem.menu = item.menu; + newItem.menu = getRootMenu(key, item[key]); items = [ ...items, newItem ]; } } diff --git a/frontend/src/organisms/connection/collection/indexes.svelte b/frontend/src/organisms/connection/collection/indexes.svelte index 2008496..ede049b 100644 --- a/frontend/src/organisms/connection/collection/indexes.svelte +++ b/frontend/src/organisms/connection/collection/indexes.svelte @@ -50,10 +50,13 @@
- ({ - ...idx, - menu: [ { label: 'Drop this index', fn: () => drop(idx.name) } ], - }))} bind:activePath on:trigger={e => openJson(e.detail.itemKey)} /> + [ { label: 'Drop this index', fn: () => drop(idx.name) } ]} + bind:activePath + on:trigger={e => openJson(e.detail.itemKey)} + />