diff --git a/angular.json b/angular.json index 24a30d169..24d3f0227 100644 --- a/angular.json +++ b/angular.json @@ -41,13 +41,7 @@ } ], "styles": [ - "node_modules/primeng/resources/themes/bootstrap4-light-blue/theme.css", - "node_modules/primeng/resources/primeng.min.css", - "node_modules/primeicons/primeicons.css", - "node_modules/primeflex/primeflex.min.css", - "node_modules/ngx-spinner/animations/ball-zig-zag.css", - "projects/admin/src/app/scss/styles.scss", - "projects/shared/src/scss/styles.scss" + "projects/admin/src/app/scss/styles.scss" ], "scripts": [], "vendorChunk": true, @@ -77,7 +71,7 @@ { "type": "initial", "maximumWarning": "2.5mb", - "maximumError": "7mb" + "maximumError": "9mb" }, { "type": "anyComponentStyle", @@ -113,7 +107,6 @@ "tsConfig": "projects/admin/tsconfig.spec.json", "karmaConfig": "projects/admin/karma.conf.js", "assets": [], - "styles": ["projects/admin/src/app/scss/styles.scss"], "scripts": [] } }, @@ -169,15 +162,15 @@ } ], "styles": [ - "node_modules/primeng/resources/themes/bootstrap4-light-blue/theme.css", - "node_modules/primeng/resources/primeng.min.css", - "node_modules/primeicons/primeicons.css", - "node_modules/primeflex/primeflex.min.css", - "node_modules/ngx-spinner/animations/ball-zig-zag.css", - "projects/public-search/src/app/scss/styles.scss", - "projects/shared/src/scss/styles.scss" + "projects/public-search/src/app/scss/styles.scss" ], - "scripts": [] + "scripts": [], + "vendorChunk": true, + "extractLicenses": false, + "buildOptimizer": false, + "sourceMap": true, + "optimization": false, + "namedChunks": true }, "configurations": { "production": { @@ -277,11 +270,7 @@ } ], "styles": [ - "node_modules/primeng/resources/themes/bootstrap4-light-blue/theme.css", - "node_modules/primeng/resources/primeng.min.css", - "node_modules/primeicons/primeicons.css", - "node_modules/primeflex/primeflex.min.css", - "projects/shared/src/scss/styles.scss" + "projects/public-search/src/app/scss/bootstrap_styles.scss" ], "scripts": [], "vendorChunk": true, @@ -299,6 +288,9 @@ "with": "projects/public-search/src/environments/environment.prod.ts" } ], + "styles": [ + "projects/public-search/src/app/scss/styles.scss" + ], "optimization": true, "outputHashing": "all", "sourceMap": false, @@ -405,10 +397,7 @@ } ], "styles": [ - "node_modules/primeng/resources/themes/bootstrap4-light-blue/theme.css", - "node_modules/primeng/resources/primeng.min.css", - "node_modules/primeicons/primeicons.css", - "node_modules/primeflex/primeflex.min.css" + "projects/public-search/src/app/scss/styles.scss" ], "scripts": [], "vendorChunk": true, @@ -556,12 +545,7 @@ } ], "styles": [ - "node_modules/primeng/resources/themes/bootstrap4-light-blue/theme.css", - "node_modules/primeng/resources/primeng.min.css", - "node_modules/primeicons/primeicons.css", - "node_modules/primeflex/primeflex.min.css", - "projects/public-search/src/app/scss/styles.scss", - "projects/shared/src/scss/styles.scss" + "projects/public-search/src/app/scss/styles.scss" ], "scripts": [], "vendorChunk": true, @@ -673,13 +657,15 @@ } ], "styles": [ - "node_modules/primeng/resources/themes/bootstrap4-light-blue/theme.css", - "node_modules/primeng/resources/primeng.min.css", - "node_modules/primeicons/primeicons.css", - "node_modules/primeflex/primeflex.min.css", - "projects/shared/src/scss/styles.scss" + "projects/public-search/src/app/scss/styles.scss" ], - "scripts": [] + "scripts": [], + "vendorChunk": true, + "extractLicenses": false, + "buildOptimizer": false, + "sourceMap": true, + "optimization": false, + "namedChunks": true }, "configurations": { "production": { @@ -781,13 +767,15 @@ } ], "styles": [ - "node_modules/primeng/resources/themes/bootstrap4-light-blue/theme.css", - "node_modules/primeng/resources/primeng.min.css", - "node_modules/primeicons/primeicons.css", - "node_modules/primeflex/primeflex.min.css", - "projects/shared/src/scss/styles.scss" + "projects/public-search/src/app/scss/styles.scss" ], - "scripts": [] + "scripts": [], + "vendorChunk": true, + "extractLicenses": false, + "buildOptimizer": false, + "sourceMap": true, + "optimization": false, + "namedChunks": true }, "configurations": { "production": { diff --git a/package-lock.json b/package-lock.json index e79b9c8b1..70d75668b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -28,7 +28,7 @@ "@ngx-loading-bar/http-client": "^6.0.0", "@ngx-loading-bar/router": "^6.0.0", "@ngx-translate/core": "^15.0.0", - "@rero/ng-core": "^17.2.3", + "@rero/ng-core": "^17.3.0", "@swimlane/ngx-charts": "^20.5.0", "@vpoppy/ngx-translate-extract": "^9.0.0", "bootstrap": "^4.6.2", @@ -42,8 +42,8 @@ "marked": "^10.0.0", "ngx-spinner": "^16.0.0", "primeflex": "^3.3.1", - "primeicons": "^6.0.1", - "primeng": "^17.14.1", + "primeicons": "^7.0.0", + "primeng": "^17.18.0", "rxjs": "^7.8.1", "simple-isbn": "^1.1.5", "tslib": "^2.6.0", @@ -4003,9 +4003,9 @@ } }, "node_modules/@rero/ng-core": { - "version": "17.2.3", - "resolved": "https://registry.npmjs.org/@rero/ng-core/-/ng-core-17.2.3.tgz", - "integrity": "sha512-K5isydJVTrWYXV6ZnpG+xEfDqDXa5yCezgWNdr7P8P3HiOtnKZg4GZ1xEwvS46sPMmQdV/+l93xN6MjLQQIfiA==", + "version": "17.3.0", + "resolved": "https://registry.npmjs.org/@rero/ng-core/-/ng-core-17.3.0.tgz", + "integrity": "sha512-QNdrfZ41JmSt4I3RTfcc/VCtIGYDTscj9v9DajNJGvEZM9dakQkFyT6+w7c+p5UF4Te7tM9fdAXCfuCuHTmvFg==", "dependencies": { "tslib": "^2.3.0" }, @@ -12902,9 +12902,9 @@ "integrity": "sha512-zaOq3YvcOYytbAmKv3zYc+0VNS9Wg5d37dfxZnveKBFPr7vEIwfV5ydrpiouTft8MVW6qNjfkaQphHSnvgQbpQ==" }, "node_modules/primeicons": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/primeicons/-/primeicons-6.0.1.tgz", - "integrity": "sha512-KDeO94CbWI4pKsPnYpA1FPjo79EsY9I+M8ywoPBSf9XMXoe/0crjbUK7jcQEDHuc0ZMRIZsxH3TYLv4TUtHmAA==" + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/primeicons/-/primeicons-7.0.0.tgz", + "integrity": "sha512-jK3Et9UzwzTsd6tzl2RmwrVY/b8raJ3QZLzoDACj+oTJ0oX7L9Hy+XnVwgo4QVKlKpnP/Ur13SXV/pVh4LzaDw==" }, "node_modules/primelocale": { "version": "1.0.3", diff --git a/package.json b/package.json index 172f0bd59..a8d05172d 100644 --- a/package.json +++ b/package.json @@ -78,15 +78,15 @@ "@angular/platform-browser-dynamic": "^17.1.0", "@angular/router": "^17.1.0", "@biesbjerg/ngx-translate-extract-marker": "^1.0.0", - "@ngneat/hotkeys": "^4.0.0", "@ng-bootstrap/ng-bootstrap": "^16.0.0", + "@ngneat/hotkeys": "^4.0.0", "@ngx-formly/core": "^6.3.6", "@ngx-formly/primeng": "^6.3.6", "@ngx-loading-bar/core": "^6.0.0", "@ngx-loading-bar/http-client": "^6.0.0", "@ngx-loading-bar/router": "^6.0.0", "@ngx-translate/core": "^15.0.0", - "@rero/ng-core": "^17.2.3", + "@rero/ng-core": "^17.3.0", "@swimlane/ngx-charts": "^20.5.0", "@vpoppy/ngx-translate-extract": "^9.0.0", "bootstrap": "^4.6.2", @@ -100,8 +100,8 @@ "marked": "^10.0.0", "ngx-spinner": "^16.0.0", "primeflex": "^3.3.1", - "primeicons": "^6.0.1", - "primeng": "^17.14.1", + "primeicons": "^7.0.0", + "primeng": "^17.18.0", "rxjs": "^7.8.1", "simple-isbn": "^1.1.5", "tslib": "^2.6.0", diff --git a/projects/admin/src/app/acquisition/acquisition.scss b/projects/admin/src/app/acquisition/acquisition.scss index f763d9579..256beaf66 100644 --- a/projects/admin/src/app/acquisition/acquisition.scss +++ b/projects/admin/src/app/acquisition/acquisition.scss @@ -19,13 +19,16 @@ @import 'bootstrap/scss/functions'; @import 'bootstrap/scss/variables'; @import '../scss/variables'; +// @import "primeflex/primeflex"; +// @import "@rero/ng-core/assets/scss/ng-core"; .account { $DEPTH-PADDING: 50px; $MAX-DEPTH: 10; - margin-bottom: map-get($spacers, 1); + // @extend .mb-1; + &:hover{ background-color: #F8F8F8; @@ -53,7 +56,7 @@ // =========================================================================== .receipt { .account-number { - font-size: $small-font-size; + // @extend .text-sm; color: $secondary; font-weight: bold; &:before { diff --git a/projects/admin/src/app/acquisition/formly/wrapper/input-no-label.wrapper.ts b/projects/admin/src/app/acquisition/formly/wrapper/input-no-label.wrapper.ts index 89d27689b..f50e8a7b4 100644 --- a/projects/admin/src/app/acquisition/formly/wrapper/input-no-label.wrapper.ts +++ b/projects/admin/src/app/acquisition/formly/wrapper/input-no-label.wrapper.ts @@ -23,8 +23,8 @@ template: `
@if (showError) { -
- +
+
}
diff --git a/projects/admin/src/app/app.module.ts b/projects/admin/src/app/app.module.ts index 7fee58ed9..9df1c619c 100644 --- a/projects/admin/src/app/app.module.ts +++ b/projects/admin/src/app/app.module.ts @@ -58,9 +58,7 @@ import { MenuDashboardComponent } from './menu/menu-dashboard/menu-dashboard.com import { MenuDisplayComponent } from './menu/menu-display/menu-display.component'; import { MenuUserComponent } from './menu/menu-user/menu-user.component'; import { CountryCodeTranslatePipe } from './pipe/country-code-translate.pipe'; -import { DocumentProvisionActivityPipe } from './pipe/document-provision-activity.pipe'; import { ItemInCollectionPipe } from './pipe/item-in-collection.pipe'; -import { MainTitleRelationPipe } from './pipe/main-title-relation.pipe'; import { MarcPipe } from './pipe/marc.pipe'; import { NotesFormatPipe } from './pipe/notes-format.pipe'; import { PatronNamePipe } from './pipe/patron-name.pipe'; @@ -99,13 +97,6 @@ import { CircPolicyDetailViewComponent } from './record/detail-view/circ-policy- import { CollectionDetailViewComponent } from './record/detail-view/collection-detail-view/collection-detail-view.component'; import { CollectionItemsComponent } from './record/detail-view/collection-detail-view/collection-items/collection-items.component'; import { DialogImportComponent } from './record/detail-view/document-detail-view/dialog-import/dialog-import.component'; -import { DescriptionZoneComponent } from './record/detail-view/document-detail-view/document-description/description-zone/description-zone.component'; -import { - DocumentDescriptionComponent -} from './record/detail-view/document-detail-view/document-description/document-description.component'; -import { - OtherEditionComponent -} from './record/detail-view/document-detail-view/document-description/other-edition/other-edition.component'; import { DocumentDetailViewComponent } from './record/detail-view/document-detail-view/document-detail-view.component'; import { DocumentDetailComponent } from './record/detail-view/document-detail-view/document-detail/document-detail.component'; import { EntitiesRelatedComponent } from './record/detail-view/document-detail-view/entities-related/entities-related.component'; @@ -203,9 +194,9 @@ import { CurrentLibraryPermissionValidator } from './utils/permissions'; import { CustomShortcutHelpComponent } from './widgets/custom-shortcut-help/custom-shortcut-help.component'; import { FrontpageComponent } from './widgets/frontpage/frontpage.component'; +import { HotkeysShortcutPipe } from '@ngneat/hotkeys'; 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'; -import { HotkeysShortcutPipe } from '@ngneat/hotkeys'; /** Init application factory */ export function appInitFactory(appInitializerService: AppInitializerService): () => Observable { @@ -292,11 +283,6 @@ export function appInitFactory(appInitializerService: AppInitializerService): () CirculationLogComponent, ItemInCollectionPipe, CountryCodeTranslatePipe, - DocumentDescriptionComponent, - OtherEditionComponent, - DescriptionZoneComponent, - DocumentProvisionActivityPipe, - MainTitleRelationPipe, HoldingOrganisationComponent, ExpectedIssueComponent, ReceivedIssueComponent, diff --git a/projects/admin/src/app/circulation/main-request/main-request.component.html b/projects/admin/src/app/circulation/main-request/main-request.component.html index b75250f6d..dd265ff9c 100644 --- a/projects/admin/src/app/circulation/main-request/main-request.component.html +++ b/projects/admin/src/app/circulation/main-request/main-request.component.html @@ -37,18 +37,16 @@
@if (refreshInterval > 0) { - } - diff --git a/projects/admin/src/app/circulation/patron/loan/loan.component.html b/projects/admin/src/app/circulation/patron/loan/loan.component.html index d2bbcd8b0..ad9747bc7 100644 --- a/projects/admin/src/app/circulation/patron/loan/loan.component.html +++ b/projects/admin/src/app/circulation/patron/loan/loan.component.html @@ -45,8 +45,8 @@
-
diff --git a/projects/admin/src/app/record/detail-view/document-detail-view/document-detail-view.component.html b/projects/admin/src/app/record/detail-view/document-detail-view/document-detail-view.component.html index 1d4842e0d..bb55a6a77 100644 --- a/projects/admin/src/app/record/detail-view/document-detail-view/document-detail-view.component.html +++ b/projects/admin/src/app/record/detail-view/document-detail-view/document-detail-view.component.html @@ -276,7 +276,7 @@

{{ altgr_title }}

{{ "Description" | translate }} - + diff --git a/projects/admin/src/app/scss/styles.scss b/projects/admin/src/app/scss/styles.scss index 8da9ea582..6cfa296b8 100644 --- a/projects/admin/src/app/scss/styles.scss +++ b/projects/admin/src/app/scss/styles.scss @@ -16,9 +16,23 @@ * along with this program. If not, see . */ + :root { + font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, + "Helvetica Neue", Helvetica, Arial, sans-serif; + --font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", + Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 0.875rem; +} + +@layer bootstrap, rero-ils-ui, primeng; +@import '../../../../shared/src/scss/styles.scss'; @import 'font-awesome/scss/font-awesome'; +@layer bootstrap { @import 'variables'; @import 'bootstrap/scss/bootstrap'; +@import 'bootstrap/scss/_functions'; +@import 'bootstrap/scss/_mixins'; +@import 'bootstrap/scss/_variables'; html [type=button] { @@ -94,12 +108,6 @@ button.disabled { border-bottom: 0; } -.rero-ils-external-link:after { - font-family: 'FontAwesome'; - font-size: $font-size-very-small; - vertical-align: top; - content: " \f08e"; -} span.no-data { font-style: italic; @@ -405,3 +413,4 @@ pre { } } } +} diff --git a/projects/admin/src/index.html b/projects/admin/src/index.html index f255303cf..4572e3091 100644 --- a/projects/admin/src/index.html +++ b/projects/admin/src/index.html @@ -9,6 +9,6 @@ - + diff --git a/projects/public-holdings-items/src/app/app.module.ts b/projects/public-holdings-items/src/app/app.module.ts index a0c79a181..b05a8351d 100644 --- a/projects/public-holdings-items/src/app/app.module.ts +++ b/projects/public-holdings-items/src/app/app.module.ts @@ -29,15 +29,19 @@ import { LoadingBarHttpClientModule } from '@ngx-loading-bar/http-client'; import { TranslateLoader as BaseTranslateLoader, TranslateModule, TranslateService } from '@ngx-translate/core'; import { CoreConfigService, CoreModule, NgCoreTranslateService, RecordModule, TranslateLoader } from '@rero/ng-core'; import { SharedModule } from '@rero/shared'; +import { AccordionModule } from 'primeng/accordion'; +import { DividerModule } from 'primeng/divider'; +import { DocumentDetailViewComponent } from 'projects/public-search/src/app/document-detail/document-detail-view/document-detail-view.component'; +import { ElectronicHoldingsComponent } from 'projects/public-search/src/app/document-detail/document-detail-view/holdings/electronic-holdings/electronic-holdings.component'; import { HoldingComponent } from 'projects/public-search/src/app/document-detail/holdings/holding/holding.component'; import { HoldingsComponent } from 'projects/public-search/src/app/document-detail/holdings/holdings.component'; import { ItemsComponent } from 'projects/public-search/src/app/document-detail/holdings/items/items.component'; import { ItemComponent } from 'projects/public-search/src/app/document-detail/item/item.component'; import { PickupLocationComponent } from 'projects/public-search/src/app/document-detail/request/pickup-location/pickup-location.component'; import { RequestComponent } from 'projects/public-search/src/app/document-detail/request/request.component'; +import { Observable } from 'rxjs'; import { AppConfigService } from './app-config-service.service'; import { AppInitializerService } from './app-initializer.service'; -import { Observable } from 'rxjs'; /** function to instantiate the application */ export function appInitFactory(appInitializerService: AppInitializerService): () => Observable { @@ -51,11 +55,15 @@ export function appInitFactory(appInitializerService: AppInitializerService): () ItemComponent, ItemsComponent, PickupLocationComponent, - RequestComponent + RequestComponent, + DocumentDetailViewComponent, + ElectronicHoldingsComponent ], imports: [ + AccordionModule, BrowserModule, BrowserAnimationsModule, + DividerModule, RouterModule.forRoot([]), HttpClientModule, FormsModule, @@ -90,9 +98,9 @@ export class AppModule implements DoBootstrap { private injector: Injector = inject(Injector); ngDoBootstrap(): void { - if (!customElements.get('public-search-holdings')) { - const searchBar = createCustomElement(HoldingsComponent, { injector: this.injector }); - customElements.define('public-search-holdings', searchBar); + if (!customElements.get('public-search-document')) { + const searchBar = createCustomElement(DocumentDetailViewComponent, { injector: this.injector }); + customElements.define('public-search-document', searchBar); } } } diff --git a/projects/public-holdings-items/src/index.html b/projects/public-holdings-items/src/index.html index 3e58eef95..ad9c950a8 100644 --- a/projects/public-holdings-items/src/index.html +++ b/projects/public-holdings-items/src/index.html @@ -23,24 +23,36 @@ + - + /> --> +

Document holdings items

- +
+ + For babeltec. + +
diff --git a/projects/public-patron-profile/src/app/app.module.ts b/projects/public-patron-profile/src/app/app.module.ts index 4d19b7546..90f8c9456 100644 --- a/projects/public-patron-profile/src/app/app.module.ts +++ b/projects/public-patron-profile/src/app/app.module.ts @@ -14,19 +14,14 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ -import { HttpClient, HttpClientModule, HttpClientXsrfModule } from '@angular/common/http'; +import { HttpClient } from '@angular/common/http'; import { APP_INITIALIZER, CUSTOM_ELEMENTS_SCHEMA, DoBootstrap, inject, Injector, NgModule } from '@angular/core'; import { createCustomElement } from '@angular/elements'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { BrowserModule } from '@angular/platform-browser'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { RouterModule } from '@angular/router'; -import { FormlyModule } from '@ngx-formly/core'; -import { FormlyPrimeNGModule } from '@ngx-formly/primeng'; -import { LoadingBarModule } from '@ngx-loading-bar/core'; import { LoadingBarHttpClientModule } from '@ngx-loading-bar/http-client'; import { TranslateLoader as BaseTranslateLoader, TranslateModule, TranslateService } from '@ngx-translate/core'; -import { CoreConfigService, CoreModule, NgCoreTranslateService, RecordModule, TranslateLoader } from '@rero/ng-core'; +import { CoreConfigService, NgCoreTranslateService, RecordModule, TranslateLoader } from '@rero/ng-core'; import { SharedModule } from '@rero/shared'; import { PatronProfileDocumentComponent } from 'projects/public-search/src/app/patron-profile/patron-profile-document/patron-profile-document.component'; import { PatronProfileFeeComponent } from 'projects/public-search/src/app/patron-profile/patron-profile-fees/patron-profile-fee/patron-profile-fee.component'; @@ -54,11 +49,9 @@ import { PatronProfileComponent } from 'projects/public-search/src/app/patron-pr import { ArrayTranslatePipe } from 'projects/public-search/src/app/pipe/array-translate.pipe'; import { JournalVolumePipe } from 'projects/public-search/src/app/pipe/journal-volume.pipe'; import { LoanStatusBadgePipe } from 'projects/public-search/src/app/pipe/loan-status-badge.pipe'; -import { StatusBadgePipe } from 'projects/public-search/src/app/pipe/status-badge.pipe'; import { Observable } from 'rxjs'; import { AppConfigService } from './app-config-service.service'; import { AppInitializerService } from './app-initializer.service'; -import { TabViewModule } from 'primeng/tabview'; /** function to instantiate the application */ export function appInitFactory(appInitializerService: AppInitializerService): () => Observable { @@ -84,22 +77,12 @@ export function appInitFactory(appInitializerService: AppInitializerService): () PatronProfileHistoryComponent, PatronProfileMenuComponent, JournalVolumePipe, - StatusBadgePipe, LoanStatusBadgePipe ], imports: [ - BrowserModule, BrowserAnimationsModule, - RouterModule.forRoot([]), - HttpClientModule, - HttpClientXsrfModule, - FormsModule, - FormlyModule.forRoot(), - FormlyPrimeNGModule, - CoreModule, RecordModule, - ReactiveFormsModule, - TabViewModule, + RouterModule.forRoot([]), TranslateModule.forRoot({ loader: { provide: BaseTranslateLoader, @@ -109,8 +92,7 @@ export function appInitFactory(appInitializerService: AppInitializerService): () isolate: false }), SharedModule, - LoadingBarHttpClientModule, - LoadingBarModule + LoadingBarHttpClientModule ], providers: [ { provide: TranslateService, useClass: NgCoreTranslateService }, diff --git a/projects/public-patron-profile/src/index.html b/projects/public-patron-profile/src/index.html index 0b24b4e77..47919c40f 100644 --- a/projects/public-patron-profile/src/index.html +++ b/projects/public-patron-profile/src/index.html @@ -29,20 +29,25 @@ integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous" /> - + /> --> + - - -
-
- -
-
-
+ +
+ +
diff --git a/projects/public-search/src/app/api/holdings-api.service.ts b/projects/public-search/src/app/api/holdings-api.service.ts index 84b038285..690556598 100644 --- a/projects/public-search/src/app/api/holdings-api.service.ts +++ b/projects/public-search/src/app/api/holdings-api.service.ts @@ -42,8 +42,7 @@ export class HoldingsApiService extends BaseApi implements IAvailabilityService */ getHoldingsByDocumentPidAndViewcode( documentPid: string, viewcode: string, page: number, itemsPerPage: number = 5): Observable { - const query = `document.pid:${documentPid} - AND ((holdings_type:standard AND public_items_count:[1 TO *]) OR holdings_type:serial)`; + const query = `document.pid:${documentPid} AND ((holdings_type:standard AND public_items_count:[1 TO *]) OR holdings_type:serial) NOT _masked:true`; return this.recordService .getRecords( 'holdings', query, page, itemsPerPage, undefined, { view: viewcode }, @@ -51,6 +50,22 @@ export class HoldingsApiService extends BaseApi implements IAvailabilityService ).pipe(map((response: Record) => response.hits)); } + /** + * Get Electronic Holdings by document pid and viewcode + * @param documentPid - string + * @param viewcode - string + * @return Observable + */ + getElectronicHoldingsByDocumentPidAndViewcode( + documentPid: string, viewcode: string, page: number, itemsPerPage: number = 5): Observable { + const query = `document.pid:${documentPid} AND holdings_type:electronic NOT _masked:true`; + return this.recordService + .getRecords( + 'holdings', query, page, itemsPerPage, undefined, { view: viewcode }, + BaseApi.reroJsonheaders, 'organisation_library_location' + ).pipe(map((response: Record) => response.hits)); + } + /** * Holding Can request * @param holdingPid - Holding pid diff --git a/projects/public-search/src/app/app.module.ts b/projects/public-search/src/app/app.module.ts index f9957b07a..3115623c3 100644 --- a/projects/public-search/src/app/app.module.ts +++ b/projects/public-search/src/app/app.module.ts @@ -25,7 +25,7 @@ import { LoadingBarHttpClientModule } from '@ngx-loading-bar/http-client'; import { LoadingBarRouterModule } from '@ngx-loading-bar/router'; import { TranslateLoader as BaseTranslateLoader, TranslateModule, TranslateService } from '@ngx-translate/core'; import { BucketNameService as CoreBucketNameService, CoreConfigService, NgCoreTranslateService, RecordModule, TranslateLoader } from '@rero/ng-core'; -import { RemoteSearchComponent, SharedModule, UserService } from '@rero/shared'; +import { PrimeNgImportModule, RemoteSearchComponent, SharedModule, UserService } from '@rero/shared'; import { AppConfigService } from './app-config.service'; import { AppInitializerService } from './app-initializer.service'; import { AppRoutingModule } from './app-routing.module'; @@ -38,6 +38,7 @@ import { CustomRequestInterceptor } from './interceptor/custom-request.intercept import { MainComponent } from './main/main.component'; import { BucketNameService } from './service/bucket-name.service'; import { Observable } from 'rxjs'; +import { DividerModule } from 'primeng/divider'; /** function to instantiate the application */ export function appInitFactory(appInitializerService: AppInitializerService): () => Observable { @@ -57,8 +58,8 @@ export function appInitFactory(appInitializerService: AppInitializerService): () BrowserModule, BrowserAnimationsModule, AppRoutingModule, - HttpClientModule, RecordModule, + DividerModule, TranslateModule.forRoot({ loader: { provide: BaseTranslateLoader, @@ -69,8 +70,7 @@ export function appInitFactory(appInitializerService: AppInitializerService): () }), SharedModule, LoadingBarHttpClientModule, - LoadingBarRouterModule, - LoadingBarModule + LoadingBarRouterModule ], providers: [ { provide: APP_INITIALIZER, useFactory: appInitFactory, deps: [AppInitializerService, UserService], multi: true }, diff --git a/projects/public-search/src/app/collection-brief/collection-brief.component.html b/projects/public-search/src/app/collection-brief/collection-brief.component.html index b59700644..f8441638a 100644 --- a/projects/public-search/src/app/collection-brief/collection-brief.component.html +++ b/projects/public-search/src/app/collection-brief/collection-brief.component.html @@ -16,13 +16,13 @@ along with this program. If not, see . --> @if (record) { -
+

{{ record.metadata.title }} @if (record.metadata.collection_id) { ({{ record.metadata.collection_id }}) } -

-
+ +
@if (record.metadata.teachers) {
@for (teacher of record.metadata.teachers; track teacher; let last = $last) { diff --git a/projects/public-search/src/app/document-brief/document-brief.component.html b/projects/public-search/src/app/document-brief/document-brief.component.html index 1d86b50bd..0a5710e58 100644 --- a/projects/public-search/src/app/document-brief/document-brief.component.html +++ b/projects/public-search/src/app/document-brief/document-brief.component.html @@ -16,39 +16,30 @@ along with this program. If not, see . --> @if (record) { -
- -
+
+
+ +
+

{{ record.metadata.title | mainTitle }}

- + @if (provisionActivityPublications.length > 0) { -
    +
      @for (publication of provisionActivityPublications; track publication) {
    • {{ publication.value }}
    • }
    } - - @if (record.explanation) { - -
    -          {{ record.explanation | json }}
    -        
    - } - + @if (record.metadata.editionStatement) { -
      +
        @for (edition of record.metadata.editionStatement; track edition) {
      • {{ edition._text[0].value }}
      • } @@ -61,7 +52,7 @@

        [record]="record" [apiService]="documentApiService" [viewcode]="viewcode" - > + /> }

diff --git a/projects/public-search/src/app/document-brief/document-brief.component.ts b/projects/public-search/src/app/document-brief/document-brief.component.ts index f48f2b173..1a6135432 100644 --- a/projects/public-search/src/app/document-brief/document-brief.component.ts +++ b/projects/public-search/src/app/document-brief/document-brief.component.ts @@ -15,7 +15,8 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ -import { Component, Input } from '@angular/core'; +import { Component, inject, Input } from '@angular/core'; +import { DocumentApiService } from '../api/document-api.service'; @Component({ selector: 'public-search-document-brief', @@ -26,6 +27,7 @@ export class DocumentBriefComponent { public coverUrl: string; private pathArray = window.location.pathname.split('/'); + public documentApiService: DocumentApiService = inject(DocumentApiService); private _record: any; @Input() detailUrl: string; diff --git a/projects/public-search/src/app/document-detail/document-detail-view/document-detail-view.component.html b/projects/public-search/src/app/document-detail/document-detail-view/document-detail-view.component.html new file mode 100644 index 000000000..55cc67052 --- /dev/null +++ b/projects/public-search/src/app/document-detail/document-detail-view/document-detail-view.component.html @@ -0,0 +1,38 @@ + + + + +@if (document) { + + + + + + + + + + + + @if (showinfo) { + + + + } + +} diff --git a/projects/public-search/src/app/document-detail/document-detail-view/document-detail-view.component.ts b/projects/public-search/src/app/document-detail/document-detail-view/document-detail-view.component.ts new file mode 100644 index 000000000..c37f24e9a --- /dev/null +++ b/projects/public-search/src/app/document-detail/document-detail-view/document-detail-view.component.ts @@ -0,0 +1,41 @@ +/* + * RERO ILS UI + * Copyright (C) 2021-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, Input, OnInit } from '@angular/core'; +import { RecordService } from '@rero/ng-core'; +import { AppSettingsService } from '@rero/shared'; + +@Component({ + selector: 'public-search-document-detail-vew', + templateUrl: './document-detail-view.component.html', +}) +export class DocumentDetailViewComponent implements OnInit { + private appSettingsService: AppSettingsService = inject(AppSettingsService); + private recordService: RecordService = inject(RecordService); + + @Input() viewcode: string; + @Input() documentpid: string; + @Input() showinfo = false; + document = null; + + /** OnInit hook */ + ngOnInit(): void { + // Set view code to app settings + this.appSettingsService.currentViewCode = this.viewcode; + this.recordService.getRecord('documents', this.documentpid).subscribe((doc) => (this.document = doc)); + } +} diff --git a/projects/public-search/src/app/document-detail/document-detail-view/holdings/electronic-holdings/electronic-holdings.component.html b/projects/public-search/src/app/document-detail/document-detail-view/holdings/electronic-holdings/electronic-holdings.component.html new file mode 100644 index 000000000..5b99fcda4 --- /dev/null +++ b/projects/public-search/src/app/document-detail/document-detail-view/holdings/electronic-holdings/electronic-holdings.component.html @@ -0,0 +1,45 @@ + + +@if (holdings.length > 0) { + + + + + +
+ @for(holding of holdings; track holding) { + @for (location of holding.metadata.electronic_location; track location) { +
+
+ {{holding.metadata.library.name}} +
+
+ {{location.source}} +
+ +
+ } + } +
+
+} diff --git a/projects/public-search/src/app/document-detail/document-detail-view/holdings/electronic-holdings/electronic-holdings.component.ts b/projects/public-search/src/app/document-detail/document-detail-view/holdings/electronic-holdings/electronic-holdings.component.ts new file mode 100644 index 000000000..428f813e4 --- /dev/null +++ b/projects/public-search/src/app/document-detail/document-detail-view/holdings/electronic-holdings/electronic-holdings.component.ts @@ -0,0 +1,39 @@ +/* + * RERO ILS UI + * Copyright (C) 2021-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, Input, OnInit } from '@angular/core'; +import { HoldingsApiService } from 'projects/public-search/src/app/api/holdings-api.service'; + +@Component({ + selector: 'public-search-electronic-holdings', + templateUrl: './electronic-holdings.component.html' +}) +export class ElectronicHoldingsComponent implements OnInit{ + + private holdingsApiService: HoldingsApiService = inject(HoldingsApiService); + + @Input() documentPid; + @Input() viewcode; + + holdings = []; + + ngOnInit(): void { + const query = `document.pid:${this.documentPid} AND holdings_type:electronic NOT _masked:true`; + this.holdingsApiService.getElectronicHoldingsByDocumentPidAndViewcode(this.documentPid, this.viewcode, 1, 100).subscribe((hits: any) => this.holdings = hits.hits); + } + +} diff --git a/projects/public-search/src/app/document-detail/holdings/holding/holding.component.html b/projects/public-search/src/app/document-detail/holdings/holding/holding.component.html index 0ec6ea9ee..cd858157d 100644 --- a/projects/public-search/src/app/document-detail/holdings/holding/holding.component.html +++ b/projects/public-search/src/app/document-detail/holdings/holding/holding.component.html @@ -15,92 +15,97 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . --> -
- -
-
- - {{ holding.metadata.library.name }}: {{ holding.metadata.location.name }} -
-
- {{ holding.metadata.circulation_category.circulation_information | getTranslatedLabel : language }} -
-
- - {{ holding.metadata.public_items_count }} - {{ holding.metadata.public_items_count | i18nPlural: { '=0': 'item', '=1': 'item', 'other': 'items' } | translate }} - -
-
- - @if (holding.metadata.holdings_type === 'serial') { - - {{ 'see collections and items' | translate }} - } @else { - + + + +
+
+
+ {{ holding.metadata.library.name }}: {{ holding.metadata.location.name }} +
+
+ {{ holding.metadata.circulation_category.circulation_information | getTranslatedLabel : language }} +
+
+ @if (holding.metadata.public_items_count > 0) { + {{ holding.metadata.public_items_count }} + {{ holding.metadata.public_items_count | i18nPlural: { '=0': 'item', '=1': 'item', 'other': 'items' } | translate }} } - -
-
- - @if (holding.metadata.holdings_type === 'serial') { -
- - @if (holding.metadata.call_number) { -
Call number
-
- {{ holding.metadata.call_number }} - @if (holding.metadata.second_call_number) { - | {{ holding.metadata.second_call_number }} +
+
+ @if (holding.metadata.holdings_type === 'serial') { + + {{ 'see collections and items' | translate }} + } @else { + } - - } - - @if (holding.metadata.enumerationAndChronology) { -
Available collection
-
-
- } - - @if (holding.metadata.supplementaryContent) { -
Supplementary content
-
{{ holding.metadata.supplementaryContent }}
- } - - @if (holding.metadata.index) { -
Indexes
-
{{ holding.metadata.index }}
- } - - @if (holding.metadata.missing_issues) { -
Missing issues
-
{{ holding.metadata.missing_issues }}
- } - - @if (holding.metadata.notes) { - @for (note of holding.metadata.notes | notesFilter : noteAuthorizedTypes; track note) { -
- - {{ note.type | translate }} -
-
- } +
+
+ + @if (holding.metadata.holdings_type === 'serial') { + } - - } -
-@if (!collapsed) { +
+ @if (holding.metadata.public_items_count > 0) { - + } -} + /> + + diff --git a/projects/public-search/src/app/document-detail/holdings/holding/holding.component.scss b/projects/public-search/src/app/document-detail/holdings/holding/holding.component.scss index c6f346e6a..689688b1f 100644 --- a/projects/public-search/src/app/document-detail/holdings/holding/holding.component.scss +++ b/projects/public-search/src/app/document-detail/holdings/holding/holding.component.scss @@ -16,20 +16,11 @@ * along with this program. If not, see . */ -@import 'bootstrap/scss/functions'; -@import 'bootstrap/scss/variables'; - -a.collapse-link i { - min-width: 16px -} - -.label-title:after { - content: ":" -} - -dl.holdings-data { - margin-left: map-get($spacers, 4); - dd, dt { - margin: 0; +public-search-holding, [public-search-holding] { + .p-accordion-header { + @extend .surface-100; + a.p-accordion-header-link { + background: none; + } } } diff --git a/projects/public-search/src/app/document-detail/holdings/holding/holding.component.ts b/projects/public-search/src/app/document-detail/holdings/holding/holding.component.ts index e366f54a9..d2cabe161 100644 --- a/projects/public-search/src/app/document-detail/holdings/holding/holding.component.ts +++ b/projects/public-search/src/app/document-detail/holdings/holding/holding.component.ts @@ -18,15 +18,16 @@ import { Component, inject, Input } from '@angular/core'; import { TranslateService } from '@ngx-translate/core'; import { HoldingsNoteType } from '@rero/shared'; +import { HoldingsApiService } from '../../../api/holdings-api.service'; @Component({ - selector: 'public-search-holding', - templateUrl: './holding.component.html', - styleUrls: ['./holding.component.scss'] + selector: 'public-search-holding, [public-search-holding]', + templateUrl: './holding.component.html' }) export class HoldingComponent { private translateService: TranslateService = inject(TranslateService); + public holdingApiService: HoldingsApiService = inject(HoldingsApiService); // COMPONENT ATTRIBUTES ===================================================== /** Holdings record */ @@ -35,9 +36,6 @@ export class HoldingComponent { /** View code */ @Input() viewcode: string; - /** Is collapsed holdings */ - @Input() collapsed = true; - /** Authorized types of note */ noteAuthorizedTypes: string[] = [HoldingsNoteType.GENERAL, HoldingsNoteType.ACCESS]; diff --git a/projects/public-search/src/app/document-detail/holdings/holdings.component.html b/projects/public-search/src/app/document-detail/holdings/holdings.component.html index 268c4ab8f..50cab05af 100644 --- a/projects/public-search/src/app/document-detail/holdings/holdings.component.html +++ b/projects/public-search/src/app/document-detail/holdings/holdings.component.html @@ -14,23 +14,45 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . --> - - - @if (holdings.length > 0) { - @for (holding of holdings; track holding) { - - + @if (!user.roles.includes('patron')) { + } + + @for (holding of holdings; track holding) { +
+ } +
@if (isLinkShowMore) { - - ({{ hiddenHoldings }}) + +
+  {{ + "Show more" | translate + }} ({{ hiddenHoldings }}) +
+
} + Interlibrary loan } diff --git a/projects/public-search/src/app/document-detail/holdings/holdings.component.ts b/projects/public-search/src/app/document-detail/holdings/holdings.component.ts index 23286f848..7403cb1ac 100644 --- a/projects/public-search/src/app/document-detail/holdings/holdings.component.ts +++ b/projects/public-search/src/app/document-detail/holdings/holdings.component.ts @@ -1,6 +1,5 @@ /* - * RERO ILS UI - * Copyright (C) 2021-2024 RERO + * RERO IL-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 @@ -14,29 +13,28 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ -import { Component, inject, Input, OnInit } from '@angular/core'; +import { Component, inject, Input, OnInit, ViewEncapsulation } from '@angular/core'; import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; import { TranslateService } from '@ngx-translate/core'; -import { AppSettingsService } from '@rero/shared'; -import { Observable } from 'rxjs'; +import { AppSettingsService, User, UserService } from '@rero/shared'; +import { Observable, switchMap, tap } from 'rxjs'; import { HoldingsApiService } from '../../api/holdings-api.service'; import { QueryResponse } from '../../record'; +import { RecordService } from '@rero/ng-core'; @Component({ selector: 'public-search-holdings', - templateUrl: './holdings.component.html' + templateUrl: './holdings.component.html', }) export class HoldingsComponent implements OnInit { - private holdingsApiService: HoldingsApiService = inject(HoldingsApiService); private translateService: TranslateService = inject(TranslateService); - private appSettingsService: AppSettingsService = inject(AppSettingsService); + private userService: UserService = inject(UserService); // COMPONENTS ATTRIBUTES ==================================================== /** View code */ @Input() viewcode: string; - /** Document pid */ - @Input() documentpid: string; + @Input() documentPid: string; /** Holdings total */ holdingsTotal = 0; @@ -48,13 +46,17 @@ export class HoldingsComponent implements OnInit { /** Holdings per page */ private holdingsPerPage = 10; + get user(): User { + return this.userService.user; + } + // GETTER & SETTER ========================================================== /** * Is the link `show more holdings` must be displayed * @return boolean */ get isLinkShowMore() { - return this.holdingsTotal > 0 && ((this.page * this.holdingsPerPage) < this.holdingsTotal); + return this.holdingsTotal > 0 && this.page * this.holdingsPerPage < this.holdingsTotal; } /** @@ -62,32 +64,35 @@ export class HoldingsComponent implements OnInit { * @return string */ get hiddenHoldings(): string { - const count = this.holdingsTotal - (this.page * this.holdingsPerPage); + const count = this.holdingsTotal - this.page * this.holdingsPerPage; if (count <= 0) { return ''; } - const linkText = (count > 1) - ? _('{{ counter }} hidden holdings') - : _('{{ counter }} hidden holding'); + const linkText = count > 1 ? _('{{ counter }} hidden holdings') : _('{{ counter }} hidden holding'); return this.translateService.instant(linkText, { counter: count }); } /** OnInit hook */ ngOnInit(): void { // Set view code to app settings - this.appSettingsService.currentViewCode = this.viewcode; - this._holdingsQuery(1).subscribe((response: QueryResponse) => { - this.holdingsTotal = response.total.value; - this.holdings = response.hits; - }); + this._holdingsQuery(1) + .pipe( + tap((response: QueryResponse) => { + this.holdingsTotal = response.total.value; + this.holdings = response.hits; + }) + ) + .subscribe(); } // COMPONENT FUNCTIONS ====================================================== /** Handler when 'show more holdings' link is clicked. */ showMore(event: Event) { - event.preventDefault(); // Doesn't follow any `href` link + event.preventDefault(); // Doesn't follow any `href` link this.page++; - this._holdingsQuery(this.page).subscribe((response: QueryResponse) => this.holdings = this.holdings.concat(response.hits)); + this._holdingsQuery(this.page).subscribe( + (response: QueryResponse) => (this.holdings = this.holdings.concat(response.hits)) + ); } /** @@ -96,7 +101,11 @@ export class HoldingsComponent implements OnInit { * @return Observable */ private _holdingsQuery(page: number): Observable { - return this.holdingsApiService - .getHoldingsByDocumentPidAndViewcode(this.documentpid, this.viewcode, page, this.holdingsPerPage); + return this.holdingsApiService.getHoldingsByDocumentPidAndViewcode( + this.documentPid, + this.viewcode, + page, + this.holdingsPerPage + ); } } diff --git a/projects/public-search/src/app/document-detail/holdings/items/items.component.html b/projects/public-search/src/app/document-detail/holdings/items/items.component.html index b5f156b8f..b8f96e33f 100644 --- a/projects/public-search/src/app/document-detail/holdings/items/items.component.html +++ b/projects/public-search/src/app/document-detail/holdings/items/items.component.html @@ -15,23 +15,32 @@ along with this program. If not, see . --> -
- @if (items.length > 0) { - @for (item of items; track item; let index = $index) { +
+@if (items.length > 0) { + +
+ @for (item of items; track item) { +
- } - @if (isLinkShowMore) { - - ({{ hiddenItems }}) - } - } @else { -
No item received.
+ /> +
+ } +
+ @if (isLinkShowMore) { + +
+  {{'Show more' | translate}} ({{ hiddenItems }}) +
+
} +} @else { +
No item received.
+}
diff --git a/projects/public-search/src/app/patron-profile/patron-profile-document/patron-profile-document.component.scss b/projects/public-search/src/app/document-detail/holdings/items/items.component.scss similarity index 91% rename from projects/public-search/src/app/patron-profile/patron-profile-document/patron-profile-document.component.scss rename to projects/public-search/src/app/document-detail/holdings/items/items.component.scss index bef22e57c..fbdbf04b3 100644 --- a/projects/public-search/src/app/patron-profile/patron-profile-document/patron-profile-document.component.scss +++ b/projects/public-search/src/app/document-detail/holdings/items/items.component.scss @@ -1,6 +1,6 @@ /* * RERO ILS UI - * Copyright (C) 2021 RERO + * Copyright (C) 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 @@ -15,6 +15,4 @@ * along with this program. If not, see . */ -dl, dt, dd { - margin-bottom: 0; -} +// @import 'primeflex/primeflex'; diff --git a/projects/public-search/src/app/document-detail/holdings/items/items.component.ts b/projects/public-search/src/app/document-detail/holdings/items/items.component.ts index 4904339e8..dfd62420a 100644 --- a/projects/public-search/src/app/document-detail/holdings/items/items.component.ts +++ b/projects/public-search/src/app/document-detail/holdings/items/items.component.ts @@ -22,7 +22,8 @@ import { QueryResponse } from '../../../record'; @Component({ selector: 'public-search-items', - templateUrl: './items.component.html' + templateUrl: './items.component.html', + styleUrl: './items.component.scss' }) export class ItemsComponent implements OnInit { diff --git a/projects/public-search/src/app/document-detail/item/item.component.html b/projects/public-search/src/app/document-detail/item/item.component.html index 7c2fde0c0..22765e1a4 100644 --- a/projects/public-search/src/app/document-detail/item/item.component.html +++ b/projects/public-search/src/app/document-detail/item/item.component.html @@ -15,21 +15,18 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . --> -
-
+ - -
+ diff --git a/projects/public-search/src/app/document-detail/item/item.component.ts b/projects/public-search/src/app/document-detail/item/item.component.ts index b98ab4c0a..843085295 100644 --- a/projects/public-search/src/app/document-detail/item/item.component.ts +++ b/projects/public-search/src/app/document-detail/item/item.component.ts @@ -17,6 +17,7 @@ */ import { Component, inject, Input } from '@angular/core'; import { TranslateService } from '@ngx-translate/core'; +import { ItemApiService } from '../../api/item-api.service'; @Component({ selector: 'public-search-item', @@ -25,6 +26,7 @@ import { TranslateService } from '@ngx-translate/core'; export class ItemComponent { private translateService: TranslateService = inject(TranslateService); + public itemApiService: ItemApiService = inject(ItemApiService); /** Item record */ private _item: any; @@ -50,9 +52,6 @@ export class ItemComponent { /** context */ @Input() context: string; - /** index */ - @Input() index: number; - /** Authorized types of note */ noteAuthorizedTypes: string[] = [ 'binding_note', diff --git a/projects/public-search/src/app/document-detail/request/pickup-location/pickup-location.component.html b/projects/public-search/src/app/document-detail/request/pickup-location/pickup-location.component.html index 7c9b2e3d6..8a345c42f 100644 --- a/projects/public-search/src/app/document-detail/request/pickup-location/pickup-location.component.html +++ b/projects/public-search/src/app/document-detail/request/pickup-location/pickup-location.component.html @@ -15,45 +15,52 @@ along with this program. If not, see . --> @if (fields.length > 0 && showForm) { -
-
-
- @if (recordType === 'holding' && itemCount > 0) { -
Please make sure that your requested issue is not listed above.
- +
+ @if (recordType === 'holding' && itemCount > 0) { + + } +
+ + @if (!requestInProgress) { + + } + + @if (!requestInProgress) { + {{ 'Confirm your request' | translate }} + } @else { + + {{ 'Request in progress' | translate }} } - - - @if (!requestInProgress) { - - } - - -
-
+ +
} @if (requested && !showForm) { -
-
-
- -
-
+
+
} diff --git a/projects/public-search/src/app/document-detail/request/request.component.html b/projects/public-search/src/app/document-detail/request/request.component.html index 262e9525a..0bec11b24 100644 --- a/projects/public-search/src/app/document-detail/request/request.component.html +++ b/projects/public-search/src/app/document-detail/request/request.component.html @@ -17,45 +17,32 @@ @if (patron) { @if (!requestDialog) { @if (canRequest && canRequest.can) { -
- @if (recordType !== 'holding') { -
 
+ + + @if (recordType === 'item') { + {{ 'Request' | translate }} + } @else { + @if (holdingsItemsCount > 0) { + {{ 'Request another issue' | translate }} + } @else { + {{ 'Request an issue' | translate }} + } } -
- -
-
+ } } @else { -
- @if (recordType !== 'holding') { -
 
- } -
-
-
+ class="w-full" + /> } } diff --git a/projects/public-search/src/app/error/error-page.component.ts b/projects/public-search/src/app/error/error-page.component.ts index eec740504..cf9c25f53 100644 --- a/projects/public-search/src/app/error/error-page.component.ts +++ b/projects/public-search/src/app/error/error-page.component.ts @@ -26,14 +26,20 @@ export function _(str: string) { @Component({ selector: 'public-search-error-page', template: ` -
-

{{ statusCode }} - {{ messages[statusCode].title }}

- @for (text of messages[statusCode].description || []; track text) { -
{{ text }}
- } -
-

For any information please contact system administrator

+ + +
+

{{ msg.summary }}

+

{{ msg.detail }}

+ For any information please contact system administrator.
+
+
` }) @@ -47,34 +53,36 @@ export class ErrorPageComponent implements OnInit { * - title : the error title * - description : A human readable description of this error as Array. Each array * element will be a separate line. - * - level: the bootstrap alert look-and-feel level to use for the error. 'danger' by default. + * - severity: the bootstrap alert look-and-feel level to use for the error. 'danger' by default. */ messages = { 401: { - title: _('Unauthorized'), - description: [_('Access denied due to invalid credentials.')], - level: 'warning' + summary: _('Unauthorized'), + detail: _('Access denied due to invalid credentials.'), + severity: 'warn' }, 403: { - title: _('Forbidden access'), - description: [_('You don\'t have permission to access this page.')], - level: 'warning' + summary: _('Forbidden access'), + detail: _('You don\'t have permission to access this page.'), + severity: 'warn' }, 404: { - title: _('Page not found'), - description: [_('Woops. Looks like this page doesn\'t exists')] + summary: _('Page not found'), + detail: _('Woops. Looks like this page doesn\'t exists'), + severity: 'info' }, 418: { - title: _('I\'m a teapot'), - description: [ + summary: _('I\'m a teapot'), + detail: [ _('The requested entity body is short and stout'), _('Tip me over and pour me out') - ], - level: 'success' + ].join(' '), + severity: 'success' }, 500: { - title: _('Internal server error'), - description: [_('Oops, Something went wrong !')] + summary: _('Internal server error'), + detail: _('Oops, Something went wrong !'), + severity: 'danger' } }; diff --git a/projects/public-search/src/app/main/main.component.ts b/projects/public-search/src/app/main/main.component.ts index 83424540a..5ab9c08fa 100644 --- a/projects/public-search/src/app/main/main.component.ts +++ b/projects/public-search/src/app/main/main.component.ts @@ -19,11 +19,9 @@ import { Component } from '@angular/core'; @Component({ selector: 'public-search-main', template: ` -
-
-

Public search

+
+

Public search

-
` }) export class MainComponent { } diff --git a/projects/public-search/src/app/patron-profile/patron-profile-document/patron-profile-document.component.html b/projects/public-search/src/app/patron-profile/patron-profile-document/patron-profile-document.component.html index e057fd41b..47d2a83b3 100644 --- a/projects/public-search/src/app/patron-profile/patron-profile-document/patron-profile-document.component.html +++ b/projects/public-search/src/app/patron-profile/patron-profile-document/patron-profile-document.component.html @@ -19,24 +19,22 @@ {{ record.metadata.document.title | mainTitle }} @if (record.metadata.item.enumerationAndChronology && !showAdditionalInformation) { - {{ record.metadata.item.enumerationAndChronology }} + } - + @if (record.metadata && showAdditionalInformation) { -
-
+ - -
+ } } diff --git a/projects/public-search/src/app/patron-profile/patron-profile-document/patron-profile-document.component.ts b/projects/public-search/src/app/patron-profile/patron-profile-document/patron-profile-document.component.ts index 013206ba9..e122d59c0 100644 --- a/projects/public-search/src/app/patron-profile/patron-profile-document/patron-profile-document.component.ts +++ b/projects/public-search/src/app/patron-profile/patron-profile-document/patron-profile-document.component.ts @@ -20,8 +20,7 @@ import { PatronProfileMenuService } from '../patron-profile-menu.service'; @Component({ selector: 'public-search-patron-profile-document', - templateUrl: './patron-profile-document.component.html', - styleUrls: ['./patron-profile-document.component.scss'] + templateUrl: './patron-profile-document.component.html' }) export class PatronProfileDocumentComponent implements OnInit { diff --git a/projects/public-search/src/app/patron-profile/patron-profile-fees/patron-profile-fee/patron-profile-fee.component.html b/projects/public-search/src/app/patron-profile/patron-profile-fees/patron-profile-fee/patron-profile-fee.component.html index 7994d288a..ad51d7886 100644 --- a/projects/public-search/src/app/patron-profile/patron-profile-fees/patron-profile-fee/patron-profile-fee.component.html +++ b/projects/public-search/src/app/patron-profile/patron-profile-fees/patron-profile-fee/patron-profile-fee.component.html @@ -16,100 +16,103 @@ --> @if (record) { -
- -
-
-
{{ record.metadata.creation_date | dateTranslate: 'short' }}
-
{{ record.metadata.type | translate }}
-
{{ record.metadata.total_amount | currency:organisation.currency:'symbol' }}
- - @if (!isCollapsed) { -
-
- - @if (record.metadata.note) { -
-
Note
- {{ record.metadata.note }} -
- } - - @if (record.metadata.document; as document) { -
-
Document
-
- -
Title
-
- {{ document.title | mainTitle }} -
- - @if (record.metadata.loan.item.call_number) { -
Call number
-
{{ record.metadata.loan.item.call_number }}
- } - -
Loan started at
-
{{ record.metadata.loan.transaction_date | dateTranslate: 'short' }}
-
-
- } +
+
+ +
+
{{ record.metadata.creation_date | dateTranslate: 'short' }}
+
{{ record.metadata.type | translate }}
+
{{ record.metadata.total_amount | currency:organisation.currency:'symbol' }}
+ + @if (!isCollapsed) { +
+ + @if (record.metadata.note) { + + {{ record.metadata.note }} + + } + + @if (record.metadata.document; as document) { + + + + } + + + - -
Transactions history
-
- @for (event of events; track event) { -
-
-
- - {{ event.metadata.creation_date | dateTranslate: 'shortDate' }} - - {{ event.metadata.creation_date | dateTranslate: 'HH:mm' }} + + +
+
+ {{ event.metadata.type | translate }} + @if (event.metadata.subtype) { + [{{ event.metadata.subtype | translate }}] + }
-
-
-
- {{ event.metadata.type | translate }} - @if (event.metadata.subtype) { - [{{ event.metadata.subtype | translate }}] - } -
-
- @if (event.metadata.amount) { - - {{ event.metadata.amount | currency:organisation.currency:'symbol' }} - - } @else { -   - } -
- @if (event.metadata.note) { -
- - {{ 'Note' | translate }} -
-
{{ event.metadata.note }}
- } - @if (event.metadata.library) { -
- - {{ 'Library' | translate }} -
-
{{ event.metadata.library.name }}
- } -
+
+ @if (event.metadata.amount) { + + {{ event.metadata.amount | currency:organisation.currency:'symbol' }} + + }
+ @if (event.metadata.note) { + + } + @if (event.metadata.library) { + + } + + +
+ + {{ event.metadata.creation_date | dateTranslate: 'shortDate' }} + + {{ event.metadata.creation_date | dateTranslate: 'HH:mm' }}
- } -
-
+ + + + + + + +
} -
-
} diff --git a/projects/public-search/src/app/patron-profile/patron-profile-fees/patron-profile-fee/patron-profile-fee.component.scss b/projects/public-search/src/app/patron-profile/patron-profile-fees/patron-profile-fee/patron-profile-fee.component.scss deleted file mode 100644 index f557f52dd..000000000 --- a/projects/public-search/src/app/patron-profile/patron-profile-fees/patron-profile-fee/patron-profile-fee.component.scss +++ /dev/null @@ -1,186 +0,0 @@ -/* - * RERO ILS UI - * Copyright (C) 2021 RERO - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, version 3 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ -@import 'bootstrap/scss/functions'; -@import 'bootstrap/scss/variables'; - -:host:nth-child(even){ - background-color: $light; -} - -dl > dt, -dl > dd { - padding-left: 0; - margin-bottom: 0; -} - -h5 { - border-bottom: $border-width solid $border-color; - margin-bottom: map-get($spacers, 3); -} - -@media (min-width: map_get($grid-breakpoints, lg)) { - .events-timeline { - position: relative; - .timeline-event { - .event-timestamp { - color: $secondary; - font-size: ($font-size-base * .75); - text-align: right; - } - .event-content { - &:before { - content: ''; - background: $secondary; - position: absolute; - left: - map-get($spacers, 2); // -.5rem - top: map-get($spacers, 1); // .25rem - width: 1px; - height: 100%; - z-index: 400; - } - &:hover .more-detail{ - display: block; - } - .row { - margin-bottom: 1rem; - line-height: 1.1; - &:first-child:after { - content: ' '; - background-color: white; - display: inline-block; - position: absolute; - border-radius: 50%; - border: 1px solid $secondary; - left: calc(-.75rem - 1px); - top: .25rem; - width: .75rem; - height: .75rem; - z-index: 400; - } - &.event-highlight:first-child:after{ - border-color: $warning; - background-color: theme-color-level("warning", -10); - } - .label { - &:after { - content: ' '; - position: absolute; - border: .5px dashed #EEE; - top: calc(.55rem - 1px); - width: 100%; - } - } - blockquote { - font-style: italic; - margin: 0; - &:before, &:after { - color: #AAA; - } - &:before { - content: '“ '; - } - &:after { - content: ' ”'; - } - } - } - .force-display { - display: block !important; - } - .more-detail { - display: none; - cursor: pointer; - } - .label-title { - text-align: right; - } - } - } - } -} - -@media (max-width: map_get($grid-breakpoints, md)) { - .events-timeline { - position: relative; - .timeline-event { - margin-left: 10px; - .event-timestamp { - color: $secondary; - font-size: ($font-size-base * .75); - text-align: left; - } - .event-content { - .amount { - text-align: right; - } - &:before { - content: ''; - background: $secondary; - position: absolute; - left: - map-get($spacers, 2); // -.50rem - top: map-get($spacers, 1); // .25rem - width: 1px; - height: 100%; - z-index: 400; - } - &:hover .more-detail{ - display: block; - } - .row { - margin-bottom: 1rem; - line-height: 1.1; - &:first-child:after { - content: ' '; - background-color: white; - display: inline-block; - position: absolute; - border-radius: 50%; - border: 1px solid $secondary; - left: calc(-.75rem - 1px); - top: .25rem; - width: .75rem; - height: .75rem; - z-index: 400; - } - &.event-highlight:first-child:after{ - border-color: $warning; - background-color: theme-color-level("warning", -10); - } - .label { - &:after { - content: ' '; - position: absolute; - border: .5px dashed #EEE; - top: calc(.55rem - 1px); - width: 100%; - } - } - } - .force-display { - display: block !important; - } - .more-detail { - display: none; - cursor: pointer; - } - .label-title { - text-align: left; - } - } - } - } -} diff --git a/projects/public-search/src/app/patron-profile/patron-profile-fees/patron-profile-fee/patron-profile-fee.component.ts b/projects/public-search/src/app/patron-profile/patron-profile-fees/patron-profile-fee/patron-profile-fee.component.ts index baebc39bb..b3ceb1da4 100644 --- a/projects/public-search/src/app/patron-profile/patron-profile-fees/patron-profile-fee/patron-profile-fee.component.ts +++ b/projects/public-search/src/app/patron-profile/patron-profile-fees/patron-profile-fee/patron-profile-fee.component.ts @@ -22,8 +22,7 @@ import { PatronProfileMenuService } from '../../patron-profile-menu.service'; @Component({ selector: 'public-search-patron-profile-fee', - templateUrl: './patron-profile-fee.component.html', - styleUrls: ['./patron-profile-fee.component.scss'] + templateUrl: './patron-profile-fee.component.html' }) export class PatronProfileFeeComponent { diff --git a/projects/public-search/src/app/patron-profile/patron-profile-fees/patron-profile-fees.component.html b/projects/public-search/src/app/patron-profile/patron-profile-fees/patron-profile-fees.component.html index 26f8f28b0..16e7bae6b 100644 --- a/projects/public-search/src/app/patron-profile/patron-profile-fees/patron-profile-fees.component.html +++ b/projects/public-search/src/app/patron-profile/patron-profile-fees/patron-profile-fees.component.html @@ -15,42 +15,37 @@ along with this program. If not, see . --> -
-
-
-
Date
-
Category
-
- {{ 'Total amount' | translate }}: - {{ feesTotal | currency:currency:'symbol' }} -
-
-
+
+ + + + - @if (!loaded) { -
-
Loading in progress
-
- } @else { - @if (paginator.getRecordsCount() > 0) { -
-
-
- @for (record of records; track record) { + @defer (when loaded) { + @if (paginator.getRecordsCount() > 0) { +
+ @for (record of records; track record) { +
- - } - -
+ /> +
+ } +
-
- } @else { -
-
No fee
-
+ } @else { +
No fee
+ } + } @placeholder { +
Loading in progress
} - } +
diff --git a/projects/public-search/src/app/patron-profile/patron-profile-histories/patron-profile-histories.component.html b/projects/public-search/src/app/patron-profile/patron-profile-histories/patron-profile-histories.component.html index 19892a5a3..bd3ec99ee 100644 --- a/projects/public-search/src/app/patron-profile/patron-profile-histories/patron-profile-histories.component.html +++ b/projects/public-search/src/app/patron-profile/patron-profile-histories/patron-profile-histories.component.html @@ -14,33 +14,33 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . --> -
-
-
Document
-
Return date
-
+
+ + + + @defer (when loaded) { @if (paginator.getRecordsCount() > 0) { -
-
+
@for (loan of records; track loan) { +
- + id="history-{{ loan.metadata.pid }}" + /> +
} -
- + } @else { -
- No history -
- } - } @placeholder { -
-
Loading in progress
-
+
No loan
} +} @placeholder { +
Loading in progress
+} +
diff --git a/projects/public-search/src/app/patron-profile/patron-profile-histories/patron-profile-history/patron-profile-history.component.html b/projects/public-search/src/app/patron-profile/patron-profile-histories/patron-profile-history/patron-profile-history.component.html index b0190e06d..4a56171b9 100644 --- a/projects/public-search/src/app/patron-profile/patron-profile-histories/patron-profile-history/patron-profile-history.component.html +++ b/projects/public-search/src/app/patron-profile/patron-profile-histories/patron-profile-history/patron-profile-history.component.html @@ -16,29 +16,32 @@ --> @if (record) { -
-
+
-
+
@if (document) { {{ record.metadata.loan.item.document.title }} } @else { - {{ record.metadata.loan.item.document.title }} + {{ record.metadata.loan.item.document.title }} } @if (record.metadata.loan.item.enumerationAndChronology) { - {{ record.metadata.loan.item.enumerationAndChronology }} + + {{ record.metadata.loan.item.enumerationAndChronology }} + } @if (document) { } +
-
- Return date - {{ record.metadata.date | dateTranslate: 'shortDate' }} +
-
} diff --git a/projects/public-search/src/app/patron-profile/patron-profile-histories/patron-profile-history/patron-profile-history.component.ts b/projects/public-search/src/app/patron-profile/patron-profile-histories/patron-profile-history/patron-profile-history.component.ts index e6f7fffb7..311b0704c 100644 --- a/projects/public-search/src/app/patron-profile/patron-profile-histories/patron-profile-history/patron-profile-history.component.ts +++ b/projects/public-search/src/app/patron-profile/patron-profile-histories/patron-profile-history/patron-profile-history.component.ts @@ -19,8 +19,7 @@ import { PatronProfileMenuService } from '../../patron-profile-menu.service'; @Component({ selector: 'public-search-patron-profile-history', - templateUrl: './patron-profile-history.component.html', - styleUrls: ['./patron-profile-history.component.scss'] + templateUrl: './patron-profile-history.component.html' }) export class PatronProfileHistoryComponent { diff --git a/projects/public-search/src/app/patron-profile/patron-profile-ill-requests/patron-profile-ill-request/patron-profile-ill-request.component.html b/projects/public-search/src/app/patron-profile/patron-profile-ill-requests/patron-profile-ill-request/patron-profile-ill-request.component.html index a34b42e39..c524c5fac 100644 --- a/projects/public-search/src/app/patron-profile/patron-profile-ill-requests/patron-profile-ill-request/patron-profile-ill-request.component.html +++ b/projects/public-search/src/app/patron-profile/patron-profile-ill-requests/patron-profile-ill-request/patron-profile-ill-request.component.html @@ -15,99 +15,85 @@ along with this program. If not, see . --> -
- -
+
+
+ -
-
-
{{ record.metadata.document.title }}
-
{{ record.metadata.document.authors }}
-
-
- @if (record.metadata.status !== 'validated') { - - {{ record.metadata.status | translate }} - - } @else { - @if (record.metadata.loan_status) { - - {{ record.metadata.loan_status | translate }} - +
+
{{ record.metadata.document.title }}
+
{{ record.metadata.document.authors }}
+ + @if (!isCollapsed){ +
-
- - @if (!isCollapsed){ -
-
- - @if (record.metadata.document.publisher) { -
Publisher
-
{{ record.metadata.document.publisher }}
- } - - @if (record.metadata.document.year) { -
Year
-
{{ record.metadata.document.year }}
- } - - @if (record.metadata.document.identifier) { -
Identifier
-
{{ record.metadata.document.identifier }}
- } - - @if (record.metadata.document.source) { -
Source
-
- @if (record.metadata.document.source.volume || record.metadata.document.source.number) { - {{ record.metadata.document.source | journalVolume }} + + @if (record.metadata.document.year) { +
Year
+
{{ record.metadata.document.year }}
+ } + + @if (record.metadata.document.identifier) { +
Identifier
+
{{ record.metadata.document.identifier }}
+ } + + @if (record.metadata.document.source) { +
Source
+
+ @if (record.metadata.document.source.volume || record.metadata.document.source.number) { + {{ record.metadata.document.source | journalVolume }} + } +
+ } + +
Pickup location
+
{{ record.metadata.pickup_location.name }}
+ +
Scope
+
+ @if (record.metadata.copy) { + {{ 'Copy' | translate }} + } @else { + {{ 'Loan' | translate }} }
- } - -
Pickup location
-
{{ record.metadata.pickup_location.name }}
- -
Scope
-
- @if (record.metadata.copy) { - {{ 'Copy' | translate }} - } @else { - {{ 'Loan' | translate }} + + @if (record.metadata.copy && record.metadata.pages) { +
Pages
+
{{ record.metadata.pages }}
} - - - @if (record.metadata.copy && record.metadata.pages) { -
Pages
-
{{ record.metadata.pages }}
- } - - @if (record.metadata.found_in) { -
Found in
-
- {{ record.metadata.found_in.url }} - {{ record.metadata.found_in.source }} -
- } - - @if (record.metadata.notes && record.metadata.notes.length > 0) { -
Note
-
-
-
    + + @if (record.metadata.found_in) { +
    Found in
    +
    + {{ record.metadata.found_in.url }} + {{ record.metadata.found_in.source }} +
    + } + + @if (record.metadata.notes && record.metadata.notes.length > 0) { +
    Note
    +
    +
      @for (note of record.metadata.notes | notesFilter:['public_note']; track note) {
    • }
    -
-
- } -
-
- } + + } + + } +
+
+
+ @if (record.metadata.loan_status) { + + {{ record.metadata.loan_status | translate }} + + }
diff --git a/projects/public-search/src/app/patron-profile/patron-profile-ill-requests/patron-profile-ill-request/patron-profile-ill-request.component.scss b/projects/public-search/src/app/patron-profile/patron-profile-ill-requests/patron-profile-ill-request/patron-profile-ill-request.component.scss deleted file mode 100644 index fa9626a3c..000000000 --- a/projects/public-search/src/app/patron-profile/patron-profile-ill-requests/patron-profile-ill-request/patron-profile-ill-request.component.scss +++ /dev/null @@ -1,29 +0,0 @@ -/* - * RERO ILS UI - * Copyright (C) 2022 RERO - * Copyright (C) 2022 UCLouvain - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, version 3 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -@import 'bootstrap/scss/functions'; -@import 'bootstrap/scss/variables'; - -:host:nth-child(even){ - background-color: $light; -} - -dt, dd { - padding-left: 0; - margin-bottom: 0; - } diff --git a/projects/public-search/src/app/patron-profile/patron-profile-ill-requests/patron-profile-ill-request/patron-profile-ill-request.component.ts b/projects/public-search/src/app/patron-profile/patron-profile-ill-requests/patron-profile-ill-request/patron-profile-ill-request.component.ts index 9d8a7befd..586fc5b4d 100644 --- a/projects/public-search/src/app/patron-profile/patron-profile-ill-requests/patron-profile-ill-request/patron-profile-ill-request.component.ts +++ b/projects/public-search/src/app/patron-profile/patron-profile-ill-requests/patron-profile-ill-request/patron-profile-ill-request.component.ts @@ -18,8 +18,7 @@ import { Component, Input } from '@angular/core'; @Component({ selector: 'public-search-patron-profile-ill-request', - templateUrl: './patron-profile-ill-request.component.html', - styleUrls: ['./patron-profile-ill-request.component.scss'] + templateUrl: './patron-profile-ill-request.component.html' }) export class PatronProfileIllRequestComponent { diff --git a/projects/public-search/src/app/patron-profile/patron-profile-ill-requests/patron-profile-ill-requests.component.html b/projects/public-search/src/app/patron-profile/patron-profile-ill-requests/patron-profile-ill-requests.component.html index 8b751db36..2b6c3ff08 100644 --- a/projects/public-search/src/app/patron-profile/patron-profile-ill-requests/patron-profile-ill-requests.component.html +++ b/projects/public-search/src/app/patron-profile/patron-profile-ill-requests/patron-profile-ill-requests.component.html @@ -14,36 +14,34 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . --> -
-
-
-
Document
-
Status
-
-
+
+ + + + - @defer (when loaded) { - @if (paginator.getRecordsCount() > 0) { -
-
- @for (record of records; track record) { - - - } - + @defer (when loaded) { + @if (paginator.getRecordsCount() > 0) { +
+ @for (record of records; track record) { +
+ +
+ } +
-
- } @else { -
-
No ill request
-
+ } @else { +
No ill request
+ } } - } @placeholder { -
-
Loading in progress
-
- } + @placeholder { +
Loading in progress
+ } +
diff --git a/projects/public-search/src/app/patron-profile/patron-profile-loans/patron-profile-loan/patron-profile-loan.component.html b/projects/public-search/src/app/patron-profile/patron-profile-loans/patron-profile-loan/patron-profile-loan.component.html index 450fb4887..1d7121bc2 100644 --- a/projects/public-search/src/app/patron-profile/patron-profile-loans/patron-profile-loan/patron-profile-loan.component.html +++ b/projects/public-search/src/app/patron-profile/patron-profile-loans/patron-profile-loan/patron-profile-loan.component.html @@ -15,74 +15,72 @@ along with this program. If not, see . --> -
- -
-
+
- -
-
Library
-
{{ record.metadata.library.name }}
+
+ +
+ + + + - +
+ +
+
+
-
-
- Due date - + -
- @if (canExtend.can) { - - } @else { - - } -
-
+ [tooltipDisabled]="canExtend.can" + (onClick)="renew()" + [disabled]="renewInProgress || actionDone || !canExtend.can" + [label]="'Renew' | translate" + [icon]="renewInProgress? 'pi pi-spin pi-spinner': 'pi pi-refresh'" + />
+ + + @if (record.metadata.extension_count && record.metadata.extension_count > 0) { + + {{ record.metadata.extension_count }} + {{ record.metadata.extension_count | i18nPlural: {'=1': 'renewal', 'other': 'renewals'} | translate }} + + } + @if (record.metadata.overdue) { +
+ overdue + @if (fees > 0) { + + {{ fees | currency:organisation.currency:'symbol' }} + + } +
+ } + @if (isDueSoon) { + approaching due date + } +
diff --git a/projects/public-search/src/app/patron-profile/patron-profile-loans/patron-profile-loan/patron-profile-loan.component.scss b/projects/public-search/src/app/patron-profile/patron-profile-loans/patron-profile-loan/patron-profile-loan.component.scss deleted file mode 100644 index 23a91dcb6..000000000 --- a/projects/public-search/src/app/patron-profile/patron-profile-loans/patron-profile-loan/patron-profile-loan.component.scss +++ /dev/null @@ -1,25 +0,0 @@ -/* - * RERO ILS UI - * Copyright (C) 2022 RERO - * Copyright (C) 2022 UCLouvain - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, version 3 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -@import 'bootstrap/scss/functions'; -@import 'bootstrap/scss/variables'; - -:host:nth-child(even){ - background-color: $light; -} - diff --git a/projects/public-search/src/app/patron-profile/patron-profile-loans/patron-profile-loan/patron-profile-loan.component.ts b/projects/public-search/src/app/patron-profile/patron-profile-loans/patron-profile-loan/patron-profile-loan.component.ts index 8af14bd12..7956a912f 100644 --- a/projects/public-search/src/app/patron-profile/patron-profile-loans/patron-profile-loan/patron-profile-loan.component.ts +++ b/projects/public-search/src/app/patron-profile/patron-profile-loans/patron-profile-loan/patron-profile-loan.component.ts @@ -28,8 +28,7 @@ import { PatronProfileService } from '../../patron-profile.service'; @Component({ selector: 'public-search-patron-profile-loan', - templateUrl: './patron-profile-loan.component.html', - styleUrls: ['./patron-profile-loan.component.scss'] + templateUrl: './patron-profile-loan.component.html' }) export class PatronProfileLoanComponent implements OnInit { diff --git a/projects/public-search/src/app/patron-profile/patron-profile-loans/patron-profile-loans.component.html b/projects/public-search/src/app/patron-profile/patron-profile-loans/patron-profile-loans.component.html index e52da1efd..07ee03e7e 100644 --- a/projects/public-search/src/app/patron-profile/patron-profile-loans/patron-profile-loans.component.html +++ b/projects/public-search/src/app/patron-profile/patron-profile-loans/patron-profile-loans.component.html @@ -16,54 +16,45 @@ --> @if (paginator.getRecordsCount() > 0) { -
-
-
- - -
+
+ +
} -
-
-
-
Document
-
Due date
-
 
-
-
- +
+ + + + @defer (when loaded) { @if (paginator.getRecordsCount() > 0) { -
-
+
@for (loan of records; track loan) { +
- + /> +
}
-
- + } @else { -
-
No loan
-
+
No loan
} } @placeholder { -
-
Loading in progress
-
+
Loading in progress
} +
diff --git a/projects/public-search/src/app/patron-profile/patron-profile-menu/patron-profile-menu.component.html b/projects/public-search/src/app/patron-profile/patron-profile-menu/patron-profile-menu.component.html index 76def9f15..930c22d55 100644 --- a/projects/public-search/src/app/patron-profile/patron-profile-menu/patron-profile-menu.component.html +++ b/projects/public-search/src/app/patron-profile/patron-profile-menu/patron-profile-menu.component.html @@ -15,13 +15,10 @@ along with this program. If not, see . --> @defer (when isVisible) { -
- -
+ } diff --git a/projects/public-search/src/app/patron-profile/patron-profile-menu/patron-profile-menu.component.ts b/projects/public-search/src/app/patron-profile/patron-profile-menu/patron-profile-menu.component.ts index 58cba572c..6dd2d7676 100644 --- a/projects/public-search/src/app/patron-profile/patron-profile-menu/patron-profile-menu.component.ts +++ b/projects/public-search/src/app/patron-profile/patron-profile-menu/patron-profile-menu.component.ts @@ -27,6 +27,8 @@ export class PatronProfileMenuComponent { @Input() patronPid: string; + selectedOrganisation: IMenu; + /** * Is menu visible * @return boolean @@ -39,11 +41,11 @@ export class PatronProfileMenuComponent { * Get menu lines (organisation) * @return array */ - get menuOptions(): IMenu[] { + get organisations(): IMenu[] { const menuSelected = this.patronProfileMenuService.menu .find((menu: any) => menu.value === this.patronPid); if (menuSelected) { - menuSelected.selected = true; + this.selectedOrganisation = menuSelected; } return this.patronProfileMenuService.menu; } diff --git a/projects/public-search/src/app/patron-profile/patron-profile-message/patron-profile-message.component.ts b/projects/public-search/src/app/patron-profile/patron-profile-message/patron-profile-message.component.ts index 149f0b120..502924ad4 100644 --- a/projects/public-search/src/app/patron-profile/patron-profile-message/patron-profile-message.component.ts +++ b/projects/public-search/src/app/patron-profile/patron-profile-message/patron-profile-message.component.ts @@ -16,21 +16,22 @@ */ import { Component, inject, OnDestroy, OnInit } from '@angular/core'; import { Subscription } from 'rxjs'; -import { Message, PatronApiService } from '../../api/patron-api.service'; +import { PatronApiService, Message } from '../../api/patron-api.service'; import { PatronProfileMenuService } from '../patron-profile-menu.service'; +import { Message as PrimeMessage } from 'primeng/api'; @Component({ selector: 'public-search-patron-profile-message', template: ` - @for (message of messages; track message) { -
- }` + + ` }) export class PatronProfileMessageComponent implements OnInit, OnDestroy { - private patronApiService: PatronApiService = inject(PatronApiService); private patronProfileMenuService: PatronProfileMenuService = inject(PatronProfileMenuService); @@ -38,7 +39,7 @@ export class PatronProfileMessageComponent implements OnInit, OnDestroy { private _subscription = new Subscription(); /** patron messages */ - messages: Message[] = []; + messages: PrimeMessage[] = []; /** OnInit hook */ ngOnInit(): void { @@ -58,7 +59,11 @@ export class PatronProfileMessageComponent implements OnInit, OnDestroy { /** load message */ private _loanMessage(): void { const patronPid = this.patronProfileMenuService.currentPatron.pid; - this.patronApiService.getMessages(patronPid) - .subscribe((messages: Message[]) => this.messages = messages); + this.patronApiService.getMessages(patronPid).subscribe( + (messages: Message[]) => + (this.messages = messages.map((message:Message): PrimeMessage => { + return { detail: message.content, severity: message.type }; + })) + ); } } diff --git a/projects/public-search/src/app/patron-profile/patron-profile-password/patron-profile-password.component.html b/projects/public-search/src/app/patron-profile/patron-profile-password/patron-profile-password.component.html index 76caa2ec1..93ccfb065 100644 --- a/projects/public-search/src/app/patron-profile/patron-profile-password/patron-profile-password.component.html +++ b/projects/public-search/src/app/patron-profile/patron-profile-password/patron-profile-password.component.html @@ -14,17 +14,15 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . --> -
+ +
- -
- - -
-
+
+ +
+
+ + +
+
diff --git a/projects/public-search/src/app/patron-profile/patron-profile-personal-editor/patron-profile-personal-editor.component.html b/projects/public-search/src/app/patron-profile/patron-profile-personal-editor/patron-profile-personal-editor.component.html index b5570b5eb..b75ed6531 100644 --- a/projects/public-search/src/app/patron-profile/patron-profile-personal-editor/patron-profile-personal-editor.component.html +++ b/projects/public-search/src/app/patron-profile/patron-profile-personal-editor/patron-profile-personal-editor.component.html @@ -14,18 +14,17 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . --> -@if (model) { -
+@defer (when model) { + + +
- -
- - +
+ +
+
+ +
diff --git a/projects/public-search/src/app/patron-profile/patron-profile-personal-editor/patron-profile-personal-editor.component.ts b/projects/public-search/src/app/patron-profile/patron-profile-personal-editor/patron-profile-personal-editor.component.ts index 45ce22b2c..a18ad00ea 100644 --- a/projects/public-search/src/app/patron-profile/patron-profile-personal-editor/patron-profile-personal-editor.component.ts +++ b/projects/public-search/src/app/patron-profile/patron-profile-personal-editor/patron-profile-personal-editor.component.ts @@ -21,7 +21,7 @@ import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; import { FormlyFieldConfig } from '@ngx-formly/core'; import { FormlyJsonschema } from '@ngx-formly/core/json-schema'; import { TranslateService } from '@ngx-translate/core'; -import { CONFIG, RecordService, processJsonSchema, removeEmptyValues } from '@rero/ng-core'; +import { CONFIG, RecordService, processJsonSchema, removeEmptyValues, resolve$ref } from '@rero/ng-core'; import { AppSettingsService, UserService } from '@rero/shared'; import { MessageService } from 'primeng/api'; import { Subscription, forkJoin, of } from 'rxjs'; @@ -59,7 +59,7 @@ export class PatronProfilePersonalEditorComponent implements OnInit, OnDestroy { /** Additional style for a field */ private _cssConfig = { keep_history: 'col-12 pl-0', - default: 'col-6 pl-0' + default: 'col-12 md:col-6 pl-0' }; /** Description for some fields defined as key */ private _fieldDescription = { @@ -74,7 +74,7 @@ export class PatronProfilePersonalEditorComponent implements OnInit, OnDestroy { if (schema) { const disabledFields = this.appSettingsService.settings.userProfile.readOnlyFields; this.fields = [ - this.formlyJsonschema.toFieldConfig(processJsonSchema(schema.schema), { + this.formlyJsonschema.toFieldConfig(processJsonSchema(resolve$ref(schema.schema, schema.schema.properties)), { // post process JSONSchema7 to FormlyFieldConfig conversion map: (field: FormlyFieldConfig, jsonSchema: any) => { @@ -85,7 +85,7 @@ export class PatronProfilePersonalEditorComponent implements OnInit, OnDestroy { } // Add the "row" class to the main object if (field.key == null) { - field.props.containerCssClass = 'row'; + field.props.containerCssClass = 'grid'; } const fkey = String(field.key); // Add a class on each field @@ -94,7 +94,7 @@ export class PatronProfilePersonalEditorComponent implements OnInit, OnDestroy { : this._cssConfig.default; // Deactivation of the fields if we have a patron record if ((this.userService.user.roles.length > 0) && (field.key !== undefined && disabledFields.includes(fkey))) { - field.props.readonly = true; + field.props.disabled = true; } // Hide password field if (fkey === 'password') { @@ -181,7 +181,7 @@ export class PatronProfilePersonalEditorComponent implements OnInit, OnDestroy { }); return; } - const data = removeEmptyValues(this.form.value); + const data = removeEmptyValues(this.model); // Update user record and reload logged user this.recordService .update('users', this.userService.user.id.toString(), data) @@ -195,7 +195,15 @@ export class PatronProfilePersonalEditorComponent implements OnInit, OnDestroy { }); this.redirect(); }, - error: (error) => this.formError = error.title + error: (error) => { + this.messageService.add({ + severity: 'error', + summary: this.translateService.instant('Error'), + detail: this.translateService.instant('An error occurred on the server: ') + error.title, + sticky: true, + closable: true + }); + } }); } diff --git a/projects/public-search/src/app/patron-profile/patron-profile-personal/patron-profile-personal.component.html b/projects/public-search/src/app/patron-profile/patron-profile-personal/patron-profile-personal.component.html index 4c5ec46ba..eae12d997 100644 --- a/projects/public-search/src/app/patron-profile/patron-profile-personal/patron-profile-personal.component.html +++ b/projects/public-search/src/app/patron-profile/patron-profile-personal/patron-profile-personal.component.html @@ -14,30 +14,23 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . --> -
-
-
-
Personal details
-
-
-
- -
-
+
+

Personal details

+ @if (disabledButtonOnReadyOnly) { -
diff --git a/projects/public-search/src/app/patron-profile/patron-profile-personal/patron-profile-personal.component.scss b/projects/public-search/src/app/patron-profile/patron-profile-personal/patron-profile-personal.component.scss index 14bd7f64c..d0fed2dba 100644 --- a/projects/public-search/src/app/patron-profile/patron-profile-personal/patron-profile-personal.component.scss +++ b/projects/public-search/src/app/patron-profile/patron-profile-personal/patron-profile-personal.component.scss @@ -15,7 +15,12 @@ * along with this program. If not, see . */ -dl > dt, -dl > dd { - margin-bottom: 0; + +public-search-patron-profile-personal { + .p-button { + @extend .text-white, .font-bold; + &:hover { + @extend .no-underline; + } + } } diff --git a/projects/public-search/src/app/patron-profile/patron-profile-personal/patron-profile-personal.component.ts b/projects/public-search/src/app/patron-profile/patron-profile-personal/patron-profile-personal.component.ts index 08f8ca922..68b81b1f0 100644 --- a/projects/public-search/src/app/patron-profile/patron-profile-personal/patron-profile-personal.component.ts +++ b/projects/public-search/src/app/patron-profile/patron-profile-personal/patron-profile-personal.component.ts @@ -19,8 +19,7 @@ import { AppSettingsService, IPatron } from '@rero/shared'; @Component({ selector: 'public-search-patron-profile-personal', - templateUrl: './patron-profile-personal.component.html', - styleUrls: ['./patron-profile-personal.component.scss'] + templateUrl: './patron-profile-personal.component.html' }) export class PatronProfilePersonalComponent { diff --git a/projects/public-search/src/app/patron-profile/patron-profile-requests/patron-profile-request/patron-profile-request.component.html b/projects/public-search/src/app/patron-profile/patron-profile-requests/patron-profile-request/patron-profile-request.component.html index b54aca1ab..0b821c4d6 100644 --- a/projects/public-search/src/app/patron-profile/patron-profile-requests/patron-profile-request/patron-profile-request.component.html +++ b/projects/public-search/src/app/patron-profile/patron-profile-requests/patron-profile-request/patron-profile-request.component.html @@ -16,69 +16,68 @@ --> @if (record) { -
- -
-
+
+ +
+ +
-
- - -
-
Pickup location
-
{{ record.metadata.pickup_name }}
-
-
- -
-
Status
-
- - @if (record.metadata.state === 'ITEM_AT_DESK') { - - {{ 'to pick up' | translate }} - @if (record.metadata.request_expire_date) { - {{ 'until' | translate }} {{ record.metadata.request_expire_date | dateTranslate: 'shortDate'}} - } - } - - @if (record.metadata.state === 'PENDING' || record.metadata.state === 'ITEM_IN_TRANSIT_FOR_PICKUP') { - - - {{ 'waiting' | translate }} - } - - @if (record.metadata.state === 'PENDING' && record.metadata.rank && record.metadata.rank > 0) { -
- } + + + - -
- @if (record.metadata.state === 'PENDING' || record.metadata.state === 'ITEM_IN_TRANSIT_FOR_PICKUP') { - - } @else { -   - } -
+
+ + + +
+ @if (['PENDING', 'ITEM_IN_TRANSIT_FOR_PICKUP'].includes(record.metadata.state)) { + + }
} + + + + @if (record.metadata.state === 'ITEM_AT_DESK') { + + {{ 'to pick up' | translate }} + @if (record.metadata.request_expire_date) { + {{ 'until' | translate }} {{ record.metadata.request_expire_date | dateTranslate: 'shortDate'}} + } + } + + @if (['PENDING', 'ITEM_IN_TRANSIT_FOR_PICKUP'].includes(record.metadata.state)) { + + + {{ 'waiting' | translate }} + } + + @if (record.metadata.state === 'PENDING' && record.metadata.rank && record.metadata.rank > 0) { +
+ } +
diff --git a/projects/public-search/src/app/patron-profile/patron-profile-requests/patron-profile-request/patron-profile-request.component.scss b/projects/public-search/src/app/patron-profile/patron-profile-requests/patron-profile-request/patron-profile-request.component.scss deleted file mode 100644 index 3ae7f5c40..000000000 --- a/projects/public-search/src/app/patron-profile/patron-profile-requests/patron-profile-request/patron-profile-request.component.scss +++ /dev/null @@ -1,28 +0,0 @@ -/* - * RERO ILS UI - * Copyright (C) 2022 RERO - * Copyright (C) 2022 UCLouvain - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, version 3 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -@import 'bootstrap/scss/functions'; -@import 'bootstrap/scss/variables'; - -:host:nth-child(even){ - background-color: $light; -} - -dl, dt, dd { - margin-bottom: 0; -} diff --git a/projects/public-search/src/app/patron-profile/patron-profile-requests/patron-profile-request/patron-profile-request.component.ts b/projects/public-search/src/app/patron-profile/patron-profile-requests/patron-profile-request/patron-profile-request.component.ts index bdc5f9d47..42813ff29 100644 --- a/projects/public-search/src/app/patron-profile/patron-profile-requests/patron-profile-request/patron-profile-request.component.ts +++ b/projects/public-search/src/app/patron-profile/patron-profile-requests/patron-profile-request/patron-profile-request.component.ts @@ -24,8 +24,7 @@ import { PatronProfileService } from '../../patron-profile.service'; @Component({ selector: 'public-search-patron-profile-request', - templateUrl: './patron-profile-request.component.html', - styleUrls: ['./patron-profile-request.component.scss'] + templateUrl: './patron-profile-request.component.html' }) export class PatronProfileRequestComponent { diff --git a/projects/public-search/src/app/patron-profile/patron-profile-requests/patron-profile-requests.component.html b/projects/public-search/src/app/patron-profile/patron-profile-requests/patron-profile-requests.component.html index b744fbb98..62e94533b 100644 --- a/projects/public-search/src/app/patron-profile/patron-profile-requests/patron-profile-requests.component.html +++ b/projects/public-search/src/app/patron-profile/patron-profile-requests/patron-profile-requests.component.html @@ -14,37 +14,33 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . --> -
-
-
-
Document
-
Status
-
 
-
-
+
+ + + + @defer (when loaded) { @if (paginator.getRecordsCount() > 0) { -
-
+
@for (request of records; track request) { - - +
+ +
} - -
+
} @else { -
-
No request
-
+
No request
} } @placeholder { -
-
Loading in progress
-
+
Loading in progress
} +
diff --git a/projects/public-search/src/app/patron-profile/patron-profile.component.html b/projects/public-search/src/app/patron-profile/patron-profile.component.html index 3d1d6abec..df22641ea 100644 --- a/projects/public-search/src/app/patron-profile/patron-profile.component.html +++ b/projects/public-search/src/app/patron-profile/patron-profile.component.html @@ -14,7 +14,7 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . --> - + @if (user) { @if (user.isAuthenticated && user.isPatron) {

{{ fullname }}

@@ -22,27 +22,27 @@

{{ fullname }}

+ />
- + +
-@for (tab of tabs|keyvalue: sortTabs; track tab) { - {{tab.key}} -} -
- +
+ @for (tab of tabs|keyvalue: sortTabs; track tab.key) { - {{tab.value.title}} - @if (tab.value.count != null) { - - } - @if (tab.value.feeTotal != null) { - - } +
+
{{tab.value.title}}
+ @if (tab.value.count != null) { + + } + @if (tab.value.feeTotal != null) { + + } +
@switch(tab.key) { @case ('loan') { diff --git a/projects/public-search/src/app/patron-profile/patron-profile.component.ts b/projects/public-search/src/app/patron-profile/patron-profile.component.ts index 8faf1c8ac..18572eb99 100644 --- a/projects/public-search/src/app/patron-profile/patron-profile.component.ts +++ b/projects/public-search/src/app/patron-profile/patron-profile.component.ts @@ -71,6 +71,8 @@ export class PatronProfileComponent implements OnInit, OnDestroy { /** Current logged user */ user: any; + activeIndex: number = 0; + /** Tabs informations */ tabs: Tabs; @@ -103,7 +105,7 @@ export class PatronProfileComponent implements OnInit, OnDestroy { illRequest: { loaded: false, count: 0, - title: this.translateService.instant('Interlibrary load'), + title: this.translateService.instant('Interlibrary loan'), order: 4, }, personalDetails: { @@ -136,9 +138,7 @@ export class PatronProfileComponent implements OnInit, OnDestroy { * - zero if `a` and `b` are considered equal in sort order. */ sortTabs = (a: KeyValue, b: KeyValue): number => { - if (a.value.order < b.value.order) return 1; - if (b.value.order > a.value.order) return -1; - return 0; + return a.value.order - b.value.order; }; tabOnChange(event) { @@ -179,7 +179,6 @@ export class PatronProfileComponent implements OnInit, OnDestroy { /** OnInit hook */ ngOnInit(): void { - this.selectTab(this.getTabKeyByIndex(0)); this.subscription.add( this.patronProfileService.loanFeesEvent$.subscribe((fees: number) => (this.tabs.loan.feeTotal = +fees.toFixed(2))) ); @@ -203,15 +202,15 @@ export class PatronProfileComponent implements OnInit, OnDestroy { Record, Record ]) => { - this.tabs.loan = { - ...this.tabs.loan, - loaded: true, - count: this.recordService.totalHits(loanResponse.hits.total), - }; + Object.values(this.tabs).map(tab => tab.loaded = false); + this.tabs.loan.count = this.recordService.totalHits(loanResponse.hits.total); this.tabs.fee.feeTotal = feeResponse.aggregations.total.value; this.tabs.request.count = this.recordService.totalHits(requestResponse.hits.total); this.tabs.history.count = this.recordService.totalHits(historyResponse.hits.total); this.tabs.illRequest.count = this.recordService.totalHits(illRequestResponse.hits.total); + // back to the loan tab if the organisation as been changed + this.activeIndex = 0; + this.selectTab(this.getTabKeyByIndex(this.activeIndex)); } ); }) @@ -244,6 +243,7 @@ export class PatronProfileComponent implements OnInit, OnDestroy { * @param tabName - string, name of current selected tab */ selectTab(name: string): void { + this.activeIndex = this.tabs[name].order; if (name in this.tabs && !this.tabs[name].loaded) { this.tabs[name].loaded = true; this.patronProfileService.changeTab({ name, count: this.tabs[name].count }); diff --git a/projects/public-search/src/app/pipe/loan-status-badge.pipe.ts b/projects/public-search/src/app/pipe/loan-status-badge.pipe.ts index 3bb44e0f6..9453466bf 100644 --- a/projects/public-search/src/app/pipe/loan-status-badge.pipe.ts +++ b/projects/public-search/src/app/pipe/loan-status-badge.pipe.ts @@ -29,13 +29,15 @@ export class LoanStatusBadgePipe implements PipeTransform { transform(status: string): string { switch (status) { case 'PENDING': - return 'badge-warning'; + return 'warning'; case 'ITEM_AT_DESK': - return 'badge-success'; + return 'success'; case 'ITEM_ON_LOAN': - return 'badge-info'; + return 'info'; + case 'CANCELLED': + return 'danger' default: - return 'badge-light'; + return 'secondary'; } } } diff --git a/projects/public-search/src/app/pipe/status-badge.pipe.spec.ts b/projects/public-search/src/app/pipe/status-badge.pipe.spec.ts deleted file mode 100644 index c01e02d73..000000000 --- a/projects/public-search/src/app/pipe/status-badge.pipe.spec.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * RERO ILS UI - * Copyright (C) 2021 RERO - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, version 3 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ -import { TestBed } from '@angular/core/testing'; -import { StatusBadgePipe } from './status-badge.pipe'; - -describe('StatusBadgePipe', () => { - let pipe: StatusBadgePipe; - - beforeEach(() => { - TestBed.configureTestingModule({ - providers: [ - StatusBadgePipe - ] - }); - pipe = TestBed.inject(StatusBadgePipe); - }); - - it('create an instance', () => { - expect(pipe).toBeTruthy(); - }); - - it('Should return the "badge-secondary" class', () => { - expect(pipe.transform('pending')).toEqual('badge-secondary'); - }); - - it('Should return the "badge-light" class (default)', () => { - expect(pipe.transform('missing')).toEqual('badge-light'); - }); -}); diff --git a/projects/public-search/src/app/pipe/status-badge.pipe.ts b/projects/public-search/src/app/pipe/status-badge.pipe.ts deleted file mode 100644 index ca7f3742a..000000000 --- a/projects/public-search/src/app/pipe/status-badge.pipe.ts +++ /dev/null @@ -1,41 +0,0 @@ -/* - * RERO ILS UI - * Copyright (C) 2021 RERO - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, version 3 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ -import { Pipe, PipeTransform } from '@angular/core'; - -@Pipe({ - name: 'statusBadge' -}) -export class StatusBadgePipe implements PipeTransform { - - /** - * Transform status to class - * @param status - string - * @return string - */ - transform(status: string): string { - switch (status) { - case 'pending': - return 'badge-secondary'; - case 'validated': - return 'badge-success'; - case 'denied': - return 'badge-danger'; - default: - return 'badge-light'; - } - } -} diff --git a/projects/public-search/src/app/routes/documents-route.service.ts b/projects/public-search/src/app/routes/documents-route.service.ts index 0b51ec363..8b69947c9 100644 --- a/projects/public-search/src/app/routes/documents-route.service.ts +++ b/projects/public-search/src/app/routes/documents-route.service.ts @@ -161,20 +161,24 @@ export class DocumentsRouteService extends BaseRoute implements ResourceRouteInt { label: _('Relevance'), value: 'bestmatch', - defaultQuery: true + defaultQuery: true, + icon: 'fa-sort-amount-desc' }, { label: _('Date (newest)'), - value: 'pub_date_new' + value: 'pub_date_new', + icon: 'fa-sort-amount-desc' }, { label: _('Date (oldest)'), value: 'pub_date_old', + icon: 'fa-sort-amount-asc' }, { label: _('Title'), value: 'title', - defaultNoQuery: true + defaultNoQuery: true, + icon: 'fa-sort-alpha-asc' } ] }, diff --git a/projects/public-search/src/app/patron-profile/patron-profile-histories/patron-profile-history/patron-profile-history.component.scss b/projects/public-search/src/app/scss/bootstrap_styles.scss similarity index 75% rename from projects/public-search/src/app/patron-profile/patron-profile-histories/patron-profile-history/patron-profile-history.component.scss rename to projects/public-search/src/app/scss/bootstrap_styles.scss index 1e8eb24c5..d7adaf45a 100644 --- a/projects/public-search/src/app/patron-profile/patron-profile-histories/patron-profile-history/patron-profile-history.component.scss +++ b/projects/public-search/src/app/scss/bootstrap_styles.scss @@ -1,7 +1,6 @@ /* - * RERO ILS UI - * Copyright (C) 2022 RERO - * Copyright (C) 2022 UCLouvain + * RERO angular core + * Copyright (C) 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 @@ -15,9 +14,9 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ -@import 'bootstrap/scss/functions'; -@import 'bootstrap/scss/variables'; -:host:nth-child(even){ - background-color: $light; -} + @layer bootstrap, rero-ils-ui, primeng, rero-ils-ui; + @layer bootstrap { + @import 'bootstrap/scss/bootstrap'; + } + @import "./styles.scss"; diff --git a/projects/public-search/src/app/scss/styles.scss b/projects/public-search/src/app/scss/styles.scss index 10cc670ac..9213da26c 100644 --- a/projects/public-search/src/app/scss/styles.scss +++ b/projects/public-search/src/app/scss/styles.scss @@ -1,7 +1,6 @@ -/* You can add global styles to this file, and also import other style files */ /* - * RERO ILS UI - * Copyright (C) 2021 RERO + * RERO angular core + * Copyright (C) 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 @@ -16,72 +15,6 @@ * along with this program. If not, see . */ -@import 'bootstrap/scss/functions'; -@import 'bootstrap/scss/variables'; -@import 'bootstrap/scss/mixins'; - -// ADJUST BOOTSTRAP / PRIMENG ------------------- -.col, .col-1, .col-2, .col-3, .col-4, .col-5, .col-6, .col-7, .col-8, .col-9, .col-10, .col-11, .col-12 { - padding-top: 0; - padding-bottom: 0; -} - -// FIELDS FORMAT ----------------------- -ng-core-formly-field-primeng-input > input, -formly-field > input { - width: 100%; -} - -label { - align-items: baseline; -} - -.label-title:after { - content: ":" -} - -/* CALLOUT PANEL */ -// source: https://codepen.io/superjaberwocky/pen/AXdEWj -.callout { - border-left: 5px solid $border-color; -} -@each $name,$color in (primary,$primary),(success,$success),(danger,$danger),(warning,$warning),(info,$info), (dark,$dark) { - .callout-#{$name} { - border-color: $color !important; - } - .callout-bg-#{$name} { - background-color: theme-color-level(#{$name}, -10) !important; - *[class*='btn-outline-']:not(:hover) { - background-color: white; - } - } -} - -/* SHOW MORE BUTTON ====================================================== */ -.btn-show-more { - border: $border-width solid $border-color; - border-radius: 2rem; - height: 30px; - min-width: 30px; - background-color: $white; - margin-right: map-get($spacers, 3); - font-size: $font-size-base; - outline: none !important; - - &.btn-expanded::before { - font-family: 'FontAwesome'; - font-weight: 100; - content: " \f0d7"; - } - - &.btn-collapsed::before { - font-family: 'FontAwesome'; - font-weight: 100; - content: " \f0da"; - } -} -.card-header .btn-show-more { - border-color: $card-border-color; - font-size: $font-size-base; - margin-right: map-get($spacers, 2); -} + @import "../../../../shared/src/scss/styles.scss"; + @import "../../../../public-search/src/app/patron-profile/patron-profile-personal/patron-profile-personal.component.scss"; + @import "../../../../public-search/src/app/document-detail/holdings/holding/holding.component.scss"; diff --git a/projects/public-search/src/index.html b/projects/public-search/src/index.html index 56c0019cb..cbeea01e7 100644 --- a/projects/public-search/src/index.html +++ b/projects/public-search/src/index.html @@ -14,48 +14,80 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . --> - + - + PublicSearch - + - - - - + + + +
- + Public Search + + + +
+ +
+ +
diff --git a/projects/public-user-password-change/src/app/app.module.ts b/projects/public-user-password-change/src/app/app.module.ts index f3b5b4893..294757546 100644 --- a/projects/public-user-password-change/src/app/app.module.ts +++ b/projects/public-user-password-change/src/app/app.module.ts @@ -14,19 +14,15 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ -import { HttpClient, HttpClientModule } from '@angular/common/http'; +import { HttpClient } from '@angular/common/http'; import { APP_INITIALIZER, DoBootstrap, inject, Injector, NgModule } from '@angular/core'; import { createCustomElement } from '@angular/elements'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { ReactiveFormsModule } from '@angular/forms'; import { BrowserModule } from '@angular/platform-browser'; -import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { FormlyModule } from '@ngx-formly/core'; -import { FormlyPrimeNGModule } from '@ngx-formly/primeng'; -import { LoadingBarModule } from '@ngx-loading-bar/core'; import { LoadingBarHttpClientModule } from '@ngx-loading-bar/http-client'; import { TranslateLoader as BaseTranslateLoader, TranslateModule, TranslateService } from '@ngx-translate/core'; -import { CoreConfigService, CoreModule, NgCoreTranslateService, RecordModule, TranslateLoader } from '@rero/ng-core'; -import { SharedModule } from '@rero/shared'; +import { CoreConfigService, NgCoreTranslateService, RecordModule, TranslateLoader } from '@rero/ng-core'; import { fieldPasswordMatchValidator, PatronProfilePasswordComponent } from 'projects/public-search/src/app/patron-profile/patron-profile-password/patron-profile-password.component'; import { Observable } from 'rxjs'; import { AppConfigService } from './app-config.service'; @@ -42,17 +38,12 @@ export function appInitFactory(appInitializerService: AppInitializerService): () PatronProfilePasswordComponent ], imports: [ - HttpClientModule, BrowserModule, - BrowserAnimationsModule, - FormsModule, FormlyModule.forRoot({ validators: [ { name: 'passwordMatch', validation: fieldPasswordMatchValidator } ] }), - FormlyPrimeNGModule, - CoreModule, RecordModule, ReactiveFormsModule, TranslateModule.forRoot({ @@ -63,9 +54,7 @@ export function appInitFactory(appInitializerService: AppInitializerService): () }, isolate: false }), - SharedModule, - LoadingBarHttpClientModule, - LoadingBarModule, + LoadingBarHttpClientModule ], providers: [ { provide: TranslateService, useClass: NgCoreTranslateService }, diff --git a/projects/public-user-password-change/src/index.html b/projects/public-user-password-change/src/index.html index 4077e272a..4c714c815 100644 --- a/projects/public-user-password-change/src/index.html +++ b/projects/public-user-password-change/src/index.html @@ -29,18 +29,24 @@ integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous" /> - + /> --> +
- +
diff --git a/projects/public-user-profile-edit/src/app/app.module.ts b/projects/public-user-profile-edit/src/app/app.module.ts index 39829f35b..a9796c3af 100644 --- a/projects/public-user-profile-edit/src/app/app.module.ts +++ b/projects/public-user-profile-edit/src/app/app.module.ts @@ -14,22 +14,20 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ -import { HttpClient, HttpClientModule } from '@angular/common/http'; +import { HttpClient } from '@angular/common/http'; import { APP_INITIALIZER, CUSTOM_ELEMENTS_SCHEMA, DoBootstrap, inject, Injector, NgModule } from '@angular/core'; import { createCustomElement } from '@angular/elements'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { ReactiveFormsModule } from '@angular/forms'; import { BrowserModule } from '@angular/platform-browser'; -import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; -import { RouterModule } from '@angular/router'; -import { LoadingBarModule } from '@ngx-loading-bar/core'; import { LoadingBarHttpClientModule } from '@ngx-loading-bar/http-client'; import { TranslateLoader as BaseTranslateLoader, TranslateModule, TranslateService } from '@ngx-translate/core'; -import { CoreConfigService, CoreModule, NgCoreTranslateService, RecordModule, TranslateLoader } from '@rero/ng-core'; -import { SharedModule } from '@rero/shared'; +import { CoreConfigService, NgCoreTranslateService, RecordModule, TranslateLoader } from '@rero/ng-core'; import { PatronProfilePersonalEditorComponent } from 'projects/public-search/src/app/patron-profile/patron-profile-personal-editor/patron-profile-personal-editor.component'; import { Observable } from 'rxjs'; import { AppConfigService } from './app-config.service'; import { AppInitializerService } from './app-initializer.service'; +import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; +import { MessagesModule } from 'primeng/messages'; /** function to instantiate the application */ export function appInitFactory(appInitializerService: AppInitializerService): () => Observable { @@ -41,14 +39,11 @@ export function appInitFactory(appInitializerService: AppInitializerService): () PatronProfilePersonalEditorComponent ], imports: [ - RouterModule, - HttpClientModule, BrowserModule, BrowserAnimationsModule, - CoreModule, RecordModule, - FormsModule, ReactiveFormsModule, + MessagesModule, TranslateModule.forRoot({ loader: { provide: BaseTranslateLoader, @@ -57,9 +52,7 @@ export function appInitFactory(appInitializerService: AppInitializerService): () }, isolate: false }), - SharedModule, LoadingBarHttpClientModule, - LoadingBarModule, ], providers: [ { provide: TranslateService, useClass: NgCoreTranslateService }, diff --git a/projects/public-user-profile-edit/src/index.html b/projects/public-user-profile-edit/src/index.html index b3666ad0a..fd05210db 100644 --- a/projects/public-user-profile-edit/src/index.html +++ b/projects/public-user-profile-edit/src/index.html @@ -29,18 +29,24 @@ integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous" /> - + /> --> +
- +
diff --git a/projects/search-bar/src/app/app.module.ts b/projects/search-bar/src/app/app.module.ts index 68c32713e..1a5268e23 100644 --- a/projects/search-bar/src/app/app.module.ts +++ b/projects/search-bar/src/app/app.module.ts @@ -20,27 +20,26 @@ import { APP_INITIALIZER, DoBootstrap, inject, Injector, NgModule } from '@angul import { createCustomElement } from '@angular/elements'; import { ReactiveFormsModule } from '@angular/forms'; import { BrowserModule } from '@angular/platform-browser'; +import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { TranslateLoader as BaseTranslateLoader, TranslateModule } from '@ngx-translate/core'; -import { CoreConfigService, RecordModule, TranslateLoader } from '@rero/ng-core'; +import { CoreConfigService, TranslateLoader } from '@rero/ng-core'; import { RemoteSearchComponent, SharedModule } from '@rero/shared'; -import { AppInitializerService } from './app-initializer.service'; import { Observable } from 'rxjs'; -import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; - +import { AppInitializerService } from './app-initializer.service'; +import { RouterModule } from '@angular/router'; /** function to instantiate the application */ export function appInitFactory(appInitializerService: AppInitializerService): () => Observable { return () => appInitializerService.load(); } - @NgModule({ declarations: [], imports: [ BrowserModule, BrowserAnimationsModule, + RouterModule.forRoot([]), HttpClientModule, - RecordModule, ReactiveFormsModule, TranslateModule.forRoot({ loader: { diff --git a/projects/search-bar/src/index.html b/projects/search-bar/src/index.html index ff0ba1920..c0580b3e2 100644 --- a/projects/search-bar/src/index.html +++ b/projects/search-bar/src/index.html @@ -5,18 +5,24 @@ SearchBar - + + - -
+ +

Search bar

-
- +
+
- +
diff --git a/projects/shared/src/lib/component/core/brief-view/brief-view.component.html b/projects/shared/src/lib/component/core/brief-view/brief-view.component.html index 789f6f7e9..d43b127cd 100644 --- a/projects/shared/src/lib/component/core/brief-view/brief-view.component.html +++ b/projects/shared/src/lib/component/core/brief-view/brief-view.component.html @@ -15,16 +15,15 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . --> - -
+
@if (iconTemplate) { -
+
} -
-
+
+
@if (titleTemplate) { } @else { @@ -42,20 +41,18 @@
}
@if (contentTemplate) { -
+
} -
+
@if (tagsTemplate) { } @else { @if (tags) { -
    @for (tag of tags; track tag) { -
  • {{ tag.label }}
  • + } -
} }
diff --git a/projects/shared/src/lib/component/core/brief-view/brief-view.component.scss b/projects/shared/src/lib/component/core/brief-view/brief-view.component.scss deleted file mode 100644 index 075548d1f..000000000 --- a/projects/shared/src/lib/component/core/brief-view/brief-view.component.scss +++ /dev/null @@ -1,50 +0,0 @@ -/* - * RERO ILS UI - * Copyright (C) 2019-2023 RERO - * Copyright (C) 2019-2023 UCLouvain - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, version 3 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -@import 'bootstrap/scss/bootstrap'; - -.brief-view { - display: flex; - align-content: flex-start; - - .brief-view-icon { - min-width: 2rem; - text-align: center; - } - - .brief-view-body { - margin-left: 1rem; - margin-right: 1rem; - } - - .brief-view-tags { - ul { - display: inline; - padding: 0; - - li { - @extend .badge; - @extend .badge-secondary; - } - - li + li { - @extend .ml-1; - } - } - } -} diff --git a/projects/shared/src/lib/component/core/brief-view/brief-view.component.ts b/projects/shared/src/lib/component/core/brief-view/brief-view.component.ts index 0bd440e84..37f59b20c 100644 --- a/projects/shared/src/lib/component/core/brief-view/brief-view.component.ts +++ b/projects/shared/src/lib/component/core/brief-view/brief-view.component.ts @@ -26,8 +26,7 @@ export interface BriefViewTag { @Component({ selector: 'shared-brief-view', - templateUrl: './brief-view.component.html', - styleUrls: ['./brief-view.component.scss'] + templateUrl: './brief-view.component.html' }) export class BriefViewComponent implements AfterContentInit { diff --git a/projects/shared/src/lib/component/documents/document-brief-view/document-brief-view.component.html b/projects/shared/src/lib/component/documents/document-brief-view/document-brief-view.component.html index ca1b3022a..022c8d72a 100644 --- a/projects/shared/src/lib/component/documents/document-brief-view/document-brief-view.component.html +++ b/projects/shared/src/lib/component/documents/document-brief-view/document-brief-view.component.html @@ -23,7 +23,7 @@ } @if (record?.contribution; as entities) { -
+
@if (provisionActivityPublications.length > 0) { -
+
{{ provisionActivityPublications | join }}
} diff --git a/projects/shared/src/lib/component/documents/document-brief-view/document-brief-view.component.scss b/projects/shared/src/lib/component/documents/document-brief-view/document-brief-view.component.scss index 02b6649b9..70ad4a697 100644 --- a/projects/shared/src/lib/component/documents/document-brief-view/document-brief-view.component.scss +++ b/projects/shared/src/lib/component/documents/document-brief-view/document-brief-view.component.scss @@ -16,11 +16,8 @@ * along with this program. If not, see . */ -@import 'bootstrap/scss/functions'; -@import 'bootstrap/scss/variables'; +@import 'primeflex/primeflex'; .small-content{ - font-size: small; - color: $secondary; - font-weight: bold; + @extend .text-sm, .font-bold, .text-color-secondary; } diff --git a/projects/admin/src/app/record/detail-view/document-detail-view/document-description/description-zone/description-zone.component.html b/projects/shared/src/lib/component/documents/document-description/description-zone/description-zone.component.html similarity index 76% rename from projects/admin/src/app/record/detail-view/document-detail-view/document-description/description-zone/description-zone.component.html rename to projects/shared/src/lib/component/documents/document-description/description-zone/description-zone.component.html index 5c5c4ed02..6bd815b56 100644 --- a/projects/admin/src/app/record/detail-view/document-detail-view/document-description/description-zone/description-zone.component.html +++ b/projects/shared/src/lib/component/documents/document-description/description-zone/description-zone.component.html @@ -14,11 +14,11 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . --> -
-
- -
-
- -
-
+ diff --git a/projects/admin/src/app/record/detail-view/document-detail-view/document-description/description-zone/description-zone.component.ts b/projects/shared/src/lib/component/documents/document-description/description-zone/description-zone.component.ts similarity index 95% rename from projects/admin/src/app/record/detail-view/document-detail-view/document-description/description-zone/description-zone.component.ts rename to projects/shared/src/lib/component/documents/document-description/description-zone/description-zone.component.ts index 47317b667..76c96f992 100644 --- a/projects/admin/src/app/record/detail-view/document-detail-view/document-description/description-zone/description-zone.component.ts +++ b/projects/shared/src/lib/component/documents/document-description/description-zone/description-zone.component.ts @@ -17,7 +17,7 @@ import { Component } from '@angular/core'; @Component({ - selector: 'admin-description-zone', + selector: 'shared-description-zone', templateUrl: './description-zone.component.html' }) export class DescriptionZoneComponent { } diff --git a/projects/admin/src/app/record/detail-view/document-detail-view/document-description/document-description.component.html b/projects/shared/src/lib/component/documents/document-description/document-description.component.html similarity index 73% rename from projects/admin/src/app/record/detail-view/document-detail-view/document-description/document-description.component.html rename to projects/shared/src/lib/component/documents/document-description/document-description.component.html index c7712c569..b63ce4396 100644 --- a/projects/admin/src/app/record/detail-view/document-detail-view/document-description/document-description.component.html +++ b/projects/shared/src/lib/component/documents/document-description/document-description.component.html @@ -14,71 +14,58 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . --> - -
@if (record.metadata.fiction_statement) { -
- + {{ 'Fiction statement' | translate }} {{ record.metadata.fiction_statement | translate }} - -
+ } @if (record.metadata.supplement) { -
- -
+ } @if (record.metadata.relatedTo) { -
- -
+ } @if (notesGeneral) { -
- + {{ 'General note' | translate }} @for (noteType of notesGeneral | keyvalue; track noteType) { -
    +
      @for (note of noteType.value; track note) {
    • {{ note }}
    • }
    } - -
+ } @if (record.metadata.credits) { -
- + {{ 'Other responsibilities' | translate }} -
    +
      @for (credit of record.metadata.credits; track credit) {
    • {{ credit }}
    • }
    - -
+ } @if (record.metadata.language && record.metadata.language.length > 0) { -
- + {{ 'Language' | translate }} @for (lang of record.metadata.language; track lang; let isLast = $last) { @@ -86,14 +73,12 @@ @if (!isLast) {, } } - -
+ } @if (record.metadata.originalLanguage) { -
- + {{ 'Original language' | translate }} @for (lang of record.metadata.originalLanguage; track lang; let isLast = $last) { @@ -101,67 +86,59 @@ @if (!isLast) {, } } - -
+ } @if (record.metadata.originalTitle) { -
- + {{ 'Original title' | translate }} -
    +
      @for (title of record.metadata.originalTitle; track title) {
    • {{ title }}
    • }
    - -
+ } @if (workAccessPoint; as works) { @if (works.length > 0) { -
- + {{ 'Work' | translate }} -
    +
      @for (work of works; track work) {
    • {{ work }}
    • }
    - -
+ } } @if (record.metadata.tableOfContents) { -
- + {{ 'Contents' | translate }} -
    +
      @for (table of record.metadata.tableOfContents; track table) {
    • {{ table }}
    • }
    - -
+ } @if (record.metadata.dissertation) { -
- + {{ 'Thesis' | translate }} -
    +
      @for (dissertation of record.metadata.dissertation; track dissertation) { @for (label of dissertation.label; track label) {
    • {{ label.value }}
    • @@ -169,14 +146,12 @@ }
    - -
+ } @if (record.metadata.intendedAudience) { -
- + {{ 'Intended audience' | translate }} @for (audience of record.metadata.intendedAudience; track audience; let isLast = $last) { @@ -184,26 +159,22 @@ @if (!isLast) {, } } - -
+ } @if (record.metadata.illustrativeContent) { -
- + {{ 'Illustrations' | translate }} {{ record.metadata.illustrativeContent.join(', ') }} - -
+ } @if (record.metadata.colorContent) { -
- + {{ 'Colors' | translate }} @for (color of record.metadata.colorContent; track color; let isLast = $last) { @@ -211,33 +182,29 @@ @if (!isLast) {, } } - -
+ } @if (record.metadata.scale) { -
- + {{ 'Scale' | translate }} -
    +
      @for (scale of record.metadata.scale; track scale) {
    • {{ scale.label }}
    • }
    - -
+ } @if (cartographicAttributes.length > 0) { -
- + {{ 'Cartographic data' | translate }} -
    +
      @for (cartographic of cartographicAttributes; track cartographic) {
    • @if (cartographic.projection) { @@ -253,17 +220,15 @@ }
    - -
+ } @if (record.metadata.classification) { -
- + {{ 'Classification' | translate }} -
    +
      @for (classification of record.metadata.classification; track classification) {
    • {{ classification.classificationPortion }} @@ -275,246 +240,210 @@ }
    - -
+ } @if (record.metadata.usageAndAccessPolicy) { -
- + {{ 'Use and access condition' | translate }} -
    +
      @for (usage of record.metadata.usageAndAccessPolicy; track usage) {
    • {{ usage.label }}
    • }
    - -
+ } @if (record.metadata.otherEdition) { -
- -
+ } @if (record.metadata.otherPhysicalFormat) { -
- -
+ } @if (record.metadata.hasReproduction) { -
- -
+ } @if (titleVariants !== {}) { @for (title of titleVariants | keyvalue; track title) { -
- + {{ $any(title).key | translate | ucfirst }} -
    +
      @for (value of $any(title).value; track value) {
    • {{ value }}
    • }
    - -
+ } } @if (record.metadata.ui_responsibilities) { -
- + {{ 'Statement of responsibility' | translate }} -
    +
      @for (responsibility of record.metadata.ui_responsibilities; track responsibility) {
    • {{ responsibility }}
    • }
    - -
+ } @if (record.metadata.seriesStatement) { -
- + {{ 'Series statement' | translate }} -
    +
      @for (serie of editionStatement; track serie) {
    • {{ serie.value }}
    • }
    - -
+ } @if (record.metadata.provisionActivity | documentProvisionActivity | keyvalue | callbackArrayFilter: filterNotPublicationProvisionActivity;as provisionActivity) { @for (provision of provisionActivity; track provision) { -
- + {{ provision.key | translate }} -
    +
      @for (value of provision.value; track value; let isLast = $last) {
    • {{ value }}@if (!isLast) {, }
    • }
    - -
+ } } @if (provisionActivityOriginalDate.length > 0) { -
- + {{ 'Date of the original' | translate }} @for (provision of provisionActivityOriginalDate; track provision; let isLast = $last) { {{ provision.original_date }}@if (!isLast) {, } } - -
+ } @if (record.metadata.copyrightDate) { -
- + {{ 'Copyright date' | translate }} {{ record.metadata.copyrightDate.join(", ") }} - -
+ } @if (record.metadata.sequence_numbering) { -
- + {{ 'Numbering' | translate }} {{ record.metadata.sequence_numbering }} - -
+ } @if (record.metadata.dimensions) { -
- + {{ 'Dimensions' | translate }} {{ record.metadata.dimensions.join(", ") }} - -
+ } @if (record.metadata.bookFormat) { -
- + {{ 'Format' | translate }} {{ record.metadata.bookFormat.join(", ") }} - -
+ } @if (record.metadata.productionMethod) { -
- + {{ 'Production method' | translate }} @for (method of record.metadata.productionMethod; track method; let isLast = $last) { {{ method | translate }}@if (!isLast) {, } } - -
+ } @if (notesExceptGeneral) { @for (noteType of notesExceptGeneral | keyvalue; track noteType) { -
- + {{ noteType.key | translate | ucfirst }} -
    +
      @for (note of noteType.value; track note) {
    • {{ note }}
    • }
    - -
+ } } @if (record.metadata.supplementaryContent) { -
- + {{ 'Supplementary content' | translate }} -
    +
      @for (sup of record.metadata.supplementaryContent; track sup) {
    • {{ sup }}
    • }
    - -
+ } @if (record.metadata.acquisitionTerms) { -
- + {{ 'Terms of availability' | translate }} -
    +
      @for (term of record.metadata.acquisitionTerms; track term) {
    • {{ term }}
    • }
    - -
+ } @if (identifiedBy && identifiedBy.length > 0) { -
- + {{ 'Identifier' | translate }} -
    +
      @for (identifier of identifiedBy; track identifier; let i = $index) {
    • @if (identifier.type === 'uri') { @@ -525,23 +454,19 @@ @if (identifier.details) { - {{ identifier.details }} } - - {{ identifier.type }} - +
    • }
    - -
+ } @if (record.metadata.contentMediaCarrier) { -
- + {{ 'Carrier and content type' | translate }} @for (content of record.metadata.contentMediaCarrier; track content; let isLastL1 = $last) { @@ -554,19 +479,15 @@ @if (!isLastL1) {, } } - -
+ } @if (record.metadata.issuance) { -
- + {{ 'Mode of issuance' | translate }} {{ record.metadata.issuance.main_type | translate }} / {{ record.metadata.issuance.subtype | translate }} - -
+ } -
diff --git a/projects/admin/src/app/record/detail-view/document-detail-view/document-description/document-description.component.ts b/projects/shared/src/lib/component/documents/document-description/document-description.component.ts similarity index 99% rename from projects/admin/src/app/record/detail-view/document-detail-view/document-description/document-description.component.ts rename to projects/shared/src/lib/component/documents/document-description/document-description.component.ts index 4094723bf..060d2a7b3 100644 --- a/projects/admin/src/app/record/detail-view/document-detail-view/document-description/document-description.component.ts +++ b/projects/shared/src/lib/component/documents/document-description/document-description.component.ts @@ -19,7 +19,7 @@ import { Component, inject, Input, OnInit } from '@angular/core'; import { TranslateService } from '@ngx-translate/core'; @Component({ - selector: 'admin-document-description', + selector: 'shared-document-description', templateUrl: './document-description.component.html' }) export class DocumentDescriptionComponent implements OnInit { diff --git a/projects/admin/src/app/record/detail-view/document-detail-view/document-description/other-edition/other-edition.component.html b/projects/shared/src/lib/component/documents/document-description/other-edition/other-edition.component.html similarity index 94% rename from projects/admin/src/app/record/detail-view/document-detail-view/document-description/other-edition/other-edition.component.html rename to projects/shared/src/lib/component/documents/document-description/other-edition/other-edition.component.html index 5b39a5a25..4d02771a4 100644 --- a/projects/admin/src/app/record/detail-view/document-detail-view/document-description/other-edition/other-edition.component.html +++ b/projects/shared/src/lib/component/documents/document-description/other-edition/other-edition.component.html @@ -15,10 +15,10 @@ along with this program. If not, see . --> @if (!header) { - + {{ fieldLabel }} -