Skip to content

Commit

Permalink
Merge pull request #87 from harvester/mergify/bp/release-harvester-v1…
Browse files Browse the repository at this point in the history
….5/pr-85

fix: filter schedule style and functionality (backport #85)
  • Loading branch information
a110605 authored Jan 14, 2025
2 parents 9af5ff7 + 1ecac7a commit ddb8e81
Showing 1 changed file with 26 additions and 14 deletions.
40 changes: 26 additions & 14 deletions pkg/harvester/components/FilterVMSchedule.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ export default {
return Array.from(new Set(options));
},
enableFilterButton() {
return this.rows.some((r) => r.sourceSchedule !== undefined);
}
},
methods: {
Expand Down Expand Up @@ -63,27 +66,30 @@ export default {
</script>

<template>
<div class="vm-schedule-filter">
<template>
<span
v-if="selected"
class="banner-item bg-warning"
>
{{ t('harvester.tableHeaders.vmSchedule') }}{{ selected ? ` = ${selected}`: '' }}<i
class="icon icon-close ml-5"
@click="remove"
/>
</span>
</template>

<div
class="vm-schedule-filter"
>
<span
v-if="selected"
class="banner-item bg-warning"
>
{{ t('harvester.tableHeaders.vmSchedule') }}{{ selected ? ` = ${selected}`: '' }}
<i
class="icon icon-close ml-5"
@click="remove"
/>
</span>
<v-dropdown
popper-class="vm-schedule-dropdown"
:triggers="scheduleOptions.length ? ['click'] : []"
placement="bottom-end"
offset="1"
:distance="20"
>
<button
ref="actionDropDown"
class="btn bg-primary mr-10"
:disabled="!enableFilterButton"
>
<slot name="title">
{{ t('harvester.fields.filterSchedule') }}
Expand All @@ -98,14 +104,20 @@ export default {
name="model"
:options="scheduleOptions"
:labels="scheduleOptions"
@input="onSelect"
@update:value="onSelect"
/>
</div>
</template>
</v-dropdown>
</div>
</template>

<style lang="scss">
.vm-schedule-dropdown .v-popper__arrow-container {
display: none;
}
</style>

<style lang="scss" scoped>
.vm-schedule-filter {
display: inline-block;
Expand Down

0 comments on commit ddb8e81

Please sign in to comment.