From 4e6962b43a8a35d72e02de848affc4d3c03ef4f1 Mon Sep 17 00:00:00 2001 From: Camille Moinier Date: Wed, 6 Dec 2023 15:12:25 +0100 Subject: [PATCH] feat(dh): various UX fixes --- .../record-apis/record-apis.component.html | 3 +- .../record-apis/record-apis.component.spec.ts | 6 +-- .../record-apis/record-apis.component.ts | 2 +- .../record-metadata.component.html | 4 +- .../record-metadata.component.spec.ts | 42 +++++++++++-------- .../record-metadata.component.ts | 2 +- .../src/lib/api-card/api-card.component.html | 6 ++- .../lib/api-card/api-card.component.spec.ts | 10 ++--- .../src/lib/api-card/api-card.component.ts | 14 +++++-- .../record-api-form.component.css | 1 + .../record-api-form.component.ts | 6 +-- translations/de.json | 3 +- translations/en.json | 5 ++- translations/es.json | 3 +- translations/fr.json | 3 +- translations/it.json | 3 +- translations/nl.json | 3 +- translations/pt.json | 3 +- 18 files changed, 72 insertions(+), 47 deletions(-) diff --git a/apps/datahub/src/app/record/record-apis/record-apis.component.html b/apps/datahub/src/app/record/record-apis/record-apis.component.html index 57c66cf2c7..23dd9ac594 100644 --- a/apps/datahub/src/app/record/record-apis/record-apis.component.html +++ b/apps/datahub/src/app/record/record-apis/record-apis.component.html @@ -15,6 +15,7 @@ let last = last " [link]="link" + [currentLink]="facade.selectedApiLink$ | async" class="w-80" [ngClass]="{ 'mr-[var(--container-outside-width)]': last, @@ -22,7 +23,7 @@ 'shadow-xl bg-white': link === (facade.selectedApiLink$ | async), 'bg-neutral-100': link !== (facade.selectedApiLink$ | async) }" - (openCustomPanel)="openCustomPanel($event)" + (openRecordApiForm)="openRecordApiForm($event)" > diff --git a/apps/datahub/src/app/record/record-apis/record-apis.component.spec.ts b/apps/datahub/src/app/record/record-apis/record-apis.component.spec.ts index b4b7a3593d..b0ce4d03da 100644 --- a/apps/datahub/src/app/record/record-apis/record-apis.component.spec.ts +++ b/apps/datahub/src/app/record/record-apis/record-apis.component.spec.ts @@ -11,7 +11,7 @@ class MdViewFacadeMock { const serviceDistributionMock = { type: 'service', - url: 'http://myogcapifeatures.test', + url: new URL('http://myogcapifeatures.test'), accessServiceProtocol: 'ogcFeatures', } as DatasetServiceDistribution @@ -42,9 +42,9 @@ describe('RecordApisComponent', () => { expect(component).toBeTruthy() }) - describe('#openCustomPanel', () => { + describe('#openRecordApiForm', () => { beforeEach(() => { - component.openCustomPanel(serviceDistributionMock) + component.openRecordApiForm(serviceDistributionMock) }) it('should update value in facade.selectedApiLink$', async () => { const apiLink = await firstValueFrom(facade.selectedApiLink$) diff --git a/apps/datahub/src/app/record/record-apis/record-apis.component.ts b/apps/datahub/src/app/record/record-apis/record-apis.component.ts index a51e77a266..564c073f00 100644 --- a/apps/datahub/src/app/record/record-apis/record-apis.component.ts +++ b/apps/datahub/src/app/record/record-apis/record-apis.component.ts @@ -17,7 +17,7 @@ import { MdViewFacade } from '@geonetwork-ui/feature/record' export class RecordApisComponent { constructor(public facade: MdViewFacade) {} - openCustomPanel(link: DatasetServiceDistribution) { + openRecordApiForm(link: DatasetServiceDistribution) { this.facade.selectedApiLink$.next(link) } } diff --git a/apps/datahub/src/app/record/record-metadata/record-metadata.component.html b/apps/datahub/src/app/record/record-metadata/record-metadata.component.html index ad3a3e2697..757db1212f 100644 --- a/apps/datahub/src/app/record/record-metadata/record-metadata.component.html +++ b/apps/datahub/src/app/record/record-metadata/record-metadata.component.html @@ -122,7 +122,7 @@
@@ -138,7 +138,7 @@