@@ -28,6 +28,7 @@ import {
2828 AddContributorDialogComponent ,
2929 AddUnregisteredContributorDialogComponent ,
3030 ContributorsTableComponent ,
31+ RemoveContributorDialogComponent ,
3132 RequestAccessTableComponent ,
3233} from '@osf/shared/components/contributors' ;
3334import { SearchInputComponent } from '@osf/shared/components/search-input/search-input.component' ;
@@ -397,26 +398,37 @@ export class ContributorsComponent implements OnInit, OnDestroy {
397398 removeContributor ( contributor : ContributorModel ) {
398399 const isDeletingSelf = contributor . userId === this . currentUser ( ) ?. id ;
399400
400- this . customConfirmationService . confirmDelete ( {
401- headerKey : 'project.contributors.removeDialog.title' ,
402- messageKey : 'project.contributors.removeDialog.message' ,
403- messageParams : { name : contributor . fullName } ,
404- acceptLabelKey : 'common.buttons.remove' ,
405- onConfirm : ( ) => {
406- this . actions
407- . deleteContributor ( this . resourceId ( ) , this . resourceType ( ) , contributor . userId , isDeletingSelf )
408- . pipe ( takeUntilDestroyed ( this . destroyRef ) )
409- . subscribe ( ( ) => {
410- this . toastService . showSuccess ( 'project.contributors.removeDialog.successMessage' , {
411- name : contributor . fullName ,
412- } ) ;
401+ this . customDialogService
402+ . open ( RemoveContributorDialogComponent , {
403+ header : 'project.contributors.removeDialog.title' ,
404+ width : '448px' ,
405+ data : {
406+ messageKey : 'project.contributors.removeDialog.message' ,
407+ messageParams : { name : contributor . fullName } ,
408+ } ,
409+ } )
410+ . onClose . pipe (
411+ filter ( ( res ) => res !== undefined ) ,
412+ switchMap ( ( removeFromChildren : boolean ) =>
413+ this . actions . deleteContributor (
414+ this . resourceId ( ) ,
415+ this . resourceType ( ) ,
416+ contributor . userId ,
417+ isDeletingSelf ,
418+ removeFromChildren
419+ )
420+ ) ,
421+ takeUntilDestroyed ( this . destroyRef )
422+ )
423+ . subscribe ( ( ) => {
424+ this . toastService . showSuccess ( 'project.contributors.removeDialog.successMessage' , {
425+ name : contributor . fullName ,
426+ } ) ;
413427
414- if ( isDeletingSelf ) {
415- this . router . navigate ( [ '/' ] ) ;
416- }
417- } ) ;
418- } ,
419- } ) ;
428+ if ( isDeletingSelf ) {
429+ this . router . navigate ( [ '/' ] ) ;
430+ }
431+ } ) ;
420432 }
421433
422434 loadMoreContributors ( ) : void {
0 commit comments