fix(navigation): highlight saved filters in project view and prevent them from being dragged around
continuous-integration/drone/push Build is passing Details

This commit is contained in:
kolaente 2023-06-07 20:58:43 +02:00
parent 7b92028e67
commit b50adaf4b5
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
4 changed files with 34 additions and 6 deletions

View File

@ -10,17 +10,19 @@
tag="menu"
item-key="id"
:disabled="!canEditOrder"
filter=".drag-disabled"
:component-data="{
type: 'transition-group',
name: !drag ? 'flip-list' : null,
class: [
'menu-list can-be-hidden',
{ 'dragging-disabled': !canEditOrder }
]
],
}"
>
<template #item="{element: project}">
<ProjectsNavigationItem
:class="{'drag-disabled': project.id < 0}"
:project="project"
:is-loading="projectUpdating[project.id]"
:can-collapse="canCollapse"

View File

@ -20,12 +20,16 @@
v-if="!canCollapse || childProjects?.length === 0"
class="collapse-project-button-placeholder"
></span>
<div class="color-bubble-handle-wrapper">
<div class="color-bubble-handle-wrapper" :class="{'is-draggable': project.id > 0}">
<ColorBubble
v-if="project.hexColor !== ''"
:color="project.hexColor"
/>
<span v-else-if="project.id < -1" class="saved-filter-icon icon menu-item-icon">
<icon icon="filter"/>
</span>
<span
v-if="project.id > 0"
class="icon menu-item-icon handle lines-handle"
:class="{'has-color-bubble': project.hexColor !== ''}"
>
@ -133,8 +137,11 @@ const canNestDeeper = computed(() => canNestProjectDeeper(props.level))
opacity: 1;
}
.list-menu:hover > div > a > .color-bubble-handle-wrapper > .color-bubble {
opacity: 0;
.list-menu:hover > div > a > .color-bubble-handle-wrapper.is-draggable > {
.saved-filter-icon,
.color-bubble {
opacity: 0;
}
}
.color-bubble-handle-wrapper {
@ -160,4 +167,9 @@ const canNestDeeper = computed(() => canNestProjectDeeper(props.level))
overflow: hidden;
text-overflow: ellipsis;
}
.saved-filter-icon {
color: var(--grey-300) !important;
font-size: .75rem;
}
</style>

View File

@ -54,7 +54,11 @@
/>
<template v-else>
<nav class="menu" v-if="favoriteProjects">
<ProjectsNavigation :model-value="favoriteProjects" :can-edit-order="false" :can-collapse="false"/>
<ProjectsNavigation
:model-value="favoriteProjects"
:can-edit-order="false"
:can-collapse="false"
/>
</nav>
<nav class="menu">

View File

@ -17,7 +17,12 @@
/>
<span v-if="project.isArchived" class="is-archived" >{{ $t('project.archived') }}</span>
<div class="project-title" aria-hidden="true">{{ project.title }}</div>
<div class="project-title" aria-hidden="true">
<span v-if="project.id < -1" class="saved-filter-icon icon">
<icon icon="filter"/>
</span>
{{ project.title }}
</div>
<BaseButton
class="project-button"
:aria-label="project.title"
@ -179,4 +184,9 @@ const projectStore = useProjectStore()
opacity: 1;
}
}
.saved-filter-icon {
color: var(--grey-300);
font-size: .75em;
}
</style>