@leav/ui 1.14.0 → 1.15.0-64b980c3
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/components/EditTreeModal/EditTree/EditTreeInfo/EditTreeInfoForm/TreeLibrariesForm/TreeLibrariesForm.js +1 -1
- package/dist/components/EditTreeModal/EditTree/EditTreeInfo/EditTreeInfoForm/TreeLibrariesForm/TreeLibrariesForm.js.map +1 -1
- package/dist/components/Explorer/Explorer.d.ts +9 -3
- package/dist/components/Explorer/Explorer.js +32 -17
- package/dist/components/Explorer/Explorer.js.map +1 -1
- package/dist/components/Explorer/ExplorerFiltersAndSorts.js +1 -0
- package/dist/components/Explorer/ExplorerFiltersAndSorts.js.map +1 -1
- package/dist/components/Explorer/ExplorerTitle.js +1 -1
- package/dist/components/Explorer/ExplorerTitle.js.map +1 -1
- package/dist/components/Explorer/TableCell.js +7 -6
- package/dist/components/Explorer/TableCell.js.map +1 -1
- package/dist/components/Explorer/TableNameCell.js +2 -3
- package/dist/components/Explorer/TableNameCell.js.map +1 -1
- package/dist/components/Explorer/_types.d.ts +3 -1
- package/dist/components/Explorer/_types.js.map +1 -1
- package/dist/components/Explorer/actions-item/useEditStatusItemAction.js +1 -1
- package/dist/components/Explorer/actions-item/useEditStatusItemAction.js.map +1 -1
- package/dist/components/Explorer/actions-mass/useDeactivateMassAction.js +1 -1
- package/dist/components/Explorer/actions-mass/useDeactivateMassAction.js.map +1 -1
- package/dist/components/Explorer/actions-mass/useDeleteLinkValues.js +1 -1
- package/dist/components/Explorer/actions-mass/useDeleteLinkValues.js.map +1 -1
- package/dist/components/Explorer/list-saved-views/SavedViews.js +6 -4
- package/dist/components/Explorer/list-saved-views/SavedViews.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings-v2/useOpenViewSettingsV2.d.ts +18 -0
- package/dist/components/Explorer/manage-view-settings-v2/useOpenViewSettingsV2.js +41 -0
- package/dist/components/Explorer/manage-view-settings-v2/useOpenViewSettingsV2.js.map +1 -0
- package/dist/components/Explorer/useLoadView.d.ts +10 -1
- package/dist/components/Explorer/useLoadView.js +2 -6
- package/dist/components/Explorer/useLoadView.js.map +1 -1
- package/dist/components/Explorer/useLoadViewById.d.ts +25 -0
- package/dist/components/Explorer/useLoadViewById.js +28 -0
- package/dist/components/Explorer/useLoadViewById.js.map +1 -0
- package/dist/components/Explorer/useViewSettingsReducer.js +3 -2
- package/dist/components/Explorer/useViewSettingsReducer.js.map +1 -1
- package/dist/components/Filters/filter-items/filter-type/tree/useTreeNodeSelection.js +25 -10
- package/dist/components/Filters/filter-items/filter-type/tree/useTreeNodeSelection.js.map +1 -1
- package/dist/components/ImportModal/ImportModalConfigStep/ImportSheetSettings/ImportSheetSettings.js +1 -1
- package/dist/components/ImportModal/ImportModalConfigStep/ImportSheetSettings/ImportSheetSettings.js.map +1 -1
- package/dist/components/RecordCard/RecordCard.js +1 -1
- package/dist/components/RecordCard/RecordCard.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordButtons/SidebarButton.js +1 -1
- package/dist/components/RecordEdition/EditRecordButtons/SidebarButton.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/tag/link-record/useLinkRecord.js +1 -2
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/tag/link-record/useLinkRecord.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/shared/ComputeIndicator.js +1 -2
- package/dist/components/RecordEdition/EditRecordContent/uiElements/shared/ComputeIndicator.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/shared/DeleteAllValuesButton.js +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/shared/DeleteAllValuesButton.js.map +1 -1
- package/dist/components/RecordEdition/hooks/useCreateCancelConfirm/useCreateCancelConfirm.js +1 -1
- package/dist/components/RecordEdition/hooks/useCreateCancelConfirm/useCreateCancelConfirm.js.map +1 -1
- package/dist/components/SelectTreeNode/SelectTreeNode.js +1 -1
- package/dist/components/SelectTreeNode/SelectTreeNode.js.map +1 -1
- package/dist/components/TriggerPreviewsGenerationModal/TriggerPreviewsGenerationModal.js +1 -1
- package/dist/components/TriggerPreviewsGenerationModal/TriggerPreviewsGenerationModal.js.map +1 -1
- package/dist/components/ValuesVersionConfigurator/VersionTree/VersionTree.js +1 -1
- package/dist/components/ValuesVersionConfigurator/VersionTree/VersionTree.js.map +1 -1
- package/dist/constants.d.ts +0 -1
- package/dist/constants.js +0 -1
- package/dist/constants.js.map +1 -1
- package/dist/hooks/index.d.ts +4 -8
- package/dist/hooks/index.js +4 -8
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/useIFrameMessengerClient/IFrameMessengerClientContext.d.ts +20 -0
- package/dist/hooks/useIFrameMessengerClient/IFrameMessengerClientContext.js +3 -0
- package/dist/hooks/useIFrameMessengerClient/IFrameMessengerClientContext.js.map +1 -0
- package/dist/hooks/useIFrameMessengerClient/{IFrameMessengerClient.d.ts → IFrameMessengerClientProvider.d.ts} +1 -1
- package/dist/hooks/useIFrameMessengerClient/IFrameMessengerClientProvider.js +13 -0
- package/dist/hooks/useIFrameMessengerClient/IFrameMessengerClientProvider.js.map +1 -0
- package/dist/hooks/useIFrameMessengerClient/index.d.ts +2 -0
- package/dist/hooks/useIFrameMessengerClient/index.js +3 -0
- package/dist/hooks/useIFrameMessengerClient/index.js.map +1 -0
- package/dist/hooks/useIFrameMessengerClient/useIFrameMessengerClient.d.ts +14 -13
- package/dist/hooks/useIFrameMessengerClient/useIFrameMessengerClient.js +2 -2
- package/dist/hooks/useIFrameMessengerClient/useIFrameMessengerClient.js.map +1 -1
- package/dist/hooks/useLang/__mocks__/useLang.js.map +1 -1
- package/dist/hooks/useLang/useLang.js.map +1 -1
- package/dist/hooks/usePanelMessenger/PanelMessengerProvider.d.ts +13 -0
- package/dist/hooks/{useIFrameMessenger/useIFrameMessengerContext.js → usePanelMessenger/PanelMessengerProvider.js} +22 -12
- package/dist/hooks/usePanelMessenger/PanelMessengerProvider.js.map +1 -0
- package/dist/hooks/usePanelMessenger/index.d.ts +6 -0
- package/dist/hooks/usePanelMessenger/index.js +6 -0
- package/dist/hooks/usePanelMessenger/index.js.map +1 -0
- package/dist/hooks/{useIFrameMessenger → usePanelMessenger}/messageHandlers.d.ts +2 -2
- package/dist/hooks/{useIFrameMessenger → usePanelMessenger}/messageHandlers.js +1 -1
- package/dist/hooks/usePanelMessenger/messageHandlers.js.map +1 -0
- package/dist/hooks/usePanelMessenger/panelMessengerContext.d.ts +10 -0
- package/dist/hooks/{useIFrameMessenger/iFrameMessengerContext.js → usePanelMessenger/panelMessengerContext.js} +2 -2
- package/dist/hooks/usePanelMessenger/panelMessengerContext.js.map +1 -0
- package/dist/hooks/{useIFrameMessenger → usePanelMessenger}/schema.d.ts +9 -0
- package/dist/hooks/{useIFrameMessenger → usePanelMessenger}/schema.js +10 -0
- package/dist/hooks/usePanelMessenger/schema.js.map +1 -0
- package/dist/hooks/{useIFrameMessenger → usePanelMessenger}/types.d.ts +20 -9
- package/dist/hooks/usePanelMessenger/types.js.map +1 -0
- package/dist/hooks/usePanelMessenger/usePanelEventHandlers.d.ts +10 -0
- package/dist/hooks/usePanelMessenger/usePanelEventHandlers.js +15 -0
- package/dist/hooks/usePanelMessenger/usePanelEventHandlers.js.map +1 -0
- package/dist/hooks/{useIFrameMessenger/useIFrameMessengerHandlers.d.ts → usePanelMessenger/usePanelIFrameHandlers.d.ts} +3 -3
- package/dist/hooks/{useIFrameMessenger/useIFrameMessengerHandlers.js → usePanelMessenger/usePanelIFrameHandlers.js} +5 -5
- package/dist/hooks/usePanelMessenger/usePanelIFrameHandlers.js.map +1 -0
- package/dist/hooks/{useIFrameMessenger/useIFrameMessenger.d.ts → usePanelMessenger/usePanelMessenger.d.ts} +3 -3
- package/dist/hooks/{useIFrameMessenger/useIFrameMessenger.js → usePanelMessenger/usePanelMessenger.js} +25 -4
- package/dist/hooks/usePanelMessenger/usePanelMessenger.js.map +1 -0
- package/dist/locales/en/shared.json +7 -1
- package/dist/locales/fr/shared.json +7 -1
- package/dist/testing/MockedLangContextProvider/MockedLangContextProvider.js +1 -1
- package/dist/testing/MockedLangContextProvider/MockedLangContextProvider.js.map +1 -1
- package/package.json +13 -12
- package/dist/hooks/useConfirmModal/__mocks__/index.d.ts +0 -1
- package/dist/hooks/useConfirmModal/__mocks__/index.js +0 -2
- package/dist/hooks/useConfirmModal/__mocks__/index.js.map +0 -1
- package/dist/hooks/useConfirmModal/index.d.ts +0 -1
- package/dist/hooks/useConfirmModal/index.js +0 -2
- package/dist/hooks/useConfirmModal/index.js.map +0 -1
- package/dist/hooks/useIFrameMessenger/iFrameMessengerContext.d.ts +0 -8
- package/dist/hooks/useIFrameMessenger/iFrameMessengerContext.js.map +0 -1
- package/dist/hooks/useIFrameMessenger/messageHandlers.js.map +0 -1
- package/dist/hooks/useIFrameMessenger/schema.js.map +0 -1
- package/dist/hooks/useIFrameMessenger/types.js.map +0 -1
- package/dist/hooks/useIFrameMessenger/useIFrameMessenger.js.map +0 -1
- package/dist/hooks/useIFrameMessenger/useIFrameMessengerContext.d.ts +0 -13
- package/dist/hooks/useIFrameMessenger/useIFrameMessengerContext.js.map +0 -1
- package/dist/hooks/useIFrameMessenger/useIFrameMessengerHandlers.js.map +0 -1
- package/dist/hooks/useIFrameMessenger/useNativePanelMessengerHandlers.d.ts +0 -14
- package/dist/hooks/useIFrameMessenger/useNativePanelMessengerHandlers.js +0 -19
- package/dist/hooks/useIFrameMessenger/useNativePanelMessengerHandlers.js.map +0 -1
- package/dist/hooks/useIFrameMessengerClient/IFrameMessengerClient.js +0 -13
- package/dist/hooks/useIFrameMessengerClient/IFrameMessengerClient.js.map +0 -1
- package/dist/hooks/useIFrameMessengerClient/iFrameMessengerClientContext.d.ts +0 -19
- package/dist/hooks/useIFrameMessengerClient/iFrameMessengerClientContext.js +0 -3
- package/dist/hooks/useIFrameMessengerClient/iFrameMessengerClientContext.js.map +0 -1
- package/dist/hooks/useLang/__mocks__/index.d.ts +0 -2
- package/dist/hooks/useLang/__mocks__/index.js +0 -3
- package/dist/hooks/useLang/__mocks__/index.js.map +0 -1
- package/dist/hooks/useLang/index.d.ts +0 -2
- package/dist/hooks/useLang/index.js +0 -3
- package/dist/hooks/useLang/index.js.map +0 -1
- /package/dist/hooks/{useIFrameMessenger → usePanelMessenger}/types.js +0 -0
|
@@ -5,7 +5,7 @@ import { Button, Collapse, Form, List, Select, Space, Switch } from 'antd';
|
|
|
5
5
|
import { useState } from 'react';
|
|
6
6
|
import styled from 'styled-components';
|
|
7
7
|
import { PreviewSize } from '../../../../../../constants';
|
|
8
|
-
import useLang from '../../../../../../hooks/useLang';
|
|
8
|
+
import useLang from '../../../../../../hooks/useLang/useLang';
|
|
9
9
|
import { useSharedTranslation } from '../../../../../../hooks/useSharedTranslation';
|
|
10
10
|
import { EntityCard } from '../../../../../EntityCard';
|
|
11
11
|
import FieldsGroup from '../../../../../FieldsGroup';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeLibrariesForm.js","sourceRoot":"","sources":["../../../../../../../src/components/EditTreeModal/EditTree/EditTreeInfo/EditTreeInfoForm/TreeLibrariesForm/TreeLibrariesForm.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,aAAa,EAAE,YAAY,EAAC,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAC,oBAAoB,EAAC,MAAM,aAAa,CAAC;AACjD,OAAO,EAAC,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAC,MAAM,MAAM,CAAC;AACzE,OAAO,EAAsC,QAAQ,EAAC,MAAM,OAAO,CAAC;AACpE,OAAO,MAAwB,MAAM,mBAAmB,CAAC;AAEzD,OAAO,EAAC,WAAW,EAAC,MAAM,6BAA6B,CAAC;AACxD,OAAO,OAAO,MAAM,iCAAiC,CAAC;AACtD,OAAO,EAAC,oBAAoB,EAAC,MAAM,8CAA8C,CAAC;A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yBAAyB,EAClC,IAAI,EAAE,mBAAmB,EACzB,QAAQ,EAAE,0BAA0B,EACpC,QAAQ,QACR,QAAQ,EAAE,iBAAiB,EAC3B,YAAY,EAAE,KAAK,GACrB,CACL,IACF,CACN,CAAC;AACN,CAAC;AAED,eAAe,iBAAiB,CAAC","sourcesContent":["import {CloseOutlined, PlusOutlined} from '@ant-design/icons';\nimport {localizedTranslation} from '@leav/utils';\nimport {Button, Collapse, Form, List, Select, Space, Switch} from 'antd';\nimport {type ComponentProps, type ReactNode, useState} from 'react';\nimport styled, {type CSSObject} from 'styled-components';\nimport {type LibraryLightFragment, type TreeDetailsFragment} from '../../../../../../_gqlTypes';\nimport {PreviewSize} from '../../../../../../constants';\nimport useLang from '../../../../../../hooks/useLang';\nimport {useSharedTranslation} from '../../../../../../hooks/useSharedTranslation';\nimport {EntityCard, type IEntityData} from '../../../../../EntityCard';\nimport FieldsGroup from '../../../../../FieldsGroup';\nimport {LibraryPicker} from '../../../../../LibraryPicker';\n\nconst RemoveButton = styled(CloseOutlined)`\n cursor: pointer;\n align-self: flex-start;\n`;\n\nconst ListItemPart = styled.div<{style?: CSSObject}>`\n display: flex;\n padding: 0.5rem;\n width: 100%;\n gap: 1rem;\n\n ${props => props.style}\n`;\n\nconst ALL_CHILDREN_ALLOWED_KEY = '__all__';\n\ninterface ITreeLibrariesFormProps {\n onChange: (libraries: TreeDetailsFragment['libraries']) => void;\n readOnly?: boolean;\n extra?: ReactNode;\n}\n\nfunction TreeLibrariesForm({onChange, extra, readOnly}: ITreeLibrariesFormProps): JSX.Element {\n const {t} = useSharedTranslation();\n const {lang} = useLang();\n const form = Form.useFormInstance();\n const libraries: TreeDetailsFragment['libraries'] = form.getFieldValue('libraries') ?? [];\n const [isLibraryPickerOpen, setIsLibraryPickerOpen] = useState(false);\n\n const _handleLibrariesChange = (newLibraries: TreeDetailsFragment['libraries']) => {\n form.setFieldValue('libraries', newLibraries);\n onChange(newLibraries);\n };\n\n const _handleAddLibrary = () => {\n setIsLibraryPickerOpen(true);\n };\n const _handleCloseLibraryPicker = () => setIsLibraryPickerOpen(false);\n const _handleSubmitLibraryPicker = (selectedLibraries: LibraryLightFragment[]) => {\n const addedLibraries = selectedLibraries.map(library => ({\n library: {id: library.id, label: library.label},\n settings: {allowMultiplePositions: false, allowedAtRoot: true, allowedChildren: [ALL_CHILDREN_ALLOWED_KEY]},\n }));\n\n const newLibraries = [...libraries, ...addedLibraries];\n _handleLibrariesChange(newLibraries);\n };\n const _handleRemoveLibrary = (libraryId: string) => () => {\n const newLibraries = libraries.filter(library => library.library.id !== libraryId);\n _handleLibrariesChange(newLibraries);\n };\n\n const _handleSwitchChange = (libraryId: string, field: string) => (checked: boolean) => {\n const newLibraries = libraries.map(library => {\n if (library.library.id === libraryId) {\n return {\n ...library,\n settings: {...library.settings, [field]: checked},\n };\n }\n\n return library;\n });\n\n _handleLibrariesChange(newLibraries);\n };\n\n const _handleAllowedChildrenChange = (libraryId: string, index: number) => (allowedChildren: string[]) => {\n const previousValue =\n libraries.find(library => library.library.id === libraryId)?.settings.allowedChildren ?? [];\n\n let selectedChildren = allowedChildren;\n const didAllowAllChildren = previousValue.includes(ALL_CHILDREN_ALLOWED_KEY);\n const nowAllowAllChildren = allowedChildren.includes(ALL_CHILDREN_ALLOWED_KEY);\n if (!nowAllowAllChildren && didAllowAllChildren) {\n selectedChildren = allowedChildren.filter(child => child !== ALL_CHILDREN_ALLOWED_KEY);\n }\n\n if (nowAllowAllChildren && !didAllowAllChildren) {\n selectedChildren = [ALL_CHILDREN_ALLOWED_KEY];\n }\n\n const newLibraries = libraries.map(library => {\n if (library.library.id === libraryId) {\n return {\n ...library,\n settings: {...library.settings, allowedChildren: selectedChildren},\n };\n }\n\n return library;\n });\n\n _handleLibrariesChange(newLibraries);\n form.setFieldValue(['libraries', index, 'settings', 'allowedChildren'], selectedChildren);\n };\n\n const groupLabel = (\n <Space>\n {t('trees.linked_libraries')}\n {extra}\n </Space>\n );\n\n const renderListItem = (item: TreeDetailsFragment['libraries'][number], index: number) => {\n const itemIdentity: IEntityData = {\n label: localizedTranslation(item.library.label, lang),\n subLabel: item.library.id,\n color: null,\n preview: null,\n };\n\n const allowedChildrenOptions = [\n {key: ALL_CHILDREN_ALLOWED_KEY, value: ALL_CHILDREN_ALLOWED_KEY, label: t('trees.all_children_allowed')},\n {\n key: 'libraries',\n label: t('trees.libraries'),\n options: libraries.map(library => ({\n key: library.library.id,\n value: library.library.id,\n label: localizedTranslation(library.library.label, lang),\n disabled: form\n .getFieldValue(['libraries', index, 'settings', 'allowedChildren'])\n .includes(ALL_CHILDREN_ALLOWED_KEY),\n })),\n },\n ];\n\n const collapseItems: ComponentProps<typeof Collapse>['items'] = [\n {\n key: 'settings',\n label: t('trees.advanced_settings'),\n children: (\n <>\n <ListItemPart>\n <Form.Item\n name={['libraries', index, 'settings', 'allowMultiplePositions']}\n label={t('trees.allowed_multiple_positions')}\n valuePropName=\"checked\"\n style={{margin: 0}}\n >\n <Switch\n disabled={readOnly}\n onChange={_handleSwitchChange(item.library.id, 'allowMultiplePositions')}\n />\n </Form.Item>\n <Form.Item\n name={['libraries', index, 'settings', 'allowedAtRoot']}\n label={t('trees.allowed_at_root')}\n valuePropName=\"checked\"\n style={{margin: 0}}\n >\n <Switch\n disabled={readOnly}\n onChange={_handleSwitchChange(item.library.id, 'allowedAtRoot')}\n />\n </Form.Item>\n </ListItemPart>\n <ListItemPart>\n <Form.Item\n name={['libraries', index, 'settings', 'allowedChildren']}\n label={t('trees.allowed_children')}\n style={{margin: 0}}\n >\n <Select\n options={allowedChildrenOptions}\n onChange={_handleAllowedChildrenChange(item.library.id, index)}\n placeholder={t('trees.no_children_allowed')}\n mode=\"multiple\"\n allowClear\n disabled={readOnly}\n style={{minWidth: '15rem'}}\n aria-label=\"\"\n />\n </Form.Item>\n </ListItemPart>\n </>\n ),\n },\n ];\n\n return (\n <List.Item style={{flexDirection: 'column', padding: '5px 1rem'}}>\n <ListItemPart style={{justifyContent: 'space-between'}}>\n <EntityCard entity={itemIdentity} size={PreviewSize.SMALL} />\n {!readOnly && (\n <RemoveButton\n role=\"button\"\n aria-label=\"delete-library\"\n onClick={_handleRemoveLibrary(item.library.id)}\n />\n )}\n </ListItemPart>\n <Collapse size=\"small\" style={{width: '100%', margin: '0.5rem'}} items={collapseItems} />\n </List.Item>\n );\n };\n\n const listFooter = !readOnly ? (\n <Button icon={<PlusOutlined />} style={{border: 'none', boxShadow: 'none'}} onClick={_handleAddLibrary}>\n {t('trees.add_libraries')}\n </Button>\n ) : null;\n const selectedLibraries = libraries.map(library => library.library.id);\n\n return (\n <>\n <FieldsGroup label={groupLabel} style={{padding: 0}}>\n <List\n dataSource={libraries}\n renderItem={renderListItem}\n footer={listFooter}\n locale={{emptyText: t('trees.no_linked_libraries')}}\n style={{padding: 0}}\n />\n </FieldsGroup>\n {isLibraryPickerOpen && (\n <LibraryPicker\n onClose={_handleCloseLibraryPicker}\n open={isLibraryPickerOpen}\n onSubmit={_handleSubmitLibraryPicker}\n multiple\n selected={selectedLibraries}\n showSelected={false}\n />\n )}\n </>\n );\n}\n\nexport default TreeLibrariesForm;\n"]}
|
|
1
|
+
{"version":3,"file":"TreeLibrariesForm.js","sourceRoot":"","sources":["../../../../../../../src/components/EditTreeModal/EditTree/EditTreeInfo/EditTreeInfoForm/TreeLibrariesForm/TreeLibrariesForm.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,aAAa,EAAE,YAAY,EAAC,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAC,oBAAoB,EAAC,MAAM,aAAa,CAAC;AACjD,OAAO,EAAC,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAC,MAAM,MAAM,CAAC;AACzE,OAAO,EAAsC,QAAQ,EAAC,MAAM,OAAO,CAAC;AACpE,OAAO,MAAwB,MAAM,mBAAmB,CAAC;AAEzD,OAAO,EAAC,WAAW,EAAC,MAAM,6BAA6B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AAE,EAAC,OAAO,EAAE,CAAC,EAAC,GACrB,GACQ,EACb,mBAAmB,IAAI,CACpB,KAAC,aAAa,IACV,OAAO,EAAE,yBAAyB,EAClC,IAAI,EAAE,mBAAmB,EACzB,QAAQ,EAAE,0BAA0B,EACpC,QAAQ,QACR,QAAQ,EAAE,iBAAiB,EAC3B,YAAY,EAAE,KAAK,GACrB,CACL,IACF,CACN,CAAC;AACN,CAAC;AAED,eAAe,iBAAiB,CAAC","sourcesContent":["import {CloseOutlined, PlusOutlined} from '@ant-design/icons';\nimport {localizedTranslation} from '@leav/utils';\nimport {Button, Collapse, Form, List, Select, Space, Switch} from 'antd';\nimport {type ComponentProps, type ReactNode, useState} from 'react';\nimport styled, {type CSSObject} from 'styled-components';\nimport {type LibraryLightFragment, type TreeDetailsFragment} from '../../../../../../_gqlTypes';\nimport {PreviewSize} from '../../../../../../constants';\nimport useLang from '../../../../../../hooks/useLang/useLang';\nimport {useSharedTranslation} from '../../../../../../hooks/useSharedTranslation';\nimport {EntityCard, type IEntityData} from '../../../../../EntityCard';\nimport FieldsGroup from '../../../../../FieldsGroup';\nimport {LibraryPicker} from '../../../../../LibraryPicker';\n\nconst RemoveButton = styled(CloseOutlined)`\n cursor: pointer;\n align-self: flex-start;\n`;\n\nconst ListItemPart = styled.div<{style?: CSSObject}>`\n display: flex;\n padding: 0.5rem;\n width: 100%;\n gap: 1rem;\n\n ${props => props.style}\n`;\n\nconst ALL_CHILDREN_ALLOWED_KEY = '__all__';\n\ninterface ITreeLibrariesFormProps {\n onChange: (libraries: TreeDetailsFragment['libraries']) => void;\n readOnly?: boolean;\n extra?: ReactNode;\n}\n\nfunction TreeLibrariesForm({onChange, extra, readOnly}: ITreeLibrariesFormProps): JSX.Element {\n const {t} = useSharedTranslation();\n const {lang} = useLang();\n const form = Form.useFormInstance();\n const libraries: TreeDetailsFragment['libraries'] = form.getFieldValue('libraries') ?? [];\n const [isLibraryPickerOpen, setIsLibraryPickerOpen] = useState(false);\n\n const _handleLibrariesChange = (newLibraries: TreeDetailsFragment['libraries']) => {\n form.setFieldValue('libraries', newLibraries);\n onChange(newLibraries);\n };\n\n const _handleAddLibrary = () => {\n setIsLibraryPickerOpen(true);\n };\n const _handleCloseLibraryPicker = () => setIsLibraryPickerOpen(false);\n const _handleSubmitLibraryPicker = (selectedLibraries: LibraryLightFragment[]) => {\n const addedLibraries = selectedLibraries.map(library => ({\n library: {id: library.id, label: library.label},\n settings: {allowMultiplePositions: false, allowedAtRoot: true, allowedChildren: [ALL_CHILDREN_ALLOWED_KEY]},\n }));\n\n const newLibraries = [...libraries, ...addedLibraries];\n _handleLibrariesChange(newLibraries);\n };\n const _handleRemoveLibrary = (libraryId: string) => () => {\n const newLibraries = libraries.filter(library => library.library.id !== libraryId);\n _handleLibrariesChange(newLibraries);\n };\n\n const _handleSwitchChange = (libraryId: string, field: string) => (checked: boolean) => {\n const newLibraries = libraries.map(library => {\n if (library.library.id === libraryId) {\n return {\n ...library,\n settings: {...library.settings, [field]: checked},\n };\n }\n\n return library;\n });\n\n _handleLibrariesChange(newLibraries);\n };\n\n const _handleAllowedChildrenChange = (libraryId: string, index: number) => (allowedChildren: string[]) => {\n const previousValue =\n libraries.find(library => library.library.id === libraryId)?.settings.allowedChildren ?? [];\n\n let selectedChildren = allowedChildren;\n const didAllowAllChildren = previousValue.includes(ALL_CHILDREN_ALLOWED_KEY);\n const nowAllowAllChildren = allowedChildren.includes(ALL_CHILDREN_ALLOWED_KEY);\n if (!nowAllowAllChildren && didAllowAllChildren) {\n selectedChildren = allowedChildren.filter(child => child !== ALL_CHILDREN_ALLOWED_KEY);\n }\n\n if (nowAllowAllChildren && !didAllowAllChildren) {\n selectedChildren = [ALL_CHILDREN_ALLOWED_KEY];\n }\n\n const newLibraries = libraries.map(library => {\n if (library.library.id === libraryId) {\n return {\n ...library,\n settings: {...library.settings, allowedChildren: selectedChildren},\n };\n }\n\n return library;\n });\n\n _handleLibrariesChange(newLibraries);\n form.setFieldValue(['libraries', index, 'settings', 'allowedChildren'], selectedChildren);\n };\n\n const groupLabel = (\n <Space>\n {t('trees.linked_libraries')}\n {extra}\n </Space>\n );\n\n const renderListItem = (item: TreeDetailsFragment['libraries'][number], index: number) => {\n const itemIdentity: IEntityData = {\n label: localizedTranslation(item.library.label, lang),\n subLabel: item.library.id,\n color: null,\n preview: null,\n };\n\n const allowedChildrenOptions = [\n {key: ALL_CHILDREN_ALLOWED_KEY, value: ALL_CHILDREN_ALLOWED_KEY, label: t('trees.all_children_allowed')},\n {\n key: 'libraries',\n label: t('trees.libraries'),\n options: libraries.map(library => ({\n key: library.library.id,\n value: library.library.id,\n label: localizedTranslation(library.library.label, lang),\n disabled: form\n .getFieldValue(['libraries', index, 'settings', 'allowedChildren'])\n .includes(ALL_CHILDREN_ALLOWED_KEY),\n })),\n },\n ];\n\n const collapseItems: ComponentProps<typeof Collapse>['items'] = [\n {\n key: 'settings',\n label: t('trees.advanced_settings'),\n children: (\n <>\n <ListItemPart>\n <Form.Item\n name={['libraries', index, 'settings', 'allowMultiplePositions']}\n label={t('trees.allowed_multiple_positions')}\n valuePropName=\"checked\"\n style={{margin: 0}}\n >\n <Switch\n disabled={readOnly}\n onChange={_handleSwitchChange(item.library.id, 'allowMultiplePositions')}\n />\n </Form.Item>\n <Form.Item\n name={['libraries', index, 'settings', 'allowedAtRoot']}\n label={t('trees.allowed_at_root')}\n valuePropName=\"checked\"\n style={{margin: 0}}\n >\n <Switch\n disabled={readOnly}\n onChange={_handleSwitchChange(item.library.id, 'allowedAtRoot')}\n />\n </Form.Item>\n </ListItemPart>\n <ListItemPart>\n <Form.Item\n name={['libraries', index, 'settings', 'allowedChildren']}\n label={t('trees.allowed_children')}\n style={{margin: 0}}\n >\n <Select\n options={allowedChildrenOptions}\n onChange={_handleAllowedChildrenChange(item.library.id, index)}\n placeholder={t('trees.no_children_allowed')}\n mode=\"multiple\"\n allowClear\n disabled={readOnly}\n style={{minWidth: '15rem'}}\n aria-label=\"\"\n />\n </Form.Item>\n </ListItemPart>\n </>\n ),\n },\n ];\n\n return (\n <List.Item style={{flexDirection: 'column', padding: '5px 1rem'}}>\n <ListItemPart style={{justifyContent: 'space-between'}}>\n <EntityCard entity={itemIdentity} size={PreviewSize.SMALL} />\n {!readOnly && (\n <RemoveButton\n role=\"button\"\n aria-label=\"delete-library\"\n onClick={_handleRemoveLibrary(item.library.id)}\n />\n )}\n </ListItemPart>\n <Collapse size=\"small\" style={{width: '100%', margin: '0.5rem'}} items={collapseItems} />\n </List.Item>\n );\n };\n\n const listFooter = !readOnly ? (\n <Button icon={<PlusOutlined />} style={{border: 'none', boxShadow: 'none'}} onClick={_handleAddLibrary}>\n {t('trees.add_libraries')}\n </Button>\n ) : null;\n const selectedLibraries = libraries.map(library => library.library.id);\n\n return (\n <>\n <FieldsGroup label={groupLabel} style={{padding: 0}}>\n <List\n dataSource={libraries}\n renderItem={renderListItem}\n footer={listFooter}\n locale={{emptyText: t('trees.no_linked_libraries')}}\n style={{padding: 0}}\n />\n </FieldsGroup>\n {isLibraryPickerOpen && (\n <LibraryPicker\n onClose={_handleCloseLibraryPicker}\n open={isLibraryPickerOpen}\n onSubmit={_handleSubmitLibraryPicker}\n multiple\n selected={selectedLibraries}\n showSelected={false}\n />\n )}\n </>\n );\n}\n\nexport default TreeLibrariesForm;\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
2
|
import { type ISubmitMultipleResult } from '../../components/RecordEdition/EditRecordContent/_types';
|
|
3
|
-
import { type DefaultViewSettings, type Entrypoint, type FiltersChangePayload, type IItemAction, type IMassActions, type IPrimaryAction, type ViewConfigTab } from './_types';
|
|
4
3
|
import { type JoinLibraryContextFragment } from '../../_gqlTypes';
|
|
4
|
+
import { type DefaultViewSettings, type Entrypoint, type FiltersChangePayload, type IItemAction, type IMassActions, type IPrimaryAction, type SerializedView, type ViewSettingsShortcuts } from './_types';
|
|
5
5
|
export interface IExplorerProps {
|
|
6
6
|
entrypoint: Entrypoint;
|
|
7
7
|
noPagination?: true;
|
|
@@ -34,9 +34,13 @@ export interface IExplorerProps {
|
|
|
34
34
|
export?: IMassActions['callback'];
|
|
35
35
|
generatePreviews?: IMassActions['callback'];
|
|
36
36
|
};
|
|
37
|
-
|
|
37
|
+
viewSettings?: {
|
|
38
38
|
onFiltersChange?: (payload: FiltersChangePayload) => void;
|
|
39
|
-
|
|
39
|
+
onViewSettingsShortcutClick?: ({ settingName, viewId, }: {
|
|
40
|
+
settingName: ViewSettingsShortcuts;
|
|
41
|
+
viewId: string;
|
|
42
|
+
}) => void;
|
|
43
|
+
closeViewSettings?: () => void;
|
|
40
44
|
};
|
|
41
45
|
};
|
|
42
46
|
showCreateOnNoResultOnly?: boolean;
|
|
@@ -58,6 +62,8 @@ export interface IExplorerProps {
|
|
|
58
62
|
tableBodyHeight?: string;
|
|
59
63
|
creationFormId?: string;
|
|
60
64
|
joinLibraryContext?: JoinLibraryContextFragment;
|
|
65
|
+
currentView?: SerializedView;
|
|
66
|
+
loadedViewId?: string | null;
|
|
61
67
|
}
|
|
62
68
|
export interface IExplorerRef {
|
|
63
69
|
createAction: IPrimaryAction | null;
|
|
@@ -3,32 +3,33 @@ import { forwardRef, useImperativeHandle, useMemo } from 'react';
|
|
|
3
3
|
import { createPortal } from 'react-dom';
|
|
4
4
|
import { KitEmpty, KitSnackBarProvider, KitTypography } from 'aristid-ds';
|
|
5
5
|
import styled from 'styled-components';
|
|
6
|
-
import { Loading } from '../../components/Loading';
|
|
7
6
|
import { useSharedTranslation } from '../../hooks/useSharedTranslation';
|
|
7
|
+
import { Loading } from '../../components/Loading';
|
|
8
|
+
import { useFiltersReducer } from '../../components/Filters/context/useFiltersReducer';
|
|
9
|
+
import { FiltersContext } from '../../components/Filters/context/filtersContext';
|
|
8
10
|
import { useExplorerData } from './_queries/useExplorerData';
|
|
9
11
|
import { DataView } from './DataView';
|
|
10
12
|
import { ExplorerTitle } from './ExplorerTitle';
|
|
11
13
|
import { ExplorerToolbar } from './ExplorerToolbar';
|
|
12
14
|
import { useEditStatusItemAction } from './actions-item/useEditStatusItemAction';
|
|
15
|
+
import { useReplaceItemAction } from './actions-item/useReplaceItemAction';
|
|
13
16
|
import { usePrimaryActionsButton } from './actions-primary/usePrimaryActions';
|
|
14
17
|
import { useCreatePrimaryAction } from './actions-primary/useCreatePrimaryAction';
|
|
15
18
|
import { useLinkPrimaryAction } from './actions-primary/useLinkPrimaryAction';
|
|
16
19
|
import { useMassActions } from './actions-mass/useMassActions';
|
|
17
20
|
import { useDeactivateMassAction } from './actions-mass/useDeactivateMassAction';
|
|
21
|
+
import { useDeleteLinkValues } from './actions-mass/useDeleteLinkValues';
|
|
22
|
+
import { useExportMassAction } from './actions-mass/useExportMassAction';
|
|
23
|
+
import { useEditAttributeMassAction } from './actions-mass/useEditAttributeMassAction';
|
|
24
|
+
import { useGeneratePreviewsMassAction } from './actions-mass/useGeneratePreviewsMassAction';
|
|
18
25
|
import { defaultPageSizeOptions, SidePanel, useEditSettings, useOpenViewSettings, ViewSettingsContext, } from './manage-view-settings';
|
|
26
|
+
import { useOpenViewSettingsV2 } from './manage-view-settings-v2/useOpenViewSettingsV2';
|
|
19
27
|
import { useSearchInput } from './useSearchInput';
|
|
20
28
|
import { usePagination } from './usePagination';
|
|
21
29
|
import { useViewSettingsReducer } from './useViewSettingsReducer';
|
|
22
30
|
import { MASS_SELECTION_ALL, SNACKBAR_MASS_ID } from './_constants';
|
|
23
|
-
import { useDeleteLinkValues } from './actions-mass/useDeleteLinkValues';
|
|
24
|
-
import { useReplaceItemAction } from './actions-item/useReplaceItemAction';
|
|
25
|
-
import { useFiltersReducer } from '../../components/Filters/context/useFiltersReducer';
|
|
26
|
-
import { FiltersContext } from '../../components/Filters/context/filtersContext';
|
|
27
|
-
import { useExportMassAction } from './actions-mass/useExportMassAction';
|
|
28
|
-
import { useEditAttributeMassAction } from './actions-mass/useEditAttributeMassAction';
|
|
29
31
|
import { useExplorerCountData } from './_queries/useExplorerCountData';
|
|
30
|
-
import {
|
|
31
|
-
import { useNotifyFiltersChange } from './useNotifyFiltersChange';
|
|
32
|
+
import { useLoadViewById } from './useLoadViewById';
|
|
32
33
|
const isNotEmpty = (union) => union.length > 0;
|
|
33
34
|
const emptyArray = [];
|
|
34
35
|
const emptyObject = {};
|
|
@@ -50,10 +51,10 @@ const ExplorerEmptyDataStyled = styled.div `
|
|
|
50
51
|
align-items: center;
|
|
51
52
|
justify-content: center;
|
|
52
53
|
`;
|
|
53
|
-
export const Explorer = forwardRef(({ entrypoint, itemActions = [], primaryActions = [], massActions = [], title, selectionMode = 'multiple', emptyPlaceholder, noPagination, creationFormId, showCreateOnNoResultOnly = false, showFilters = false, showSorts = false, hideFirstActionLabel = false, disableSelection = false, hideSelectAllAction = false, showTitle = false, showSearch = false, hidePrimaryActions = false, hideTableHeader = false, useSmallHeaderSize = false, tableBodyHeight, ignoreViewByDefault = false, defaultActionsForItem = ['replaceLink', 'remove', 'activate'], defaultPrimaryActions = ['create'], defaultMassActions = ['deactivate', 'editAttribute', 'export', 'generatePreviews'], defaultCallbacks, defaultViewSettings, joinLibraryContext, }, ref) => {
|
|
54
|
+
export const Explorer = forwardRef(({ entrypoint, itemActions = [], primaryActions = [], massActions = [], title, selectionMode = 'multiple', emptyPlaceholder, noPagination, creationFormId, showCreateOnNoResultOnly = false, showFilters = false, showSorts = false, hideFirstActionLabel = false, disableSelection = false, hideSelectAllAction = false, showTitle = false, showSearch = false, hidePrimaryActions = false, hideTableHeader = false, useSmallHeaderSize = false, tableBodyHeight, ignoreViewByDefault = false, defaultActionsForItem = ['replaceLink', 'remove', 'activate'], defaultPrimaryActions = ['create'], defaultMassActions = ['deactivate', 'editAttribute', 'export', 'generatePreviews'], defaultCallbacks, defaultViewSettings, joinLibraryContext, currentView, loadedViewId, }, ref) => {
|
|
54
55
|
const { t } = useSharedTranslation();
|
|
55
|
-
const { panelElement: settingsPanelElement } = useEditSettings();
|
|
56
|
-
const { loading: viewSettingsLoading, view, dispatch: viewSettingsDispatch, } = useViewSettingsReducer(entrypoint, defaultViewSettings, ignoreViewByDefault);
|
|
56
|
+
const { panelElement: settingsPanelElement } = useEditSettings(); // TODO: should be conditional due to can be manager via app-studio only
|
|
57
|
+
const { loading: viewSettingsLoading, view, dispatch: viewSettingsDispatch, } = useViewSettingsReducer(entrypoint, defaultViewSettings, ignoreViewByDefault); // TODO: load all views, why should viewConfigPanel have to do it too? Can they communicate with each other (context)?
|
|
57
58
|
const { filtersData, dispatch: filtersDispatch } = useFiltersReducer({
|
|
58
59
|
libraryId: view.libraryId,
|
|
59
60
|
viewId: view.viewId ?? undefined,
|
|
@@ -62,11 +63,12 @@ export const Explorer = forwardRef(({ entrypoint, itemActions = [], primaryActio
|
|
|
62
63
|
ignoreViewByDefault,
|
|
63
64
|
skip: viewSettingsLoading,
|
|
64
65
|
});
|
|
65
|
-
|
|
66
|
+
useLoadViewById({
|
|
67
|
+
loadedViewId,
|
|
66
68
|
isLoading: viewSettingsLoading,
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
69
|
+
view,
|
|
70
|
+
viewSettingsDispatch,
|
|
71
|
+
filtersDispatch,
|
|
70
72
|
});
|
|
71
73
|
const { currentPage, setNewPageSize, setNewPage } = usePagination(viewSettingsDispatch);
|
|
72
74
|
const { data, isMultivalue, canEditLinkAttributeValues, loading: loadingData, refetch, } = useExplorerData({
|
|
@@ -196,6 +198,13 @@ export const Explorer = forwardRef(({ entrypoint, itemActions = [], primaryActio
|
|
|
196
198
|
actions: [createPrimaryAction, linkPrimaryAction, ...primaryActions].filter(Boolean),
|
|
197
199
|
hideFirstActionLabel,
|
|
198
200
|
});
|
|
201
|
+
const { viewSettingsShortcutsButtons } = useOpenViewSettingsV2({
|
|
202
|
+
isEnabled: defaultCallbacks?.viewSettings?.onViewSettingsShortcutClick !== undefined,
|
|
203
|
+
view: view,
|
|
204
|
+
open: !isMassSelectionAll,
|
|
205
|
+
closeViewSettings: defaultCallbacks?.viewSettings?.closeViewSettings,
|
|
206
|
+
onViewSettingsShortcutClick: defaultCallbacks?.viewSettings?.onViewSettingsShortcutClick,
|
|
207
|
+
});
|
|
199
208
|
const { viewSettingsButton, viewListButton } = useOpenViewSettings({ view, isEnabled: !isMassSelectionAll });
|
|
200
209
|
const { searchInput } = useSearchInput({ view, dispatch: viewSettingsDispatch, setNewPage });
|
|
201
210
|
useImperativeHandle(ref, () => ({
|
|
@@ -203,7 +212,13 @@ export const Explorer = forwardRef(({ entrypoint, itemActions = [], primaryActio
|
|
|
203
212
|
linkAction: linkPrimaryAction,
|
|
204
213
|
totalCount: totalCountFiltered,
|
|
205
214
|
}), [createPrimaryAction?.disabled, linkPrimaryAction?.disabled, totalCountFiltered]);
|
|
206
|
-
return (_jsxs(_Fragment, { children: [_jsx(FiltersContext.Provider, { value: { filtersData, dispatch: filtersDispatch }, children: _jsxs(ViewSettingsContext.Provider, { value: { view, dispatch: viewSettingsDispatch }, children: [_jsxs(ExplorerPageDivStyled, { children: [showTitle && (_jsx(ExplorerHeaderDivStyled, { children: _jsx(KitTypography.Title, { level: "h3", children: !viewSettingsLoading && (_jsx(ExplorerTitle, { library: view.libraryId, title: title, entrypoint: entrypoint })) /*TODO: manage loading*/ }) })), _jsxs(ExplorerToolbar, { showFilters: showFilters, showSorts: showSorts, isMassSelectionAll: isMassSelectionAll, headless: hideTableHeader, canRemoveFilters: view?.enableConfigureView ?? false, selectAllButton: hideSelectAllAction ? null : selectAllButton, viewSettingsLoading: viewSettingsLoading, children: [view?.enableConfigureView
|
|
215
|
+
return (_jsxs(_Fragment, { children: [_jsx(FiltersContext.Provider, { value: { filtersData, dispatch: filtersDispatch }, children: _jsxs(ViewSettingsContext.Provider, { value: { view, dispatch: viewSettingsDispatch }, children: [_jsxs(ExplorerPageDivStyled, { children: [showTitle && (_jsx(ExplorerHeaderDivStyled, { children: _jsx(KitTypography.Title, { level: "h3", children: !viewSettingsLoading && (_jsx(ExplorerTitle, { library: view.libraryId, title: title, entrypoint: entrypoint })) /*TODO: manage loading*/ }) })), _jsxs(ExplorerToolbar, { showFilters: showFilters, showSorts: showSorts, isMassSelectionAll: isMassSelectionAll, headless: hideTableHeader, canRemoveFilters: view?.enableConfigureView ?? false, selectAllButton: hideSelectAllAction ? null : selectAllButton, viewSettingsLoading: viewSettingsLoading, children: [view?.enableConfigureView &&
|
|
216
|
+
defaultCallbacks?.viewSettings?.onViewSettingsShortcutClick === undefined // TODO: can be refactored into a constant
|
|
217
|
+
? viewListButton
|
|
218
|
+
: null, showSearch ? searchInput : null, view?.enableConfigureView &&
|
|
219
|
+
defaultCallbacks?.viewSettings?.onViewSettingsShortcutClick === undefined // TODO: can be refactored into a constant
|
|
220
|
+
? viewSettingsButton
|
|
221
|
+
: null, view?.enableConfigureView && viewSettingsShortcutsButtons, hidePrimaryActions ? null : primaryButton] }), loadingData || viewSettingsLoading ? (_jsx(Loading, {})) : hasNoResults ? (_jsx(ExplorerEmptyDataStyled, { children: emptyPlaceholder || _jsx(KitEmpty, { title: t('explorer.empty-data') }) })) : (_jsx(DataView, { dataGroupedFilteredSorted: data?.records ?? emptyArray, attributesProperties: data?.attributes ?? emptyObject, attributesToDisplay:
|
|
207
222
|
/* ⚠️ whoAmI column will always be displayed first*/ view.attributesIds, hideTableHeader: hideTableHeader, useSmallHeaderSize: useSmallHeaderSize, paginationProps: entrypoint.type === 'library' && !noPagination
|
|
208
223
|
? {
|
|
209
224
|
pageSizeOptions: defaultPageSizeOptions,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Explorer.js","sourceRoot":"","sources":["../../../src/components/Explorer/Explorer.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,UAAU,EAAkB,mBAAmB,EAAE,OAAO,EAAC,MAAM,OAAO,CAAC;AAC/E,OAAO,EAAC,YAAY,EAAC,MAAM,WAAW,CAAC;AACvC,OAAO,EAAC,QAAQ,EAAE,mBAAmB,EAAE,aAAa,EAAC,MAAM,YAAY,CAAC;AACxE,OAAO,MAA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AC,MAAM,CAAC,EAAE,CAAC;4CAC5C,CAAC,CAAE,IAAI,CAAC,aAA0B;wCACtC,IAAI,EAAE,aAAa;qCACtB,EACD,eAAe,EAAE,eAAe,GAClC,CACL,IACmB,EACvB,oBAAoB,IAAI,YAAY,CAAC,KAAC,SAAS,KAAG,EAAE,oBAAoB,EAAE,EAAE,IAAI,QAAQ,CAAC,IAAI,CAAC,EAC9F,gBAAgB,EAChB,WAAW,EACX,SAAS,EACT,4BAA4B,EAC5B,WAAW,EACX,qBAAqB,IACK,GACT,EAC1B,KAAC,mBAAmB,IAAC,EAAE,EAAE,oBAAoB,GAAI,IAClD,CACN,CAAC;AACN,CAAC,CACJ,CAAC","sourcesContent":["import {forwardRef, type ReactNode, useImperativeHandle, useMemo} from 'react';\nimport {createPortal} from 'react-dom';\nimport {KitEmpty, KitSnackBarProvider, KitTypography} from 'aristid-ds';\nimport styled from 'styled-components';\nimport {Loading} from '_ui/components/Loading';\nimport {useSharedTranslation} from '_ui/hooks/useSharedTranslation';\nimport {type ISubmitMultipleResult} from '_ui/components/RecordEdition/EditRecordContent/_types';\nimport {\n type DefaultViewSettings,\n type Entrypoint,\n type FiltersChangePayload,\n type IItemAction,\n type IMassActions,\n type IPrimaryAction,\n type ViewConfigTab,\n} from './_types';\nimport {useExplorerData} from './_queries/useExplorerData';\nimport {DataView} from './DataView';\nimport {ExplorerTitle} from './ExplorerTitle';\nimport {ExplorerToolbar} from './ExplorerToolbar';\nimport {useEditStatusItemAction} from './actions-item/useEditStatusItemAction';\nimport {usePrimaryActionsButton} from './actions-primary/usePrimaryActions';\nimport {useCreatePrimaryAction} from './actions-primary/useCreatePrimaryAction';\nimport {useLinkPrimaryAction} from './actions-primary/useLinkPrimaryAction';\nimport {useMassActions} from './actions-mass/useMassActions';\nimport {useDeactivateMassAction} from './actions-mass/useDeactivateMassAction';\nimport {\n defaultPageSizeOptions,\n SidePanel,\n useEditSettings,\n useOpenViewSettings,\n ViewSettingsContext,\n} from './manage-view-settings';\nimport {useSearchInput} from './useSearchInput';\nimport {usePagination} from './usePagination';\nimport {useViewSettingsReducer} from './useViewSettingsReducer';\nimport {MASS_SELECTION_ALL, SNACKBAR_MASS_ID} from './_constants';\nimport {useDeleteLinkValues} from './actions-mass/useDeleteLinkValues';\nimport {useReplaceItemAction} from './actions-item/useReplaceItemAction';\nimport {type JoinLibraryContextFragment} from '_ui/_gqlTypes';\nimport {useFiltersReducer} from '_ui/components/Filters/context/useFiltersReducer';\nimport {FiltersContext} from '_ui/components/Filters/context/filtersContext';\nimport {useExportMassAction} from './actions-mass/useExportMassAction';\nimport {useEditAttributeMassAction} from './actions-mass/useEditAttributeMassAction';\nimport {useExplorerCountData} from './_queries/useExplorerCountData';\nimport {useGeneratePreviewsMassAction} from './actions-mass/useGeneratePreviewsMassAction';\nimport {useNotifyFiltersChange} from './useNotifyFiltersChange';\n\nconst isNotEmpty = <T extends unknown[]>(union: T): union is Exclude<T, []> => union.length > 0;\n\nconst emptyArray = [];\nconst emptyObject = {};\n\nconst ExplorerHeaderDivStyled = styled.div`\n display: flex;\n align-items: flex-start;\n padding: calc(var(--general-spacing-xs) * 1px);\n`;\n\nconst ExplorerPageDivStyled = styled.div`\n display: flex;\n flex-direction: column;\n height: 100%;\n overflow: hidden;\n`;\n\nconst ExplorerEmptyDataStyled = styled.div`\n flex: 1;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n`;\n\nexport interface IExplorerProps {\n entrypoint: Entrypoint;\n noPagination?: true;\n itemActions?: IItemAction[];\n primaryActions?: IPrimaryAction[];\n massActions?: IMassActions[];\n title?: string;\n selectionMode?: 'multiple' | 'simple';\n emptyPlaceholder?: ReactNode;\n defaultActionsForItem?: Array<'replaceLink' | 'remove' | 'activate'>;\n defaultPrimaryActions?: Array<'create'>;\n defaultMassActions?: Array<'deactivate' | 'export' | 'editAttribute' | 'generatePreviews'>;\n defaultViewSettings?: DefaultViewSettings;\n defaultCallbacks?: {\n item?: {\n edit?: IItemAction['callback'];\n replaceLink?: (replaceValuesResult: ISubmitMultipleResult) => void;\n remove?: IItemAction['callback'];\n select?: IItemAction['callback'];\n };\n primary?: {\n create?: ({\n recordIdCreated,\n saveValuesResultOnLink,\n }: {\n recordIdCreated: string;\n saveValuesResultOnLink?: ISubmitMultipleResult;\n }) => void;\n link?: (saveValuesResult: ISubmitMultipleResult) => void;\n };\n mass?: {\n deactivate?: IMassActions['callback'];\n export?: IMassActions['callback'];\n generatePreviews?: IMassActions['callback'];\n };\n viewConfig?: {\n onFiltersChange?: (payload: FiltersChangePayload) => void;\n onViewConfigTabClick?: (tab: ViewConfigTab) => void;\n };\n };\n showCreateOnNoResultOnly?: boolean;\n showFilters?: boolean;\n showSorts?: boolean;\n hideFirstActionLabel?: boolean;\n /**\n * Optional to `false` load the last added view when `props.defaultViewSettings.viewId` is `undefined`,\n * if set to `true` load default view.\n */\n ignoreViewByDefault?: boolean;\n showTitle?: boolean;\n showSearch?: boolean;\n disableSelection?: boolean;\n hideSelectAllAction?: boolean;\n hidePrimaryActions?: boolean;\n hideTableHeader?: boolean;\n useSmallHeaderSize?: boolean;\n tableBodyHeight?: string;\n creationFormId?: string;\n joinLibraryContext?: JoinLibraryContextFragment;\n}\n\nexport interface IExplorerRef {\n createAction: IPrimaryAction | null;\n linkAction: IPrimaryAction | null;\n totalCount: number;\n}\n\nexport const Explorer = forwardRef<IExplorerRef, IExplorerProps>(\n (\n {\n entrypoint,\n itemActions = [],\n primaryActions = [],\n massActions = [],\n title,\n selectionMode = 'multiple',\n emptyPlaceholder,\n noPagination,\n creationFormId,\n showCreateOnNoResultOnly = false,\n showFilters = false,\n showSorts = false,\n hideFirstActionLabel = false,\n disableSelection = false,\n hideSelectAllAction = false,\n showTitle = false,\n showSearch = false,\n hidePrimaryActions = false,\n hideTableHeader = false,\n useSmallHeaderSize = false,\n tableBodyHeight,\n ignoreViewByDefault = false,\n defaultActionsForItem = ['replaceLink', 'remove', 'activate'],\n defaultPrimaryActions = ['create'],\n defaultMassActions = ['deactivate', 'editAttribute', 'export', 'generatePreviews'],\n defaultCallbacks,\n defaultViewSettings,\n joinLibraryContext,\n },\n ref,\n ) => {\n const {t} = useSharedTranslation();\n\n const {panelElement: settingsPanelElement} = useEditSettings();\n\n const {\n loading: viewSettingsLoading,\n view,\n dispatch: viewSettingsDispatch,\n } = useViewSettingsReducer(entrypoint, defaultViewSettings, ignoreViewByDefault);\n\n const {filtersData, dispatch: filtersDispatch} = useFiltersReducer({\n libraryId: view.libraryId,\n viewId: view.viewId ?? undefined,\n filters: defaultViewSettings?.filters ?? undefined,\n filtersOperator: defaultViewSettings?.filtersOperator ?? undefined,\n ignoreViewByDefault,\n skip: viewSettingsLoading,\n });\n\n useNotifyFiltersChange({\n isLoading: viewSettingsLoading,\n filters: filtersData.filters,\n filtersOperator: filtersData.filtersOperator,\n onFiltersChange: defaultCallbacks?.viewConfig?.onFiltersChange,\n });\n\n const {currentPage, setNewPageSize, setNewPage} = usePagination(viewSettingsDispatch);\n\n const {\n data,\n isMultivalue,\n canEditLinkAttributeValues,\n loading: loadingData,\n refetch,\n } = useExplorerData({\n entrypoint,\n libraryId: view.libraryId,\n attributeIds: view.attributesIds,\n fulltextSearch: view.fulltextSearch,\n pagination: noPagination ? null : {limit: view.pageSize, offset: view.pageSize * (currentPage - 1)},\n sorts: view.sort,\n filters: filtersData.filters,\n filtersOperator: filtersData.filtersOperator,\n skip: viewSettingsLoading,\n }); // TODO: refresh when go back on page\n const isMassSelectionAll = view.massSelection === MASS_SELECTION_ALL;\n const isLink = entrypoint.type === 'link';\n\n const {editStatusItemAction} = useEditStatusItemAction({\n isEnabled:\n isNotEmpty(defaultActionsForItem) &&\n (defaultActionsForItem.includes('remove') || defaultActionsForItem.includes('activate')),\n onRemove: defaultCallbacks?.item?.remove,\n canDeleteLinkValues: canEditLinkAttributeValues,\n store: {view, dispatch: viewSettingsDispatch},\n entrypoint,\n });\n\n const {replaceItemAction, replaceItemModal} = useReplaceItemAction({\n isEnabled: isLink && isNotEmpty(defaultActionsForItem) && defaultActionsForItem.includes('replaceLink'),\n isMultivalue,\n onReplace: defaultCallbacks?.item?.replaceLink,\n canReplaceLinkValues: canEditLinkAttributeValues,\n columnsToDisplay: !joinLibraryContext ? view.attributesIds : [],\n });\n\n const totalCountFiltered = data?.totalCount ?? 0;\n\n const {countData: totalCountLibrary, refetchCount} = useExplorerCountData({\n entrypoint,\n libraryId: view.libraryId,\n defaultFilters: defaultViewSettings?.filters ?? [],\n filters: filtersData.filters,\n skip: viewSettingsLoading,\n });\n\n const hasNoResults = data === null || data.totalCount === 0;\n\n const isAllowedFreeEntry = !(entrypoint.type === 'library' && !entrypoint.allowFreeEntry);\n\n const showCreatePrimaryButton = showCreateOnNoResultOnly\n ? !hidePrimaryActions && !loadingData && hasNoResults && isAllowedFreeEntry\n : true;\n\n const {createPrimaryAction, createModal} = useCreatePrimaryAction({\n isEnabled: isNotEmpty(defaultPrimaryActions) && defaultPrimaryActions.includes('create'),\n isVisible: showCreatePrimaryButton,\n libraryId: view.libraryId,\n canCreateAndLinkValue: canEditLinkAttributeValues,\n onCreate: defaultCallbacks?.primary?.create,\n joinLibraryContext,\n entrypoint,\n isMultivalue,\n totalCount: totalCountFiltered,\n formId: creationFormId,\n refetch,\n refetchCount,\n });\n const {linkPrimaryAction, linkModal} = useLinkPrimaryAction({\n isEnabled: isLink,\n joinLibraryContext,\n isVisible: showCreatePrimaryButton,\n canAddLinkValue: canEditLinkAttributeValues,\n onLink: defaultCallbacks?.primary?.link,\n linkId: data?.totalCount === 0 ? undefined : data?.records[0]?.id_value,\n isMultivalue,\n maxItemsLeft: null, // TODO: use KitTable.row,\n columnsToDisplay: !joinLibraryContext ? view.attributesIds : [],\n });\n\n const allVisibleKeys = data?.records.map(({key}) => key) ?? [];\n\n const {generatePreviewsMassAction, GeneratePreviewsModal} = useGeneratePreviewsMassAction({\n isEnabled: !isLink && isNotEmpty(defaultMassActions) && defaultMassActions.includes('generatePreviews'),\n store: {view},\n totalCount: totalCountFiltered,\n onGeneratePreviews: defaultCallbacks?.mass?.generatePreviews,\n });\n\n const {exportMassAction, ExportModal} = useExportMassAction({\n isEnabled: !isLink && isNotEmpty(defaultMassActions) && defaultMassActions.includes('export'),\n store: {view, dispatch: viewSettingsDispatch},\n totalCount: totalCountFiltered,\n onExport: defaultCallbacks?.mass?.export,\n });\n\n const {editAttributeMassAction, editAttributeMassActionModal} = useEditAttributeMassAction({\n isEnabled: !isLink && isNotEmpty(defaultMassActions) && defaultMassActions.includes('editAttribute'),\n store: {view},\n totalCount: totalCountFiltered,\n });\n\n const {deactivateMassAction} = useDeactivateMassAction({\n isEnabled: !isLink && isNotEmpty(defaultMassActions) && defaultMassActions.includes('deactivate'),\n store: {view, dispatch: viewSettingsDispatch},\n allVisibleKeys,\n totalCount: totalCountFiltered,\n onDeactivate: defaultCallbacks?.mass?.deactivate,\n refetch,\n });\n\n const {unlinkMassAction} = useDeleteLinkValues({\n isEnabled: isLink && isNotEmpty(defaultMassActions) && defaultMassActions.includes('deactivate'),\n store: {view, dispatch: viewSettingsDispatch},\n filtersStore: filtersData,\n pagination: noPagination ? null : {limit: view.pageSize, offset: view.pageSize * (currentPage - 1)},\n allVisibleKeys,\n onDelete: defaultCallbacks?.mass?.deactivate,\n refetch,\n });\n\n const _isSelectionDisable = disableSelection || (isLink && !isMultivalue && totalCountFiltered > 0);\n\n const massActionSnackbarId = useMemo(() => `${SNACKBAR_MASS_ID}_${Date.now()}`, []);\n\n const {setSelectedKeys, selectAllButton} = useMassActions({\n isEnabled:\n totalCountFiltered > 0 &&\n !_isSelectionDisable &&\n (isNotEmpty(defaultMassActions) || isNotEmpty(massActions) || !!defaultCallbacks?.item?.select),\n store: {view, dispatch: viewSettingsDispatch},\n filtersStore: filtersData,\n totalCountFiltered,\n totalCountLibrary,\n allVisibleKeys,\n massActions: [\n generatePreviewsMassAction,\n exportMassAction,\n editAttributeMassAction,\n deactivateMassAction,\n unlinkMassAction,\n ...massActions,\n ].filter(Boolean),\n snackbarId: massActionSnackbarId,\n });\n\n const {primaryButton} = usePrimaryActionsButton({\n view,\n actions: [createPrimaryAction, linkPrimaryAction, ...primaryActions].filter(Boolean),\n hideFirstActionLabel,\n });\n\n const {viewSettingsButton, viewListButton} = useOpenViewSettings({view, isEnabled: !isMassSelectionAll});\n\n const {searchInput} = useSearchInput({view, dispatch: viewSettingsDispatch, setNewPage});\n\n useImperativeHandle(\n ref,\n () => ({\n createAction: createPrimaryAction,\n linkAction: linkPrimaryAction,\n totalCount: totalCountFiltered,\n }),\n [createPrimaryAction?.disabled, linkPrimaryAction?.disabled, totalCountFiltered],\n );\n\n return (\n <>\n <FiltersContext.Provider value={{filtersData, dispatch: filtersDispatch}}>\n <ViewSettingsContext.Provider value={{view, dispatch: viewSettingsDispatch}}>\n <ExplorerPageDivStyled>\n {showTitle && (\n <ExplorerHeaderDivStyled>\n <KitTypography.Title level=\"h3\">\n {\n !viewSettingsLoading && (\n <ExplorerTitle\n library={view.libraryId}\n title={title}\n entrypoint={entrypoint}\n />\n ) /*TODO: manage loading*/\n }\n </KitTypography.Title>\n </ExplorerHeaderDivStyled>\n )}\n <ExplorerToolbar\n showFilters={showFilters}\n showSorts={showSorts}\n isMassSelectionAll={isMassSelectionAll}\n headless={hideTableHeader}\n canRemoveFilters={view?.enableConfigureView ?? false}\n selectAllButton={hideSelectAllAction ? null : selectAllButton}\n viewSettingsLoading={viewSettingsLoading}\n >\n {view?.enableConfigureView ? viewListButton : null}\n {showSearch ? searchInput : null}\n {view?.enableConfigureView ? viewSettingsButton : null}\n {hidePrimaryActions ? null : primaryButton}\n </ExplorerToolbar>\n {loadingData || viewSettingsLoading ? (\n <Loading />\n ) : hasNoResults ? (\n <ExplorerEmptyDataStyled>\n {emptyPlaceholder || <KitEmpty title={t('explorer.empty-data')} />}\n </ExplorerEmptyDataStyled>\n ) : (\n <DataView\n dataGroupedFilteredSorted={data?.records ?? emptyArray}\n attributesProperties={data?.attributes ?? emptyObject}\n attributesToDisplay={\n /* ⚠️ whoAmI column will always be displayed first*/ view.attributesIds\n }\n hideTableHeader={hideTableHeader}\n useSmallHeaderSize={useSmallHeaderSize}\n paginationProps={\n entrypoint.type === 'library' && !noPagination\n ? {\n pageSizeOptions: defaultPageSizeOptions,\n currentPage,\n pageSize: view.pageSize,\n setNewPageSize,\n setNewPage,\n totalCount: totalCountFiltered,\n }\n : undefined\n }\n itemActions={[...itemActions, replaceItemAction, editStatusItemAction]\n .filter(Boolean)\n .map(action => ({\n ...action,\n disabled: isMassSelectionAll || action.disabled,\n }))}\n selection={{\n onSelectItem: _isSelectionDisable ? null : defaultCallbacks?.item?.select,\n onSelectionChange: _isSelectionDisable ? null : setSelectedKeys,\n isMassSelectionAll,\n selectedKeys: isMassSelectionAll\n ? data?.records.map(({whoAmI}) => whoAmI.id)\n : (view.massSelection as string[]),\n mode: selectionMode,\n }}\n tableBodyHeight={tableBodyHeight}\n />\n )}\n </ExplorerPageDivStyled>\n {settingsPanelElement && createPortal(<SidePanel />, settingsPanelElement?.() ?? document.body)}\n {replaceItemModal}\n {createModal}\n {linkModal}\n {editAttributeMassActionModal}\n {ExportModal}\n {GeneratePreviewsModal}\n </ViewSettingsContext.Provider>\n </FiltersContext.Provider>\n <KitSnackBarProvider id={massActionSnackbarId} />\n </>\n );\n },\n);\n"]}
|
|
1
|
+
{"version":3,"file":"Explorer.js","sourceRoot":"","sources":["../../../src/components/Explorer/Explorer.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,UAAU,EAAkB,mBAAmB,EAAE,OAAO,EAAC,MAAM,OAAO,CAAC;AAC/E,OAAO,EAAC,YAAY,EAAC,MAAM,WAAW,CAAC;AACvC,OAAO,EAAC,QAAQ,EAAE,mBAAmB,EAAE,aAAa,EAAC,MAAM,YAAY,CAAC;AACxE,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAC,OAAO,EAAC,MAAM,wBA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kBAAkB,IAAI,MAAM,CAAC,QAAQ;qCAClD,CAAC,CAAC,EACP,SAAS,EAAE;wCACP,YAAY,EAAE,mBAAmB,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,gBAAgB,EAAE,IAAI,EAAE,MAAM;wCACzE,iBAAiB,EAAE,mBAAmB,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,eAAe;wCAC/D,kBAAkB;wCAClB,YAAY,EAAE,kBAAkB;4CAC5B,CAAC,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,EAAC,MAAM,EAAC,EAAE,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC;4CAC5C,CAAC,CAAE,IAAI,CAAC,aAA0B;wCACtC,IAAI,EAAE,aAAa;qCACtB,EACD,eAAe,EAAE,eAAe,GAClC,CACL,IACmB,EACvB,oBAAoB,IAAI,YAAY,CAAC,KAAC,SAAS,KAAG,EAAE,oBAAoB,EAAE,EAAE,IAAI,QAAQ,CAAC,IAAI,CAAC,EAC9F,gBAAgB,EAChB,WAAW,EACX,SAAS,EACT,4BAA4B,EAC5B,WAAW,EACX,qBAAqB,IACK,GACT,EAC1B,KAAC,mBAAmB,IAAC,EAAE,EAAE,oBAAoB,GAAI,IAClD,CACN,CAAC;AACN,CAAC,CACJ,CAAC","sourcesContent":["import {forwardRef, type ReactNode, useImperativeHandle, useMemo} from 'react';\nimport {createPortal} from 'react-dom';\nimport {KitEmpty, KitSnackBarProvider, KitTypography} from 'aristid-ds';\nimport styled from 'styled-components';\nimport {useSharedTranslation} from '_ui/hooks/useSharedTranslation';\nimport {Loading} from '_ui/components/Loading';\nimport {type ISubmitMultipleResult} from '_ui/components/RecordEdition/EditRecordContent/_types';\nimport {useFiltersReducer} from '_ui/components/Filters/context/useFiltersReducer';\nimport {FiltersContext} from '_ui/components/Filters/context/filtersContext';\nimport {type JoinLibraryContextFragment} from '_ui/_gqlTypes';\nimport {\n type DefaultViewSettings,\n type Entrypoint,\n type FiltersChangePayload,\n type IItemAction,\n type IMassActions,\n type IPrimaryAction,\n type SerializedView,\n type ViewSettingsShortcuts,\n} from './_types';\nimport {useExplorerData} from './_queries/useExplorerData';\nimport {DataView} from './DataView';\nimport {ExplorerTitle} from './ExplorerTitle';\nimport {ExplorerToolbar} from './ExplorerToolbar';\nimport {useEditStatusItemAction} from './actions-item/useEditStatusItemAction';\nimport {useReplaceItemAction} from './actions-item/useReplaceItemAction';\nimport {usePrimaryActionsButton} from './actions-primary/usePrimaryActions';\nimport {useCreatePrimaryAction} from './actions-primary/useCreatePrimaryAction';\nimport {useLinkPrimaryAction} from './actions-primary/useLinkPrimaryAction';\nimport {useMassActions} from './actions-mass/useMassActions';\nimport {useDeactivateMassAction} from './actions-mass/useDeactivateMassAction';\nimport {useDeleteLinkValues} from './actions-mass/useDeleteLinkValues';\nimport {useExportMassAction} from './actions-mass/useExportMassAction';\nimport {useEditAttributeMassAction} from './actions-mass/useEditAttributeMassAction';\nimport {useGeneratePreviewsMassAction} from './actions-mass/useGeneratePreviewsMassAction';\nimport {\n defaultPageSizeOptions,\n SidePanel,\n useEditSettings,\n useOpenViewSettings,\n ViewSettingsContext,\n} from './manage-view-settings';\nimport {useOpenViewSettingsV2} from './manage-view-settings-v2/useOpenViewSettingsV2';\nimport {useSearchInput} from './useSearchInput';\nimport {usePagination} from './usePagination';\nimport {useViewSettingsReducer} from './useViewSettingsReducer';\nimport {MASS_SELECTION_ALL, SNACKBAR_MASS_ID} from './_constants';\nimport {useExplorerCountData} from './_queries/useExplorerCountData';\nimport {useLoadViewById} from './useLoadViewById';\n\nconst isNotEmpty = <T extends unknown[]>(union: T): union is Exclude<T, []> => union.length > 0;\n\nconst emptyArray = [];\nconst emptyObject = {};\n\nconst ExplorerHeaderDivStyled = styled.div`\n display: flex;\n align-items: flex-start;\n padding: calc(var(--general-spacing-xs) * 1px);\n`;\n\nconst ExplorerPageDivStyled = styled.div`\n display: flex;\n flex-direction: column;\n height: 100%;\n overflow: hidden;\n`;\n\nconst ExplorerEmptyDataStyled = styled.div`\n flex: 1;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n`;\n\nexport interface IExplorerProps {\n entrypoint: Entrypoint;\n noPagination?: true;\n itemActions?: IItemAction[];\n primaryActions?: IPrimaryAction[];\n massActions?: IMassActions[];\n title?: string;\n selectionMode?: 'multiple' | 'simple';\n emptyPlaceholder?: ReactNode;\n defaultActionsForItem?: Array<'replaceLink' | 'remove' | 'activate'>;\n defaultPrimaryActions?: Array<'create'>;\n defaultMassActions?: Array<'deactivate' | 'export' | 'editAttribute' | 'generatePreviews'>;\n defaultViewSettings?: DefaultViewSettings;\n defaultCallbacks?: {\n item?: {\n edit?: IItemAction['callback'];\n replaceLink?: (replaceValuesResult: ISubmitMultipleResult) => void;\n remove?: IItemAction['callback'];\n select?: IItemAction['callback'];\n };\n primary?: {\n create?: ({\n recordIdCreated,\n saveValuesResultOnLink,\n }: {\n recordIdCreated: string;\n saveValuesResultOnLink?: ISubmitMultipleResult;\n }) => void;\n link?: (saveValuesResult: ISubmitMultipleResult) => void;\n };\n mass?: {\n deactivate?: IMassActions['callback'];\n export?: IMassActions['callback'];\n generatePreviews?: IMassActions['callback'];\n };\n viewSettings?: {\n onFiltersChange?: (payload: FiltersChangePayload) => void;\n onViewSettingsShortcutClick?: ({\n settingName,\n viewId,\n }: {\n settingName: ViewSettingsShortcuts;\n viewId: string;\n }) => void;\n closeViewSettings?: () => void;\n };\n };\n showCreateOnNoResultOnly?: boolean;\n showFilters?: boolean;\n showSorts?: boolean;\n hideFirstActionLabel?: boolean;\n /**\n * Optional to `false` load the last added view when `props.defaultViewSettings.viewId` is `undefined`,\n * if set to `true` load default view.\n */\n ignoreViewByDefault?: boolean;\n showTitle?: boolean;\n showSearch?: boolean;\n disableSelection?: boolean;\n hideSelectAllAction?: boolean;\n hidePrimaryActions?: boolean;\n hideTableHeader?: boolean;\n useSmallHeaderSize?: boolean;\n tableBodyHeight?: string;\n creationFormId?: string;\n joinLibraryContext?: JoinLibraryContextFragment;\n\n // ViewConfig specific props\n currentView?: SerializedView;\n loadedViewId?: string | null;\n}\n\nexport interface IExplorerRef {\n createAction: IPrimaryAction | null;\n linkAction: IPrimaryAction | null;\n totalCount: number;\n}\n\nexport const Explorer = forwardRef<IExplorerRef, IExplorerProps>(\n (\n {\n entrypoint,\n itemActions = [],\n primaryActions = [],\n massActions = [],\n title,\n selectionMode = 'multiple',\n emptyPlaceholder,\n noPagination,\n creationFormId,\n showCreateOnNoResultOnly = false,\n showFilters = false,\n showSorts = false,\n hideFirstActionLabel = false,\n disableSelection = false,\n hideSelectAllAction = false,\n showTitle = false,\n showSearch = false,\n hidePrimaryActions = false,\n hideTableHeader = false,\n useSmallHeaderSize = false,\n tableBodyHeight,\n ignoreViewByDefault = false,\n defaultActionsForItem = ['replaceLink', 'remove', 'activate'],\n defaultPrimaryActions = ['create'],\n defaultMassActions = ['deactivate', 'editAttribute', 'export', 'generatePreviews'],\n defaultCallbacks,\n defaultViewSettings,\n joinLibraryContext,\n currentView,\n loadedViewId,\n },\n ref,\n ) => {\n const {t} = useSharedTranslation();\n\n const {panelElement: settingsPanelElement} = useEditSettings(); // TODO: should be conditional due to can be manager via app-studio only\n\n const {\n loading: viewSettingsLoading,\n view,\n dispatch: viewSettingsDispatch,\n } = useViewSettingsReducer(entrypoint, defaultViewSettings, ignoreViewByDefault); // TODO: load all views, why should viewConfigPanel have to do it too? Can they communicate with each other (context)?\n\n const {filtersData, dispatch: filtersDispatch} = useFiltersReducer({\n libraryId: view.libraryId,\n viewId: view.viewId ?? undefined,\n filters: defaultViewSettings?.filters ?? undefined,\n filtersOperator: defaultViewSettings?.filtersOperator ?? undefined,\n ignoreViewByDefault,\n skip: viewSettingsLoading,\n });\n\n useLoadViewById({\n loadedViewId,\n isLoading: viewSettingsLoading,\n view,\n viewSettingsDispatch,\n filtersDispatch,\n });\n\n const {currentPage, setNewPageSize, setNewPage} = usePagination(viewSettingsDispatch);\n\n const {\n data,\n isMultivalue,\n canEditLinkAttributeValues,\n loading: loadingData,\n refetch,\n } = useExplorerData({\n entrypoint,\n libraryId: view.libraryId,\n attributeIds: view.attributesIds,\n fulltextSearch: view.fulltextSearch,\n pagination: noPagination ? null : {limit: view.pageSize, offset: view.pageSize * (currentPage - 1)},\n sorts: view.sort,\n filters: filtersData.filters,\n filtersOperator: filtersData.filtersOperator,\n skip: viewSettingsLoading,\n }); // TODO: refresh when go back on page\n const isMassSelectionAll = view.massSelection === MASS_SELECTION_ALL;\n const isLink = entrypoint.type === 'link';\n\n const {editStatusItemAction} = useEditStatusItemAction({\n isEnabled:\n isNotEmpty(defaultActionsForItem) &&\n (defaultActionsForItem.includes('remove') || defaultActionsForItem.includes('activate')),\n onRemove: defaultCallbacks?.item?.remove,\n canDeleteLinkValues: canEditLinkAttributeValues,\n store: {view, dispatch: viewSettingsDispatch},\n entrypoint,\n });\n\n const {replaceItemAction, replaceItemModal} = useReplaceItemAction({\n isEnabled: isLink && isNotEmpty(defaultActionsForItem) && defaultActionsForItem.includes('replaceLink'),\n isMultivalue,\n onReplace: defaultCallbacks?.item?.replaceLink,\n canReplaceLinkValues: canEditLinkAttributeValues,\n columnsToDisplay: !joinLibraryContext ? view.attributesIds : [],\n });\n\n const totalCountFiltered = data?.totalCount ?? 0;\n\n const {countData: totalCountLibrary, refetchCount} = useExplorerCountData({\n entrypoint,\n libraryId: view.libraryId,\n defaultFilters: defaultViewSettings?.filters ?? [],\n filters: filtersData.filters,\n skip: viewSettingsLoading,\n });\n\n const hasNoResults = data === null || data.totalCount === 0;\n\n const isAllowedFreeEntry = !(entrypoint.type === 'library' && !entrypoint.allowFreeEntry);\n\n const showCreatePrimaryButton = showCreateOnNoResultOnly\n ? !hidePrimaryActions && !loadingData && hasNoResults && isAllowedFreeEntry\n : true;\n\n const {createPrimaryAction, createModal} = useCreatePrimaryAction({\n isEnabled: isNotEmpty(defaultPrimaryActions) && defaultPrimaryActions.includes('create'),\n isVisible: showCreatePrimaryButton,\n libraryId: view.libraryId,\n canCreateAndLinkValue: canEditLinkAttributeValues,\n onCreate: defaultCallbacks?.primary?.create,\n joinLibraryContext,\n entrypoint,\n isMultivalue,\n totalCount: totalCountFiltered,\n formId: creationFormId,\n refetch,\n refetchCount,\n });\n const {linkPrimaryAction, linkModal} = useLinkPrimaryAction({\n isEnabled: isLink,\n joinLibraryContext,\n isVisible: showCreatePrimaryButton,\n canAddLinkValue: canEditLinkAttributeValues,\n onLink: defaultCallbacks?.primary?.link,\n linkId: data?.totalCount === 0 ? undefined : data?.records[0]?.id_value,\n isMultivalue,\n maxItemsLeft: null, // TODO: use KitTable.row,\n columnsToDisplay: !joinLibraryContext ? view.attributesIds : [],\n });\n\n const allVisibleKeys = data?.records.map(({key}) => key) ?? [];\n\n const {generatePreviewsMassAction, GeneratePreviewsModal} = useGeneratePreviewsMassAction({\n isEnabled: !isLink && isNotEmpty(defaultMassActions) && defaultMassActions.includes('generatePreviews'),\n store: {view},\n totalCount: totalCountFiltered,\n onGeneratePreviews: defaultCallbacks?.mass?.generatePreviews,\n });\n\n const {exportMassAction, ExportModal} = useExportMassAction({\n isEnabled: !isLink && isNotEmpty(defaultMassActions) && defaultMassActions.includes('export'),\n store: {view, dispatch: viewSettingsDispatch},\n totalCount: totalCountFiltered,\n onExport: defaultCallbacks?.mass?.export,\n });\n\n const {editAttributeMassAction, editAttributeMassActionModal} = useEditAttributeMassAction({\n isEnabled: !isLink && isNotEmpty(defaultMassActions) && defaultMassActions.includes('editAttribute'),\n store: {view},\n totalCount: totalCountFiltered,\n });\n\n const {deactivateMassAction} = useDeactivateMassAction({\n isEnabled: !isLink && isNotEmpty(defaultMassActions) && defaultMassActions.includes('deactivate'),\n store: {view, dispatch: viewSettingsDispatch},\n allVisibleKeys,\n totalCount: totalCountFiltered,\n onDeactivate: defaultCallbacks?.mass?.deactivate,\n refetch,\n });\n\n const {unlinkMassAction} = useDeleteLinkValues({\n isEnabled: isLink && isNotEmpty(defaultMassActions) && defaultMassActions.includes('deactivate'),\n store: {view, dispatch: viewSettingsDispatch},\n filtersStore: filtersData,\n pagination: noPagination ? null : {limit: view.pageSize, offset: view.pageSize * (currentPage - 1)},\n allVisibleKeys,\n onDelete: defaultCallbacks?.mass?.deactivate,\n refetch,\n });\n\n const _isSelectionDisable = disableSelection || (isLink && !isMultivalue && totalCountFiltered > 0);\n\n const massActionSnackbarId = useMemo(() => `${SNACKBAR_MASS_ID}_${Date.now()}`, []);\n\n const {setSelectedKeys, selectAllButton} = useMassActions({\n isEnabled:\n totalCountFiltered > 0 &&\n !_isSelectionDisable &&\n (isNotEmpty(defaultMassActions) || isNotEmpty(massActions) || !!defaultCallbacks?.item?.select),\n store: {view, dispatch: viewSettingsDispatch},\n filtersStore: filtersData,\n totalCountFiltered,\n totalCountLibrary,\n allVisibleKeys,\n massActions: [\n generatePreviewsMassAction,\n exportMassAction,\n editAttributeMassAction,\n deactivateMassAction,\n unlinkMassAction,\n ...massActions,\n ].filter(Boolean),\n snackbarId: massActionSnackbarId,\n });\n\n const {primaryButton} = usePrimaryActionsButton({\n view,\n actions: [createPrimaryAction, linkPrimaryAction, ...primaryActions].filter(Boolean),\n hideFirstActionLabel,\n });\n\n const {viewSettingsShortcutsButtons} = useOpenViewSettingsV2({\n isEnabled: defaultCallbacks?.viewSettings?.onViewSettingsShortcutClick !== undefined,\n view: view as any,\n open: !isMassSelectionAll,\n closeViewSettings: defaultCallbacks?.viewSettings?.closeViewSettings,\n onViewSettingsShortcutClick: defaultCallbacks?.viewSettings?.onViewSettingsShortcutClick,\n });\n const {viewSettingsButton, viewListButton} = useOpenViewSettings({view, isEnabled: !isMassSelectionAll});\n\n const {searchInput} = useSearchInput({view, dispatch: viewSettingsDispatch, setNewPage});\n\n useImperativeHandle(\n ref,\n () => ({\n createAction: createPrimaryAction,\n linkAction: linkPrimaryAction,\n totalCount: totalCountFiltered,\n }),\n [createPrimaryAction?.disabled, linkPrimaryAction?.disabled, totalCountFiltered],\n );\n\n return (\n <>\n <FiltersContext.Provider value={{filtersData, dispatch: filtersDispatch}}>\n <ViewSettingsContext.Provider value={{view, dispatch: viewSettingsDispatch}}>\n <ExplorerPageDivStyled>\n {showTitle && (\n <ExplorerHeaderDivStyled>\n <KitTypography.Title level=\"h3\">\n {\n !viewSettingsLoading && (\n <ExplorerTitle\n library={view.libraryId}\n title={title}\n entrypoint={entrypoint}\n />\n ) /*TODO: manage loading*/\n }\n </KitTypography.Title>\n </ExplorerHeaderDivStyled>\n )}\n <ExplorerToolbar\n showFilters={showFilters}\n showSorts={showSorts}\n isMassSelectionAll={isMassSelectionAll}\n headless={hideTableHeader}\n canRemoveFilters={view?.enableConfigureView ?? false}\n selectAllButton={hideSelectAllAction ? null : selectAllButton}\n viewSettingsLoading={viewSettingsLoading}\n >\n {view?.enableConfigureView &&\n defaultCallbacks?.viewSettings?.onViewSettingsShortcutClick === undefined // TODO: can be refactored into a constant\n ? viewListButton\n : null}\n {showSearch ? searchInput : null}\n {view?.enableConfigureView &&\n defaultCallbacks?.viewSettings?.onViewSettingsShortcutClick === undefined // TODO: can be refactored into a constant\n ? viewSettingsButton\n : null}\n {view?.enableConfigureView && viewSettingsShortcutsButtons}\n {hidePrimaryActions ? null : primaryButton}\n </ExplorerToolbar>\n {loadingData || viewSettingsLoading ? (\n <Loading />\n ) : hasNoResults ? (\n <ExplorerEmptyDataStyled>\n {emptyPlaceholder || <KitEmpty title={t('explorer.empty-data')} />}\n </ExplorerEmptyDataStyled>\n ) : (\n <DataView\n dataGroupedFilteredSorted={data?.records ?? emptyArray}\n attributesProperties={data?.attributes ?? emptyObject}\n attributesToDisplay={\n /* ⚠️ whoAmI column will always be displayed first*/ view.attributesIds\n }\n hideTableHeader={hideTableHeader}\n useSmallHeaderSize={useSmallHeaderSize}\n paginationProps={\n entrypoint.type === 'library' && !noPagination\n ? {\n pageSizeOptions: defaultPageSizeOptions,\n currentPage,\n pageSize: view.pageSize,\n setNewPageSize,\n setNewPage,\n totalCount: totalCountFiltered,\n }\n : undefined\n }\n itemActions={[...itemActions, replaceItemAction, editStatusItemAction]\n .filter(Boolean)\n .map(action => ({\n ...action,\n disabled: isMassSelectionAll || action.disabled,\n }))}\n selection={{\n onSelectItem: _isSelectionDisable ? null : defaultCallbacks?.item?.select,\n onSelectionChange: _isSelectionDisable ? null : setSelectedKeys,\n isMassSelectionAll,\n selectedKeys: isMassSelectionAll\n ? data?.records.map(({whoAmI}) => whoAmI.id)\n : (view.massSelection as string[]),\n mode: selectionMode,\n }}\n tableBodyHeight={tableBodyHeight}\n />\n )}\n </ExplorerPageDivStyled>\n {settingsPanelElement && createPortal(<SidePanel />, settingsPanelElement?.() ?? document.body)}\n {replaceItemModal}\n {createModal}\n {linkModal}\n {editAttributeMassActionModal}\n {ExportModal}\n {GeneratePreviewsModal}\n </ViewSettingsContext.Provider>\n </FiltersContext.Provider>\n <KitSnackBarProvider id={massActionSnackbarId} />\n </>\n );\n },\n);\n"]}
|
|
@@ -19,6 +19,7 @@ export const ExplorerFiltersAndSorts = ({ isMassSelectionAll, showFilters, showS
|
|
|
19
19
|
const { t } = useSharedTranslation();
|
|
20
20
|
const { view } = useViewSettingsContext();
|
|
21
21
|
const { sort } = view;
|
|
22
|
+
// TODO: modify to use app-studio
|
|
22
23
|
const { openSettingsPanel } = useOpenViewSettings({ view, isEnabled: true });
|
|
23
24
|
const { filtersProps } = useFilters(!canRemoveFilters);
|
|
24
25
|
const { attributeDetailsById } = useAttributeDetailsData(view.libraryId);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExplorerFiltersAndSorts.js","sourceRoot":"","sources":["../../../src/components/Explorer/ExplorerFiltersAndSorts.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAC,SAAS,EAAC,MAAM,eAAe,CAAC;AACxC,OAAO,EAAC,sBAAsB,EAAC,MAAM,mEAAmE,CAAC;AACzG,OAAO,EAAC,uBAAuB,EAAC,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I,CAAC,MAAM,GAAG,CAAC,IAAI,CAC7B,uBACI,KAAC,YAAY,IACT,KAAK,EAAE,CAAC,CAAC,qBAAqB,CAAC,EAC/B,MAAM,EAAE,UAAU,EAClB,QAAQ,EAAE,kBAAkB,EAC5B,OAAO,EAAE,kBAAkB,GAC7B,GACD,CACR,IACF,CACN,IACF,CACN,CAAC;AACN,CAAC,CAAC","sourcesContent":["import {useSharedTranslation} from '_ui/hooks/useSharedTranslation';\nimport {SortOrder} from '_ui/_gqlTypes';\nimport {useViewSettingsContext} from './manage-view-settings/store-view-settings/useViewSettingsContext';\nimport {useAttributeDetailsData} from './manage-view-settings/_shared/useAttributeDetailsData';\nimport {useOpenViewSettings} from './manage-view-settings';\nimport {type ComponentProps, type FunctionComponent, type ReactNode} from 'react';\nimport {KitDivider, KitFilter} from 'aristid-ds';\nimport styled from 'styled-components';\nimport {CommonFilterItem} from '_ui/components/Filters/filter-items/CommonFilterItem';\nimport {useFilters} from '_ui/components/Filters/useFilters';\nimport {type UIFilter} from '../Filters';\n\nconst FilterStyled = styled(KitFilter)`\n flex: 0 0 auto;\n`;\n\nconst DividerStyled = styled(KitDivider)`\n height: 26px;\n margin-inline: calc(var(--general-spacing-xxs) * 1px);\n`;\n\nexport const ExplorerFiltersAndSorts: FunctionComponent<{\n isMassSelectionAll: boolean;\n showFilters: boolean;\n showSorts: boolean;\n canRemoveFilters: boolean;\n selectAllButton: ReactNode | null;\n}> = ({isMassSelectionAll, showFilters, showSorts, canRemoveFilters, selectAllButton}) => {\n const {t} = useSharedTranslation();\n\n const {view} = useViewSettingsContext();\n const {sort} = view;\n\n const {openSettingsPanel} = useOpenViewSettings({view, isEnabled: true});\n const {filtersProps} = useFilters(!canRemoveFilters);\n\n const {attributeDetailsById} = useAttributeDetailsData(view.libraryId);\n // const visibleFilters = filters.filter(filterItem => !filterItem.hidden);\n\n if (((filtersProps.length === 0 && sort.length === 0) || (!showFilters && !showSorts)) && !selectAllButton) {\n return null;\n }\n\n const sortValues =\n sort.length === 0\n ? undefined\n : sort.map(\n ({field, order}) =>\n (attributeDetailsById?.[field]?.label ?? field) +\n ' ' +\n (order === SortOrder.asc ? t('explorer.sort-ascending') : t('explorer.sort-descending')),\n );\n\n const _handleClickOnSort: ComponentProps<typeof FilterStyled>['onClick'] = () =>\n isMassSelectionAll ? undefined : openSettingsPanel('sort-items');\n\n if (!Object.keys(attributeDetailsById).length) {\n return <></>;\n }\n\n return (\n <>\n {selectAllButton && (\n <>\n <li>{selectAllButton}</li>\n {((showFilters && filtersProps.length !== 0) || (showSorts && sort.length > 0)) && (\n <DividerStyled type=\"vertical\" />\n )}\n </>\n )}\n {(showFilters || showSorts) && (\n <>\n {filtersProps.length > 0 &&\n filtersProps.map(filterProps => (\n <li key={filterProps.key}>\n <CommonFilterItem\n filter={filterProps.filter as UIFilter}\n isPinned={filterProps.isPinned}\n disabled={isMassSelectionAll}\n />\n </li>\n ))}\n {showSorts && sort.length > 0 && (\n <li>\n <FilterStyled\n label={t('explorer.sort-items')}\n values={sortValues}\n disabled={isMassSelectionAll}\n onClick={_handleClickOnSort}\n />\n </li>\n )}\n </>\n )}\n </>\n );\n};\n"]}
|
|
1
|
+
{"version":3,"file":"ExplorerFiltersAndSorts.js","sourceRoot":"","sources":["../../../src/components/Explorer/ExplorerFiltersAndSorts.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAC,SAAS,EAAC,MAAM,eAAe,CAAC;AACxC,OAAO,EAAC,sBAAsB,EAAC,MAAM,mEAAmE,CAAC;AACzG,OAAO,EAAC,uBAAuB,EAAC,MAAM,wDAAwD,CAAC;AAC/F,OAAO,EAAC,mBAAmB,EAAC,MAAM,wBAAwB,CAAC;AAE3D,OAAO,EAAC,UAAU,EAAE,SAAS,EAAC,MAAM,YAAY,CAAC;AACjD,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAC,gBAAgB,EAAC,MAAM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,IACF,CACN,IACF,CACN,CAAC;AACN,CAAC,CAAC","sourcesContent":["import {useSharedTranslation} from '_ui/hooks/useSharedTranslation';\nimport {SortOrder} from '_ui/_gqlTypes';\nimport {useViewSettingsContext} from './manage-view-settings/store-view-settings/useViewSettingsContext';\nimport {useAttributeDetailsData} from './manage-view-settings/_shared/useAttributeDetailsData';\nimport {useOpenViewSettings} from './manage-view-settings';\nimport {type ComponentProps, type FunctionComponent, type ReactNode} from 'react';\nimport {KitDivider, KitFilter} from 'aristid-ds';\nimport styled from 'styled-components';\nimport {CommonFilterItem} from '_ui/components/Filters/filter-items/CommonFilterItem';\nimport {useFilters} from '_ui/components/Filters/useFilters';\nimport {type UIFilter} from '../Filters';\n\nconst FilterStyled = styled(KitFilter)`\n flex: 0 0 auto;\n`;\n\nconst DividerStyled = styled(KitDivider)`\n height: 26px;\n margin-inline: calc(var(--general-spacing-xxs) * 1px);\n`;\n\nexport const ExplorerFiltersAndSorts: FunctionComponent<{\n isMassSelectionAll: boolean;\n showFilters: boolean;\n showSorts: boolean;\n canRemoveFilters: boolean;\n selectAllButton: ReactNode | null;\n}> = ({isMassSelectionAll, showFilters, showSorts, canRemoveFilters, selectAllButton}) => {\n const {t} = useSharedTranslation();\n\n const {view} = useViewSettingsContext();\n const {sort} = view;\n\n // TODO: modify to use app-studio\n const {openSettingsPanel} = useOpenViewSettings({view, isEnabled: true});\n const {filtersProps} = useFilters(!canRemoveFilters);\n\n const {attributeDetailsById} = useAttributeDetailsData(view.libraryId);\n // const visibleFilters = filters.filter(filterItem => !filterItem.hidden);\n\n if (((filtersProps.length === 0 && sort.length === 0) || (!showFilters && !showSorts)) && !selectAllButton) {\n return null;\n }\n\n const sortValues =\n sort.length === 0\n ? undefined\n : sort.map(\n ({field, order}) =>\n (attributeDetailsById?.[field]?.label ?? field) +\n ' ' +\n (order === SortOrder.asc ? t('explorer.sort-ascending') : t('explorer.sort-descending')),\n );\n\n const _handleClickOnSort: ComponentProps<typeof FilterStyled>['onClick'] = () =>\n isMassSelectionAll ? undefined : openSettingsPanel('sort-items');\n\n if (!Object.keys(attributeDetailsById).length) {\n return <></>;\n }\n\n return (\n <>\n {selectAllButton && (\n <>\n <li>{selectAllButton}</li>\n {((showFilters && filtersProps.length !== 0) || (showSorts && sort.length > 0)) && (\n <DividerStyled type=\"vertical\" />\n )}\n </>\n )}\n {(showFilters || showSorts) && (\n <>\n {filtersProps.length > 0 &&\n filtersProps.map(filterProps => (\n <li key={filterProps.key}>\n <CommonFilterItem\n filter={filterProps.filter as UIFilter}\n isPinned={filterProps.isPinned}\n disabled={isMassSelectionAll}\n />\n </li>\n ))}\n {showSorts && sort.length > 0 && (\n <li>\n <FilterStyled\n label={t('explorer.sort-items')}\n values={sortValues}\n disabled={isMassSelectionAll}\n onClick={_handleClickOnSort}\n />\n </li>\n )}\n </>\n )}\n </>\n );\n};\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { localizedTranslation } from '@leav/utils';
|
|
3
3
|
import { useExplorerLibraryDetailsQuery, useExplorerLinkAttributeQuery } from '../../_gqlTypes';
|
|
4
|
-
import useLang from '../../hooks/useLang';
|
|
4
|
+
import useLang from '../../hooks/useLang/useLang';
|
|
5
5
|
import { AntSkeleton } from 'aristid-ds';
|
|
6
6
|
// TODO: use <h1 /> tag
|
|
7
7
|
export const ExplorerTitle = ({ title, library, entrypoint }) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExplorerTitle.js","sourceRoot":"","sources":["../../../src/components/Explorer/ExplorerTitle.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,oBAAoB,EAAC,MAAM,aAAa,CAAC;AACjD,OAAO,EAAC,8BAA8B,EAAE,6BAA6B,EAAC,MAAM,eAAe,CAAC;AAC5F,OAAO,OAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"ExplorerTitle.js","sourceRoot":"","sources":["../../../src/components/Explorer/Explor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IAAI,KAAK,CAAC;IAEV,IAAI,UAAU,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;QAChC,MAAM,WAAW,GAAG,IAAI,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;QAE7C,IAAI,CAAC,WAAW,EAAE,CAAC;YACf,qBAAqB;YACrB,OAAO,6CAA4B,CAAC;QACxC,CAAC;QAED,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC;IAC9B,CAAC;SAAM,CAAC;QACJ,MAAM,iBAAiB,GAAG,aAAa,EAAE,UAAU,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;QAE7D,IAAI,CAAC,iBAAiB,EAAE,CAAC;YACrB,OAAO,oDAAmC,CAAC;QAC/C,CAAC;QAED,KAAK,GAAG,OAAO,IAAI,iBAAiB,CAAC,CAAC,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;IAC1E,CAAC;IAED,OAAO,yBAAO,oBAAoB,CAAC,KAAK,EAAE,IAAI,CAAC,GAAQ,CAAC;AAC5D,CAAC,CAAC","sourcesContent":["import {localizedTranslation} from '@leav/utils';\nimport {useExplorerLibraryDetailsQuery, useExplorerLinkAttributeQuery} from '_ui/_gqlTypes';\nimport useLang from '_ui/hooks/useLang/useLang';\nimport {AntSkeleton} from 'aristid-ds';\nimport {type FunctionComponent} from 'react';\nimport {type Entrypoint, type IEntrypointLink} from './_types';\n\ninterface IExplorerTitleProps {\n title?: string;\n library: string;\n entrypoint: Entrypoint;\n}\n\n// TODO: use <h1 /> tag\nexport const ExplorerTitle: FunctionComponent<IExplorerTitleProps> = ({title, library, entrypoint}) => {\n const {data, loading, error} = useExplorerLibraryDetailsQuery({variables: {libraryId: library}, skip: !!title});\n const {\n data: attributeData,\n loading: attributeLoading,\n error: attributeError,\n } = useExplorerLinkAttributeQuery({\n skip: !!title || entrypoint.type !== 'link',\n variables: {\n id: (entrypoint as IEntrypointLink).linkAttributeId,\n },\n });\n\n const {lang} = useLang();\n\n if (title) {\n return <span>{title}</span>;\n }\n\n if (loading || attributeLoading) {\n return <AntSkeleton.Input style={{width: 400}} active />;\n }\n\n // TODO: handle error and bad library ID\n if (error || attributeError) {\n return <span>{error?.message ?? attributeError?.message}</span>;\n }\n\n let label;\n\n if (entrypoint.type === 'library') {\n const libraryData = data?.libraries?.list[0];\n\n if (!libraryData) {\n // TODO: make it i18n\n return <span>Unknown library</span>;\n }\n\n label = libraryData.label;\n } else {\n const linkAttributeData = attributeData?.attributes?.list[0];\n\n if (!linkAttributeData) {\n return <span>Unknown link attribute</span>;\n }\n\n label = 'label' in linkAttributeData ? linkAttributeData.label : null;\n }\n\n return <span>{localizedTranslation(label, lang)}</span>;\n};\n"]}
|
|
@@ -31,6 +31,7 @@ const StyledColorChip = styled.div `
|
|
|
31
31
|
const RightIcon = styled(FontAwesomeIcon) `
|
|
32
32
|
flex-shrink: 0;
|
|
33
33
|
`;
|
|
34
|
+
const TOOLTIP_COLOR = '#ffffff';
|
|
34
35
|
export const TableCell = ({ values, attributeProperties }) => {
|
|
35
36
|
const { t } = useSharedTranslation();
|
|
36
37
|
const _getDateRangeValueContent = useCallback((value) => {
|
|
@@ -53,7 +54,7 @@ export const TableCell = ({ values, attributeProperties }) => {
|
|
|
53
54
|
switch (attributeProperties.format) {
|
|
54
55
|
case AttributeFormat.boolean:
|
|
55
56
|
return {
|
|
56
|
-
children: (_jsx(
|
|
57
|
+
children: (_jsx(KitTypography.Text, { color: TOOLTIP_COLOR, children: value.valuePayload ? String(t('global.yes')) : String(t('global.no')) })),
|
|
57
58
|
type: value.valuePayload ? 'primary' : 'neutral',
|
|
58
59
|
};
|
|
59
60
|
case AttributeFormat.color:
|
|
@@ -67,7 +68,7 @@ export const TableCell = ({ values, attributeProperties }) => {
|
|
|
67
68
|
};
|
|
68
69
|
case AttributeFormat.date_range:
|
|
69
70
|
return {
|
|
70
|
-
children: _jsx(
|
|
71
|
+
children: (_jsx(KitTypography.Text, { color: TOOLTIP_COLOR, children: _getDateRangeValueContent(value.valuePayload) })),
|
|
71
72
|
type: 'primary',
|
|
72
73
|
};
|
|
73
74
|
default:
|
|
@@ -75,7 +76,7 @@ export const TableCell = ({ values, attributeProperties }) => {
|
|
|
75
76
|
? '●●●●●●●●●●●●'
|
|
76
77
|
: value.valuePayload;
|
|
77
78
|
return {
|
|
78
|
-
children: _jsx(
|
|
79
|
+
children: _jsx(KitTypography.Text, { color: TOOLTIP_COLOR, children: valueContent }),
|
|
79
80
|
type: 'primary',
|
|
80
81
|
};
|
|
81
82
|
}
|
|
@@ -87,7 +88,7 @@ export const TableCell = ({ values, attributeProperties }) => {
|
|
|
87
88
|
case MultiDisplayOption.tag:
|
|
88
89
|
return (_jsx(TableTagGroup, { tags: values.map(value => ({
|
|
89
90
|
type: 'primary',
|
|
90
|
-
children: _jsx(
|
|
91
|
+
children: (_jsx(KitTypography.Text, { color: TOOLTIP_COLOR, children: value.linkPayload?.whoAmI.label ?? undefined })),
|
|
91
92
|
})) }));
|
|
92
93
|
case MultiDisplayOption.badge_qty:
|
|
93
94
|
return _jsx(KitBadge, { overflowCount: Infinity, count: values.length, color: "primary" });
|
|
@@ -106,7 +107,7 @@ export const TableCell = ({ values, attributeProperties }) => {
|
|
|
106
107
|
case MultiDisplayOption.tag:
|
|
107
108
|
return (_jsx(TableTagGroup, { tags: values.map(value => ({
|
|
108
109
|
type: 'primary',
|
|
109
|
-
children: (_jsx(
|
|
110
|
+
children: (_jsx(KitTypography.Text, { color: TOOLTIP_COLOR, children: value.treePayload?.record.whoAmI.label ?? undefined })),
|
|
110
111
|
})) }));
|
|
111
112
|
case MultiDisplayOption.badge_qty:
|
|
112
113
|
return _jsx(KitBadge, { overflowCount: Infinity, count: values.length, color: "primary" });
|
|
@@ -134,7 +135,7 @@ export const TableCell = ({ values, attributeProperties }) => {
|
|
|
134
135
|
switch (attributeProperties.format) {
|
|
135
136
|
case AttributeFormat.boolean:
|
|
136
137
|
const valueToDisplay = value.valuePayload ? t('global.yes') : t('global.no');
|
|
137
|
-
content = (_jsx(KitTag, { type: !!value.valuePayload ? 'primary' : 'neutral', children: _jsx(
|
|
138
|
+
content = (_jsx(KitTag, { type: !!value.valuePayload ? 'primary' : 'neutral', children: _jsx(KitTypography.Text, { children: valueToDisplay }) }, attributeProperties.id));
|
|
138
139
|
break;
|
|
139
140
|
case AttributeFormat.rich_text:
|
|
140
141
|
const tmp = document.createElement('div');
|