@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
|
@@ -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
|
-
/**
|
|
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
|
-
|
|
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() {
|