diff --git a/projects/admin/src/app/app.module.ts b/projects/admin/src/app/app.module.ts index 76b013ed5..23f3cc18f 100644 --- a/projects/admin/src/app/app.module.ts +++ b/projects/admin/src/app/app.module.ts @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -import { HTTP_INTERCEPTORS, HttpClientModule } from '@angular/common/http'; +import { HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http'; import { LOCALE_ID, NgModule } from '@angular/core'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { BrowserModule } from '@angular/platform-browser'; @@ -42,6 +42,7 @@ import { MenuComponent } from './menu/menu.component'; import { BioInformationsPipe } from './pipe/bio-informations.pipe'; import { BirthDatePipe } from './pipe/birth-date.pipe'; import { MefTitlePipe } from './pipe/mef-title.pipe'; +import { NotesFormatPipe } from './pipe/notes-format.pipe'; import { AcquisitionOrderBriefViewComponent } from './record/brief-view/acquisition-order-brief-view.component'; import { BudgetsBriefViewComponent } from './record/brief-view/budgets-brief-view.component'; import { CircPoliciesBriefViewComponent } from './record/brief-view/circ-policies-brief-view.component'; @@ -184,7 +185,8 @@ import { SharedPipesModule } from './shared/shared-pipes.module'; SerialHoldingItemComponent, SerialHoldingDetailViewComponent, HoldingDetailViewComponent, - DefaultHoldingItemComponent + DefaultHoldingItemComponent, + NotesFormatPipe ], imports: [ AppRoutingModule, diff --git a/projects/admin/src/app/pipe/notes-format.pipe.spec.ts b/projects/admin/src/app/pipe/notes-format.pipe.spec.ts new file mode 100644 index 000000000..f15d8cc25 --- /dev/null +++ b/projects/admin/src/app/pipe/notes-format.pipe.spec.ts @@ -0,0 +1,8 @@ +import { NotesFormatPipe } from './notes-format.pipe'; + +describe('NotesFormatPipe', () => { + it('create an instance', () => { + const pipe = new NotesFormatPipe(); + expect(pipe).toBeTruthy(); + }); +}); diff --git a/projects/admin/src/app/pipe/notes-format.pipe.ts b/projects/admin/src/app/pipe/notes-format.pipe.ts new file mode 100644 index 000000000..dd1fe211d --- /dev/null +++ b/projects/admin/src/app/pipe/notes-format.pipe.ts @@ -0,0 +1,23 @@ +import { Pipe, PipeTransform } from '@angular/core'; + +@Pipe({ + name: 'notesFormat' +}) +export class NotesFormatPipe implements PipeTransform { + + transform(notes: any): any { + if (notes) { + const notesText = {}; + for (const note of notes) { + if (!(note.noteType in notesText)) { + notesText[note.noteType] = [note.label]; + } else { + notesText[note.noteType].push(note.label); + } + } + return notesText; + } + return null; + + } +} 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 86c584b0d..2e9fc8424 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 @@ -201,41 +201,43 @@

{{ altgr_title }}

- + +
Note
  • {{ note }}
-
- -
- Physical details -
-
-
    -
  • {{ note }}
  • -
-
-
- -
- Accompanying material -
-
-
    -
  • {{ note }}
  • -
-
+
+ +
+ Physical details +
+
+
    +
  • {{ note }}
  • +
+
+
+ +
+ Accompanying material +
+
+
    +
  • {{ note }}
  • +
+
+