Skip to content
This repository has been archived by the owner on May 7, 2021. It is now read-only.

Commit

Permalink
fix(list): block unauthorized to reorder the workitem
Browse files Browse the repository at this point in the history
  • Loading branch information
vikram-raj authored and michaelkleinhenz committed Mar 27, 2017
1 parent 7295a25 commit a9d63be
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/app/toolbar-panel/toolbar-panel.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
Move
<span class="caret"></span>
</button>
<ul role="menu" aria-labelledby="wi_filter_dropdown" class="btn-move" dropdownMenu>
<ul role="menu" aria-labelledby="wi_filter_dropdown" class="btn-move" *ngIf="loggedIn" dropdownMenu>
<li>
<a role="menuitem" tabindex="-1" (click)="moveItem('top')">Move to Top</a>
</li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</div>
<div class="workItemList_entry" (click)="onSelect($event)">
<!--checkbox to select a WI and move it-->
<div class="row-cbh" title="Select the checkbox to move the item.">
<div class="row-cbh" title="Select the checkbox to move the item." *ngIf="loggedIn">
<input type="checkbox" [checked]="checkedWI" (click)="toggleEntry($event)" />
</div>
<!-- info area -->
Expand Down
6 changes: 5 additions & 1 deletion src/app/work-item/work-item-list/work-item-list.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export class WorkItemListComponent implements OnInit, AfterViewInit, DoCheck {

// See: https://angular2-tree.readme.io/docs/options
treeListOptions = {
allowDrag: true,
allowDrag: false,
getChildren: (node: TreeNode): any => {
return this.workItemService.getChildren(node.data);
},
Expand All @@ -104,6 +104,9 @@ export class WorkItemListComponent implements OnInit, AfterViewInit, DoCheck {
this.loggedIn = this.auth.isLoggedIn();
// console.log('ALL USER DATA', this.route.snapshot.data['allusers']);
// console.log('AUTH USER DATA', this.route.snapshot.data['authuser']);
if(this.loggedIn) {
this.treeListOptions['allowDrag'] = true;
}
this.spaceSubscription = this.spaces.current.subscribe(space => {
if (space) {
console.log('[WorkItemListComponent] New Space selected: ' + space.attributes.name);
Expand Down Expand Up @@ -237,6 +240,7 @@ export class WorkItemListComponent implements OnInit, AfterViewInit, DoCheck {
.subscribe(message => {
this.loggedIn = false;
this.authUser = null;
this.treeListOptions['allowDrag'] = false;
});
//Filters like assign to me should stack with the current filters
this.broadcaster.on<string>('item_filter')
Expand Down

0 comments on commit a9d63be

Please sign in to comment.