From 2f1a601b58dc6b2571da583987b5db6d38d1e2c4 Mon Sep 17 00:00:00 2001 From: Pascal Wilbrink Date: Mon, 28 Nov 2022 08:50:58 +0100 Subject: [PATCH] Fixed plain compare list Signed-off-by: Pascal Wilbrink --- src/plain-compare-list.ts | 29 ++++++++++-------- .../plain-compare-list.test.snap.js | 30 ++----------------- 2 files changed, 20 insertions(+), 39 deletions(-) diff --git a/src/plain-compare-list.ts b/src/plain-compare-list.ts index 78ffb4e71c..750a5f2b84 100644 --- a/src/plain-compare-list.ts +++ b/src/plain-compare-list.ts @@ -60,10 +60,7 @@ export class PlainCompareList extends LitElement { render(): TemplateResult { return html` -
-
- ${this.renderFilterCheckbox()} -
+ ${this.renderFilterCheckbox()}

${this.leftHandTitle}

@@ -83,8 +80,8 @@ export class PlainCompareList extends LitElement { ${this.leftHandObject && this.rightHandObject ? html` ${renderDiff( - this.leftHandObject, this.rightHandObject, + this.leftHandObject, this.filterMutables ? this.filterToIgnore : {} )} ` @@ -93,13 +90,21 @@ export class PlainCompareList extends LitElement { } protected renderFilterCheckbox(): TemplateResult { - return html` - (this.filterMutables = !this.filterMutables)} - > - - `; + if (this.filterToIgnore) { + return html` +
+
+ + (this.filterMutables = !this.filterMutables)} + > + + +
+ `; + } + return html``; } static styles = css` diff --git a/test/unit/__snapshots__/plain-compare-list.test.snap.js b/test/unit/__snapshots__/plain-compare-list.test.snap.js index afcc997b0c..7445726ad3 100644 --- a/test/unit/__snapshots__/plain-compare-list.test.snap.js +++ b/test/unit/__snapshots__/plain-compare-list.test.snap.js @@ -2,15 +2,7 @@ export const snapshots = {}; snapshots["Plain Compare List Empty list looks like the latest snapshot"] = -`
-
-
- - - - -
-
+`

@@ -24,15 +16,7 @@ snapshots["Plain Compare List Empty list looks like the latest snapshot"] = /* end snapshot Plain Compare List Empty list looks like the latest snapshot */ snapshots["Plain Compare List Basic List looks like the latest snapshot"] = -`
-
-
- - - - -
-
+`

Project doc @@ -48,15 +32,7 @@ snapshots["Plain Compare List Basic List looks like the latest snapshot"] = /* end snapshot Plain Compare List Basic List looks like the latest snapshot */ snapshots["Plain Compare List Basic List Has a subtitlte, so looks like the latest snapshot"] = -`
-
-
- - - - -
-
+`

Project doc