@leav/ui 1.5.1-8082bc38 → 1.5.1-8967454c
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.
|
@@ -55,7 +55,7 @@ export const useExportMassAction = ({ isEnabled, store: { view, dispatch }, tota
|
|
|
55
55
|
throw errorWithExtensions;
|
|
56
56
|
}
|
|
57
57
|
kitNotification.info({
|
|
58
|
-
message: t('explorer.massAction.export_message'
|
|
58
|
+
message: t('explorer.massAction.export_message'),
|
|
59
59
|
description: t('explorer.massAction.export_description', {
|
|
60
60
|
count: total,
|
|
61
61
|
total,
|
|
@@ -69,10 +69,8 @@ export const useExportMassAction = ({ isEnabled, store: { view, dispatch }, tota
|
|
|
69
69
|
KitAlert.error({
|
|
70
70
|
showIcon: true,
|
|
71
71
|
duration: ERROR_ALERT_DURATION,
|
|
72
|
-
message: t('
|
|
73
|
-
description: t('explorer.massAction.export_config_error_description',
|
|
74
|
-
library: view.libraryId,
|
|
75
|
-
}),
|
|
72
|
+
message: t('explorer.massAction.export_config_error_message'),
|
|
73
|
+
description: t('explorer.massAction.export_config_error_description'),
|
|
76
74
|
closable: true,
|
|
77
75
|
});
|
|
78
76
|
}
|
|
@@ -80,7 +78,7 @@ export const useExportMassAction = ({ isEnabled, store: { view, dispatch }, tota
|
|
|
80
78
|
KitAlert.error({
|
|
81
79
|
showIcon: true,
|
|
82
80
|
duration: ERROR_ALERT_DURATION,
|
|
83
|
-
message: t('
|
|
81
|
+
message: t('explorer.massAction.export_error_message'),
|
|
84
82
|
description: t('explorer.massAction.export_error_description', { count: total }),
|
|
85
83
|
closable: true,
|
|
86
84
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useExportMassAction.js","sourceRoot":"","sources":["../../../../src/components/Explorer/actions-mass/useExportMassAction.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAgB,OAAO,EAAC,MAAM,OA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ACzD,CAAC;AACN,CAAC,CAAC","sourcesContent":["// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06\n// This file is released under LGPL V3\n// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt\nimport {type Dispatch, useMemo} from 'react';\nimport {FaFileExport} from 'react-icons/fa';\nimport {KitAlert, KitModal, useKitNotification} from 'aristid-ds';\nimport {useExportLazyQuery} from '_ui/_gqlTypes';\nimport {useSharedTranslation} from '_ui/hooks/useSharedTranslation';\nimport {type FeatureHook, type IMassActions} from '../_types';\nimport {type IViewSettingsAction, type IViewSettingsState} from '../manage-view-settings';\nimport {BREAK_TWO_LINES, MASS_SELECTION_ALL} from '../_constants';\nimport {ERROR_ALERT_DURATION, INFO_NOTIFICATION_DURATION_SECONDS} from '_ui/constants';\n\n/**\n * Hook that provides a mass action configuration for exporting selected or all items\n * from a view/data set\n */\nexport const useExportMassAction = ({\n isEnabled,\n store: {view, dispatch},\n totalCount,\n onExport,\n}: FeatureHook<{\n store: {\n view: IViewSettingsState;\n dispatch: Dispatch<IViewSettingsAction>;\n };\n totalCount: number;\n onExport?: IMassActions['callback'];\n}>) => {\n const {t} = useSharedTranslation();\n const {kitNotification} = useKitNotification();\n\n const [exportQuery] = useExportLazyQuery();\n\n const _exportMassAction: IMassActions = useMemo(\n () => ({\n label: t('explorer.massAction.export'),\n icon: <FaFileExport />,\n deselectAll: false,\n callback: massSelectionFilter => {\n KitModal.confirm({\n width: '100%',\n style: {content: {width: '90vw', maxWidth: '656px'}},\n icon: false,\n type: 'confirm',\n title:\n t('explorer.export_item', {\n count: view.massSelection === MASS_SELECTION_ALL ? Infinity : view.massSelection.length,\n }) ?? undefined,\n content:\n t('explorer.export_item_description', {\n count: view.massSelection === MASS_SELECTION_ALL ? Infinity : view.massSelection.length,\n }) +\n BREAK_TWO_LINES +\n t('global.are_you_sure'),\n okText: t('global.confirm') ?? undefined,\n cancelText: t('global.cancel') ?? undefined,\n onOk: async () => {\n const total =\n view.massSelection === MASS_SELECTION_ALL ? totalCount : view.massSelection.length;\n try {\n const {data, error} = await exportQuery({\n variables: {\n library: view.libraryId,\n filters: massSelectionFilter,\n profile: 'default', // Set 'default' by default, it'll change when we can select a profile from the UI\n },\n });\n if (error) {\n // Preserve the extensions property which contains the error code\n const graphQLError = error.graphQLErrors?.[0];\n const errorWithExtensions = new Error(error.message);\n (errorWithExtensions as any).extensions = graphQLError?.extensions;\n throw errorWithExtensions;\n }\n\n kitNotification.info({\n message: t('explorer.massAction.export_message'),\n description: t('explorer.massAction.export_description', {\n count: total,\n total,\n }),\n duration: INFO_NOTIFICATION_DURATION_SECONDS,\n });\n\n onExport?.(massSelectionFilter, view.massSelection);\n } catch (e) {\n if (e.extensions?.code === 'CUSTOM_CONFIG_ERROR') {\n KitAlert.error({\n showIcon: true,\n duration: ERROR_ALERT_DURATION,\n message: t('explorer.massAction.export_config_error_message'),\n description: t('explorer.massAction.export_config_error_description'),\n closable: true,\n });\n } else {\n KitAlert.error({\n showIcon: true,\n duration: ERROR_ALERT_DURATION,\n message: t('explorer.massAction.export_error_message'),\n description: t('explorer.massAction.export_error_description', {count: total}),\n closable: true,\n });\n }\n }\n },\n });\n },\n }),\n [t, exportQuery, view.massSelection, dispatch, view.libraryId],\n );\n\n return {\n exportMassAction: isEnabled ? _exportMassAction : null,\n };\n};\n"]}
|
|
@@ -759,13 +759,14 @@
|
|
|
759
759
|
"editAttribute_submit_notification_description": "Your request to edit {{counter, number}} items has been received. You will be notified once the operation is complete.",
|
|
760
760
|
"editAttribute_submit_error": "An error occurred while requesting a bulk edit. Please contact an administrator.",
|
|
761
761
|
"export": "Export",
|
|
762
|
-
"
|
|
763
|
-
"
|
|
764
|
-
"
|
|
765
|
-
"
|
|
766
|
-
"export_error_description_one": "An error occurred while exporting the selected record.",
|
|
767
|
-
"export_error_description_other": "An error occurred while exporting the selected records.",
|
|
768
|
-
"
|
|
762
|
+
"export_message": "Export request",
|
|
763
|
+
"export_description_one": "Your request to export {{total, number}} item has been received. You will be notified as soon as the file is ready.",
|
|
764
|
+
"export_description_other": "Your request to export {{total, number}} items has been received. You will be notified as soon as the file is ready.",
|
|
765
|
+
"export_error_message": "Export error",
|
|
766
|
+
"export_error_description_one": "An error occurred while exporting the selected record. Please contact your administrator.",
|
|
767
|
+
"export_error_description_other": "An error occurred while exporting the selected records. Please contact your administrator.",
|
|
768
|
+
"export_config_error_message": "Export profile error",
|
|
769
|
+
"export_config_error_description": "No export profile is available for this library. Please contact your administrator.",
|
|
769
770
|
"add-link": "Add",
|
|
770
771
|
"replace-link": "Replace",
|
|
771
772
|
"toggle_selection": {
|
|
@@ -759,13 +759,14 @@
|
|
|
759
759
|
"editAttribute_submit_notification_description": "Votre demande de modification de {{counter, number}} éléments a bien été prise en compte. Vous serez notifié une fois l'opération terminée.",
|
|
760
760
|
"editAttribute_submit_error": "Une erreur est survenue lors de la demande d'une modification en masse. Veuillez contacter un administrateur.",
|
|
761
761
|
"export": "Exporter",
|
|
762
|
-
"
|
|
763
|
-
"
|
|
764
|
-
"
|
|
765
|
-
"
|
|
766
|
-
"export_error_description_one": "Une erreur s'est produite lors de l'
|
|
767
|
-
"export_error_description_other": "Une erreur s'est produite lors de l'
|
|
768
|
-
"
|
|
762
|
+
"export_message": "Demande d'export",
|
|
763
|
+
"export_description_one": "Votre demande d’export de {{total, number}} élément a bien été prise en compte. Vous recevrez une notification dès que le fichier sera prêt.",
|
|
764
|
+
"export_description_other": "Votre demande d’export de {{total, number}} éléments a bien été prise en compte. Vous recevrez une notification dès que le fichier sera prêt.",
|
|
765
|
+
"export_error_message": "Erreur d’export",
|
|
766
|
+
"export_error_description_one": "Une erreur s'est produite lors de l'export de l'enregistrements sélectionné. Veuillez contacter votre administrateur.",
|
|
767
|
+
"export_error_description_other": "Une erreur s'est produite lors de l'export des enregistrements sélectionnés. Veuillez contacter votre administrateur.",
|
|
768
|
+
"export_config_error_message": "Erreur de profil d’export",
|
|
769
|
+
"export_config_error_description": "Aucun profil d’export n’est disponible pour cette bibliothèque. Veuillez contacter votre administrateur.",
|
|
769
770
|
"add-link": "Ajouter",
|
|
770
771
|
"replace-link": "Remplacer",
|
|
771
772
|
"toggle_selection": {
|