Skip to content

Commit

Permalink
adding 'resolveall' method to api (#1473)
Browse files Browse the repository at this point in the history
* adding 'resolveall' method to api

* added mapId data obj w/in `resolveAllConflicts()` to `api.js`

* updating api and conflicts

* removing feature highlight from reviews

* updated removal of conflict review table

* resolveAllConflicts api call no longer async

* adding alert for errors when handling resolveall

* making requested changes

* rename function, conflicts is used interchangeably with review

throughout the code and docs, but really is not the same
so change it where we update things
  • Loading branch information
jackgrossman18 authored and brianhatchl committed Jul 10, 2019
1 parent eba8740 commit 793402b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
19 changes: 19 additions & 0 deletions modules/Hoot/managers/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,25 @@ export default class API {
.then( resp => resp.data );
}

resolveAllReviews(mapId) {
const params = {
path: '/job/review/resolveall',
method: 'PUT',
data: {mapId: mapId}
};

return this.request( params )
.then( resp => {
if (resp.status !== 200) {
let alert = {
message: 'Failed to resolve all conflicts in review.',
type: 'warn'
};
Hoot.message.alert( alert );
}
});
}

/**
* Get next review item in current conflicts review process
*
Expand Down
6 changes: 5 additions & 1 deletion modules/Hoot/ui/conflicts/resolve.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,11 @@ export default class Resolve {
this.performAcceptAll( layer );
} );
} else {
this.performAcceptAll( layer );
Hoot.api.resolveAllReviews(layer.id)
.then ( () => {
Hoot.ui.conflicts.deactivate();
this.performAcceptAll( layer );
});
}
}

Expand Down

0 comments on commit 793402b

Please sign in to comment.