{
beforeEach(async () => {
await TestBed.configureTestingModule({
- declarations: [BadgeComponent],
+ imports: [BadgeComponent],
}).compileComponents()
})
diff --git a/libs/ui/widgets/src/lib/badge/badge.component.stories.ts b/libs/ui/widgets/src/lib/badge/badge.component.stories.ts
index b8ad87d651..15a01fb421 100644
--- a/libs/ui/widgets/src/lib/badge/badge.component.stories.ts
+++ b/libs/ui/widgets/src/lib/badge/badge.component.stories.ts
@@ -1,10 +1,15 @@
-import { componentWrapperDecorator, Meta, StoryObj } from '@storybook/angular'
+import { Meta, moduleMetadata, StoryObj } from '@storybook/angular'
import { BadgeComponent } from './badge.component'
+import { MatIconModule } from '@angular/material/icon'
export default {
title: 'Widgets/BadgeComponent',
component: BadgeComponent,
- decorators: [componentWrapperDecorator(BadgeComponent)],
+ decorators: [
+ moduleMetadata({
+ imports: [MatIconModule],
+ }),
+ ],
} as Meta
interface BadgeComponentContent extends Partial {
@@ -13,11 +18,35 @@ interface BadgeComponentContent extends Partial {
export const Primary: StoryObj = {
args: {
- clickable: true,
+ clickable: false,
content: 'My custom badge',
},
render: (args) => ({
props: args,
- template: `{{content}}`,
+ template: `
+
+ {{ content }}
+
+
+ with an icon downloading
+
+
+ pest_control larger (with css)
+
+
+ different waves shape
+
+
+ different corners
+
+
+ different colors
+
+
`,
}),
}
diff --git a/libs/ui/widgets/src/lib/badge/badge.component.ts b/libs/ui/widgets/src/lib/badge/badge.component.ts
index 8d78ac1b34..cd2525068e 100644
--- a/libs/ui/widgets/src/lib/badge/badge.component.ts
+++ b/libs/ui/widgets/src/lib/badge/badge.component.ts
@@ -1,11 +1,14 @@
import { ChangeDetectionStrategy, Component, Input } from '@angular/core'
+import { CommonModule } from '@angular/common'
@Component({
selector: 'gn-ui-badge',
templateUrl: './badge.component.html',
styleUrls: ['./badge.component.css'],
changeDetection: ChangeDetectionStrategy.OnPush,
+ standalone: true,
+ imports: [CommonModule],
})
export class BadgeComponent {
- @Input() clickable? = false
+ @Input() clickable = false
}
diff --git a/libs/ui/widgets/src/lib/ui-widgets.module.ts b/libs/ui/widgets/src/lib/ui-widgets.module.ts
index eda41bebf8..ab7cfa8db1 100644
--- a/libs/ui/widgets/src/lib/ui-widgets.module.ts
+++ b/libs/ui/widgets/src/lib/ui-widgets.module.ts
@@ -10,7 +10,6 @@ import { FormsModule, ReactiveFormsModule } from '@angular/forms'
import { LoadingMaskComponent } from './loading-mask/loading-mask.component'
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'
import { PopupAlertComponent } from './popup-alert/popup-alert.component'
-import { BadgeComponent } from './badge/badge.component'
import { MatIconModule } from '@angular/material/icon'
import { SpinningLoaderComponent } from './spinning-loader/spinning-loader.component'
import { CommonModule } from '@angular/common'
@@ -22,7 +21,6 @@ import { CommonModule } from '@angular/common'
StepBarComponent,
LoadingMaskComponent,
PopupAlertComponent,
- BadgeComponent,
SpinningLoaderComponent,
],
imports: [
@@ -41,7 +39,6 @@ import { CommonModule } from '@angular/common'
StepBarComponent,
LoadingMaskComponent,
PopupAlertComponent,
- BadgeComponent,
SpinningLoaderComponent,
],
})
diff --git a/tailwind.base.css b/tailwind.base.css
index 016e4d3f4f..ee9c093999 100644
--- a/tailwind.base.css
+++ b/tailwind.base.css
@@ -104,7 +104,27 @@
border border-white focus:ring-4 focus:ring-gray-300;
}
- /* TODO: add prefix */
+ /* BADGE CLASS */
+ .gn-ui-badge {
+ --rounded: var(--gn-ui-badge-rounded, 0.25em);
+ --padding: var(--gn-ui-badge-padding, 0.375em 0.75em);
+ --text-color: var(--gn-ui-badge-text-color, var(--color-gray-50));
+ --background-color: var(--gn-ui-badge-background-color, black);
+ @apply inline-block opacity-70 p-[--padding] rounded-[--rounded]
+ font-medium text-[length:0.875em] leading-none text-[color:--text-color] bg-[color:--background-color];
+ }
+ /* makes sure icons will not make the badges grow vertically; also make size proportional */
+ .gn-ui-badge mat-icon.mat-icon {
+ margin-top: -0.325em;
+ margin-bottom: -0.325em;
+ flex-shrink: 0;
+ vertical-align: middle;
+ font-size: 1.4em;
+ width: 1em;
+ height: 1em;
+ }
+
+ /* TODO: replace by gn-ui-badge class above */
.badge-btn {
@apply flex items-center justify-center px-4 py-1 text-white rounded backdrop-blur;
}
diff --git a/translations/de.json b/translations/de.json
index 5a5e80f3f9..822d224de6 100644
--- a/translations/de.json
+++ b/translations/de.json
@@ -20,6 +20,7 @@
"dashboard.createRecord": "Neuer Eintrag",
"dashboard.labels.mySpace": "Mein Bereich",
"dashboard.records.all": "Katalog",
+ "dashboard.records.hasDraft": "",
"dashboard.records.myDraft": "Meine Entwürfe",
"dashboard.records.myLibrary": "Meine Bibliothek",
"dashboard.records.myOrg": "Meine Organisation",
@@ -167,6 +168,9 @@
"editor.record.publishError.title": "",
"editor.record.publishSuccess.body": "",
"editor.record.publishSuccess.title": "",
+ "editor.record.saveStatus.asDraftOnly": "",
+ "editor.record.saveStatus.draftWithChangesPending": "",
+ "editor.record.saveStatus.recordUpToDate": "",
"editor.record.upToDate": "",
"externalviewer.dataset.unnamed": "Datensatz aus dem Datahub",
"facets.block.title.OrgForResource": "Organisation",
@@ -334,8 +338,8 @@
"search.autocomplete.error": "Vorschläge konnten nicht abgerufen werden:",
"search.error.couldNotReachApi": "Die API konnte nicht erreicht werden",
"search.error.receivedError": "Ein Fehler ist aufgetreten",
- "search.error.recordNotFound": "Der Datensatz mit der Kennung \"{ id }\" konnte nicht gefunden werden.",
"search.error.recordHasnolink": "",
+ "search.error.recordNotFound": "Der Datensatz mit der Kennung \"{ id }\" konnte nicht gefunden werden.",
"search.field.any.placeholder": "Suche Datensätze ...",
"search.field.sortBy": "Sortieren nach:",
"search.filters.clear": "Zurücksetzen",
diff --git a/translations/en.json b/translations/en.json
index 0e038a84f8..53e231e70e 100644
--- a/translations/en.json
+++ b/translations/en.json
@@ -20,6 +20,7 @@
"dashboard.createRecord": "New record",
"dashboard.labels.mySpace": "My space",
"dashboard.records.all": "Metadata records",
+ "dashboard.records.hasDraft": "draft",
"dashboard.records.myDraft": "My drafts",
"dashboard.records.myLibrary": "My library",
"dashboard.records.myOrg": "Organization",
@@ -167,6 +168,9 @@
"editor.record.publishError.title": "Error publishing record",
"editor.record.publishSuccess.body": "The record was successfully published!",
"editor.record.publishSuccess.title": "Publish success",
+ "editor.record.saveStatus.asDraftOnly": "Saved as draft only - not published yet",
+ "editor.record.saveStatus.draftWithChangesPending": "Saved as draft - changes are pending",
+ "editor.record.saveStatus.recordUpToDate": "Record is up to date",
"editor.record.upToDate": "This record is up to date",
"externalviewer.dataset.unnamed": "Datahub layer",
"facets.block.title.OrgForResource": "Organisation",
@@ -334,8 +338,8 @@
"search.autocomplete.error": "Suggestions could not be fetched:",
"search.error.couldNotReachApi": "The API could not be reached",
"search.error.receivedError": "An error was received",
- "search.error.recordNotFound": "The record with identifier \"{ id }\" could not be found.",
"search.error.recordHasnolink": "This record currently has no link yet, please come back later.",
+ "search.error.recordNotFound": "The record with identifier \"{ id }\" could not be found.",
"search.field.any.placeholder": "Search datasets ...",
"search.field.sortBy": "Sort by:",
"search.filters.clear": "Reset",
diff --git a/translations/es.json b/translations/es.json
index efbc8c4b50..384aa3cba3 100644
--- a/translations/es.json
+++ b/translations/es.json
@@ -20,6 +20,7 @@
"dashboard.createRecord": "",
"dashboard.labels.mySpace": "Mi espacio",
"dashboard.records.all": "Catálogo",
+ "dashboard.records.hasDraft": "",
"dashboard.records.myDraft": "Mis borradores",
"dashboard.records.myLibrary": "Mi biblioteca",
"dashboard.records.myOrg": "Organización",
@@ -167,6 +168,9 @@
"editor.record.publishError.title": "",
"editor.record.publishSuccess.body": "",
"editor.record.publishSuccess.title": "",
+ "editor.record.saveStatus.asDraftOnly": "",
+ "editor.record.saveStatus.draftWithChangesPending": "",
+ "editor.record.saveStatus.recordUpToDate": "",
"editor.record.upToDate": "",
"externalviewer.dataset.unnamed": "",
"facets.block.title.OrgForResource": "",
@@ -334,8 +338,8 @@
"search.autocomplete.error": "",
"search.error.couldNotReachApi": "",
"search.error.receivedError": "",
- "search.error.recordNotFound": "",
"search.error.recordHasnolink": "",
+ "search.error.recordNotFound": "",
"search.field.any.placeholder": "",
"search.field.sortBy": "",
"search.filters.clear": "",
diff --git a/translations/fr.json b/translations/fr.json
index debb06f6fb..8dc865f38f 100644
--- a/translations/fr.json
+++ b/translations/fr.json
@@ -20,6 +20,7 @@
"dashboard.createRecord": "Nouvel enregistrement",
"dashboard.labels.mySpace": "Mon espace",
"dashboard.records.all": "Catalogue",
+ "dashboard.records.hasDraft": "brouillon",
"dashboard.records.myDraft": "Mes brouillons",
"dashboard.records.myLibrary": "Ma bibliothèque",
"dashboard.records.myOrg": "Mon organisation",
@@ -167,6 +168,9 @@
"editor.record.publishError.title": "",
"editor.record.publishSuccess.body": "",
"editor.record.publishSuccess.title": "",
+ "editor.record.saveStatus.asDraftOnly": "Brouillon enregistré - fiche non publiée",
+ "editor.record.saveStatus.draftWithChangesPending": "Brouillon enregistré - modifications en cours",
+ "editor.record.saveStatus.recordUpToDate": "La fiche publiée est à jour",
"editor.record.upToDate": "",
"externalviewer.dataset.unnamed": "Couche du datahub",
"facets.block.title.OrgForResource": "Organisation",
@@ -334,8 +338,8 @@
"search.autocomplete.error": "Les suggestions ne peuvent pas être récupérées",
"search.error.couldNotReachApi": "Problème de connexion à l'API",
"search.error.receivedError": "Erreur retournée",
- "search.error.recordNotFound": "Cette donnée n'a pu être trouvée.",
"search.error.recordHasnolink": "Ce dataset n'a pas encore de lien, réessayez plus tard s'il vous plaît.",
+ "search.error.recordNotFound": "Cette donnée n'a pu être trouvée.",
"search.field.any.placeholder": "Rechercher une donnée...",
"search.field.sortBy": "Trier par :",
"search.filters.clear": "Réinitialiser",
diff --git a/translations/it.json b/translations/it.json
index 209c87ab2e..34ec4c3674 100644
--- a/translations/it.json
+++ b/translations/it.json
@@ -20,6 +20,7 @@
"dashboard.createRecord": "Crea un record",
"dashboard.labels.mySpace": "Il mio spazio",
"dashboard.records.all": "Catalogo",
+ "dashboard.records.hasDraft": "",
"dashboard.records.myDraft": "Le mie bozze",
"dashboard.records.myLibrary": "La mia biblioteca",
"dashboard.records.myOrg": "La mia organizzazione",
@@ -167,6 +168,9 @@
"editor.record.publishError.title": "",
"editor.record.publishSuccess.body": "",
"editor.record.publishSuccess.title": "",
+ "editor.record.saveStatus.asDraftOnly": "",
+ "editor.record.saveStatus.draftWithChangesPending": "",
+ "editor.record.saveStatus.recordUpToDate": "",
"editor.record.upToDate": "",
"externalviewer.dataset.unnamed": "Layer del datahub",
"facets.block.title.OrgForResource": "Organizzazione",
@@ -334,8 +338,8 @@
"search.autocomplete.error": "Impossibile recuperare le suggerimenti",
"search.error.couldNotReachApi": "Problema di connessione all'API",
"search.error.receivedError": "Errore ricevuto",
- "search.error.recordNotFound": "Impossibile trovare questo dato",
"search.error.recordHasnolink": "",
+ "search.error.recordNotFound": "Impossibile trovare questo dato",
"search.field.any.placeholder": "Cerca un dato...",
"search.field.sortBy": "Ordina per:",
"search.filters.clear": "Ripristina",
diff --git a/translations/nl.json b/translations/nl.json
index 424abeffc5..98078f8718 100644
--- a/translations/nl.json
+++ b/translations/nl.json
@@ -20,6 +20,7 @@
"dashboard.createRecord": "",
"dashboard.labels.mySpace": "Mijn ruimte",
"dashboard.records.all": "Catalogus",
+ "dashboard.records.hasDraft": "",
"dashboard.records.myDraft": "Mijn concepten",
"dashboard.records.myLibrary": "Mijn bibliotheek",
"dashboard.records.myOrg": "Organisatie",
@@ -167,6 +168,9 @@
"editor.record.publishError.title": "",
"editor.record.publishSuccess.body": "",
"editor.record.publishSuccess.title": "",
+ "editor.record.saveStatus.asDraftOnly": "",
+ "editor.record.saveStatus.draftWithChangesPending": "",
+ "editor.record.saveStatus.recordUpToDate": "",
"editor.record.upToDate": "",
"externalviewer.dataset.unnamed": "",
"facets.block.title.OrgForResource": "",
@@ -334,8 +338,8 @@
"search.autocomplete.error": "",
"search.error.couldNotReachApi": "",
"search.error.receivedError": "",
- "search.error.recordNotFound": "",
"search.error.recordHasnolink": "",
+ "search.error.recordNotFound": "",
"search.field.any.placeholder": "",
"search.field.sortBy": "",
"search.filters.clear": "",
diff --git a/translations/pt.json b/translations/pt.json
index 9ec6b6be38..46a680eb6e 100644
--- a/translations/pt.json
+++ b/translations/pt.json
@@ -20,6 +20,7 @@
"dashboard.createRecord": "",
"dashboard.labels.mySpace": "Meu espaço",
"dashboard.records.all": "Catálogo",
+ "dashboard.records.hasDraft": "",
"dashboard.records.myDraft": "Meus rascunhos",
"dashboard.records.myLibrary": "Minha biblioteca",
"dashboard.records.myOrg": "Organização",
@@ -167,6 +168,9 @@
"editor.record.publishError.title": "",
"editor.record.publishSuccess.body": "",
"editor.record.publishSuccess.title": "",
+ "editor.record.saveStatus.asDraftOnly": "",
+ "editor.record.saveStatus.draftWithChangesPending": "",
+ "editor.record.saveStatus.recordUpToDate": "",
"editor.record.upToDate": "",
"externalviewer.dataset.unnamed": "",
"facets.block.title.OrgForResource": "",
@@ -334,8 +338,8 @@
"search.autocomplete.error": "",
"search.error.couldNotReachApi": "",
"search.error.receivedError": "",
- "search.error.recordNotFound": "",
"search.error.recordHasnolink": "",
+ "search.error.recordNotFound": "",
"search.field.any.placeholder": "",
"search.field.sortBy": "",
"search.filters.clear": "",
diff --git a/translations/sk.json b/translations/sk.json
index b7a103afe4..02131776ed 100644
--- a/translations/sk.json
+++ b/translations/sk.json
@@ -20,6 +20,7 @@
"dashboard.createRecord": "",
"dashboard.labels.mySpace": "Môj priestor",
"dashboard.records.all": "Katalóg",
+ "dashboard.records.hasDraft": "",
"dashboard.records.myDraft": "Moje koncepty",
"dashboard.records.myLibrary": "Moja knižnica",
"dashboard.records.myOrg": "Organizácia",
@@ -167,6 +168,9 @@
"editor.record.publishError.title": "",
"editor.record.publishSuccess.body": "",
"editor.record.publishSuccess.title": "",
+ "editor.record.saveStatus.asDraftOnly": "",
+ "editor.record.saveStatus.draftWithChangesPending": "",
+ "editor.record.saveStatus.recordUpToDate": "",
"editor.record.upToDate": "",
"externalviewer.dataset.unnamed": "",
"facets.block.title.OrgForResource": "Organizácia",
@@ -334,8 +338,8 @@
"search.autocomplete.error": "Návrhy sa nepodarilo načítať:",
"search.error.couldNotReachApi": "K rozhraniu API sa nepodarilo pripojiť",
"search.error.receivedError": "Bola zaznamenaná chyba",
- "search.error.recordNotFound": "Záznam s identifikátorom \"{ id }\" sa nepodarilo nájsť.",
"search.error.recordHasnolink": "",
+ "search.error.recordNotFound": "Záznam s identifikátorom \"{ id }\" sa nepodarilo nájsť.",
"search.field.any.placeholder": "Hľadať datasety ...",
"search.field.sortBy": "Zoradiť podľa:",
"search.filters.clear": "Obnoviť",