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

Commit

Permalink
fix(details): change all the paths to 'details' to be relative
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuawilson committed Mar 5, 2017
1 parent bc6ed50 commit 2dee1b0
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<li><a class="workItemList_MoveTop">Move to Top</a></li>
<li><a class="workItemList_MoveBottom">Move to Bottom</a></li>
<li class="divider" role="presentation"></li>
<li><a class="workItemList_Open" href="/work-item/list/detail/429">Open</a></li>
<li><a class="workItemList_Open" href="./detail/429">Open</a></li>
<li><a class="workItemList_Delete">Delete</a></li>
<li><a class="workItemList_Backlog">Move to Backlog</a></li>
</ul>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,8 @@ describe('Comment section for the work item detailed view - ', () => {
imports: [
FormsModule,
RouterTestingModule.withRoutes([
{ path: 'work-item/list/detail/1', component: WorkItemDetailComponent }
// this needs to be a relative path but I don't know how to do that in a test
{ path: './detail/1', component: WorkItemDetailComponent }
]),
CollapseModule,
CommonModule,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,8 @@ describe('Detailed view and edit a selected work item - ', () => {
imports: [
FormsModule,
RouterTestingModule.withRoutes([
{ path: 'work-item/list/detail/1', component: WorkItemDetailComponent }
// this needs to be a relative path but I don't know how to do that in a test
{ path: './detail/1', component: WorkItemDetailComponent }
]),
CollapseModule,
CommonModule,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ export class WorkItemDetailComponent implements OnInit, AfterViewInit {
this.workItemService
.create(this.workItem)
.then((workItem) => {
this.router.navigate(['/work-item/list/detail/' + workItem.id]);
this.router.navigate(['./detail/' + workItem.id], { relativeTo: this.route });
});
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,8 @@
// imports: [
// Ng2CompleterModule,
// RouterTestingModule.withRoutes([
// {path: 'work-item/list/detail/1', component: WorkItemLinkComponent}
// // this needs to be a relative path but I don't know how to do that in a test
// {path: './detail/1', component: WorkItemLinkComponent}
// ]),
// ],

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
<li role="presentation" class="divider"></li>
<li><a class="workItemList_Iteration" (click)="associateIterationModal.open()">Associate with Iteration...</a></li>
<li role="presentation" class="divider"></li>
<li><a [routerLink]="['/work-item/list/detail/' + workItem.id]" class="workItemList_Open">Open</a></li>
<li><a [routerLink]="['./detail/' + workItem.id]" class="workItemList_Open">Open</a></li>
<li><a class="workItemList_Delete" (click)="confirmDelete($event)">Delete</a></li>
<li><a class="workItemList_Backlog" (click)="onMoveToBacklog($event)">Move to Backlog</a></li>
</ul>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Component, EventEmitter, Input, OnInit, Output, ViewEncapsulation } from '@angular/core';
import { Router } from '@angular/router';
import { Router, ActivatedRoute } from '@angular/router';

import {
AuthenticationService,
Expand Down Expand Up @@ -55,6 +55,7 @@ export class WorkItemListEntryComponent implements OnInit {

constructor(private auth: AuthenticationService,
private broadcaster: Broadcaster,
private route: ActivatedRoute,
private router: Router,
private workItemService: WorkItemService,
private logger: Logger) {}
Expand Down Expand Up @@ -145,7 +146,7 @@ export class WorkItemListEntryComponent implements OnInit {
onDetail(event: MouseEvent): void {
event.stopPropagation();
this.detailEvent.emit(this);
this.router.navigate(['/work-item/list/detail/' + this.workItem.id]);
this.router.navigate(['./detail/' + this.workItem.id], { relativeTo: this.route });
}

onMoveToTop(event: MouseEvent): void {
Expand Down

0 comments on commit 2dee1b0

Please sign in to comment.