+
+
- @if (serialPatternsTemplate != null) {
-
diff --git a/projects/admin/src/app/record/custom-editor/holding-editor/holding-editor.component.ts b/projects/admin/src/app/record/custom-editor/holding-editor/holding-editor.component.ts
index 1a4caeccc..8d20f3176 100644
--- a/projects/admin/src/app/record/custom-editor/holding-editor/holding-editor.component.ts
+++ b/projects/admin/src/app/record/custom-editor/holding-editor/holding-editor.component.ts
@@ -1,6 +1,6 @@
/*
* RERO ILS UI
- * Copyright (C) 2020-2024 RERO
+ * Copyright (C) 2020-2025 RERO
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
@@ -17,7 +17,7 @@
import { Component, inject, OnDestroy, OnInit } from '@angular/core';
import { AbstractCanDeactivateComponent, removeEmptyValues } from '@rero/ng-core';
import { BehaviorSubject, of, Subscription } from 'rxjs';
-import { catchError, debounceTime, distinctUntilChanged, switchMap } from 'rxjs/operators';
+import { catchError, debounceTime, distinctUntilChanged, switchMap, tap } from 'rxjs/operators';
import { EditorService } from '../../../service/editor.service';
import { PredictionIssue } from '../../../service/holdings.service';
@@ -98,14 +98,13 @@ export class HoldingEditorComponent extends AbstractCanDeactivateComponent imple
*/
modelChanged(modelValue) {
modelValue = removeEmptyValues(modelValue);
- if (
- modelValue.patterns
- && modelValue.patterns.template
- ) {
+ if (modelValue.patterns && modelValue.patterns.template) {
this.serialPatternsTemplate = modelValue.patterns.template;
this.serialPreviewError = null;
+ this.serialPreviewExamples = [];
this.predictionModel$.next(modelValue);
} else {
+ this.serialPreviewExamples = [];
this.serialPatternsTemplate = null;
}
}
diff --git a/projects/admin/src/app/record/detail-view/circ-policy-detail-view/circ-policy-detail-view.component.html b/projects/admin/src/app/record/detail-view/circ-policy-detail-view/circ-policy-detail-view.component.html
index 306d97734..940399cdb 100644
--- a/projects/admin/src/app/record/detail-view/circ-policy-detail-view/circ-policy-detail-view.component.html
+++ b/projects/admin/src/app/record/detail-view/circ-policy-detail-view/circ-policy-detail-view.component.html
@@ -58,7 +58,7 @@
{{ record.metadata.name | translate }}
@if (record.metadata.is_default) {
} @else {
-
+
}
@@ -86,14 +86,14 @@
{{ record.metadata.name | translate }}
@if (record.metadata.automatic_renewal) {
} @else {
-
+
}
} @else {
-
+
}
Allow requests
@@ -101,7 +101,7 @@
{{ record.metadata.name | translate }}
@if (record.metadata.allow_requests) {
} @else {
-
+
}
diff --git a/projects/admin/src/app/record/detail-view/document-detail-view/holding-organisation/holding-organisation.component.html b/projects/admin/src/app/record/detail-view/document-detail-view/holding-organisation/holding-organisation.component.html
index 6e1dd9fe1..e82946916 100644
--- a/projects/admin/src/app/record/detail-view/document-detail-view/holding-organisation/holding-organisation.component.html
+++ b/projects/admin/src/app/record/detail-view/document-detail-view/holding-organisation/holding-organisation.component.html
@@ -21,7 +21,7 @@
@if (otherOrganisationCount > 0) {
Other organisations
-
+
}
} @loading {
diff --git a/projects/admin/src/app/record/detail-view/document-detail-view/holding/holding-item-temporary-item-type/holding-item-temporary-item-type.component.ts b/projects/admin/src/app/record/detail-view/document-detail-view/holding/holding-item-temporary-item-type/holding-item-temporary-item-type.component.ts
index 08a312c01..3ee24efea 100644
--- a/projects/admin/src/app/record/detail-view/document-detail-view/holding/holding-item-temporary-item-type/holding-item-temporary-item-type.component.ts
+++ b/projects/admin/src/app/record/detail-view/document-detail-view/holding/holding-item-temporary-item-type/holding-item-temporary-item-type.component.ts
@@ -30,7 +30,7 @@ import { DateTime } from 'luxon';
{{ record.metadata.temporary_item_type.pid | getRecord:'item_types': 'field':'name' | async }}
@if (record.metadata.temporary_item_type.end_date; as endDate) {
-
+
( {{ endDate | dateTranslate :'shortDate' }})
}
diff --git a/projects/admin/src/app/record/detail-view/document-detail-view/holdings/holdings.component.html b/projects/admin/src/app/record/detail-view/document-detail-view/holdings/holdings.component.html
index ab1b2594d..d0998e287 100644
--- a/projects/admin/src/app/record/detail-view/document-detail-view/holdings/holdings.component.html
+++ b/projects/admin/src/app/record/detail-view/document-detail-view/holdings/holdings.component.html
@@ -23,13 +23,13 @@
@if (holdings) {
-
+
@for (holding of holdings; track holding; let i = $index) {
1"
[isCurrentOrganisation]="isCurrentOrganisation"
(deleteHolding)="deleteHolding($event)"
diff --git a/projects/admin/src/app/record/detail-view/entities-detail-view/local/local-organisation-detail-view/local-organisation-detail-view.component.html b/projects/admin/src/app/record/detail-view/entities-detail-view/local/local-organisation-detail-view/local-organisation-detail-view.component.html
index 70d7aa782..59fb46533 100644
--- a/projects/admin/src/app/record/detail-view/entities-detail-view/local/local-organisation-detail-view/local-organisation-detail-view.component.html
+++ b/projects/admin/src/app/record/detail-view/entities-detail-view/local/local-organisation-detail-view/local-organisation-detail-view.component.html
@@ -54,7 +54,7 @@
}
diff --git a/projects/admin/src/app/record/detail-view/holding-detail-view/serial-holding-detail-view/received-issue/received-issue.component.html b/projects/admin/src/app/record/detail-view/holding-detail-view/serial-holding-detail-view/received-issue/received-issue.component.html
index 3b3bc0b0c..d0b3fd301 100644
--- a/projects/admin/src/app/record/detail-view/holding-detail-view/serial-holding-detail-view/received-issue/received-issue.component.html
+++ b/projects/admin/src/app/record/detail-view/holding-detail-view/serial-holding-detail-view/received-issue/received-issue.component.html
@@ -37,7 +37,7 @@
@if (issue.metadata.notes) {
}
-
+
@if (issue.metadata?.issue?.claims?.counter > 0 && isCollapsed) {
}
@@ -51,7 +51,7 @@
@if (issue.metadata._masked) {
- -
+
-
{{ 'This issue has been marked as masked' | translate }}
diff --git a/projects/admin/src/app/record/detail-view/holding-detail-view/serial-holding-detail-view/received-issue/received-issue.component.ts b/projects/admin/src/app/record/detail-view/holding-detail-view/serial-holding-detail-view/received-issue/received-issue.component.ts
index e090b9de7..644b6f5f7 100644
--- a/projects/admin/src/app/record/detail-view/holding-detail-view/serial-holding-detail-view/received-issue/received-issue.component.ts
+++ b/projects/admin/src/app/record/detail-view/holding-detail-view/serial-holding-detail-view/received-issue/received-issue.component.ts
@@ -102,7 +102,7 @@ export class ReceivedIssueComponent implements OnInit, OnDestroy {
*/
getIcon(realState: boolean = false): string {
return (this.issue.metadata._masked && !realState)
- ? 'fa-eye-slash text-danger'
+ ? 'fa-eye-slash text-error'
: this.holdingService.getIcon(this.issue.metadata.issue.status);
}
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 c6f06ca2e..7051e2ce1 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
@@ -117,7 +117,7 @@ {{ 'Barcode' | translate }} {{ record.metadata.barcode }}
- New acquisition
-
@@ -154,7 +154,7 @@
Issue data
- Regular issue
-
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 5bdbaf68c..ed6f979a4 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
@@ -102,7 +102,7 @@
Restrictions
- Restrict pickup to
-
-
+
@for (location of data.restrict_pickup_to; track location) {
-
{{ location.pid | getRecord: 'locations' : 'field' : 'pickup_name' | async }}
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
deleted file mode 100644
index 4f37d7ad2..000000000
--- a/projects/admin/src/app/record/detail-view/organisation-detail-view/organisation-detail-view.component.html
+++ /dev/null
@@ -1,41 +0,0 @@
-
-@if (record$ | async; as record) {
-
{{ record.metadata.name }}
-
-
- @if (record.metadata.address) {
- - Address
-
- }
-
- @if (record.metadata.code) {
- - Code
- - {{ record.metadata.code }}
- }
-
- @if (record.metadata.default_currency) {
- - Default currency
- - {{ record.metadata.default_currency }}
- }
-
-
-
- @if (isEnabledOperationLog) {
-
- }
-}
diff --git a/projects/admin/src/app/record/detail-view/organisation-detail-view/organisation-detail-view.component.ts b/projects/admin/src/app/record/detail-view/organisation-detail-view/organisation-detail-view.component.ts
deleted file mode 100644
index a99817333..000000000
--- a/projects/admin/src/app/record/detail-view/organisation-detail-view/organisation-detail-view.component.ts
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * RERO ILS UI
- * Copyright (C) 2019-2024 RERO
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, version 3 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-import { Component, inject } from '@angular/core';
-import { DetailRecord } from '@rero/ng-core/lib/record/detail/view/detail-record';
-import { Observable } from 'rxjs';
-import { OperationLogsService } from '../../../service/operation-logs.service';
-
-@Component({
- selector: 'admin-organisation-detail-view',
- templateUrl: './organisation-detail-view.component.html'
-})
-export class OrganisationDetailViewComponent implements DetailRecord {
-
- private operationLogsService: OperationLogsService = inject(OperationLogsService);
-
- /** Record observable */
- record$: Observable;
-
- /** Type */
- type: string;
-
- /** Load operation logs on show */
- showOperationLogs = false;
-
- /**
- * Is operation log enabled
- * @return boolean
- */
- get isEnabledOperationLog(): boolean {
- return this.operationLogsService.isLogVisible('organisations');
- }
-}
diff --git a/projects/admin/src/app/record/detail-view/patron-detail-view/patron-detail-view.component.ts b/projects/admin/src/app/record/detail-view/patron-detail-view/patron-detail-view.component.ts
index 0a386b5ed..919cb32ec 100644
--- a/projects/admin/src/app/record/detail-view/patron-detail-view/patron-detail-view.component.ts
+++ b/projects/admin/src/app/record/detail-view/patron-detail-view/patron-detail-view.component.ts
@@ -85,7 +85,7 @@ export class PatronDetailViewComponent implements OnInit, DetailRecord, OnDestro
/**
* Get the color badge to apply for a specific role
* @param role: the role to check.
- * @return the bootstrap badge class to use for this role.
+ * @return the primeng badge class to use for this role.
*/
getroleTagSeverity(role: string): string {
return roleTagSeverity(role);
diff --git a/projects/admin/src/app/record/detail-view/record-masked/record-masked.component.spec.ts b/projects/admin/src/app/record/detail-view/record-masked/record-masked.component.spec.ts
index 81c314d9c..afeb2b7ff 100644
--- a/projects/admin/src/app/record/detail-view/record-masked/record-masked.component.spec.ts
+++ b/projects/admin/src/app/record/detail-view/record-masked/record-masked.component.spec.ts
@@ -113,7 +113,7 @@ describe('MaskedComponent', () => {
const icon = fixture.nativeElement.querySelector('i');
expect(icon.attributes.title.textContent).toContain('No masked');
expect(icon.attributes.class.textContent).toContain('fa-circle');
- expect(icon.attributes.class.textContent).toContain('text-danger');
+ expect(icon.attributes.class.textContent).toContain('text-error');
});
it('should return a bullet red icon with label (record with flag _masked true)', () => {
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 609958ac7..f655dce8c 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
@@ -28,7 +28,7 @@ {{ record.metadata.name }}
-
- Frequency
diff --git a/projects/admin/src/app/record/editor/wrappers/identifiedby-value.component.ts b/projects/admin/src/app/record/editor/wrappers/identifiedby-value.component.ts
index 350e0a73e..822664090 100644
--- a/projects/admin/src/app/record/editor/wrappers/identifiedby-value.component.ts
+++ b/projects/admin/src/app/record/editor/wrappers/identifiedby-value.component.ts
@@ -29,12 +29,12 @@ import { IdentifierTypes } from '../../../classes/identifiers';
template: `
@if (message$ | async; as message) {
-
+
{{ message | translate }}
}
@if (asyncRecord$ | async; as record) {
-
+
{{ 'A document already exists under this reference' | translate }}:
{{ 'Show' | translate }}
diff --git a/projects/admin/src/app/record/editor/wrappers/user-id.component.ts b/projects/admin/src/app/record/editor/wrappers/user-id.component.ts
index 1176ccf05..90aa66b9c 100644
--- a/projects/admin/src/app/record/editor/wrappers/user-id.component.ts
+++ b/projects/admin/src/app/record/editor/wrappers/user-id.component.ts
@@ -15,41 +15,40 @@
* along with this program. If not, see .
*/
-import { Component, inject, OnDestroy, OnInit } from '@angular/core';
+import { ChangeDetectorRef, Component, inject, OnDestroy, OnInit } from '@angular/core';
import { FieldWrapper } from '@ngx-formly/core';
+import { TranslateService } from '@ngx-translate/core';
import { RecordService } from '@rero/ng-core';
import { DialogService, DynamicDialogRef } from 'primeng/dynamicdialog';
-import { Observable, of, Subscription, switchMap } from 'rxjs';
+import { of, Subscription, switchMap } from 'rxjs';
import { UserIdEditorComponent } from '../../custom-editor/user-id-editor/user-id-editor.component';
-import { TranslateService } from '@ngx-translate/core';
@Component({
selector: 'admin-user-id',
template: `
- @if (user$ | async; as user) {
-
- {{ $any(user).metadata.last_name }}, {{ $any(user).metadata.first_name }}
- @if (user.metadata.city) {
- ({{ user.metadata.city }})
+ @if (user) {
+
+ {{ $any(user).metadata.last_name }}, {{ $any(user).metadata.first_name }}
+ @if (user.metadata.city) {
+ ({{ user.metadata.city }})
+ }
+
+
+ } @else {
+
}
-
-
- } @else {
-
Personal informations*
-
- }
- `
+ `,
})
export class UserIdComponent extends FieldWrapper implements OnInit, OnDestroy {
-
private dialogService: DialogService = inject(DialogService);
private recordService: RecordService = inject(RecordService);
private translateService: TranslateService = inject(TranslateService);
+ private changeDetectorRef: ChangeDetectorRef = inject(ChangeDetectorRef);
/** current user */
- user$: Observable;
+ user;
private subscription = new Subscription();
@@ -58,7 +57,10 @@ export class UserIdComponent extends FieldWrapper implements OnInit, OnDestroy {
*/
ngOnInit(): void {
if (this.formControl && this.formControl.value != null) {
- this.user$ = this.recordService.getRecord('users', this.formControl.value);
+ this.recordService.getRecord('users', this.formControl.value).subscribe((user) => {
+ this.user = user;
+ this.changeDetectorRef.detectChanges();
+ });
}
}
@@ -74,19 +76,26 @@ export class UserIdComponent extends FieldWrapper implements OnInit, OnDestroy {
header: this.translateService.instant('Personal informations'),
focusOnShow: false,
width: '60vw',
- data: { userID: this.formControl.value }
+ data: { userID: this.formControl.value },
});
- this.user$ = ref.onClose.pipe(
- switchMap((userId?: string) => {
- if (userId) {
- this.formControl.setValue(userId);
- // need to force the role validation as the user can be changed
- this.formControl.root.get('roles').updateValueAndValidity();
- return this.recordService.getRecord('users', userId);
- } else {
- return of(null);
- }
- })
+ this.subscription.add(
+ ref.onClose
+ .pipe(
+ switchMap((userId?: string) => {
+ if (userId) {
+ this.formControl.setValue(userId);
+ // need to force the role validation as the user can be changed
+ this.formControl.root.get('roles').updateValueAndValidity();
+ return this.recordService.getRecord('users', userId);
+ }
+ return of(null);
+ })
+ )
+ .subscribe((user) => {
+ if (user) {
+ this.user = user;
+ }
+ })
);
}
}
diff --git a/projects/admin/src/app/routes/organisations-route.ts b/projects/admin/src/app/routes/organisations-route.ts
deleted file mode 100644
index 7b8796797..000000000
--- a/projects/admin/src/app/routes/organisations-route.ts
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * RERO ILS UI
- * Copyright (C) 2020-2023 RERO
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, version 3 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
-import { ComponentCanDeactivateGuard, DetailComponent, EditorComponent, RouteInterface } from '@rero/ng-core';
-import { of } from 'rxjs';
-import { CAN_ACCESS_ACTIONS, CanAccessGuard } from '../guard/can-access.guard';
-import { OrganisationDetailViewComponent } from '../record/detail-view/organisation-detail-view/organisation-detail-view.component';
-import { BaseRoute } from './base-route';
-
-export class OrganisationsRoute extends BaseRoute implements RouteInterface {
-
- /** Route name */
- readonly name = 'organisations';
-
- /**
- * Get Configuration
- * @return Object
- */
- getConfiguration() {
- return {
- matcher: (url: any) => this.routeMatcher(url, this.name),
- children: [
- { path: 'detail/:pid', component: DetailComponent, canActivate: [ CanAccessGuard], data: { action: CAN_ACCESS_ACTIONS.READ } },
- { path: 'edit/:pid', component: EditorComponent, canActivate: [ CanAccessGuard ], canDeactivate: [ ComponentCanDeactivateGuard ], data: { action: CAN_ACCESS_ACTIONS.UPDATE } }
- ],
- data: {
- adminMode: () => of({
- can: false,
- message: ''
- }),
- types: [
- {
- key: this.name,
- label: _('Organisations'),
- detailComponent: OrganisationDetailViewComponent
- }
- ]
- }
- };
- }
-}
diff --git a/projects/admin/src/app/routes/route.service.ts b/projects/admin/src/app/routes/route.service.ts
index b221961a1..85a650c87 100644
--- a/projects/admin/src/app/routes/route.service.ts
+++ b/projects/admin/src/app/routes/route.service.ts
@@ -38,7 +38,6 @@ import { LibrariesRoute } from './libraries-route';
import { LoansRoute } from './loans-route';
import { LocalFieldsRoute } from './local-fields-route';
import { LocationsRoute } from './locations-route';
-import { OrganisationsRoute } from './organisations-route';
import { PatronTransactionEventsRoute } from './patron-transaction-events-route';
import { PatronTypesRoute } from './patron-types-route';
import { PatronsRoute } from './patrons-route';
@@ -67,7 +66,6 @@ export class RouteService {
.addRoute(new ItemTypesRoute())
.addRoute(new LibrariesRoute())
.addRoute(new LocationsRoute())
- .addRoute(new OrganisationsRoute())
.addRoute(new PatronsRoute())
.addRoute(new PatronTypesRoute())
.addRoute(new VendorsRoute())
diff --git a/projects/admin/src/app/service/holdings.service.ts b/projects/admin/src/app/service/holdings.service.ts
index 8a93bed69..945e38d9a 100644
--- a/projects/admin/src/app/service/holdings.service.ts
+++ b/projects/admin/src/app/service/holdings.service.ts
@@ -80,7 +80,7 @@ export class HoldingsService {
*/
getIcon(status: IssueItemStatus): string {
switch (status) {
- case IssueItemStatus.DELETED: return 'fa-circle text-danger';
+ case IssueItemStatus.DELETED: return 'fa-circle text-error';
case IssueItemStatus.RECEIVED: return 'fa-circle text-success';
case IssueItemStatus.LATE: return 'fa-envelope-open-o text-warning';
case IssueItemStatus.EXPECTED: return 'fa-circle text-secondary';