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

Hide filtered items in KeyValue #13524

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
17 changes: 9 additions & 8 deletions shell/components/form/KeyValue.vue
Original file line number Diff line number Diff line change
Expand Up @@ -295,12 +295,6 @@ export default {
*/
canRemove() {
return !this.isView && this.removeAllowed;
},
/**
* Filter rows based on toggler, keeping to still emit all the values
*/
filteredRows() {
return this.rows.filter((row) => !(this.isProtected(row.key) && !this.toggleFilter));
}
},
created() {
Expand Down Expand Up @@ -665,11 +659,14 @@ export default {
</div>
</template>
<template
v-for="(row,i) in filteredRows"
v-for="(row,i) in rows"
v-else
:key="i"
>
<div class="rowgroup">
<div
class="rowgroup"
:class="{'hidden': isProtected(row.key) && !toggleFilter}"
Copy link
Contributor

Choose a reason for hiding this comment

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

We could replace the hidden class with the hide class. I figure we might as well use the global style since it exists.

https://github.com/rancher/dashboard/blob/master/shell/assets/styles/base/_helpers.scss#L134

>
<div class="row">
<!-- Key -->
<div
Expand Down Expand Up @@ -921,6 +918,10 @@ export default {
grid-column-start: 1;
grid-column-end: span end;
grid-template-columns: subgrid;

&.hidden {
display: none;
}
}

.row {
Expand Down
Loading