From 309522c4b80c29b3ffb020e9440f54b1a80de588 Mon Sep 17 00:00:00 2001 From: Nahuel Soldevilla Date: Wed, 16 Jan 2019 13:15:56 -0300 Subject: [PATCH] Rename sample-browse to sample-manager As it now contains all the functionality not just the browse sample link Issue: IBP-2078 / IBP-2302 Reviewer: None --- .../jhipster/src/main/webapp/app/entities/sample/index.ts | 2 +- ...rowse.component.html => sample-manager.component.html} | 0 ...le-browse.component.ts => sample-manager.component.ts} | 8 ++++---- .../app/entities/sample/sample-search-list.component.ts | 2 +- .../main/webapp/app/entities/sample/sample.component.ts | 4 ++-- .../src/main/webapp/app/entities/sample/sample.module.ts | 6 +++--- .../src/main/webapp/app/entities/sample/sample.route.ts | 6 +++--- src/main/jhipster/src/main/webapp/index.html | 2 +- .../entities/sample/sample-search-list.component.spec.ts | 2 +- 9 files changed, 16 insertions(+), 16 deletions(-) rename src/main/jhipster/src/main/webapp/app/entities/sample/{sample-browse.component.html => sample-manager.component.html} (100%) rename src/main/jhipster/src/main/webapp/app/entities/sample/{sample-browse.component.ts => sample-manager.component.ts} (92%) diff --git a/src/main/jhipster/src/main/webapp/app/entities/sample/index.ts b/src/main/jhipster/src/main/webapp/app/entities/sample/index.ts index 385bbba5c8..d1db00ce09 100644 --- a/src/main/jhipster/src/main/webapp/app/entities/sample/index.ts +++ b/src/main/jhipster/src/main/webapp/app/entities/sample/index.ts @@ -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'; diff --git a/src/main/jhipster/src/main/webapp/app/entities/sample/sample-browse.component.html b/src/main/jhipster/src/main/webapp/app/entities/sample/sample-manager.component.html similarity index 100% rename from src/main/jhipster/src/main/webapp/app/entities/sample/sample-browse.component.html rename to src/main/jhipster/src/main/webapp/app/entities/sample/sample-manager.component.html diff --git a/src/main/jhipster/src/main/webapp/app/entities/sample/sample-browse.component.ts b/src/main/jhipster/src/main/webapp/app/entities/sample/sample-manager.component.ts similarity index 92% rename from src/main/jhipster/src/main/webapp/app/entities/sample/sample-browse.component.ts rename to src/main/jhipster/src/main/webapp/app/entities/sample/sample-manager.component.ts index 6f8d144ef7..44ab589662 100644 --- a/src/main/jhipster/src/main/webapp/app/entities/sample/sample-browse.component.ts +++ b/src/main/jhipster/src/main/webapp/app/entities/sample/sample-manager.component.ts @@ -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; @@ -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 } }); diff --git a/src/main/jhipster/src/main/webapp/app/entities/sample/sample-search-list.component.ts b/src/main/jhipster/src/main/webapp/app/entities/sample/sample-search-list.component.ts index cbe074b63b..177884e320 100644 --- a/src/main/jhipster/src/main/webapp/app/entities/sample/sample-search-list.component.ts +++ b/src/main/jhipster/src/main/webapp/app/entities/sample/sample-search-list.component.ts @@ -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 } }); diff --git a/src/main/jhipster/src/main/webapp/app/entities/sample/sample.component.ts b/src/main/jhipster/src/main/webapp/app/entities/sample/sample.component.ts index 483dad8768..f49fd3c60c 100644 --- a/src/main/jhipster/src/main/webapp/app/entities/sample/sample.component.ts +++ b/src/main/jhipster/src/main/webapp/app/entities/sample/sample.component.ts @@ -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') }]); @@ -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') diff --git a/src/main/jhipster/src/main/webapp/app/entities/sample/sample.module.ts b/src/main/jhipster/src/main/webapp/app/entities/sample/sample.module.ts index 8fd734da3f..50e26828d6 100644 --- a/src/main/jhipster/src/main/webapp/app/entities/sample/sample.module.ts +++ b/src/main/jhipster/src/main/webapp/app/entities/sample/sample.module.ts @@ -14,7 +14,7 @@ import { sampleRoute, samplePopupRoute, SampleResolvePagingParams, - SampleBrowseComponent + SampleManagerComponent } from './'; import {SampleSearchListComponent} from './sample-search-list.component'; @@ -44,7 +44,7 @@ const ENTITY_STATES = [ SampleDeleteDialogComponent, SamplePopupComponent, SampleDeletePopupComponent, - SampleBrowseComponent, + SampleManagerComponent, SampleSearchListComponent, SampleImportPlateComponent, SampleImportPlateMappingComponent, @@ -56,7 +56,7 @@ const ENTITY_STATES = [ SamplePopupComponent, SampleDeleteDialogComponent, SampleDeletePopupComponent, - SampleBrowseComponent, + SampleManagerComponent, SampleImportPlateComponent, SampleImportPlateMappingComponent, ModalComponent diff --git a/src/main/jhipster/src/main/webapp/app/entities/sample/sample.route.ts b/src/main/jhipster/src/main/webapp/app/entities/sample/sample.route.ts index 8ba02dcecd..f2fe99e288 100644 --- a/src/main/jhipster/src/main/webapp/app/entities/sample/sample.route.ts +++ b/src/main/jhipster/src/main/webapp/app/entities/sample/sample.route.ts @@ -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'; @@ -25,8 +25,8 @@ export class SampleResolvePagingParams implements Resolve { export const sampleRoute: Routes = [ { - path: 'sample-browse', - component: SampleBrowseComponent, + path: 'sample-manager', + component: SampleManagerComponent, resolve: { 'pagingParams': SampleResolvePagingParams }, diff --git a/src/main/jhipster/src/main/webapp/index.html b/src/main/jhipster/src/main/webapp/index.html index 926129df85..cfd13000a7 100644 --- a/src/main/jhipster/src/main/webapp/index.html +++ b/src/main/jhipster/src/main/webapp/index.html @@ -104,7 +104,7 @@

You must enable javascript to view this page.

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); } diff --git a/src/main/jhipster/src/test/javascript/spec/app/entities/sample/sample-search-list.component.spec.ts b/src/main/jhipster/src/test/javascript/spec/app/entities/sample/sample-search-list.component.spec.ts index fa133edfa5..96086a74cf 100644 --- a/src/main/jhipster/src/test/javascript/spec/app/entities/sample/sample-search-list.component.spec.ts +++ b/src/main/jhipster/src/test/javascript/spec/app/entities/sample/sample-search-list.component.spec.ts @@ -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 }) })); });