@leav/ui 1.10.0-5d59fa11 → 1.10.0-873ef4d7
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/_utils/index.d.ts +0 -1
- package/dist/_utils/index.js +0 -3
- package/dist/_utils/index.js.map +1 -1
- package/dist/components/Explorer/_queries/useExplorerCountData.js +3 -4
- package/dist/components/Explorer/_queries/useExplorerCountData.js.map +1 -1
- package/dist/components/Filters/filter-items/CommonFilterItem.js +8 -6
- package/dist/components/Filters/filter-items/CommonFilterItem.js.map +1 -1
- package/dist/components/Filters/filter-items/filter-type/BooleanAttributeDropdown.js +6 -1
- package/dist/components/Filters/filter-items/filter-type/BooleanAttributeDropdown.js.map +1 -1
- package/dist/components/Filters/filter-items/filter-type/FilterValueListDropDown.js +9 -18
- package/dist/components/Filters/filter-items/filter-type/FilterValueListDropDown.js.map +1 -1
- package/dist/components/Notifications/InitNotificationsSubscription.d.ts +4 -2
- package/dist/components/Notifications/InitNotificationsSubscription.js.map +1 -1
- package/dist/components/RecordEdition/EditRecord/EditRecord.d.ts +1 -0
- package/dist/components/RecordEdition/EditRecord/EditRecord.js +2 -2
- package/dist/components/RecordEdition/EditRecord/EditRecord.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/_types.d.ts +1 -18
- package/dist/components/RecordEdition/EditRecordContent/_types.js +0 -5
- package/dist/components/RecordEdition/EditRecordContent/_types.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/explorer/LinkFieldExplorer.d.ts +0 -3
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/explorer/LinkFieldExplorer.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordModal/EditRecordModal.js +1 -1
- package/dist/components/RecordEdition/EditRecordModal/EditRecordModal.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordSidebar/EditRecordSidebar.d.ts +1 -0
- package/dist/components/RecordEdition/EditRecordSidebar/EditRecordSidebar.js +4 -4
- package/dist/components/RecordEdition/EditRecordSidebar/EditRecordSidebar.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordSidebar/RecordSummary/RecordSummary.d.ts +1 -0
- package/dist/components/RecordEdition/EditRecordSidebar/RecordSummary/RecordSummary.js +3 -2
- package/dist/components/RecordEdition/EditRecordSidebar/RecordSummary/RecordSummary.js.map +1 -1
- package/dist/components/RecordHistory/RecordHistory.d.ts +1 -0
- package/dist/components/RecordHistory/RecordHistory.js +3 -3
- package/dist/components/RecordHistory/RecordHistory.js.map +1 -1
- package/dist/components/RecordHistory/RecordHistoryGoUpButton.d.ts +1 -0
- package/dist/components/RecordHistory/RecordHistoryGoUpButton.js +3 -3
- package/dist/components/RecordHistory/RecordHistoryGoUpButton.js.map +1 -1
- package/dist/locales/en/shared.json +0 -26
- package/dist/locales/fr/shared.json +0 -26
- package/package.json +4 -4
- package/dist/components/RecordEdition/EditRecordContent/helpers/getActiveFieldValues/getActiveFieldValues.d.ts +0 -3
- package/dist/components/RecordEdition/EditRecordContent/helpers/getActiveFieldValues/getActiveFieldValues.js +0 -2
- package/dist/components/RecordEdition/EditRecordContent/helpers/getActiveFieldValues/getActiveFieldValues.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/helpers/getActiveFieldValues/index.d.ts +0 -1
- package/dist/components/RecordEdition/EditRecordContent/helpers/getActiveFieldValues/index.js +0 -5
- package/dist/components/RecordEdition/EditRecordContent/helpers/getActiveFieldValues/index.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/helpers/isCurrentVersion/index.d.ts +0 -1
- package/dist/components/RecordEdition/EditRecordContent/helpers/isCurrentVersion/index.js +0 -5
- package/dist/components/RecordEdition/EditRecordContent/helpers/isCurrentVersion/index.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/helpers/isCurrentVersion/isCurrentVersion.d.ts +0 -7
- package/dist/components/RecordEdition/EditRecordContent/helpers/isCurrentVersion/isCurrentVersion.js +0 -20
- package/dist/components/RecordEdition/EditRecordContent/helpers/isCurrentVersion/isCurrentVersion.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/hooks/useTabManagement.d.ts +0 -11
- package/dist/components/RecordEdition/EditRecordContent/hooks/useTabManagement.js +0 -35
- package/dist/components/RecordEdition/EditRecordContent/hooks/useTabManagement.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/reducers/linkFieldReducer/index.d.ts +0 -2
- package/dist/components/RecordEdition/EditRecordContent/reducers/linkFieldReducer/index.js +0 -6
- package/dist/components/RecordEdition/EditRecordContent/reducers/linkFieldReducer/index.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/reducers/linkFieldReducer/linkFieldReducer.d.ts +0 -52
- package/dist/components/RecordEdition/EditRecordContent/reducers/linkFieldReducer/linkFieldReducer.js +0 -144
- package/dist/components/RecordEdition/EditRecordContent/reducers/linkFieldReducer/linkFieldReducer.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/shared/AddValueBtn/AddValueBtn.d.ts +0 -9
- package/dist/components/RecordEdition/EditRecordContent/shared/AddValueBtn/AddValueBtn.js +0 -19
- package/dist/components/RecordEdition/EditRecordContent/shared/AddValueBtn/AddValueBtn.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/shared/AddValueBtn/index.d.ts +0 -2
- package/dist/components/RecordEdition/EditRecordContent/shared/AddValueBtn/index.js +0 -6
- package/dist/components/RecordEdition/EditRecordContent/shared/AddValueBtn/index.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/shared/DeleteAllValuesBtn/DeleteAllValuesBtn.d.ts +0 -5
- package/dist/components/RecordEdition/EditRecordContent/shared/DeleteAllValuesBtn/DeleteAllValuesBtn.js +0 -21
- package/dist/components/RecordEdition/EditRecordContent/shared/DeleteAllValuesBtn/DeleteAllValuesBtn.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/shared/DeleteAllValuesBtn/index.d.ts +0 -2
- package/dist/components/RecordEdition/EditRecordContent/shared/DeleteAllValuesBtn/index.js +0 -6
- package/dist/components/RecordEdition/EditRecordContent/shared/DeleteAllValuesBtn/index.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/shared/DeleteValueBtn/DeleteValueBtn.d.ts +0 -6
- package/dist/components/RecordEdition/EditRecordContent/shared/DeleteValueBtn/DeleteValueBtn.js +0 -14
- package/dist/components/RecordEdition/EditRecordContent/shared/DeleteValueBtn/DeleteValueBtn.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/shared/DeleteValueBtn/index.d.ts +0 -2
- package/dist/components/RecordEdition/EditRecordContent/shared/DeleteValueBtn/index.js +0 -6
- package/dist/components/RecordEdition/EditRecordContent/shared/DeleteValueBtn/index.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/shared/FieldFooter/FieldFooter.d.ts +0 -9
- package/dist/components/RecordEdition/EditRecordContent/shared/FieldFooter/FieldFooter.js +0 -28
- package/dist/components/RecordEdition/EditRecordContent/shared/FieldFooter/FieldFooter.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/shared/FieldFooter/index.d.ts +0 -2
- package/dist/components/RecordEdition/EditRecordContent/shared/FieldFooter/index.js +0 -6
- package/dist/components/RecordEdition/EditRecordContent/shared/FieldFooter/index.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/shared/InheritedFieldLabel/InheritedFieldLabel.d.ts +0 -6
- package/dist/components/RecordEdition/EditRecordContent/shared/InheritedFieldLabel/InheritedFieldLabel.js +0 -25
- package/dist/components/RecordEdition/EditRecordContent/shared/InheritedFieldLabel/InheritedFieldLabel.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/shared/InheritedFieldLabel/index.d.ts +0 -2
- package/dist/components/RecordEdition/EditRecordContent/shared/InheritedFieldLabel/index.js +0 -6
- package/dist/components/RecordEdition/EditRecordContent/shared/InheritedFieldLabel/index.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/shared/NoValue/NoValue.d.ts +0 -7
- package/dist/components/RecordEdition/EditRecordContent/shared/NoValue/NoValue.js +0 -33
- package/dist/components/RecordEdition/EditRecordContent/shared/NoValue/NoValue.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/shared/NoValue/index.d.ts +0 -2
- package/dist/components/RecordEdition/EditRecordContent/shared/NoValue/index.js +0 -6
- package/dist/components/RecordEdition/EditRecordContent/shared/NoValue/index.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/shared/UpdatedFieldIcon/UpdatedFieldIcon.d.ts +0 -2
- package/dist/components/RecordEdition/EditRecordContent/shared/UpdatedFieldIcon/UpdatedFieldIcon.js +0 -13
- package/dist/components/RecordEdition/EditRecordContent/shared/UpdatedFieldIcon/UpdatedFieldIcon.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/shared/UpdatedFieldIcon/index.d.ts +0 -2
- package/dist/components/RecordEdition/EditRecordContent/shared/UpdatedFieldIcon/index.js +0 -6
- package/dist/components/RecordEdition/EditRecordContent/shared/UpdatedFieldIcon/index.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/shared/ValueDetailsBtn/ValueDetailsBtn.d.ts +0 -10
- package/dist/components/RecordEdition/EditRecordContent/shared/ValueDetailsBtn/ValueDetailsBtn.js +0 -24
- package/dist/components/RecordEdition/EditRecordContent/shared/ValueDetailsBtn/ValueDetailsBtn.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/shared/ValueDetailsBtn/index.d.ts +0 -2
- package/dist/components/RecordEdition/EditRecordContent/shared/ValueDetailsBtn/index.js +0 -6
- package/dist/components/RecordEdition/EditRecordContent/shared/ValueDetailsBtn/index.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/shared/ValuesVersionBtn/ValuesVersionBtn.d.ts +0 -13
- package/dist/components/RecordEdition/EditRecordContent/shared/ValuesVersionBtn/ValuesVersionBtn.js +0 -41
- package/dist/components/RecordEdition/EditRecordContent/shared/ValuesVersionBtn/ValuesVersionBtn.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/shared/ValuesVersionBtn/index.d.ts +0 -2
- package/dist/components/RecordEdition/EditRecordContent/shared/ValuesVersionBtn/index.js +0 -6
- package/dist/components/RecordEdition/EditRecordContent/shared/ValuesVersionBtn/index.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/shared/ValuesVersionIndicator/ValuesVersionIndicator.d.ts +0 -8
- package/dist/components/RecordEdition/EditRecordContent/shared/ValuesVersionIndicator/ValuesVersionIndicator.js +0 -34
- package/dist/components/RecordEdition/EditRecordContent/shared/ValuesVersionIndicator/ValuesVersionIndicator.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/shared/ValuesVersionIndicator/index.d.ts +0 -2
- package/dist/components/RecordEdition/EditRecordContent/shared/ValuesVersionIndicator/index.js +0 -6
- package/dist/components/RecordEdition/EditRecordContent/shared/ValuesVersionIndicator/index.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LinkFieldExplorer.js","sourceRoot":"","sources":["../../../../../../../src/components/RecordEdition/EditRecordContent/uiElements/LinkField/explorer/LinkFieldExplorer.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,oBAAoB,EAAC,MAAM,aAAa,CAAC;AACjD,OAAO,EAAyB,QAAQ,EAAC,MAAM,OAAO,CAAC;AACvD,OAAO,EAAC,oBAAoB,EAAC,MAAM,qEAAqE,CAAC;
|
|
1
|
+
{"version":3,"file":"LinkFieldExplorer.js","sourceRoot":"","sources":["../../../../../../../src/components/RecordEdition/EditRecordContent/uiElements/LinkField/explorer/LinkFieldExplorer.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,oBAAoB,EAAC,MAAM,aAAa,CAAC;AACjD,OAAO,EAAyB,QAAQ,EAAC,MAAM,OAAO,CAAC;AACvD,OAAO,EAAC,oBAAoB,EAAC,MAAM,qEAAqE,CAAC;AAGzG,OAAO,EAAC,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AS;QACT,kBAAkB;QAClB,gBAAgB;QAChB,aAAa;QACb,gBAAgB;QAChB,UAAU;QACV,cAAc;QACd,UAAU,EAAE,aAAa,CAAC,MAAM,KAAK,CAAC;QACtC,sBAAsB;KACzB,CAAC,CAAC;IAEH,MAAM,EAAC,sBAAsB,EAAC,GAAG,mBAAmB,CAAC;QACjD,SAAS;QACT,aAAa;QACb,gBAAgB;QAChB,sBAAsB;QACtB,UAAU;QACV,cAAc;KACjB,CAAC,CAAC;IAEH,OAAO,CACH,KAAC,OAAO,qBAAgB,YAAY,YAChC,KAAC,OAAO,CAAC,IAAI,IAAC,IAAI,EAAE,SAAS,CAAC,EAAE,EAAE,OAAO,kBACrC,KAAC,YAAY,IACT,EAAE,EAAE,oBAAoB,GAAG,SAAS,CAAC,EAAE,EACvC,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,SAAS,CAAC,QAAQ,EAC5B,QAAQ,QACR,MAAM,EAAE,cAAc,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,EAC5C,MAAM,EAAE,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,EAC3D,KAAK,EACD,8BACI,KAAC,mBAAmB,cAChB,KAAC,gBAAgB,IAAC,eAAe,EAAE,eAAe,EAAE,cAAc,EAAE,cAAc,GAAI,GACpE,EACrB,sBAAsB,IACxB,yBAEc,UAAU,YAE9B,mBAAmB,GACT,GACJ,GACT,CACb,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 {localizedTranslation} from '@leav/utils';\nimport {type FunctionComponent, useState} from 'react';\nimport {useEditRecordReducer} from '_ui/components/RecordEdition/editRecordReducer/useEditRecordReducer';\nimport {type RecordFormElementsValueLinkValue} from '_ui/hooks/useGetRecordForm/useGetRecordForm';\nimport {type JoinLibraryContextFragment, type RecordFormAttributeLinkAttributeFragment} from '_ui/_gqlTypes';\nimport {AntForm} from 'aristid-ds';\nimport {useLang} from '_ui/hooks';\nimport {LINK_FIELD_ID_PREFIX} from '_ui/constants';\nimport {computeCalculatedFlags, computeInheritedFlags} from '../../shared/calculatedInheritedFlags';\nimport {ComputeIndicator} from '../../shared/ComputeIndicator';\nimport {useOutsideInteractionDetector} from '../../shared/useOutsideInteractionDetector';\nimport {useLinkRecords} from './link-record/useLinkRecords';\nimport {\n CREATE_RECORD_MODAL_CLASSNAME,\n EDIT_RECORD_MODAL_CLASSNAME,\n LINK_RECORDS_MODAL_CLASSNAME,\n} from '_ui/components/Explorer/_constants';\nimport {type LinkFieldProps} from '../_types';\nimport {useUnlinkAllRecords} from '../unlink-all-records/useUnlinkAllRecords';\nimport {Wrapper} from '../shared/Wrapper';\nimport {InputExtraAlignLeft} from '../shared/InputExtraAlignLeft';\nimport {InputWrapper} from '../shared/InputWrapper';\n\nexport const LinkFieldExplorer: FunctionComponent<LinkFieldProps> = ({\n element,\n readonly,\n isFormCreationMode,\n onDeleteMultipleValues,\n metadataEdit = false,\n}) => {\n const {state, dispatch} = useEditRecordReducer();\n const {lang} = useLang();\n const {\n settings,\n attribute,\n joinLibraryContext,\n }: {\n settings: typeof element.settings;\n attribute?: RecordFormAttributeLinkAttributeFragment;\n joinLibraryContext?: JoinLibraryContextFragment;\n } = element;\n\n const [backendValues, setBackendValues] = useState<RecordFormElementsValueLinkValue[]>(element.values);\n\n const calculatedFlags = computeCalculatedFlags(backendValues);\n const inheritedFlags = computeInheritedFlags(backendValues);\n const form = AntForm.useFormInstance();\n const label = localizedTranslation(settings.label, lang);\n const fieldErrors = form.getFieldError(attribute.id);\n\n // TODO: Temporary const that should be removed (and all it's usages) when we will have a proper way to override multiple values\n const tmpCantOverrideValues =\n attribute.multiple_values &&\n (calculatedFlags.calculatedValues?.length > 1 || inheritedFlags.inheritedValues?.length > 1);\n\n const columnsToDisplay = settings.columns?.map(({id}) => id);\n const isReadOnly = attribute.readonly || !attribute.permissions.edit_value || readonly || tmpCantOverrideValues;\n const isFieldInError = fieldErrors.length > 0;\n\n useOutsideInteractionDetector({\n attribute,\n activeAttribute: state.activeAttribute,\n attributePrefix: LINK_FIELD_ID_PREFIX,\n dispatch,\n backendValues,\n allowedSelectors: [\n 'div[role=\"status\"]:has(.kit-snackbar-message)',\n '.kit-modal-wrapper',\n `.${CREATE_RECORD_MODAL_CLASSNAME}`,\n `.${LINK_RECORDS_MODAL_CLASSNAME}`,\n `.${EDIT_RECORD_MODAL_CLASSNAME}`,\n '.kit-select-dropdown-content',\n ],\n });\n\n const editionFormId = settings.editFormId ? settings.editFormId : 'edition';\n\n const {LinkRecordsExplorer} = useLinkRecords({\n libraryId: state.libraryId,\n recordId: state.record?.id,\n editionFormId,\n isFormCreationMode,\n attribute,\n joinLibraryContext,\n columnsToDisplay,\n backendValues,\n setBackendValues,\n isReadOnly,\n isFieldInError,\n hasNoValue: backendValues.length === 0,\n onDeleteMultipleValues,\n });\n\n const {UnlinkAllRecordsButton} = useUnlinkAllRecords({\n attribute,\n backendValues,\n setBackendValues,\n onDeleteMultipleValues,\n isReadOnly,\n isFieldInError,\n });\n\n return (\n <Wrapper $metadataEdit={metadataEdit}>\n <AntForm.Item name={attribute.id} noStyle>\n <InputWrapper\n id={LINK_FIELD_ID_PREFIX + attribute.id}\n label={label}\n required={attribute.required}\n bordered\n status={isFieldInError ? 'error' : undefined}\n helper={isFieldInError ? String(fieldErrors[0]) : undefined}\n extra={\n <>\n <InputExtraAlignLeft>\n <ComputeIndicator calculatedFlags={calculatedFlags} inheritedFlags={inheritedFlags} />\n </InputExtraAlignLeft>\n {UnlinkAllRecordsButton}\n </>\n }\n $readonlyBackground={isReadOnly}\n >\n {LinkRecordsExplorer}\n </InputWrapper>\n </AntForm.Item>\n </Wrapper>\n );\n};\n"]}
|
|
@@ -137,6 +137,6 @@ export const EditRecordModal = ({ className, open, record, creationFormId, editi
|
|
|
137
137
|
return (_jsxs(KitModalStyled, { appElement: document.getElementById('root'), className: className, height: autoHeight ? 'auto' : MODAL_HEIGHT, maxHeight: autoHeight ? MODAL_HEIGHT : undefined, width: MODAL_WIDTH, isOpen: open, close: _handleClose, title: _jsxs(KitSpace, { children: [_jsx(KitTypography.Title, { level: "h2", style: { margin: 0 }, children: modalTitle }), _jsx("div", { id: EDIT_RECORD_MODAL_HEADER_CONTAINER_BUTTONS })] }), footer: _jsx(KitSpace, { children: [
|
|
138
138
|
_jsx(KitButton, { "aria-label": closeButtonLabel, icon: _jsx(FontAwesomeIcon, { icon: faXmark }), onClick: _handleClose, children: closeButtonLabel }, "close"),
|
|
139
139
|
...displayedSubmitButtons,
|
|
140
|
-
] }), closeIcon: _jsx(FontAwesomeIcon, { icon: faXmark }), showCloseIcon: true, destroyOnClose: true, children: [isError && _jsx(ErrorComponent, {}), !isReady && _jsx(KitLoader, {}), isReady && (_jsx(EditRecord, { antdForm: antdForm, isFormCreationMode: isCreation, formId: formId, formElementId: formElementId.current, record: currentRecord, library: library, onCreate: _handleCreate, valuesVersion: valuesVersion, showSidebar: showSidebar, enableSidebar: enableSidebar, withInfoButton: withInfoButton }))] }));
|
|
140
|
+
] }), closeIcon: _jsx(FontAwesomeIcon, { icon: faXmark }), showCloseIcon: true, destroyOnClose: true, children: [isError && _jsx(ErrorComponent, {}), !isReady && _jsx(KitLoader, {}), isReady && (_jsx(EditRecord, { antdForm: antdForm, isFormCreationMode: isCreation, formId: formId, formElementId: formElementId.current, record: currentRecord, library: library, scrollAllRecordSummary: true, onCreate: _handleCreate, valuesVersion: valuesVersion, showSidebar: showSidebar, enableSidebar: enableSidebar, withInfoButton: withInfoButton }))] }));
|
|
141
141
|
};
|
|
142
142
|
//# sourceMappingURL=EditRecordModal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditRecordModal.js","sourceRoot":"","sources":["../../../../src/components/RecordEdition/EditRecord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// This file is released under LGPL V3\n// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt\nimport {type FunctionComponent, useEffect, useRef, useState} from 'react';\nimport {KitButton, KitLoader, KitModal, KitSpace, KitTypography} from 'aristid-ds';\nimport styled from 'styled-components';\nimport {useSharedTranslation} from '_ui/hooks/useSharedTranslation';\nimport {type IValueVersion} from '_ui/types';\nimport {type RecordIdentityFragment, useCreateRecordMutation, usePurgeRecordMutation} from '_ui/_gqlTypes';\nimport {EditRecord} from '../EditRecord';\nimport {FontAwesomeIcon} from '@fortawesome/react-fontawesome';\nimport {faXmark} from '@fortawesome/free-solid-svg-icons';\nimport {type PossibleSubmitButtons, type SubmitButtonsName} from '../_types';\nimport {useGetSubmitButtons} from '../hooks/useGetSubmitButtons';\nimport {useForm} from 'antd/lib/form/Form';\nimport {useCreateCancelConfirm} from '../hooks/useCreateCancelConfirm';\nimport {EDIT_RECORD_MODAL_HEADER_CONTAINER_BUTTONS} from '../constants';\nimport {useGetInitialRecordValues} from '../EditRecordPage/getInitialRecordValues';\nimport {ErrorComponent} from '../EditRecordPage/ErrorComponent';\n\nexport interface IEditRecordModalProps {\n className?: string;\n open: boolean;\n record: RecordIdentityFragment['whoAmI'] | null;\n creationFormId?: string;\n editionFormId?: string;\n library: string;\n onClose: () => void;\n onCreate?: (newRecord: RecordIdentityFragment['whoAmI']) => void; // Called after submitting via the \"create\" button\n onCreateAndEdit?: (newRecord: RecordIdentityFragment['whoAmI']) => void; // Called after submitting via the \"create and edit\" button\n submitButtons?: PossibleSubmitButtons;\n withInfoButton?: boolean;\n valuesVersion?: IValueVersion;\n showSidebar?: boolean;\n enableSidebar?: boolean;\n autoHeight?: boolean;\n}\n\nconst MODAL_HEIGHT = '80vh';\nconst MODAL_WIDTH = '90vw';\nconst MODAL_MAX_WIDTH = '656px';\nconst MODAL_WITH_SIDEBAR_MAX_WIDTH = '900px';\n\nconst KitModalStyled = styled(KitModal)`\n && {\n & > div {\n max-width: ${MODAL_MAX_WIDTH};\n\n &:has(#edit_record_sidebar) {\n max-width: ${MODAL_WITH_SIDEBAR_MAX_WIDTH};\n }\n\n .kit-modal-header {\n border-bottom: 1px solid var(--general-utilities-border);\n\n .kit-modal-title {\n padding-right: calc(var(--general-spacing-xs) * 1px);\n\n .ant-space {\n width: 100%;\n justify-content: space-between;\n }\n }\n }\n\n .kit-modal-content-wrapper {\n padding: 0;\n\n .kit-modal-content {\n height: 100%;\n\n & > div {\n height: 100%;\n }\n }\n }\n }\n }\n`;\n\nexport const EditRecordModal: FunctionComponent<IEditRecordModalProps> = ({\n className,\n open,\n record,\n creationFormId,\n editionFormId,\n library,\n onClose,\n onCreate,\n onCreateAndEdit,\n valuesVersion,\n showSidebar,\n enableSidebar,\n submitButtons = ['create'],\n withInfoButton = true,\n autoHeight = false,\n}) => {\n const {t} = useSharedTranslation();\n const [antdForm] = useForm();\n const [currentRecord, setCurrentRecord] = useState<RecordIdentityFragment['whoAmI'] | null>(record);\n const clickedSubmitButton = useRef<SubmitButtonsName | null>(null);\n const [createRecord] = useCreateRecordMutation();\n const [purgeRecordMutation] = usePurgeRecordMutation();\n\n const formElementId = useRef(window.crypto.randomUUID());\n const [isCreation, setIsCreation] = useState(!record);\n const [isReady, setIsReady] = useState(!!record);\n const [isError, setIsError] = useState(false);\n const [formId, setFormId] = useState<string>(\n isCreation ? (creationFormId ?? 'creation') : (editionFormId ?? 'edition'),\n );\n const closeButtonLabel = isCreation ? t('global.cancel') : t('global.close');\n const modalTitle =\n currentRecord?.label && currentRecord.label.trim() ? currentRecord.label : t('record_edition.new_record');\n\n useEffect(() => {\n const createEmptyRecordFunction = async () => {\n const values = useGetInitialRecordValues();\n const {data} = await createRecord({\n variables: {\n library,\n skipActivate: true,\n data: {values},\n },\n });\n\n const recordId = data?.createRecord.record?.id;\n setCurrentRecord(data?.createRecord.record.whoAmI ?? null);\n if (!recordId) {\n setIsError(true);\n return;\n }\n\n setIsReady(true);\n };\n\n if (open && isCreation && !currentRecord) {\n createEmptyRecordFunction();\n }\n }, [open, currentRecord]);\n\n const _handleClickSubmit = (button: SubmitButtonsName) => {\n clickedSubmitButton.current = button;\n };\n\n const _purgeRecordOnCreationCancel = () =>\n purgeRecordMutation({\n errorPolicy: 'ignore',\n variables: {\n libraryId: currentRecord?.library?.id,\n recordId: currentRecord?.id,\n },\n });\n\n const _closeAfterConfirm = async () => {\n if (currentRecord?.id && currentRecord?.library?.id) {\n _purgeRecordOnCreationCancel();\n }\n return onClose();\n };\n\n const showCancelConfirm = useCreateCancelConfirm(_closeAfterConfirm);\n\n const _handleCreate = (newRecord: RecordIdentityFragment['whoAmI']) => {\n setCurrentRecord(newRecord);\n\n if (onCreateAndEdit && clickedSubmitButton.current === 'createAndEdit') {\n setFormId(editionFormId ?? 'edition');\n setIsCreation(false);\n onCreateAndEdit(newRecord);\n return;\n }\n\n if (onCreate && clickedSubmitButton.current === 'create') {\n onCreate(newRecord);\n return;\n }\n };\n\n const _handleClose = () => {\n if (isCreation) {\n if (antdForm.isFieldsTouched()) {\n return showCancelConfirm();\n } else {\n _purgeRecordOnCreationCancel();\n }\n }\n return onClose();\n };\n\n const displayedSubmitButtons = useGetSubmitButtons(\n submitButtons,\n formElementId.current,\n isCreation,\n _handleClickSubmit,\n _handleClose,\n );\n\n return (\n <KitModalStyled\n appElement={document.getElementById('root')}\n className={className}\n height={autoHeight ? 'auto' : MODAL_HEIGHT}\n maxHeight={autoHeight ? MODAL_HEIGHT : undefined}\n width={MODAL_WIDTH}\n isOpen={open}\n close={_handleClose}\n title={\n <KitSpace>\n <KitTypography.Title level=\"h2\" style={{margin: 0}}>\n {modalTitle}\n </KitTypography.Title>\n <div id={EDIT_RECORD_MODAL_HEADER_CONTAINER_BUTTONS} />\n </KitSpace>\n }\n footer={\n <KitSpace>\n {[\n <KitButton\n aria-label={closeButtonLabel}\n key=\"close\"\n icon={<FontAwesomeIcon icon={faXmark} />}\n onClick={_handleClose}\n >\n {closeButtonLabel}\n </KitButton>,\n ...displayedSubmitButtons,\n ]}\n </KitSpace>\n }\n closeIcon={<FontAwesomeIcon icon={faXmark} />}\n showCloseIcon\n destroyOnClose\n >\n {isError && <ErrorComponent />}\n {!isReady && <KitLoader />}\n {isReady && (\n <EditRecord\n antdForm={antdForm}\n isFormCreationMode={isCreation}\n formId={formId}\n formElementId={formElementId.current}\n record={currentRecord}\n library={library}\n onCreate={_handleCreate}\n valuesVersion={valuesVersion}\n showSidebar={showSidebar}\n enableSidebar={enableSidebar}\n withInfoButton={withInfoButton}\n />\n )}\n </KitModalStyled>\n );\n};\n"]}
|
|
1
|
+
{"version":3,"file":"EditRecordModal.js","sourceRoot":"","sources":["../../../../src/components/RecordEdition/EditRecordModal/EditRecordModal.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAyB,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AAC1E,OAAO,EAAC,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,aAAa,EAAC,MAAM,YAAY,CAAC;AACnF,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AAEpE,OAAO,EAA8B,uBAAuB,EAAE,sBAAsB,EAAC,MAAM,eAAe,CAAC;AAC3G,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AACzC,OAAO,EAAC,eAAe,EAAC,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAC,OAAO,EAAC,MAAM,mCAAmC,CAAC;AAE1D,OAAO,EAAC,mBAAmB,EAAC,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAC,OAAO,EAAC,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAC,sBAAsB,EAAC,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAC,0CAA0C,EAAC,MAAM,cAAc,CAAC;AACxE,OAAO,EAAC,yBAAyB,EAAC,MAAM,0CA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OAAO,IAAI,CACR,KAAC,UAAU,IACP,QAAQ,EAAE,QAAQ,EAClB,kBAAkB,EAAE,UAAU,EAC9B,MAAM,EAAE,MAAM,EACd,aAAa,EAAE,aAAa,CAAC,OAAO,EACpC,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE,OAAO,EAChB,sBAAsB,QACtB,QAAQ,EAAE,aAAa,EACvB,aAAa,EAAE,aAAa,EAC5B,WAAW,EAAE,WAAW,EACxB,aAAa,EAAE,aAAa,EAC5B,cAAc,EAAE,cAAc,GAChC,CACL,IACY,CACpB,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, useEffect, useRef, useState} from 'react';\nimport {KitButton, KitLoader, KitModal, KitSpace, KitTypography} from 'aristid-ds';\nimport styled from 'styled-components';\nimport {useSharedTranslation} from '_ui/hooks/useSharedTranslation';\nimport {type IValueVersion} from '_ui/types';\nimport {type RecordIdentityFragment, useCreateRecordMutation, usePurgeRecordMutation} from '_ui/_gqlTypes';\nimport {EditRecord} from '../EditRecord';\nimport {FontAwesomeIcon} from '@fortawesome/react-fontawesome';\nimport {faXmark} from '@fortawesome/free-solid-svg-icons';\nimport {type PossibleSubmitButtons, type SubmitButtonsName} from '../_types';\nimport {useGetSubmitButtons} from '../hooks/useGetSubmitButtons';\nimport {useForm} from 'antd/lib/form/Form';\nimport {useCreateCancelConfirm} from '../hooks/useCreateCancelConfirm';\nimport {EDIT_RECORD_MODAL_HEADER_CONTAINER_BUTTONS} from '../constants';\nimport {useGetInitialRecordValues} from '../EditRecordPage/getInitialRecordValues';\nimport {ErrorComponent} from '../EditRecordPage/ErrorComponent';\n\nexport interface IEditRecordModalProps {\n className?: string;\n open: boolean;\n record: RecordIdentityFragment['whoAmI'] | null;\n creationFormId?: string;\n editionFormId?: string;\n library: string;\n onClose: () => void;\n onCreate?: (newRecord: RecordIdentityFragment['whoAmI']) => void; // Called after submitting via the \"create\" button\n onCreateAndEdit?: (newRecord: RecordIdentityFragment['whoAmI']) => void; // Called after submitting via the \"create and edit\" button\n submitButtons?: PossibleSubmitButtons;\n withInfoButton?: boolean;\n valuesVersion?: IValueVersion;\n showSidebar?: boolean;\n enableSidebar?: boolean;\n autoHeight?: boolean;\n}\n\nconst MODAL_HEIGHT = '80vh';\nconst MODAL_WIDTH = '90vw';\nconst MODAL_MAX_WIDTH = '656px';\nconst MODAL_WITH_SIDEBAR_MAX_WIDTH = '900px';\n\nconst KitModalStyled = styled(KitModal)`\n && {\n & > div {\n max-width: ${MODAL_MAX_WIDTH};\n\n &:has(#edit_record_sidebar) {\n max-width: ${MODAL_WITH_SIDEBAR_MAX_WIDTH};\n }\n\n .kit-modal-header {\n border-bottom: 1px solid var(--general-utilities-border);\n\n .kit-modal-title {\n padding-right: calc(var(--general-spacing-xs) * 1px);\n\n .ant-space {\n width: 100%;\n justify-content: space-between;\n }\n }\n }\n\n .kit-modal-content-wrapper {\n padding: 0;\n\n .kit-modal-content {\n height: 100%;\n\n & > div {\n height: 100%;\n }\n }\n }\n }\n }\n`;\n\nexport const EditRecordModal: FunctionComponent<IEditRecordModalProps> = ({\n className,\n open,\n record,\n creationFormId,\n editionFormId,\n library,\n onClose,\n onCreate,\n onCreateAndEdit,\n valuesVersion,\n showSidebar,\n enableSidebar,\n submitButtons = ['create'],\n withInfoButton = true,\n autoHeight = false,\n}) => {\n const {t} = useSharedTranslation();\n const [antdForm] = useForm();\n const [currentRecord, setCurrentRecord] = useState<RecordIdentityFragment['whoAmI'] | null>(record);\n const clickedSubmitButton = useRef<SubmitButtonsName | null>(null);\n const [createRecord] = useCreateRecordMutation();\n const [purgeRecordMutation] = usePurgeRecordMutation();\n\n const formElementId = useRef(window.crypto.randomUUID());\n const [isCreation, setIsCreation] = useState(!record);\n const [isReady, setIsReady] = useState(!!record);\n const [isError, setIsError] = useState(false);\n const [formId, setFormId] = useState<string>(\n isCreation ? (creationFormId ?? 'creation') : (editionFormId ?? 'edition'),\n );\n const closeButtonLabel = isCreation ? t('global.cancel') : t('global.close');\n const modalTitle =\n currentRecord?.label && currentRecord.label.trim() ? currentRecord.label : t('record_edition.new_record');\n\n useEffect(() => {\n const createEmptyRecordFunction = async () => {\n const values = useGetInitialRecordValues();\n const {data} = await createRecord({\n variables: {\n library,\n skipActivate: true,\n data: {values},\n },\n });\n\n const recordId = data?.createRecord.record?.id;\n setCurrentRecord(data?.createRecord.record.whoAmI ?? null);\n if (!recordId) {\n setIsError(true);\n return;\n }\n\n setIsReady(true);\n };\n\n if (open && isCreation && !currentRecord) {\n createEmptyRecordFunction();\n }\n }, [open, currentRecord]);\n\n const _handleClickSubmit = (button: SubmitButtonsName) => {\n clickedSubmitButton.current = button;\n };\n\n const _purgeRecordOnCreationCancel = () =>\n purgeRecordMutation({\n errorPolicy: 'ignore',\n variables: {\n libraryId: currentRecord?.library?.id,\n recordId: currentRecord?.id,\n },\n });\n\n const _closeAfterConfirm = async () => {\n if (currentRecord?.id && currentRecord?.library?.id) {\n _purgeRecordOnCreationCancel();\n }\n return onClose();\n };\n\n const showCancelConfirm = useCreateCancelConfirm(_closeAfterConfirm);\n\n const _handleCreate = (newRecord: RecordIdentityFragment['whoAmI']) => {\n setCurrentRecord(newRecord);\n\n if (onCreateAndEdit && clickedSubmitButton.current === 'createAndEdit') {\n setFormId(editionFormId ?? 'edition');\n setIsCreation(false);\n onCreateAndEdit(newRecord);\n return;\n }\n\n if (onCreate && clickedSubmitButton.current === 'create') {\n onCreate(newRecord);\n return;\n }\n };\n\n const _handleClose = () => {\n if (isCreation) {\n if (antdForm.isFieldsTouched()) {\n return showCancelConfirm();\n } else {\n _purgeRecordOnCreationCancel();\n }\n }\n return onClose();\n };\n\n const displayedSubmitButtons = useGetSubmitButtons(\n submitButtons,\n formElementId.current,\n isCreation,\n _handleClickSubmit,\n _handleClose,\n );\n\n return (\n <KitModalStyled\n appElement={document.getElementById('root')}\n className={className}\n height={autoHeight ? 'auto' : MODAL_HEIGHT}\n maxHeight={autoHeight ? MODAL_HEIGHT : undefined}\n width={MODAL_WIDTH}\n isOpen={open}\n close={_handleClose}\n title={\n <KitSpace>\n <KitTypography.Title level=\"h2\" style={{margin: 0}}>\n {modalTitle}\n </KitTypography.Title>\n <div id={EDIT_RECORD_MODAL_HEADER_CONTAINER_BUTTONS} />\n </KitSpace>\n }\n footer={\n <KitSpace>\n {[\n <KitButton\n aria-label={closeButtonLabel}\n key=\"close\"\n icon={<FontAwesomeIcon icon={faXmark} />}\n onClick={_handleClose}\n >\n {closeButtonLabel}\n </KitButton>,\n ...displayedSubmitButtons,\n ]}\n </KitSpace>\n }\n closeIcon={<FontAwesomeIcon icon={faXmark} />}\n showCloseIcon\n destroyOnClose\n >\n {isError && <ErrorComponent />}\n {!isReady && <KitLoader />}\n {isReady && (\n <EditRecord\n antdForm={antdForm}\n isFormCreationMode={isCreation}\n formId={formId}\n formElementId={formElementId.current}\n record={currentRecord}\n library={library}\n scrollAllRecordSummary\n onCreate={_handleCreate}\n valuesVersion={valuesVersion}\n showSidebar={showSidebar}\n enableSidebar={enableSidebar}\n withInfoButton={withInfoButton}\n />\n )}\n </KitModalStyled>\n );\n};\n"]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type FunctionComponent } from 'react';
|
|
2
2
|
interface IEditRecordSidebarProps {
|
|
3
3
|
sidebarContainer?: HTMLElement;
|
|
4
|
+
scrollAllRecordSummary?: boolean;
|
|
4
5
|
}
|
|
5
6
|
export declare const EditRecordSidebar: FunctionComponent<IEditRecordSidebarProps>;
|
|
6
7
|
export default EditRecordSidebar;
|
|
@@ -22,7 +22,7 @@ const StyledDivContentWrapper = styled.div `
|
|
|
22
22
|
gap: calc(var(--general-spacing-s) * 1px);
|
|
23
23
|
height: 100%;
|
|
24
24
|
`;
|
|
25
|
-
const _getRecordSidebarContent = (state) => {
|
|
25
|
+
const _getRecordSidebarContent = (state, scrollAllRecordSummary = false) => {
|
|
26
26
|
// TODO: ValuesVersions should be removed or refactored later
|
|
27
27
|
switch (state.sidebarContent) {
|
|
28
28
|
case 'none':
|
|
@@ -32,7 +32,7 @@ const _getRecordSidebarContent = (state) => {
|
|
|
32
32
|
case 'valuesVersions':
|
|
33
33
|
return _jsx(ValuesVersions, {});
|
|
34
34
|
default:
|
|
35
|
-
return _jsx(RecordSummary, { record: state.record });
|
|
35
|
+
return _jsx(RecordSummary, { record: state.record, scrollAll: scrollAllRecordSummary });
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
38
|
const StyledKitSidePanel = styled(KitSidePanel) `
|
|
@@ -43,14 +43,14 @@ const StyledKitSidePanel = styled(KitSidePanel) `
|
|
|
43
43
|
grid-area: sidebar;
|
|
44
44
|
display: ${({ $isOpen }) => ($isOpen ? 'block' : 'none')};
|
|
45
45
|
`;
|
|
46
|
-
export const EditRecordSidebar = ({ sidebarContainer }) => {
|
|
46
|
+
export const EditRecordSidebar = ({ sidebarContainer, scrollAllRecordSummary, }) => {
|
|
47
47
|
const { lang } = useLang();
|
|
48
48
|
const { state } = useEditRecordReducer();
|
|
49
49
|
const sidePanelRef = useRef(null);
|
|
50
50
|
const idCardProps = state.sidebarContent === EditRecordSidebarContentTypeMap.VALUE_DETAILS
|
|
51
51
|
? { title: localizedTranslation(state.activeAttribute?.attribute.label, lang) }
|
|
52
52
|
: undefined;
|
|
53
|
-
const editRecordSidebarContent = (_jsx(StyledKitSidePanel, { ref: sidePanelRef, initialOpen: state.isOpenSidebar && state.enableSidebar, idCardProps: idCardProps, id: EDIT_RECORD_SIDEBAR_ID, headerExtra: _jsx(Breadcrumb, {}), "$hideBoxShadow": !sidebarContainer, "$isOpen": state.isOpenSidebar, children: _getRecordSidebarContent(state) }));
|
|
53
|
+
const editRecordSidebarContent = (_jsx(StyledKitSidePanel, { ref: sidePanelRef, initialOpen: state.isOpenSidebar && state.enableSidebar, idCardProps: idCardProps, id: EDIT_RECORD_SIDEBAR_ID, headerExtra: _jsx(Breadcrumb, {}), "$hideBoxShadow": !sidebarContainer, "$isOpen": state.isOpenSidebar, children: _getRecordSidebarContent(state, scrollAllRecordSummary) }));
|
|
54
54
|
useEffect(() => {
|
|
55
55
|
if (sidePanelRef.current && state.enableSidebar) {
|
|
56
56
|
if (state.isOpenSidebar) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditRecordSidebar.js","sourceRoot":"","sources":["../../../../src/components/RecordEdition/EditRecordSidebar/EditRecordSidebar.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAyB,SAAS,EAAE,MAAM,EAAC,MAAM,OAAO,CAAC;AAChE,OAAO,EAAC,oBAAoB,EAAC,MAAM,2CAA2C,CAAC;AAC/E,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAC,YAAY,EAAC,MAAM,WAAW,CAAC;AACvC,OAAO,EAAC,+BAA+B,EAA+B,MAAM,wCAAwC,CAAC;AACrH,OAAO,EAAC,YAAY,EAAC,MAAM,YAAY,CAAC;AAExC,OAAO,EAAC,sBAAsB,EAAC,MAAM,eAAe,CAAC;AACrD,OAAO,UAAU,MAAM,aAAa,CAAC;AACrC,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAClD,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAClC,OAAO,EAAC,oBAAoB,EAAC,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"EditRecordSidebar.js","sourceRoot":"","sources":["../../../../src/components/RecordEdition/EditRecordSidebar/EditRecordSidebar.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAyB,SAAS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ACvC,CACxB,CAAC;IAEF,SAAS,CAAC,GAAG,EAAE;QACX,IAAI,YAAY,CAAC,OAAO,IAAI,KAAK,CAAC,aAAa,EAAE,CAAC;YAC9C,IAAI,KAAK,CAAC,aAAa,EAAE,CAAC;gBACtB,YAAY,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;YAChC,CAAC;iBAAM,CAAC;gBACJ,YAAY,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;YACjC,CAAC;QACL,CAAC;IACL,CAAC,EAAE,CAAC,KAAK,CAAC,aAAa,EAAE,KAAK,CAAC,aAAa,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC;IAErE,IAAI,CAAC,KAAK,CAAC,aAAa,EAAE,CAAC;QACvB,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,OAAO,gBAAgB,KAAK,SAAS;QACjC,CAAC,CAAC,wBAAwB;QAC1B,CAAC,CAAC,YAAY,CAAC,wBAAwB,EAAE,gBAAgB,CAAC,CAAC;AACnE,CAAC,CAAC;AAEF,eAAe,iBAAiB,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, useEffect, useRef} from 'react';\nimport {useEditRecordReducer} from '../editRecordReducer/useEditRecordReducer';\nimport RecordSummary from './RecordSummary';\nimport ValuesVersions from './ValuesVersions';\nimport {createPortal} from 'react-dom';\nimport {EditRecordSidebarContentTypeMap, type IEditRecordReducerState} from '../editRecordReducer/editRecordReducer';\nimport {KitSidePanel} from 'aristid-ds';\nimport {type KitSidePanelRef} from 'aristid-ds/dist/Kit/Navigation/SidePanel/types';\nimport {EDIT_RECORD_SIDEBAR_ID} from '_ui/constants';\nimport Breadcrumb from './Breacrumb';\nimport AttributeSummary from './AttributeSummary';\nimport ValuesSummary from './ValuesSummary';\nimport styled from 'styled-components';\nimport {useLang} from '_ui/hooks';\nimport {localizedTranslation} from '@leav/utils';\n\ninterface IEditRecordSidebarProps {\n sidebarContainer?: HTMLElement;\n scrollAllRecordSummary?: boolean;\n}\n\nconst StyledDivContentWrapper = styled.div`\n display: flex;\n flex-direction: column;\n gap: calc(var(--general-spacing-s) * 1px);\n height: 100%;\n`;\n\nconst _getRecordSidebarContent = (state: IEditRecordReducerState, scrollAllRecordSummary: boolean = false) => {\n // TODO: ValuesVersions should be removed or refactored later\n switch (state.sidebarContent) {\n case 'none':\n return null;\n case 'valueDetails':\n return (\n <StyledDivContentWrapper>\n <AttributeSummary attribute={state.activeAttribute.attribute} />\n <ValuesSummary\n record={state.record}\n attributeId={state.activeAttribute.attribute.id}\n globalValues={state.activeAttribute.globalValues}\n calculatedValues={state.activeAttribute.calculatedValues}\n />\n </StyledDivContentWrapper>\n );\n case 'valuesVersions':\n return <ValuesVersions />;\n default:\n return <RecordSummary record={state.record} scrollAll={scrollAllRecordSummary} />;\n }\n};\n\nconst StyledKitSidePanel = styled(KitSidePanel)<{$hideBoxShadow: boolean; $isOpen: boolean}>`\n ${({$hideBoxShadow}) =>\n $hideBoxShadow &&\n `&&& section {\n box-shadow: none;\n }`}\n grid-area: sidebar;\n display: ${({$isOpen}) => ($isOpen ? 'block' : 'none')};\n`;\n\nexport const EditRecordSidebar: FunctionComponent<IEditRecordSidebarProps> = ({\n sidebarContainer,\n scrollAllRecordSummary,\n}) => {\n const {lang} = useLang();\n const {state} = useEditRecordReducer();\n const sidePanelRef = useRef<KitSidePanelRef | null>(null);\n const idCardProps =\n state.sidebarContent === EditRecordSidebarContentTypeMap.VALUE_DETAILS\n ? {title: localizedTranslation(state.activeAttribute?.attribute.label, lang)}\n : undefined;\n\n const editRecordSidebarContent = (\n <StyledKitSidePanel\n ref={sidePanelRef}\n initialOpen={state.isOpenSidebar && state.enableSidebar}\n idCardProps={idCardProps}\n id={EDIT_RECORD_SIDEBAR_ID}\n headerExtra={<Breadcrumb />}\n $hideBoxShadow={!sidebarContainer}\n $isOpen={state.isOpenSidebar}\n >\n {_getRecordSidebarContent(state, scrollAllRecordSummary)}\n </StyledKitSidePanel>\n );\n\n useEffect(() => {\n if (sidePanelRef.current && state.enableSidebar) {\n if (state.isOpenSidebar) {\n sidePanelRef.current.open();\n } else {\n sidePanelRef.current.close();\n }\n }\n }, [state.enableSidebar, state.isOpenSidebar, sidePanelRef.current]);\n\n if (!state.enableSidebar) {\n return null;\n }\n\n return sidebarContainer === undefined\n ? editRecordSidebarContent\n : createPortal(editRecordSidebarContent, sidebarContainer);\n};\n\nexport default EditRecordSidebar;\n"]}
|
|
@@ -2,6 +2,7 @@ import { type IRecordIdentityWhoAmI } from '../../../../types/records';
|
|
|
2
2
|
import { type FunctionComponent } from 'react';
|
|
3
3
|
interface IRecordSummaryProps {
|
|
4
4
|
record: IRecordIdentityWhoAmI | null;
|
|
5
|
+
scrollAll?: boolean;
|
|
5
6
|
}
|
|
6
7
|
export declare const RecordSummary: FunctionComponent<IRecordSummaryProps>;
|
|
7
8
|
export default RecordSummary;
|
|
@@ -10,12 +10,13 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
|
10
10
|
import { faRotateRight } from '@fortawesome/free-solid-svg-icons';
|
|
11
11
|
import { RecordHistory } from '../../../RecordHistory/RecordHistory';
|
|
12
12
|
import styled from 'styled-components';
|
|
13
|
+
import RecordHistoryGoUpButton from '../../../../components/RecordHistory/RecordHistoryGoUpButton';
|
|
13
14
|
const StyledDivContentWrapper = styled.div `
|
|
14
15
|
display: flex;
|
|
15
16
|
flex-direction: column;
|
|
16
17
|
height: 100%;
|
|
17
18
|
`;
|
|
18
|
-
export const RecordSummary = ({ record }) => {
|
|
19
|
+
export const RecordSummary = ({ record, scrollAll }) => {
|
|
19
20
|
const { t } = useSharedTranslation();
|
|
20
21
|
const { loading, error, data, refetch } = useGetRecordValuesQuery(record?.library?.id, ['created_at', 'created_by', 'modified_at', 'modified_by'], [record?.id]);
|
|
21
22
|
if (loading) {
|
|
@@ -24,7 +25,7 @@ export const RecordSummary = ({ record }) => {
|
|
|
24
25
|
if (error) {
|
|
25
26
|
return (_jsxs(_Fragment, { children: [_jsx(KitAlert, { type: "error", message: t('record_summary.error.title'), description: t('record_summary.error.description'), details: error.message, customContent: record?.id && (_jsx(KitButton, { onClick: () => refetch([record?.id]), type: "action", icon: _jsx(FontAwesomeIcon, { icon: faRotateRight }), danger: true, children: t('record_summary.error.refresh') })) }), _jsx(KitEmpty, { image: KitEmpty.ASSET_TASKS_ERROR })] }));
|
|
26
27
|
}
|
|
27
|
-
return (
|
|
28
|
+
return (_jsx(StyledDivContentWrapper, { children: _jsxs(RecordHistoryGoUpButton, { disabled: !scrollAll, children: [_jsx(KitTypography.Text, { weight: "bold", children: t('record_summary.informations') }), _jsx(RecordInformations, { record: record, recordData: data?.[record?.id] }), _jsx(KitDivider, {}), _jsx(KitTypography.Text, { weight: "bold", children: t('record_summary.history') }), record && _jsx(RecordHistory, { record: record, noScroll: scrollAll })] }) }));
|
|
28
29
|
};
|
|
29
30
|
export default RecordSummary;
|
|
30
31
|
//# sourceMappingURL=RecordSummary.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RecordSummary.js","sourceRoot":"","sources":["../../../../../src/components/RecordEdition/EditRecordSidebar/RecordSummary/RecordSummary.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,uBAAuB,EAAC,MAAM,mEAAmE,CAAC;AAE1G,OAAO,EAAC,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAY,WAAW,EAAW,aAAa,EAAC,MAAM,YAAY,CAAC;AACpH,OAAO,EAAC,kBAAkB,EAAC,MAAM,yCAAyC,CAAC;AAE3E,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAC,eAAe,EAAC,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAC,aAAa,EAAC,MAAM,mCAAmC,CAAC;AAChE,OAAO,EAAC,aAAa,EAAC,MAAM,sCAAsC,CAAC;AACnE,OAAO,MAAM,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"RecordSummary.js","sourceRoot":"","sources":["../../../../../src/components/RecordEdition/EditRecordSidebar/RecordSummary/RecordSummary.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,uBAAuB,EAAC,MAAM,mEAAmE,CAAC;AAE1G,OAAO,EAAC,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAY,WAAW,EAAW,aAAa,EAAC,MAAM,YAAY,CAAC;AACpH,OAAO,EAAC,kBAAkB,EAAC,MAAM,yCAAyC,CAAC;AAE3E,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAC,eAAe,EAAC,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAC,aAAa,EAAC,MAAM,mCAAmC,CAAC;AAChE,OAAO,EAAC,aAAa,EAAC,MAAM,sCAAsC,CAAC;AACnE,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,uBAAuB,MAAM,sDAAsD,CAAC;AAO3F,MAAM,uBAAuB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;CAIzC,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAA2C,CAAC,EAAC,MAAM,EAAE,SAAS,EAAC,EAAE,EAAE;IACzF,MAAM,EAAC,CAAC,EAAC,GAAG,oBAAoB,EAAE,CAAC;IACnC,MAAM,EAAC,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAC,GAAG,uBAAuB,CAC3D,MAAM,EAAE,OAAO,EAAE,EAAE,EACnB,CAAC,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,aAAa,CAAC,EAC1D,CAAC,MAAM,EAAE,EAAE,CAAC,CACf,CAAC;IAEF,IAAI,OAAO,EAAE,CAA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eAAe,aAAa,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 {useGetRecordValuesQuery} from '../../../../hooks/useGetRecordValuesQuery/useGetRecordValuesQuery';\nimport {type IRecordIdentityWhoAmI} from '../../../../types/records';\nimport {KitAlert, KitButton, KitDivider, KitEmpty, KitError, KitSkeleton, KitTabs, KitTypography} from 'aristid-ds';\nimport {RecordInformations} from './RecordInformations/RecordInformations';\nimport {type FunctionComponent} from 'react';\nimport {useSharedTranslation} from '_ui/hooks/useSharedTranslation';\nimport {FontAwesomeIcon} from '@fortawesome/react-fontawesome';\nimport {faRotateRight} from '@fortawesome/free-solid-svg-icons';\nimport {RecordHistory} from '../../../RecordHistory/RecordHistory';\nimport styled from 'styled-components';\nimport RecordHistoryGoUpButton from '_ui/components/RecordHistory/RecordHistoryGoUpButton';\n\ninterface IRecordSummaryProps {\n record: IRecordIdentityWhoAmI | null;\n scrollAll?: boolean;\n}\n\nconst StyledDivContentWrapper = styled.div`\n display: flex;\n flex-direction: column;\n height: 100%;\n`;\n\nexport const RecordSummary: FunctionComponent<IRecordSummaryProps> = ({record, scrollAll}) => {\n const {t} = useSharedTranslation();\n const {loading, error, data, refetch} = useGetRecordValuesQuery(\n record?.library?.id,\n ['created_at', 'created_by', 'modified_at', 'modified_by'],\n [record?.id],\n );\n\n if (loading) {\n return (\n <span data-testid=\"record-summary-skeleton\">\n <KitSkeleton.KitItemCardSkeleton />\n </span>\n );\n }\n\n if (error) {\n return (\n <>\n <KitAlert\n type=\"error\"\n message={t('record_summary.error.title')}\n description={t('record_summary.error.description')}\n details={error.message}\n customContent={\n record?.id && (\n <KitButton\n onClick={() => refetch([record?.id])}\n type=\"action\"\n icon={<FontAwesomeIcon icon={faRotateRight} />}\n danger\n >\n {t('record_summary.error.refresh')}\n </KitButton>\n )\n }\n />\n <KitEmpty image={KitEmpty.ASSET_TASKS_ERROR} />\n </>\n );\n }\n\n return (\n <StyledDivContentWrapper>\n <RecordHistoryGoUpButton disabled={!scrollAll}>\n <KitTypography.Text weight=\"bold\">{t('record_summary.informations')}</KitTypography.Text>\n <RecordInformations record={record} recordData={data?.[record?.id]} />\n <KitDivider />\n <KitTypography.Text weight=\"bold\">{t('record_summary.history')}</KitTypography.Text>\n {record && <RecordHistory record={record} noScroll={scrollAll} />}\n </RecordHistoryGoUpButton>\n </StyledDivContentWrapper>\n );\n};\n\nexport default RecordSummary;\n"]}
|
|
@@ -3,6 +3,7 @@ import { type FunctionComponent } from 'react';
|
|
|
3
3
|
interface IRecordHistoryProps {
|
|
4
4
|
record: IRecordIdentityWhoAmI;
|
|
5
5
|
attributeId?: string;
|
|
6
|
+
noScroll?: boolean;
|
|
6
7
|
}
|
|
7
8
|
export declare const RecordHistory: FunctionComponent<IRecordHistoryProps>;
|
|
8
9
|
export default RecordHistory;
|
|
@@ -15,7 +15,7 @@ import { RecordHistoryLogEntry } from './RecordHistoryLogEntry';
|
|
|
15
15
|
const StyledDivContentWrapper = styled.div `
|
|
16
16
|
margin-top: calc(var(--general-spacing-xs) * 1px);
|
|
17
17
|
flex: 1 1 0;
|
|
18
|
-
overflow-y: auto;
|
|
18
|
+
overflow-y: ${props => (props.$scrollable ? 'auto' : 'unset')};
|
|
19
19
|
`;
|
|
20
20
|
// TODO: This component should be moved to /apps/app-studio/src/modules/information-and-history/record-history/ when he will no longer be used by RecordSummary and ValuesSummary (those components will be removed in the future)
|
|
21
21
|
// Also when component will be moved
|
|
@@ -23,7 +23,7 @@ const StyledDivContentWrapper = styled.div `
|
|
|
23
23
|
// - remove usage of styled-components
|
|
24
24
|
// - instead of a record we could receive a recordId and a libraryId directly
|
|
25
25
|
// - remove styling of StyledDivContentWrapper that will no longer be necessary
|
|
26
|
-
export const RecordHistory = ({ record, attributeId }) => {
|
|
26
|
+
export const RecordHistory = ({ record, attributeId, noScroll }) => {
|
|
27
27
|
const { t } = useSharedTranslation();
|
|
28
28
|
const [showAllHistory, setShowAllHistory] = useState(false);
|
|
29
29
|
const { loading, inError, logs, total, hasMore, fetchMore } = useFetchRecordHistory({
|
|
@@ -44,7 +44,7 @@ export const RecordHistory = ({ record, attributeId }) => {
|
|
|
44
44
|
if (logs.length === 0) {
|
|
45
45
|
return (_jsx(StyledDivContentWrapper, { children: _jsx(KitTypography.Text, { children: t('record_history.empty_history') }) }));
|
|
46
46
|
}
|
|
47
|
-
return (_jsx(StyledDivContentWrapper, { children: _jsx(RecordHistoryGoUpButton, { children: _jsxs(KitSpace, { size: "s", direction: "vertical", children: [showAllHistory && (_jsxs(_Fragment, { children: [logs.map((logEntry, index) => (_jsx(RecordHistoryLogEntry, { index: index, logEntry: logEntry }, index))), _jsx(ShowMore, { hasMore: hasMore, fetchMore: fetchMore })] })), !showAllHistory && _jsx(RecordHistoryLogEntry, { index: 0, logEntry: logs[0] }, 0), total > 1 && (_jsx(KitButton, { type: "secondary", size: "s", onClick: () => setShowAllHistory(!showAllHistory), children: showAllHistory
|
|
47
|
+
return (_jsx(StyledDivContentWrapper, { "$scrollable": !noScroll, children: _jsx(RecordHistoryGoUpButton, { disabled: noScroll, children: _jsxs(KitSpace, { size: "s", direction: "vertical", children: [showAllHistory && (_jsxs(_Fragment, { children: [logs.map((logEntry, index) => (_jsx(RecordHistoryLogEntry, { index: index, logEntry: logEntry }, index))), _jsx(ShowMore, { hasMore: hasMore, fetchMore: fetchMore })] })), !showAllHistory && _jsx(RecordHistoryLogEntry, { index: 0, logEntry: logs[0] }, 0), total > 1 && (_jsx(KitButton, { type: "secondary", size: "s", onClick: () => setShowAllHistory(!showAllHistory), children: showAllHistory
|
|
48
48
|
? t('record_history.hide_history', { total })
|
|
49
49
|
: t('record_history.show_history', { total }) }))] }) }) }));
|
|
50
50
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RecordHistory.js","sourceRoot":"","sources":["../../../src/components/RecordHistory/RecordHistory.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AAEpE,OAAO,EAAC,SAAS,EAAE,QAAQ,EAAE,aAAa,EAAC,MAAM,YAAY,CAAC;AAC9D,OAAO,EAAyB,QAAQ,EAAC,MAAM,OAAO,CAAC;AACvD,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAC,OAAO,EAAC,MAAM,YAAY,CAAC;AACnC,OAAO,EAAC,QAAQ,EAAC,MAAM,aAAa,CAAC;AACrC,OAAO,EAAC,qBAAqB,EAAC,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAC,uBAAuB,EAAC,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAC,qBAAqB,EAAC,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"RecordHistory.js","sourceRoot":"","sources":["../../../src/components/RecordHistory/RecordHistory.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AAEpE,OAAO,EAAC,SAAS,EAAE,QAAQ,EAAE,aAAa,EAAC,MAAM,YAAY,CAAC;AAC9D,OAAO,EAAyB,QAAQ,EAAC,MAAM,OAAO,CAAC;AACvD,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAC,OAAO,EAAC,MAAM,YAAY,CAAC;AACnC,OAAO,EAAC,QAAQ,EAAC,MAAM,aAAa,CAAC;AACrC,OAAO,EAAC,qBAAqB,EAAC,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAC,uBAAuB,EAAC,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAC,qBAAqB,EAAC,MAA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H,KAAC,uBAAuB,mBAAc,CAAC,QAAQ,YAC3C,KAAC,uBAAuB,IAAC,QAAQ,EAAE,QAAQ,YACvC,MAAC,QAAQ,IAAC,IAAI,EAAC,GAAG,EAAC,SAAS,EAAC,UAAU,aAClC,cAAc,IAAI,CACf,8BACK,IAAI,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,KAAK,EAAE,EAAE,CAAC,CAC3B,KAAC,qBAAqB,IAAa,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,IAAvC,KAAK,CAAsC,CAC1E,CAAC,EACF,KAAC,QAAQ,IAAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,GAAI,IACrD,CACN,EACA,CAAC,cAAc,IAAI,KAAC,qBAAqB,IAAS,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC,IAA9B,CAAC,CAAiC,EACjF,KAAK,GAAG,CAAC,IAAI,CACV,KAAC,SAAS,IAAC,IAAI,EAAC,WAAW,EAAC,IAAI,EAAC,GAAG,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,iBAAiB,CAAC,CAAC,cAAc,CAAC,YACjF,cAAc;4BACX,CAAC,CAAC,CAAC,CAAC,6BAA6B,EAAE,EAAC,KAAK,EAAC,CAAC;4BAC3C,CAAC,CAAC,CAAC,CAAC,6BAA6B,EAAE,EAAC,KAAK,EAAC,CAAC,GACvC,CACf,IACM,GACW,GACJ,CAC7B,CAAC;AACN,CAAC,CAAC;AAEF,eAAe,aAAa,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 {type IRecordIdentityWhoAmI} from '_ui/types';\nimport {KitButton, KitSpace, KitTypography} from 'aristid-ds';\nimport {type FunctionComponent, useState} from 'react';\nimport styled from 'styled-components';\nimport {ErrorDisplay} from '../ErrorDisplay';\nimport {Loading} from '../Loading';\nimport {ShowMore} from '../ShowMore';\nimport {useFetchRecordHistory} from './hooks/useFetchRecordHistory';\nimport {RecordHistoryGoUpButton} from './RecordHistoryGoUpButton';\nimport {RecordHistoryLogEntry} from './RecordHistoryLogEntry';\n\ninterface IRecordHistoryProps {\n record: IRecordIdentityWhoAmI;\n attributeId?: string;\n noScroll?: boolean;\n}\n\nconst StyledDivContentWrapper = styled.div<{\n $scrollable?: boolean;\n}>`\n margin-top: calc(var(--general-spacing-xs) * 1px);\n flex: 1 1 0;\n overflow-y: ${props => (props.$scrollable ? 'auto' : 'unset')};\n`;\n\n// TODO: This component should be moved to /apps/app-studio/src/modules/information-and-history/record-history/ when he will no longer be used by RecordSummary and ValuesSummary (those components will be removed in the future)\n// Also when component will be moved\n// - put together translations with information_and_history\n// - remove usage of styled-components\n// - instead of a record we could receive a recordId and a libraryId directly\n// - remove styling of StyledDivContentWrapper that will no longer be necessary\nexport const RecordHistory: FunctionComponent<IRecordHistoryProps> = ({record, attributeId, noScroll}) => {\n const {t} = useSharedTranslation();\n const [showAllHistory, setShowAllHistory] = useState<boolean>(false);\n const {loading, inError, logs, total, hasMore, fetchMore} = useFetchRecordHistory({\n record: {\n id: record.id,\n libraryId: record.library.id,\n },\n attributeId,\n });\n\n if (loading && logs.length === 0) {\n // TODO: Add a better loading state\n return <Loading />;\n }\n\n if (inError) {\n //TODO: Add a better error state\n return <ErrorDisplay message={t('record_history.error_fetching')} />;\n }\n\n if (logs.length === 0) {\n return (\n <StyledDivContentWrapper>\n <KitTypography.Text>{t('record_history.empty_history')}</KitTypography.Text>\n </StyledDivContentWrapper>\n );\n }\n\n return (\n <StyledDivContentWrapper $scrollable={!noScroll}>\n <RecordHistoryGoUpButton disabled={noScroll}>\n <KitSpace size=\"s\" direction=\"vertical\">\n {showAllHistory && (\n <>\n {logs.map((logEntry, index) => (\n <RecordHistoryLogEntry key={index} index={index} logEntry={logEntry} />\n ))}\n <ShowMore hasMore={hasMore} fetchMore={fetchMore} />\n </>\n )}\n {!showAllHistory && <RecordHistoryLogEntry key={0} index={0} logEntry={logs[0]} />}\n {total > 1 && (\n <KitButton type=\"secondary\" size=\"s\" onClick={() => setShowAllHistory(!showAllHistory)}>\n {showAllHistory\n ? t('record_history.hide_history', {total})\n : t('record_history.show_history', {total})}\n </KitButton>\n )}\n </KitSpace>\n </RecordHistoryGoUpButton>\n </StyledDivContentWrapper>\n );\n};\n\nexport default RecordHistory;\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } 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
|
|
@@ -14,14 +14,14 @@ const StyledKitButtonGoUp = styled(KitButton) `
|
|
|
14
14
|
bottom: calc(var(--general-spacing-m) * 1px);
|
|
15
15
|
z-index: 10;
|
|
16
16
|
`;
|
|
17
|
-
export const RecordHistoryGoUpButton = ({ children }) => {
|
|
17
|
+
export const RecordHistoryGoUpButton = ({ disabled, children }) => {
|
|
18
18
|
// cannot use detectScrollTopRef because it is not a ref to div but to a customRef to a callback
|
|
19
19
|
const scrollTopRef = useRef(null);
|
|
20
20
|
// Detect if the top of the list is visible or not
|
|
21
21
|
// to show or hide the "go up" button
|
|
22
22
|
const [detectScrollTopRef, detectScrollTopEntry] = useIntersectionObserver({ threshold: 0 });
|
|
23
23
|
const showGoUpButton = !detectScrollTopEntry?.isIntersecting;
|
|
24
|
-
return (_jsxs("div", { ref: scrollTopRef, children: [_jsx("div", { ref: detectScrollTopRef }), children, showGoUpButton && (_jsx(StyledKitButtonGoUp, { type: "segmented", size: "m", icon: _jsx(FontAwesomeIcon, { icon: faAngleUp }), onClick: () => {
|
|
24
|
+
return disabled ? (_jsx(_Fragment, { children: children })) : (_jsxs("div", { ref: scrollTopRef, children: [_jsx("div", { ref: detectScrollTopRef }), children, showGoUpButton && (_jsx(StyledKitButtonGoUp, { type: "segmented", size: "m", icon: _jsx(FontAwesomeIcon, { icon: faAngleUp }), onClick: () => {
|
|
25
25
|
scrollTopRef.current?.scrollIntoView({ behavior: 'smooth' });
|
|
26
26
|
} }))] }));
|
|
27
27
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RecordHistoryGoUpButton.js","sourceRoot":"","sources":["../../../src/components/RecordHistory/RecordHistoryGoUpButton.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,SAAS,EAAC,MAAM,mCAAmC,CAAC;AAC5D,OAAO,EAAC,eAAe,EAAC,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAC,uBAAuB,EAAC,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAC,SAAS,EAAC,MAAM,YAAY,CAAC;AACrC,OAAO,EAAiB,MAAM,EAAC,MAAM,OAAO,CAAC;AAC7C,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,MAAM,mBAAmB,GAAG,MAAM,CAAC,SAAS,CAAC,CAAA;;;;;CAK5C,CAAC;
|
|
1
|
+
{"version":3,"file":"RecordHistoryGoUpButton.js","sourceRoot":"","sources":["../../../src/components/RecordHistory/RecordHistoryGoUpButton.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,SAAS,EAAC,MAAM,mCAAmC,CAAC;AAC5D,OAAO,EAAC,eAAe,EAAC,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAC,uBAAuB,EAAC,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAC,SAAS,EAAC,MAAM,YAAY,CAAC;AACrC,OAAO,EAAiB,MAAM,EAAC,MAAM,OAAO,CAAC;AAC7C,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,MAAM,mBAAmB,GAAG,MAAM,CAAC,SAAS,CAAC,CAAA;;;;;CAK5C,CAAC;AAOF,MAAM,CAAC,MAAM,uBAAuB,GAA4C,CAAC,EAAC,QAAQ,EAAE,QAAQ,EAAC,EAAE,EAAE;IACrG,gGAAgG;IAChG,MAAM,YAAY,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAElD,kDAAkD;IAClD,qCAAqC;IACrC,MAAM,CAAC,kBAAkB,EAAE,oBAAoB,CAAC,GAAG,uBAAuB,CAAiB,EAAC,SAAS,EAAE,CAAC,EAAC,CAAC,CAAC;IAC3G,MAAM,cAAc,GAAG,CAAC,oBAAoB,EAAE,cAAc,CAAC;IAE7D,OAAO,QAAQ,CAAC,CAAC,CAAC,CACd,4BAAG,QAAQ,GAAI,CAClB,CAAC,CAAC,CAAC,CACA,eAAK,GAAG,EAAE,YAAY,aAClB,cAAK,GAAG,EAAE,kBAAkB,GAAI,EAC/B,QAAQ,EACR,cAAc,IAAI,CACf,KAAC,mBAAmB,IAChB,IAAI,EAAC,WAAW,EAChB,IAAI,EAAC,GAAG,EACR,IAAI,EAAE,KAAC,eAAe,IAAC,IAAI,EAAE,SAAS,GAAI,EAC1C,OAAO,EAAE,GAAG,EAAE;oBACV,YAAY,CAAC,OAAO,EAAE,cAAc,CAAC,EAAC,QAAQ,EAAE,QAAQ,EAAC,CAAC,CAAC;gBAC/D,CAAC,GACH,CACL,IACC,CACT,CAAC;AACN,CAAC,CAAC;AAEF,eAAe,uBAAuB,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 {faAngleUp} from '@fortawesome/free-solid-svg-icons';\nimport {FontAwesomeIcon} from '@fortawesome/react-fontawesome';\nimport {useIntersectionObserver} from '@uidotdev/usehooks';\nimport {KitButton} from 'aristid-ds';\nimport {type ReactNode, useRef} from 'react';\nimport styled from 'styled-components';\n\nconst StyledKitButtonGoUp = styled(KitButton)`\n position: absolute;\n right: calc(var(--general-spacing-m) * 1px);\n bottom: calc(var(--general-spacing-m) * 1px);\n z-index: 10;\n`;\n\ninterface IRecordHistoryGoUpButtonProps {\n children: ReactNode;\n disabled?: boolean;\n}\n\nexport const RecordHistoryGoUpButton: React.FC<IRecordHistoryGoUpButtonProps> = ({disabled, children}) => {\n // cannot use detectScrollTopRef because it is not a ref to div but to a customRef to a callback\n const scrollTopRef = useRef<HTMLDivElement>(null);\n\n // Detect if the top of the list is visible or not\n // to show or hide the \"go up\" button\n const [detectScrollTopRef, detectScrollTopEntry] = useIntersectionObserver<HTMLDivElement>({threshold: 0});\n const showGoUpButton = !detectScrollTopEntry?.isIntersecting;\n\n return disabled ? (\n <>{children}</>\n ) : (\n <div ref={scrollTopRef}>\n <div ref={detectScrollTopRef} />\n {children}\n {showGoUpButton && (\n <StyledKitButtonGoUp\n type=\"segmented\"\n size=\"m\"\n icon={<FontAwesomeIcon icon={faAngleUp} />}\n onClick={() => {\n scrollTopRef.current?.scrollIntoView({behavior: 'smooth'});\n }}\n />\n )}\n </div>\n );\n};\n\nexport default RecordHistoryGoUpButton;\n"]}
|
|
@@ -411,42 +411,21 @@
|
|
|
411
411
|
},
|
|
412
412
|
"record_edition": {
|
|
413
413
|
"no_form_error": "No form available",
|
|
414
|
-
"invalid_format": "Invalid format",
|
|
415
414
|
"missing_attribute": "Missing attribute",
|
|
416
415
|
"modified_at": "Modified at",
|
|
417
416
|
"created_at": "Created at",
|
|
418
|
-
"link_created_at": "Linked at",
|
|
419
417
|
"add_value": "Add value",
|
|
420
|
-
"add_value_link": "Add link",
|
|
421
418
|
"delete_value": "Delete value",
|
|
422
|
-
"delete_value_confirm": "Do you really want to delete this value?",
|
|
423
419
|
"whoAmI": "Information",
|
|
424
420
|
"no_value": "No value",
|
|
425
|
-
"value_details": "Value details",
|
|
426
|
-
"link_details": "Link details",
|
|
427
|
-
"by": "by",
|
|
428
|
-
"no_matching_value": "No matching value",
|
|
429
|
-
"copy_value": "Copy",
|
|
430
421
|
"select": "Select",
|
|
431
|
-
"new_value": "New value",
|
|
432
|
-
"advanced_search": "Advanced search",
|
|
433
|
-
"search_elements": "Search elements",
|
|
434
422
|
"values_list": "Values List",
|
|
435
423
|
"new_record": "Create",
|
|
436
|
-
"value_details_section": "Value",
|
|
437
|
-
"link_value_details_section": "Linked record",
|
|
438
|
-
"attribute_details_section": "More details...",
|
|
439
|
-
"path_section": "Path",
|
|
440
|
-
"start_typing_message": "Start typing to search elements",
|
|
441
|
-
"metadata_section": "Value properties",
|
|
442
|
-
"metadata_section_link": "Link properties",
|
|
443
|
-
"value_length": "{{length}} characters",
|
|
444
424
|
"delete_all": "Delete all",
|
|
445
425
|
"delete_all_values": "Delete all values",
|
|
446
426
|
"delete_all_values_confirm": "Do you really want to delete all values?",
|
|
447
427
|
"delete_link": "Delete link",
|
|
448
428
|
"delete_link_description": "Do you really want to delete the link?",
|
|
449
|
-
"value_details_tooltip": "More details",
|
|
450
429
|
"attribute": {
|
|
451
430
|
"id": "Identifier",
|
|
452
431
|
"info_title": "Attribute info",
|
|
@@ -467,8 +446,6 @@
|
|
|
467
446
|
"format_rich_text": "Rich Text"
|
|
468
447
|
},
|
|
469
448
|
"date_range_value": "From {{from}} to {{to}}",
|
|
470
|
-
"external_update_warning": "This record has been updated by {{modifiers}}",
|
|
471
|
-
"field_external_update": "This field has been updated",
|
|
472
449
|
"create": "Create",
|
|
473
450
|
"create_and_edit": "Create and edit",
|
|
474
451
|
"cancel_confirm_modal_title": "Confirm cancellation?",
|
|
@@ -477,9 +454,6 @@
|
|
|
477
454
|
"inherited_value": "Inherited value",
|
|
478
455
|
"calculated_value": "Calculated value",
|
|
479
456
|
"overrided_value": "Overrided value",
|
|
480
|
-
"date_range_from_to": "from {{- from}} to {{- to}}",
|
|
481
|
-
"link_search_result_count": "Results ({{count}}/{{total}})",
|
|
482
|
-
"suggestions_count": "Suggestions ({{count}})",
|
|
483
457
|
"search_not_found": "No match",
|
|
484
458
|
"press_enter_to": "Press enter to ",
|
|
485
459
|
"select_this_value": "Select this value",
|
|
@@ -411,42 +411,21 @@
|
|
|
411
411
|
},
|
|
412
412
|
"record_edition": {
|
|
413
413
|
"no_form_error": "Aucun formulaire disponible",
|
|
414
|
-
"invalid_format": "Format non valide",
|
|
415
414
|
"missing_attribute": "Attribut manquant",
|
|
416
415
|
"modified_at": "Modifié le",
|
|
417
416
|
"created_at": "Créée le",
|
|
418
|
-
"link_created_at": "Lié le",
|
|
419
417
|
"add_value": "Ajouter une valeur",
|
|
420
|
-
"add_value_link": "Ajouter une liaison",
|
|
421
418
|
"delete_value": "Supprimer cette valeur",
|
|
422
|
-
"delete_value_confirm": "Êtes-vous sûr de vouloir supprimer cette valeur ?",
|
|
423
419
|
"whoAmI": "Informations",
|
|
424
420
|
"no_value": "Pas de valeur",
|
|
425
|
-
"value_details": "Infos valeur",
|
|
426
|
-
"link_details": "Infos liaison",
|
|
427
|
-
"by": "par",
|
|
428
|
-
"no_matching_value": "Aucune valeur correspondante",
|
|
429
|
-
"copy_value": "Copier",
|
|
430
421
|
"select": "Sélectionner",
|
|
431
|
-
"new_value": "Nouvelle valeur",
|
|
432
|
-
"advanced_search": "Recherche avancée",
|
|
433
|
-
"search_elements": "Rechercher des éléments",
|
|
434
422
|
"values_list": "Liste de valeurs",
|
|
435
423
|
"new_record": "Créer",
|
|
436
|
-
"value_details_section": "Valeur",
|
|
437
|
-
"link_value_details_section": "Élément lié",
|
|
438
|
-
"attribute_details_section": "Plus d'infos...",
|
|
439
|
-
"path_section": "Chemin",
|
|
440
|
-
"start_typing_message": "Commencez à taper pour chercher des éléments",
|
|
441
|
-
"metadata_section": "Propriétés de la valeur",
|
|
442
|
-
"metadata_section_link": "Propriétés de la liaison",
|
|
443
|
-
"value_length": "{{length}} caractère(s)",
|
|
444
424
|
"delete_all": "Tout supprimer",
|
|
445
425
|
"delete_all_values": "Supprimer toutes les valeurs",
|
|
446
426
|
"delete_all_values_confirm": "Êtes-vous sûr de vouloir supprimer toutes les valeurs?",
|
|
447
427
|
"delete_link": "Supprimer la liaison",
|
|
448
428
|
"delete_link_description": "Êtes-vous sûr de vouloir supprimer la liaison?",
|
|
449
|
-
"value_details_tooltip": "Plus d'informations",
|
|
450
429
|
"attribute": {
|
|
451
430
|
"id": "Identifiant",
|
|
452
431
|
"info_title": "Infos attribut",
|
|
@@ -467,8 +446,6 @@
|
|
|
467
446
|
"format_rich_text": "Texte Enrichi"
|
|
468
447
|
},
|
|
469
448
|
"date_range_value": "Du {{from}} au {{to}}",
|
|
470
|
-
"external_update_warning": "Cet élément a été modifié par {{modifiers}}",
|
|
471
|
-
"field_external_update": "Ce champ a été modifié",
|
|
472
449
|
"create": "Créer",
|
|
473
450
|
"create_and_edit": "Créer et éditer",
|
|
474
451
|
"cancel_confirm_modal_title": "Confirmer l'abandon?",
|
|
@@ -477,9 +454,6 @@
|
|
|
477
454
|
"inherited_value": "Valeur héritée",
|
|
478
455
|
"calculated_value": "Valeur calculée",
|
|
479
456
|
"overrided_value": "Valeur surchargée",
|
|
480
|
-
"date_range_from_to": "du {{- from}} au {{- to}}",
|
|
481
|
-
"link_search_result_count": "Résultats ({{count}}/{{total}})",
|
|
482
|
-
"suggestions_count": "Suggestions ({{count}})",
|
|
483
457
|
"search_not_found": "Aucune correspondance",
|
|
484
458
|
"press_enter_to": "Appuyer sur Entrer pour ",
|
|
485
459
|
"select_this_value": "Sélectionner cette valeur",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leav/ui",
|
|
3
|
-
"version": "1.10.0-
|
|
3
|
+
"version": "1.10.0-873ef4d7",
|
|
4
4
|
"description": "Shared React components and hooks",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"prepublishOnly": "yarn build",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@babel/preset-env": "7.29.0",
|
|
29
29
|
"@babel/preset-react": "7.28.5",
|
|
30
30
|
"@graphql-codegen/add": "5.0.3",
|
|
31
|
-
"@graphql-codegen/cli": "6.1
|
|
31
|
+
"@graphql-codegen/cli": "6.2.1",
|
|
32
32
|
"@graphql-codegen/typescript": "5.0.9",
|
|
33
33
|
"@graphql-codegen/typescript-operations": "5.0.9",
|
|
34
34
|
"@graphql-codegen/typescript-react-apollo": "4.4.1",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"@types/lodash.isequal": "^4",
|
|
43
43
|
"@types/react": "18.2.14",
|
|
44
44
|
"@types/react-dom": "18.2.6",
|
|
45
|
-
"aristid-ds": "15.2.0-
|
|
45
|
+
"aristid-ds": "15.2.0-e049fb9",
|
|
46
46
|
"babel-jest": "29.7.0",
|
|
47
47
|
"graphql": "16.12.0",
|
|
48
48
|
"i18next": "22.5.1",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
},
|
|
61
61
|
"peerDependencies": {
|
|
62
62
|
"@apollo/client": ">=3.8.1",
|
|
63
|
-
"aristid-ds": "15.2.0-
|
|
63
|
+
"aristid-ds": "15.2.0-e049fb9",
|
|
64
64
|
"i18next": ">=22.5.1",
|
|
65
65
|
"react": "^18.2.0",
|
|
66
66
|
"react-dom": "^18.2.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getActiveFieldValues.js","sourceRoot":"","sources":["../../../../../../src/components/RecordEdition/EditRecordContent/helpers/getActiveFieldValues/getActiveFieldValues.ts"],"names":[],"mappings":"AAKA,eAAe,CAAmB,KAA4C,EAAE,EAAE,CAC9E,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,MAAM,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 ICommonFieldsReducerState} from '../../_types';\n\nexport default <ValuesType = any>(state: ICommonFieldsReducerState<ValuesType>) =>\n state.values[state.activeScope].values;\n"]}
|
package/dist/components/RecordEdition/EditRecordContent/helpers/getActiveFieldValues/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from './getActiveFieldValues';
|
package/dist/components/RecordEdition/EditRecordContent/helpers/getActiveFieldValues/index.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06
|
|
2
|
-
// This file is released under LGPL V3
|
|
3
|
-
// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
|
|
4
|
-
export { default } from './getActiveFieldValues';
|
|
5
|
-
//# sourceMappingURL=index.js.map
|
package/dist/components/RecordEdition/EditRecordContent/helpers/getActiveFieldValues/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/components/RecordEdition/EditRecordContent/helpers/getActiveFieldValues/index.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,OAAO,EAAC,MAAM,wBAAwB,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\nexport {default} from './getActiveFieldValues';\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from './isCurrentVersion';
|