@leav/ui 1.6.0-dfb71145 → 1.6.0-e751f378
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/_gqlTypes/index.d.ts +889 -686
- package/dist/_gqlTypes/index.js +98 -43
- package/dist/_gqlTypes/index.js.map +1 -1
- package/dist/_queries/trees/treeNodeChildrenQuery.js +2 -0
- package/dist/_queries/trees/treeNodeChildrenQuery.js.map +1 -1
- package/dist/_queries/views/viewDetailsFragment.js +1 -0
- package/dist/_queries/views/viewDetailsFragment.js.map +1 -1
- package/dist/components/AttributesSelectionList/sharedComponents.d.ts +159 -153
- package/dist/components/Explorer/Explorer.js +5 -3
- package/dist/components/Explorer/Explorer.js.map +1 -1
- package/dist/components/Explorer/ExplorerFiltersAndSorts.js +1 -1
- package/dist/components/Explorer/ExplorerFiltersAndSorts.js.map +1 -1
- package/dist/components/Explorer/TableCell.js +6 -7
- package/dist/components/Explorer/TableCell.js.map +1 -1
- package/dist/components/Explorer/TableNameCell.js +3 -2
- package/dist/components/Explorer/TableNameCell.js.map +1 -1
- package/dist/components/Explorer/_queries/useExplorerData.d.ts +7 -7
- package/dist/components/Explorer/actions-item/useEditStatusItemAction.js +3 -2
- package/dist/components/Explorer/actions-item/useEditStatusItemAction.js.map +1 -1
- package/dist/components/Explorer/actions-item/useReplaceItemAction.d.ts +2 -1
- package/dist/components/Explorer/actions-item/useReplaceItemAction.js +5 -4
- package/dist/components/Explorer/actions-item/useReplaceItemAction.js.map +1 -1
- package/dist/components/Explorer/actions-mass/export/ExportProfileSelectionModal.d.ts +10 -0
- package/dist/components/Explorer/actions-mass/export/ExportProfileSelectionModal.js +46 -0
- package/dist/components/Explorer/actions-mass/export/ExportProfileSelectionModal.js.map +1 -0
- package/dist/components/Explorer/actions-mass/export/content/NoProfiles.d.ts +1 -0
- package/dist/components/Explorer/actions-mass/export/content/NoProfiles.js +17 -0
- package/dist/components/Explorer/actions-mass/export/content/NoProfiles.js.map +1 -0
- package/dist/components/Explorer/actions-mass/export/content/ProfilesSelection.d.ts +8 -0
- package/dist/components/Explorer/actions-mass/export/content/ProfilesSelection.js +49 -0
- package/dist/components/Explorer/actions-mass/export/content/ProfilesSelection.js.map +1 -0
- package/dist/components/Explorer/actions-mass/export/useGetLibraryExportProfiles.d.ts +27 -0
- package/dist/components/Explorer/actions-mass/export/useGetLibraryExportProfiles.js +48 -0
- package/dist/components/Explorer/actions-mass/export/useGetLibraryExportProfiles.js.map +1 -0
- package/dist/components/Explorer/actions-mass/useDeactivateMassAction.js +3 -2
- package/dist/components/Explorer/actions-mass/useDeactivateMassAction.js.map +1 -1
- package/dist/components/Explorer/actions-mass/useDeleteLinkValues.js +3 -2
- package/dist/components/Explorer/actions-mass/useDeleteLinkValues.js.map +1 -1
- package/dist/components/Explorer/actions-mass/useEditAttributeMassAction.js +3 -2
- package/dist/components/Explorer/actions-mass/useEditAttributeMassAction.js.map +1 -1
- package/dist/components/Explorer/actions-mass/useExportMassAction.d.ts +7 -4
- package/dist/components/Explorer/actions-mass/useExportMassAction.js +80 -73
- package/dist/components/Explorer/actions-mass/useExportMassAction.js.map +1 -1
- package/dist/components/Explorer/actions-mass/useMassActions.js +3 -2
- package/dist/components/Explorer/actions-mass/useMassActions.js.map +1 -1
- package/dist/components/Explorer/actions-primary/useCreatePrimaryAction.js +3 -2
- package/dist/components/Explorer/actions-primary/useCreatePrimaryAction.js.map +1 -1
- package/dist/components/Explorer/actions-primary/useLinkPrimaryAction.d.ts +2 -1
- package/dist/components/Explorer/actions-primary/useLinkPrimaryAction.js +5 -4
- package/dist/components/Explorer/actions-primary/useLinkPrimaryAction.js.map +1 -1
- package/dist/components/Explorer/link-item/LinkModal.d.ts +1 -0
- package/dist/components/Explorer/link-item/LinkModal.js +2 -2
- package/dist/components/Explorer/link-item/LinkModal.js.map +1 -1
- package/dist/components/Explorer/list-saved-views/SavedViews.js +4 -3
- package/dist/components/Explorer/list-saved-views/SavedViews.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/_shared/ColumnItem.js +5 -8
- package/dist/components/Explorer/manage-view-settings/_shared/ColumnItem.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/configure-display/attributes/SelectVisibleAttributes.js +3 -2
- package/dist/components/Explorer/manage-view-settings/configure-display/attributes/SelectVisibleAttributes.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/filter-items/FilterItems.js +7 -6
- package/dist/components/Explorer/manage-view-settings/filter-items/FilterItems.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/filter-items/FilterListItem.js +3 -2
- package/dist/components/Explorer/manage-view-settings/filter-items/FilterListItem.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/open-view-settings/useOpenViewSettings.js +4 -3
- package/dist/components/Explorer/manage-view-settings/open-view-settings/useOpenViewSettings.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/router-menu/SettingItem.js +3 -2
- package/dist/components/Explorer/manage-view-settings/router-menu/SettingItem.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/router-menu/SettingsPanel.js +3 -2
- package/dist/components/Explorer/manage-view-settings/router-menu/SettingsPanel.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/save-view/LabelViewFormModal.js +3 -2
- package/dist/components/Explorer/manage-view-settings/save-view/LabelViewFormModal.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/save-view/prepareViewForRequest.js +3 -0
- package/dist/components/Explorer/manage-view-settings/save-view/prepareViewForRequest.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/save-view/useCreateNewView.js +3 -2
- package/dist/components/Explorer/manage-view-settings/save-view/useCreateNewView.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/save-view/useDeleteView.js +4 -3
- package/dist/components/Explorer/manage-view-settings/save-view/useDeleteView.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/save-view/useEditLabelView.js +3 -2
- package/dist/components/Explorer/manage-view-settings/save-view/useEditLabelView.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/save-view/useResetView.js +3 -2
- package/dist/components/Explorer/manage-view-settings/save-view/useResetView.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/save-view/useShareView.js +3 -2
- package/dist/components/Explorer/manage-view-settings/save-view/useShareView.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/save-view/useUpdateView.js +3 -2
- package/dist/components/Explorer/manage-view-settings/save-view/useUpdateView.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/sort-items/SortItems.js +7 -6
- package/dist/components/Explorer/manage-view-settings/sort-items/SortItems.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/sort-items/SortListItem.js +3 -2
- package/dist/components/Explorer/manage-view-settings/sort-items/SortListItem.js.map +1 -1
- package/dist/components/Filters/FiltersProvider.d.ts +2 -2
- package/dist/components/Filters/FiltersProvider.js.map +1 -1
- package/dist/components/Filters/_types.d.ts +3 -0
- package/dist/components/Filters/_types.js.map +1 -1
- package/dist/components/Filters/context/filtersReducer.js +5 -1
- package/dist/components/Filters/context/filtersReducer.js.map +1 -1
- package/dist/components/Filters/filter-items/CommonFilterItem.d.ts +1 -0
- package/dist/components/Filters/filter-items/CommonFilterItem.js +28 -8
- package/dist/components/Filters/filter-items/CommonFilterItem.js.map +1 -1
- package/dist/components/Filters/filter-items/EmptyValueCheckbox.d.ts +8 -0
- package/dist/components/Filters/filter-items/EmptyValueCheckbox.js +16 -0
- package/dist/components/Filters/filter-items/EmptyValueCheckbox.js.map +1 -0
- package/dist/components/Filters/filter-items/filter-type/BooleanAttributeDropdown.js +23 -9
- package/dist/components/Filters/filter-items/filter-type/BooleanAttributeDropdown.js.map +1 -1
- package/dist/components/Filters/filter-items/filter-type/ColorAttributeDropDown.js +9 -8
- package/dist/components/Filters/filter-items/filter-type/ColorAttributeDropDown.js.map +1 -1
- package/dist/components/Filters/filter-items/filter-type/FilterDropDown.js +4 -3
- package/dist/components/Filters/filter-items/filter-type/FilterDropDown.js.map +1 -1
- package/dist/components/Filters/filter-items/filter-type/FilterDropdownContent.js +1 -1
- package/dist/components/Filters/filter-items/filter-type/FilterDropdownContent.js.map +1 -1
- package/dist/components/Filters/filter-items/filter-type/FilterValueListDropDown.d.ts +0 -1
- package/dist/components/Filters/filter-items/filter-type/FilterValueListDropDown.js +17 -23
- package/dist/components/Filters/filter-items/filter-type/FilterValueListDropDown.js.map +1 -1
- package/dist/components/Filters/filter-items/filter-type/TreeAttributeDropDown.js +10 -12
- package/dist/components/Filters/filter-items/filter-type/TreeAttributeDropDown.js.map +1 -1
- package/dist/components/Filters/filter-items/filter-type/useConditionOptionsByType.js +3 -13
- package/dist/components/Filters/filter-items/filter-type/useConditionOptionsByType.js.map +1 -1
- package/dist/components/Filters/index.d.ts +1 -0
- package/dist/components/Filters/index.js +1 -0
- package/dist/components/Filters/index.js.map +1 -1
- package/dist/components/Filters/prepareFiltersForRequest.js +36 -3
- package/dist/components/Filters/prepareFiltersForRequest.js.map +1 -1
- package/dist/components/Filters/useFilters.d.ts +5 -0
- package/dist/components/Filters/useTransformFilters.js +4 -0
- package/dist/components/Filters/useTransformFilters.js.map +1 -1
- package/dist/components/LibraryItemsList/FiltersPanel/FiltersOptions.js +1 -8
- package/dist/components/LibraryItemsList/FiltersPanel/FiltersOptions.js.map +1 -1
- package/dist/components/LibraryItemsList/MenuView/MenuView.js +4 -4
- package/dist/components/LibraryItemsList/MenuView/MenuView.js.map +1 -1
- package/dist/components/LibraryItemsList/ViewPanel/View/View.js +3 -2
- package/dist/components/LibraryItemsList/ViewPanel/View/View.js.map +1 -1
- package/dist/components/Notifications/hooks/useNotificationSubscription.js +3 -2
- package/dist/components/Notifications/hooks/useNotificationSubscription.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/shared/ValuesVersionBtn/ValuesVersionBtn.js +5 -20
- package/dist/components/RecordEdition/EditRecordContent/shared/ValuesVersionBtn/ValuesVersionBtn.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/link-record/useLinkRecords.js +4 -3
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/link-record/useLinkRecords.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/shared/ExplorerWrapper.d.ts +53 -51
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardField.js +4 -3
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardField.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/TreeField.js +9 -2
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/TreeField.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/display-tree-node/TreeFieldWrapper.d.ts +53 -51
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/display-tree-node/TreeNodeItem.js +3 -2
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/display-tree-node/TreeNodeItem.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/manage-tree-node-selection/SelectTreeNodeModal.d.ts +2 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/manage-tree-node-selection/SelectTreeNodeModal.js +4 -7
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/manage-tree-node-selection/SelectTreeNodeModal.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/manage-tree-node-selection/useManageTreeNodeSelection.d.ts +3 -2
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/manage-tree-node-selection/useManageTreeNodeSelection.js +2 -2
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/manage-tree-node-selection/useManageTreeNodeSelection.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/shared/ComputeIndicator.js +3 -2
- package/dist/components/RecordEdition/EditRecordContent/uiElements/shared/ComputeIndicator.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordSidebar/RecordSummary/RecordInformations/RecordInformations.js +3 -2
- package/dist/components/RecordEdition/EditRecordSidebar/RecordSummary/RecordInformations/RecordInformations.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordSidebar/ValuesSummary/ValuesSummary.js +4 -3
- package/dist/components/RecordEdition/EditRecordSidebar/ValuesSummary/ValuesSummary.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordSidebar/ValuesVersions/ValuesVersions.js +3 -2
- package/dist/components/RecordEdition/EditRecordSidebar/ValuesVersions/ValuesVersions.js.map +1 -1
- package/dist/components/SelectRecordForLinkModal/SelectRecordForLinkModal.d.ts +1 -0
- package/dist/components/SelectRecordForLinkModal/SelectRecordForLinkModal.js +7 -7
- package/dist/components/SelectRecordForLinkModal/SelectRecordForLinkModal.js.map +1 -1
- package/dist/components/SelectTreeNode/SelectTreeNode.d.ts +2 -1
- package/dist/components/SelectTreeNode/SelectTreeNode.js +3 -3
- package/dist/components/SelectTreeNode/SelectTreeNode.js.map +1 -1
- package/dist/components/SelectTreeNode/SelectTreeNodeContent.d.ts +2 -1
- package/dist/components/SelectTreeNode/SelectTreeNodeContent.js +6 -2
- package/dist/components/SelectTreeNode/SelectTreeNodeContent.js.map +1 -1
- package/dist/components/SelectTreeNode/TreeNodeTitle.js +3 -2
- package/dist/components/SelectTreeNode/TreeNodeTitle.js.map +1 -1
- package/dist/constants.d.ts +1 -0
- package/dist/constants.js +1 -0
- package/dist/constants.js.map +1 -1
- package/dist/hooks/useIFrameMessenger/messageHandlers.d.ts +2 -1
- package/dist/hooks/useIFrameMessenger/messageHandlers.js +8 -0
- package/dist/hooks/useIFrameMessenger/messageHandlers.js.map +1 -1
- package/dist/hooks/useIFrameMessenger/schema.d.ts +3 -0
- package/dist/hooks/useIFrameMessenger/schema.js +1 -0
- package/dist/hooks/useIFrameMessenger/schema.js.map +1 -1
- package/dist/hooks/useIFrameMessenger/types.d.ts +12 -2
- package/dist/hooks/useIFrameMessenger/types.js.map +1 -1
- package/dist/hooks/useIFrameMessenger/useIFrameMessenger.d.ts +1 -0
- package/dist/hooks/useIFrameMessenger/useIFrameMessenger.js +15 -0
- package/dist/hooks/useIFrameMessenger/useIFrameMessenger.js.map +1 -1
- package/dist/hooks/useIFrameMessengerClient/iFrameMessengerClientContext.d.ts +1 -0
- package/dist/hooks/useIFrameMessengerClient/useIFrameMessengerClient.d.ts +1 -0
- package/dist/locales/en/shared.json +15 -3
- package/dist/locales/fr/shared.json +15 -3
- package/package.json +12 -10
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { FaTimes, FaSave } from 'react-icons/fa';
|
|
3
2
|
import { KitModal, KitButton, AntForm, KitInputWrapper, KitInput } from 'aristid-ds';
|
|
4
3
|
import { useLang } from '../../../../hooks';
|
|
5
4
|
import { useSharedTranslation } from '../../../../hooks/useSharedTranslation';
|
|
6
5
|
import { useViewSettingsContext } from '../store-view-settings/useViewSettingsContext';
|
|
6
|
+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
7
|
+
import { faTimes, faSave } from '@fortawesome/free-solid-svg-icons';
|
|
7
8
|
const sortWithDefaultAtFirst = defaultLang => (a, b) => (b === defaultLang ? 1 : 0) - (a === defaultLang ? 1 : 0);
|
|
8
9
|
export const LabelViewFormModal = ({ viewData, isOpen, onSubmit, onClose }) => {
|
|
9
10
|
const { t } = useSharedTranslation();
|
|
@@ -26,7 +27,7 @@ export const LabelViewFormModal = ({ viewData, isOpen, onSubmit, onClose }) => {
|
|
|
26
27
|
// TODO: remove appElement and put in the test : "KitModal.setAppElement(document.body) once exposed"
|
|
27
28
|
, {
|
|
28
29
|
// TODO: remove appElement and put in the test : "KitModal.setAppElement(document.body) once exposed"
|
|
29
|
-
appElement: document.getElementById('root'), title: t('explorer.viewList.save-view-as'), showCloseIcon: false, close: _toggleModal, isOpen: isOpen, footer: _jsxs(_Fragment, { children: [_jsx(KitButton, { type: "secondary", onClick: _toggleModal, icon: _jsx(
|
|
30
|
+
appElement: document.getElementById('root'), title: t('explorer.viewList.save-view-as'), showCloseIcon: false, close: _toggleModal, isOpen: isOpen, footer: _jsxs(_Fragment, { children: [_jsx(KitButton, { type: "secondary", onClick: _toggleModal, icon: _jsx(FontAwesomeIcon, { icon: faTimes }), children: t('global.close') }), _jsx(KitButton, { type: "primary", onClick: _handleSaveView, icon: _jsx(FontAwesomeIcon, { icon: faSave }), children: t('global.save') })] }), children: _jsx(AntForm, { name: "label", form: form, initialValues: initialValues, onFinish: _onSubmit, children: _jsx(KitInputWrapper, { label: String(t('explorer.viewList.view-name')), children: [...availableLangs].sort(sortWithDefaultAtFirst(defaultLang)).map(lang => (_jsx(AntForm.Item, { name: lang, validateTrigger: "onBlur", rules: [
|
|
30
31
|
{
|
|
31
32
|
required: lang === defaultLang,
|
|
32
33
|
message: String(t('errors.standard_field_required')),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LabelViewFormModal.js","sourceRoot":"","sources":["../../../../../src/components/Explorer/manage-view-settings/save-view/LabelViewFormModal.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"LabelViewFormModal.js","sourceRoot":"","sources":["../../../../../src/components/Explorer/manage-view-settings/save-view/LabelViewFormModal.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAC,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAC,MAAM,YAAY,CAAC;AACnF,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAClC,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAC,sBAAsB,EAAC,MAAM,+CAA+C,CAAC;AACrF,OAAO,EAAC,eAAe,EAAC,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAC,OAAO,EAAE,MAAM,EAAC,MAAM,mCAAmC,CAAC;AASlE,MAAM,sBAAsB,GAAG,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,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AgC,CAAC,EAC1C,aAAa,EAAE,KAAK,EACpB,KAAK,EAAE,YAAY,EACnB,MAAM,EAAE,MAAM,EACd,MAAM,EACF,8BACI,KAAC,SAAS,IAAC,IAAI,EAAC,WAAW,EAAC,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,KAAC,eAAe,IAAC,IAAI,EAAE,OAAO,GAAI,YACtF,CAAC,CAAC,cAAc,CAAC,GACV,EACZ,KAAC,SAAS,IAAC,IAAI,EAAC,SAAS,EAAC,OAAO,EAAE,eAAe,EAAE,IAAI,EAAE,KAAC,eAAe,IAAC,IAAI,EAAE,MAAM,GAAI,YACtF,CAAC,CAAC,aAAa,CAAC,GACT,IACb,YAGP,KAAC,OAAO,IAAC,IAAI,EAAC,OAAO,EAAC,IAAI,EAAE,IAAI,EAAE,aAAa,EAAE,aAAa,EAAE,QAAQ,EAAE,SAAS,YAC/E,KAAC,eAAe,IAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,6BAA6B,CAAC,CAAC,YAC3D,CAAC,GAAG,cAAc,CAAC,CAAC,IAAI,CAAC,sBAAsB,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CACvE,KAAC,OAAO,CAAC,IAAI,IAET,IAAI,EAAE,IAAI,EACV,eAAe,EAAC,QAAQ,EACxB,KAAK,EAAE;wBACH;4BACI,QAAQ,EAAE,IAAI,KAAK,WAAW;4BAC9B,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,gCAAgC,CAAC,CAAC;yBACvD;qBACJ,YAED,KAAC,QAAQ,IACL,KAAK,EAAE,IAAI,EACX,QAAQ,EAAE,IAAI,KAAK,WAAW,EAC9B,WAAW,EAAE,0BAA0B,GACzC,IAdG,IAAI,CAeE,CAClB,CAAC,GACY,GACZ,GACH,CACd,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 FunctionComponent} from 'react';\nimport {KitModal, KitButton, AntForm, KitInputWrapper, KitInput} from 'aristid-ds';\nimport {useLang} from '_ui/hooks';\nimport {useSharedTranslation} from '_ui/hooks/useSharedTranslation';\nimport {useViewSettingsContext} from '../store-view-settings/useViewSettingsContext';\nimport {FontAwesomeIcon} from '@fortawesome/react-fontawesome';\nimport {faTimes, faSave} from '@fortawesome/free-solid-svg-icons';\n\ninterface ISaveViewProps {\n viewData?: Record<string, string> | null;\n isOpen: boolean;\n onSubmit: (label: Record<string, string>, id?: string | undefined) => void;\n onClose: () => void;\n}\n\nconst sortWithDefaultAtFirst = defaultLang => (a, b) => (b === defaultLang ? 1 : 0) - (a === defaultLang ? 1 : 0);\n\nexport const LabelViewFormModal: FunctionComponent<ISaveViewProps> = ({viewData, isOpen, onSubmit, onClose}) => {\n const {t} = useSharedTranslation();\n const {defaultLang, availableLangs} = useLang();\n const {view} = useViewSettingsContext();\n\n const [form] = AntForm.useForm();\n const initialValues = viewData ? viewData : view.viewId ? view.viewLabels : {};\n\n const _toggleModal = () => {\n onClose();\n };\n\n const _handleSaveView = () => {\n form.submit();\n };\n\n const _onSubmit = values => {\n onSubmit(values);\n onClose();\n };\n\n const _preventCloseSettingsPanel = e => e.stopPropagation();\n\n return (\n <KitModal\n // TODO: remove appElement and put in the test : \"KitModal.setAppElement(document.body) once exposed\"\n appElement={document.getElementById('root')}\n title={t('explorer.viewList.save-view-as')}\n showCloseIcon={false}\n close={_toggleModal}\n isOpen={isOpen}\n footer={\n <>\n <KitButton type=\"secondary\" onClick={_toggleModal} icon={<FontAwesomeIcon icon={faTimes} />}>\n {t('global.close')}\n </KitButton>\n <KitButton type=\"primary\" onClick={_handleSaveView} icon={<FontAwesomeIcon icon={faSave} />}>\n {t('global.save')}\n </KitButton>\n </>\n }\n >\n <AntForm name=\"label\" form={form} initialValues={initialValues} onFinish={_onSubmit}>\n <KitInputWrapper label={String(t('explorer.viewList.view-name'))}>\n {[...availableLangs].sort(sortWithDefaultAtFirst(defaultLang)).map(lang => (\n <AntForm.Item\n key={lang}\n name={lang}\n validateTrigger=\"onBlur\"\n rules={[\n {\n required: lang === defaultLang,\n message: String(t('errors.standard_field_required')),\n },\n ]}\n >\n <KitInput\n label={lang}\n required={lang === defaultLang}\n onMouseDown={_preventCloseSettingsPanel}\n />\n </AntForm.Item>\n ))}\n </KitInputWrapper>\n </AntForm>\n </KitModal>\n );\n};\n"]}
|
|
@@ -14,6 +14,7 @@ export const prepareViewForRequest = (view, filters, label) => ({
|
|
|
14
14
|
// TODO : save filter values as string[] when tree filter and handle fields with libraries
|
|
15
15
|
value: filter.value?.[0],
|
|
16
16
|
condition: filter.condition,
|
|
17
|
+
withEmptyValues: filter.withEmptyValues,
|
|
17
18
|
};
|
|
18
19
|
}
|
|
19
20
|
if (isUIFilterThrough(filter)) {
|
|
@@ -30,12 +31,14 @@ export const prepareViewForRequest = (view, filters, label) => ({
|
|
|
30
31
|
// TODO : save filter values as string[] when filter and handle fields with libraries
|
|
31
32
|
value: filter.value?.[0],
|
|
32
33
|
condition: filter.condition,
|
|
34
|
+
withEmptyValues: filter.withEmptyValues,
|
|
33
35
|
};
|
|
34
36
|
}
|
|
35
37
|
return {
|
|
36
38
|
field: filter.field,
|
|
37
39
|
value: filter.value,
|
|
38
40
|
condition: filter.condition,
|
|
41
|
+
withEmptyValues: filter.withEmptyValues,
|
|
39
42
|
};
|
|
40
43
|
}),
|
|
41
44
|
sort: view.sort.map(({ field, order }) => ({ field, order })),
|
package/dist/components/Explorer/manage-view-settings/save-view/prepareViewForRequest.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prepareViewForRequest.js","sourceRoot":"","sources":["../../../../../src/components/Explorer/manage-view-settings/save-view/prepareViewForRequest.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,+BAA+B,EAAC,MAAM,kBAAkB,CAAC;AAEjE,OAAO,EAAC,cAAc,EAAE,iBAAiB,EAAE,mBAAmB,EAAgB,MAAM,+BAA+B,CAAC;AAEpH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CACjC,IAAwB,EACxB,OAAmB,EACnB,KAA6B,EACpB,EAAE,CAAC,CAAC;IACb,OAAO,EAAE,IAAI,CAAC,SAAS;IACvB,MAAM,EAAE,KAAK;IACb,OAAO,EAAE;QACL,IAAI,EAAE,+BAA+B,CAAC,IAAI,CAAC,QAAQ,CAAC;KACvD;IACD,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAqB,EAAE;QAC/C,IAAI,cAAc,CAAC,MAAM,CAAC,EAAE,CAAC;YACzB,OAAO;gBACH,oIAAoI;gBACpI,KAAK,EAAE,MAAM,CAAC,SAAS,CAAC,EAAE;gBAC1B,0FAA0F;gBAC1F,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;gBACxB,SAAS,EAAE,MAAM,CAAC,SAAS;
|
|
1
|
+
{"version":3,"file":"prepareViewForRequest.js","sourceRoot":"","sources":["../../../../../src/components/Explorer/manage-view-settings/save-view/prepareViewForRequest.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,+BAA+B,EAAC,MAAM,kBAAkB,CAAC;AAEjE,OAAO,EAAC,cAAc,EAAE,iBAAiB,EAAE,mBAAmB,EAAgB,MAAM,+BAA+B,CAAC;AAEpH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CACjC,IAAwB,EACxB,OAAmB,EACnB,KAA6B,EACpB,EAAE,CAAC,CAAC;IACb,OAAO,EAAE,IAAI,CAAC,SAAS;IACvB,MAAM,EAAE,KAAK;IACb,OAAO,EAAE;QACL,IAAI,EAAE,+BAA+B,CAAC,IAAI,CAAC,QAAQ,CAAC;KACvD;IACD,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAqB,EAAE;QAC/C,IAAI,cAAc,CAAC,MAAM,CAAC,EAAE,CAAC;YACzB,OAAO;gBAC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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 RecordFilterInput, type ViewInput} from '_ui/_gqlTypes';\nimport {mapViewTypeFromExplorerToLegacy} from '../../_constants';\nimport {type IViewSettingsState} from '../store-view-settings/viewSettingsReducer';\nimport {isUIFilterTree, isUIFilterThrough, isUIFilterValueList, type UIFilter} from '_ui/components/Filters/_types';\n\nexport const prepareViewForRequest = (\n view: IViewSettingsState,\n filters: UIFilter[],\n label: Record<string, string>,\n): ViewInput => ({\n library: view.libraryId,\n shared: false,\n display: {\n type: mapViewTypeFromExplorerToLegacy[view.viewType],\n },\n filters: filters.map((filter): RecordFilterInput => {\n if (isUIFilterTree(filter)) {\n return {\n // TODO save filter.field, but need to handle Through an other way in useTransformFilters.toValidFilters to keep that field as saved\n field: filter.attribute.id,\n // TODO : save filter values as string[] when tree filter and handle fields with libraries\n value: filter.value?.[0],\n condition: filter.condition,\n withEmptyValues: filter.withEmptyValues,\n };\n }\n if (isUIFilterThrough(filter)) {\n return {\n field: `${filter.field}.${filter.subField}`,\n value: filter.value,\n condition: filter.subCondition,\n };\n }\n\n if (isUIFilterValueList(filter)) {\n return {\n // TODO save filter.field, but need to handle Through an other way in useTransformFilters.toValidFilters to keep that field as saved\n field: filter.attribute.id,\n // TODO : save filter values as string[] when filter and handle fields with libraries\n value: filter.value?.[0],\n condition: filter.condition,\n withEmptyValues: filter.withEmptyValues,\n };\n }\n\n return {\n field: filter.field,\n value: filter.value,\n condition: filter.condition,\n withEmptyValues: filter.withEmptyValues,\n };\n }),\n sort: view.sort.map(({field, order}) => ({field, order})),\n attributes: view.attributesIds,\n label,\n});\n"]}
|
|
@@ -5,7 +5,6 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
5
5
|
import { useState } from 'react';
|
|
6
6
|
import { LabelViewFormModal } from './LabelViewFormModal';
|
|
7
7
|
import { KitButton } from 'aristid-ds';
|
|
8
|
-
import { FaSdCard } from 'react-icons/fa';
|
|
9
8
|
import { useSharedTranslation } from '../../../../hooks/useSharedTranslation';
|
|
10
9
|
import { useViewSettingsContext } from '../store-view-settings/useViewSettingsContext';
|
|
11
10
|
import { ViewSettingsActionTypes } from '../store-view-settings/viewSettingsReducer';
|
|
@@ -15,6 +14,8 @@ import { mapViewTypeFromExplorerToLegacy } from '../../_constants';
|
|
|
15
14
|
import { useTransformFilters } from '../../../../components/Filters/useTransformFilters';
|
|
16
15
|
import { useFiltersContext } from '../../../../components/Filters/useFiltersContext';
|
|
17
16
|
import { FiltersActionTypes } from '../../../../components/Filters/context/filtersReducer';
|
|
17
|
+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
18
|
+
import { faSdCard } from '@fortawesome/free-solid-svg-icons';
|
|
18
19
|
export const useCreateNewView = () => {
|
|
19
20
|
const { t } = useSharedTranslation();
|
|
20
21
|
const { toValidFilters } = useTransformFilters();
|
|
@@ -58,7 +59,7 @@ export const useCreateNewView = () => {
|
|
|
58
59
|
}
|
|
59
60
|
};
|
|
60
61
|
return {
|
|
61
|
-
createNewViewButton: (_jsxs(_Fragment, { children: [_jsx(LabelViewFormModal, { isOpen: isModalOpen, onSubmit: _createView, onClose: _toggleModal }), _jsx(KitButton, { type: "action", icon: _jsx(
|
|
62
|
+
createNewViewButton: (_jsxs(_Fragment, { children: [_jsx(LabelViewFormModal, { isOpen: isModalOpen, onSubmit: _createView, onClose: _toggleModal }), _jsx(KitButton, { type: "action", icon: _jsx(FontAwesomeIcon, { icon: faSdCard }), onClick: _toggleModal, children: t('explorer.viewList.save-view-as') })] })),
|
|
62
63
|
};
|
|
63
64
|
};
|
|
64
65
|
//# sourceMappingURL=useCreateNewView.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCreateNewView.js","sourceRoot":"","sources":["../../../../../src/components/Explorer/manage-view-settings/save-view/useCreateNewView.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,QAAQ,EAAC,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAC,SAAS,EAAC,MAAM,YAAY,CAAC;AACrC,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"useCreateNewView.js","sourceRoot":"","sources":["../../../../../src/components/Explorer/manage-view-settings/save-view/useCreateNewView.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,QAAQ,EAAC,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAC,SAAS,EAAC,MAAM,YAAY,CAAC;AACrC,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAC,sBAAsB,EAAC,MAAM,+CAA+C,CAAC;AACrF,OAAO,EAAC,uBAAuB,EAAC,MAAM,4CAA4C,CAAC;AACnF,OAAO,0BAA0B,MAAM,sCAAsC,CAAC;AAC9E,OAAO,EAAC,qBAAqB,EAAC,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAC,+BAA+B,EAAC,MAAM,kBAAkB,CAAC;AAEjE,OAAO,EAAC,mBAAmB,EAAC,MAAM,4CAA4C,CAAC;AAC/E,OAAO,EAAC,iBAAiB,EAAC,MAAM,0CAA0C,CAAC;AAC3E,OAAO,EAAC,kBAAkB,EAAC,MAAM,+CAA+C,CAAC;AAEjF,OAAO,EAAC,eAAe,EAAC,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAC,QAAQ,EAAC,MAAM,mCAAmC,CAAC;AAE3D,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,EAAE;IACjC,MAAM,EAAC,CAAC,EAAC,GAAG,oBAAoB,EAAE,CAAC;IACnC,MAAM,EAAC,cAAc,EAAC,GAAG,mBAAmB,EAA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,CAAC,QAAQ,CAAC;qBACvD;oBACD,UAAU,EAAE,IAAI,CAAC,QAAQ,EAAE,UAAU,EAAE,GAAG,CAAC,CAAC,EAAC,EAAE,EAAC,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,EAAE;iBACjE;aACJ,CAAC,CAAC;YACH,eAAe,CAAC;gBACZ,IAAI,EAAE,kBAAkB,CAAC,YAAY;gBACrC,OAAO,EAAE;oBACL,GAAG,WAAW;oBACd,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,EAAE;oBACxB,OAAO,EAAE,YAA0B;iBACtC;aACJ,CAAC,CAAC;QACP,CAAC;IACL,CAAC,CAAC;IAEF,OAAO;QACH,mBAAmB,EAAE,CACjB,8BACI,KAAC,kBAAkB,IAAC,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,EAAE,OAAO,EAAE,YAAY,GAAI,EACzF,KAAC,SAAS,IAAC,IAAI,EAAC,QAAQ,EAAC,IAAI,EAAE,KAAC,eAAe,IAAC,IAAI,EAAE,QAAQ,GAAI,EAAE,OAAO,EAAE,YAAY,YACpF,CAAC,CAAC,gCAAgC,CAAC,GAC5B,IACb,CACN;KACJ,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 {useState} from 'react';\nimport {LabelViewFormModal} from './LabelViewFormModal';\nimport {KitButton} from 'aristid-ds';\nimport {useSharedTranslation} from '_ui/hooks/useSharedTranslation';\nimport {useViewSettingsContext} from '../store-view-settings/useViewSettingsContext';\nimport {ViewSettingsActionTypes} from '../store-view-settings/viewSettingsReducer';\nimport useExecuteSaveViewMutation from '_ui/hooks/useExecuteSaveViewMutation';\nimport {prepareViewForRequest} from './prepareViewForRequest';\nimport {mapViewTypeFromExplorerToLegacy} from '../../_constants';\nimport {type IViewDisplay} from '_ui/types';\nimport {useTransformFilters} from '_ui/components/Filters/useTransformFilters';\nimport {useFiltersContext} from '_ui/components/Filters/useFiltersContext';\nimport {FiltersActionTypes} from '_ui/components/Filters/context/filtersReducer';\nimport {type UIFilter} from '_ui/components/Filters/_types';\nimport {FontAwesomeIcon} from '@fortawesome/react-fontawesome';\nimport {faSdCard} from '@fortawesome/free-solid-svg-icons';\n\nexport const useCreateNewView = () => {\n const {t} = useSharedTranslation();\n const {toValidFilters} = useTransformFilters();\n const {view, dispatch} = useViewSettingsContext();\n const {filtersData, dispatch: filtersDispatch} = useFiltersContext();\n const {saveView} = useExecuteSaveViewMutation();\n const [isModalOpen, setIsModalOpen] = useState(false);\n\n const _toggleModal = () => {\n setIsModalOpen(!isModalOpen);\n };\n\n const _createView = async (label: Record<string, string>) => {\n const mappedView = prepareViewForRequest(view, filtersData.filters, label);\n\n const {data} = await saveView({\n view: mappedView,\n });\n\n if (data) {\n const validFilters = toValidFilters(data.saveView.filters);\n dispatch({\n type: ViewSettingsActionTypes.UPDATE_VIEWS,\n payload: {\n id: data.saveView.id,\n ownerId: data.saveView.created_by.id,\n label: data.saveView.label,\n shared: data.saveView.shared,\n filters: validFilters,\n sort: data.saveView.sort ?? [],\n display: (data.saveView.display as IViewDisplay) ?? {\n type: mapViewTypeFromExplorerToLegacy[view.viewType],\n },\n attributes: data.saveView?.attributes?.map(({id}) => id) ?? [],\n },\n });\n filtersDispatch({\n type: FiltersActionTypes.UPDATE_VIEWS,\n payload: {\n ...filtersData,\n viewId: data.saveView.id,\n filters: validFilters as UIFilter[],\n },\n });\n }\n };\n\n return {\n createNewViewButton: (\n <>\n <LabelViewFormModal isOpen={isModalOpen} onSubmit={_createView} onClose={_toggleModal} />\n <KitButton type=\"action\" icon={<FontAwesomeIcon icon={faSdCard} />} onClick={_toggleModal}>\n {t('explorer.viewList.save-view-as')}\n </KitButton>\n </>\n ),\n };\n};\n"]}
|
|
@@ -4,7 +4,6 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
4
4
|
// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
|
|
5
5
|
import { useSharedTranslation } from '../../../../hooks/useSharedTranslation';
|
|
6
6
|
import { KitButton, KitModal, KitTypography } from 'aristid-ds';
|
|
7
|
-
import { FaTimes, FaTrash } from 'react-icons/fa';
|
|
8
7
|
import { useViewSettingsContext } from '../store-view-settings/useViewSettingsContext';
|
|
9
8
|
import { useState } from 'react';
|
|
10
9
|
import { ViewSettingsActionTypes } from '../store-view-settings/viewSettingsReducer';
|
|
@@ -12,6 +11,8 @@ import useExecuteDeleteViewMutation from '../../../../hooks/useExecuteDeleteView
|
|
|
12
11
|
import { localizedTranslation } from '@leav/utils';
|
|
13
12
|
import { useLang } from '../../../../hooks';
|
|
14
13
|
import styled from 'styled-components';
|
|
14
|
+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
15
|
+
import { faTimes, faTrash } from '@fortawesome/free-solid-svg-icons';
|
|
15
16
|
const StyledButton = styled.button `
|
|
16
17
|
all: unset;
|
|
17
18
|
`;
|
|
@@ -38,10 +39,10 @@ export const useDeleteView = () => {
|
|
|
38
39
|
};
|
|
39
40
|
const iconDelete = (viewItem) => (_jsx(StyledButton, { className: "delete", title: t('explorer.viewList.delete-view'), onClick: () => {
|
|
40
41
|
setDataViewOnAction({ id: viewItem.id, label: viewItem.label });
|
|
41
|
-
}, children: _jsx(
|
|
42
|
+
}, children: _jsx(FontAwesomeIcon, { icon: faTrash }) }));
|
|
42
43
|
return {
|
|
43
44
|
iconDelete,
|
|
44
|
-
deleteModal: dataViewOnAction.id && dataViewOnAction.label && (_jsx(KitModal, { appElement: document.getElementById('root'), title: t('explorer.viewList.confirm-delete-view'), isOpen: !!dataViewOnAction.id && !!dataViewOnAction.label, footer: _jsxs(_Fragment, { children: [_jsx(KitButton, { type: "secondary", onClick: () => setDataViewOnAction({ id: null, label: null }), icon: _jsx(
|
|
45
|
+
deleteModal: dataViewOnAction.id && dataViewOnAction.label && (_jsx(KitModal, { appElement: document.getElementById('root'), title: t('explorer.viewList.confirm-delete-view'), isOpen: !!dataViewOnAction.id && !!dataViewOnAction.label, footer: _jsxs(_Fragment, { children: [_jsx(KitButton, { type: "secondary", onClick: () => setDataViewOnAction({ id: null, label: null }), icon: _jsx(FontAwesomeIcon, { icon: faTimes }), children: t('global.close') }), _jsx(KitButton, { type: "primary", danger: true, onClick: _onDeleteConfirm, icon: _jsx(FontAwesomeIcon, { icon: faTrash }), children: t('global.delete') })] }), children: _jsx(KitTypography.Text, { size: "fontSize3", weight: "medium", children: localizedTranslation(dataViewOnAction.label, availableLangs) }) })),
|
|
45
46
|
};
|
|
46
47
|
};
|
|
47
48
|
//# sourceMappingURL=useDeleteView.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDeleteView.js","sourceRoot":"","sources":["../../../../../src/components/Explorer/manage-view-settings/save-view/useDeleteView.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAC,SAAS,EAAE,QAAQ,EAAE,aAAa,EAAC,MAAM,YAAY,CAAC;AAC9D,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"useDeleteView.js","sourceRoot":"","sources":["../../../../../src/components/Explorer/manage-view-settings/save-view/useDeleteView.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAC,SAAS,EAAE,QAAQ,EAAE,aAAa,EAAC,MAAM,YAAY,CAAC;AAC9D,OAAO,EAAC,sBAAsB,EAAC,MAAM,+CAA+C,CAAC;AACrF,OAAO,EAAsB,QAAQ,EAAC,MAAM,OAAO,CAAC;AACpD,OAAO,EAAC,uBAAuB,EAAC,MAAM,4CAA4C,CAAC;AACnF,OAAO,4BAA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KAAK,EAAE,cAAc,CAAC,GAC5C,GACd,CACd;KACJ,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 {useSharedTranslation} from '_ui/hooks/useSharedTranslation';\nimport {KitButton, KitModal, KitTypography} from 'aristid-ds';\nimport {useViewSettingsContext} from '../store-view-settings/useViewSettingsContext';\nimport {type ComponentProps, useState} from 'react';\nimport {ViewSettingsActionTypes} from '../store-view-settings/viewSettingsReducer';\nimport useExecuteDeleteViewMutation from '_ui/hooks/useExecuteDeleteViewMutation/useExecuteDeleteViewMutation';\nimport {localizedTranslation} from '@leav/utils';\nimport {useLang} from '_ui/hooks';\nimport {type IUserView, type IDataViewOnAction} from '../../_types';\nimport styled from 'styled-components';\nimport {type Button} from 'antd';\nimport {FontAwesomeIcon} from '@fortawesome/react-fontawesome';\nimport {faTimes, faTrash} from '@fortawesome/free-solid-svg-icons';\n\nconst StyledButton = styled.button`\n all: unset;\n`;\n\nexport const useDeleteView = () => {\n const {t} = useSharedTranslation();\n const {availableLangs} = useLang();\n const {deleteView} = useExecuteDeleteViewMutation();\n const {dispatch} = useViewSettingsContext();\n const [dataViewOnAction, setDataViewOnAction] = useState<IDataViewOnAction>({id: null, label: null});\n\n const _onDeleteConfirm: ComponentProps<typeof Button>['onClick'] = async () => {\n if (!dataViewOnAction.id) {\n return;\n }\n const {data} = await deleteView(dataViewOnAction.id);\n\n if (data) {\n dispatch({\n type: ViewSettingsActionTypes.DELETE_VIEW,\n payload: {\n id: dataViewOnAction.id,\n },\n });\n }\n setDataViewOnAction({id: null, label: null});\n };\n\n const iconDelete = (viewItem: IUserView) => (\n <StyledButton\n className=\"delete\"\n title={t('explorer.viewList.delete-view')}\n onClick={() => {\n setDataViewOnAction({id: viewItem.id, label: viewItem.label});\n }}\n >\n <FontAwesomeIcon icon={faTrash} />\n </StyledButton>\n );\n\n return {\n iconDelete,\n deleteModal: dataViewOnAction.id && dataViewOnAction.label && (\n <KitModal\n appElement={document.getElementById('root')}\n title={t('explorer.viewList.confirm-delete-view')}\n isOpen={!!dataViewOnAction.id && !!dataViewOnAction.label}\n footer={\n <>\n <KitButton\n type=\"secondary\"\n onClick={() => setDataViewOnAction({id: null, label: null})}\n icon={<FontAwesomeIcon icon={faTimes} />}\n >\n {t('global.close')}\n </KitButton>\n <KitButton\n type=\"primary\"\n danger\n onClick={_onDeleteConfirm}\n icon={<FontAwesomeIcon icon={faTrash} />}\n >\n {t('global.delete')}\n </KitButton>\n </>\n }\n >\n <KitTypography.Text size=\"fontSize3\" weight=\"medium\">\n {localizedTranslation(dataViewOnAction.label, availableLangs)}\n </KitTypography.Text>\n </KitModal>\n ),\n };\n};\n"]}
|
|
@@ -2,7 +2,6 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06
|
|
3
3
|
// This file is released under LGPL V3
|
|
4
4
|
// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
|
|
5
|
-
import { FaEdit } from 'react-icons/fa';
|
|
6
5
|
import { useViewSettingsContext } from '../store-view-settings/useViewSettingsContext';
|
|
7
6
|
import { useState } from 'react';
|
|
8
7
|
import { ViewSettingsActionTypes } from '../store-view-settings/viewSettingsReducer';
|
|
@@ -10,6 +9,8 @@ import useExecuteUpdateViewMutation from '../../_queries/useExecuteUpdateViewMut
|
|
|
10
9
|
import { LabelViewFormModal } from './LabelViewFormModal';
|
|
11
10
|
import styled from 'styled-components';
|
|
12
11
|
import { useSharedTranslation } from '../../../../hooks/useSharedTranslation';
|
|
12
|
+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
13
|
+
import { faEdit } from '@fortawesome/free-solid-svg-icons';
|
|
13
14
|
const StyledButton = styled.button `
|
|
14
15
|
all: unset;
|
|
15
16
|
`;
|
|
@@ -39,7 +40,7 @@ export const useEditLabelView = () => {
|
|
|
39
40
|
});
|
|
40
41
|
}
|
|
41
42
|
};
|
|
42
|
-
const iconEditLabel = (viewItem) => (_jsx(StyledButton, { className: "edit", title: t('explorer.viewList.edit-view'), onClick: () => setDataViewOnAction({ id: viewItem.id, label: viewItem.label }), children: _jsx(
|
|
43
|
+
const iconEditLabel = (viewItem) => (_jsx(StyledButton, { className: "edit", title: t('explorer.viewList.edit-view'), onClick: () => setDataViewOnAction({ id: viewItem.id, label: viewItem.label }), children: _jsx(FontAwesomeIcon, { icon: faEdit }) }));
|
|
43
44
|
return {
|
|
44
45
|
iconEditLabel,
|
|
45
46
|
editViewModal: dataViewOnAction.id && dataViewOnAction.label && (_jsx(LabelViewFormModal, { viewData: dataViewOnAction.label, isOpen: true, onSubmit: _onEditLabel, onClose: () => setDataViewOnAction({ id: null, label: null }) })),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEditLabelView.js","sourceRoot":"","sources":["../../../../../src/components/Explorer/manage-view-settings/save-view/useEditLabelView.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"useEditLabelView.js","sourceRoot":"","sources":["../../../../../src/components/Explorer/manage-view-settings/save-view/useEditLabelView.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,sBAAsB,EAAC,MAAM,+CAA+C,CAAC;AACrF,OAAO,EAAC,QAAQ,EAAC,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAC,uBAAuB,EAAC,MAAM,4CAA4C,CAAC;AAEnF,OAAO,4BAA4B,MAAM,6CAA6C,CAAC;AACvF,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AACxD,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,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AAC,EACvC,OAAO,EAAE,GAAG,EAAE,CAAC,mBAAmB,CAAC,EAAC,EAAE,EAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,EAAE,QAAQ,CAAC,KAAK,EAAC,CAAC,YAE5E,KAAC,eAAe,IAAC,IAAI,EAAE,MAAM,GAAI,GACtB,CAClB,CAAC;IAEF,OAAO;QACH,aAAa;QACb,aAAa,EAAE,gBAAgB,CAAC,EAAE,IAAI,gBAAgB,CAAC,KAAK,IAAI,CAC5D,KAAC,kBAAkB,IACf,QAAQ,EAAE,gBAAgB,CAAC,KAAK,EAChC,MAAM,QACN,QAAQ,EAAE,YAAY,EACtB,OAAO,EAAE,GAAG,EAAE,CAAC,mBAAmB,CAAC,EAAC,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAC,CAAC,GAC7D,CACL;KACJ,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 {useViewSettingsContext} from '../store-view-settings/useViewSettingsContext';\nimport {useState} from 'react';\nimport {ViewSettingsActionTypes} from '../store-view-settings/viewSettingsReducer';\nimport {type IDataViewOnAction, type IUserView} from '../../_types';\nimport useExecuteUpdateViewMutation from '../../_queries/useExecuteUpdateViewMutation';\nimport {LabelViewFormModal} from './LabelViewFormModal';\nimport styled from 'styled-components';\nimport {useSharedTranslation} from '_ui/hooks/useSharedTranslation';\nimport {FontAwesomeIcon} from '@fortawesome/react-fontawesome';\nimport {faEdit} from '@fortawesome/free-solid-svg-icons';\n\nconst StyledButton = styled.button`\n all: unset;\n`;\n\nexport const useEditLabelView = () => {\n const {t} = useSharedTranslation();\n const {updateView} = useExecuteUpdateViewMutation();\n const {dispatch} = useViewSettingsContext();\n const [dataViewOnAction, setDataViewOnAction] = useState<IDataViewOnAction>({id: null, label: null});\n\n const _onEditLabel = async (label: Record<string, string>) => {\n if (!dataViewOnAction.id) {\n return;\n }\n const mappedView = {\n id: dataViewOnAction.id,\n label,\n };\n\n const {data} = await updateView({\n view: mappedView,\n });\n\n if (data) {\n dispatch({\n type: ViewSettingsActionTypes.RENAME_VIEW,\n payload: {\n id: data.updateView.id,\n label: data.updateView.label,\n },\n });\n }\n };\n\n const iconEditLabel = (viewItem: IUserView) => (\n <StyledButton\n className=\"edit\"\n title={t('explorer.viewList.edit-view')}\n onClick={() => setDataViewOnAction({id: viewItem.id, label: viewItem.label})}\n >\n <FontAwesomeIcon icon={faEdit} />\n </StyledButton>\n );\n\n return {\n iconEditLabel,\n editViewModal: dataViewOnAction.id && dataViewOnAction.label && (\n <LabelViewFormModal\n viewData={dataViewOnAction.label}\n isOpen\n onSubmit={_onEditLabel}\n onClose={() => setDataViewOnAction({id: null, label: null})}\n />\n ),\n };\n};\n"]}
|
|
@@ -6,9 +6,10 @@ import { KitButton } from 'aristid-ds';
|
|
|
6
6
|
import { useSharedTranslation } from '../../../../hooks/useSharedTranslation';
|
|
7
7
|
import { useViewSettingsContext } from '../store-view-settings/useViewSettingsContext';
|
|
8
8
|
import { ViewSettingsActionTypes } from '../store-view-settings/viewSettingsReducer';
|
|
9
|
-
import { FaUndo } from 'react-icons/fa';
|
|
10
9
|
import { useFiltersContext } from '../../../../components/Filters/useFiltersContext';
|
|
11
10
|
import { FiltersActionTypes } from '../../../../components/Filters/context/filtersReducer';
|
|
11
|
+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
12
|
+
import { faUndo } from '@fortawesome/free-solid-svg-icons';
|
|
12
13
|
export const useResetView = () => {
|
|
13
14
|
const { t } = useSharedTranslation();
|
|
14
15
|
const { dispatch } = useViewSettingsContext();
|
|
@@ -18,7 +19,7 @@ export const useResetView = () => {
|
|
|
18
19
|
filtersDispatch({ type: FiltersActionTypes.RESTORE_INITIAL_VIEW_SETTINGS });
|
|
19
20
|
};
|
|
20
21
|
return {
|
|
21
|
-
resetViewButton: (_jsx(KitButton, { type: "action", icon: _jsx(
|
|
22
|
+
resetViewButton: (_jsx(KitButton, { type: "action", icon: _jsx(FontAwesomeIcon, { icon: faUndo }), onClick: _resetView, children: t('explorer.viewList.reinit-view') })),
|
|
22
23
|
};
|
|
23
24
|
};
|
|
24
25
|
//# sourceMappingURL=useResetView.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useResetView.js","sourceRoot":"","sources":["../../../../../src/components/Explorer/manage-view-settings/save-view/useResetView.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,SAAS,EAAC,MAAM,YAAY,CAAC;AACrC,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAC,sBAAsB,EAAC,MAAM,+CAA+C,CAAC;AACrF,OAAO,EAAC,uBAAuB,EAAC,MAAM,4CAA4C,CAAC;AACnF,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"useResetView.js","sourceRoot":"","sources":["../../../../../src/components/Explorer/manage-view-settings/save-view/useResetView.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,SAAS,EAAC,MAAM,YAAY,CAAC;AACrC,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAC,sBAAsB,EAAC,MAAM,+CAA+C,CAAC;AACrF,OAAO,EAAC,uBAAuB,EAAC,MAAM,4CAA4C,CAAC;AACnF,OAAO,EAAC,iBAAiB,EAAC,MAAM,0CAA0C,CAAC;AAC3E,OAAO,EAAC,kBAAkB,EAAC,MAAM,+CAA+C,CAAC;AACjF,OAAO,EAAC,eAAe,EAAC,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAC,MAAM,EAAC,MAAM,mCAAmC,CAAC;AAEzD,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,EAAE;IAC7B,MAAM,EAAC,CAAC,EAAC,GAAG,oBAAoB,EAAE,CAAC;IACnC,MAAM,EAAC,QAAQ,EAAC,GAAG,sBAAsB,EAAE,CAAC;IAC5C,MAAM,EAAC,QAAQ,EAAE,eAAe,EAAC,GAAG,iBAAiB,EAAE,CAAC;IAExD,MAAM,UAAU,GAAG,GAAG,EAAE;QACpB,QAAQ,CAAC,EAAC,IAAI,EAAE,uBAAuB,CAAC,6BAA6B,EAAC,CAAC,CAAC;QACxE,eAAe,CAAC,EAAC,IAAI,EAAE,kBAAkB,CAAC,6BAA6B,EAAC,CAAC,CAAC;IAC9E,CAAC,CAAC;IAEF,OAAO;QACH,eAAe,EAAE,CACb,KAAC,SAAS,IAAC,IAAI,EAAC,QAAQ,EAAC,IAAI,EAAE,KAAC,eAAe,IAAC,IAAI,EAAE,MAAM,GAAI,EAAE,OAAO,EAAE,UAAU,YAChF,CAAC,CAAC,+BAA+B,CAAC,GAC3B,CACf;KACJ,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 {KitButton} from 'aristid-ds';\nimport {useSharedTranslation} from '_ui/hooks/useSharedTranslation';\nimport {useViewSettingsContext} from '../store-view-settings/useViewSettingsContext';\nimport {ViewSettingsActionTypes} from '../store-view-settings/viewSettingsReducer';\nimport {useFiltersContext} from '_ui/components/Filters/useFiltersContext';\nimport {FiltersActionTypes} from '_ui/components/Filters/context/filtersReducer';\nimport {FontAwesomeIcon} from '@fortawesome/react-fontawesome';\nimport {faUndo} from '@fortawesome/free-solid-svg-icons';\n\nexport const useResetView = () => {\n const {t} = useSharedTranslation();\n const {dispatch} = useViewSettingsContext();\n const {dispatch: filtersDispatch} = useFiltersContext();\n\n const _resetView = () => {\n dispatch({type: ViewSettingsActionTypes.RESTORE_INITIAL_VIEW_SETTINGS});\n filtersDispatch({type: FiltersActionTypes.RESTORE_INITIAL_VIEW_SETTINGS});\n };\n\n return {\n resetViewButton: (\n <KitButton type=\"action\" icon={<FontAwesomeIcon icon={faUndo} />} onClick={_resetView}>\n {t('explorer.viewList.reinit-view')}\n </KitButton>\n ),\n };\n};\n"]}
|
|
@@ -4,7 +4,6 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
4
4
|
// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
|
|
5
5
|
import { useSharedTranslation } from '../../../../hooks/useSharedTranslation';
|
|
6
6
|
import { KitButton } from 'aristid-ds';
|
|
7
|
-
import { FaShare } from 'react-icons/fa';
|
|
8
7
|
import { useViewSettingsContext } from '../store-view-settings/useViewSettingsContext';
|
|
9
8
|
import { useEffect, useState } from 'react';
|
|
10
9
|
import useExecuteSaveViewMutation from '../../../../hooks/useExecuteSaveViewMutation';
|
|
@@ -14,6 +13,8 @@ import { mapViewTypeFromExplorerToLegacy } from '../../_constants';
|
|
|
14
13
|
import { useMeQuery } from '../../../../_gqlTypes';
|
|
15
14
|
import { useTransformFilters } from '../../../../components/Filters/useTransformFilters';
|
|
16
15
|
import { useFiltersContext } from '../../../../components/Filters';
|
|
16
|
+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
17
|
+
import { faShare } from '@fortawesome/free-solid-svg-icons';
|
|
17
18
|
export const useShareView = () => {
|
|
18
19
|
const { t } = useSharedTranslation();
|
|
19
20
|
const { view, dispatch } = useViewSettingsContext();
|
|
@@ -60,7 +61,7 @@ export const useShareView = () => {
|
|
|
60
61
|
}
|
|
61
62
|
};
|
|
62
63
|
return {
|
|
63
|
-
shareViewButton: !view.viewId || (isSharedView && !isOwnerView) ? null : (_jsx(KitButton, { type: "action", icon: _jsx(
|
|
64
|
+
shareViewButton: !view.viewId || (isSharedView && !isOwnerView) ? null : (_jsx(KitButton, { type: "action", icon: _jsx(FontAwesomeIcon, { icon: faShare }), onClick: _toggleShareView, children: isSharedView ? t('explorer.viewList.unshare-view') : t('explorer.viewList.share-view') })),
|
|
64
65
|
};
|
|
65
66
|
};
|
|
66
67
|
//# sourceMappingURL=useShareView.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useShareView.js","sourceRoot":"","sources":["../../../../../src/components/Explorer/manage-view-settings/save-view/useShareView.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAC,SAAS,EAAC,MAAM,YAAY,CAAC;AACrC,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"useShareView.js","sourceRoot":"","sources":["../../../../../src/components/Explorer/manage-view-settings/save-view/useShareView.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAC,SAAS,EAAC,MAAM,YAAY,CAAC;AACrC,OAAO,EAAC,sBAAsB,EAAC,MAAM,+CAA+C,CAAC;AACrF,OAAO,EAAC,SAAS,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AAC1C,OAAO,0BAA0B,MAAM,sCAAsC,CAAC;AAC9E,OAAO,EAAC,uBAAuB,EAAC,MAAM,4CAA4C,CAAC;AACnF,OAAO,EAAC,qBAAqB,EAAC,MAAM,yBAAyB,CAAC;AAE9D,OAAO,EAAC,+BAA+B,EAAC,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AACzC,OAAO,EAAC,mBAAmB,EAAC,MAAM,4CAA4C,CAAC;AAC/E,OAAO,EAAC,iBAAiB,EAAC,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAC,eAAe,EAAC,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAC,OAAO,EAAC,MAAM,mCAAmC,CAAC;AAE1D,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,EAAE;I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C,CAAC,8BAA8B,CAAC,GAC/E,CACf;KACR,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 {useSharedTranslation} from '_ui/hooks/useSharedTranslation';\nimport {KitButton} from 'aristid-ds';\nimport {useViewSettingsContext} from '../store-view-settings/useViewSettingsContext';\nimport {useEffect, useState} from 'react';\nimport useExecuteSaveViewMutation from '_ui/hooks/useExecuteSaveViewMutation';\nimport {ViewSettingsActionTypes} from '../store-view-settings/viewSettingsReducer';\nimport {prepareViewForRequest} from './prepareViewForRequest';\nimport {type IViewDisplay} from '_ui/types';\nimport {mapViewTypeFromExplorerToLegacy} from '../../_constants';\nimport {useMeQuery} from '_ui/_gqlTypes';\nimport {useTransformFilters} from '_ui/components/Filters/useTransformFilters';\nimport {useFiltersContext} from '_ui/components/Filters';\nimport {FontAwesomeIcon} from '@fortawesome/react-fontawesome';\nimport {faShare} from '@fortawesome/free-solid-svg-icons';\n\nexport const useShareView = () => {\n const {t} = useSharedTranslation();\n const {view, dispatch} = useViewSettingsContext();\n const {filtersData} = useFiltersContext();\n const {saveView} = useExecuteSaveViewMutation();\n const {toValidFilters} = useTransformFilters();\n const [isSharedView, setIsSharedView] = useState(false);\n const [isOwnerView, setIsOwnerView] = useState(false);\n\n const {data: userData} = useMeQuery();\n\n useEffect(() => {\n const currentView = view.savedViews.find(v => v.id === view.viewId);\n if (currentView === undefined) {\n return;\n }\n setIsSharedView(currentView.shared ?? false);\n setIsOwnerView(currentView.ownerId === userData?.me?.whoAmI?.id);\n }, [view.viewId]);\n\n const _toggleShareView = async () => {\n const mappedView = {\n ...prepareViewForRequest(view, filtersData.filters, view.viewLabels),\n shared: !isSharedView,\n id: view.viewId,\n };\n\n const {data} = await saveView({\n view: mappedView,\n });\n\n setIsSharedView(!isSharedView);\n if (data) {\n dispatch({\n type: ViewSettingsActionTypes.UPDATE_VIEWS,\n payload: {\n id: data.saveView.id,\n ownerId: data.saveView.created_by.id,\n label: data.saveView.label,\n shared: data.saveView.shared,\n filters: toValidFilters(data.saveView.filters),\n sort: data.saveView.sort ?? [],\n display: (data.saveView.display as IViewDisplay) ?? {\n type: mapViewTypeFromExplorerToLegacy[view.viewType],\n },\n attributes: data.saveView?.attributes?.map(({id}) => id) ?? [],\n },\n });\n }\n };\n\n return {\n shareViewButton:\n !view.viewId || (isSharedView && !isOwnerView) ? null : (\n <KitButton type=\"action\" icon={<FontAwesomeIcon icon={faShare} />} onClick={_toggleShareView}>\n {isSharedView ? t('explorer.viewList.unshare-view') : t('explorer.viewList.share-view')}\n </KitButton>\n ),\n };\n};\n"]}
|
|
@@ -3,7 +3,6 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
3
3
|
// This file is released under LGPL V3
|
|
4
4
|
// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
|
|
5
5
|
import { KitButton } from 'aristid-ds';
|
|
6
|
-
import { FaSave } from 'react-icons/fa';
|
|
7
6
|
import { useSharedTranslation } from '../../../../hooks/useSharedTranslation';
|
|
8
7
|
import { useViewSettingsContext } from '../store-view-settings/useViewSettingsContext';
|
|
9
8
|
import { ViewSettingsActionTypes } from '../store-view-settings/viewSettingsReducer';
|
|
@@ -15,6 +14,8 @@ import { useMeQuery } from '../../../../_gqlTypes';
|
|
|
15
14
|
import { useTransformFilters } from '../../../../components/Filters/useTransformFilters';
|
|
16
15
|
import { useFiltersContext } from '../../../../components/Filters/useFiltersContext';
|
|
17
16
|
import { FiltersActionTypes } from '../../../../components/Filters/context/filtersReducer';
|
|
17
|
+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
18
|
+
import { faSave } from '@fortawesome/free-solid-svg-icons';
|
|
18
19
|
export const useUpdateView = () => {
|
|
19
20
|
const { t } = useSharedTranslation();
|
|
20
21
|
const { toValidFilters } = useTransformFilters();
|
|
@@ -71,7 +72,7 @@ export const useUpdateView = () => {
|
|
|
71
72
|
}
|
|
72
73
|
};
|
|
73
74
|
return {
|
|
74
|
-
updateViewButton: !view.viewId || !view.savedViews.length || !isOwnerView ? null : (_jsx(KitButton, { type: "action", icon: _jsx(
|
|
75
|
+
updateViewButton: !view.viewId || !view.savedViews.length || !isOwnerView ? null : (_jsx(KitButton, { type: "action", icon: _jsx(FontAwesomeIcon, { icon: faSave }), onClick: _updateView, children: t('global.save') })),
|
|
75
76
|
};
|
|
76
77
|
};
|
|
77
78
|
//# sourceMappingURL=useUpdateView.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useUpdateView.js","sourceRoot":"","sources":["../../../../../src/components/Explorer/manage-view-settings/save-view/useUpdateView.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,SAAS,EAAC,MAAM,YAAY,CAAC;AACrC,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"useUpdateView.js","sourceRoot":"","sources":["../../../../../src/components/Explorer/manage-view-settings/save-view/useUpdateView.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,SAAS,EAAC,MAAM,YAAY,CAAC;AACrC,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAC,sBAAsB,EAAC,MAAM,+CAA+C,CAAC;AACrF,OAAO,EAAC,uBAAuB,EAAC,MAAM,4CAA4C,CAAC;AACnF,OAAO,4BAA4B,MAAM,6CAA6C,CAAC;AACvF,OAAO,EAAC,qBAAqB,EAAC,MAAM,yBAAyB,CAAC;AAE9D,OAAO,EAAC,+BAA+B,EAAC,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AAClD,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AAEzC,OAA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AE,kBAAkB,CAAC,YAAY;gBACrC,OAAO,EAAE;oBACL,GAAG,WAAW;oBACd,MAAM,EAAE,IAAI,CAAC,UAAU,CAAC,EAAE;oBAC1B,OAAO,EAAE,IAAI,CAAC,UAAU,CAAC,OAAqB;iBACjD;aACJ,CAAC,CAAC;QACP,CAAC;IACL,CAAC,CAAC;IAEF,OAAO;QACH,gBAAgB,EACZ,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAC7D,KAAC,SAAS,IAAC,IAAI,EAAC,QAAQ,EAAC,IAAI,EAAE,KAAC,eAAe,IAAC,IAAI,EAAE,MAAM,GAAI,EAAE,OAAO,EAAE,WAAW,YACjF,CAAC,CAAC,aAAa,CAAC,GACT,CACf;KACR,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 {KitButton} from 'aristid-ds';\nimport {useSharedTranslation} from '_ui/hooks/useSharedTranslation';\nimport {useViewSettingsContext} from '../store-view-settings/useViewSettingsContext';\nimport {ViewSettingsActionTypes} from '../store-view-settings/viewSettingsReducer';\nimport useExecuteUpdateViewMutation from '../../_queries/useExecuteUpdateViewMutation';\nimport {prepareViewForRequest} from './prepareViewForRequest';\nimport {type IViewDisplay} from '_ui/types';\nimport {mapViewTypeFromExplorerToLegacy} from '../../_constants';\nimport {useEffect, useRef, useState} from 'react';\nimport {useMeQuery} from '_ui/_gqlTypes';\nimport {type IUserView} from '../../_types';\nimport {useTransformFilters} from '_ui/components/Filters/useTransformFilters';\nimport {useFiltersContext} from '_ui/components/Filters/useFiltersContext';\nimport {FiltersActionTypes} from '_ui/components/Filters/context/filtersReducer';\nimport {type UIFilter} from '_ui/components/Filters/_types';\nimport {FontAwesomeIcon} from '@fortawesome/react-fontawesome';\nimport {faSave} from '@fortawesome/free-solid-svg-icons';\n\nexport const useUpdateView = () => {\n const {t} = useSharedTranslation();\n const {toValidFilters} = useTransformFilters();\n const {view, dispatch} = useViewSettingsContext();\n const {filtersData, dispatch: filtersDispatch} = useFiltersContext();\n const {updateView} = useExecuteUpdateViewMutation();\n const [isOwnerView, setIsOwnerView] = useState(false);\n const currentView = useRef<IUserView | undefined>();\n\n const {data: userData} = useMeQuery();\n\n useEffect(() => {\n currentView.current = view.savedViews.find(v => v.id === view.viewId);\n if (currentView.current === undefined) {\n return;\n }\n setIsOwnerView(currentView.current.ownerId === userData?.me?.whoAmI?.id);\n }, [view.viewId]);\n\n const _updateView = async () => {\n if (!view.viewId) {\n return;\n }\n const mappedView = {\n ...prepareViewForRequest(view, filtersData.filters, view.viewLabels),\n id: view.viewId,\n shared: currentView.current?.shared ?? false,\n };\n\n const {data} = await updateView({\n view: mappedView,\n });\n\n if (data) {\n const validFilters = toValidFilters(data.updateView.filters);\n dispatch({\n type: ViewSettingsActionTypes.UPDATE_VIEWS,\n payload: {\n id: data.updateView.id,\n ownerId: data.updateView.created_by.id,\n label: data.updateView.label,\n shared: data.updateView.shared,\n filters: validFilters,\n sort: data.updateView.sort ?? [],\n display: (data.updateView.display as IViewDisplay) ?? {\n type: mapViewTypeFromExplorerToLegacy[view.viewType],\n },\n attributes: data.updateView?.attributes?.map(({id}) => id) ?? [],\n },\n });\n filtersDispatch({\n type: FiltersActionTypes.UPDATE_VIEWS,\n payload: {\n ...filtersData,\n viewId: data.updateView.id,\n filters: data.updateView.filters as UIFilter[],\n },\n });\n }\n };\n\n return {\n updateViewButton:\n !view.viewId || !view.savedViews.length || !isOwnerView ? null : (\n <KitButton type=\"action\" icon={<FontAwesomeIcon icon={faSave} />} onClick={_updateView}>\n {t('global.save')}\n </KitButton>\n ),\n };\n};\n"]}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { FaEye, FaEyeSlash, FaSearch } from 'react-icons/fa';
|
|
3
2
|
import { KitInput, KitTypography } from 'aristid-ds';
|
|
4
3
|
import styled from 'styled-components';
|
|
5
4
|
import { useSharedTranslation } from '../../../../hooks/useSharedTranslation';
|
|
@@ -10,6 +9,8 @@ import { useAttributeDetailsData } from '../_shared/useAttributeDetailsData';
|
|
|
10
9
|
import { ViewSettingsActionTypes } from '../store-view-settings/viewSettingsReducer';
|
|
11
10
|
import { useViewSettingsContext } from '../store-view-settings/useViewSettingsContext';
|
|
12
11
|
import { SortListItem } from './SortListItem';
|
|
12
|
+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
13
|
+
import { faSearch, faEye, faEyeSlash } from '@fortawesome/free-solid-svg-icons';
|
|
13
14
|
const StyledListContainer = styled.div `
|
|
14
15
|
display: flex;
|
|
15
16
|
flex-direction: column;
|
|
@@ -20,10 +21,10 @@ const StyledList = styled.ul `
|
|
|
20
21
|
list-style: none;
|
|
21
22
|
color: var(--general-utilities-text-primary);
|
|
22
23
|
`;
|
|
23
|
-
const StyledEyeSlash = styled(
|
|
24
|
+
const StyledEyeSlash = styled(FontAwesomeIcon) `
|
|
24
25
|
color: var(--general-utilities-neutral-dark);
|
|
25
26
|
`;
|
|
26
|
-
const StyledFaEye = styled(
|
|
27
|
+
const StyledFaEye = styled(FontAwesomeIcon) `
|
|
27
28
|
color: var(--general-utilities-neutral-deepDark);
|
|
28
29
|
`;
|
|
29
30
|
export const SortItems = ({ libraryId }) => {
|
|
@@ -97,13 +98,13 @@ export const SortItems = ({ libraryId }) => {
|
|
|
97
98
|
},
|
|
98
99
|
},
|
|
99
100
|
}, visibilityButtonProps: {
|
|
100
|
-
icon: _jsx(StyledFaEye, {}),
|
|
101
|
+
icon: _jsx(StyledFaEye, { icon: faEye }),
|
|
101
102
|
title: String(t('explorer.hide')),
|
|
102
103
|
onClick: _toggleColumnVisibility(field),
|
|
103
|
-
} }, field))) }) }) })), _jsx(KitTypography.Title, { level: "h4", children: t('explorer.available-attributes') }), _jsx(KitInput, { placeholder: String(t('global.search')), onChange: onSearchChanged, allowClear: true, prefix: _jsx(
|
|
104
|
+
} }, field))) }) }) })), _jsx(KitTypography.Title, { level: "h4", children: t('explorer.available-attributes') }), _jsx(KitInput, { placeholder: String(t('global.search')), onChange: onSearchChanged, allowClear: true, prefix: _jsx(FontAwesomeIcon, { icon: faSearch }) }), _jsx(StyledList, { "aria-label": t('explorer.sort-list.inactive'), children: inactiveFilters.map(field => (_jsx(SortListItem, { attributeId: field, filterChipProps: {
|
|
104
105
|
label: attributeDetailsById[field].label,
|
|
105
106
|
}, visibilityButtonProps: {
|
|
106
|
-
icon: _jsx(StyledEyeSlash, {}),
|
|
107
|
+
icon: _jsx(StyledEyeSlash, { icon: faEyeSlash }),
|
|
107
108
|
title: String(t('explorer.show')),
|
|
108
109
|
onClick: _toggleColumnVisibility(field),
|
|
109
110
|
} }, field))) })] }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SortItems.js","sourceRoot":"","sources":["../../../../../src/components/Explorer/manage-view-settings/sort-items/SortItems.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAC,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAC,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAC,QAAQ,EAAE,aAAa,EAAC,MAAM,YAAY,CAAC;AACnD,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAC,SAAS,EAAC,MAAM,eAAe,CAAC;AACxC,OAAO,EACH,aAAa,EACb,UAAU,EAEV,cAAc,EACd,aAAa,EACb,SAAS,EACT,UAAU,GACb,MAAM,eAAe,CAAC;AACvB,OAAO,EAAC,eAAe,EAAE,2BAA2B,EAAE,2BAA2B,EAAC,MAAM,mBAAmB,CAAC;AAC5G,OAAO,EAAC,uBAAuB,EAAC,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,CAAC,GACO,IACK,CACzB,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 FunctionComponent} from 'react';\nimport {FaEye, FaEyeSlash, FaSearch} from 'react-icons/fa';\nimport {KitInput, KitTypography} from 'aristid-ds';\nimport styled from 'styled-components';\nimport {useSharedTranslation} from '_ui/hooks/useSharedTranslation';\nimport {SortOrder} from '_ui/_gqlTypes';\nimport {\n closestCenter,\n DndContext,\n type DragEndEvent,\n KeyboardSensor,\n PointerSensor,\n useSensor,\n useSensors,\n} from '@dnd-kit/core';\nimport {SortableContext, sortableKeyboardCoordinates, verticalListSortingStrategy} from '@dnd-kit/sortable';\nimport {useAttributeDetailsData} from '../_shared/useAttributeDetailsData';\nimport {ViewSettingsActionTypes} from '../store-view-settings/viewSettingsReducer';\nimport {useViewSettingsContext} from '../store-view-settings/useViewSettingsContext';\nimport {SortListItem} from './SortListItem';\n\nconst StyledListContainer = styled.div`\n display: flex;\n flex-direction: column;\n`;\n\nconst StyledList = styled.ul`\n padding: calc(var(--general-spacing-s) * 1px) 0;\n margin: 0;\n list-style: none;\n color: var(--general-utilities-text-primary);\n`;\n\nconst StyledEyeSlash = styled(FaEyeSlash)`\n color: var(--general-utilities-neutral-dark);\n`;\n\nconst StyledFaEye = styled(FaEye)`\n color: var(--general-utilities-neutral-deepDark);\n`;\n\nexport const SortItems: FunctionComponent<{libraryId: string}> = ({libraryId}) => {\n const {t} = useSharedTranslation();\n const {view, dispatch} = useViewSettingsContext();\n\n const {onSearchChanged, searchFilteredColumnsIds, attributeDetailsById} = useAttributeDetailsData(libraryId);\n\n const sensors = useSensors(\n useSensor(PointerSensor),\n useSensor(KeyboardSensor, {\n coordinateGetter: sortableKeyboardCoordinates,\n }),\n );\n\n const _toggleColumnVisibility = (field: string) => () => {\n const isAttributeAlreadySorting = view.sort.some(sortItem => sortItem.field === field);\n if (isAttributeAlreadySorting) {\n dispatch({\n type: ViewSettingsActionTypes.REMOVE_SORT,\n payload: {\n field,\n },\n });\n } else {\n dispatch({\n type: ViewSettingsActionTypes.ADD_SORT,\n payload: {\n order: SortOrder.asc,\n field,\n },\n });\n }\n };\n\n const _changeOrderActiveFilterTo = (field: string) => (order: SortOrder) =>\n dispatch({\n type: ViewSettingsActionTypes.CHANGE_SORT_ORDER,\n payload: {\n field,\n order,\n },\n });\n\n const _handleDragEnd = ({active: draggedElement, over: dropTarget}: DragEndEvent) => {\n const indexFrom = activeFilters.findIndex(({field}) => field === String(draggedElement.id));\n const indexTo = activeFilters.findIndex(({field}) => field === String(dropTarget?.id));\n\n if (!dropTarget || indexFrom === indexTo || indexTo === -1) {\n return;\n }\n\n dispatch({type: ViewSettingsActionTypes.MOVE_SORT, payload: {indexFrom, indexTo}});\n };\n\n const activeFilters = view.sort.filter(({field}) => searchFilteredColumnsIds.includes(field));\n const inactiveFilters = searchFilteredColumnsIds.filter(field =>\n view.sort.every(sortItem => sortItem.field !== field),\n );\n\n return (\n <StyledListContainer>\n {activeFilters.length > 0 && (\n <StyledList aria-label={t('explorer.sort-list.active')}>\n <DndContext sensors={sensors} collisionDetection={closestCenter} onDragEnd={_handleDragEnd}>\n <SortableContext\n items={activeFilters.map(({field}) => ({id: field}))}\n strategy={verticalListSortingStrategy}\n >\n {activeFilters.map(({field, order}) => (\n <SortListItem\n key={field}\n attributeId={field}\n isDraggable\n filterChipProps={{\n label: attributeDetailsById[field].label,\n values: [\n order === SortOrder.asc\n ? t('explorer.sort-ascending')\n : t('explorer.sort-descending'),\n ],\n expandable: true,\n dropDownProps: {\n menu: {\n selectable: true,\n selectedKeys: [order],\n items: [\n {\n key: SortOrder.asc,\n label: t('explorer.sort-ascending'),\n },\n {\n key: SortOrder.desc,\n label: t('explorer.sort-descending'),\n },\n ],\n onSelect: ({selectedKeys: [newOrder]}) =>\n _changeOrderActiveFilterTo(field)(newOrder as SortOrder),\n onDeselect: ({selectedKeys: [newOrder]}) =>\n _changeOrderActiveFilterTo(field)(newOrder as SortOrder),\n },\n },\n }}\n visibilityButtonProps={{\n icon: <StyledFaEye />,\n title: String(t('explorer.hide')),\n onClick: _toggleColumnVisibility(field),\n }}\n />\n ))}\n </SortableContext>\n </DndContext>\n </StyledList>\n )}\n <KitTypography.Title level=\"h4\">{t('explorer.available-attributes')}</KitTypography.Title>\n <KitInput\n placeholder={String(t('global.search'))}\n onChange={onSearchChanged}\n allowClear\n prefix={<FaSearch />}\n />\n <StyledList aria-label={t('explorer.sort-list.inactive')}>\n {inactiveFilters.map(field => (\n <SortListItem\n key={field}\n attributeId={field}\n filterChipProps={{\n label: attributeDetailsById[field].label,\n }}\n visibilityButtonProps={{\n icon: <StyledEyeSlash />,\n title: String(t('explorer.show')),\n onClick: _toggleColumnVisibility(field),\n }}\n />\n ))}\n </StyledList>\n </StyledListContainer>\n );\n};\n"]}
|
|
1
|
+
{"version":3,"file":"SortItems.js","sourceRoot":"","sources":["../../../../../src/components/Explorer/manage-view-settings/sort-items/SortItems.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAC,QAAQ,EAAE,aAAa,EAAC,MAAM,YAAY,CAAC;AACnD,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAC,SAAS,EAAC,MAAM,eAAe,CAAC;AACxC,OAAO,EACH,aAAa,EACb,UAAU,EAEV,cAAc,EACd,aAAa,EACb,SAAS,EACT,UAAU,GACb,MAAM,eAAe,CAAC;AACvB,OAAO,EAAC,eAAe,EAAE,2BAA2B,EAAE,2BAA2B,EAAC,MAAM,mBAAmB,CAAC;AAC5G,OAAO,EAAC,uBAAuB,EAAC,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EAAC,uBAAuB,EAAC,MAAM,4CAA4C,CAAC;AACnF,OAAO,EAAC,sBAAsB,EAAC,MAAM,+CAA+C,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,CAAC;wBACjC,OAAO,EAAE,uBAAuB,CAAC,KAAK,CAAC;qBAC1C,IATI,KAAK,CAUZ,CACL,CAAC,GACO,IACK,CACzB,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 FunctionComponent} from 'react';\nimport {KitInput, KitTypography} from 'aristid-ds';\nimport styled from 'styled-components';\nimport {useSharedTranslation} from '_ui/hooks/useSharedTranslation';\nimport {SortOrder} from '_ui/_gqlTypes';\nimport {\n closestCenter,\n DndContext,\n type DragEndEvent,\n KeyboardSensor,\n PointerSensor,\n useSensor,\n useSensors,\n} from '@dnd-kit/core';\nimport {SortableContext, sortableKeyboardCoordinates, verticalListSortingStrategy} from '@dnd-kit/sortable';\nimport {useAttributeDetailsData} from '../_shared/useAttributeDetailsData';\nimport {ViewSettingsActionTypes} from '../store-view-settings/viewSettingsReducer';\nimport {useViewSettingsContext} from '../store-view-settings/useViewSettingsContext';\nimport {SortListItem} from './SortListItem';\nimport {FontAwesomeIcon} from '@fortawesome/react-fontawesome';\nimport {faSearch, faEye, faEyeSlash} from '@fortawesome/free-solid-svg-icons';\n\nconst StyledListContainer = styled.div`\n display: flex;\n flex-direction: column;\n`;\n\nconst StyledList = styled.ul`\n padding: calc(var(--general-spacing-s) * 1px) 0;\n margin: 0;\n list-style: none;\n color: var(--general-utilities-text-primary);\n`;\n\nconst StyledEyeSlash = styled(FontAwesomeIcon)`\n color: var(--general-utilities-neutral-dark);\n`;\n\nconst StyledFaEye = styled(FontAwesomeIcon)`\n color: var(--general-utilities-neutral-deepDark);\n`;\n\nexport const SortItems: FunctionComponent<{libraryId: string}> = ({libraryId}) => {\n const {t} = useSharedTranslation();\n const {view, dispatch} = useViewSettingsContext();\n\n const {onSearchChanged, searchFilteredColumnsIds, attributeDetailsById} = useAttributeDetailsData(libraryId);\n\n const sensors = useSensors(\n useSensor(PointerSensor),\n useSensor(KeyboardSensor, {\n coordinateGetter: sortableKeyboardCoordinates,\n }),\n );\n\n const _toggleColumnVisibility = (field: string) => () => {\n const isAttributeAlreadySorting = view.sort.some(sortItem => sortItem.field === field);\n if (isAttributeAlreadySorting) {\n dispatch({\n type: ViewSettingsActionTypes.REMOVE_SORT,\n payload: {\n field,\n },\n });\n } else {\n dispatch({\n type: ViewSettingsActionTypes.ADD_SORT,\n payload: {\n order: SortOrder.asc,\n field,\n },\n });\n }\n };\n\n const _changeOrderActiveFilterTo = (field: string) => (order: SortOrder) =>\n dispatch({\n type: ViewSettingsActionTypes.CHANGE_SORT_ORDER,\n payload: {\n field,\n order,\n },\n });\n\n const _handleDragEnd = ({active: draggedElement, over: dropTarget}: DragEndEvent) => {\n const indexFrom = activeFilters.findIndex(({field}) => field === String(draggedElement.id));\n const indexTo = activeFilters.findIndex(({field}) => field === String(dropTarget?.id));\n\n if (!dropTarget || indexFrom === indexTo || indexTo === -1) {\n return;\n }\n\n dispatch({type: ViewSettingsActionTypes.MOVE_SORT, payload: {indexFrom, indexTo}});\n };\n\n const activeFilters = view.sort.filter(({field}) => searchFilteredColumnsIds.includes(field));\n const inactiveFilters = searchFilteredColumnsIds.filter(field =>\n view.sort.every(sortItem => sortItem.field !== field),\n );\n\n return (\n <StyledListContainer>\n {activeFilters.length > 0 && (\n <StyledList aria-label={t('explorer.sort-list.active')}>\n <DndContext sensors={sensors} collisionDetection={closestCenter} onDragEnd={_handleDragEnd}>\n <SortableContext\n items={activeFilters.map(({field}) => ({id: field}))}\n strategy={verticalListSortingStrategy}\n >\n {activeFilters.map(({field, order}) => (\n <SortListItem\n key={field}\n attributeId={field}\n isDraggable\n filterChipProps={{\n label: attributeDetailsById[field].label,\n values: [\n order === SortOrder.asc\n ? t('explorer.sort-ascending')\n : t('explorer.sort-descending'),\n ],\n expandable: true,\n dropDownProps: {\n menu: {\n selectable: true,\n selectedKeys: [order],\n items: [\n {\n key: SortOrder.asc,\n label: t('explorer.sort-ascending'),\n },\n {\n key: SortOrder.desc,\n label: t('explorer.sort-descending'),\n },\n ],\n onSelect: ({selectedKeys: [newOrder]}) =>\n _changeOrderActiveFilterTo(field)(newOrder as SortOrder),\n onDeselect: ({selectedKeys: [newOrder]}) =>\n _changeOrderActiveFilterTo(field)(newOrder as SortOrder),\n },\n },\n }}\n visibilityButtonProps={{\n icon: <StyledFaEye icon={faEye} />,\n title: String(t('explorer.hide')),\n onClick: _toggleColumnVisibility(field),\n }}\n />\n ))}\n </SortableContext>\n </DndContext>\n </StyledList>\n )}\n <KitTypography.Title level=\"h4\">{t('explorer.available-attributes')}</KitTypography.Title>\n <KitInput\n placeholder={String(t('global.search'))}\n onChange={onSearchChanged}\n allowClear\n prefix={<FontAwesomeIcon icon={faSearch} />}\n />\n <StyledList aria-label={t('explorer.sort-list.inactive')}>\n {inactiveFilters.map(field => (\n <SortListItem\n key={field}\n attributeId={field}\n filterChipProps={{\n label: attributeDetailsById[field].label,\n }}\n visibilityButtonProps={{\n icon: <StyledEyeSlash icon={faEyeSlash} />,\n title: String(t('explorer.show')),\n onClick: _toggleColumnVisibility(field),\n }}\n />\n ))}\n </StyledList>\n </StyledListContainer>\n );\n};\n"]}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import styled from 'styled-components';
|
|
3
|
-
import { FaGripLines } from 'react-icons/fa';
|
|
4
3
|
import { KitButton, KitFilter } from 'aristid-ds';
|
|
5
4
|
import { useSortable } from '@dnd-kit/sortable';
|
|
6
5
|
import { CSS } from '@dnd-kit/utilities';
|
|
6
|
+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
7
|
+
import { faGripLines } from '@fortawesome/free-solid-svg-icons';
|
|
7
8
|
const StyledSortListItem = styled.li `
|
|
8
9
|
display: flex;
|
|
9
10
|
justify-content: space-between;
|
|
@@ -27,6 +28,6 @@ export const SortListItem = ({ attributeId, isDraggable, visibilityButtonProps,
|
|
|
27
28
|
transform: CSS.Transform.toString(transform),
|
|
28
29
|
transition,
|
|
29
30
|
};
|
|
30
|
-
return (_jsxs(StyledSortListItem, { ref: setNodeRef, style: style, children: [_jsxs("div", { children: [isDraggable && (_jsx(StyledDragHandle, { ...attributes, ...listeners, "$isDragging": isDragging, children: _jsx(
|
|
31
|
+
return (_jsxs(StyledSortListItem, { ref: setNodeRef, style: style, children: [_jsxs("div", { children: [isDraggable && (_jsx(StyledDragHandle, { ...attributes, ...listeners, "$isDragging": isDragging, children: _jsx(FontAwesomeIcon, { icon: faGripLines }) })), _jsx(KitFilter, { ...filterChipProps }, attributeId)] }), _jsx(KitButton, { size: "m", type: "tertiary", ...visibilityButtonProps })] }));
|
|
31
32
|
};
|
|
32
33
|
//# sourceMappingURL=SortListItem.js.map
|