Added context menu to the app navigation sidebar
This commit is contained in:
parent
0579e3bea6
commit
e8e2a3c31d
|
@ -38,7 +38,7 @@
|
||||||
<div use:getAnchor on:click={openMenu}>
|
<div use:getAnchor on:click={openMenu}>
|
||||||
<slot name="control" />
|
<slot name="control" />
|
||||||
</div>
|
</div>
|
||||||
<Popover bind:this={dropdown} {anchor} {align} {portalTarget}>
|
<Popover bind:this={dropdown} {anchor} {align} {portalTarget} on:open on:close>
|
||||||
<Menu>
|
<Menu>
|
||||||
<slot />
|
<slot />
|
||||||
</Menu>
|
</Menu>
|
||||||
|
|
|
@ -71,6 +71,7 @@
|
||||||
class:scrollable
|
class:scrollable
|
||||||
class:highlighted
|
class:highlighted
|
||||||
class:selectedBy
|
class:selectedBy
|
||||||
|
class:actionsOpen={highlighted && withActions}
|
||||||
on:dragend
|
on:dragend
|
||||||
on:dragstart
|
on:dragstart
|
||||||
on:dragover
|
on:dragover
|
||||||
|
@ -168,8 +169,9 @@
|
||||||
--avatars-background: var(--spectrum-global-color-gray-300);
|
--avatars-background: var(--spectrum-global-color-gray-300);
|
||||||
}
|
}
|
||||||
.nav-item:hover .actions,
|
.nav-item:hover .actions,
|
||||||
.hovering .actions {
|
.hovering .actions,
|
||||||
visibility: visible;
|
.nav-item.withActions.actionsOpen .actions {
|
||||||
|
opacity: 1;
|
||||||
}
|
}
|
||||||
.nav-item-content {
|
.nav-item-content {
|
||||||
flex: 1 1 auto;
|
flex: 1 1 auto;
|
||||||
|
@ -272,7 +274,6 @@
|
||||||
position: relative;
|
position: relative;
|
||||||
display: grid;
|
display: grid;
|
||||||
place-items: center;
|
place-items: center;
|
||||||
visibility: hidden;
|
|
||||||
order: 3;
|
order: 3;
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
width: 20px;
|
width: 20px;
|
||||||
|
|
|
@ -5,11 +5,11 @@
|
||||||
import DuplicateAppModal from "./DuplicateAppModal.svelte"
|
import DuplicateAppModal from "./DuplicateAppModal.svelte"
|
||||||
|
|
||||||
export let app
|
export let app
|
||||||
|
export let align = "right"
|
||||||
|
|
||||||
let deleteModal
|
let deleteModal
|
||||||
let exportModal
|
let exportModal
|
||||||
let duplicateModal
|
let duplicateModal
|
||||||
|
|
||||||
let exportPublishedVersion = false
|
let exportPublishedVersion = false
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@
|
||||||
<DuplicateAppModal appId={app.devId} appName={app.name} />
|
<DuplicateAppModal appId={app.devId} appName={app.name} />
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|
||||||
<ActionMenu align="right">
|
<ActionMenu {align} on:open on:close>
|
||||||
<div slot="control" class="icon">
|
<div slot="control" class="icon">
|
||||||
<Icon size="S" hoverable name="MoreSmallList" />
|
<Icon size="S" hoverable name="MoreSmallList" />
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -3,8 +3,11 @@
|
||||||
import { params, goto } from "@roxi/routify"
|
import { params, goto } from "@roxi/routify"
|
||||||
import NavItem from "components/common/NavItem.svelte"
|
import NavItem from "components/common/NavItem.svelte"
|
||||||
import NavHeader from "components/common/NavHeader.svelte"
|
import NavHeader from "components/common/NavHeader.svelte"
|
||||||
|
import AppRowContext from "components/start/AppRowContext.svelte"
|
||||||
|
import { AppStatus } from "constants"
|
||||||
|
|
||||||
let searchString
|
let searchString
|
||||||
|
let opened
|
||||||
|
|
||||||
$: filteredApps = $apps
|
$: filteredApps = $apps
|
||||||
.filter(app => {
|
.filter(app => {
|
||||||
|
@ -13,6 +16,12 @@
|
||||||
app.name.toLowerCase().includes(searchString.toLowerCase())
|
app.name.toLowerCase().includes(searchString.toLowerCase())
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
.map(app => {
|
||||||
|
return {
|
||||||
|
...app,
|
||||||
|
deployed: app.status === AppStatus.DEPLOYED,
|
||||||
|
}
|
||||||
|
})
|
||||||
.sort((a, b) => {
|
.sort((a, b) => {
|
||||||
const lowerA = a.name.toLowerCase()
|
const lowerA = a.name.toLowerCase()
|
||||||
const lowerB = b.name.toLowerCase()
|
const lowerB = b.name.toLowerCase()
|
||||||
|
@ -42,8 +51,20 @@
|
||||||
icon={app.icon?.name || "Apps"}
|
icon={app.icon?.name || "Apps"}
|
||||||
iconColor={app.icon?.color}
|
iconColor={app.icon?.color}
|
||||||
selected={$params.appId === app.appId}
|
selected={$params.appId === app.appId}
|
||||||
|
highlighted={opened == app.appId}
|
||||||
on:click={() => $goto(`./${app.appId}`)}
|
on:click={() => $goto(`./${app.appId}`)}
|
||||||
/>
|
>
|
||||||
|
<AppRowContext
|
||||||
|
{app}
|
||||||
|
align="left"
|
||||||
|
on:open={() => {
|
||||||
|
opened = app.appId
|
||||||
|
}}
|
||||||
|
on:close={() => {
|
||||||
|
opened = null
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</NavItem>
|
||||||
{/each}
|
{/each}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue