-
+ [steps]="['files', 'metadata', 'contributors', 'projects', 'diffusion']"
+/>
+
-
+@if (deposit){
+
+}
diff --git a/projects/sonar/src/app/deposit/upload/upload.component.spec.ts b/projects/sonar/src/app/deposit/upload/upload.component.spec.ts
deleted file mode 100644
index 41c41c74..00000000
--- a/projects/sonar/src/app/deposit/upload/upload.component.spec.ts
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * SONAR User Interface
- * 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 { HttpClient, HttpClientModule } from '@angular/common/http';
-import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
-import { ReactiveFormsModule } from '@angular/forms';
-import { ActivatedRoute } from '@angular/router';
-import { RouterTestingModule } from '@angular/router/testing';
-import { TranslateLoader as BaseTranslateLoader, TranslateModule } from '@ngx-translate/core';
-import { CoreConfigService, RecordModule, TranslateLoader } from '@rero/ng-core';
-import { TabsModule } from 'ngx-bootstrap/tabs';
-import { NgxDropzoneModule } from 'ngx-dropzone';
-import { of } from 'rxjs';
-import { FileSizePipe } from '../../core/filesize.pipe';
-import { StepComponent } from '../../core/step/step.component';
-import { ReviewComponent } from '../review/review.component';
-import { UploadComponent } from './upload.component';
-
-describe('UploadComponent', () => {
- let component: UploadComponent;
- let fixture: ComponentFixture
;
-
- const route = {
- params: of({
- id: '0'
- })
- };
-
- beforeEach(waitForAsync(() => {
- TestBed.configureTestingModule({
- declarations: [UploadComponent, StepComponent, ReviewComponent, FileSizePipe],
- imports: [
- RecordModule,
- ReactiveFormsModule,
- NgxDropzoneModule,
- TabsModule.forRoot(),
- HttpClientModule,
- RouterTestingModule,
- TranslateModule.forRoot({
- loader: {
- provide: BaseTranslateLoader,
- useClass: TranslateLoader,
- deps: [CoreConfigService, HttpClient]
- }
- })
- ],
- providers: [{ provide: ActivatedRoute, useValue: route }]
- }).compileComponents();
- }));
-
- beforeEach(() => {
- fixture = TestBed.createComponent(UploadComponent);
- component = fixture.componentInstance;
- fixture.detectChanges();
- });
-
- afterEach(() => {
- TestBed.resetTestingModule();
- });
-
- it('should create', () => {
- expect(component).toBeTruthy();
- });
-});
diff --git a/projects/sonar/src/app/deposit/upload/upload.component.ts b/projects/sonar/src/app/deposit/upload/upload.component.ts
index faad6b45..7c13876a 100644
--- a/projects/sonar/src/app/deposit/upload/upload.component.ts
+++ b/projects/sonar/src/app/deposit/upload/upload.component.ts
@@ -15,35 +15,14 @@
* along with this program. If not, see .
*/
import {
- AfterContentChecked,
- ChangeDetectorRef,
Component,
- OnDestroy,
OnInit,
+ inject
} from '@angular/core';
-import {
- AbstractControl,
- UntypedFormArray,
- UntypedFormBuilder,
- Validators,
-} from '@angular/forms';
import { ActivatedRoute, Router } from '@angular/router';
-import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
-import { TranslateService } from '@ngx-translate/core';
-import { DialogService } from '@rero/ng-core';
import { NgxSpinnerService } from 'ngx-spinner';
-import { ToastrService } from 'ngx-toastr';
-import { forkJoin, from, Observable, of } from 'rxjs';
import {
- concatMap,
- delay,
- first,
- map,
- mergeMap,
- reduce,
- switchMap,
- takeWhile,
- tap,
+ tap
} from 'rxjs/operators';
import { DepositService } from '../deposit.service';
@@ -53,7 +32,7 @@ const MAX_FILE_SIZE = 500; // Max file size in Mb.
selector: 'sonar-deposit-upload',
templateUrl: './upload.component.html',
})
-export class UploadComponent implements OnInit, AfterContentChecked, OnDestroy {
+export class UploadComponent implements OnInit {
/**
* Files list, an item can be a file to upload or an uploaded file.
*/
@@ -64,283 +43,64 @@ export class UploadComponent implements OnInit, AfterContentChecked, OnDestroy {
*/
deposit: any = null;
- /** Form for handling files metdata */
- filesForm: UntypedFormArray = null;
-
- /** Flag activated when component is destroyed. Is used to unsubscribe to observables with takeWhile operator. */
- destroyed = false;
-
- constructor(
- private _toastr: ToastrService,
- private _depositService: DepositService,
- private _router: Router,
- private _route: ActivatedRoute,
- private _dialogService: DialogService,
- private _spinner: NgxSpinnerService,
- private _translateService: TranslateService,
- private _fb: UntypedFormBuilder,
- private _cd: ChangeDetectorRef
- ) {}
+ // services
+ private depositService = inject(DepositService);
+ private router = inject(Router);
+ private route = inject(ActivatedRoute);
+ private spinner = inject(NgxSpinnerService);
ngOnInit(): void {
- this._spinner.show();
-
- this._route.params
- .pipe(
- first(),
- tap(() => {
- this._spinner.show();
- }),
- switchMap((params) => {
- if (params.id !== '0') {
- return forkJoin([
- this._depositService.get(params.id),
- this._depositService.getFiles(params.id),
- ]).pipe(
- tap((result) => {
- this.deposit = result[0].metadata;
-
- if (
- this._depositService.canAccessDeposit(this.deposit) === false
- ) {
- this._router.navigate([
- 'deposit',
- this.deposit.pid,
- 'confirmation',
- ]);
- }
-
- this.files = result[1];
- })
- );
- } else {
- this.deposit = null;
- this.files = [];
- return of(null);
- }
- })
- )
- .subscribe(() => {
- this._spinner.hide();
- this._initForm();
- });
- }
+ if (this.route.snapshot.routeConfig.path == 'deposit/create') {
+ this.createEmptyDeposit();
+ } else if (this.route.snapshot?.params?.id) {
- ngAfterContentChecked() {
- this._cd.detectChanges();
+ this.depositService
+ .get(this.route.snapshot.params.id)
+ .pipe(
+ tap((result) => {
+ this.spinner.show();
+ this.deposit = result.metadata;
+ if (this.depositService.canAccessDeposit(this.deposit) === false) {
+ this.router.navigate([
+ 'deposit',
+ this.deposit.pid,
+ 'confirmation',
+ ]);
+ }
+ })
+ )
+ .subscribe(() => this.spinner.hide());
+ }
}
- ngOnDestroy() {
- this.destroyed = true;
+ /**
+ * Create a deposit without associated files.
+ * @param event - Event
+ */
+ createEmptyDeposit() {
+ this.depositService.create().subscribe((deposit: any) => {
+ this.router.navigate(['deposit', deposit.id, 'files']);
+ });
}
/**
* Return link prefix
*/
get linkPrefix() {
- return `/deposit/${this.deposit ? this.deposit.pid : '0'}/`;
+ return `/deposit/${this.deposit ? this.deposit.pid : ''}/`;
}
/**
* Get max step
*/
get maxStep() {
- if (this.deposit) {
- return this.deposit.step;
- }
- return 'create';
- }
-
- /**
- * Get list of file for the given type.
- * @param type - string, type of files
- */
- getFilesByType(type: string): Array {
- return this.files.filter((item: any) => item.category === type);
- }
-
- /**
- * Upload a file to the server and create a deposit if it's not already
- * created.
- * @param files Array of files to upload
- * @param type Type of file
- */
- uploadFiles(files: Array, type: string) {
- this._spinner.show();
-
- // Create a deposit if not existing
- let createDeposit$: Observable = this._depositService.create().pipe(
- tap((deposit) => (this.deposit = deposit.metadata)),
- delay(1000),
- map(() => {
- if (type === 'main') {
- this._router.navigate(['deposit', this.deposit.pid, 'create']);
- }
- })
- );
if (this.deposit) {
- createDeposit$ = of(this.deposit);
- }
-
- createDeposit$
- .pipe(
- switchMap(() => {
- return from(files).pipe(
- concatMap((file: File) => {
- return this._depositService.uploadFile(
- this.deposit.pid,
- file.name,
- type,
- file
- );
- })
- );
- })
- )
- .subscribe({
- next: (file: any) => {
- this._toastr.success(
- _('File uploaded successfully') + ': ' + file.key
- );
- this.files.push(file);
- this._addFormField(file);
- },
- complete: () => {
- this._spinner.hide();
- },
- error: () => {
- this._spinner.hide();
- this._toastr.error(
- _('An error occurred during file upload process, please try again.')
- );
- },
- });
- }
-
- /**
- * Removes a deposit (after confirmation) and go back to upload homepage.
- */
- cancelDeposit() {
- this._depositService
- .deleteDepositWithConfirmation(this.deposit)
- .subscribe((result: any) => {
- if (result === true) {
- this.files = [];
- this.deposit = null;
- this._router.navigate(['deposit', '0', 'create']);
- }
- });
- }
-
- /**
- * Method called when ngx-dropzone receive a file, add the selected file to
- * files list.
- * @param event - Event, contains the added files.
- * @param type Type of file to upload.
- * @param limit Limit files for the type.
- */
- onSelect(event: any, type: string, limit: number) {
- if (limit !== 0 && this.getFilesByType(type).length >= limit) {
- this._toastr.error(
- _('You cannot add more files, please remove existing files first.')
- );
- return;
- }
-
- event.addedFiles.forEach((file: any, index: number) => {
- try {
- if (file.size > MAX_FILE_SIZE * 1000 * 1000) {
- throw new Error(`The maximum size for a file is ${MAX_FILE_SIZE}Mb, ${file.name} cannot be uploaded.`);
- }
-
- if (
- this.getFilesByType(type).filter((item) => item.key === file.name)
- .length > 0
- ) {
- throw new Error(
- `File with the same name is already added to the deposit: ${file.name}`
- );
- }
- } catch (error) {
- this._toastr.error(_(error.message));
- event.addedFiles.splice(index, 1);
- }
- });
-
- if (event.addedFiles.length > 0) {
- this.uploadFiles(event.addedFiles, type);
+ return this.deposit.step;
}
+ return 'metadata';
}
- /**
- * Method called when a file is removed from dropzone. If file is already
- * uploaded, it has to be deleted from database with confirmation.
- *
- * @param Event DOM event triggered
- * @param file - File to remove
- */
- removeFile(event: Event, file: any) {
- event.preventDefault();
-
- this._dialogService
- .show({
- ignoreBackdropClick: true,
- initialState: {
- title: _('Confirmation'),
- body: _('Do you really want to remove this file?'),
- confirmButton: true,
- confirmTitleButton: _('OK'),
- cancelTitleButton: _('Cancel'),
- },
- })
- .pipe(
- switchMap((confirm: boolean) => {
- if (confirm === true) {
- return this._depositService
- .removeFile(this.deposit.pid, file.key, file.version_id)
- .pipe(map(() => true));
- }
- return of(false);
- })
- )
- .subscribe((removed: boolean) => {
- if (removed === true) {
- const index = this.files.indexOf(file);
- this.files.splice(this.files.indexOf(file), 1);
- this._toastr.success(
- this._translateService.instant(
- `File ${file.key} removed successfully.`
- )
- );
- this.filesForm.removeAt(index);
- }
- });
- }
-
- /**
- * Create a deposit without associated files.
- * @param event - Event
- */
- createEmptyDeposit(event: Event) {
- event.preventDefault();
-
- if (this.deposit) {
- this._router.navigate(['deposit', this.deposit.pid, 'metadata']);
- return;
- }
-
- this._depositService
- .create()
- .pipe(
- tap(() => this._spinner.show()),
- delay(1000)
- )
- .subscribe((deposit: any) => {
- this._spinner.hide();
- this._router.navigate(['deposit', deposit.id, 'metadata']);
- });
- }
/**
* Save files metadata and go to next step.
@@ -348,101 +108,6 @@ export class UploadComponent implements OnInit, AfterContentChecked, OnDestroy {
*/
saveAndContinue(event: Event) {
event.preventDefault();
-
- const filesToUpdate = [];
-
- if (this.filesForm.touched === true) {
- this.filesForm.value.forEach((value: any) => {
- const index = this.files.findIndex(
- (item) => item.version_id === value.id
- );
-
- if (this.filesForm.at(index).dirty) {
- // remove embargo date if embargo is not checked
- value.embargoDate = value.embargo === true ? value.embargoDate : '';
-
- this.files[index] = { ...this.files[index], ...value };
- filesToUpdate.push(this.files[index]);
- }
- });
- }
-
- if (filesToUpdate.length > 0) {
- from(filesToUpdate)
- .pipe(
- mergeMap((file: any) => {
- return this._depositService.updateFile(this.deposit.pid, file);
- }),
- reduce(() => true)
- )
- .subscribe(() => {
- this._toastr.success(
- this._translateService.instant(
- 'The files have been updated successfully.'
- )
- );
- this._router.navigate(['deposit', this.deposit.pid, 'metadata']);
- });
- } else {
- this._router.navigate(['deposit', this.deposit.pid, 'metadata']);
- }
- }
-
- /**
- * Check if the field is invalid.
- * @param field Form field to check
- */
- isFieldInvalid(field: any) {
- return field.invalid && (field.dirty || field.touched);
- }
-
- /**
- * Create form for managing files
- */
- private _initForm() {
- this.filesForm = this._fb.array([]);
-
- this.files.forEach((file) => {
- this._addFormField(file);
- });
- }
-
- /**
- * Add a new entry in the form.
- * @param file File data
- */
- private _addFormField(file: any) {
- const control = this._fb.group({
- label: [file.label, Validators.required],
- embargo: [file.embargo],
- embargoDate: [file.embargoDate, this._embargoDateValidator],
- exceptInOrganisation: [file.exceptInOrganisation],
- id: file.version_id,
- });
- this.filesForm.push(control);
- control
- .get('embargo')
- .valueChanges.pipe(takeWhile(() => this.destroyed === false))
- .subscribe((values: any) => {
- if (values === false) {
- control.get('embargoDate').setValue('');
- }
- control.get('embargoDate').updateValueAndValidity();
- });
- }
-
- /**
- * Conditional validator for embargo date.
- * @param formControl Form control to add a validator
- */
- private _embargoDateValidator(formControl: AbstractControl) {
- if (!formControl.parent) {
- return null;
- }
-
- if (formControl.parent.get('embargo').value) {
- return Validators.required(formControl);
- }
- return null;
+ this.router.navigate(['deposit', this.deposit.pid, 'metadata']);
}
}
diff --git a/projects/sonar/src/app/record/collection/detail/detail.component.html b/projects/sonar/src/app/record/collection/detail/detail.component.html
index fa9e028b..77e27a42 100644
--- a/projects/sonar/src/app/record/collection/detail/detail.component.html
+++ b/projects/sonar/src/app/record/collection/detail/detail.component.html
@@ -1,25 +1,27 @@
{{ record.metadata.name | languageValue | async }}
-
-
- - Description
-
-
-
+ @if(record.metadata.description) {
+ Description
+
+ }
+
diff --git a/projects/sonar/src/app/record/document/detail/contributions/contributions.component.html b/projects/sonar/src/app/record/document/detail/contributions/contributions.component.html
index 92aee6a0..99a38b67 100644
--- a/projects/sonar/src/app/record/document/detail/contributions/contributions.component.html
+++ b/projects/sonar/src/app/record/document/detail/contributions/contributions.component.html
@@ -17,7 +17,7 @@
0">
-
- - Conference
- -
-
- -
+
+ - Conference
+ -
+
diff --git a/projects/sonar/src/app/record/document/detail/detail.component.html b/projects/sonar/src/app/record/document/detail/detail.component.html
index 74e03692..875010c8 100644
--- a/projects/sonar/src/app/record/document/detail/detail.component.html
+++ b/projects/sonar/src/app/record/document/detail/detail.component.html
@@ -14,468 +14,415 @@
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see .
-->
-
-
-
-
-
-
+@if(record) {
+
+
+
+
+
+
+
+
+ @if(record.documentType){
+
+ {{ 'document_type_' + record.documentType | translate }}
+
+ }
+
+
+
+ @if(record.masked && record.masked !== 'not_masked') {
+
+ }
+
+ @if(record.title[0].subtitle) { : {{
+ record.title[0].subtitle | languageValue | async
+ }}
+ }
+
+
+
+ @if(record.organisation) {
+
+ {{ organisation.name }}
+
+ } @if(record.subdivisions) {
+
+ {{ subdivision.name | languageValue | async }}
+
+ }
+
+
+
+
+
+
+ @if(record.provisionActivity && record.provisionActivity.length > 0) {
+
+ @for(statement of record.provisionActivity; track statement) {
+ @if(statement.text && statement.text.default) { @for(item of
+ statement.text | keyvalue; track item) {
+ -
+ {{ item.value }}
+
+ } } @else {
+ - {{ statement.text }}
+ } }
+
+ }
+
+
+ @if(record.extent || record.formats) {
+
+ @if(record.extent) {
+ {{ record.extent }}
+ } @if(record.extent && record.formats) { ; } @if(record.formats) {
+ {{ record.formats | join : ', ' }}
+ }
+
+ }
+
+
+ @if(record.editionStatement) {
+
+ {{ record.editionStatement.editionDesignation.value }}
+ @if(record.editionStatement.responsibility) { /
+ {{ record.editionStatement.responsibility.value }}
+ }
+
+ }
+
+
+ @if(record.dissertation) {
+
+ {{ record.dissertation.text }}
+
+ }
+
+
+ @if (record.partOf && record.partOf.length > 0) {
+
+
+
+ {{
+ (record.documentType !== 'coar:c_816b'
+ ? 'Published in'
+ : 'Submitted to'
+ ) | translate
+ }}:
+
+
+ @for (partOf of record.partOf; track partOf) {
+ -
+ {{ partOf.text }}
+
+ }
+
+
+
+ }
-
-
- {{ 'document_type_' + record.documentType | translate }}
+
+ @if(record.subjects && record.subjects.length > 0) {
+
+ @for (subject of record.subjects; track subject) {
+
+ }
-
-
-
-
-
- : {{
- record.title[0].subtitle | languageValue | async
- }}
-
+ }
-
-
-
+ @if (record.abstracts.length > 0) {
+
+ @for (abstract of record.abstracts; track abstract) {
+
+ {{ abstract.language | translateLanguage }}
+
+ } @for (abstract of record.abstracts; track abstract) { @if
+ (abstract.show) { @if (!abstract.full && abstract.value.length > 400) {
+
+ {{ abstract.value | slice : 0 : 400 }}
+
+ {{ 'Show more' | translate }}…
+
+
+ } @else {
+
+ } } }
+
+ }
+
+
+
+
+
+
+
- {{ organisation.name }}
-
-
-
-
+ {{ get_funding_organisations(project) }}
+
+
+
+
+
+
+
- {{ subdivision.name | languageValue | async }}
-
-
-
+ {{ collection.name | languageValue | async }}
+
+
+
+
+ @for (i of [1, 2, 3]; track i) {
+
+ }
+
+
+
+
+ {{ language.value | translateLanguage }}
+
+
-
+
-
-
0
- "
- >
-
-
- -
- {{ item.value }}
-
-
-
- - {{ statement.text }}
-
-
-
-
-
-
- {{ record.extent }}
-
- ;
-
- {{
- record.formats | join : ', '
- }}
-
-
-
-
- {{ record.editionStatement.editionDesignation.value }}
-
- / {{ record.editionStatement.responsibility.value }}
-
-
-
-
-
- {{ record.dissertation.text }}
-
-
-
-
0"
+
+
+
+
+
-
-
-
-
- -
- {{ partOf.text }}
-
-
-
-
-
-
-
-
-
-
0">
-
- {{ abstract.language | translateLanguage }}
-
-
-
- 400;
- else fullAbstract
- "
- >
- {{ abstract.value | slice : 0 : 400 }}
-
- {{ 'Show more' | translate }}…
-
-
-
-
-
-
-
-
-
-
-
-
-
- - Research projects
- -
-
-
-
-
-
-
- - Collections
- -
-
-
-
-
-
-
-
- -
- {{ 'Custom field ' + i | translate }}
-
- -
- {{ record['customField' + i].join(', ') }}
-
-
-
-
-
-
- - Language
- -
-
- -
- {{ language.value | translateLanguage }}
-
-
-
-
-
-
-
-
-
-
- - Content
- -
-
-
-
-
-
-
- - Classification
- -
-
- {{
- 'classification_' + classification.classificationPortion
- | translate
- }} ;
-
-
-
-
-
-
- - Other electronic version
- -
-
-
-
- {{ otherEdition.publicNote }}
-
-
-
-
-
-
-
- - Related to
- -
-
-
-
- {{ relatedTo.publicNote }}
-
-
-
-
-
-
-
- - Series statement
- -
-
- -
- {{ serie.name }}
- ; {{ serie.number }}
-
-
-
-
-
-
-
- - Notes
- -
-
-
-
-
-
-
- - Other material characteristics
- -
- {{ record.otherMaterialCharacteristics }}
-
-
-
-
-
- - Accompanying material
- -
- {{ record.additionalMaterials }}
-
-
-
-
-
- - License
- -
- {{ record.usageAndAccessPolicy.license | translate }}
-
-
{{ record.usageAndAccessPolicy.label }}
-
-
-
-
-
-
- - Open Access status
- -
- {{ record.oa_status }}
-
-
-
-
-
- - Identifiers
- -
-
-
-
-
-
-
-
- - Permalink
- -
- {{ record.permalink }}
-
-
-
+ 'classification_' + classification.classificationPortion
+ | translate
+ }}
+
+
+
+
+
+
+
+
+ {{ otherEdition.publicNote }}
+
+
+
+
+
+
+
+
+
+ {{ relatedTo.publicNote }}
+
+
+
+
+
+
+
+
+ {{ serie.name }}
+ @if (serie.number) { ; {{ serie.number }}
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ usageAndAccessPolicy.license | translate }}
+ @if(usageAndAccessPolicy.label) {
+
{{ usageAndAccessPolicy.label }}
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ permalink }}
+
+
+
-
-
-
-
-
- @if (filteredFiles.length > 1) {
- Other files
-
- @if (tabOther.active) {
+
+
+
+
+
+
+ 1? false: true"
+ id="documents-other-files-tab"
+ [header]="'Other files' | translate"
+ cache="false"
+ >
+
- } }
-
-
-
- Statistics
-
- @if (tabStats.active) {
+
+
+
+
+
- }
-
-
- Edit Files
-
- @if (tabEditFiles.active) {
+
+
+
+
+
- }
-
-
-
+
+
+
+}
diff --git a/projects/sonar/src/app/record/document/detail/detail.component.ts b/projects/sonar/src/app/record/document/detail/detail.component.ts
index e746adc8..db6823b3 100644
--- a/projects/sonar/src/app/record/document/detail/detail.component.ts
+++ b/projects/sonar/src/app/record/document/detail/detail.component.ts
@@ -159,7 +159,7 @@ export class DetailComponent implements OnDestroy, OnInit {
*
* @returns List of UDC classifications.
*/
- get UDCclassifiations(): Array
{
+ get UDCclassifications(): Array {
if (!this.record.classification) {
return [];
}
diff --git a/projects/sonar/src/app/record/document/detail/field-description/field-description.component.html b/projects/sonar/src/app/record/document/detail/field-description/field-description.component.html
new file mode 100644
index 00000000..44b92e78
--- /dev/null
+++ b/projects/sonar/src/app/record/document/detail/field-description/field-description.component.html
@@ -0,0 +1,30 @@
+
+@if (field()) {
+
+
- {{ label() }}
+
-
+ @if(type() === 'array') {
+
+ @for (value of field(); track value; let last=$last; let index=$index) {
+ -
+ @if (template) {
+
+ } @else {
+ {{ value }}
+ }
+
+ }
+
+ }
+ @else {
+ @if (template) {
+
+ } @else {
+ {{ field() }}
+ }
+ }
+
+
+}
diff --git a/projects/sonar/src/app/record/document/document.component.html b/projects/sonar/src/app/record/document/document.component.html
index eb06a5c7..b4c9f2a6 100644
--- a/projects/sonar/src/app/record/document/document.component.html
+++ b/projects/sonar/src/app/record/document/document.component.html
@@ -14,6 +14,7 @@
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see .
-->
+
diff --git a/projects/sonar/src/app/record/files/file-item/file-item.component.html b/projects/sonar/src/app/record/files/file-item/file-item.component.html
index 9ac50404..caa936a4 100644
--- a/projects/sonar/src/app/record/files/file-item/file-item.component.html
+++ b/projects/sonar/src/app/record/files/file-item/file-item.component.html
@@ -91,6 +91,7 @@ Versions
+ {{file.metadata.order}}.
@if (file?.links?.self) {
.
- */
-
-import { ComponentFixture, TestBed } from '@angular/core/testing';
-
-import { OtherFilesComponent } from './other-files.component';
-
-describe('OtherFilesComponent', () => {
- let component: OtherFilesComponent;
- let fixture: ComponentFixture;
-
- beforeEach(async () => {
- await TestBed.configureTestingModule({
- imports: [OtherFilesComponent]
- })
- .compileComponents();
-
- fixture = TestBed.createComponent(OtherFilesComponent);
- component = fixture.componentInstance;
- fixture.detectChanges();
- });
-
- it('should create', () => {
- expect(component).toBeTruthy();
- });
-});
diff --git a/projects/sonar/src/app/record/files/other-files/other-files.component.ts b/projects/sonar/src/app/record/files/other-files/other-files.component.ts
index 1e7180aa..ff1f53af 100644
--- a/projects/sonar/src/app/record/files/other-files/other-files.component.ts
+++ b/projects/sonar/src/app/record/files/other-files/other-files.component.ts
@@ -165,8 +165,8 @@ export class OtherFilesComponent implements OnInit, OnDestroy {
const data = {};
// retrieve main files
res.map((entry) => {
- // main file (such as pdf)
- if (entry.type == 'file') {
+ // main file (such as pdf) and avoid the first
+ if (entry.type == 'file' && entry?.order != '1') {
const dataFile: any = {
label: entry?.label ? entry.label : entry.key,
mimetype: entry.mimetype,
diff --git a/projects/sonar/src/app/record/files/stats-files/stats-files.component.spec.ts b/projects/sonar/src/app/record/files/stats-files/stats-files.component.spec.ts
deleted file mode 100644
index f72dbd80..00000000
--- a/projects/sonar/src/app/record/files/stats-files/stats-files.component.spec.ts
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * SONAR User Interface
- * Copyright (C) 2019-2024 RERO
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, version 3 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-import { ComponentFixture, TestBed } from '@angular/core/testing';
-
-import { StatsFilesComponent } from './stats-files.component';
-
-describe('StatsFilesComponent', () => {
- let component: StatsFilesComponent;
- let fixture: ComponentFixture;
-
- beforeEach(async () => {
- await TestBed.configureTestingModule({
- imports: [StatsFilesComponent]
- })
- .compileComponents();
-
- fixture = TestBed.createComponent(StatsFilesComponent);
- component = fixture.componentInstance;
- fixture.detectChanges();
- });
-
- it('should create', () => {
- expect(component).toBeTruthy();
- });
-});
diff --git a/projects/sonar/src/app/record/files/upload-files/upload-files.component.html b/projects/sonar/src/app/record/files/upload-files/upload-files.component.html
index 1f684387..314b185c 100644
--- a/projects/sonar/src/app/record/files/upload-files/upload-files.component.html
+++ b/projects/sonar/src/app/record/files/upload-files/upload-files.component.html
@@ -74,6 +74,7 @@ Upload Files
+ @if(files?.length > 0) {
Upload Files
>
+ }
} @else {
diff --git a/projects/sonar/src/app/record/files/upload-files/upload-files.component.ts b/projects/sonar/src/app/record/files/upload-files/upload-files.component.ts
index f3cc2edd..1e7b689e 100644
--- a/projects/sonar/src/app/record/files/upload-files/upload-files.component.ts
+++ b/projects/sonar/src/app/record/files/upload-files/upload-files.component.ts
@@ -16,7 +16,14 @@
*/
import { HttpClient } from '@angular/common/http';
-import { Component, ViewChild, effect, inject, input, output } from '@angular/core';
+import {
+ Component,
+ ViewChild,
+ effect,
+ inject,
+ input,
+ output,
+} from '@angular/core';
import { toObservable, toSignal } from '@angular/core/rxjs-interop';
import { TranslateService } from '@ngx-translate/core';
import { DialogService, RecordService } from '@rero/ng-core';
@@ -147,7 +154,7 @@ export class UploadFilesComponent {
);
if (indexToUpdate >= 0) {
this.fileService
- .put(`/api/documents/${this.pid()}`, this.record)
+ .put(`/api/${this.recordType()}/${this.pid()}`, this.record)
.subscribe((record: any) => {
// update the current record
this.record = record.metadata;
@@ -182,14 +189,17 @@ export class UploadFilesComponent {
.pipe(
catchError((e: any) => {
let msg = this.translateService.instant('Server error');
- if (e.error.message) {
+ if (e?.error?.message) {
msg = `${msg}: ${e.error.message}`;
}
this.toastrService.error(msg);
return of([]);
}),
+ switchMap(() => this.getRecord()),
+ switchMap(() => {
+ return this._reorder();
+ }),
tap(() => {
- this.getRecord();
this.resetFilter();
this.fileUpload.clear();
this.toastrService.success(
@@ -212,7 +222,10 @@ export class UploadFilesComponent {
let fileUpload: File = event.fileUpload;
this.spinner.show('file-upload');
this.fileService
- .put(`/api/documents/${this.pid()}/files/${file.key}`, fileUpload)
+ .put(
+ `/api/${this.recordType()}/${this.pid()}/files/${file.key}`,
+ fileUpload
+ )
.pipe(
catchError((e: any) => {
let msg = this.translateService.instant('Server error');
@@ -222,10 +235,10 @@ export class UploadFilesComponent {
this.toastrService.error(msg);
return of(null);
}),
- map((file: any) => {
+ switchMap((file: any) =>
// update the record and the files
- this.getRecord();
- }),
+ this.getRecord()
+ ),
tap(() => {
this.filesChanged.emit(this.files);
this.resetFilter();
@@ -241,15 +254,14 @@ export class UploadFilesComponent {
* Get the record and the files from the backend.
*/
getRecord() {
- this.fileService
+ return this.fileService
.get(`/api/${this.recordType()}/${this.pid()}`)
.pipe(
map((rec: any) => (rec = rec.metadata)),
tap((record) => (this.record = record)),
switchMap((record) => this.getFiles(record)),
tap((files) => (this.files = files))
- )
- .subscribe();
+ );
}
/**
@@ -261,12 +273,15 @@ export class UploadFilesComponent {
private generateCreateRequests(event): Observable {
return from(event.files).pipe(
concatMap((f: any) =>
- this.fileService.put(`/api/documents/${this.pid()}/files/${f.name}`, f)
+ this.fileService.put(
+ `/api/${this.recordType()}/${this.pid()}/files/${f.name}`,
+ f
+ )
),
map((file: any) => {
this.nUploadedFiles += 1;
this.files = this.processFiles([
- { label: file.key, ...file },
+ { label: file.key, metadata:{order: this.files.length + 1}, ...file },
...this.files,
]);
}),
@@ -335,16 +350,23 @@ export class UploadFilesComponent {
if (confirm === true) {
// remove the file
return this.fileService
- .delete(`/api/documents/${this.pid()}/files/${file.key}`)
+ .delete(
+ `/api/${this.recordType()}/${this.pid()}/files/${file.key}`
+ )
.pipe(
- map((res) => {
+ tap(() => {
this.files = this.files.filter((f) => f.key !== file.key);
+ this.record._files = this.record._files.filter(
+ (item: any) => file.key !== item.key
+ );
+ }),
+ switchMap(() => this._reorder()),
+ tap(() => {
this.resetFilter();
this.toastrService.success(
this.translateService.instant('File removed successfully.')
);
this.filesChanged.emit(this.files);
- return true;
})
);
}
@@ -368,7 +390,7 @@ export class UploadFilesComponent {
*/
private getFiles(record): Observable {
return this.fileService
- .get(`/api/documents/${record.pid}/files?versions`)
+ .get(`/api/${this.recordType()}/${record.pid}/files?versions`)
.pipe(
map((record: any) => {
if (record?.contents) {
@@ -405,7 +427,10 @@ export class UploadFilesComponent {
// get old versions
let versions = {};
files.map((file) => {
- if (file?.metadata?.type === 'file' && file.is_head === false) {
+ if (file?.metadata?.type && file.metadata.type !== 'file') {
+ return;
+ }
+ if (file.is_head === false) {
if (!(file.key in versions)) versions[file.key] = [];
versions[file.key].push(file);
}
@@ -413,7 +438,10 @@ export class UploadFilesComponent {
// get head files only
let headFiles = [];
files.map((file) => {
- if (file?.metadata?.type === 'file' && file.is_head) {
+ if (file?.metadata?.type && file.metadata.type !== 'file') {
+ return;
+ }
+ if (file.is_head) {
// add versions if exists
if (versions[file.key]) {
let fileVersions = versions[file.key];
@@ -431,19 +459,28 @@ export class UploadFilesComponent {
* Reorder the files.
*/
reorder() {
+
+ this._reorder().subscribe((record: any) => {
+ this.filesChanged.emit(this.files);
+ });
+ }
+
+ _reorder() {
this.files.map((file, index) => {
let recordFile = this._getFileInRecord(file.key);
recordFile.order = index + 1;
});
- this.fileService
- .put(`/api/documents/${this.pid()}`, this.record)
- .subscribe((record: any) => {
+ return this.fileService
+ .put(`/api/${this.recordType()}/${this.pid()}`, this.record)
+ .pipe(
+ tap((record: any) => {
this.record = record.metadata;
this.files.map((file) => {
file.metadata = this._getFileInRecord(file.key);
});
- this.filesChanged.emit(this.files);
- });
+
+ })
+ );
}
/**
diff --git a/projects/sonar/src/app/record/hepvs/project/detail/detail.component.html b/projects/sonar/src/app/record/hepvs/project/detail/detail.component.html
index fd42dc67..8101f472 100644
--- a/projects/sonar/src/app/record/hepvs/project/detail/detail.component.html
+++ b/projects/sonar/src/app/record/hepvs/project/detail/detail.component.html
@@ -1,20 +1,20 @@
-
+@if (record$ | async; as record) {
{{ record.metadata.name }}
@@ -34,187 +34,158 @@
{{ record.metadata.projectSponsor }} ({{ 'Project sponsor' | translate }}, {{ record.metadata.statusHep }})
-
+
-
- - Internal research associates
- - {{ record.metadata.innerSearcher | join:', ' }}
-
+
-
- - Main team
- -
- {{ record.metadata.mainTeam }}
-
-
+
-
- - Secondary team
- -
- {{ record.metadata.secondaryTeam }}
-
-
+
-
- - External partners
- -
-
+ @if (record.metadata.externalPartners.choice) {
+
+
+ @for (partner of record.metadata.externalPartners.list; track partner; let last=$last) {
{{ partner.searcherName }}
{{ partner.institution }}
- ,
-
-
-
+ @if (!last) {
+ ,
+ }
+ }
+
+
+ }
-
- - Project summary
- -
-
-
-
+
+
+
+
+
-
- - Date of approval by the Team Leader
- -
- {{ record.metadata.approvalDate | dateTranslate: 'dd.MM.yyyy' }}
-
-
+
+
-
- - Realization framework
- -
- {{ record.metadata.realizationFramework | join:', ' }}
-
-
+
-
- - Funding
- -
-
+ @if (record.metadata.funding.choice) {
+
+
+ @if (funding?.funder?.number) {
- {{ record.metadata.funding.funder.number }}
+ {{ funding.funder.number }}
-
-
- {{ record.metadata.funding.funder.name }}
-
+ }
+ @if (funding?.funder?.name) {
+ {{ funding.funder.name }}
+ }
+ @if (funding.funder.type != 'Other (free field)') {
+
{{ record.metadata.funding.funder.type }}
-
-
- {{ record.metadata.funding.funder.type }}
-
+ }
+ @if (['Swiss National Science Foundation', 'Swissuniversities'].includes(funding.funder.type)) {
+ {{ funding.funder.type }}
+ }
-
-
+ [ngClass]="{ 'fa-check text-success': funding.fundingReceived, 'fa-remove text-danger': !funding.fundingReceived }">
+
+
+ }
-
- - Actors involved
- -
-
- {{ actor.choice !== 'Other' ? actor.choice : actor.other }} ({{ actor.count }}),
-
-
-
-
+
+
+ {{ actor.choice !== 'Other' ? actor.choice : actor.other }} ({{ actor.count }})
+ @if (!last) {
+ ,
+ }
+
+
-
- - What are the benefits and quality improvements in the research in this
- project?
-
- -
-
-
-
+
+
+
+
+
-
- - What are the impacts of training research?
- -
-
-
-
+
+
+
+
+
-
- - What is the impact of the research on the professional environment?
- -
-
-
-
+
+
+
+
+
-
- - What is the impact of research on public action or on internal or external
- governance?
- -
-
-
-
+
+
+
+
+
-
- - Why this project promote pedagogical or technological innovation?
- -
- {{ record.metadata.promoteInnovation.reason }}
-
-
+ @if (record.metadata.promoteInnovation?.choice) {
+
+ }
-
- - Mandate
- -
- {{ record.metadata.relatedToMandate.mandate }}
-
- {{ record.metadata.relatedToMandate.name }}
-
-
-
- - Brief description of the mandate
- -
-
-
-
+ @if (record.metadata.relatedToMandate?.choice) {
+
+
+ {{ relatedToMandate.mandate }}
+ @if (relatedToMandate.name) {
+ {{ relatedToMandate.name }}
+ }
+
+
+
+
+
+
+
+
+ }
-
- - Brief description of the report
- -
-
-
-
+ @if (record.metadata.educationalDocument?.choice) {
+
+
+
+
+
+ }
-
- - How are research results used in training?
- -
-
-
-
+
+
+
+
+
-
- 0 && user.is_moderator">
- Linked documents
-
-
-
+ }
+
+ }
+}
diff --git a/projects/sonar/src/app/record/organisation/detail/detail.component.html b/projects/sonar/src/app/record/organisation/detail/detail.component.html
index 6888304c..82f3aae3 100644
--- a/projects/sonar/src/app/record/organisation/detail/detail.component.html
+++ b/projects/sonar/src/app/record/organisation/detail/detail.component.html
@@ -16,111 +16,87 @@
-->
{{ record.metadata.name }}
-
- - Code
- - {{ record.metadata.code }}
+
+
- - Is shared
- -
-
-
+
+
+
+
+
- - Is dedicated
- -
-
-
+
+
+
+
+
-
- - Server name (without http)
- - {{ record.metadata.serverName }}
-
+
-
- - Platform name
-
-
+
+
+
+
+
-
- - Ark Name Assigning Authority Number (NAAN)
- - {{ record.metadata.arkNAAN }}
-
+
-
- - Allowed IP addresses
-
-
+
+
+
+
+
-
- - Description
- -
-
- {{ 'lang_' + desc.language | translate | ucfirst }}
-
-
-
-
+
+
+ {{ 'lang_' + description.language | translate | ucfirst }}
+
+
+
-
- - Footer
- -
-
- {{ 'lang_' + foot.language | translate | ucfirst }}
-
-
-
-
+
+
+ {{ 'lang_' + footer.language | translate | ucfirst }}
+
+
+
-
-
-
- - {{ 'Custom field' | translate }} {{ i }}
- -
-
- {{ 'Label' | translate }}: {{ record.metadata['documentsCustomField' + i].label | languageValue | async }}
+ @for (i of [1, 2, 3]; track i) {
+
+
+ @if (customField.label) {
+ {{ 'Label' | translate }}: {{ customField.label | languageValue | async }}
-
-
+ }
+
{{ 'Include in facets' | translate }}
-
-
-
+
+
+ }
-
- - {{ 'Visible facets in the public interface for documents' | translate }}
- -
-
- -
-
- {{ facet | translate | ucfirst }}
-
-
-
-
-
+
+
+
+ {{ publicDocumentFacet | translate | ucfirst }}
+
+
-
+
+
+ {{ subdivision.metadata.name | languageValue | async }}
+
+
+
+
+
+
+ {{ collection.metadata.name | languageValue | async }}
+
+
+
+
+
diff --git a/projects/sonar/src/app/record/organisation/detail/detail.component.ts b/projects/sonar/src/app/record/organisation/detail/detail.component.ts
index 6d8771e8..ae40acbc 100644
--- a/projects/sonar/src/app/record/organisation/detail/detail.component.ts
+++ b/projects/sonar/src/app/record/organisation/detail/detail.component.ts
@@ -14,10 +14,10 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see .
*/
-import { Component, OnInit } from '@angular/core';
+import { Component, OnInit, inject } from '@angular/core';
import { RecordService } from '@rero/ng-core';
import { combineLatest, Observable } from 'rxjs';
-import { switchMap } from 'rxjs/operators';
+import { map, switchMap } from 'rxjs/operators';
@Component({
templateUrl: './detail.component.html',
@@ -29,6 +29,8 @@ export class DetailComponent implements OnInit {
/** Organisation record. */
record: any;
+ recordService = inject(RecordService);
+
/** Subdivisions list. */
subdivisions: Array = [];
@@ -40,7 +42,7 @@ export class DetailComponent implements OnInit {
*
* @param _recordService: Record service.
*/
- constructor(private _recordService: RecordService) {}
+ constructor() {}
/**
* Component init.
@@ -53,11 +55,11 @@ export class DetailComponent implements OnInit {
switchMap((record: any) => {
this.record = record;
return combineLatest([
- this._recordService.getRecords(
+ this.recordService.getRecords(
'subdivisions',
`organisation.pid:${record.id}`
),
- this._recordService.getRecords(
+ this.recordService.getRecords(
'collections',
`organisation.pid:${record.id}`
),
diff --git a/projects/sonar/src/app/record/project/detail/detail.component.html b/projects/sonar/src/app/record/project/detail/detail.component.html
index 56ce94bc..1f9a2ca2 100644
--- a/projects/sonar/src/app/record/project/detail/detail.component.html
+++ b/projects/sonar/src/app/record/project/detail/detail.component.html
@@ -16,77 +16,63 @@
-->
{{ record.metadata.name }}
-
-
- - Description
-
-
+
+
+
+
+
+
- - Period
- - {{ record.metadata.startDate | dateTranslate: 'd/M/yyyy' }} -
- {{ record.metadata.endDate | dateTranslate: 'd/M/yyyy' }}
+
+
-
- - End date
- - {{ record.metadata.endDate | dateTranslate: 'longDate' }}
-
+
+
-
- - Identifier
- -
-
-
-
+
+
+
+
+
-
- - Investigators
- -
-
-
- {{ investigator.agent.preferred_name }} ({{ role | translate }}
- ,
- )
+
+
+ {{ investigator.agent.preferred_name }}
+ (@for (role of investigator.role; track role; let last=$last) {
+ {{ role | translate }}@if (!last) {
+ ,
+ }
+ })
-
-
+ @if (investigator.affiliation) {
+
{{ investigator.affiliation }}
-
-
- {{ investigator.affiliation }}
-
-
-
-
-
-
-
+ }
+
+
-
- - Funding organisations
- -
-
- {{ funding_organisation.agent.preferred_name }}
+
+
+ {{ funding_organisation.agent.preferred_name }}
-
-
-
+
+
+
-
- 0 && user.is_moderator">
- Linked documents
-
- -
+ @if (user$ | async; as user && record.metadata.documents && record.metadata.documents.length > 0 && user.is_moderator) {
+
Linked documents
+
-
-
-
+ }
+
+ }
diff --git a/projects/sonar/src/app/record/subdivision/brief-view/brief-view.component.html b/projects/sonar/src/app/record/subdivision/brief-view/brief-view.component.html
index e18973b2..7c1064eb 100644
--- a/projects/sonar/src/app/record/subdivision/brief-view/brief-view.component.html
+++ b/projects/sonar/src/app/record/subdivision/brief-view/brief-view.component.html
@@ -1,20 +1,18 @@
-
+{{ record.metadata.name | languageValue | async }}
diff --git a/projects/sonar/src/app/record/subdivision/detail/detail.component.html b/projects/sonar/src/app/record/subdivision/detail/detail.component.html
deleted file mode 100644
index e08edb1f..00000000
--- a/projects/sonar/src/app/record/subdivision/detail/detail.component.html
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
- {{ record.metadata.name | languageValue | async }}
-
diff --git a/projects/sonar/src/app/record/subdivision/detail/detail.component.ts b/projects/sonar/src/app/record/subdivision/detail/detail.component.ts
deleted file mode 100644
index d8a17831..00000000
--- a/projects/sonar/src/app/record/subdivision/detail/detail.component.ts
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * SONAR User Interface
- * 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 { Component } from '@angular/core';
-import { Observable } from 'rxjs';
-
-@Component({
- templateUrl: './detail.component.html'
-})
-export class DetailComponent {
- /** Observable resolving record data */
- record$: Observable;
-}
diff --git a/projects/sonar/src/app/record/user/detail/detail.component.html b/projects/sonar/src/app/record/user/detail/detail.component.html
deleted file mode 100644
index bf8b2e63..00000000
--- a/projects/sonar/src/app/record/user/detail/detail.component.html
+++ /dev/null
@@ -1,58 +0,0 @@
-
-
- {{ record.metadata.first_name }} {{ record.metadata.last_name }}
-
-
- - Organisation
- - {{ record.metadata.organisation.name }}
-
-
- - Role
- - {{ ('role_' + record.metadata.role) | translate }}
-
-
- - Subdivision
- - {{ record.metadata.subdivision.name | languageValue | async }}
-
-
- - Email address
- - {{ record.metadata.email }}
-
-
- - Birthdate
- - {{ record.metadata.birth_date | date }}
-
-
-
- - Phone
- - {{ record.metadata.phone }}
-
-
-
- - Address
- -
-
- {{ record.metadata.street }}
-
-
- {{ record.metadata.postal_code }} {{ record.metadata.city }}
-
-
-
-
-
diff --git a/projects/sonar/src/app/record/user/detail/detail.component.ts b/projects/sonar/src/app/record/user/detail/detail.component.ts
deleted file mode 100644
index d8a17831..00000000
--- a/projects/sonar/src/app/record/user/detail/detail.component.ts
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * SONAR User Interface
- * 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 { Component } from '@angular/core';
-import { Observable } from 'rxjs';
-
-@Component({
- templateUrl: './detail.component.html'
-})
-export class DetailComponent {
- /** Observable resolving record data */
- record$: Observable;
-}
diff --git a/projects/sonar/src/styles.scss b/projects/sonar/src/styles.scss
index f7b53583..bf1cf9c2 100644
--- a/projects/sonar/src/styles.scss
+++ b/projects/sonar/src/styles.scss
@@ -25,6 +25,7 @@ $secondary: rgb(246, 130, 17) !default;
@import url('https://fonts.googleapis.com/css?family=Roboto:300,700|Roboto+Condensed:300,700');
@import 'font-awesome/scss/font-awesome';
+
@layer bootstrap {
@import 'bootstrap/scss/bootstrap';
@import 'ngx-toastr/toastr-bs4-alert';
@@ -32,6 +33,9 @@ $secondary: rgb(246, 130, 17) !default;
// TODO: remove `node_modules` when this will be fixed in ngx-bootstrap
@import 'easymde/dist/easymde.min';
body,
+ .invalid-feedback {
+ display: block !important;
+ }
html {
line-height: normal;
font-size: 0.9rem;
@@ -105,7 +109,7 @@ $secondary: rgb(246, 130, 17) !default;
}
}
-@import 'primeng/resources/themes/bootstrap4-light-blue/theme';
+@import 'primeng/resources/themes/lara-light-blue/theme';
@import 'primeng/resources/primeng';
@layer primengother {
@import 'primeicons/primeicons';
@@ -117,3 +121,7 @@ $secondary: rgb(246, 130, 17) !default;
font-size: 0.9rem;
}
}
+@layer ng-core {
+ @import 'node_modules/@rero/ng-core/assets/scss/ng-core';
+}
+
diff --git a/tsconfig.json b/tsconfig.json
index 91de5f9c..3de016a6 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -7,7 +7,7 @@
"declaration": false,
"downlevelIteration": true,
"experimentalDecorators": true,
- "module": "es2020",
+ "module": "es2022",
"moduleResolution": "node",
"importHelpers": true,
"target": "ES2022",