Skip to content

Commit fa49787

Browse files
Garfield-frjma
andcommitted
entity: use entity instead of contribution
* Adds a new contribution component. * Removes Mef Person et Organisastion typeahead service. * Adds Mef typeahead service. * Adds contribution entity pipe. * Removes contribution filter and format pipe. * Renames contribution to entity. * Uses authorized_access_point. Co-Authored-by: Bertrand Zuchuat <[email protected]> Co-Authored-by: Johnny Mariéthoz <[email protected]>
1 parent 11efe9e commit fa49787

File tree

51 files changed

+501
-839
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+501
-839
lines changed

Diff for: projects/admin/src/app/app.module.ts

+18-22
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* RERO ILS UI
3-
* Copyright (C) 2019-2022 RERO
4-
* Copyright (C) 2019-2022 UCLouvain
3+
* Copyright (C) 2019-2023 RERO
4+
* Copyright (C) 2019-2023 UCLouvain
55
*
66
* This program is free software: you can redistribute it and/or modify
77
* it under the terms of the GNU Affero General Public License as published by
@@ -17,7 +17,7 @@
1717
*/
1818

1919
import { APP_BASE_HREF, PlatformLocation } from '@angular/common';
20-
import { HttpClient, HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http';
20+
import { HTTP_INTERCEPTORS, HttpClient, HttpClientModule } from '@angular/common/http';
2121
import { APP_INITIALIZER, CUSTOM_ELEMENTS_SCHEMA, LOCALE_ID, NgModule } from '@angular/core';
2222
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
2323
import { BrowserModule } from '@angular/platform-browser';
@@ -44,13 +44,10 @@ import {
4444
SelectAccountEditorWidgetComponent
4545
} from './acquisition/components/editor/widget/select-account-editor-widget/select-account-editor-widget.component';
4646
import { ReceivedOrderPermissionValidator } from './acquisition/utils/permissions';
47-
import { PaymentsDataComponent } from './record/search-view/patron-transaction-event-search-view/payments-data/payments-data.component';
4847
import { AppRoutingModule } from './app-routing.module';
4948
import { AppComponent } from './app.component';
5049
import { DocumentsTypeahead } from './classes/typeahead/documents-typeahead';
5150
import { ItemsTypeahead } from './classes/typeahead/items-typeahead';
52-
import { MefOrganisationTypeahead } from './classes/typeahead/mef-organisation-typeahead';
53-
import { MefPersonTypeahead } from './classes/typeahead/mef-person-typeahead';
5451
import { MefTypeahead } from './classes/typeahead/mef-typeahead';
5552
import { PatronsTypeahead } from './classes/typeahead/patrons-typeahead';
5653
import { TabOrderDirective } from './directives/tab-order.directive';
@@ -72,6 +69,7 @@ import { ItemInCollectionPipe } from './pipe/item-in-collection.pipe';
7269
import { MainTitleRelationPipe } from './pipe/main-title-relation.pipe';
7370
import { MarcPipe } from './pipe/marc.pipe';
7471
import { NotesFormatPipe } from './pipe/notes-format.pipe';
72+
import { PatronNamePipe } from './pipe/patron-name.pipe';
7573
import { SubjectProcessPipe } from './pipe/subject-process.pipe';
7674
import { CircPoliciesBriefViewComponent } from './record/brief-view/circ-policies-brief-view.component';
7775
import { CollectionBriefViewComponent } from './record/brief-view/collection-brief-view.component';
@@ -82,10 +80,15 @@ import { ItemTypesBriefViewComponent } from './record/brief-view/item-types-brie
8280
import { ItemsBriefViewComponent } from './record/brief-view/items-brief-view/items-brief-view.component';
8381
import { LibrariesBriefViewComponent } from './record/brief-view/libraries-brief-view.component';
8482
import { LoansBriefViewComponent } from './record/brief-view/loans-brief-view/loans-brief-view.component';
83+
import { PatronTransactionEventDefaultComponent } from './record/brief-view/patron-transaction-events-brief-view/patron-transaction-event-default.component';
84+
import { PatronTransactionEventOverdueComponent } from './record/brief-view/patron-transaction-events-brief-view/patron-transaction-event-overdue.component';
85+
import { PatronTransactionEventsBriefViewComponent } from './record/brief-view/patron-transaction-events-brief-view/patron-transaction-events-brief-view.component';
8586
import { PatronTypesBriefViewComponent } from './record/brief-view/patron-types-brief-view.component';
8687
import { PatronsBriefViewComponent } from './record/brief-view/patrons-brief-view/patrons-brief-view.component';
8788
import { TemplatesBriefViewComponent } from './record/brief-view/templates-brief-view.component';
8889
import { VendorBriefViewComponent } from './record/brief-view/vendor-brief-view.component';
90+
import { CirculationLogLoanComponent } from './record/circulation-logs/circulation-log/circulation-log-loan/circulation-log-loan.component';
91+
import { CirculationLogNotificationComponent } from './record/circulation-logs/circulation-log/circulation-log-notification/circulation-log-notification.component';
8992
import { CirculationLogComponent } from './record/circulation-logs/circulation-log/circulation-log.component';
9093
import { CirculationLogsDialogComponent } from './record/circulation-logs/circulation-logs-dialog.component';
9194
import { CirculationLogsComponent } from './record/circulation-logs/circulation-logs.component';
@@ -150,18 +153,24 @@ import { LocalFieldComponent } from './record/detail-view/local-field/local-fiel
150153
import { LocationDetailViewComponent } from './record/detail-view/location-detail-view/location-detail-view.component';
151154
import { OrganisationDetailViewComponent } from './record/detail-view/organisation-detail-view/organisation-detail-view.component';
152155
import { PatronDetailViewComponent } from './record/detail-view/patron-detail-view/patron-detail-view.component';
156+
import { PatronPermissionComponent } from './record/detail-view/patron-detail-view/patron-permissions/patron-permission/patron-permission.component';
157+
import { PatronPermissionsComponent } from './record/detail-view/patron-detail-view/patron-permissions/patron-permissions.component';
153158
import { PatronTypesDetailViewComponent } from './record/detail-view/patron-types-detail-view/patron-types-detail-view.component';
154159
import { PermissionDetailViewComponent } from './record/detail-view/permission-detail-view/permission-detail-view.component';
155160
import { RecordMaskedComponent } from './record/detail-view/record-masked/record-masked.component';
156161
import { TemplateDetailViewComponent } from './record/detail-view/template-detail-view/template-detail-view.component';
157162
import { VendorDetailViewComponent } from './record/detail-view/vendor-detail-view/vendor-detail-view.component';
158-
import { DocumentRecordSearchComponent } from './record/search-view/document-record-search/document-record-search.component';
159163
import { IdentifiedbyValueComponent } from './record/editor/wrappers/identifiedby-value.component';
160164
import { UserIdComponent } from './record/editor/wrappers/user-id/user-id.component';
161165
import { CipoPatronTypeItemTypeComponent } from './record/formly/type/cipo-patron-type-item-type/cipo-patron-type-item-type.component';
162166
import { ItemAvailabilityComponent } from './record/item-availability/item-availability.component';
163167
import { OperationLogsDialogComponent } from './record/operation-logs/operation-logs-dialog/operation-logs-dialog.component';
164168
import { OperationLogsComponent } from './record/operation-logs/operation-logs.component';
169+
import { DocumentRecordSearchComponent } from './record/search-view/document-record-search/document-record-search.component';
170+
import { PatronTransactionEventSearchViewComponent } from './record/search-view/patron-transaction-event-search-view/patron-transaction-event-search-view.component';
171+
import { PaymentsDataComponent } from './record/search-view/patron-transaction-event-search-view/payments-data/payments-data.component';
172+
import { PaymentDataPieComponent } from './record/search-view/patron-transaction-event-search-view/payments-data/pie/payment-data-pie.component';
173+
import { PaymentsDataTableComponent } from './record/search-view/patron-transaction-event-search-view/payments-data/table/payments-data-table.component';
165174
import { AppConfigService } from './service/app-config.service';
166175
import { AppInitializerService } from './service/app-initializer.service';
167176
import { OrganisationService } from './service/organisation.service';
@@ -170,17 +179,6 @@ import { UiRemoteTypeaheadService } from './service/ui-remote-typeahead.service'
170179
import { CurrentLibraryPermissionValidator } from './utils/permissions';
171180
import { CustomShortcutHelpComponent } from './widgets/custom-shortcut-help/custom-shortcut-help.component';
172181
import { FrontpageComponent } from './widgets/frontpage/frontpage.component';
173-
import { PatronTransactionEventsBriefViewComponent } from './record/brief-view/patron-transaction-events-brief-view/patron-transaction-events-brief-view.component';
174-
import { PatronNamePipe } from './pipe/patron-name.pipe';
175-
import { PatronTransactionEventOverdueComponent } from './record/brief-view/patron-transaction-events-brief-view/patron-transaction-event-overdue.component';
176-
import { PatronTransactionEventDefaultComponent } from './record/brief-view/patron-transaction-events-brief-view/patron-transaction-event-default.component';
177-
import { PatronTransactionEventSearchViewComponent } from './record/search-view/patron-transaction-event-search-view/patron-transaction-event-search-view.component';
178-
import { PaymentsDataTableComponent } from './record/search-view/patron-transaction-event-search-view/payments-data/table/payments-data-table.component';
179-
import { PaymentDataPieComponent } from './record/search-view/patron-transaction-event-search-view/payments-data/pie/payment-data-pie.component';
180-
import { PatronPermissionsComponent } from './record/detail-view/patron-detail-view/patron-permissions/patron-permissions.component';
181-
import { PatronPermissionComponent } from './record/detail-view/patron-detail-view/patron-permissions/patron-permission/patron-permission.component';
182-
import { CirculationLogLoanComponent } from './record/circulation-logs/circulation-log/circulation-log-loan/circulation-log-loan.component';
183-
import { CirculationLogNotificationComponent } from './record/circulation-logs/circulation-log/circulation-log-notification/circulation-log-notification.component';
184182

185183
/** Init application factory */
186184
export function appInitFactory(appInitializerService: AppInitializerService): () => Promise<any> {
@@ -370,8 +368,7 @@ export function appInitFactory(appInitializerService: AppInitializerService): ()
370368
// Use the "multi" parameter to allow the recovery of several services in the injector.
371369
{ provide: typeaheadToken, useExisting: DocumentsTypeahead, multi: true },
372370
{ provide: typeaheadToken, useExisting: ItemsTypeahead, multi: true },
373-
{ provide: typeaheadToken, useExisting: MefOrganisationTypeahead, multi: true },
374-
{ provide: typeaheadToken, useExisting: MefPersonTypeahead, multi: true },
371+
{ provide: typeaheadToken, useExisting: MefTypeahead, multi: true },
375372
{ provide: typeaheadToken, useExisting: PatronsTypeahead, multi: true },
376373
{
377374
provide: CoreConfigService,
@@ -388,8 +385,7 @@ export function appInitFactory(appInitializerService: AppInitializerService): ()
388385
ItemsTypeahead,
389386
PatronsTypeahead,
390387
MainTitlePipe,
391-
MefPersonTypeahead,
392-
MefOrganisationTypeahead,
388+
MefTypeahead,
393389
TruncateTextPipe,
394390
CurrentLibraryPermissionValidator,
395391
ReceivedOrderPermissionValidator,

Diff for: projects/admin/src/app/circulation/item/item.component.html

+5-14
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!--
22
RERO ILS UI
3-
Copyright (C) 2019 RERO
3+
Copyright (C) 2019-2023 RERO
44
55
This program is free software: you can redistribute it and/or modify
66
it under the terms of the GNU Affero General Public License as published by
@@ -58,19 +58,10 @@
5858
<a [routerLink]="['/records','documents','detail', item.document.pid]" *ngIf="item.document.title | mainTitle as title ">
5959
{{ isCollapsed ? (title | truncateText: 12) : title }}
6060
</a>
61-
<ng-container *ngIf="document && document.contribution && document.contribution.length > 0">
62-
<ul class="list-inline mb-0 small">
63-
<li *ngFor="let contribution of document.contribution; let last = last; let i = index" class="list-inline-item">
64-
<span *ngIf="!contribution.agent.pid" [innerHTML]="contribution | contributionFormat: true"></span>
65-
<a
66-
*ngIf="contribution.agent.pid"
67-
[innerHTML]="contribution | contributionFormat: true"
68-
[routerLink]="['/records', 'persons', 'detail', contribution.agent.pid]">
69-
</a>
70-
{{ last ? '' : '; ' }}
71-
</li>
72-
</ul>
73-
</ng-container>
61+
<shared-contribution
62+
*ngIf="document?.contribution && document.contribution.length > 0"
63+
[contributions]="document.contribution"
64+
></shared-contribution>
7465
</div>
7566
<!-- CIRCULATION INFO -->
7667
<div name="circ-info" class="col-2">

Diff for: projects/admin/src/app/circulation/main-request/requested-item/requested-item.component.html

+5-14
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!--
22
RERO ILS UI
3-
Copyright (C) 2019 RERO
3+
Copyright (C) 2019-2023 RERO
44
55
This program is free software: you can redistribute it and/or modify
66
it under the terms of the GNU Affero General Public License as published by
@@ -44,19 +44,10 @@
4444
<a [routerLink]="['/records','documents','detail', document.pid]" *ngIf="document.title | mainTitle as title ">
4545
{{ title }}
4646
</a><br/>
47-
<ng-container *ngIf="document.contribution && document.contribution.length > 0">
48-
<ul class="list-inline mb-0 small" *ngIf="document && document.contribution">
49-
<li *ngFor="let contribution of document.contribution; let last = last; let i = index" class="list-inline-item">
50-
<span *ngIf="!contribution.agent.pid" [innerHTML]="contribution | contributionFormat: true"></span>
51-
<a
52-
*ngIf="contribution.agent.pid"
53-
[innerHTML]="contribution | contributionFormat: true"
54-
[routerLink]="['/records', 'persons', 'detail', contribution.agent.pid]">
55-
</a>
56-
{{ last ? '' : '; ' }}
57-
</li>
58-
</ul>
59-
</ng-container>
47+
<shared-contribution
48+
*ngIf="document?.contribution && document.contribution.length > 0"
49+
[contributions]="document.contribution"
50+
></shared-contribution>
6051
</div>
6152
<div name="call-number" class="col-2">
6253
<shared-inherited-call-number [item]="item"></shared-inherited-call-number>

Diff for: projects/admin/src/app/circulation/patron/history/history-log/history-log.component.html

+6-19
Original file line numberDiff line numberDiff line change
@@ -32,25 +32,12 @@
3232
</ng-template>
3333
</div>
3434
<div class="col-sm-4">
35-
<ng-container *ngIf="document && document.metadata.contribution; else noContributionRecord">
36-
<ul class="list-inline mb-0">
37-
<li class="list-inline-item mr-1" *ngFor="let contribution of document.metadata.contribution.slice(0,3) | contributionFilter:language; let last = last; let i = index">
38-
<ng-container *ngIf="contribution.pid && contribution.target !== undefined; else agentNoLink">
39-
<a [routerLink]="['/', 'records', contribution.type | contributionType, 'detail', contribution.pid]">
40-
{{ contribution.authorizedAccessPoint }}
41-
</a>
42-
</ng-container>
43-
<ng-template #agentNoLink>
44-
{{ contribution.authorizedAccessPoint }}
45-
</ng-template>
46-
{{ last ? '' : '; ' }}
47-
{{ last && i === 2 ? '; …' : '' }}
48-
</li>
49-
</ul>
50-
</ng-container>
51-
<ng-template #noContributionRecord>
52-
&nbsp;
53-
</ng-template>
35+
<shared-contribution
36+
*ngIf="document?.metadata?.contribution && document.metadata.contribution.length > 0; else noContributionRecord"
37+
[contributions]="document.metadata.contribution"
38+
[limitRecord]="3"
39+
></shared-contribution>
40+
<ng-template #noContributionRecord>&nbsp;</ng-template>
5441
</div>
5542
<div class="col-sm-2">
5643
{{ log.metadata.date | dateTranslate: 'short' }}

Diff for: projects/admin/src/app/circulation/patron/history/history-log/history-log.component.ts

+1-9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* RERO ILS UI
3-
* Copyright (C) 2021 RERO
3+
* Copyright (C) 2021-2023 RERO
44
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU Affero General Public License as published by
@@ -16,7 +16,6 @@
1616
*/
1717

1818
import { Component, Input } from '@angular/core';
19-
import { TranslateService } from '@ngx-translate/core';
2019
import { ProvisionActivityType } from '@rero/shared';
2120
import { OperationLogsApiService } from '@app/admin/api/operation-logs-api.service';
2221

@@ -38,18 +37,11 @@ export class HistoryLogComponent {
3837
/** Checkout record operation logs */
3938
checkout: any = null;
4039

41-
/** Get current language */
42-
get language(): string {
43-
return this._translateService.currentLang;
44-
}
45-
4640
/**
4741
* Constructor
48-
* @param _translateService - TranslateService
4942
* @param _operationLogsApiService - OperationLogsApiService
5043
*/
5144
constructor(
52-
private _translateService: TranslateService,
5345
private _operationLogsApiService: OperationLogsApiService
5446
) {}
5547

Diff for: projects/admin/src/app/circulation/patron/pending/pending-item/pending-item.component.html

+5-14
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!--
22
RERO ILS UI
3-
Copyright (C) 2020 RERO
3+
Copyright (C) 2020-2023 RERO
44
55
This program is free software: you can redistribute it and/or modify
66
it under the terms of the GNU Affero General Public License as published by
@@ -29,19 +29,10 @@
2929
<a [routerLink]="['/records', 'documents', 'detail', document.pid]" *ngIf="document.title | mainTitle as title">
3030
{{ title }}
3131
</a><br/>
32-
<ng-container *ngIf="document.contribution && document.contribution.length > 0">
33-
<ul class="list-inline mb-0 small">
34-
<li *ngFor="let contribution of document.contribution; let last = last; let i = index" class="list-inline-item">
35-
<span *ngIf="!contribution.agent.pid" [innerHTML]="contribution | contributionFormat: true"></span>
36-
<a
37-
*ngIf="contribution.agent.pid"
38-
[innerHTML]="contribution | contributionFormat: true"
39-
[routerLink]="['/records', 'persons', 'detail', contribution.agent.pid]">
40-
</a>
41-
{{ last ? '' : '; ' }}
42-
</li>
43-
</ul>
44-
</ng-container>
32+
<shared-contribution
33+
*ngIf="document && document.contribution && document.contribution.length > 0"
34+
[contributions]="document.contribution"
35+
></shared-contribution>
4536
</div>
4637
<div class="col-2">{{ loan.created | dateTranslate: 'short' }}</div>
4738
<div class="col-2">-<!-- TODO :: display the computed expected_date --></div>

Diff for: projects/admin/src/app/circulation/patron/pickup/pickup-item/pickup-item.component.html

+5-14
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!--
22
RERO ILS UI
3-
Copyright (C) 2020 RERO
3+
Copyright (C) 2020-2023 RERO
44
55
This program is free software: you can redistribute it and/or modify
66
it under the terms of the GNU Affero General Public License as published by
@@ -22,19 +22,10 @@
2222
<a [routerLink]="['/records', 'documents', 'detail', document.pid]" *ngIf="document.title | mainTitle as title">
2323
{{ title }}
2424
</a><br/>
25-
<ng-container *ngIf="document.contribution && document.contribution.length > 0">
26-
<ul class="list-inline mb-0 small">
27-
<li *ngFor="let contribution of document.contribution; let last = last; let i = index" class="list-inline-item">
28-
<span *ngIf="!contribution.agent.pid" [innerHTML]="contribution | contributionFormat: true"></span>
29-
<a
30-
*ngIf="contribution.agent.pid"
31-
[innerHTML]="contribution | contributionFormat: true"
32-
[routerLink]="['/records', 'persons', 'detail', contribution.agent.pid]">
33-
</a>
34-
{{ last ? '' : '; ' }}
35-
</li>
36-
</ul>
37-
</ng-container>
25+
<shared-contribution
26+
*ngIf="document && document.contribution && document.contribution.length > 0"
27+
[contributions]="document.contribution"
28+
></shared-contribution>
3829
</div>
3930
<div class="col-3">
4031
{{ loan.metadata.pickup_location_pid | getRecord: 'locations' : 'field' : 'pickup_name' | async }}

Diff for: projects/admin/src/app/classes/typeahead/ITypeahead-interface.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* RERO ILS UI
3-
* Copyright (C) 2020 RERO
3+
* Copyright (C) 2020-2023 RERO
44
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU Affero General Public License as published by
@@ -42,5 +42,5 @@ export interface ITypeahead {
4242
* @returns - an observable of the list of suggestions.
4343
*/
4444
getSuggestions(options: any, query: string, numberOfSuggestions: number):
45-
Observable<Array<SuggestionMetadata>>;
45+
Observable<Array<SuggestionMetadata | string>>;
4646
}

0 commit comments

Comments
 (0)