+
+
-
-
{{ option.label }}{{ option.label | translate }}
diff --git a/libs/ui/inputs/src/lib/switch-toggle/switch-toggle.component.ts b/libs/ui/inputs/src/lib/switch-toggle/switch-toggle.component.ts
index 72d8f9e161..4a0df6ba02 100644
--- a/libs/ui/inputs/src/lib/switch-toggle/switch-toggle.component.ts
+++ b/libs/ui/inputs/src/lib/switch-toggle/switch-toggle.component.ts
@@ -7,9 +7,11 @@ import {
Output,
} from '@angular/core'
import { MatButtonToggleModule } from '@angular/material/button-toggle'
+import { TranslateModule } from '@ngx-translate/core'
export type SwitchToggleOption = {
label: string
+ value?: unknown
checked: boolean
}
@@ -19,7 +21,7 @@ export type SwitchToggleOption = {
styleUrls: ['./switch-toggle.component.css'],
changeDetection: ChangeDetectionStrategy.OnPush,
standalone: true,
- imports: [MatButtonToggleModule, CommonModule],
+ imports: [MatButtonToggleModule, CommonModule, TranslateModule],
})
export class SwitchToggleComponent {
@Input() options: SwitchToggleOption[]
diff --git a/libs/ui/inputs/src/lib/url-input/url-input.component.html b/libs/ui/inputs/src/lib/url-input/url-input.component.html
index 2f964788dc..9944a4b428 100644
--- a/libs/ui/inputs/src/lib/url-input/url-input.component.html
+++ b/libs/ui/inputs/src/lib/url-input/url-input.component.html
@@ -27,7 +27,11 @@
diff --git a/libs/ui/inputs/src/lib/url-input/url-input.component.spec.ts b/libs/ui/inputs/src/lib/url-input/url-input.component.spec.ts
index d90106b83c..ba96445896 100644
--- a/libs/ui/inputs/src/lib/url-input/url-input.component.spec.ts
+++ b/libs/ui/inputs/src/lib/url-input/url-input.component.spec.ts
@@ -78,15 +78,27 @@ describe('UrlInputComponent', () => {
})
describe('button', () => {
- it('is disabled if value is input empty', () => {
+ it('is disabled if parent set it as disabled', () => {
+ component.disabled = true
inputEl.value = ''
fixture.detectChanges()
expect(button.componentInstance.disabled).toBe(true)
})
+ it('is disabled if value is empty', () => {
+ inputEl.value = ''
+ fixture.detectChanges()
+ expect(button.componentInstance.disabled).toBe(true)
+ })
+ it('is disabled if asking for parseable URL and value is not an URL', () => {
+ component.urlCanParse = true
+ inputEl.value = 'hello'
+ fixture.detectChanges()
+ expect(button.componentInstance.disabled).toBe(true)
+ })
it('is not disabled otherwise', () => {
inputEl.value = 'hello'
fixture.detectChanges()
- expect(button.componentInstance.disabled).toBe(false)
+ expect(button.componentInstance.disabled).toBeFalsy()
})
})
})
diff --git a/libs/ui/inputs/src/lib/url-input/url-input.component.ts b/libs/ui/inputs/src/lib/url-input/url-input.component.ts
index 2cca056e24..9bafd36ad0 100644
--- a/libs/ui/inputs/src/lib/url-input/url-input.component.ts
+++ b/libs/ui/inputs/src/lib/url-input/url-input.component.ts
@@ -1,4 +1,11 @@
-import { ChangeDetectorRef, Component, Input, Output } from '@angular/core'
+import {
+ ChangeDetectorRef,
+ Component,
+ Input,
+ OnChanges,
+ Output,
+ SimpleChanges,
+} from '@angular/core'
import { CommonModule } from '@angular/common'
import { ButtonComponent } from '../button/button.component'
import { MatIconModule } from '@angular/material/icon'
@@ -12,16 +19,23 @@ import { Subject } from 'rxjs'
standalone: true,
imports: [CommonModule, ButtonComponent, MatIconModule],
})
-export class UrlInputComponent {
+export class UrlInputComponent implements OnChanges {
@Input() value = ''
@Input() extraClass = ''
@Input() placeholder = 'https://'
@Input() disabled: boolean
+ @Input() urlCanParse?: boolean
rawChange = new Subject()
@Output() valueChange = this.rawChange.pipe(filter((v) => !!v))
constructor(private cd: ChangeDetectorRef) {}
+ ngOnChanges(changes: SimpleChanges): void {
+ if (changes.value) {
+ console.log('changes.value', changes.value)
+ }
+ }
+
handleInput() {
this.cd.markForCheck()
}
@@ -30,4 +44,13 @@ export class UrlInputComponent {
const value = element.value
this.rawChange.next(value)
}
+
+ URLcanParse(url: string): boolean {
+ try {
+ new URL(url)
+ return true
+ } catch (e) {
+ return false
+ }
+ }
}
diff --git a/translations/de.json b/translations/de.json
index 4ba2803a1d..0095630ab3 100644
--- a/translations/de.json
+++ b/translations/de.json
@@ -1,4 +1,5 @@
{
+ "": "",
"Add Layer As": "",
"button.login": "",
"catalog.figures.datasets": "{count, plural, =0{Datensätze} one{Datensatz} other{Datensätze}}",
@@ -217,9 +218,13 @@
"editor.record.form.field.onlineResource.confirm": "",
"editor.record.form.field.onlineResource.dialogTitle": "",
"editor.record.form.field.onlineResource.edit.description": "",
+ "editor.record.form.field.onlineResource.edit.protocol": "",
"editor.record.form.field.onlineResource.edit.title": "",
"editor.record.form.field.onlineResource.fileSize": "",
"editor.record.form.field.onlineResource.modify": "",
+ "editor.record.form.field.onlineResource.toggle.dataset": "",
+ "editor.record.form.field.onlineResource.toggle.service": "",
+ "editor.record.form.field.onlineResources": "",
"editor.record.form.field.overviews": "",
"editor.record.form.field.recordUpdated": "Datensatz zuletzt aktualisiert",
"editor.record.form.field.resourceUpdated": "Letztes Aktualisierungsdatum",
@@ -242,6 +247,7 @@
"editor.record.form.page.ressources": "",
"editor.record.form.section.about.description": "",
"editor.record.form.section.about.label": "",
+ "editor.record.form.section.annexes.description": "",
"editor.record.form.section.annexes.label": "",
"editor.record.form.section.associatedResources.description": "",
"editor.record.form.section.associatedResources.label": "",
@@ -265,6 +271,7 @@
"editor.record.loadError.body": "Der Datensatz konnte nicht geladen werden:",
"editor.record.loadError.closeMessage": "Verstanden",
"editor.record.loadError.title": "Fehler beim Laden des Datensatzes",
+ "editor.record.onlineResource.protocol.other": "",
"editor.record.onlineResourceError.body": "",
"editor.record.onlineResourceError.closeMessage": "",
"editor.record.onlineResourceError.title": "",
diff --git a/translations/en.json b/translations/en.json
index 4ad061ef09..1c0638f91d 100644
--- a/translations/en.json
+++ b/translations/en.json
@@ -1,4 +1,5 @@
{
+ "": "",
"Add Layer As": "",
"button.login": "Log in",
"catalog.figures.datasets": "{count, plural, =0{datasets} one{dataset} other{datasets}}",
@@ -217,9 +218,13 @@
"editor.record.form.field.onlineResource.confirm": "Confirm",
"editor.record.form.field.onlineResource.dialogTitle": "Modify the resource preview",
"editor.record.form.field.onlineResource.edit.description": "Description",
+ "editor.record.form.field.onlineResource.edit.protocol": "Protocol",
"editor.record.form.field.onlineResource.edit.title": "Title",
"editor.record.form.field.onlineResource.fileSize": "{sizeMB}MB",
"editor.record.form.field.onlineResource.modify": "Modify",
+ "editor.record.form.field.onlineResource.toggle.dataset": "Link to a dataset",
+ "editor.record.form.field.onlineResource.toggle.service": "Link to a service",
+ "editor.record.form.field.onlineResources": "Distribution",
"editor.record.form.field.overviews": "Overviews",
"editor.record.form.field.recordUpdated": "Record Updated",
"editor.record.form.field.resourceUpdated": "Resource Updated",
@@ -242,6 +247,7 @@
"editor.record.form.page.ressources": "Resources",
"editor.record.form.section.about.description": "This section describes the resource.",
"editor.record.form.section.about.label": "About the resource",
+ "editor.record.form.section.annexes.description": "",
"editor.record.form.section.annexes.label": "Annexes",
"editor.record.form.section.associatedResources.description": "Drop files here to associate them with the resource.",
"editor.record.form.section.associatedResources.label": "Associated resources",
@@ -265,6 +271,7 @@
"editor.record.loadError.body": "The record could not be loaded:",
"editor.record.loadError.closeMessage": "Understood",
"editor.record.loadError.title": "Error loading record",
+ "editor.record.onlineResource.protocol.other": "Other",
"editor.record.onlineResourceError.body": "An error occurred while adding the resource:",
"editor.record.onlineResourceError.closeMessage": "Understood",
"editor.record.onlineResourceError.title": "Error adding resource",
diff --git a/translations/es.json b/translations/es.json
index 49a8c44dbc..c0a6c50667 100644
--- a/translations/es.json
+++ b/translations/es.json
@@ -1,4 +1,5 @@
{
+ "": "",
"Add Layer As": "",
"button.login": "",
"catalog.figures.datasets": "conjuntos de datos",
@@ -217,9 +218,13 @@
"editor.record.form.field.onlineResource.confirm": "",
"editor.record.form.field.onlineResource.dialogTitle": "",
"editor.record.form.field.onlineResource.edit.description": "",
+ "editor.record.form.field.onlineResource.edit.protocol": "",
"editor.record.form.field.onlineResource.edit.title": "",
"editor.record.form.field.onlineResource.fileSize": "",
"editor.record.form.field.onlineResource.modify": "",
+ "editor.record.form.field.onlineResource.toggle.dataset": "",
+ "editor.record.form.field.onlineResource.toggle.service": "",
+ "editor.record.form.field.onlineResources": "",
"editor.record.form.field.overviews": "",
"editor.record.form.field.recordUpdated": "",
"editor.record.form.field.resourceUpdated": "",
@@ -242,6 +247,7 @@
"editor.record.form.page.ressources": "",
"editor.record.form.section.about.description": "",
"editor.record.form.section.about.label": "",
+ "editor.record.form.section.annexes.description": "",
"editor.record.form.section.annexes.label": "",
"editor.record.form.section.associatedResources.description": "",
"editor.record.form.section.associatedResources.label": "",
@@ -265,6 +271,7 @@
"editor.record.loadError.body": "",
"editor.record.loadError.closeMessage": "",
"editor.record.loadError.title": "",
+ "editor.record.onlineResource.protocol.other": "",
"editor.record.onlineResourceError.body": "",
"editor.record.onlineResourceError.closeMessage": "",
"editor.record.onlineResourceError.title": "",
diff --git a/translations/fr.json b/translations/fr.json
index 29b8281384..1198b1c383 100644
--- a/translations/fr.json
+++ b/translations/fr.json
@@ -1,4 +1,5 @@
{
+ "": "",
"Add Layer As": "",
"button.login": "Se connecter",
"catalog.figures.datasets": "{count, plural, =0{données} one{donnée} other{données}}",
@@ -217,9 +218,13 @@
"editor.record.form.field.onlineResource.confirm": "Valider",
"editor.record.form.field.onlineResource.dialogTitle": "Modifier l'aperçu de la ressource",
"editor.record.form.field.onlineResource.edit.description": "Description",
+ "editor.record.form.field.onlineResource.edit.protocol": "Protocole",
"editor.record.form.field.onlineResource.edit.title": "Titre",
"editor.record.form.field.onlineResource.fileSize": "{sizeMB} Mo",
"editor.record.form.field.onlineResource.modify": "Modifier",
+ "editor.record.form.field.onlineResource.toggle.dataset": "Lier un jeu de données",
+ "editor.record.form.field.onlineResource.toggle.service": "Lier un service",
+ "editor.record.form.field.onlineResources": "Distribution",
"editor.record.form.field.overviews": "Aperçus",
"editor.record.form.field.recordUpdated": "Date de dernière révision",
"editor.record.form.field.resourceUpdated": "Date de dernière révision",
@@ -242,8 +247,9 @@
"editor.record.form.page.ressources": "Ressources",
"editor.record.form.section.about.description": "Ces informations concernent la donnée.",
"editor.record.form.section.about.label": "À propos de la ressource",
+ "editor.record.form.section.annexes.description": "Les annexes sont optionnels. Ce sont des pièces jointes de la fiche de métadonnées qui peuvent aider à mieux comprendre la donnée (notice, etc.)",
"editor.record.form.section.annexes.label": "Annexes",
- "editor.record.form.section.associatedResources.description": "Déposez les jeux de données associées à cette fiche de métadonnées.",
+ "editor.record.form.section.associatedResources.description": "Liez des jeux de données ou des services associés à cette fiche de métadonnée.",
"editor.record.form.section.associatedResources.label": "Ressources associées",
"editor.record.form.section.classification.description": "La classification a un impact sur la recherche du jeu de données.",
"editor.record.form.section.classification.label": "Classification",
@@ -265,6 +271,7 @@
"editor.record.loadError.body": "La fiche n'a pas pu être chargée :",
"editor.record.loadError.closeMessage": "Compris",
"editor.record.loadError.title": "Erreur lors du chargement",
+ "editor.record.onlineResource.protocol.other": "Autre",
"editor.record.onlineResourceError.body": "Une erreur est survenue lors de l'ajout de la ressource :",
"editor.record.onlineResourceError.closeMessage": "Compris",
"editor.record.onlineResourceError.title": "Erreur lors de l'ajout d'une ressource",
diff --git a/translations/it.json b/translations/it.json
index 55080f29f2..a5c3b93f39 100644
--- a/translations/it.json
+++ b/translations/it.json
@@ -1,4 +1,5 @@
{
+ "": "",
"Add Layer As": "",
"button.login": "",
"catalog.figures.datasets": "{count, plural, =0{datasets} one{dataset} other{datasets}}",
@@ -217,9 +218,13 @@
"editor.record.form.field.onlineResource.confirm": "",
"editor.record.form.field.onlineResource.dialogTitle": "",
"editor.record.form.field.onlineResource.edit.description": "",
+ "editor.record.form.field.onlineResource.edit.protocol": "",
"editor.record.form.field.onlineResource.edit.title": "",
"editor.record.form.field.onlineResource.fileSize": "",
"editor.record.form.field.onlineResource.modify": "",
+ "editor.record.form.field.onlineResource.toggle.dataset": "",
+ "editor.record.form.field.onlineResource.toggle.service": "",
+ "editor.record.form.field.onlineResources": "",
"editor.record.form.field.overviews": "",
"editor.record.form.field.recordUpdated": "",
"editor.record.form.field.resourceUpdated": "",
@@ -242,6 +247,7 @@
"editor.record.form.page.ressources": "",
"editor.record.form.section.about.description": "",
"editor.record.form.section.about.label": "",
+ "editor.record.form.section.annexes.description": "",
"editor.record.form.section.annexes.label": "",
"editor.record.form.section.associatedResources.description": "",
"editor.record.form.section.associatedResources.label": "",
@@ -265,6 +271,7 @@
"editor.record.loadError.body": "",
"editor.record.loadError.closeMessage": "",
"editor.record.loadError.title": "",
+ "editor.record.onlineResource.protocol.other": "",
"editor.record.onlineResourceError.body": "",
"editor.record.onlineResourceError.closeMessage": "",
"editor.record.onlineResourceError.title": "",
diff --git a/translations/nl.json b/translations/nl.json
index 1174781c78..3f8cf3fb7c 100644
--- a/translations/nl.json
+++ b/translations/nl.json
@@ -1,4 +1,5 @@
{
+ "": "",
"Add Layer As": "",
"button.login": "",
"catalog.figures.datasets": "datasets",
@@ -217,9 +218,13 @@
"editor.record.form.field.onlineResource.confirm": "",
"editor.record.form.field.onlineResource.dialogTitle": "",
"editor.record.form.field.onlineResource.edit.description": "",
+ "editor.record.form.field.onlineResource.edit.protocol": "",
"editor.record.form.field.onlineResource.edit.title": "",
"editor.record.form.field.onlineResource.fileSize": "",
"editor.record.form.field.onlineResource.modify": "",
+ "editor.record.form.field.onlineResource.toggle.dataset": "",
+ "editor.record.form.field.onlineResource.toggle.service": "",
+ "editor.record.form.field.onlineResources": "",
"editor.record.form.field.overviews": "",
"editor.record.form.field.recordUpdated": "",
"editor.record.form.field.resourceUpdated": "",
@@ -242,6 +247,7 @@
"editor.record.form.page.ressources": "",
"editor.record.form.section.about.description": "",
"editor.record.form.section.about.label": "",
+ "editor.record.form.section.annexes.description": "",
"editor.record.form.section.annexes.label": "",
"editor.record.form.section.associatedResources.description": "",
"editor.record.form.section.associatedResources.label": "",
@@ -265,6 +271,7 @@
"editor.record.loadError.body": "",
"editor.record.loadError.closeMessage": "",
"editor.record.loadError.title": "",
+ "editor.record.onlineResource.protocol.other": "",
"editor.record.onlineResourceError.body": "",
"editor.record.onlineResourceError.closeMessage": "",
"editor.record.onlineResourceError.title": "",
diff --git a/translations/pt.json b/translations/pt.json
index bb817d78a3..89d4ddc0c3 100644
--- a/translations/pt.json
+++ b/translations/pt.json
@@ -1,4 +1,5 @@
{
+ "": "",
"Add Layer As": "",
"button.login": "",
"catalog.figures.datasets": "conjuntos de dados",
@@ -217,9 +218,13 @@
"editor.record.form.field.onlineResource.confirm": "",
"editor.record.form.field.onlineResource.dialogTitle": "",
"editor.record.form.field.onlineResource.edit.description": "",
+ "editor.record.form.field.onlineResource.edit.protocol": "",
"editor.record.form.field.onlineResource.edit.title": "",
"editor.record.form.field.onlineResource.fileSize": "",
"editor.record.form.field.onlineResource.modify": "",
+ "editor.record.form.field.onlineResource.toggle.dataset": "",
+ "editor.record.form.field.onlineResource.toggle.service": "",
+ "editor.record.form.field.onlineResources": "",
"editor.record.form.field.overviews": "",
"editor.record.form.field.recordUpdated": "",
"editor.record.form.field.resourceUpdated": "",
@@ -242,6 +247,7 @@
"editor.record.form.page.ressources": "",
"editor.record.form.section.about.description": "",
"editor.record.form.section.about.label": "",
+ "editor.record.form.section.annexes.description": "",
"editor.record.form.section.annexes.label": "",
"editor.record.form.section.associatedResources.description": "",
"editor.record.form.section.associatedResources.label": "",
@@ -265,6 +271,7 @@
"editor.record.loadError.body": "",
"editor.record.loadError.closeMessage": "",
"editor.record.loadError.title": "",
+ "editor.record.onlineResource.protocol.other": "",
"editor.record.onlineResourceError.body": "",
"editor.record.onlineResourceError.closeMessage": "",
"editor.record.onlineResourceError.title": "",
diff --git a/translations/sk.json b/translations/sk.json
index 51f07aff9d..7af8363d38 100644
--- a/translations/sk.json
+++ b/translations/sk.json
@@ -1,4 +1,5 @@
{
+ "": "",
"Add Layer As": "",
"button.login": "",
"catalog.figures.datasets": "{count, plural, =0{datasety} one{dataset} other{datasety}}",
@@ -217,9 +218,13 @@
"editor.record.form.field.onlineResource.confirm": "",
"editor.record.form.field.onlineResource.dialogTitle": "",
"editor.record.form.field.onlineResource.edit.description": "",
+ "editor.record.form.field.onlineResource.edit.protocol": "",
"editor.record.form.field.onlineResource.edit.title": "",
"editor.record.form.field.onlineResource.fileSize": "",
"editor.record.form.field.onlineResource.modify": "",
+ "editor.record.form.field.onlineResource.toggle.dataset": "",
+ "editor.record.form.field.onlineResource.toggle.service": "",
+ "editor.record.form.field.onlineResources": "",
"editor.record.form.field.overviews": "",
"editor.record.form.field.recordUpdated": "",
"editor.record.form.field.resourceUpdated": "",
@@ -242,6 +247,7 @@
"editor.record.form.page.ressources": "",
"editor.record.form.section.about.description": "",
"editor.record.form.section.about.label": "",
+ "editor.record.form.section.annexes.description": "",
"editor.record.form.section.annexes.label": "",
"editor.record.form.section.associatedResources.description": "",
"editor.record.form.section.associatedResources.label": "",
@@ -265,6 +271,7 @@
"editor.record.loadError.body": "",
"editor.record.loadError.closeMessage": "",
"editor.record.loadError.title": "",
+ "editor.record.onlineResource.protocol.other": "",
"editor.record.onlineResourceError.body": "",
"editor.record.onlineResourceError.closeMessage": "",
"editor.record.onlineResourceError.title": "",