From e0b6b5d5e6dabbeabe53a2b122ae707cb5e8edc2 Mon Sep 17 00:00:00 2001 From: Bertrand Zuchuat Date: Mon, 21 Oct 2024 11:58:00 +0200 Subject: [PATCH] chore: refactoring components/service for primeng Co-Authored-by: Bertrand Zuchuat --- package-lock.json | 8 +- package.json | 2 +- .../src/app/acquisition/acquisition.module.ts | 28 +- .../account-brief-view.component.html | 31 +- .../account-brief-view.component.ts | 4 +- .../account-detail-view.component.html | 46 +- .../account-list/account-list.component.html | 29 +- .../account-transfer.component.html | 86 +++- .../account-transfer.component.ts | 8 +- .../budgets-brief-view.component.ts | 2 +- .../budget-detail-view.component.html | 11 +- .../order-brief-view.component.html | 2 +- .../order-detail-view.component.html | 26 +- .../order-detail-view.component.ts | 4 + .../order-line/order-line.component.html | 33 +- .../order-lines/order-lines.component.html | 25 +- .../order-email-form.component.html | 1 - .../order-email-form.component.ts | 7 +- .../order-summary.component.html | 2 +- .../receipt-detail-view.component.html | 16 +- .../receipt-form/order-receipt-form.ts | 2 +- .../order-receipt-view.component.ts | 7 +- .../receipt-list/receipt-list.component.html | 25 +- .../receipt-summary.component.html | 26 +- .../formly/type/repeat-section.type.ts | 69 +++ projects/admin/src/app/app.module.ts | 15 +- .../checkin-action.component.html | 36 +- .../circulation/checkin/checkin.component.ts | 47 +- .../src/app/circulation/circulation.module.ts | 33 +- .../app/circulation/item/item.component.html | 56 +-- .../items-list/items-list.component.html | 21 +- .../main-request/main-request.component.ts | 7 +- .../patron/cancel-request-button.component.ts | 5 +- .../circulation/patron/card/card.component.ts | 17 +- .../change-password-form.component.html | 29 +- .../change-password-form.component.ts | 6 +- .../circulation-settings.component.html | 18 + .../circulation-settings.component.spec.ts | 38 ++ .../circulation-settings.component.ts | 108 +++++ .../circulation-settings.service.spec.ts} | 21 +- .../circulation-settings.service.ts | 53 +++ .../fixed-date-form.component.html | 75 ++- .../fixed-date-form.component.ts | 46 +- .../patron/loan/loan.component.html | 25 +- .../circulation/patron/loan/loan.component.ts | 160 ++----- .../patron/main/main.component.html | 109 +---- .../circulation/patron/main/main.component.ts | 100 +++- .../patron-fee/patron-fee.component.ts | 5 +- .../pending-item/pending-item.component.html | 15 +- .../patron/pending/pending.component.html | 2 +- .../patron/pending/pending.component.ts | 3 +- .../patron/pickup/pickup.component.ts | 2 +- .../patron/profile/profile.component.ts | 3 + .../services/circulation.service.ts | 83 +--- .../services/loan-fixed-date.service.ts | 2 +- .../services/patron-transaction.service.ts | 5 +- .../issue-email/issue-email.component.html | 3 +- .../issue-email/issue-email.component.ts | 42 +- .../admin/src/app/guard/item-access.guard.ts | 16 +- .../app/menu/menu-user/menu-user.component.ts | 4 +- .../menu/service/menu-translate.service.ts | 2 +- .../src/app/menu/service/menu.service.ts | 33 +- .../documents-brief-view.component.html | 66 +-- .../circulation-log.component.spec.ts | 2 - .../circulation-logs-dialog.component.ts | 4 + .../circulation-logs.component.html | 134 +++--- .../document-editor.component.spec.ts | 9 +- .../document-editor.component.ts | 11 +- .../exception-dates-edit.component.html | 442 ++++++++---------- .../exception-dates-list.component.html | 6 +- .../exception-dates-list.component.ts | 4 + .../libraries/library-form.service.ts | 4 +- .../libraries/library.component.html | 5 +- .../libraries/library.component.ts | 16 +- .../user-id-editor.component.ts | 15 +- .../address-type/address-type.component.html | 60 +-- .../address-type/address-type.component.ts | 7 +- .../document-detail-view.component.html | 202 +++----- .../document-detail-view.component.ts | 20 +- .../document-detail.component.html | 26 +- .../files-collections.component.html | 11 +- .../files-collections.component.ts | 4 +- .../upload-files/upload-files.component.html | 5 +- .../upload-files/upload-files.component.ts | 15 +- .../default-holding-item.component.html | 101 ++-- .../holding/holding.component.html | 88 ++-- .../holding/holding.component.ts | 2 + .../serial-holding-item.component.html | 86 ++-- .../holdings/holdings.component.html | 35 +- .../holdings/holdings.component.ts | 22 +- .../item-request/item-request.component.html | 116 ++--- .../item-request/item-request.component.ts | 16 +- .../received-issue.component.html | 57 ++- .../serial-holding-detail-view.component.html | 104 ++--- .../serial-holding-detail-view.component.ts | 9 +- .../item-detail-view.component.html | 90 ++-- .../item-transactions.component.ts | 9 +- .../library-detail-view.component.html | 24 +- .../location/location.component.html | 48 +- .../local-field/local-field.component.html | 43 +- .../location-detail-view.component.html | 60 +-- .../organisation-detail-view.component.html | 16 +- .../patron-types-detail-view.component.html | 162 ++++--- .../reports-list/reports-list.component.html | 37 +- .../statistics-cfg-detail-view.component.html | 102 ++-- .../statistics-cfg-detail-view.component.ts | 34 +- .../template-detail-view.component.html | 2 +- .../template-detail-view.component.ts | 4 +- .../vendor-detail-view.component.html | 45 +- .../add-entity-local-form.component.ts | 4 +- .../remote/patrons-remote.service.ts | 4 +- .../record/editor/type/field-custom.type.ts | 2 +- .../operation-logs-dialog.component.html | 13 +- .../operation-logs-dialog.component.ts | 4 + .../operation-logs.component.html | 68 ++- .../operation-logs.component.ts | 2 +- projects/admin/src/app/scss/styles.scss | 19 - .../service/app-initializer.service.spec.ts | 2 - .../app/service/app-initializer.service.ts | 14 +- .../src/app/service/issue.service.spec.ts | 2 - .../admin/src/app/service/issue.service.ts | 6 +- .../service/record.handle-error.service.ts | 4 +- .../preview-email.component.html | 66 ++- .../preview-email.component.scss | 6 +- .../primeng-import/primeng-import.module.ts | 16 +- .../src/app/app.module.ts | 6 - .../src/app/app-initializer.service.spec.ts | 4 - projects/public-search/src/app/app.module.ts | 2 - .../collection-brief.component.spec.ts | 4 - .../patron-profile-fee.component.spec.ts | 2 - .../patron-profile-loan.component.html | 3 +- .../patron-profile-loan.component.ts | 8 +- .../patron-profile-password.component.ts | 10 +- ...atron-profile-personal-editor.component.ts | 9 +- .../patron-profile-personal.component.spec.ts | 2 - .../patron-profile-request.component.ts | 10 +- .../patron-profile.component.spec.ts | 4 - .../src/app/app.module.ts | 6 +- .../src/app/app.module.ts | 4 +- .../shared/src/lib/api/user-api.service.ts | 7 +- .../action-button/action-button.component.ts | 75 ++- .../component/open-close-button.component.ts | 47 ++ .../pipe/item-holdings-call-number.pipe.ts | 4 +- projects/shared/src/lib/shared.module.ts | 11 +- projects/shared/src/public-api.ts | 17 +- 145 files changed, 2436 insertions(+), 2156 deletions(-) create mode 100644 projects/admin/src/app/circulation/patron/loan/circulation-settings/circulation-settings.component.html create mode 100644 projects/admin/src/app/circulation/patron/loan/circulation-settings/circulation-settings.component.spec.ts create mode 100644 projects/admin/src/app/circulation/patron/loan/circulation-settings/circulation-settings.component.ts rename projects/admin/src/app/{record/detail-view/document-detail-view/document-detail-view.component.scss => circulation/patron/loan/circulation-settings/circulation-settings.service.spec.ts} (58%) create mode 100644 projects/admin/src/app/circulation/patron/loan/circulation-settings/circulation-settings.service.ts create mode 100644 projects/shared/src/lib/component/open-close-button.component.ts diff --git a/package-lock.json b/package-lock.json index 3e398b523..f2edf09c4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -38,7 +38,7 @@ "issn": "^1.0.6", "js-generate-password": "^0.1.9", "lodash-es": "^4.17.21", - "luxon": "^3.4.0", + "luxon": "^3.5.0", "marked": "^10.0.0", "moment": "^2.30.1", "ngx-bootstrap": "^12.0.0", @@ -10923,9 +10923,9 @@ } }, "node_modules/luxon": { - "version": "3.4.4", - "resolved": "https://registry.npmjs.org/luxon/-/luxon-3.4.4.tgz", - "integrity": "sha512-zobTr7akeGHnv7eBOXcRgMeCP6+uyYsczwmeRCauvpvaAltgNyTbLH/+VaEAPUeWBT+1GuNmz4wC/6jtQzbbVA==", + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/luxon/-/luxon-3.5.0.tgz", + "integrity": "sha512-rh+Zjr6DNfUYR3bPwJEnuwDdqMbxZW7LOQfUN4B54+Cl+0o5zaU9RJ6bcidfDtC1cWCZXQ+nvX8bf6bAji37QQ==", "engines": { "node": ">=12" } diff --git a/package.json b/package.json index 4d6aeb800..733e09f3d 100644 --- a/package.json +++ b/package.json @@ -96,7 +96,7 @@ "issn": "^1.0.6", "js-generate-password": "^0.1.9", "lodash-es": "^4.17.21", - "luxon": "^3.4.0", + "luxon": "^3.5.0", "marked": "^10.0.0", "moment": "^2.30.1", "ngx-bootstrap": "^12.0.0", diff --git a/projects/admin/src/app/acquisition/acquisition.module.ts b/projects/admin/src/app/acquisition/acquisition.module.ts index 926c038d2..d328e8017 100644 --- a/projects/admin/src/app/acquisition/acquisition.module.ts +++ b/projects/admin/src/app/acquisition/acquisition.module.ts @@ -19,12 +19,14 @@ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; import { ReactiveFormsModule } from '@angular/forms'; -import { FormlyModule, FORMLY_CONFIG } from '@ngx-formly/core'; +import { FORMLY_CONFIG, FormlyModule } from '@ngx-formly/core'; +import { FormlyPrimeNGModule } from '@ngx-formly/primeng'; import { TranslateService } from '@ngx-translate/core'; import { ApiService, CoreModule, RecordModule } from '@rero/ng-core'; +import { SharedModule } from '@rero/shared'; import { BsDropdownModule } from 'ngx-bootstrap/dropdown'; -import { PopoverModule } from 'ngx-bootstrap/popover'; -import { TabsModule } from 'ngx-bootstrap/tabs'; +import { PreviewEmailModule } from '../shared/preview-email/preview-email.module'; +import { PrimengImportModule } from '../shared/primeng-import/primeng-import.module'; import { AcquisitionRoutingModule } from './acquisition-routing.module'; import { AcqAccountApiService } from './api/acq-account-api.service'; import { AcqOrderApiService } from './api/acq-order-api.service'; @@ -39,29 +41,26 @@ import { OrderBriefViewComponent } from './components/order/order-brief-view/ord import { OrderDetailViewComponent } from './components/order/order-detail-view/order-detail-view.component'; import { OrderLineComponent } from './components/order/order-detail-view/order-line/order-line.component'; import { OrderLinesComponent } from './components/order/order-detail-view/order-lines/order-lines.component'; +import { OrderEmailFormComponent } from './components/order/order-email-form/order-email-form.component'; +import { OrderSummaryComponent } from './components/order/order-summary/order-summary.component'; +import { ReceiptDetailViewComponent } from './components/receipt/receipt-detail-view/receipt-detail-view.component'; import { OrderReceipt } from './components/receipt/receipt-form/order-receipt'; import { OrderReceiptForm } from './components/receipt/receipt-form/order-receipt-form'; import { OrderReceiptViewComponent } from './components/receipt/receipt-form/order-receipt-view.component'; -import { OrderSummaryComponent } from './components/order/order-summary/order-summary.component'; import { ReceiptListComponent } from './components/receipt/receipt-list/receipt-list.component'; +import { ReceiptSummaryComponent } from './components/receipt/receipt-summary/receipt-summary.component'; import { registerFormlyExtension } from './formly/extension'; import { FieldDocumentBriefViewTypeComponent } from './formly/type/field-document-brief-view.type'; import { FieldRefTypeComponent } from './formly/type/field-ref.type'; import { RepeatTypeComponent } from './formly/type/repeat-section.type'; import { SelectAccountComponent } from './formly/type/select-account/select-account.component'; import { InputNoLabelWrapperComponent } from './formly/wrapper/input-no-label.wrapper'; +import { AccountAvailableAmountPipe } from './pipes/account-available-amount.pipe'; import { NegativeAmountPipe } from './pipes/negative-amount.pipe'; -import { ReceiptSummaryComponent } from './components/receipt/receipt-summary/receipt-summary.component'; -import { ReceiptDetailViewComponent } from './components/receipt/receipt-detail-view/receipt-detail-view.component'; import { NoteBadgeColorPipe } from './pipes/note-badge-color.pipe'; -import { AccountAvailableAmountPipe } from './pipes/account-available-amount.pipe'; -import { ReceptionDatesPipe } from './pipes/reception-dates.pipe'; import { PreviewContentPipe } from './pipes/preview-content.pipe'; import { ReceiptLineTotalAmountPipe } from './pipes/receipt-line-total-amount.pipe'; -import { PermissionsService, SharedModule } from '@rero/shared'; -import { OrderEmailFormComponent } from './components/order/order-email-form/order-email-form.component'; -import { PreviewEmailModule } from '../shared/preview-email/preview-email.module'; -import { FormlyPrimeNGModule } from '@ngx-formly/primeng'; +import { ReceptionDatesPipe } from './pipes/reception-dates.pipe'; @NgModule({ declarations: [ @@ -96,7 +95,6 @@ import { FormlyPrimeNGModule } from '@ngx-formly/primeng'; ], imports: [ BsDropdownModule.forRoot(), - PopoverModule.forRoot(), CommonModule, AcquisitionRoutingModule, FormlyModule, @@ -114,10 +112,10 @@ import { FormlyPrimeNGModule } from '@ngx-formly/primeng'; ] }), RecordModule, - TabsModule, CoreModule, SharedModule, - PreviewEmailModule + PreviewEmailModule, + PrimengImportModule ], providers: [ { provide: FORMLY_CONFIG, multi: true, useFactory: registerFormlyExtension, deps: [TranslateService] }, diff --git a/projects/admin/src/app/acquisition/components/account/account-brief-view/account-brief-view.component.html b/projects/admin/src/app/acquisition/components/account/account-brief-view/account-brief-view.component.html index 40a4a6050..f582933fd 100644 --- a/projects/admin/src/app/acquisition/components/account/account-brief-view/account-brief-view.component.html +++ b/projects/admin/src/app/acquisition/components/account/account-brief-view/account-brief-view.component.html @@ -60,22 +60,27 @@
@if (permissions.update.can) { - + } @if (permissions.delete.can) { - + } @else { - -
+ + + + }
diff --git a/projects/admin/src/app/acquisition/components/account/account-brief-view/account-brief-view.component.ts b/projects/admin/src/app/acquisition/components/account/account-brief-view/account-brief-view.component.ts index e5ddb6c46..178465629 100644 --- a/projects/admin/src/app/acquisition/components/account/account-brief-view/account-brief-view.component.ts +++ b/projects/admin/src/app/acquisition/components/account/account-brief-view/account-brief-view.component.ts @@ -21,6 +21,7 @@ import { RecordPermissions } from '@app/admin/classes/permissions'; import { OrganisationService } from '@app/admin/service/organisation.service'; import { RecordPermissionService } from '@app/admin/service/record-permission.service'; import { TranslateService } from '@ngx-translate/core'; +import { CONFIG } from '@rero/ng-core'; import { UserService } from '@rero/shared'; import { MessageService } from 'primeng/api'; import { AcqAccountApiService } from '../../../api/acq-account-api.service'; @@ -99,7 +100,8 @@ export class AccountBriefViewComponent implements OnInit { this.messageService.add({ severity: 'success', summary: this.translateService.instant('Account'), - detail: this.translateService.instant('Account deleted') + detail: this.translateService.instant('Account deleted'), + life: CONFIG.MESSAGE_LIFE }); this.deleteAccount.emit(this.account); }); diff --git a/projects/admin/src/app/acquisition/components/account/account-detail-view/account-detail-view.component.html b/projects/admin/src/app/acquisition/components/account/account-detail-view/account-detail-view.component.html index 5245cadff..a104e2290 100644 --- a/projects/admin/src/app/acquisition/components/account/account-detail-view/account-detail-view.component.html +++ b/projects/admin/src/app/acquisition/components/account/account-detail-view/account-detail-view.component.html @@ -22,32 +22,27 @@ }

{{ account.name }}

-
-
Details
-
-
-
Account number
-
{{ account.number }}
-
Budget
-
{{ account.budget.pid | getRecord: 'budgets': 'field': 'name' | async }}
-
Library
-
{{ account.library.pid | getRecord: 'libraries': 'field': 'name' | async }}
- @if (account.parent) { -
Parent account
-
- - {{ account.parent.pid | getRecord: 'acq_accounts': 'field': 'name' | async }} - -
- } -
-
-
+ +
+
Account number
+
{{ account.number }}
+
Budget
+
{{ account.budget.pid | getRecord: 'budgets': 'field': 'name' | async }}
+
Library
+
{{ account.library.pid | getRecord: 'libraries': 'field': 'name' | async }}
+ @if (account.parent) { +
Parent account
+
+ + {{ account.parent.pid | getRecord: 'acq_accounts': 'field': 'name' | async }} + +
+ } +
+
-
-
Accounting informations
-
+ @@ -115,6 +110,5 @@
Accounting informations
-
-
+ } diff --git a/projects/admin/src/app/acquisition/components/account/account-list/account-list.component.html b/projects/admin/src/app/acquisition/components/account/account-list/account-list.component.html index 844910df0..4c9229bfd 100644 --- a/projects/admin/src/app/acquisition/components/account/account-list/account-list.component.html +++ b/projects/admin/src/app/acquisition/components/account/account-list/account-list.component.html @@ -20,13 +20,13 @@

Acquisition accounts

-
+
Amount
Available
diff --git a/projects/admin/src/app/acquisition/components/account/account-transfer/account-transfer.component.html b/projects/admin/src/app/acquisition/components/account/account-transfer/account-transfer.component.html index c85c79d6d..6a75c6584 100644 --- a/projects/admin/src/app/acquisition/components/account/account-transfer/account-transfer.component.html +++ b/projects/admin/src/app/acquisition/components/account/account-transfer/account-transfer.component.html @@ -16,9 +16,9 @@ along with this program. If not, see . --> @if (accountsToDisplay && organisation) { -
-

Fund transfer

-
+

Fund transfer

+
+ @if (budgets.length > 1) { } +
+
Source
+
+
Amount
+
Available
+
Target
+
+
+ @if (accountsToDisplay.length > 0) { + @for (account of accountsToDisplay; track account) { + + } + } @else { + {{ 'No account available' | translate }} + } +
+ +
} diff --git a/projects/admin/src/app/acquisition/components/account/account-transfer/account-transfer.component.ts b/projects/admin/src/app/acquisition/components/account/account-transfer/account-transfer.component.ts index b3c758476..50bc4c540 100644 --- a/projects/admin/src/app/acquisition/components/account/account-transfer/account-transfer.component.ts +++ b/projects/admin/src/app/acquisition/components/account/account-transfer/account-transfer.component.ts @@ -22,6 +22,7 @@ import { UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms import { Router } from '@angular/router'; import { OrganisationService } from '@app/admin/service/organisation.service'; import { TranslateService } from '@ngx-translate/core'; +import { CONFIG } from '@rero/ng-core'; import { UserService } from '@rero/shared'; import { MessageService } from 'primeng/api'; import { AcqAccountApiService } from '../../../api/acq-account-api.service'; @@ -118,14 +119,17 @@ export class AccountTransferComponent implements OnInit { this.messageService.add({ severity: 'success', summary: this.translateService.instant('Account'), - detail: this.translateService.instant('Fund transfer successful!') + detail: this.translateService.instant('Fund transfer successful!'), + life: CONFIG.MESSAGE_LIFE }); this.router.navigate(['/', 'acquisition', 'accounts']); }, error: (err) => this.messageService.add({ severity: 'error', summary: this.translateService.instant('Account'), - detail:this.translateService.instant(err.error.message) + detail:this.translateService.instant(err.error.message), + sticky: true, + closable: true }), }); } diff --git a/projects/admin/src/app/acquisition/components/budget/budget-brief-view/budgets-brief-view.component.ts b/projects/admin/src/app/acquisition/components/budget/budget-brief-view/budgets-brief-view.component.ts index a9565bf5a..26c7ac9c2 100644 --- a/projects/admin/src/app/acquisition/components/budget/budget-brief-view/budgets-brief-view.component.ts +++ b/projects/admin/src/app/acquisition/components/budget/budget-brief-view/budgets-brief-view.component.ts @@ -23,7 +23,7 @@ import { ResultItem } from '@rero/ng-core'; @Component({ selector: 'admin-budgets-brief-view', template: ` -
+
@if (!record.metadata.is_active) { -
Fiscal year closed
+ } -
+

{{ record.metadata.name }}

-
+
Total
{{ totalAmount | currency:currencyCode:'symbol' }}
diff --git a/projects/admin/src/app/acquisition/components/order/order-brief-view/order-brief-view.component.html b/projects/admin/src/app/acquisition/components/order/order-brief-view/order-brief-view.component.html index 630369169..14f4f9766 100644 --- a/projects/admin/src/app/acquisition/components/order/order-brief-view/order-brief-view.component.html +++ b/projects/admin/src/app/acquisition/components/order/order-brief-view/order-brief-view.component.html @@ -16,7 +16,7 @@ along with this program. If not, see . --> @if (order) { -
+
{{ order.reference }}
diff --git a/projects/admin/src/app/acquisition/components/order/order-detail-view/order-detail-view.component.html b/projects/admin/src/app/acquisition/components/order/order-detail-view/order-detail-view.component.html index f3bfd5b1b..d566d9896 100644 --- a/projects/admin/src/app/acquisition/components/order/order-detail-view/order-detail-view.component.html +++ b/projects/admin/src/app/acquisition/components/order/order-detail-view/order-detail-view.component.html @@ -34,7 +34,12 @@
@if (!order.is_current_budget) { -
Fiscal year closed
+ }

{{ order.reference }}

@@ -52,9 +57,8 @@

{{ order.reference }}

} - - - + + @if (isPermissionsLoaded) { @@ -90,16 +94,14 @@
} - - - + + @if (isPermissionsLoaded) { } - - + @if (historyVersions && historyVersions.length > 1) { - +
@@ -109,8 +111,8 @@
{{ event.description }} - + } - +
} diff --git a/projects/admin/src/app/acquisition/components/order/order-detail-view/order-detail-view.component.ts b/projects/admin/src/app/acquisition/components/order/order-detail-view/order-detail-view.component.ts index 83f677978..9c1c4d7e9 100644 --- a/projects/admin/src/app/acquisition/components/order/order-detail-view/order-detail-view.component.ts +++ b/projects/admin/src/app/acquisition/components/order/order-detail-view/order-detail-view.component.ts @@ -28,6 +28,7 @@ import { Observable, Subscription } from 'rxjs'; import { map } from 'rxjs/operators'; import { AcqOrderHistoryVersion, AcqOrderHistoryVersionResponseInterface, AcqOrderStatus, IAcqOrder } from '../../../classes/order'; import { OrderEmailFormComponent } from '../order-email-form/order-email-form.component'; +import { TranslateService } from '@ngx-translate/core'; @Component({ selector: 'admin-acquisition-order-detail-view', @@ -41,6 +42,7 @@ export class OrderDetailViewComponent implements DetailRecord, OnInit, OnDestroy private recordPermissionService: RecordPermissionService = inject(RecordPermissionService); private acqOrderService: AcqOrderApiService = inject(AcqOrderApiService); private permissionValidator: CurrentLibraryPermissionValidator = inject(CurrentLibraryPermissionValidator); + private translateService: TranslateService = inject(TranslateService); // COMPONENT ATTRIBUTES ===================================================== /** Observable resolving record data */ @@ -124,6 +126,8 @@ export class OrderDetailViewComponent implements DetailRecord, OnInit, OnDestroy */ placeOrderDialog(): void { this.modalRef = this.dialogService.open(OrderEmailFormComponent, { + header: this.translateService.instant('Place order'), + width: '60vw', dismissableMask: true, data: { order: this.order diff --git a/projects/admin/src/app/acquisition/components/order/order-detail-view/order-line/order-line.component.html b/projects/admin/src/app/acquisition/components/order/order-detail-view/order-line/order-line.component.html index 1db0795ae..6065289b7 100644 --- a/projects/admin/src/app/acquisition/components/order/order-detail-view/order-line/order-line.component.html +++ b/projects/admin/src/app/acquisition/components/order/order-detail-view/order-line/order-line.component.html @@ -18,11 +18,14 @@
@if (orderLine && account) {
- +
@if (recordPermissions) { - - + /> - - + /> } @else {   } diff --git a/projects/admin/src/app/acquisition/components/order/order-detail-view/order-lines/order-lines.component.html b/projects/admin/src/app/acquisition/components/order/order-detail-view/order-lines/order-lines.component.html index da3d87af3..6be406878 100644 --- a/projects/admin/src/app/acquisition/components/order/order-detail-view/order-lines/order-lines.component.html +++ b/projects/admin/src/app/acquisition/components/order/order-detail-view/order-lines/order-lines.component.html @@ -21,18 +21,25 @@
Order lines
@if (recordPermissions) { @if (recordPermissions.update.can) { - - {{ 'Add' | translate }} … - + /> } @else { - -
+ + + + } } @else {   diff --git a/projects/admin/src/app/acquisition/components/order/order-email-form/order-email-form.component.html b/projects/admin/src/app/acquisition/components/order/order-email-form/order-email-form.component.html index 1ceba81df..85982686e 100644 --- a/projects/admin/src/app/acquisition/components/order/order-email-form/order-email-form.component.html +++ b/projects/admin/src/app/acquisition/components/order/order-email-form/order-email-form.component.html @@ -26,7 +26,6 @@ (closeDialog)="closeDialog()" (data)="confirmOrder($event)" > - {{ 'Place order' | translate }}

You're about to send the order.

diff --git a/projects/admin/src/app/acquisition/components/order/order-email-form/order-email-form.component.ts b/projects/admin/src/app/acquisition/components/order/order-email-form/order-email-form.component.ts index b03604ec2..78a5ad407 100644 --- a/projects/admin/src/app/acquisition/components/order/order-email-form/order-email-form.component.ts +++ b/projects/admin/src/app/acquisition/components/order/order-email-form/order-email-form.component.ts @@ -22,6 +22,7 @@ import { Notification } from '@app/admin/classes/notification'; import { IPreview, ITypeEmail } from '@app/admin/shared/preview-email/IPreviewInterface'; import { Tools } from '@app/admin/shared/preview-email/utils/tools'; import { TranslateService } from '@ngx-translate/core'; +import { CONFIG } from '@rero/ng-core'; import { MessageService } from 'primeng/api'; import { DynamicDialogConfig, DynamicDialogRef } from 'primeng/dynamicdialog'; import { Subscription } from 'rxjs'; @@ -86,15 +87,15 @@ export class OrderEmailFormComponent implements OnInit, OnDestroy { this.messageService.add({ severity: 'success', summary: this.translateService.instant('Order sent'), - detail: this.translateService.instant('order has been sent') + detail: this.translateService.instant('order has been sent'), + life: CONFIG.MESSAGE_LIFE }); } else { this.messageService.add({ severity: 'warn', summary: this.translateService.instant('Order delayed'), detail: this.translateService.instant('order not yet send'), - sticky: true, - closable: true + life: CONFIG.MESSAGE_LIFE }); } this.acqOrderApiService diff --git a/projects/admin/src/app/acquisition/components/order/order-summary/order-summary.component.html b/projects/admin/src/app/acquisition/components/order/order-summary/order-summary.component.html index c7f6332d3..4081d298e 100644 --- a/projects/admin/src/app/acquisition/components/order/order-summary/order-summary.component.html +++ b/projects/admin/src/app/acquisition/components/order/order-summary/order-summary.component.html @@ -16,7 +16,7 @@ along with this program. If not, see . --> @if (order) { -
+
diff --git a/projects/admin/src/app/acquisition/components/receipt/receipt-detail-view/receipt-detail-view.component.html b/projects/admin/src/app/acquisition/components/receipt/receipt-detail-view/receipt-detail-view.component.html index 78530ec98..433fbfa1c 100644 --- a/projects/admin/src/app/acquisition/components/receipt/receipt-detail-view/receipt-detail-view.component.html +++ b/projects/admin/src/app/acquisition/components/receipt/receipt-detail-view/receipt-detail-view.component.html @@ -66,23 +66,21 @@

{{ receipt.reference }}

@if (permissions) { - - + /> - - + /> }
} @else { diff --git a/projects/admin/src/app/acquisition/components/receipt/receipt-form/order-receipt-form.ts b/projects/admin/src/app/acquisition/components/receipt/receipt-form/order-receipt-form.ts index 98cb632c1..3182ca738 100644 --- a/projects/admin/src/app/acquisition/components/receipt/receipt-form/order-receipt-form.ts +++ b/projects/admin/src/app/acquisition/components/receipt/receipt-form/order-receipt-form.ts @@ -185,7 +185,7 @@ export class OrderReceiptForm { }, { key: 'receiptDate', - type: 'datepicker', + type: 'datePicker', props: { type: 'date', label: _('Reception date'), diff --git a/projects/admin/src/app/acquisition/components/receipt/receipt-form/order-receipt-view.component.ts b/projects/admin/src/app/acquisition/components/receipt/receipt-form/order-receipt-view.component.ts index 85a62be76..17e0a6976 100644 --- a/projects/admin/src/app/acquisition/components/receipt/receipt-form/order-receipt-view.component.ts +++ b/projects/admin/src/app/acquisition/components/receipt/receipt-form/order-receipt-view.component.ts @@ -19,6 +19,7 @@ import { UntypedFormGroup } from '@angular/forms'; import { ActivatedRoute, Router } from '@angular/router'; import { FormlyFieldConfig } from '@ngx-formly/core'; import { TranslateService } from '@ngx-translate/core'; +import { CONFIG } from '@rero/ng-core'; import { MessageService } from 'primeng/api'; import { finalize, tap } from 'rxjs/operators'; import { AcqReceiptApiService } from '../../../api/acq-receipt-api.service'; @@ -156,7 +157,8 @@ export class OrderReceiptViewComponent implements OnInit { this.messageService.add({ severity: 'success', summary: this.translateService.instant('Receipt'), - detail: this.translateService.instant('Receipt operations were successful') + detail: this.translateService.instant('Receipt operations were successful'), + life: CONFIG.MESSAGE_LIFE }); } else { this.messageService.add({ @@ -173,7 +175,8 @@ export class OrderReceiptViewComponent implements OnInit { this.messageService.add({ severity: 'success', summary: this.translateService.instant('Receipt'), - detail: this.translateService.instant('Receipt operations were successful') + detail: this.translateService.instant('Receipt operations were successful'), + life: CONFIG.MESSAGE_LIFE }); this.redirectToOrder(); } diff --git a/projects/admin/src/app/acquisition/components/receipt/receipt-list/receipt-list.component.html b/projects/admin/src/app/acquisition/components/receipt/receipt-list/receipt-list.component.html index fc7fff347..47aa79a11 100644 --- a/projects/admin/src/app/acquisition/components/receipt/receipt-list/receipt-list.component.html +++ b/projects/admin/src/app/acquisition/components/receipt/receipt-list/receipt-list.component.html @@ -24,17 +24,24 @@
@if (recordPermissions) { @if (recordPermissions.create.can) { - - {{ 'Add' | translate }} … - + /> } @else { - -
+ + + + } } @else {   diff --git a/projects/admin/src/app/acquisition/components/receipt/receipt-summary/receipt-summary.component.html b/projects/admin/src/app/acquisition/components/receipt/receipt-summary/receipt-summary.component.html index 525d70e8d..16651da53 100644 --- a/projects/admin/src/app/acquisition/components/receipt/receipt-summary/receipt-summary.component.html +++ b/projects/admin/src/app/acquisition/components/receipt/receipt-summary/receipt-summary.component.html @@ -112,33 +112,31 @@
- {{ 'Resume' | translate }} - + /> - - + /> - - + />
} } @else { diff --git a/projects/admin/src/app/acquisition/formly/type/repeat-section.type.ts b/projects/admin/src/app/acquisition/formly/type/repeat-section.type.ts index 9cbeb42ac..c44184c87 100644 --- a/projects/admin/src/app/acquisition/formly/type/repeat-section.type.ts +++ b/projects/admin/src/app/acquisition/formly/type/repeat-section.type.ts @@ -20,6 +20,74 @@ import { FieldArrayType } from '@ngx-formly/core'; @Component({ selector: 'admin-formly-repeat-section', template: ` + + + @if (field.props.label || field.props.addButton) { + + } + + @if (field.fieldGroup.length > 0) { +
+
+
+
+ @for (field of field.fieldGroup[0].fieldGroup; track field) { + @if (field.className) { +
+ {{ field.props.label|translate }} + @if (field.props.required) { +  * + } +
+ } + } +
+
+
+ @for (f of field.fieldGroup; track f; let i = $index) { +
+ @if (f.fieldGroup.length > 0) { + + @if (field.props.trashButton) { +
+ @if (showTrash) { + + } @else { +   + } +
+ } + } +
+ } +
+ } +
+ ` }) export class RepeatTypeComponent extends FieldArrayType { diff --git a/projects/admin/src/app/app.module.ts b/projects/admin/src/app/app.module.ts index 82cd4dee3..69de42648 100644 --- a/projects/admin/src/app/app.module.ts +++ b/projects/admin/src/app/app.module.ts @@ -38,12 +38,7 @@ import { } from '@rero/ng-core'; import { AppSettingsService, ItemHoldingsCallNumberPipe, MainTitlePipe, SharedModule, UserService } from '@rero/shared'; import { NgxChartsModule } from '@swimlane/ngx-charts'; -import { CollapseModule } from 'ngx-bootstrap/collapse'; -import { BsDatepickerModule, BsLocaleService } from 'ngx-bootstrap/datepicker'; import { BsDropdownModule } from 'ngx-bootstrap/dropdown'; -import { PopoverModule } from 'ngx-bootstrap/popover'; -import { TabsModule } from 'ngx-bootstrap/tabs'; -import { TooltipModule } from 'ngx-bootstrap/tooltip'; import { FileUploadModule } from 'primeng/fileupload'; import { MenubarModule } from 'primeng/menubar'; import { TableModule } from "primeng/table"; @@ -181,6 +176,7 @@ import { ReportsListComponent } from './record/detail-view/statistics-cfg-detail import { StatisticsCfgDetailViewComponent } from './record/detail-view/statistics-cfg-detail-view/statistics-cfg-detail-view.component'; import { TemplateDetailViewComponent } from './record/detail-view/template-detail-view/template-detail-view.component'; import { VendorDetailViewComponent } from './record/detail-view/vendor-detail-view/vendor-detail-view.component'; +import { AddEntityLocalFormComponent } from './record/editor/formly/primeng/entity-autocomplete/add-entity-local-form/add-entity-local-form.component'; import { remoteAutocompleteToken } from './record/editor/formly/primeng/remote-autocomplete/remote-autocomplete-factory.service'; import { DocumentsRemoteService } from './record/editor/formly/primeng/remote-autocomplete/remote/documents-remote.service'; import { ItemsRemoteService } from './record/editor/formly/primeng/remote-autocomplete/remote/items-remote.service'; @@ -191,7 +187,6 @@ import { RepeatTypeComponent } from './record/editor/type/repeat-section.type'; import { IdentifiedbyValueComponent } from './record/editor/wrappers/identifiedby-value.component'; import { UserIdComponent } from './record/editor/wrappers/user-id.component'; import { CipoPatronTypeItemTypeComponent } from './record/formly/type/cipo-patron-type-item-type/cipo-patron-type-item-type.component'; -import { AddEntityLocalFormComponent } from './record/editor/formly/primeng/entity-autocomplete/add-entity-local-form/add-entity-local-form.component'; import { OperationLogsDialogComponent } from './record/operation-logs/operation-logs-dialog/operation-logs-dialog.component'; import { OperationLogsComponent } from './record/operation-logs/operation-logs.component'; import { DocumentAdvancedSearchFormComponent } from './record/search-view/document-advanced-search-form/document-advanced-search-form.component'; @@ -211,8 +206,8 @@ import { CurrentLibraryPermissionValidator } from './utils/permissions'; import { CustomShortcutHelpComponent } from './widgets/custom-shortcut-help/custom-shortcut-help.component'; import { FrontpageComponent } from './widgets/frontpage/frontpage.component'; -import { RemoteAutocompleteService as UiRemoteAutocompleteService } from './record/editor/formly/primeng/remote-autocomplete/remote-autocomplete.service'; import { EntityAutocompleteComponent } from './record/editor/formly/primeng/entity-autocomplete/entity-autocomplete.component'; +import { RemoteAutocompleteService as UiRemoteAutocompleteService } from './record/editor/formly/primeng/remote-autocomplete/remote-autocomplete.service'; /** Init application factory */ export function appInitFactory(appInitializerService: AppInitializerService): () => Observable { @@ -363,18 +358,13 @@ export function appInitFactory(appInitializerService: AppInitializerService): () AppRoutingModule, BrowserAnimationsModule, BrowserModule, - BsDatepickerModule.forRoot(), BsDropdownModule.forRoot(), NgxChartsModule, - CollapseModule.forRoot(), FormsModule, HttpClientModule, ReactiveFormsModule, RecordModule, - TabsModule.forRoot(), TableModule, - TooltipModule.forRoot(), - PopoverModule.forRoot(), FormlyModule.forRoot({ types: [ { name: "cipo-pt-it", component: CipoPatronTypeItemTypeComponent }, @@ -449,7 +439,6 @@ export function appInitFactory(appInitializerService: AppInitializerService): () useFactory: (translate: TranslateService) => translate.currentLang, deps: [TranslateService], }, - BsLocaleService, MainTitlePipe, TruncateTextPipe, CurrentLibraryPermissionValidator, diff --git a/projects/admin/src/app/circulation/checkin/checkin-action/checkin-action.component.html b/projects/admin/src/app/circulation/checkin/checkin-action/checkin-action.component.html index e9387b453..409f78995 100644 --- a/projects/admin/src/app/circulation/checkin/checkin-action/checkin-action.component.html +++ b/projects/admin/src/app/circulation/checkin/checkin-action/checkin-action.component.html @@ -1,6 +1,6 @@ -
@if (last) { @if (allowIssueCreation) { - + } @if (allowIssueCreation) { - + } } @@ -107,39 +114,32 @@

Holdings

@if (receivedItems.length < totalReceivedItems) {
- + + + {{ 'Show more' | translate }} … + ({{ showMoreIssuesCounter }})
} -
- - + - - - + + Details -
- -
-
- + + - - @if (displayLocalFieldsTab) { - - - Local fields - -
- -
-
- } - - + + + Local fields + + + + + diff --git a/projects/admin/src/app/record/detail-view/holding-detail-view/serial-holding-detail-view/serial-holding-detail-view.component.ts b/projects/admin/src/app/record/detail-view/holding-detail-view/serial-holding-detail-view/serial-holding-detail-view.component.ts index e21cea5b2..78bd51e67 100644 --- a/projects/admin/src/app/record/detail-view/holding-detail-view/serial-holding-detail-view/serial-holding-detail-view.component.ts +++ b/projects/admin/src/app/record/detail-view/holding-detail-view/serial-holding-detail-view/serial-holding-detail-view.component.ts @@ -19,7 +19,7 @@ import { Component, inject, Input, OnInit } from '@angular/core'; import { RecordPermissions } from '@app/admin/classes/permissions'; import { HoldingsService, PredictionIssue } from '@app/admin/service/holdings.service'; import { TranslateService } from '@ngx-translate/core'; -import { Record, RecordService } from '@rero/ng-core'; +import { CONFIG, Record, RecordService } from '@rero/ng-core'; import { IPermissions, IssueItemStatus, PERMISSIONS, PermissionsService, UserService } from '@rero/shared'; import { MessageService } from 'primeng/api'; @@ -133,7 +133,8 @@ export class SerialHoldingDetailViewComponent implements OnInit { this.messageService.add({ severity: 'success', summary: this.translateService.instant('Issue'), - detail: this.translateService.instant('New issue created.') + detail: this.translateService.instant('New issue created.'), + life: CONFIG.MESSAGE_LIFE }); // change item structure to have same structure as received items const item = { @@ -148,7 +149,9 @@ export class SerialHoldingDetailViewComponent implements OnInit { this.messageService.add({ severity: 'error', summary: this.translateService.instant('Issue creation failed!'), - detail: `[${error.status}-${error.statusText}] ${error.error.message}` + detail: `[${error.status}-${error.statusText}] ${error.error.message}`, + sticky: true, + closable: true }); } }); diff --git a/projects/admin/src/app/record/detail-view/item-detail-view/item-detail-view.component.html b/projects/admin/src/app/record/detail-view/item-detail-view/item-detail-view.component.html index 83b25f2cb..e3e9cfd58 100644 --- a/projects/admin/src/app/record/detail-view/item-detail-view/item-detail-view.component.html +++ b/projects/admin/src/app/record/detail-view/item-detail-view/item-detail-view.component.html @@ -215,54 +215,44 @@

Issue data

- - - - + + + {{ 'Circulation' | translate }} -
- - - - - @if (record.metadata | keyExists:'legacy_checkout_count') { -
-
-
-
-
- Legacy checkout count -
-
- {{ record.metadata.legacy_checkout_count }} -
-
-
+ + + + @if (record.metadata | keyExists:'legacy_checkout_count') { +
+
+
+
+
+ Legacy checkout count +
+
+ {{ record.metadata.legacy_checkout_count }} +
+
-
- } -
- - - - +
+
+ } + + + + {{ 'Local fields' | translate }} -
- -
- - - + +
+ @if (record.metadata?.issue?.claims) { - - + + {{ 'Claim' | translate }} @@ -271,17 +261,15 @@

Issue data

{{ record.metadata.issue.claims.counter }}
-
-
    - @for (date of claimsDates; track date) { -
  • - {{ date | dateTranslate: 'shortDate' }} - {{ date | dateTranslate: 'shortTime' }} -
  • - } -
-
-
+
    + @for (date of claimsDates; track date) { +
  • + {{ date | dateTranslate: 'shortDate' }} - {{ date | dateTranslate: 'shortTime' }} +
  • + } +
+ } - +
} diff --git a/projects/admin/src/app/record/detail-view/item-detail-view/item-transactions/item-transactions.component.ts b/projects/admin/src/app/record/detail-view/item-detail-view/item-transactions/item-transactions.component.ts index d3c6165e9..7d7d3cc0d 100644 --- a/projects/admin/src/app/record/detail-view/item-detail-view/item-transactions/item-transactions.component.ts +++ b/projects/admin/src/app/record/detail-view/item-detail-view/item-transactions/item-transactions.component.ts @@ -18,6 +18,7 @@ import { Component, EventEmitter, inject, Input, OnDestroy, OnInit, Output } from '@angular/core'; import { LoanService } from '@app/admin/service/loan.service'; import { TranslateService } from '@ngx-translate/core'; +import { CONFIG } from '@rero/ng-core'; import { IPermissions, PERMISSIONS, UserService } from '@rero/shared'; import { MessageService } from 'primeng/api'; import { DialogService } from 'primeng/dynamicdialog'; @@ -76,6 +77,8 @@ export class ItemTransactionsComponent implements OnInit, OnDestroy { */ addRequest(): void { const ref = this.dialogService.open(ItemRequestComponent, { + header: this.translateService.instant('Item request'), + width: '40vw', data: { recordPid: this.itemPid, recordType: 'item' } }); this.subscription.add( @@ -99,7 +102,8 @@ export class ItemTransactionsComponent implements OnInit, OnDestroy { this.messageService.add({ severity: 'warn', summary: this.translateService.instant('Request'), - detail: this.translateService.instant('The pending request has been cancelled.') + detail: this.translateService.instant('The pending request has been cancelled.'), + life: CONFIG.MESSAGE_LIFE }); this.requestEvent.emit(); this._refreshRequestList(); @@ -117,7 +121,8 @@ export class ItemTransactionsComponent implements OnInit, OnDestroy { this.messageService.add({ severity: 'success', summary: this.translateService.instant('Request'), - detail: this.translateService.instant('The pickup location has been changed.') + detail: this.translateService.instant('The pickup location has been changed.'), + life: CONFIG.MESSAGE_LIFE }); this._refreshRequestList(); }); diff --git a/projects/admin/src/app/record/detail-view/library-detail-view/library-detail-view.component.html b/projects/admin/src/app/record/detail-view/library-detail-view/library-detail-view.component.html index 4d3f40c70..172017081 100644 --- a/projects/admin/src/app/record/detail-view/library-detail-view/library-detail-view.component.html +++ b/projects/admin/src/app/record/detail-view/library-detail-view/library-detail-view.component.html @@ -48,16 +48,22 @@

{{ record.name }}

-
- - Locations +
+
+ + Locations +
@if (isUserCanAddLocation && activeIndex === 0) { - - {{ 'Add' | translate }} … - +
+ +
}
diff --git a/projects/admin/src/app/record/detail-view/library-detail-view/location/location.component.html b/projects/admin/src/app/record/detail-view/library-detail-view/location/location.component.html index 0d24e917a..503106edd 100644 --- a/projects/admin/src/app/record/detail-view/library-detail-view/location/location.component.html +++ b/projects/admin/src/app/record/detail-view/library-detail-view/location/location.component.html @@ -20,39 +20,49 @@
@if (location.metadata.is_pickup) { - + } @if (location.metadata.is_ill_pickup) { - + } @if (location.metadata.is_online) { - + }
@if (permissions.update.can) { - + } @if (permissions.delete.can) { - + } @else { - -
+ + + + }
diff --git a/projects/admin/src/app/record/detail-view/local-field/local-field.component.html b/projects/admin/src/app/record/detail-view/local-field/local-field.component.html index 817d19f99..eec34014e 100644 --- a/projects/admin/src/app/record/detail-view/local-field/local-field.component.html +++ b/projects/admin/src/app/record/detail-view/local-field/local-field.component.html @@ -18,7 +18,7 @@ @defer (when isLoading) { @if (localFields.length > 0) {
-
+
@for (field of localFields; track field) {
{{ 'local_' + field.name }}
{{ field.value | join:'; ' }}
@@ -28,25 +28,25 @@
@if (recordPermissions) { @if (recordPermissions.update.can) { - + size="small" + styleClass="mr-1" + /> } @if (recordPermissions.delete.can) { - + } } @else {   @@ -55,14 +55,13 @@
} @else { } diff --git a/projects/admin/src/app/record/detail-view/location-detail-view/location-detail-view.component.html b/projects/admin/src/app/record/detail-view/location-detail-view/location-detail-view.component.html index 2da212c21..5bdbaf68c 100644 --- a/projects/admin/src/app/record/detail-view/location-detail-view/location-detail-view.component.html +++ b/projects/admin/src/app/record/detail-view/location-detail-view/location-detail-view.component.html @@ -20,26 +20,26 @@

{{ data.name | translate }}

-
-
Library
-
+
+
Library
+
{{ data.library.pid | getRecord: 'libraries' : 'field' : 'name' | async }}
-
-
Name
-
{{ data.name }}
+
+
Name
+
{{ data.name }}
-
-
Code
-
{{ data.code }}
+
+
Code
+
{{ data.code }}
-
-
Is online
-
+
+
Is online
+
{{ data.name | translate }}
-
-
Is pickup
-
+
+
Is pickup
+
{{ data.name | translate }}
@if (data.pickup_name !== undefined && data.is_pickup) { -
-
Pickup location name
-
{{ data.pickup_name }}
+
+
Pickup location name
+
{{ data.pickup_name }}
}

Restrictions

-
-
Allow request
-
+
+
Allow request
+
Restrictions
@if (data.allow_request) { -
-
Send notification
-
+
+
Send notification
+
Restrictions } @if (data.send_notification && data.allow_request) { -
-
Contact email
-
{{ data.notification_email }}
+
+
Contact email
+
{{ data.notification_email }}
} @if (data.restrict_pickup_to && data.allow_request) { -
-
Restrict pickup to
-
+
+
Restrict pickup to
+
    @for (location of data.restrict_pickup_to; track location) {
  • diff --git a/projects/admin/src/app/record/detail-view/organisation-detail-view/organisation-detail-view.component.html b/projects/admin/src/app/record/detail-view/organisation-detail-view/organisation-detail-view.component.html index 0aa85f3bb..4f37d7ad2 100644 --- a/projects/admin/src/app/record/detail-view/organisation-detail-view/organisation-detail-view.component.html +++ b/projects/admin/src/app/record/detail-view/organisation-detail-view/organisation-detail-view.component.html @@ -16,26 +16,26 @@ --> @if (record$ | async; as record) {

    {{ record.metadata.name }}

    -
    +
    @if (record.metadata.address) { -
    Address
    -
    +
    Address
    +
    } @if (record.metadata.code) { -
    Code
    -
    {{ record.metadata.code }}
    +
    Code
    +
    {{ record.metadata.code }}
    } @if (record.metadata.default_currency) { -
    Default currency
    -
    {{ record.metadata.default_currency }}
    +
    Default currency
    +
    {{ record.metadata.default_currency }}
    }
    @if (isEnabledOperationLog) { - + } } diff --git a/projects/admin/src/app/record/detail-view/patron-types-detail-view/patron-types-detail-view.component.html b/projects/admin/src/app/record/detail-view/patron-types-detail-view/patron-types-detail-view.component.html index fa07ebba7..a9c9c5313 100644 --- a/projects/admin/src/app/record/detail-view/patron-types-detail-view/patron-types-detail-view.component.html +++ b/projects/admin/src/app/record/detail-view/patron-types-detail-view/patron-types-detail-view.component.html @@ -16,84 +16,86 @@ --> @if (record$ | async; as record) {

    {{ record.metadata.name }}

    -
    +
    @if (record.metadata.code) { -
    Code
    -
    {{ record.metadata.code }}
    +
    Code
    +
    {{ record.metadata.code }}
    } @if (record.metadata.description) { -
    Description
    -
    {{ record.metadata.description }}
    - +
    Description
    +
    {{ record.metadata.description }}
    } -
    Yearly subscription
    -
    - @if (record.metadata.subscription_amount > 0) { - - } @else { - - } +
    Yearly subscription
    +
    +
    @if (record.metadata.subscription_amount) { -
    Subscription amount
    -
    {{ record.metadata.subscription_amount | currency: organisation.default_currency }}
    +
    Subscription amount
    +
    {{ record.metadata.subscription_amount | currency: organisation.default_currency }}
    } @if (record.metadata.limits) {

    Limits

    -
    - -
    - - Limit by checkouts -
    + + + +
    + + Limit by checkouts +
    +
    @if (record.metadata.limits.checkout_limits) { -
    -
    -
    General limit
    -
    {{ record.metadata.limits.checkout_limits.global_limit }}
    +
    +
    General limit
    +
    {{ record.metadata.limits.checkout_limits.global_limit }}
    +
    + @if (record.metadata.limits.checkout_limits.library_limit) { +
    Library limit
    +
    {{ record.metadata.limits.checkout_limits.library_limit }}
    - @if (record.metadata.limits.checkout_limits.library_limit) { -
    Library limit
    -
    {{ record.metadata.limits.checkout_limits.library_limit }}
    -
    - } - @if (record.metadata.limits.checkout_limits.library_exceptions) { -
    Exceptions
    -
    -
      - @for (exception of record.metadata.limits.checkout_limits.library_exceptions; track exception) { -
    • -
      - - {{ exception.library.pid | getRecord: 'libraries' : 'field' : 'name' | async }} -
      -
      {{ exception.value }}
      -
    • - } -
    -
    - } -
    -
    + } + @if (record.metadata.limits.checkout_limits.library_exceptions) { +
    Exceptions
    +
    +
      + @for (exception of record.metadata.limits.checkout_limits.library_exceptions; track exception) { +
    • +
      + + {{ exception.library.pid | getRecord: 'libraries' : 'field' : 'name' | async }} +
      +
      {{ exception.value }}
      +
    • + } +
    +
    + } +
    } - -
    - - Limit by fee amount -
    + + + + +
    + + Limit by fee amount +
    +
    @if (record.metadata.limits.fee_amount_limits) {
    @@ -102,14 +104,18 @@

    Limits

    } - -
    - - Limit by overdue items -
    +
    + + + +
    + + Limit by overdue items +
    +
    @if (record.metadata.limits.overdue_items_limits) {
    @@ -118,15 +124,19 @@

    Limits

    } - -
    - - Limit to unpaid subscription -
    -
+ + + + +
+ + Limit to unpaid subscription +
+
+
} diff --git a/projects/admin/src/app/record/detail-view/statistics-cfg-detail-view/reports-list/reports-list.component.html b/projects/admin/src/app/record/detail-view/statistics-cfg-detail-view/reports-list/reports-list.component.html index 6813856dc..62651d4cd 100644 --- a/projects/admin/src/app/record/detail-view/statistics-cfg-detail-view/reports-list/reports-list.component.html +++ b/projects/admin/src/app/record/detail-view/statistics-cfg-detail-view/reports-list/reports-list.component.html @@ -14,27 +14,24 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . --> - @if (reports?.length) { - - - @for (report of reports; track report) { - - - - - } - -
- - {{ report.created | dateTranslate: 'longDate' }} - - - - - - -
+ + + + + + {{ report.created | dateTranslate: 'longDate' }} + + + + + + + + + + + } @else {

No result

} diff --git a/projects/admin/src/app/record/detail-view/statistics-cfg-detail-view/statistics-cfg-detail-view.component.html b/projects/admin/src/app/record/detail-view/statistics-cfg-detail-view/statistics-cfg-detail-view.component.html index bca1a8862..ec566fcd0 100644 --- a/projects/admin/src/app/record/detail-view/statistics-cfg-detail-view/statistics-cfg-detail-view.component.html +++ b/projects/admin/src/app/record/detail-view/statistics-cfg-detail-view/statistics-cfg-detail-view.component.html @@ -14,14 +14,13 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . --> - @if (record) {

{{ record.metadata.name }}

-
+
Library
{{ record.metadata.library.$ref | getRecord: 'libraries' : 'field' : 'name' | async }}
@@ -48,63 +47,62 @@

{{ record.metadata.name }}

}
-
-
Configuration
-
-
+ +
-
Category
-
{{ record.metadata.category.type | translate }}
+
Category
+
{{ record.metadata.category.type | translate }}
-
Indicator
-
{{ record.metadata.category.indicator.type | translate }}
+
Indicator
+
{{ record.metadata.category.indicator.type | translate }}
- @if (record.metadata.category.indicator.period) { -
Period
-
{{ record.metadata.category.indicator.period | translate }}
- } + @if (record.metadata.category.indicator.period) { +
Period
+
{{ record.metadata.category.indicator.period | translate }}
+ } - @if (record.metadata.category.indicator.distributions) { -
Distributions
-
-
    - @for (dist of record.metadata.category.indicator.distributions; track dist; let last = $last) { -
  • {{ dist | translate }}{{ last ? '' : ' / ' }}
  • - } -
-
- } + @if (record.metadata.category.indicator.distributions) { +
Distributions
+
+
    + @for (dist of record.metadata.category.indicator.distributions; track dist; let last = $last) { +
  • {{ dist | translate }}{{ last ? '' : ' / ' }}
  • + } +
+
+ } - @if (record.metadata.category.indicator.filter) { -
Filter
-
{{ record.metadata.category.indicator.filter }}
- } - @if (record.created) { -
Created at
-
{{ record.created | dateTranslate: 'medium' }}
- } - @if (record.updated) { -
Updated at
-
{{ record.updated | dateTranslate: 'medium' }}
- } -
-
-
+ @if (record.metadata.category.indicator.filter) { +
Filter
+
{{ record.metadata.category.indicator.filter }}
+ } + @if (record.created) { +
Created at
+
{{ record.created | dateTranslate: 'medium' }}
+ } + @if (record.updated) { +
Updated at
+
{{ record.updated | dateTranslate: 'medium' }}
+ } +
+
- - - - Reports - - - - - - {{ 'Live Values' | translate }} - + + + + + @if (liveData) { } - - + @if (liveDataError) { + + } + + } diff --git a/projects/admin/src/app/record/detail-view/statistics-cfg-detail-view/statistics-cfg-detail-view.component.ts b/projects/admin/src/app/record/detail-view/statistics-cfg-detail-view/statistics-cfg-detail-view.component.ts index d97fa37ef..387adedc6 100644 --- a/projects/admin/src/app/record/detail-view/statistics-cfg-detail-view/statistics-cfg-detail-view.component.ts +++ b/projects/admin/src/app/record/detail-view/statistics-cfg-detail-view/statistics-cfg-detail-view.component.ts @@ -16,18 +16,21 @@ */ import { HttpClient } from "@angular/common/http"; import { Component, inject, OnDestroy, OnInit } from '@angular/core'; -import { ApiService } from "@rero/ng-core"; +import { AppConfigService } from "@app/admin/service/app-config.service"; +import { TranslateService } from "@ngx-translate/core"; import { DetailRecord } from '@rero/ng-core/lib/record/detail/view/detail-record'; +import { TabViewChangeEvent } from "primeng/tabview"; import { Observable, Subscription } from 'rxjs'; @Component({ - selector: "admin-statitics-cfg-view", + selector: "admin-statistics-cfg-view", templateUrl: "./statistics-cfg-detail-view.component.html", }) export class StatisticsCfgDetailViewComponent implements DetailRecord, OnInit, OnDestroy { private httpClient: HttpClient = inject(HttpClient); - private apiService: ApiService = inject(ApiService); + private appConfigService: AppConfigService = inject(AppConfigService); + private translateService: TranslateService = inject(TranslateService); /** Observable resolving record data */ record$: Observable; @@ -41,6 +44,9 @@ export class StatisticsCfgDetailViewComponent implements DetailRecord, OnInit, O // the current preview values liveData: any = null; + // Error on data loading + liveDataError: string = undefined; + /** Subscription to (un)follow the record$ Observable */ private subscriptions = new Subscription(); @@ -62,10 +68,28 @@ export class StatisticsCfgDetailViewComponent implements DetailRecord, OnInit, O if (this.liveData != null) { return; } + this.liveDataError = undefined; const { pid } = this.record.metadata; - const baseUrl = this.apiService.endpointPrefix; + const baseUrl = this.appConfigService.apiEndpointPrefix; this.httpClient .get(`${baseUrl}/stats_cfg/live/${pid}`) - .subscribe((res) => (this.liveData = res)); + .subscribe({ + next: (res) => (this.liveData = res), + error: () => this.liveDataError = this.translateService.instant('Data loading error') + }); + } + + /** + * Handles the TabView change event to update live values. + * + * This method is called when the active tab in the TabView changes. If the new tab index is 1, + * it triggers the `getLiveValues` method to refresh the data displayed in the application. + * + * @param {TabViewChangeEvent} event - The event object that contains details about the tab change. + */ + tabViewChange(event: TabViewChangeEvent): void { + if (event.index == 1) { + this.getLiveValues(); + } } } diff --git a/projects/admin/src/app/record/detail-view/template-detail-view/template-detail-view.component.html b/projects/admin/src/app/record/detail-view/template-detail-view/template-detail-view.component.html index 7aaec93de..22f954dc9 100644 --- a/projects/admin/src/app/record/detail-view/template-detail-view/template-detail-view.component.html +++ b/projects/admin/src/app/record/detail-view/template-detail-view/template-detail-view.component.html @@ -21,7 +21,7 @@

}

-
+
@if (record.metadata.description) {
diff --git a/projects/admin/src/app/record/detail-view/template-detail-view/template-detail-view.component.ts b/projects/admin/src/app/record/detail-view/template-detail-view/template-detail-view.component.ts index 3aa5c0635..b75686d48 100644 --- a/projects/admin/src/app/record/detail-view/template-detail-view/template-detail-view.component.ts +++ b/projects/admin/src/app/record/detail-view/template-detail-view/template-detail-view.component.ts @@ -41,10 +41,10 @@ export class TemplateDetailViewComponent implements OnInit, OnDestroy { record: any; /** Css classes for dd in template */ - ddCssClass = 'col-sm-9 mb-0'; + ddCssClass = 'col-9 mb-0'; /** Css classes for dt in template */ - dtCssClass = 'col-sm-3'; + dtCssClass = 'col-3'; /** Record subscription */ private recordSubscription: Subscription; diff --git a/projects/admin/src/app/record/detail-view/vendor-detail-view/vendor-detail-view.component.html b/projects/admin/src/app/record/detail-view/vendor-detail-view/vendor-detail-view.component.html index 11794b1b1..6325e1a97 100644 --- a/projects/admin/src/app/record/detail-view/vendor-detail-view/vendor-detail-view.component.html +++ b/projects/admin/src/app/record/detail-view/vendor-detail-view/vendor-detail-view.component.html @@ -18,62 +18,59 @@

{{ record.metadata.name }}

-
+
@if (record.metadata.website) { -
Website
-
+
Website
+
{{ record.metadata.website }}
} @if (record.metadata.communication_language && record.metadata.communication_language.length > 0) { -
Communication language
-
+
Communication language
+
{{ record.metadata.communication_language | translateLanguage:currentLanguage }}
} @if (record.metadata.currency) { -
Currency
-
{{ record.metadata.currency }}
+
Currency
+
{{ record.metadata.currency }}
} @if (record.metadata.tva_rate) { -
VAT
-
{{ record.metadata.tva_rate }}
+
VAT
+
{{ record.metadata.tva_rate }}
} @if (record.metadata.note) { -
Note
-
{{ record.metadata.note }}
+
Note
+
{{ record.metadata.note }}
}
-
- +
+ @if (filterContact(record.metadata.contacts, 'default'); as defaultContact) { - - - + + + } @if (filterContact(record.metadata.contacts, 'order'); as orderContact) { - - - + + + } - +
@if (isEnabledOperationLog) { - + }
} diff --git a/projects/admin/src/app/record/editor/formly/primeng/entity-autocomplete/add-entity-local-form/add-entity-local-form.component.ts b/projects/admin/src/app/record/editor/formly/primeng/entity-autocomplete/add-entity-local-form/add-entity-local-form.component.ts index e12adc25a..f7deac104 100644 --- a/projects/admin/src/app/record/editor/formly/primeng/entity-autocomplete/add-entity-local-form/add-entity-local-form.component.ts +++ b/projects/admin/src/app/record/editor/formly/primeng/entity-autocomplete/add-entity-local-form/add-entity-local-form.component.ts @@ -106,7 +106,9 @@ export class AddEntityLocalFormComponent implements OnInit, OnDestroy { error: () => this.messageService.add({ severity: 'error', summary: this.translateService.instant('Add local entity'), - detail: this.translateService.instant('Data submission generated an error.') + detail: this.translateService.instant('Data submission generated an error.'), + sticky: true, + closable: true }) })); } diff --git a/projects/admin/src/app/record/editor/formly/primeng/remote-autocomplete/remote/patrons-remote.service.ts b/projects/admin/src/app/record/editor/formly/primeng/remote-autocomplete/remote/patrons-remote.service.ts index 6bbd916ce..b142141df 100644 --- a/projects/admin/src/app/record/editor/formly/primeng/remote-autocomplete/remote/patrons-remote.service.ts +++ b/projects/admin/src/app/record/editor/formly/primeng/remote-autocomplete/remote/patrons-remote.service.ts @@ -16,7 +16,7 @@ */ import { inject, Injectable } from '@angular/core'; import { IRemoteAutocomplete } from './i-remote-autocomplete'; -import { ApiService, RecordService, SuggestionMetadata } from '@rero/ng-core'; +import { ApiService, RecordService } from '@rero/ng-core'; import { IQueryOptions, ISuggestionItem } from '@rero/ng-core/lib/record/editor/formly/primeng/remote-autocomplete/remote-autocomplete.interface'; import { catchError, map, Observable, of } from 'rxjs'; import { PatronService } from '@app/admin/service/patron.service'; @@ -74,7 +74,7 @@ export class PatronsRemoteService implements IRemoteAutocomplete { ); } - private getPatronsRef(metadata: any, query: string): SuggestionMetadata { + private getPatronsRef(metadata: any, query: string): ISuggestionItem { return { label: this.patronService.getFormattedName(metadata), value: this.apiService.getRefEndpoint(this.getName(), metadata.pid) diff --git a/projects/admin/src/app/record/editor/type/field-custom.type.ts b/projects/admin/src/app/record/editor/type/field-custom.type.ts index 5cfb664f9..20f6d2412 100644 --- a/projects/admin/src/app/record/editor/type/field-custom.type.ts +++ b/projects/admin/src/app/record/editor/type/field-custom.type.ts @@ -23,7 +23,7 @@ import { FieldType, FieldTypeConfig } from '@ngx-formly/core';
@if (props.label && props.hideLabel !== true) { -