@@ -41,7 +41,6 @@ import validateAndSubmitConnectionString from 'lib/validateAndSubmitConnectionSt
41
41
import { cost , features } from 'dashboard/Settings/GeneralSettings.scss' ;
42
42
import { get } from 'lib/AJAX' ;
43
43
import { Link } from 'react-router' ;
44
- import lodash from 'lodash'
45
44
46
45
const DEFAULT_SETTINGS_LABEL_WIDTH = 55 ;
47
46
@@ -514,8 +513,7 @@ export default class GeneralSettings extends DashboardView {
514
513
let removedCollaborators = setDifference ( initialFields . collaborators , allCollabs , compareCollaborators ) ;
515
514
if ( addedCollaborators . length === 0 && removedCollaborators . length === 0 ) {
516
515
//If there isn't a added or removed collaborator verify if there is a edited one.
517
- let editedCollaborators = verifyEditedCollaborators ( allCollabs , initialFields . collaborators ) ;
518
- console . log ( 'setCollaborators' , allCollabs , initialFields . collaborators )
516
+ let editedCollaborators = verifyEditedCollaborators ( allCollabs ) ;
519
517
if ( editedCollaborators . length === 0 ) {
520
518
//This is neccessary because the footer computes whether or not show a change by reference equality.
521
519
allCollabs = initialFields . collaborators ;
@@ -550,7 +548,7 @@ export default class GeneralSettings extends DashboardView {
550
548
promiseList . push ( this . context . currentApp . removeCollaboratorById ( id ) ) ;
551
549
} ) ;
552
550
553
- let editedCollaborators = verifyEditedCollaborators ( changes . collaborators , initialFields . collaborators ) ;
551
+ let editedCollaborators = verifyEditedCollaborators ( changes . collaborators ) ;
554
552
editedCollaborators . forEach ( ( { id, featuresPermission } ) => {
555
553
promiseList . push ( this . context . currentApp . editCollaboratorById ( id , featuresPermission ) ) ;
556
554
} ) ;
@@ -668,19 +666,11 @@ export default class GeneralSettings extends DashboardView {
668
666
}
669
667
670
668
let compareCollaborators = ( collab1 , collab2 ) => ( collab1 . userEmail === collab2 . userEmail ) ;
671
- let verifyEditedCollaborators = ( modified , initial ) => {
669
+ let verifyEditedCollaborators = ( modified ) => {
672
670
let editedCollabs = [ ]
673
- if ( modified . length === initial . length )
674
- modified . forEach ( ( modifiedCollab ) => {
675
- initial . forEach ( ( initialCollab ) => {
676
- console . log ( 'verifyEditedCollaborators step' , modifiedCollab , initialCollab ) ;
677
- //if (modifiedCollab.userEmail === initialCollab.userEmail &&
678
- // !lodash.isEqual(modifiedCollab, initialCollab))
679
- if ( modifiedCollab . isEdited )
680
- editedCollabs . push ( modifiedCollab ) ;
681
- } )
682
- } )
683
- console . log ( 'editedCollabs' , editedCollabs )
671
+ modified . forEach ( ( modifiedCollab ) => {
672
+ if ( modifiedCollab . isEdited ) editedCollabs . push ( modifiedCollab ) ;
673
+ } )
684
674
return editedCollabs ;
685
675
}
686
676
0 commit comments