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

Commit

Permalink
fix(workitemdetail): states are now fetched from the workitem itself.
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelkleinhenz committed Mar 6, 2017
1 parent dc1acb9 commit 6595984
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@ <h2 *ngIf="loggedIn" id="wi-detail-title-click" class="detail-title truncate">{{
<span *ngIf="loggedIn" class="caret pull-right"></span>
</button>
<ul *ngIf="loggedIn" id="wi-status-dropdown" class="dropdown-menu-right dropdown-ul" role="menu" dropdownMenu>
<li class="dropdown-li" *ngFor="let state of workItemStates;" (click)="onChangeState(state.option)">
<li class="dropdown-li" *ngFor="let state of workItem.relationalData.wiType.attributes.fields['system.state'].type.values;" (click)="onChangeState(state)">
<a>
<span class='dropdown-icon' almIcon [iconType]="state.option"></span>
<span class='dropdown-text'>{{state.option}}</span>
<span class='dropdown-icon' almIcon [iconType]="state"></span>
<span class='dropdown-text'>{{state}}</span>
</a>
</li>
</ul>
Expand Down
16 changes: 0 additions & 16 deletions src/app/work-item/work-item-detail/work-item-detail.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ export class WorkItemDetailComponent implements OnInit, AfterViewInit {

workItem: WorkItem;
workItemTypes: WorkItemType[];
// TODO: These should be read from the WorkitemType of the given Workitem
workItemStates: Object[];

showDialog: boolean = false;

Expand Down Expand Up @@ -116,7 +114,6 @@ export class WorkItemDetailComponent implements OnInit, AfterViewInit {
// console.log('ALL USER DATA', this.route.snapshot.data['allusers']);
// console.log('AUTH USER DATA', this.route.snapshot.data['authuser']);
this.listenToEvents();
this.getWorkItemTypesandStates();
this.getIterations();
this.loggedIn = this.auth.isLoggedIn();
this.route.params.forEach((params: Params) => {
Expand Down Expand Up @@ -293,19 +290,6 @@ export class WorkItemDetailComponent implements OnInit, AfterViewInit {
this.descEditable = false;
}

getWorkItemTypesandStates(): void {
this.workItemService.getWorkItemTypes()
.then((types) => {
this.workItemTypes = types;
})
.then(() => {
this.workItemService.getStatusOptions()
.then((options) => {
this.workItemStates = options;
});
});
}

getIterations() {
this.iterationService.getIterations()
.then((iteration: IterationModel[]) => {
Expand Down

0 comments on commit 6595984

Please sign in to comment.