@tekkare/romulus 0.1.294 → 0.1.295

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/module.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "compatibility": {
5
5
  "nuxt": ">=3.16.0"
6
6
  },
7
- "version": "0.1.293",
7
+ "version": "0.1.294",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "0.8.4",
10
10
  "unbuild": "2.0.0"
@@ -18,10 +18,16 @@ import * as appAlerts from "#oip-app/alerts";
18
18
 
19
19
  const BRAND_SOURCES_KEY = "BRAND_ALERT_SOURCES";
20
20
 
21
- /** Les index des alertes de produit de l'app, ou rien (ceux du hub). */
21
+ /**
22
+ * Les index des alertes de produit de l'app, ou rien (ceux du hub). Le moteur
23
+ * d'alertes interroge Elasticsearch par NOM : un id Directus du catalogue est
24
+ * traduit ici, comme l'index d'une alerte de vue (cf. useAlertSource).
25
+ */
22
26
  function appBrandSources(): unknown[] | undefined {
23
27
  const sources = (appAlerts as Record<string, unknown>)[BRAND_SOURCES_KEY];
24
- return Array.isArray(sources) && sources.length ? sources : undefined;
28
+ if (!Array.isArray(sources) || !sources.length) return undefined;
29
+ const { nameOf } = useOipEsIndices();
30
+ return sources.map((entry) => ({ ...entry, index: nameOf(String(entry?.index ?? "")) }));
25
31
  }
26
32
 
27
33
  export function useAlerts() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tekkare/romulus",
3
- "version": "0.1.294",
3
+ "version": "0.1.295",
4
4
  "description": "Romulus Design System - Nuxt module by Tekkare",
5
5
  "license": "MIT",
6
6
  "type": "module",