Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ <h2 class="title">{{ physicalEntity.title }}</h2>
@if (hasPersonsOrInstitutions()) {
<mat-expansion-panel expanded>
<mat-expansion-panel-header>
<mat-panel-title> {{ 'Persons and Institutions' | translate }} </mat-panel-title>
<mat-panel-title>
{{ 'Persons and Institutions' | translate }}
</mat-panel-title>
<mat-panel-description />
</mat-expansion-panel-header>
@if (persons(); as persons) {
Expand Down Expand Up @@ -134,28 +136,6 @@ <h2 class="title">{{ physicalEntity.title }}</h2>
}
</mat-expansion-panel>
}
@if (hasOtherMetadata()) {
<mat-expansion-panel expanded>
<mat-expansion-panel-header>
<mat-panel-title>{{ 'Other' | translate }}</mat-panel-title>
<mat-panel-description />
</mat-expansion-panel-header>
@for (entry of otherMetadata(); track entry) {
<div class="block">
@if (entry.description) {
<p>
{{ entry.description }}
</p>
}
@if (entry.value) {
<p>
{{ entry.value }}
</p>
}
</div>
}
</mat-expansion-panel>
}
@if (hasMetadataFiles()) {
<mat-expansion-panel expanded>
<mat-expansion-panel-header>
Expand Down Expand Up @@ -200,7 +180,9 @@ <h2 class="title">{{ physicalEntity.title }}</h2>
@if (hasPersonsOrInstitutions()) {
<mat-expansion-panel expanded>
<mat-expansion-panel-header>
<mat-panel-title> {{ 'Persons and Institutions' | translate }} </mat-panel-title>
<mat-panel-title>
{{ 'Persons and Institutions' | translate }}
</mat-panel-title>
<mat-panel-description />
</mat-expansion-panel-header>
@if (persons(); as persons) {
Expand Down Expand Up @@ -272,28 +254,6 @@ <h2 class="title">{{ physicalEntity.title }}</h2>
}
</mat-expansion-panel>
}
@if (hasOtherMetadata()) {
<mat-expansion-panel expanded>
<mat-expansion-panel-header>
<mat-panel-title>{{ 'Other' | translate }}</mat-panel-title>
<mat-panel-description />
</mat-expansion-panel-header>
@for (entry of otherMetadata(); track entry) {
<div class="block">
@if (entry.description) {
<p>
{{ entry.description }}
</p>
}
@if (entry.value) {
<p>
{{ entry.value }}
</p>
}
</div>
}
</mat-expansion-panel>
}
@if (hasMetadataFiles()) {
<mat-expansion-panel expanded>
<mat-expansion-panel-header>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,6 @@ export class DetailEntityComponent {
return this.metadataFiles().length > 0;
});

otherMetadata = computed(() => {
const entity = this.entity();
return entity.other;
});

hasOtherMetadata = computed(() => {
return this.otherMetadata().length > 0;
});

bibRefs = computed(() => {
const entity = this.entity();
return entity.biblioRefs;
Expand Down
123 changes: 53 additions & 70 deletions src/app/components/metadata/address/address.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,75 +9,58 @@

@if (address) {
<div class="address-form">
<mat-form-field>
<mat-label>{{ 'Country' | translate }}</mat-label>
<input
matInput
type="text"
name="country"
placeholder="{{ 'Enter a country' | translate }}"
[(ngModel)]="address.country"
[required]="!isPhysicalObject"
/>
<!--mat-hint>Lorem Ipsum</mat-hint-->
</mat-form-field>
<mat-form-field>
<mat-label>{{ 'Postal Code' | translate }}</mat-label>
<input
matInput
type="text"
name="postcode"
placeholder="{{ 'Enter a postal code' | translate }}"
[(ngModel)]="address.postcode"
[required]="!isPhysicalObject"
/>
<!--mat-hint>Lorem Ipsum</mat-hint-->
</mat-form-field>
<mat-form-field>
<mat-label>{{ 'City' | translate }}</mat-label>
<input
matInput
type="text"
name="city"
placeholder="{{ 'Enter a city' | translate }}"
[(ngModel)]="address.city"
[required]="!isPhysicalObject"
/>
<!--mat-hint>Lorem Ipsum</mat-hint-->
</mat-form-field>
<mat-form-field>
<mat-label>{{ 'Street' | translate }}</mat-label>
<input
matInput
type="text"
name="street"
placeholder="{{ 'Enter a street' | translate }}"
[(ngModel)]="address.street"
[required]="!isPhysicalObject"
/>
<!--mat-hint>Lorem Ipsum</mat-hint-->
</mat-form-field>
<mat-form-field>
<mat-label>{{ 'Number' | translate }}</mat-label>
<input
matInput
type="text"
name="number"
placeholder="{{ 'Enter a number' | translate }}"
[(ngModel)]="address.number"
/>
<!--mat-hint>Lorem Ipsum</mat-hint-->
</mat-form-field>
<mat-form-field>
<mat-label>{{ 'Building' | translate }}</mat-label>
<input
matInput
type="text"
name="building"
placeholder="{{ 'Enter a building' | translate }}"
[(ngModel)]="address.building"
/>
<!--mat-hint>Lorem Ipsum</mat-hint-->
</mat-form-field>
<app-outlined-input
type="text"
name="country"
label="{{ 'Country' | translate }}"
placeholder="{{ 'Enter a country' | translate }}"
[(ngModel)]="address.country"
[required]="!isPhysicalObject"
>
</app-outlined-input>

<app-outlined-input
type="text"
name="postcode"
label="{{ 'Postal Code' | translate }}"
placeholder="{{ 'Enter a postal code' | translate }}"
[(ngModel)]="address.postcode"
[required]="!isPhysicalObject"
>
</app-outlined-input>

<app-outlined-input
type="text"
name="city"
label="{{ 'City' | translate }}"
placeholder="{{ 'Enter a city' | translate }}"
[(ngModel)]="address.city"
[required]="!isPhysicalObject"
/>

<app-outlined-input
type="text"
name="street"
label="{{ 'Street' | translate }}"
placeholder="{{ 'Enter a street' | translate }}"
[(ngModel)]="address.street"
[required]="!isPhysicalObject"
/>

<app-outlined-input
type="text"
name="number"
label="{{ 'Number' | translate }}"
placeholder="{{ 'Enter a number' | translate }}"
[(ngModel)]="address.number"
/>

<app-outlined-input
type="text"
name="building"
label="{{ 'Building' | translate }}"
placeholder="{{ 'Enter a building' | translate }}"
[(ngModel)]="address.building"
/>
</div>
}
5 changes: 2 additions & 3 deletions src/app/components/metadata/address/address.component.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import { Component, Input } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { MatFormField, MatLabel } from '@angular/material/form-field';
import { MatInput } from '@angular/material/input';
import { Address } from 'src/app/metadata';
import { TranslatePipe } from '../../../pipes/translate.pipe';
import { OutlinedInputComponent } from '../../outlined-input/outlined-input.component';

@Component({
selector: 'app-address',
templateUrl: './address.component.html',
styleUrls: ['./address.component.scss'],
imports: [MatFormField, MatLabel, MatInput, FormsModule, TranslatePipe],
imports: [FormsModule, TranslatePipe, OutlinedInputComponent],
})
export class AddressComponent {
@Input('address')
Expand Down
6 changes: 6 additions & 0 deletions src/app/components/metadata/agents/agents.component.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
<p
[class.metadata-header-physical]="isPhysicalObject()"
[class.metadata-header-digital]="!isPhysicalObject()"
>
{{ 'Related persons and institutions' | translate }}
</p>
<mat-tab-group
disableRipple
[(selectedIndex)]="selectedTabIndex"
Expand Down
2 changes: 2 additions & 0 deletions src/app/components/metadata/agents/agents.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ export class AgentsComponent implements OnDestroy, OnChanges {
entity = input.required<AnyEntity>();
entityId = computed(() => this.entity()._id);

isPhysicalObject = input<boolean>(false);

@ViewChild('agentGroup') agentGroup!: MatTabGroup;

selectedType = signal<'person' | 'institution'>('person');
Expand Down
Loading
Loading