From 9185a1203570a0935a75773723359f43ffd13037 Mon Sep 17 00:00:00 2001 From: William Lachance Date: Mon, 13 Sep 2021 18:07:49 -0400 Subject: [PATCH] Update "removed" definition We'll say that an item is only removed if it (1) has an "in_source" annotation and it is false. This annotation should always be present for metrics, but is not currently set for any other object. --- src/components/ItemList.svelte | 4 ++-- src/pages/MetricDetail.svelte | 2 +- src/state/filter.js | 2 +- src/state/{metrics.js => items.js} | 6 ++++++ tests/state.items.test.js | 25 +++++++++++++++++++++++++ tests/state.metrics.test.js | 13 ------------- 6 files changed, 35 insertions(+), 17 deletions(-) rename src/state/{metrics.js => items.js} (51%) create mode 100644 tests/state.items.test.js delete mode 100644 tests/state.metrics.test.js diff --git a/src/components/ItemList.svelte b/src/components/ItemList.svelte index d22cda3be..099077081 100644 --- a/src/components/ItemList.svelte +++ b/src/components/ItemList.svelte @@ -10,7 +10,7 @@ import Label from "./Label.svelte"; import { filterUncollectedItems } from "../state/filter"; - import { isExpired } from "../state/metrics"; + import { isExpired, isRemoved } from "../state/items"; import { pageState, updateURLState } from "../state/stores"; let DEFAULT_ITEMS_PER_PAGE = 20; @@ -189,7 +189,7 @@ /> {/each} {/if} - {#if !item.in_source} + {#if isRemoved(item)}