Skip to content

Commit

Permalink
project code: rename a component
Browse files Browse the repository at this point in the history
* Renames checkout component accordingly to its usage (checkins).

Co-Authored-by: Alicia Zangger <alicia.zangger@rero.ch>
  • Loading branch information
Alicia Zangger committed Mar 13, 2020
1 parent 4dc4426 commit a7dc296
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ import { TranslateModule } from '@ngx-translate/core';
import { CoreModule, RecordModule } from '@rero/ng-core';
import { ItemsListComponent } from '../items-list/items-list.component';
import { CardComponent } from '../patron/card/card.component';
import { CheckoutComponent } from './checkout.component';
import { CheckinComponent } from './checkin.component';
import { ItemComponent } from '../item/item.component';
import { CollapseModule } from 'ngx-bootstrap';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';


describe('CheckoutComponent', () => {
let component: CheckoutComponent;
let fixture: ComponentFixture<CheckoutComponent>;
let component: CheckinComponent;
let fixture: ComponentFixture<CheckinComponent>;

beforeEach(async(() => {
TestBed.configureTestingModule({
Expand All @@ -45,7 +45,7 @@ describe('CheckoutComponent', () => {
],
declarations: [
CardComponent,
CheckoutComponent,
CheckinComponent,
ItemsListComponent,
ItemComponent
]
Expand All @@ -54,7 +54,7 @@ describe('CheckoutComponent', () => {
}));

beforeEach(() => {
fixture = TestBed.createComponent(CheckoutComponent);
fixture = TestBed.createComponent(CheckinComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ import { ItemsService } from '../items.service';

@Component({
selector: 'admin-circulation-checkout',
templateUrl: './checkout.component.html'
templateUrl: './checkin.component.html'
})
export class CheckoutComponent implements OnInit {
export class CheckinComponent implements OnInit {
public placeholder: string = this.translate.instant(
'Please enter a patron card number or an item barcode.'
);
Expand Down Expand Up @@ -93,6 +93,7 @@ export class CheckoutComponent implements OnInit {
automaticCheckinCheckout(itemBarcode) {
this.searchInputFocus = false;
this.itemsService.automaticCheckin(itemBarcode, this.loggedUser.getCurrentLibrary()).subscribe(item => {
console.log(item);
// TODO: remove this when policy will be in place
if (
item === null ||
Expand All @@ -109,6 +110,9 @@ export class CheckoutComponent implements OnInit {
this.getPatronInfo(item.loan.patron.barcode);
}
if (item.hasRequests) {
this.itemsService.doValidateRequest(item, this.loggedUser.library.pid).subscribe(itemData => {
item.actionDone = itemData.actionDone;
});
this.toastService.warning(
this.translate.instant('The item contains requests'),
this.translate.instant('Checkin')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { CheckoutComponent } from './checkout/checkout.component';
import { CheckinComponent } from './checkin/checkin.component';
import { MainRequestComponent } from './main-request/main-request.component';
import { LoanComponent } from './patron/loan/loan.component';
import { MainComponent } from './patron/main/main.component';
Expand Down Expand Up @@ -59,7 +59,7 @@ const routes: Routes = [
]
}, {
path: 'checkout',
component: CheckoutComponent
component: CheckinComponent
}, {
path: 'requests',
component: MainRequestComponent
Expand Down
4 changes: 2 additions & 2 deletions projects/admin/src/app/circulation/circulation.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { RecordModule } from '@rero/ng-core';
import { BsDropdownModule, CollapseModule } from 'ngx-bootstrap';
import { CheckoutComponent } from './checkout/checkout.component';
import { CheckinComponent } from './checkin/checkin.component';
import { CirculationRoutingModule } from './circulation-routing.module';
import { ItemComponent } from './item/item.component';
import { ItemsListComponent } from './items-list/items-list.component';
Expand All @@ -43,7 +43,7 @@ import { PickupItemComponent } from './patron/pickup/pickup-item/pickup-item.com
CardComponent,
ItemsListComponent,
LoanComponent,
CheckoutComponent,
CheckinComponent,
ItemComponent,
ProfileComponent,
RequestedComponent,
Expand Down

0 comments on commit a7dc296

Please sign in to comment.