-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2324 from zetkin/release-241101
241101 Release
- Loading branch information
Showing
26 changed files
with
400 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { FC } from 'react'; | ||
import React from 'react'; | ||
|
||
import MergeModal from './MergeModal'; | ||
import { ZetkinPerson } from 'utils/types/zetkin'; | ||
import useMergePersons from '../hooks/useMergePersons'; | ||
import { useNumericRouteParams } from 'core/hooks'; | ||
|
||
interface Props { | ||
initialPersons: ZetkinPerson[]; | ||
onClose: () => void; | ||
open: boolean; | ||
} | ||
|
||
const ManualMergingModal: FC<Props> = ({ initialPersons, open, onClose }) => { | ||
const { orgId } = useNumericRouteParams(); | ||
const mergePersons = useMergePersons(orgId); | ||
|
||
return ( | ||
<MergeModal | ||
initiallyShowManualSearch | ||
onClose={onClose} | ||
onMerge={(personIds, overrides) => { | ||
mergePersons(personIds, overrides); | ||
onClose(); | ||
}} | ||
open={open} | ||
persons={initialPersons} | ||
/> | ||
); | ||
}; | ||
|
||
export default ManualMergingModal; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
src/features/duplicates/components/PotentialDuplicateModal.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { FC } from 'react'; | ||
import React from 'react'; | ||
|
||
import { PotentialDuplicate } from '../store'; | ||
import useDuplicatesMutations from '../hooks/useDuplicatesMutations'; | ||
import { useNumericRouteParams } from 'core/hooks'; | ||
import MergeModal from './MergeModal'; | ||
|
||
interface Props { | ||
onClose: () => void; | ||
open: boolean; | ||
potentialDuplicate: PotentialDuplicate; | ||
} | ||
|
||
const PotentialDuplicateModal: FC<Props> = ({ | ||
potentialDuplicate, | ||
open, | ||
onClose, | ||
}) => { | ||
const { orgId } = useNumericRouteParams(); | ||
const { mergeDuplicate } = useDuplicatesMutations(orgId); | ||
|
||
return ( | ||
<MergeModal | ||
onClose={onClose} | ||
onMerge={(personIds, overrides) => { | ||
mergeDuplicate(potentialDuplicate.id, personIds, overrides); | ||
}} | ||
open={open} | ||
persons={potentialDuplicate.duplicates} | ||
/> | ||
); | ||
}; | ||
|
||
export default PotentialDuplicateModal; |
Oops, something went wrong.