From dc5fc3988730927384bbc6d33fd8daa1ed3b5041 Mon Sep 17 00:00:00 2001 From: Daniel Cousens <413395+dcousens@users.noreply.github.com> Date: Wed, 27 Oct 2021 12:41:30 +1100 Subject: [PATCH 01/21] Update renovate.json --- renovate.json | 1 + 1 file changed, 1 insertion(+) diff --git a/renovate.json b/renovate.json index c21f2374b70..1fc1e286e77 100644 --- a/renovate.json +++ b/renovate.json @@ -4,6 +4,7 @@ "lockFileMaintenance": { "enabled": true }, "separateMinorPatch": true, "prConcurrentLimit": 0, + "baseBranches": ["renovate"], "packageRules": [ { "packagePatterns": [ From fd4cb0f1708c03c42f746b1e383e22866b763751 Mon Sep 17 00:00:00 2001 From: Daniel Cousens <413395+dcousens@users.noreply.github.com> Date: Wed, 27 Oct 2021 12:54:22 +1100 Subject: [PATCH 02/21] git does not allow sub branches of branches --- renovate.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/renovate.json b/renovate.json index 1fc1e286e77..70c2df57b8b 100644 --- a/renovate.json +++ b/renovate.json @@ -4,7 +4,7 @@ "lockFileMaintenance": { "enabled": true }, "separateMinorPatch": true, "prConcurrentLimit": 0, - "baseBranches": ["renovate"], + "baseBranches": ["renovating"], "packageRules": [ { "packagePatterns": [ From db7f2311bb2ff8e1e70350cd0f087439b8404a8a Mon Sep 17 00:00:00 2001 From: Charles Date: Wed, 27 Oct 2021 13:02:16 +1100 Subject: [PATCH 03/21] Fix/relationship filter bug (#6837) * replace hard-coded query param with field.path * changeset --- .changeset/popular-emus-compare.md | 5 +++++ .../fields/types/relationship/views/index.tsx | 16 ++++++++-------- 2 files changed, 13 insertions(+), 8 deletions(-) create mode 100644 .changeset/popular-emus-compare.md diff --git a/.changeset/popular-emus-compare.md b/.changeset/popular-emus-compare.md new file mode 100644 index 00000000000..16a98cdd06b --- /dev/null +++ b/.changeset/popular-emus-compare.md @@ -0,0 +1,5 @@ +--- +'@keystone-next/keystone': patch +--- + +Fixed bug in LinkToRelatedItems button for double sided relationships diff --git a/packages/keystone/src/fields/types/relationship/views/index.tsx b/packages/keystone/src/fields/types/relationship/views/index.tsx index 4d1f437adc9..6efefc305e6 100644 --- a/packages/keystone/src/fields/types/relationship/views/index.tsx +++ b/packages/keystone/src/fields/types/relationship/views/index.tsx @@ -25,26 +25,26 @@ import { RelationshipSelect } from './RelationshipSelect'; function LinkToRelatedItems({ itemId, - isDoubleSided, value, list, + refFieldKey, }: { itemId: string | null; - isDoubleSided: boolean; value: FieldProps['value'] & { kind: 'many' | 'one' }; list: ListMeta; + refFieldKey?: string; }) { function constructQuery({ - isDoubleSided, + refFieldKey, itemId, value, }: { - isDoubleSided?: boolean; + refFieldKey?: string; itemId: string | null; value: FieldProps['value'] & { kind: 'many' | 'one' }; }) { - if (isDoubleSided && itemId) { - return `!assignedTo_matches="${itemId}"`; + if (!!refFieldKey && itemId) { + return `!${refFieldKey}_matches="${itemId}"`; } return `!id_in="${(value?.value as { id: string; label: string }[]) .slice(0, 100) @@ -58,7 +58,7 @@ function LinkToRelatedItems({ } as const; if (value.kind === 'many') { - const query = constructQuery({ isDoubleSided, value, itemId }); + const query = constructQuery({ refFieldKey, value, itemId }); return (