diff --git a/fronts-client/src/components/FrontsEdit/Collection.tsx b/fronts-client/src/components/FrontsEdit/Collection.tsx index 0f5d1adda9..97c456ca2c 100644 --- a/fronts-client/src/components/FrontsEdit/Collection.tsx +++ b/fronts-client/src/components/FrontsEdit/Collection.tsx @@ -163,8 +163,6 @@ class CollectionContext extends React.Component isUneditable={isUneditable} groupId={group.uuid} groupName={group.name ? group.name : ''} - //todo: numberOfCards can probably just be got by the card array - numberOfCardsInGroup={group.cards.length} groupsIds={groupsIds} onMove={handleMove} onDrop={handleInsert} @@ -200,7 +198,6 @@ class CollectionContext extends React.Component isUneditable={isUneditable} cardId={card.uuid} groupName={group.name ? group.name : ''} - numberOfCardsInGroup={group.cards.length} groupsIds={groupsIds} onMove={handleMove} onDrop={handleInsert} diff --git a/fronts-client/src/components/FrontsEdit/FrontContent.tsx b/fronts-client/src/components/FrontsEdit/FrontContent.tsx index 229ef5716a..946d5b2b36 100644 --- a/fronts-client/src/components/FrontsEdit/FrontContent.tsx +++ b/fronts-client/src/components/FrontsEdit/FrontContent.tsx @@ -179,7 +179,7 @@ class FrontContent extends React.Component { } public handleMove = (move: Move) => { - const numberOfArticlesAlreadyInGroup = move.to.numberOfCardsInGroup; + const numberOfArticlesAlreadyInGroup = move.to.cards?.length; // if we are inserting an article into any group that is not the splash, then we just insert if (move.to.groupName !== 'splash') { @@ -262,7 +262,7 @@ class FrontContent extends React.Component { }; public handleInsert = (e: React.DragEvent, to: PosSpec) => { - const numberOfArticlesAlreadyInGroup = to.numberOfCardsInGroup; + const numberOfArticlesAlreadyInGroup = to.cards?.length; // if we are inserting an article into any group that is not the splash, then we just insert if (to.groupName !== 'splash') { diff --git a/fronts-client/src/components/clipboard/CardLevel.tsx b/fronts-client/src/components/clipboard/CardLevel.tsx index b6d8b1946c..7520d89b8d 100644 --- a/fronts-client/src/components/clipboard/CardLevel.tsx +++ b/fronts-client/src/components/clipboard/CardLevel.tsx @@ -21,7 +21,6 @@ interface OuterProps { dropMessage?: string; cardTypeAllowList?: CardTypes[]; groupName?: string; - numberOfCardsInGroup?: number; groupsIds?: string[]; } @@ -53,7 +52,6 @@ const CardLevel = ({ dropMessage, cardTypeAllowList, groupName, - numberOfCardsInGroup, groupsIds, }: Props) => ( ( { parentId: string; parentType: string; groupName?: string; - numberOfCardsInGroup?: number; groupsIds?: string[]; type: string; getDropType?: (item: T) => string; @@ -186,7 +184,6 @@ class Level extends React.Component, State> { type: this.props.parentType, id: this.props.parentId, groupName: this.props.groupName, - numberOfCardsInGroup: this.props.numberOfCardsInGroup, groupsIds: this.props.groupsIds, cards: this.props.arr, }; diff --git a/fronts-client/src/lib/dnd/__tests__/dnd.spec.tsx b/fronts-client/src/lib/dnd/__tests__/dnd.spec.tsx index 41d4f6ada1..524085da9a 100644 --- a/fronts-client/src/lib/dnd/__tests__/dnd.spec.tsx +++ b/fronts-client/src/lib/dnd/__tests__/dnd.spec.tsx @@ -116,7 +116,6 @@ describe('Curation', () => { groupsIds: undefined, id: '2', index: 1, - numberOfCardsInGroup: undefined, type: 'a', }, }); @@ -178,7 +177,6 @@ describe('Curation', () => { groupsIds: undefined, id: '2', index: 0, - numberOfCardsInGroup: undefined, type: 'a', }, }); @@ -295,7 +293,6 @@ describe('Curation', () => { groupsIds: undefined, id: '2', index: 1, - numberOfCardsInGroup: undefined, type: 'a', }); }); diff --git a/fronts-client/src/util/collectionUtils.ts b/fronts-client/src/util/collectionUtils.ts index b910106d21..60cba848d0 100644 --- a/fronts-client/src/util/collectionUtils.ts +++ b/fronts-client/src/util/collectionUtils.ts @@ -64,7 +64,6 @@ export type InsertDropType = keyof typeof dropToCardMap; const dropToCard = (e: React.DragEvent): MappableDropType | null => { for (const [type, fn] of Object.entries(dropToCardMap)) { const data = e.dataTransfer.getData(type); - if (data) { return fn(data); }