From 6e35cd7b28be13781532a049fea7ced5dc3acfd7 Mon Sep 17 00:00:00 2001 From: Sharad S Date: Mon, 19 Aug 2024 12:48:42 -0400 Subject: [PATCH 1/8] hide cotype --- .../js_src/lib/components/SchemaConfig/Fields.tsx | 10 +++++++++- .../js_src/lib/components/Toolbar/QueryTablesEdit.tsx | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/specifyweb/frontend/js_src/lib/components/SchemaConfig/Fields.tsx b/specifyweb/frontend/js_src/lib/components/SchemaConfig/Fields.tsx index af860fcb76f..bbe118b1884 100644 --- a/specifyweb/frontend/js_src/lib/components/SchemaConfig/Fields.tsx +++ b/specifyweb/frontend/js_src/lib/components/SchemaConfig/Fields.tsx @@ -66,7 +66,15 @@ export function SchemaConfigFields({ {relationships.length > 0 && ( - + name !== 'collectionObjectType' + ) + : relationships + } + /> )} diff --git a/specifyweb/frontend/js_src/lib/components/Toolbar/QueryTablesEdit.tsx b/specifyweb/frontend/js_src/lib/components/Toolbar/QueryTablesEdit.tsx index 9f9b5dd3070..2278b09a498 100644 --- a/specifyweb/frontend/js_src/lib/components/Toolbar/QueryTablesEdit.tsx +++ b/specifyweb/frontend/js_src/lib/components/Toolbar/QueryTablesEdit.tsx @@ -39,6 +39,7 @@ export function QueryTablesEdit({ } // TODO: temp fix, remove this, use to hide geo tables for COG until 9.8 release export const HIDDEN_GEO_TABLES = new Set([ + 'CollectionObjectType', 'CollectionObjectGroup', 'CollectionObjectGroupJoin', 'CollectionObjectGroupType', From 0ab85ef9c94d16cdc0c3723f4ffecfafd8b71953 Mon Sep 17 00:00:00 2001 From: Sharad S Date: Mon, 19 Aug 2024 17:22:16 -0400 Subject: [PATCH 2/8] hide cotype in mapper relationships --- .../js_src/lib/components/WbPlanView/LineComponents.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/specifyweb/frontend/js_src/lib/components/WbPlanView/LineComponents.tsx b/specifyweb/frontend/js_src/lib/components/WbPlanView/LineComponents.tsx index 2036c74d3ba..df5aceaf43f 100644 --- a/specifyweb/frontend/js_src/lib/components/WbPlanView/LineComponents.tsx +++ b/specifyweb/frontend/js_src/lib/components/WbPlanView/LineComponents.tsx @@ -228,7 +228,8 @@ export function MappingElement({ fieldsData, ...props }: MappingElementProps): JSX.Element { - const fieldGroups = Object.entries(fieldsData).reduce< + const { collectionObjectType, ...rest } = fieldsData; + const fieldGroups = Object.entries(rest).reduce< R> >((fieldGroups, [fieldName, fieldData]) => { const groupName = getFieldGroupName( From c251b0336f4e7c1a1839f85ecd90a7952d0f584d Mon Sep 17 00:00:00 2001 From: Sharad S Date: Tue, 20 Aug 2024 12:21:00 -0400 Subject: [PATCH 3/8] hide cotype in schema override --- .../js_src/lib/components/DataModel/schemaOverrides.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/specifyweb/frontend/js_src/lib/components/DataModel/schemaOverrides.ts b/specifyweb/frontend/js_src/lib/components/DataModel/schemaOverrides.ts index 27400e4fb62..98f49dc4a6d 100644 --- a/specifyweb/frontend/js_src/lib/components/DataModel/schemaOverrides.ts +++ b/specifyweb/frontend/js_src/lib/components/DataModel/schemaOverrides.ts @@ -193,6 +193,9 @@ const globalFieldOverrides: { LithoStratTreeDefItem: { fullNameSeparator: { whiteSpaceSensitive: true }, }, + CollectionObject: { + collectionObjectType: { visibility: 'hidden' } + } }; /* From 8f53c6e64f018fa1177daa5003b598778dd4f62f Mon Sep 17 00:00:00 2001 From: Sharad S Date: Tue, 20 Aug 2024 12:33:28 -0400 Subject: [PATCH 4/8] Revert "hide cotype in schema override" This reverts commit c251b0336f4e7c1a1839f85ecd90a7952d0f584d. --- .../js_src/lib/components/DataModel/schemaOverrides.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/specifyweb/frontend/js_src/lib/components/DataModel/schemaOverrides.ts b/specifyweb/frontend/js_src/lib/components/DataModel/schemaOverrides.ts index 98f49dc4a6d..27400e4fb62 100644 --- a/specifyweb/frontend/js_src/lib/components/DataModel/schemaOverrides.ts +++ b/specifyweb/frontend/js_src/lib/components/DataModel/schemaOverrides.ts @@ -193,9 +193,6 @@ const globalFieldOverrides: { LithoStratTreeDefItem: { fullNameSeparator: { whiteSpaceSensitive: true }, }, - CollectionObject: { - collectionObjectType: { visibility: 'hidden' } - } }; /* From 98d0aaa5790a0d1407e9e886002037c70524c360 Mon Sep 17 00:00:00 2001 From: Sharad S Date: Wed, 21 Aug 2024 17:56:36 -0400 Subject: [PATCH 5/8] add todo --- .../frontend/js_src/lib/components/Toolbar/QueryTablesEdit.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/specifyweb/frontend/js_src/lib/components/Toolbar/QueryTablesEdit.tsx b/specifyweb/frontend/js_src/lib/components/Toolbar/QueryTablesEdit.tsx index 2278b09a498..560c8221689 100644 --- a/specifyweb/frontend/js_src/lib/components/Toolbar/QueryTablesEdit.tsx +++ b/specifyweb/frontend/js_src/lib/components/Toolbar/QueryTablesEdit.tsx @@ -38,6 +38,7 @@ export function QueryTablesEdit({ ); } // TODO: temp fix, remove this, use to hide geo tables for COG until 9.8 release +// TODO: Revert #5236 to unhide COType export const HIDDEN_GEO_TABLES = new Set([ 'CollectionObjectType', 'CollectionObjectGroup', From b5e5cea96c1cac316ded4621d218d689892099bc Mon Sep 17 00:00:00 2001 From: Sharad S Date: Wed, 21 Aug 2024 22:15:16 +0000 Subject: [PATCH 6/8] Lint code with ESLint and Prettier Triggered by 98d0aaa5790a0d1407e9e886002037c70524c360 on branch refs/heads/issue-5222 --- .../js_src/lib/components/Toolbar/QueryTablesEdit.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/specifyweb/frontend/js_src/lib/components/Toolbar/QueryTablesEdit.tsx b/specifyweb/frontend/js_src/lib/components/Toolbar/QueryTablesEdit.tsx index 560c8221689..613975104d3 100644 --- a/specifyweb/frontend/js_src/lib/components/Toolbar/QueryTablesEdit.tsx +++ b/specifyweb/frontend/js_src/lib/components/Toolbar/QueryTablesEdit.tsx @@ -37,8 +37,10 @@ export function QueryTablesEdit({ /> ); } -// TODO: temp fix, remove this, use to hide geo tables for COG until 9.8 release -// TODO: Revert #5236 to unhide COType +/* + * TODO: temp fix, remove this, use to hide geo tables for COG until 9.8 release + * TODO: Revert #5236 to unhide COType + */ export const HIDDEN_GEO_TABLES = new Set([ 'CollectionObjectType', 'CollectionObjectGroup', From a409aef794cb5d1067fed2aece3d508093b30dc1 Mon Sep 17 00:00:00 2001 From: Sharad S Date: Mon, 26 Aug 2024 10:37:32 -0400 Subject: [PATCH 7/8] hide cotype in unique fields picklist --- .../js_src/lib/components/SchemaConfig/TableUniquenessRules.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specifyweb/frontend/js_src/lib/components/SchemaConfig/TableUniquenessRules.tsx b/specifyweb/frontend/js_src/lib/components/SchemaConfig/TableUniquenessRules.tsx index 8b6d783d5ee..9ac8cc88eb0 100644 --- a/specifyweb/frontend/js_src/lib/components/SchemaConfig/TableUniquenessRules.tsx +++ b/specifyweb/frontend/js_src/lib/components/SchemaConfig/TableUniquenessRules.tsx @@ -71,7 +71,7 @@ export function TableUniquenessRules(): JSX.Element { (relationship) => (['many-to-one', 'one-to-one'] as RA).includes( relationship.type - ) && !relationship.isVirtual + ) && !relationship.isVirtual && relationship.name !== 'collectionObjectType' ), [table] ); From 40492c315533301607c64aef28bcda3ddefbf888 Mon Sep 17 00:00:00 2001 From: Sharad S Date: Mon, 26 Aug 2024 14:41:19 +0000 Subject: [PATCH 8/8] Lint code with ESLint and Prettier Triggered by a409aef794cb5d1067fed2aece3d508093b30dc1 on branch refs/heads/issue-5222 --- .../lib/components/SchemaConfig/TableUniquenessRules.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/specifyweb/frontend/js_src/lib/components/SchemaConfig/TableUniquenessRules.tsx b/specifyweb/frontend/js_src/lib/components/SchemaConfig/TableUniquenessRules.tsx index 9ac8cc88eb0..b2334201c4e 100644 --- a/specifyweb/frontend/js_src/lib/components/SchemaConfig/TableUniquenessRules.tsx +++ b/specifyweb/frontend/js_src/lib/components/SchemaConfig/TableUniquenessRules.tsx @@ -71,7 +71,9 @@ export function TableUniquenessRules(): JSX.Element { (relationship) => (['many-to-one', 'one-to-one'] as RA).includes( relationship.type - ) && !relationship.isVirtual && relationship.name !== 'collectionObjectType' + ) && + !relationship.isVirtual && + relationship.name !== 'collectionObjectType' ), [table] );