@cccsaurora/howler-ui 2.17.0-dev.420 → 2.17.0-dev.473
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/commons/components/app/hooks/useAppConfigs.d.ts +1 -1
- package/components/app/providers/HitSearchProvider.d.ts +0 -1
- package/components/app/providers/HitSearchProvider.js +4 -6
- package/components/app/providers/HitSearchProvider.test.js +1 -1
- package/components/app/providers/ParameterProvider.js +3 -3
- package/components/app/providers/ViewProvider.d.ts +1 -1
- package/components/app/providers/ViewProvider.js +3 -6
- package/components/app/providers/ViewProvider.test.js +1 -1
- package/components/elements/PluginChip.d.ts +2 -0
- package/components/elements/PluginChip.js +2 -1
- package/components/elements/PluginTypography.d.ts +4 -3
- package/components/elements/PluginTypography.js +4 -3
- package/components/elements/display/modals/RationaleModal.js +1 -1
- package/components/elements/display/modals/RationaleModal.test.js +1 -1
- package/components/elements/hit/HitBanner.js +2 -2
- package/components/elements/hit/HitDetails.js +9 -9
- package/components/elements/hit/outlines/DefaultOutline.js +1 -1
- package/components/routes/hits/search/ViewLink.js +1 -1
- package/components/routes/hits/search/ViewLink.test.js +3 -3
- package/components/routes/hits/search/grid/EnhancedCell.d.ts +2 -0
- package/components/routes/hits/search/grid/EnhancedCell.js +2 -2
- package/components/routes/hits/search/grid/HitRow.js +1 -1
- package/components/routes/views/ViewComposer.js +2 -2
- package/index.js +5 -0
- package/locales/en/translation.json +1 -0
- package/locales/fr/translation.json +1 -0
- package/models/entities/generated/Analytic.d.ts +2 -2
- package/models/entities/generated/ApiType.d.ts +2 -1
- package/models/entities/generated/Clue.d.ts +8 -0
- package/models/entities/generated/Hit.d.ts +2 -20
- package/models/entities/generated/Labels.d.ts +1 -0
- package/models/entities/generated/Type.d.ts +7 -0
- package/package.json +135 -126
- package/plugins/HowlerPlugin.js +1 -0
- package/plugins/clue/Provider.d.ts +3 -0
- package/plugins/clue/Provider.js +13 -0
- package/plugins/clue/components/ClueChip.d.ts +3 -0
- package/plugins/clue/components/ClueChip.js +29 -0
- package/plugins/clue/components/ClueLeadForm.d.ts +4 -0
- package/plugins/clue/components/ClueLeadForm.js +24 -0
- package/plugins/clue/components/CluePivot.d.ts +3 -0
- package/plugins/clue/components/CluePivot.js +145 -0
- package/plugins/clue/components/CluePivotForm.d.ts +21 -0
- package/plugins/clue/components/CluePivotForm.js +270 -0
- package/plugins/clue/components/ClueTypography.d.ts +3 -0
- package/plugins/clue/components/ClueTypography.js +53 -0
- package/plugins/clue/helpers.d.ts +3 -0
- package/plugins/clue/helpers.js +196 -0
- package/plugins/clue/index.d.ts +21 -0
- package/plugins/clue/index.js +66 -0
- package/plugins/clue/locales/clue.en.json +8 -0
- package/plugins/clue/locales/clue.fr.json +8 -0
- package/plugins/clue/setup.d.ts +2 -0
- package/plugins/clue/setup.js +46 -0
- package/plugins/clue/utils.d.ts +2 -0
- package/plugins/clue/utils.js +19 -0
- package/plugins/store.js +3 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
{
|
|
2
|
+
"markdown.helpers.clue.arguments": "Vous devez fournir au moins deux arguments : type et valeur.",
|
|
3
|
+
"route.dossiers.manager.clue": "ID du sélecteur Clue",
|
|
4
|
+
"route.dossiers.manager.clue.type": "Type de sélecteur",
|
|
5
|
+
"route.dossiers.manager.clue.value": "Valeur du sélecteur",
|
|
6
|
+
"route.dossiers.manager.clue.value.custom": "Valeur du sélecteur personnalisé",
|
|
7
|
+
"route.dossiers.manager.clue.value.description": "Vous pouvez utiliser la notation « handlebars » pour insérer des champs à partir de l'alerte correspondante (c'est-à-dire {{howler.id}})."
|
|
8
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { SNACKBAR_EVENT_ID } from '@cccsaurora/clue-ui/data/event';
|
|
2
|
+
import useClue from '@cccsaurora/clue-ui/hooks/useClue';
|
|
3
|
+
import { useAppUser } from '@cccsaurora/howler-ui/commons/components/app/hooks/useAppUser';
|
|
4
|
+
import { ApiConfigContext } from '@cccsaurora/howler-ui/components/app/providers/ApiConfigProvider';
|
|
5
|
+
import useMySnackbar from '@cccsaurora/howler-ui/components/hooks/useMySnackbar';
|
|
6
|
+
import { useContext, useEffect } from 'react';
|
|
7
|
+
const useSetup = () => {
|
|
8
|
+
const clue = useClue();
|
|
9
|
+
const appUser = useAppUser();
|
|
10
|
+
const { config } = useContext(ApiConfigContext);
|
|
11
|
+
const { showSuccessMessage, showErrorMessage, showInfoMessage, showWarningMessage } = useMySnackbar();
|
|
12
|
+
const features = config.configuration?.features ?? {};
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
// eslint-disable-next-line no-console
|
|
15
|
+
console.debug('Initializing clue snackbar event handler');
|
|
16
|
+
const handleMessage = (event) => {
|
|
17
|
+
const { detail } = event;
|
|
18
|
+
if (detail.level === 'success') {
|
|
19
|
+
showSuccessMessage(detail.message, detail.timeout, detail.options);
|
|
20
|
+
}
|
|
21
|
+
else if (detail.level === 'error') {
|
|
22
|
+
showErrorMessage(detail.message, detail.timeout, detail.options);
|
|
23
|
+
}
|
|
24
|
+
else if (detail.level === 'info') {
|
|
25
|
+
showInfoMessage(detail.message, detail.timeout, detail.options);
|
|
26
|
+
}
|
|
27
|
+
else if (detail.level === 'warning') {
|
|
28
|
+
showWarningMessage(detail.message, detail.timeout, detail.options);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
window.addEventListener(SNACKBAR_EVENT_ID, handleMessage);
|
|
32
|
+
return () => {
|
|
33
|
+
window.removeEventListener(SNACKBAR_EVENT_ID, handleMessage);
|
|
34
|
+
};
|
|
35
|
+
}, [showErrorMessage, showInfoMessage, showSuccessMessage, showWarningMessage]);
|
|
36
|
+
useEffect(() => {
|
|
37
|
+
if (!appUser.isReady()) {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
if (features.borealis || features.clue) {
|
|
41
|
+
clue.setReady(true);
|
|
42
|
+
}
|
|
43
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
44
|
+
}, [features, appUser.isReady()]);
|
|
45
|
+
};
|
|
46
|
+
export default useSetup;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { useClueEnrichSelector } from '@cccsaurora/clue-ui';
|
|
2
|
+
import { ApiConfigContext } from '@cccsaurora/howler-ui/components/app/providers/ApiConfigProvider';
|
|
3
|
+
import { useContext } from 'react';
|
|
4
|
+
export const useType = (hit, field, value) => {
|
|
5
|
+
const guessType = useClueEnrichSelector(ctx => ctx.guessType);
|
|
6
|
+
const { config } = useContext(ApiConfigContext);
|
|
7
|
+
const typeFromHit = hit?.clue?.types?.find(mapping => mapping.field === field)?.type;
|
|
8
|
+
if (typeFromHit) {
|
|
9
|
+
return typeFromHit;
|
|
10
|
+
}
|
|
11
|
+
const typeFromConfig = config.configuration?.mapping?.[field];
|
|
12
|
+
if (typeFromConfig) {
|
|
13
|
+
return typeFromConfig;
|
|
14
|
+
}
|
|
15
|
+
if (value) {
|
|
16
|
+
return guessType(value.toString());
|
|
17
|
+
}
|
|
18
|
+
return null;
|
|
19
|
+
};
|
package/plugins/store.js
CHANGED
|
@@ -24,6 +24,9 @@ class HowlerPluginStore {
|
|
|
24
24
|
_routes = [];
|
|
25
25
|
_sitemaps = [];
|
|
26
26
|
install(plugin) {
|
|
27
|
+
if (this.plugins.includes(plugin.name)) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
27
30
|
console.log(`Installing plugin ${plugin.getPluginName()} by ${plugin.author}`);
|
|
28
31
|
this.plugins.push(plugin.name);
|
|
29
32
|
this.pluginStore.install(plugin);
|