forked from rero/rero-ils-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
acquisition: displaying more document information
* Adds document brief view component. * Adds new formly field type to display document informations. Co-Authored-by: Lauren-D <[email protected]>
- Loading branch information
Showing
17 changed files
with
354 additions
and
53 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
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
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
49 changes: 49 additions & 0 deletions
49
projects/admin/src/app/acquisition/formly/type/field-document-brief-view.type.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) 2023 RERO | ||
* Copyright (C) 2023 UCLouvain | ||
* | ||
* 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, OnInit } from '@angular/core'; | ||
import { FieldType } from '@ngx-formly/core'; | ||
import { RecordService } from '@rero/ng-core'; | ||
|
||
@Component({ | ||
selector: 'admin-formly-field-type', | ||
template: ` | ||
<ng-container *ngIf="record"> | ||
<shared-document-brief-view [record]="record"></shared-document-brief-view> | ||
</ng-container> | ||
` | ||
}) | ||
export class FieldDocumentBriefViewTypeComponent extends FieldType implements OnInit { | ||
|
||
/** record */ | ||
record: any; | ||
|
||
/** | ||
* Constructor | ||
* @param _recordService - RecordService | ||
*/ | ||
constructor(private _recordService: RecordService) { | ||
super(); | ||
} | ||
|
||
/** OnInit hook */ | ||
ngOnInit(): void { | ||
this._recordService.getRecord('documents', this.model['document']) | ||
.subscribe((data: any) => this.record = data.metadata); | ||
} | ||
} |
51 changes: 51 additions & 0 deletions
51
...shared/src/lib/component/documents/document-brief-view/document-brief-view.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,51 @@ | ||
<!-- | ||
RERO ILS UI | ||
Copyright (C) 2023 RERO | ||
Copyright (C) 2023 UCLouvain | ||
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/>. | ||
--> | ||
<!-- title --> | ||
<a *ngIf="record.title | mainTitle as title" | ||
[routerLink]="['/records', 'documents', 'detail', record.pid]" target="_blank"> | ||
{{ title }} | ||
</a> | ||
<!-- contribution --> | ||
<ng-container *ngIf="record?.contribution as entities"> | ||
<div class="ml-2 small" name="document-contribution"> | ||
<shared-contribution | ||
[contributions]="entities" | ||
[limitRecord]="3" | ||
[activateLink]="false" | ||
></shared-contribution> | ||
</div> | ||
</ng-container> | ||
<!-- provision activity publications --> | ||
<ng-container *ngIf="provisionActivityPublications.length > 0"> | ||
<div class="ml-2 small" name="document-provision-activity"> | ||
{{ provisionActivityPublications | join }} | ||
</div> | ||
</ng-container> | ||
|
||
<!-- ISBN --> | ||
<ng-container *ngIf="record.identifiedBy | identifiedByLabel: ['bf:Isbn', 'bf:Ean'] as identifiedBy"> | ||
<div class="ml-2 small-content" name="document-identified-by"> | ||
ISBN: {{ identifiedBy | truncateText: 3 }} | ||
</div> | ||
</ng-container> | ||
<!-- ISSN --> | ||
<ng-container *ngIf="record.identifiedBy | identifiedByLabel: ['bf:Issn'] as identifiedBy"> | ||
<div class="ml-2 small-content" name="document-identified-by"> | ||
ISSN: {{ identifiedBy | truncateText: 3 }} | ||
</div> | ||
</ng-container> |
26 changes: 26 additions & 0 deletions
26
...shared/src/lib/component/documents/document-brief-view/document-brief-view.component.scss
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,26 @@ | ||
/* | ||
* RERO ILS UI | ||
* Copyright (C) 2023 RERO | ||
* Copyright (C) 2023 UCLouvain | ||
* | ||
* 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 'bootstrap/scss/functions'; | ||
@import 'bootstrap/scss/variables'; | ||
|
||
.small-content{ | ||
font-size: small; | ||
color: $secondary; | ||
font-weight: bold; | ||
} |
Oops, something went wrong.