Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

task/DES-2698: Support removing members from Other type projects in the pipeline. #1171

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ class PipelineTeamCtrl {
this.team.forEach((t, index) => {
t.order = index;
});
this.teamCopy = JSON.parse(JSON.stringify(this.team))
});

this.projectResource = this.httpi.resource('/api/projects/:uuid/').setKeepTrailingSlash(true);
Expand Down Expand Up @@ -81,7 +82,12 @@ class PipelineTeamCtrl {
return projectData;
}

resetTeam() {
this.team = this.teamCopy;
}

saveTeam() {
if (this.team.length === 0 ) return;
this.saved = false;
var prj = this.data();
this.projectResource.post({ data: prj }).then((resp) => {
Expand All @@ -90,6 +96,12 @@ class PipelineTeamCtrl {
});
}

deleteSelected() {
this.team = this.team.filter(u => u.order !== this.selectedMember.order)
.map(u => ({...u, order: u.order > this.selectedMember.order ? u.order - 1 : u.order}));
this.selectedMember = ''
}

orderMembers(up) {
this.saved = false;
var a;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,15 @@ <h5 style="font-family: Helvetica Neue">Citation Preview</h5>
<td class="tg-0lax">
<div ng-repeat="member in $ctrl.team | orderBy: 'order'">
<input type="radio" name="member" format="lname" ng-model="$ctrl.selectedMember" ng-value="member">
{{ member.lname }}, {{ member.fname }}
{{ member.lname }}, {{ member.fname }}
<button class="btn btn-danger btn-xs"
ng-if="member.order === $ctrl.selectedMember.order"
ng-click="$ctrl.deleteSelected()">
<i role="none" class="fa fa-times"></i>
</button>
</div>
<button class="btn btn-small btn-primary" ng-click="$ctrl.resetTeam()" style="margin-top: 10px">Reset Authors</button>

</td>
<td class="tg-0lax">
<i role="none" class="fa fa-arrow-circle-up fa-2x" ng-click="$ctrl.orderMembers(true)"></i>
Expand Down
Loading