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

Secure buttons #584

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions manager2/src/app/admin/project/project.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<h4>Project <strong>{{project.id}}</strong></h4>
</div>
<div class="col-sm-3" >
<button class="p-button p-button-sm p-button-danger" (click)="delete_project()">Delete project</button>
<app-my-delete-confirm [onConfirm]="delete_project"></app-my-delete-confirm>
</div>
</div>
</div>
Expand Down Expand Up @@ -109,7 +109,7 @@ <h4>Project <strong>{{project.id}}</strong></h4>
</div>
<div class="col-sm-3">
<label style="opacity: 0;">Remove member</label>
<button type="button" class="p-button p-button-sm p-button-danger" (click)="remove_user()">Remove member</button>
<app-my-delete-confirm [onConfirm]="remove_user" button_disp="Remove member"></app-my-delete-confirm>
</div>
</div>
</form>
Expand Down
2 changes: 2 additions & 0 deletions manager2/src/app/admin/project/project.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ export class ProjectComponent implements OnInit {
}

ngOnInit() {
this.delete_project = this.delete_project.bind(this);
this.remove_user = this.remove_user.bind(this);
this.route.params
.subscribe(params => {
let projectId = params.id;
Expand Down
2 changes: 1 addition & 1 deletion manager2/src/app/admin/projects/projects.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ <h3>Pending projects</h3>
<td>
<div class="btn-group">
<button type="button" style="margin-right: 0px !important; " class="p-button p-button-sm p-button-info " (click)="modify_project(pending)">View</button>
<button type="button" style="margin-right: 0px !important; " class="p-button p-button-sm p-button-danger " (click)="reject_project(pending)">Reject</button>
<app-my-delete-confirm [onConfirm]="reject_project" [data]="pending" [explainMessage]="true" button_disp="Reject"></app-my-delete-confirm>
</div>
</td>
</tr>
Expand Down
1 change: 1 addition & 0 deletions manager2/src/app/admin/projects/projects.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ export class ProjectsComponent implements OnInit {
// TODO sort groups by name

ngOnInit() {
this.reject_project = this.reject_project.bind(this);
this.route.queryParams
.subscribe(params => {
if (params.deleted == "ok") {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="deleteConfirmation">
<div *ngIf="!isDeleting" >
<button type="button" class="p-button p-button-sm p-button-danger btn-xs" (click)="startDelete()"><i class="fa fa-trash-o"></i> Delete</button>
<button type="button" class="p-button p-button-sm p-button-danger btn-xs" (click)="startDelete()"><i class="fa fa-trash-o"></i>{{button_disp}}</button>
</div>
<div *ngIf="isDeleting">
<div *ngIf="explainMessage">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ export class MyDeleteConfirmComponent implements OnInit {
@Input()
explainMessage: boolean

@Input()
button_disp: string = "Delete"

constructor() { }

ngOnInit() {
Expand Down