-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
item: add request on item by librarian
Co-Authored-by: Bertrand Zuchuat <[email protected]>
- Loading branch information
1 parent
2cd145c
commit 83928a9
Showing
13 changed files
with
488 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
.../src/app/record/detail-view/document-detail-view/item-request/item-request.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<!-- | ||
RERO ILS UI | ||
Copyright (C) 2020 RERO | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU Affero General Public License as published by | ||
the Free Software Foundation, version 3 of the License. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU Affero General Public License for more details. | ||
You should have received a copy of the GNU Affero General Public License | ||
along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
--> | ||
<div *ngIf="form" class="modal show d-block" role="dialog"> | ||
<div class="modal-dialog modal-dialog-centered" role="document"> | ||
<div class="modal-content"> | ||
<div class="modal-header"> | ||
<h5 class="modal-title" translate>Item request</h5> | ||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"> | ||
<span aria-hidden="true" data-dismiss="modal" (click)="closeModal()">×</span> | ||
</button> | ||
</div> | ||
<div class="modal-body"> | ||
<div *ngIf="patron" class="card mb-2"> | ||
<div class="card-body"> | ||
<h5 class="card-title">{{ patron.last_name }}, {{ patron.first_name }}</h5> | ||
<p class="card-text"> | ||
{{ patron.street }}<br> | ||
{{ patron.postal_code }} {{ patron.city }}<br> | ||
{{ patron.email }} | ||
</p> | ||
</div> | ||
</div> | ||
<form [formGroup]="form" (ngSubmit)="submit(model)"> | ||
<formly-form [form]="form" [fields]="formFields" [model]="model"></formly-form> | ||
<div class="text-right"> | ||
<button class="btn btn-primary" [disabled]="!form.valid" translate>New Request</button> | ||
</div> | ||
</form> | ||
</div> | ||
</div> | ||
</div> | ||
</div> |
57 changes: 57 additions & 0 deletions
57
...c/app/record/detail-view/document-detail-view/item-request/item-request.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/* | ||
* RERO ILS UI | ||
* Copyright (C) 2020 RERO | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as published by | ||
* the Free Software Foundation, version 3 of the License. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
import { HttpClientModule } from '@angular/common/http'; | ||
import { LOCALE_ID } from '@angular/core'; | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
import { FormsModule, ReactiveFormsModule } from '@angular/forms'; | ||
import { FormlyModule } from '@ngx-formly/core'; | ||
import { TranslateModule } from '@ngx-translate/core'; | ||
import { RecordModule } from '@rero/ng-core'; | ||
import { BsModalRef } from 'ngx-bootstrap'; | ||
import { ItemRequestComponent } from './item-request.component'; | ||
|
||
|
||
describe('ItemRequestComponent', () => { | ||
let component: ItemRequestComponent; | ||
let fixture: ComponentFixture<ItemRequestComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
imports: [ | ||
FormsModule, | ||
ReactiveFormsModule, | ||
FormlyModule, | ||
HttpClientModule, | ||
RecordModule, | ||
TranslateModule.forRoot() | ||
], | ||
declarations: [ ItemRequestComponent ], | ||
providers: [BsModalRef, {provide: LOCALE_ID, useValue: 'en-US' }] | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(ItemRequestComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
Oops, something went wrong.