-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Collapse worker groups on cluster list * - fixed worker group margins - adjusted tooltip delay - make button only visible on mouseover - worker group chip not clickable * Changed auto-hide activation * use v-hover to show / hide collapse button * Reset expanded state when component gets reused * Store expansion state in provided object * Allow to toggle all worker groups using shift-click Some cleanup * Refactored collapse logic into re-usable component * Use collapsable items component for access restrictions and ticket labels * Collapse Readiness Tags * Cleanup * React to shift press * Further cleanup Hide collapse buttons via css * Expand Items in Table Header * Removed expanded readiness condition state * inject expanded items * Use custom table header for all VDataTables to align headers * Use collapsable items only where we actually want to collapse * Fixed wrong param * PR Feedback * - Removed all unused functionality from GCollapsibleItems - Removed GDataTableHeader - Show number only for collapsed items - Use VChipGroup for ticket labels - Fixed sorting for numeric values * PR Feedback - Removed expand button / expand only by clicking on chip - Added hover effect for expandable chips - Close using close icon - removed g-collapsible-items-button as we don't need that re-use component anymore - Removed multi-expand logic (shift) - Use v-chips for ticket labels - Do not use v-chip-group as this makes the group selectable which we do not want * fixed unknown color * PR Feedback * PR Feedback * fixed unused import * PR Feedback: minor renaming --------- Co-authored-by: Holger Koser <[email protected]>
- Loading branch information
1 parent
2721499
commit e7e5b5f
Showing
17 changed files
with
336 additions
and
177 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
<!-- | ||
SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Gardener contributors | ||
SPDX-License-Identifier: Apache-2.0 | ||
--> | ||
|
||
<template> | ||
<div | ||
v-if="items.length" | ||
class="d-flex" | ||
> | ||
<div | ||
class="d-flex align-center" | ||
> | ||
<template v-if="!expanded"> | ||
<v-hover v-slot="{ props: hoverProps, isHovering }"> | ||
<v-chip | ||
v-bind="hoverProps" | ||
:variant="isHovering ? 'flat' : 'outlined'" | ||
size="small" | ||
:color="chipColor" | ||
label | ||
class="pointer" | ||
@click="expanded = true" | ||
> | ||
{{ itemCount }} | ||
<v-tooltip | ||
location="top" | ||
activator="parent" | ||
> | ||
Expand items | ||
</v-tooltip> | ||
</v-chip> | ||
</v-hover> | ||
</template> | ||
<template v-else> | ||
<div | ||
class="d-flex flex-wrap" | ||
> | ||
<div | ||
v-for="(item, i) in items" | ||
:key="i" | ||
class="d-flex align-center" | ||
> | ||
<slot | ||
name="item" | ||
:item="item" | ||
/> | ||
</div> | ||
</div> | ||
</template> | ||
</div> | ||
<div> | ||
<v-btn | ||
v-if="expanded" | ||
icon="mdi-close" | ||
variant="plain" | ||
size="small" | ||
@click="expanded = false" | ||
/> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script setup> | ||
import { | ||
toRefs, | ||
computed, | ||
inject, | ||
} from 'vue' | ||
const props = defineProps({ | ||
items: { | ||
type: Array, | ||
default: () => [], | ||
}, | ||
uid: { | ||
type: String, | ||
required: false, | ||
}, | ||
injectKey: { | ||
type: String, | ||
required: false, | ||
}, | ||
chipColor: { | ||
type: String, | ||
default: 'primary', | ||
}, | ||
}) | ||
const { items } = toRefs(props) | ||
const expandedItems = inject(props.injectKey, undefined) | ||
const itemCount = computed(() => { | ||
return props.items.length | ||
}) | ||
const expanded = computed({ | ||
get () { | ||
return expandedItems[props.uid] ?? expandedItems.default | ||
}, | ||
set (value) { | ||
expandedItems[props.uid] = value | ||
}, | ||
}) | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.