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

fix: filter schedule style and functionality #85

Merged
merged 2 commits into from
Jan 14, 2025
Merged
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
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);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we are fixing this in another PR harvester/dashboard#1263

}
},

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
Loading