-
Notifications
You must be signed in to change notification settings - Fork 504
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds filtering support by signal definition to signal instance table (#…
- Loading branch information
Showing
3 changed files
with
79 additions
and
14 deletions.
There are no files selected for viewing
62 changes: 62 additions & 0 deletions
62
src/dispatch/static/dispatch/src/signal/TableFilterDialog.vue
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,62 @@ | ||
<template> | ||
<v-dialog v-model="display" max-width="600px"> | ||
<template #activator="{ props }"> | ||
<v-badge :model-value="!!numFilters" bordered color="info" :content="numFilters"> | ||
<v-btn color="secondary" v-bind="props"> Filter </v-btn> | ||
</v-badge> | ||
</template> | ||
<v-card> | ||
<v-card-title> | ||
<span class="text-h5">Signal Instance Filters</span> | ||
</v-card-title> | ||
<v-list density="compact"> | ||
<v-list-item> | ||
<signal-definition-combobox v-model="local_signal" label="Signal Definitions" /> | ||
</v-list-item> | ||
</v-list> | ||
<v-card-actions> | ||
<v-spacer /> | ||
<v-btn color="info" variant="text" @click="applyFilters()"> Apply Filters </v-btn> | ||
</v-card-actions> | ||
</v-card> | ||
</v-dialog> | ||
</template> | ||
|
||
<script> | ||
import { sum } from "lodash" | ||
import { mapFields } from "vuex-map-fields" | ||
import SignalDefinitionCombobox from "@/signal/SignalDefinitionCombobox.vue" | ||
export default { | ||
name: "SignalInstanceTableFilterDialog", | ||
components: { | ||
SignalDefinitionCombobox, | ||
}, | ||
data() { | ||
return { | ||
display: false, | ||
local_signal: [], | ||
} | ||
}, | ||
computed: { | ||
...mapFields("signal", ["instanceTable.options.filters.signal"]), | ||
numFilters: function () { | ||
return sum([this.signal.length]) | ||
}, | ||
}, | ||
methods: { | ||
applyFilters() { | ||
// we set the filter values | ||
this.signal = this.local_signal | ||
// we close the dialog | ||
this.display = false | ||
}, | ||
}, | ||
} | ||
</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