Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

492 vue3 when no data present show notification #496

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/components/general/ColumnItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@ export interface ColumnItem {
href?: string
target?: string
icon?: string
disabled?: boolean
tooltipText?: string
}
24 changes: 22 additions & 2 deletions src/components/general/ColumnMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,25 @@
"
:to="child.to"
:class="getClass(child)"
:disabled="child.disabled"
>
<v-list-item-title>{{ child.name }}</v-list-item-title>
<template v-slot:append>
<v-icon v-if="child.children?.length">mdi-chevron-right</v-icon>
<v-icon v-else-if="child.icon" small>{{ child.icon }}</v-icon>
<v-tooltip v-if="item.tooltipText">
<template v-slot:activator="{ props }">
<v-icon
v-bind="props"
class="allow-disabled-hover"
size="x-small"
>{{ item.icon }}</v-icon
>
</template>
{{ item.tooltipText }}
</v-tooltip>
<div v-else>
<v-icon v-if="child.children">mdi-chevron-right</v-icon>
<v-icon v-else-if="child.icon" small>{{ child.icon }}</v-icon>
</div>
</template>
</v-list-item>
</template>
Expand Down Expand Up @@ -150,3 +164,9 @@ function recursiveFind(stack: ColumnItem[], id: string): boolean {
return false
}
</script>

<style>
.allow-disabled-hover {
pointer-events: auto;
}
</style>
28 changes: 26 additions & 2 deletions src/components/general/TreeMenuItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,35 @@
<v-list-item v-else-if="item.href" :href="item.href" target="_blank">
<v-list-item-title>{{ item.name }}</v-list-item-title>
<template v-slot:append>
<v-icon>mdi-share</v-icon>
<v-icon size="x-small">{{ item.icon }}</v-icon>
</template>
</v-list-item>
<v-list-item v-else :to="item.to" style="margin-right: 10px">
<v-list-item
v-else
:to="item.to"
style="margin-right: 10px"
:disabled="item.disabled"
>
<v-list-item-title>{{ item.name }}</v-list-item-title>
<template v-slot:append>
<v-tooltip v-if="item.tooltipText">
<template v-slot:activator="{ props }">
<v-icon
v-bind="props"
class="allow-disabled-hover"
size="x-small"
>{{ item.icon }}</v-icon
>
</template>
{{ item.tooltipText }}
</v-tooltip>
<v-icon
v-else-if="item.icon"
size="x-small"
style="pointer-events: auto"
>{{ item.icon }}
</v-icon>
</template>
</v-list-item>
</template>
</template>
Expand Down
11 changes: 9 additions & 2 deletions src/views/SpatialDisplayView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,22 @@ function attachLayersToMenu(
) {
for (const layer of layers) {
const groupNode = groupNodes.get(layer.path.toString())
const noData = layer.completelyMissing || false
const item: ColumnItem = {
id: layer.name,
name: layer.title || layer.name,
to: {
disabled: noData,
}
if (!noData) {
item.to = {
name: 'SpatialDisplay',
params: {
layerName: layer.name,
},
},
}
} else {
item.tooltipText = 'No data available'
item.icon = 'mdi-alert-circle-outline'
}
groupNode?.children?.push(item)
}
Expand Down
Loading