Skip to content

Commit

Permalink
Merge pull request #5236 from specify/issue-5222
Browse files Browse the repository at this point in the history
Hide CollectionObjectType on the frontend
  • Loading branch information
sharadsw authored Aug 27, 2024
2 parents 226b78e + 8164bf7 commit d58797e
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,15 @@ export function SchemaConfigFields({

{relationships.length > 0 && (
<optgroup label={schemaText.relationships()}>
<SchemaConfigFieldsList fields={relationships} />
<SchemaConfigFieldsList
fields={
table.name === 'CollectionObject'
? relationships.filter(
({ name }) => name !== 'collectionObjectType'
)
: relationships
}
/>
</optgroup>
)}
</Select>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ export function TableUniquenessRules(): JSX.Element {
(relationship) =>
(['many-to-one', 'one-to-one'] as RA<RelationshipType>).includes(
relationship.type
) && !relationship.isVirtual
) &&
!relationship.isVirtual &&
relationship.name !== 'collectionObjectType'
),
[table]
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,12 @@ export function QueryTablesEdit({
/>
);
}
// TODO: temp fix, remove this, use to hide geo tables for COG until 9.8 release
/*
* 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',
'CollectionObjectGroupJoin',
'CollectionObjectGroupType',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<R<CustomSelectElementOptionProps>>
>((fieldGroups, [fieldName, fieldData]) => {
const groupName = getFieldGroupName(
Expand Down

0 comments on commit d58797e

Please sign in to comment.