Skip to content

Commit

Permalink
Rename sample-browse to sample-manager
Browse files Browse the repository at this point in the history
As it now contains all the functionality not just the browse sample link

Issue: IBP-2078 / IBP-2302
Reviewer: None
  • Loading branch information
nahuel-soldevilla committed Jan 16, 2019
1 parent 18d515d commit 309522c
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ export * from './sample.service';
export * from './sample-dialog.component';
export * from './sample-delete-dialog.component';
export * from './sample-detail.component';
export * from './sample-browse.component';
export * from './sample-manager.component';
export * from './sample.component';
export * from './sample.route';
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import {SampleContext} from './sample.context';
declare const cropName: string;

@Component({
selector: 'jhi-sample-browse',
templateUrl: './sample-browse.component.html',
selector: 'jhi-sample-manager',
templateUrl: './sample-manager.component.html',
styles: []
})
export class SampleBrowseComponent implements OnInit, OnDestroy {
export class SampleManagerComponent implements OnInit, OnDestroy {

private listId: number;
private crop: string;
Expand Down Expand Up @@ -77,7 +77,7 @@ export class SampleBrowseComponent implements OnInit, OnDestroy {

private navigate(listId: any) {
this.listId = listId;
this.router.navigate(['/sample-browse'], {queryParams: {
this.router.navigate(['/sample-manager'], {queryParams: {
listId: this.listId
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export class SampleSearchListComponent {

selectList(selectedSampleList: SampleList) {
this.selectedListId = selectedSampleList.id;
this.router.navigate(['/sample-browse'], {queryParams: {
this.router.navigate(['/sample-manager'], {queryParams: {
listId: this.selectedListId
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export class SampleComponent implements OnInit, OnDestroy {
clear() {
this.page = 0;
this.currentSearch = '';
this.router.navigate(['/sample-browse', {
this.router.navigate(['/sample-manager', {
page: this.page,
sort: this.predicate + ',' + (this.reverse ? 'asc' : 'desc')
}]);
Expand All @@ -125,7 +125,7 @@ export class SampleComponent implements OnInit, OnDestroy {
}
this.page = 0;
this.currentSearch = query;
this.router.navigate(['/sample-browse', {
this.router.navigate(['/sample-manager', {
search: this.currentSearch,
page: this.page,
sort: this.predicate + ',' + (this.reverse ? 'asc' : 'desc')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
sampleRoute,
samplePopupRoute,
SampleResolvePagingParams,
SampleBrowseComponent
SampleManagerComponent
} from './';

import {SampleSearchListComponent} from './sample-search-list.component';
Expand Down Expand Up @@ -44,7 +44,7 @@ const ENTITY_STATES = [
SampleDeleteDialogComponent,
SamplePopupComponent,
SampleDeletePopupComponent,
SampleBrowseComponent,
SampleManagerComponent,
SampleSearchListComponent,
SampleImportPlateComponent,
SampleImportPlateMappingComponent,
Expand All @@ -56,7 +56,7 @@ const ENTITY_STATES = [
SamplePopupComponent,
SampleDeleteDialogComponent,
SampleDeletePopupComponent,
SampleBrowseComponent,
SampleManagerComponent,
SampleImportPlateComponent,
SampleImportPlateMappingComponent,
ModalComponent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Injectable } from '@angular/core';
import { Resolve, ActivatedRouteSnapshot, RouterStateSnapshot, Routes } from '@angular/router';
import { JhiPaginationUtil } from 'ng-jhipster';

import { SampleComponent, SampleBrowseComponent } from './';
import { SampleComponent, SampleManagerComponent } from './';
import { SampleDetailComponent } from './sample-detail.component';
import { SamplePopupComponent } from './sample-dialog.component';
import { SampleDeletePopupComponent } from './sample-delete-dialog.component';
Expand All @@ -25,8 +25,8 @@ export class SampleResolvePagingParams implements Resolve<any> {

export const sampleRoute: Routes = [
{
path: 'sample-browse',
component: SampleBrowseComponent,
path: 'sample-manager',
component: SampleManagerComponent,
resolve: {
'pagingParams': SampleResolvePagingParams
},
Expand Down
2 changes: 1 addition & 1 deletion src/main/jhipster/src/main/webapp/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ <h1>You must enable javascript to view this page.</h1>

if (window.location.hash.indexOf('listId') < 0) {
// TODO merge with page params?
window.location.hash = "sample-browse?listId=" + id;
window.location.hash = "sample-manager?listId=" + id;
} else {
window.location.hash = window.location.hash.replace(/listId=[0-9]*/, "listId=" + id);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ describe('Component Tests', () => {
const selectedSampleList = new SampleList(1, 'listName', '', false, []);
comp.selectList(selectedSampleList);

expect(router.navigate).toHaveBeenCalledWith([ '/sample-browse' ], Object({ queryParams: Object({ listId: 1 }) }));
expect(router.navigate).toHaveBeenCalledWith([ '/sample-manager' ], Object({ queryParams: Object({ listId: 1 }) }));

});

Expand Down

0 comments on commit 309522c

Please sign in to comment.