From 0483f1485daeab44451ab72f35bea592d4522fce Mon Sep 17 00:00:00 2001 From: Matthew Zikherman Date: Mon, 16 Dec 2024 18:01:41 -0500 Subject: [PATCH 1/2] fix: suppress `metric` from filter URLs --- src/Components/ArtworkFilter/Utils/isDefaultFilter.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Components/ArtworkFilter/Utils/isDefaultFilter.tsx b/src/Components/ArtworkFilter/Utils/isDefaultFilter.tsx index 5d33de052ad..84660b552f8 100644 --- a/src/Components/ArtworkFilter/Utils/isDefaultFilter.tsx +++ b/src/Components/ArtworkFilter/Utils/isDefaultFilter.tsx @@ -1,4 +1,3 @@ -import { DEFAULT_METRIC } from "Utils/metrics" import { ArtworkFilters } from "Components/ArtworkFilter/ArtworkFilterTypes" export const isDefaultFilter: ( @@ -40,7 +39,7 @@ export const isDefaultFilter: ( case name === "page": return value === 1 case name === "metric": - return value === DEFAULT_METRIC + return true // We don't want to include `metric` in the URL. default: return !value } From 656b3c562eb520792596754573267c956a4820b6 Mon Sep 17 00:00:00 2001 From: Matthew Zikherman Date: Tue, 17 Dec 2024 12:14:39 -0500 Subject: [PATCH 2/2] fix: remove unused fetchUserPreferences middleware --- src/System/Utils/fetchUserPreferences.ts | 19 ---- .../fetchUserPreferencesQuery.graphql.ts | 95 ------------------- 2 files changed, 114 deletions(-) delete mode 100644 src/System/Utils/fetchUserPreferences.ts delete mode 100644 src/__generated__/fetchUserPreferencesQuery.graphql.ts diff --git a/src/System/Utils/fetchUserPreferences.ts b/src/System/Utils/fetchUserPreferences.ts deleted file mode 100644 index e9c58d61878..00000000000 --- a/src/System/Utils/fetchUserPreferences.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { fetchQuery, graphql } from "react-relay" -import { fetchUserPreferencesQuery } from "__generated__/fetchUserPreferencesQuery.graphql" -import { Environment } from "react-relay" - -export const fetchUserPreferences = (relayEnvironment: Environment) => { - return fetchQuery( - relayEnvironment, - USER_PREFERENCES_QUERY, - {} - ).toPromise() -} - -const USER_PREFERENCES_QUERY = graphql` - query fetchUserPreferencesQuery { - me { - lengthUnitPreference - } - } -` diff --git a/src/__generated__/fetchUserPreferencesQuery.graphql.ts b/src/__generated__/fetchUserPreferencesQuery.graphql.ts deleted file mode 100644 index 73e546188eb..00000000000 --- a/src/__generated__/fetchUserPreferencesQuery.graphql.ts +++ /dev/null @@ -1,95 +0,0 @@ -/** - * @generated SignedSource<<0b82a6345946a4990c940eced4f0ef95>> - * @lightSyntaxTransform - * @nogrep - */ - -/* tslint:disable */ -/* eslint-disable */ -// @ts-nocheck - -import { ConcreteRequest } from 'relay-runtime'; -export type LengthUnitPreference = "CM" | "IN" | "%future added value"; -export type fetchUserPreferencesQuery$variables = Record; -export type fetchUserPreferencesQuery$data = { - readonly me: { - readonly lengthUnitPreference: LengthUnitPreference; - } | null | undefined; -}; -export type fetchUserPreferencesQuery = { - response: fetchUserPreferencesQuery$data; - variables: fetchUserPreferencesQuery$variables; -}; - -const node: ConcreteRequest = (function(){ -var v0 = { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "lengthUnitPreference", - "storageKey": null -}; -return { - "fragment": { - "argumentDefinitions": [], - "kind": "Fragment", - "metadata": null, - "name": "fetchUserPreferencesQuery", - "selections": [ - { - "alias": null, - "args": null, - "concreteType": "Me", - "kind": "LinkedField", - "name": "me", - "plural": false, - "selections": [ - (v0/*: any*/) - ], - "storageKey": null - } - ], - "type": "Query", - "abstractKey": null - }, - "kind": "Request", - "operation": { - "argumentDefinitions": [], - "kind": "Operation", - "name": "fetchUserPreferencesQuery", - "selections": [ - { - "alias": null, - "args": null, - "concreteType": "Me", - "kind": "LinkedField", - "name": "me", - "plural": false, - "selections": [ - (v0/*: any*/), - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "id", - "storageKey": null - } - ], - "storageKey": null - } - ] - }, - "params": { - "cacheID": "6629daf159af50f7e1cc97aa8a41f428", - "id": null, - "metadata": {}, - "name": "fetchUserPreferencesQuery", - "operationKind": "query", - "text": "query fetchUserPreferencesQuery {\n me {\n lengthUnitPreference\n id\n }\n}\n" - } -}; -})(); - -(node as any).hash = "3b561d0da012a9e902e3237f942c6b80"; - -export default node;