-
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.
document: check on the ISBN/ISSN type identifier and import function
form: when an ISBN/ISSN identifier is entered on a document, it is validated and searched in the instance to see if a document with this reference exists (non-blocking validation). When importing a document, all fields in the identifiedBy field of the document are searched in the instance. * Closes rero/rero-ils#1664 Co-Authored-by: Bertrand Zuchuat <bertrand.zuchuat@rero.ch>
- Loading branch information
1 parent
7a7cf37
commit 4fec0e0
Showing
10 changed files
with
458 additions
and
25 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
40 changes: 40 additions & 0 deletions
40
...rc/app/record/detail-view/document-detail-view/dialog-import/dialog-import.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,40 @@ | ||
<!-- | ||
RERO ILS UI | ||
Copyright (C) 2021 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 class="modal-header"> | ||
<h4 class="modal-title pull-left" translate>Import</h4> | ||
</div> | ||
<div class="modal-body"> | ||
<h5 *ngIf="records.length < 2; else plurial" translate>A document is available</h5> | ||
<ng-template #plurial> | ||
<h5 translate>Documents are available</h5> | ||
</ng-template> | ||
<ul class="list-unstyled mb-0"> | ||
<li *ngFor="let record of records"> | ||
<a [routerLink]="['/records', 'documents', 'detail', record.metadata.pid]" (click)="close()"> | ||
<ng-container *ngIf="record.metadata.ui_title_text_responsibility; else noTitle"> | ||
{{ record.metadata.ui_title_text_responsibility }} | ||
</ng-container> | ||
<ng-template #noTitle>{{ 'Document' | translate }}</ng-template> | ||
</a> | ||
</li> | ||
</ul> | ||
<div class="font-weight-bold mt-3" translate>Do you want to import this document?</div> | ||
</div> | ||
<div class="modal-footer"> | ||
<button id="modal-cancel-button" type="button" class="btn btn-light" (click)="decline()" translate>Cancel</button> | ||
<button id="modal-confirm-button" type="button" class="btn btn-primary" (click)="confirm()" translate>Import</button> | ||
</div> |
49 changes: 49 additions & 0 deletions
49
...app/record/detail-view/document-detail-view/dialog-import/dialog-import.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,49 @@ | ||
/* | ||
* RERO ILS UI | ||
* Copyright (C) 2021 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 { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
import { TranslateModule } from '@ngx-translate/core'; | ||
import { BsModalRef, ModalModule } from 'ngx-bootstrap/modal'; | ||
import { DialogImportComponent } from './dialog-import.component'; | ||
|
||
|
||
describe('DialogImportComponent', () => { | ||
let component: DialogImportComponent; | ||
let fixture: ComponentFixture<DialogImportComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
imports: [ | ||
ModalModule.forRoot(), | ||
TranslateModule.forRoot() | ||
], | ||
declarations: [ DialogImportComponent ], | ||
providers: [BsModalRef] | ||
}) | ||
.compileComponents(); | ||
}); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(DialogImportComponent); | ||
component = fixture.componentInstance; | ||
component.records = []; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
55 changes: 55 additions & 0 deletions
55
.../src/app/record/detail-view/document-detail-view/dialog-import/dialog-import.component.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,55 @@ | ||
/* | ||
* RERO ILS UI | ||
* Copyright (C) 2021 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 { Component } from '@angular/core'; | ||
import { BsModalRef } from 'ngx-bootstrap/modal'; | ||
import { Subject } from 'rxjs'; | ||
|
||
@Component({ | ||
selector: 'admin-dialog-import', | ||
templateUrl: './dialog-import.component.html' | ||
}) | ||
export class DialogImportComponent { | ||
|
||
/** Available record */ | ||
records: any[]; | ||
|
||
/** Observable for action */ | ||
confirmation$: Subject<boolean> = new Subject<boolean>(); | ||
|
||
/** | ||
* Constructor | ||
* @param _bsModalRef - BsModalRef | ||
*/ | ||
constructor(private _bsModalRef: BsModalRef) {} | ||
|
||
/** Confirm action */ | ||
confirm() { | ||
this.confirmation$.next(true); | ||
this.close(); | ||
} | ||
|
||
/** Cancel action */ | ||
decline() { | ||
this.confirmation$.next(false); | ||
this.close(); | ||
} | ||
|
||
/** Close modal box */ | ||
close() { | ||
this._bsModalRef.hide(); | ||
} | ||
} |
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
Oops, something went wrong.