Skip to content

Commit

Permalink
Merge pull request #5377 from specify/issue-5376
Browse files Browse the repository at this point in the history
Disallow to add rank in create tree dialog
  • Loading branch information
CarolineDenis authored Nov 7, 2024
2 parents a75e847 + b3526a4 commit 7fe1b80
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,16 +113,16 @@ export function IntegratedRecordSelector({

const [isDialogOpen, handleOpenDialog, handleCloseDialog] = useBooleanState();

const isTaxonTreeDefItemTable =
collection.table.specifyTable.name === 'TaxonTreeDefItem';

const isAttachmentTable =
collection.table.specifyTable.name.includes('Attachment');

const isCOJO =
relationship.relatedTable.name === 'CollectionObjectGroupJoin' &&
relationship.name === 'children';

const isTaxonTreeDefItemTable =
collection.table.specifyTable.name === 'TaxonTreeDefItem';

return (
<ReadOnlyContext.Provider value={isReadOnly}>
<RecordSelectorFromCollection
Expand Down Expand Up @@ -202,7 +202,8 @@ export function IntegratedRecordSelector({
<DataEntry.Add
disabled={
isReadOnly ||
(isToOne && collection.models.length > 0)
(isToOne && collection.models.length > 0) ||
isTaxonTreeDefItemTable
}
onClick={(): void => {
focusFirstField();
Expand Down

0 comments on commit 7fe1b80

Please sign in to comment.