Skip to content

Commit

Permalink
Finish metadata update (#69)
Browse files Browse the repository at this point in the history
* Broken state, with the following migration steps:

```bash
npm i --lockfile-version 3 --frozen-lockfile
ng update @angular/{cdk,cli,core,material}@15
ng update @angular/{cdk,cli,core,material}@16
ng update @angular/{cdk,cli,core,material}@17
ng generate @angular/material:mdc-migration
ng update @angular/material@17
ncu -u
```

▸ Remove Browserslist configuration files that matches the Angular CLI default configuration.
  Migration completed (No changes made).

▸ Remove exported `@angular/platform-server` `renderModule` method.
  The `renderModule` method is now exported by the Angular CLI.
  Migration completed (No changes made).

▸ Remove no longer needed require calls in Karma builder main file.
  Migration completed (No changes made).

▸ Update TypeScript compiler `target` and set `useDefineForClassFields`.
  These changes are for IDE purposes as TypeScript compiler options `target` and `useDefineForClassFields` are set to `ES2022` and `false` respectively by the Angular CLI.
  To control ECMA version and features use the Browerslist configuration.
UPDATE tsconfig.json (1550 bytes)
  Migration completed (1 file modified).

▸ Remove options from 'angular.json' that are no longer supported by the official builders.
  Migration completed (No changes made).

** Executing migrations of package '@angular/cdk' **

▸ Updates the Angular CDK to v15.

      ✓  Updated Angular CDK to version 15

  Migration completed (No changes made).

** Executing migrations of package '@angular/core' **

▸ In Angular version 15, the deprecated `relativeLinkResolution` config parameter of the Router is removed.
  This migration removes all `relativeLinkResolution` fields from the Router config objects.
UPDATE src/app/app-routing.module.ts (2163 bytes)
  Migration completed (1 file modified).

▸ Since Angular v15, the `RouterLink` contains the logic of the `RouterLinkWithHref` directive.
  This migration replaces all `RouterLinkWithHref` references with `RouterLink`.
  Migration completed (No changes made).

** Executing migrations of package '@angular/material' **

▸ Updates the Angular Material to v15.

      ✓  Updated Angular Material to version 15

** Executing migrations of package '@angular/cli' **

▸ Remove 'defaultProject' option from workspace configuration.
  The project to use will be determined from the current working directory.
  Migration completed (No changes made).

▸ Replace removed 'defaultCollection' option in workspace configuration with 'schematicCollections'.
  Migration completed (No changes made).

▸ Update the '@angular-devkit/build-angular:server' builder configuration to disable 'buildOptimizer' for non optimized builds.
  Migration completed (No changes made).

** Executing migrations of package '@angular/cdk' **

▸ Updates the Angular CDK to v16.

      ✓  Updated Angular CDK to version 16

  Migration completed (No changes made).

** Executing migrations of package '@angular/core' **

▸ In Angular version 15.2, the guard and resolver interfaces (CanActivate, Resolve, etc) were deprecated.
  This migration removes imports and 'implements' clauses that contain them.
UPDATE src/app/guards/authenticated.guard.ts (417 bytes)
UPDATE src/app/resolvers/profile-page-resolver.ts (684 bytes)
  Migration completed (2 files modified).

▸ As of Angular v16, the `moduleId` property of `@Component` is deprecated as it no longer has any effect.
  Migration completed (No changes made).

** Executing migrations of package '@angular/material' **

▸ Updates the Angular Material to v16.

      ✓  Updated Angular Material to version 16

  Migration completed (No changes made).

** Executing migrations of package '@angular/cli' **

▸ Replace usages of '@nguniversal/builders' with '@angular-devkit/build-angular'.
  Migration completed (No changes made).

▸ Replace usages of '@nguniversal/' packages with '@angular/ssr'.
  Migration completed (No changes made).

▸ Replace deprecated options in 'angular.json'.
UPDATE angular.json (3643 bytes)
  Migration completed (1 file modified).

** Executing migrations of package '@angular/cdk' **

▸ Updates the Angular CDK to v17.

      ✓  Updated Angular CDK to version 17

  Migration completed (No changes made).

** Executing migrations of package '@angular/core' **

▸ Angular v17 introduces a new control flow syntax that uses the @ and } characters.
  This migration replaces the existing usages with their corresponding HTML entities.
UPDATE src/app/pages/static-pages/contact/contact.component.html (2021 bytes)
UPDATE src/app/pages/static-pages/privacy/privacy.component.html (13002 bytes)
UPDATE src/app/pages/static-pages/consortium/consortium.component.html (1491 bytes)
  Migration completed (3 files modified).

▸ Updates `TransferState`, `makeStateKey`, `StateKey` imports from `@angular/platform-browser` to `@angular/core`.
  Migration completed (No changes made).

▸ CompilerOption.useJit and CompilerOption.missingTranslation are unused under Ivy.
  This migration removes their usage
  Migration completed (No changes made).

** Executing migrations of package '@angular/material' **

▸ Updates Angular Material to v17.
    Cannot update to Angular Material v17 because the project is using the legacy Material components
    that have been deleted. While Angular Material v16 is compatible with Angular v17, it is recommended
    to switch away from the legacy components as soon as possible because they no longer receive bug fixes,
    accessibility improvements and new features.

    Read more about migrating away from legacy components: https://material.angular.io/guide/mdc-migration

    Files in the project using legacy Material components:
     - /src/app/app.module.ts
     - /src/app/components/actionbar/actionbar.component.ts
     - /src/app/components/auth-dialog/auth-dialog.component.ts
     - /src/app/components/grid-element/grid-element.component.ts
     - /src/app/components/metadata/entity/entity.component.ts
     - /src/app/components/metadata/institution/institution.component.ts
     - /src/app/components/metadata/person/person.component.ts
     - /src/app/components/navigation/navbar/navbar.component.ts
     - /src/app/dialogs/confirmation-dialog/confirmation-dialog.component.ts
     - /src/app/dialogs/edit-entity-dialog/edit-entity-dialog.component.ts
     - /src/app/dialogs/entity-rights-dialog/entity-rights-dialog.component.ts
     - /src/app/dialogs/entity-settings-dialog/entity-settings-dialog.component.ts
     - /src/app/dialogs/explore-compilation-dialog/explore-compilation-dialog.component.ts
     - /src/app/dialogs/explore-entity/explore-entity-dialog.component.ts
     - /src/app/dialogs/forgot-password-dialog/forgot-password-dialog.component.ts
     - /src/app/dialogs/forgot-username-dialog/forgot-username-dialog.component.ts
     - /src/app/dialogs/group-member-dialog/group-member-dialog.component.ts
     - /src/app/dialogs/password-protected-dialog/password-protected-dialog.component.ts
     - /src/app/dialogs/register-dialog/register-dialog.component.ts
     - /src/app/dialogs/reset-password-dialog/reset-password-dialog.component.ts
     - /src/app/dialogs/upload-application-dialog/upload-application-dialog.component.ts
     - /src/app/pages/admin-page/admin-page.component.ts
     - /src/app/pages/collaborate/collaborate.component.ts
     - /src/app/pages/explore/explore.component.ts
     - /src/app/pages/profile-page/profile-page.component.ts
     - /src/app/services/dialog-helper.service.ts
     - /src/app/services/progress-bar.service.ts
     - /src/app/services/query-action.service.ts
     - /src/app/services/snackbar.service.ts
     - /src/app/wizards/add-compilation/add-compilation-wizard.component.ts
     - /src/app/wizards/add-entity/add-entity-wizard.component.ts
     - /src/app/wizards/add-group-wizard/add-group-wizard.component.ts

UPDATE package.json (2569 bytes)
✔ Packages installed successfully.
  Migration completed (1 file modified).

!!!After running 'ng generate @angular/material:mdc-migration'!!!

** Executing migrations of package '@angular/material' **

▸ Updates Angular Material to v17.

      ✓  Updated Angular Material to version 17

  Migration completed (No changes made).

* Broken state, but compiles, with the following changes:

- downgraded bson to 4.7.2
- moved from angular "browser"-builder to "application"-builder
- used newer syntax to define angular material theme
- adjusted some style imports

* Update to Angular 17.3, migrate to standalone components & new control flow syntax

* Run Control Flow Migration: `ng g @angular/core:control-flow`
* Run Standalone Migration: `ng generate @angular/core:standalone`
* Update `tsconfig.json` and `angular.json` to match more closely to Angular 17 examples
* Update browserlist and move it to `package.json`
* Remove `src/common` folder and instead include `kompakkt-common` as a github dependency

* Compiling, but broken Angular Material

* Fix Angular Material Styles

* Fix AM Styles Part 2

- Add fixes for Angular Material issues with explore entity/compilation styles
- Delete own comments

* Style Changes #40

- remove the history button from the filter options in kompakkt and add it to the navigation bar like in semantic kompakkt
 --> VE: Removed login and registration button from actionbar, removed actionbar from home-page
- add the New Object and for now for kompakkt also the New Collections button to the navigation bar
- change the fontsize from the button to 14
- if possible change also the search options to font size 14
- in semantic kompakkt it also says "Search for objects and compilations", but we don't have the "compilations" here, only in kompakkt, so better write here "Search in objects" and in kompakkt better "Search in objects and collections" (or depending from the toggle function of the Objects and Collections)
- align the search options with the logo at the navigation bar
- gap between buttons, history button and "Profile"/"Logout": 8px

* UI Design #40

Object options:
- make sure the icons are size 24x24
- font: Open Sans, size: 14
- trash bin color: E91E63
- the title of the object should also be the same font and font size.

Fix licence size

* UI Design #40

Login and Register
- Remove Login and Register from actiobar
- The font for the "Cancel" and "Create new account" is wrong, change it to Open Sans
- The "Cancel" button is orange, it should be pink: E91E63.
- Same with the accent color of the input fields
- Colors in Login-Dialog

* UI Design: object view bar #40

- gap between the icons: 16px, the rest stays 8px.
- Since we changed the navigation bar, the "History", "New Object" and "New Collection" button can be removed here.
- Move everything to the right to make it the same like in semantic kompakkt.
- change the color to blue for the "Annotate" and the "Publish" button. Colorcode: 00AFE7
- make sure the font of the buttons is Open Sans and size 14px.
- We are using an "Annotate" button in semantic kompakkt, so replace the Annotate icon with the button.
- The three icons under the picture description also are integrated in the option bar now to make it similar to semantic kompakkt.
- Align the navigation bar and the option bar (both with 24px gap from the right)

* UI Design: Upload Process + Object view

Upload Process:
- Change the color of the "Reset" button here in kompakkt to the pink color, right font for whole overlay
- fix text in finalize-settings

Object view:
- icon for collection-choice
- nested menu for existing collections

* Change text of actionbar

* Update Visibility Settings

First changes from #40

* Update Metadata next to object

- update licence view
- update persons and institutions

regarding issue #42

* Update Metadata

- change Ui from akkordeon to sidenav (like in semantik-kompakkt)
- change first style issues with the new sidenav-content

* Update meta-data

* Update Metadata (related agents)

* Finish related persons and institutions

* Fix bug when removing persons or institutions

* Update metadata (creation) WIP

* Update metadata

- add creation
- add links
- add additional component for agents
- update entity-Component

* Update Metadata

- add link-component in new format
- add biblioRef-Component iu new format

* Update metadata

- add physical object to metadata-form
- extract general information in separate component

* Update agents

- add searchfunktionality for prename and name
- add funktionality for updating existing users
- fix style issues in agent-card

* Update agents & creation

agents:
- add tabs for persons and institutions
- add translations for agent-forms

creation:
- update creation card output --> show every tuple together
- update creation(card) style

* Update metadata

- extract externalids
- extract dimensions
- update biblioRef output
- extract general

* Update General

- extract general information in separate component
- fix issues in autocomplete of tags --> selecting tag and adding tag at the same time, it was possible to add empty tags, input-value was not empty after selecting or adding a new tag

* Update physicalEntity

- add necessary forms for physical entity
- update agent-form to save agents in physicalEntity
- update general-form to save and output correct values
- delete code-validation for place

* Update Metadata

- update output for all metadata
- physicalEntity is set now
- everything will be saved in the digitalEntity
- extract list of roles in component --> output of agents is now in the list-component

* Small fixes

- dialog when closing edit-entity-window
- change text in add-entity-window when there is no back just cancel
- set required fields for digitalEntity and physicalEntity
- delete unneccassery code
- set colored headline for invalid physical object
- update validation for physical object

* Update agents

- fix issue when setting agents to update --> form in physical object will not be set

* Update agents

- fix issue when changing tabs

* Update metadata

- extract card data of optional data in global component
- adding a pipe for key mapping of objects

* Minor Updates

- Rename sentences when not in the right format
- highlight active metadata-tab
- fix small visual issues

* Update metadata

- update translation files to right format
- update style issues in agents, dimensions, externalIds, biblio reference, metadata and physical object
- change creation date in material-component datepicker
- setup edit-mode on biblio reference
- setup different card options for dimensions and biblio reference
- add service for metadata communication between different components

* Fix display issues

* Update entity-settings-dialog.component.scss

* Update entity-settings-dialog.component.scss

* Pull request changes

- replace *ngIf with @if and *ngFor with @for (only in the metadata)
- merge agent-communication.service in metadata-communication.service and delete it (maybe there is another place, but I didn't find an apropriate yet)
- delete unneccassary code
- delete objects-Method and take valuePairPipe from angular instead (maybe custom pipe could be deleted but don't know how exactly)
- add correct typings

* Remove MapKeyPipe in favor of @if/@else inside of HTML template

* Set Observables as properties instead of getters in AgentListComponent

---------

Co-authored-by: Kai Niebes <[email protected]>
  • Loading branch information
vmalieske and HeyItsBATMAN authored Feb 25, 2025
1 parent d727667 commit f027de8
Show file tree
Hide file tree
Showing 68 changed files with 3,939 additions and 17,956 deletions.
16,815 changes: 0 additions & 16,815 deletions package-lock.json

This file was deleted.

8 changes: 4 additions & 4 deletions src/app/components/actionbar/actionbar.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
</div>
@if (!showCompilations) {
<mat-form-field>
<mat-label>{{ 'Media Types' | translate }}</mat-label>
<mat-label>{{ 'Media types' | translate }}</mat-label>
<mat-select
multiple
[formControl]="mediaTypesSelected"
Expand All @@ -43,7 +43,7 @@
</mat-form-field>
}
<mat-form-field>
<mat-label>{{ 'Filter Options' | translate }}</mat-label>
<mat-label>{{ 'Filter options' | translate }}</mat-label>
<mat-select
multiple
[formControl]="filterTypesSelected"
Expand Down Expand Up @@ -196,7 +196,7 @@
<div class="button-row">
<button
mat-flat-button
matTooltip="{{ 'Embed This Object on Your Web Page' | translate }}"
matTooltip="{{ 'Embed this object on your web page' | translate }}"
(click)="copyEmbed()"
>
<mat-icon>perm_media</mat-icon>
Expand All @@ -206,7 +206,7 @@
[download]="downloadFileName"
(click)="generateDownloadJsonUri()"
>
<button mat-flat-button matTooltip="{{ 'Download Metadata' | translate }}">
<button mat-flat-button matTooltip="{{ 'Download metadata' | translate }}">
<mat-icon>list_alt</mat-icon>
</button>
</a>
Expand Down
1 change: 1 addition & 0 deletions src/app/components/actionbar/actionbar.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
}

> #quick-actions {
width: 100%;
display: flex;
align-items: center;
gap: 8px;
Expand Down
1 change: 1 addition & 0 deletions src/app/components/actionbar/actionbar.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ export class ActionbarComponent implements OnChanges {
}

get userCompilations(): ICompilation[] {
// console.log(this.userData?.data?.compilation);
return this.userData?.data?.compilation ?? [];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ <h2>{{ compilation.name }}</h2>
[download]="downloadFileName"
(click)="generateDownloadJsonUri()"
>
<button mat-flat-button matTooltip="{{ 'Download Metadata' | translate }}">
<button mat-flat-button matTooltip="{{ 'Download metadata' | translate }}">
<mat-icon>list_alt</mat-icon>
</button>
</a>
Expand Down Expand Up @@ -48,7 +48,7 @@ <h2>{{ 'Collection information' | translate }}</h2>
</div>
@if (entityCount > 0) {
<div class="detail-block">
<h2>{{ 'Collection Objects' | translate }}</h2>
<h2>{{ 'Collection objects' | translate }}</h2>
{{ 'Objects in this collection:' | translate }}
<mat-nav-list id="collection-objects">
@for (entity of entities; track entity) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
@if (physicalEntity$ | async; as physicalEntity) {
<mat-expansion-panel expanded>
<mat-expansion-panel-header>
<mat-panel-title> {{ 'Physical Object' | translate }}</mat-panel-title>
<mat-panel-title> {{ 'Physical object' | translate }}</mat-panel-title>
</mat-expansion-panel-header>
<h2 class="title">{{ physicalEntity.title }}</h2>
<p>{{ physicalEntity.description }}</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,32 +80,32 @@ export class DetailEntityComponent implements OnChanges {
},
'BY': {
src: 'assets/licence/BY.png',
description: 'CC Attribution',
description: 'Attribution 4.0 International (CC BY 4.0)',
link: 'https://creativecommons.org/licenses/by/4.0',
},
'BY-SA': {
src: 'assets/licence/BY-SA.png',
description: 'CC Attribution-ShareAlike',
description: 'Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)',
link: 'https://creativecommons.org/licenses/by-sa/4.0',
},
'BY-ND': {
src: 'assets/licence/BY-ND.png',
description: 'CC Attribution-NoDerivatives',
description: 'Attribution-NoDerivatives 4.0 International (CC BY-ND 4.0)',
link: 'https://creativecommons.org/licenses/by-nd/4.0',
},
'BYNC': {
src: 'assets/licence/BYNC.png',
description: 'CC Attribution-NonCommercial',
description: 'Attribution-NonCommercial 4.0 International (CC BY-NC 4.0)',
link: 'https://creativecommons.org/licenses/by-nc/4.0',
},
'BYNCSA': {
src: 'assets/licence/BYNCSA.png',
description: 'CC Attribution-NonCommercial-ShareAlike',
description: 'Attribution-NonCommercial-ShareAlike International (CC BY-NC-SA 4.0)',
link: 'https://creativecommons.org/licenses/by-nc-sa/4.0',
},
'BYNCND': {
src: 'assets/licence/BYNCND.png',
description: 'CC Attribution-NonCommercial-NoDerivatives',
description: 'Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0)',
link: 'https://creativecommons.org/licenses/by-nc-nd/4.0',
},
'AR': {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,43 +1,46 @@
@if (institution$ | async; as institution) {
<h3>{{ institution.name }}</h3>
@if (address$ | async; as address) {
<div class="address">
@if (address.country) {
<p>{{ address.country }}</p>
}
@if (address.postcode || address.city) {
<p>
@if (address.postcode) {
<span>{{ address.postcode }}</span>
}
@if (address.city) {
<span>{{ address.city }}</span>
}
</p>
}
@if (address.street || address.number) {
<p>
@if (address.street) {
<span>{{ address.street }}</span>
}
@if (address.number) {
<span>{{ address.number }}</span>
}
</p>
}
@if (address.building) {
<p>{{ address.building }}</p>
}
</div>
}
@if (note$ | async; as note) {
<p>{{ note }}</p>
}
@if (roles$ | async; as roles) {
<mat-chip-listbox>
@for (role of roles; track role) {
<mat-chip-option color="primary">{{ role }}</mat-chip-option>
}
</mat-chip-listbox>
}
<div *ngIf="(roles$ | async) as roles">
<p class="capitalize">
<ng-container *ngFor="let role of roles; let last = last">
{{ role }}<span *ngIf="!last">, </span><span *ngIf="last">: </span>
</ng-container>
</p>
<p class="blue-underline-text">{{ institution.name }}</p>
@if (address$ | async; as address) {
<div class="address">
@if (address.street || address.number) {
<p>
@if (address.street) {
<span>{{ address.street }}</span>
}
@if (address.number) {
<span>{{ address.number }}</span>
}
</p>
}

@if (address.postcode || address.city) {
<p>
@if (address.postcode) {
<span>{{ address.postcode }}</span>
}
@if (address.city) {
<span>{{ address.city }}</span>
}
</p>
}

@if (address.country) {
<p>{{ address.country }}</p>
}

<!-- @if (address.building) {
<p>{{ address.building }}</p>
} -->
</div>
}
@if (note$ | async; as note) {
<p>{{ note }}</p>
}
</div>
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Component, Input, OnChanges, SimpleChanges } from '@angular/core';
import { BehaviorSubject } from 'rxjs';
import { filter, map } from 'rxjs/operators';

import { AsyncPipe } from '@angular/common';
import { AsyncPipe, CommonModule } from '@angular/common';
import { MatChipListbox, MatChipOption } from '@angular/material/chips';
import { IAddress, IInstitution } from 'src/common';

Expand All @@ -13,7 +13,7 @@ const firstKey = (obj: any) => Object.keys(obj)[0] ?? '';
templateUrl: './detail-institution.component.html',
styleUrls: ['./detail-institution.component.scss'],
standalone: true,
imports: [MatChipListbox, MatChipOption, AsyncPipe],
imports: [CommonModule, MatChipListbox, MatChipOption, AsyncPipe],
})
export class DetailInstitutionComponent implements OnChanges {
@Input('institution')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
@if (person$ | async; as person) {
<h3>{{ person.prename }} {{ person.name }}</h3>
@if (contact$ | async; as contact) {
@if (contact.mail) {
<p>{{ contact.mail }}</p>
}
@if (contact.note) {
<p>{{ contact.note }}</p>
}
@if (contact.phonenumber) {
<p>{{ contact.phonenumber }}</p>
}
}
@if (roles$ | async; as roles) {
<mat-chip-listbox>
@for (role of roles; track role) {
<mat-chip-option color="primary">{{ role }}</mat-chip-option>

<div *ngIf="(roles$ | async) as roles">
<p class="capitalize">
<ng-container *ngFor="let role of roles; let last = last">
{{ role }}<span *ngIf="!last">, </span><span *ngIf="last">: </span>
</ng-container>
</p>
<p class="blue-underline-text"> {{ person.prename }} {{ person.name }} </p>
@if (contact$ | async; as contact) {
@if (contact.mail) {
<p>{{ contact.mail }}</p>
}
</mat-chip-listbox>
}
@if (contact.note) {
<p>{{ contact.note }}</p>
}
@if (contact.phonenumber) {
<p>{{ contact.phonenumber }}</p>
}
}
</div>

@if (institutions$ | async; as institutions) {
<div class="block">
@for (institution of institutions; track institution) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Component, Input, OnChanges, SimpleChanges } from '@angular/core';
import { CommonModule } from '@angular/common';
import { BehaviorSubject } from 'rxjs';
import { filter, map } from 'rxjs/operators';

Expand All @@ -14,7 +15,7 @@ const firstKey = (obj: any) => Object.keys(obj)[0] ?? '';
templateUrl: './detail-person.component.html',
styleUrls: ['./detail-person.component.scss'],
standalone: true,
imports: [MatChipListbox, MatChipOption, DetailInstitutionComponent, AsyncPipe],
imports: [CommonModule, MatChipListbox, MatChipOption, DetailInstitutionComponent, AsyncPipe],
})
export class DetailPersonComponent implements OnChanges {
@Input('person')
Expand Down
8 changes: 4 additions & 4 deletions src/app/components/metadata/address/address.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
name="country"
placeholder="{{ 'Enter a country' | translate }}"
[(ngModel)]="address.country"
[required]="required"
[required]="!isPhysicalObject"
/>
<!--mat-hint>Lorem Ipsum</mat-hint-->
</mat-form-field>
Expand All @@ -29,7 +29,7 @@
name="postcode"
placeholder="{{ 'Enter a postal code' | translate }}"
[(ngModel)]="address.postcode"
[required]="required"
[required]="!isPhysicalObject"
/>
<!--mat-hint>Lorem Ipsum</mat-hint-->
</mat-form-field>
Expand All @@ -41,7 +41,7 @@
name="city"
placeholder="{{ 'Enter a city' | translate }}"
[(ngModel)]="address.city"
[required]="required"
[required]="!isPhysicalObject"
/>
<!--mat-hint>Lorem Ipsum</mat-hint-->
</mat-form-field>
Expand All @@ -53,7 +53,7 @@
name="street"
placeholder="{{ 'Enter a street' | translate }}"
[(ngModel)]="address.street"
[required]="required"
[required]="!isPhysicalObject"
/>
<!--mat-hint>Lorem Ipsum</mat-hint-->
</mat-form-field>
Expand Down
3 changes: 3 additions & 0 deletions src/app/components/metadata/address/address.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,7 @@ export class AddressComponent {

@Input('required')
public required = true;

@Input('isPhysicalObject')
public isPhysicalObject = false;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<div class="card">
<div>
@if (isPerson(agent)) {
<p>{{ agent.fullName }}</p>
<p>{{ agent.contact_references[entityId]?.mail }}</p>
}
@if (isInstitution(agent)) {
<p>{{ agent.name }}</p>
<p>{{ agent.addresses[entityId]?.street + ' ' +
agent.addresses[entityId]?.number + ', ' +
agent.addresses[entityId]?.postcode + ' ' +
agent.addresses[entityId]?.city}}</p>
}
</div>
<div class="actions">
<button
mat-icon-button
color="primary"
(click)="onSelechtAgent()"
>
<mat-icon>edit</mat-icon>
</button>
<button
mat-icon-button
color="warn"
(click)="remove.emit()"
>
<mat-icon>close</mat-icon>
</button>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
.card > div > p {
margin: 0;
}

:host {
display: block;
}

.actions {
padding: 0 !important;
right: 5px !important;
margin-top: auto;
}

.card {
margin-top: 10px;
border-radius: 1rem !important;
justify-items: center;
justify-content: center;
}

div.card .actions {
padding: 0 !important;
transform: none;
}

.card p {
margin-block-end: 5px;
margin-block-start: 5px;
}
Loading

0 comments on commit f027de8

Please sign in to comment.