From 4b90a0b37c2e7cd8be8f0f9ab2dfd0542d00f122 Mon Sep 17 00:00:00 2001 From: rijkvanzanten Date: Tue, 22 Sep 2020 11:17:36 -0400 Subject: [PATCH] Fix type check on interfaces/displays pane --- .../routes/data-model/field-detail/store.ts | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/app/src/modules/settings/routes/data-model/field-detail/store.ts b/app/src/modules/settings/routes/data-model/field-detail/store.ts index ab8279a291..862bf975ad 100644 --- a/app/src/modules/settings/routes/data-model/field-detail/store.ts +++ b/app/src/modules/settings/routes/data-model/field-detail/store.ts @@ -64,7 +64,7 @@ function initLocalStore( return interfaces.value .filter((inter) => { // Filter out all system interfaces - if (inter.system !== undefined && inter.system === true) return false; + if (inter.system === true) return false; const matchesType = inter.types.includes(state.fieldData?.type || 'alias'); let matchesRelation = false; @@ -81,6 +81,8 @@ function initLocalStore( matchesRelation = inter.relationship === type; } + console.log(inter.id, matchesType, matchesRelation); + return matchesType && matchesRelation; }) .sort((a, b) => (a.name > b.name ? 1 : -1)); @@ -223,8 +225,8 @@ function initLocalStore( } if (type === 'o2m') { - delete state.fieldData.schema; - delete state.fieldData.type; + state.fieldData.schema = null; + state.fieldData.type = null; const syncNewCollectionsO2M = throttle(() => { const collectionName = state.relations[0].many_collection; @@ -319,8 +321,8 @@ function initLocalStore( } if (type === 'm2m' || type === 'files' || type === 'translations') { - delete state.fieldData.schema; - delete state.fieldData.type; + state.fieldData.schema = null; + state.fieldData.type = null; const syncNewCollectionsM2M = throttle(([junctionCollection, manyCurrent, manyRelated, relatedCollection]) => { state.newCollections = state.newCollections.filter( @@ -556,8 +558,8 @@ function initLocalStore( } if (type === 'presentation') { - delete state.fieldData.schema; - delete state.fieldData.type; + state.fieldData.schema = null; + state.fieldData.type = null; state.fieldData.meta.special = ['alias']; }