@leav/ui 0.4.0-cdb834a → 0.4.0-d00faf6
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/__mocks__/common/form.js +5 -1
- package/dist/__mocks__/common/form.js.map +1 -1
- package/dist/_gqlTypes/index.d.ts +968 -9
- package/dist/_gqlTypes/index.js +145 -1
- package/dist/_gqlTypes/index.js.map +1 -1
- package/dist/_queries/attributes/attributeDetailsFragment.js +1 -0
- package/dist/_queries/attributes/attributeDetailsFragment.js.map +1 -1
- package/dist/_queries/records/activateRecordsMutation.d.ts +1 -0
- package/dist/_queries/records/activateRecordsMutation.js +15 -0
- package/dist/_queries/records/activateRecordsMutation.js.map +1 -0
- package/dist/_queries/records/getRecordFormQuery.js +13 -0
- package/dist/_queries/records/getRecordFormQuery.js.map +1 -1
- package/dist/components/CreateDirectory/CreateDirectory.js +3 -3
- package/dist/components/CreateDirectory/CreateDirectory.js.map +1 -1
- package/dist/components/EditLibraryModal/EditLibrary/EditLibraryAttributes/AttributesList/DeleteButton/DeleteButton.js +3 -2
- package/dist/components/EditLibraryModal/EditLibrary/EditLibraryAttributes/AttributesList/DeleteButton/DeleteButton.js.map +1 -1
- package/dist/components/EditTreeModal/EditTree/EditTreeInfo/EditTreeInfoForm/TreeLibrariesForm/TreeLibrariesForm.js +8 -1
- package/dist/components/EditTreeModal/EditTree/EditTreeInfo/EditTreeInfoForm/TreeLibrariesForm/TreeLibrariesForm.js.map +1 -1
- package/dist/components/Explorer/DataView.d.ts +2 -1
- package/dist/components/Explorer/DataView.js +13 -10
- package/dist/components/Explorer/DataView.js.map +1 -1
- package/dist/components/Explorer/Explorer.d.ts +5 -4
- package/dist/components/Explorer/Explorer.js +7 -5
- package/dist/components/Explorer/Explorer.js.map +1 -1
- package/dist/components/Explorer/TableCell.js +22 -11
- package/dist/components/Explorer/TableCell.js.map +1 -1
- package/dist/components/Explorer/_queries/useExplorerData.js +5 -1
- package/dist/components/Explorer/_queries/useExplorerData.js.map +1 -1
- package/dist/components/Explorer/_types.d.ts +4 -2
- package/dist/components/Explorer/_types.js.map +1 -1
- package/dist/components/Explorer/actions-item/{useRemoveItemAction.d.ts → useEditStatusItemAction.d.ts} +2 -2
- package/dist/components/Explorer/actions-item/{useRemoveItemAction.js → useEditStatusItemAction.js} +71 -24
- package/dist/components/Explorer/actions-item/useEditStatusItemAction.js.map +1 -0
- package/dist/components/Explorer/actions-primary/useCreatePrimaryAction.d.ts +3 -1
- package/dist/components/Explorer/actions-primary/useCreatePrimaryAction.js +14 -6
- package/dist/components/Explorer/actions-primary/useCreatePrimaryAction.js.map +1 -1
- package/dist/components/Explorer/useViewSettingsReducer.js +6 -2
- package/dist/components/Explorer/useViewSettingsReducer.js.map +1 -1
- package/dist/components/ImportModal/ImportModalConfigStep/ImportModalConfigStep.js +1 -1
- package/dist/components/ImportModal/ImportModalConfigStep/ImportModalConfigStep.js.map +1 -1
- package/dist/components/LibraryItemsList/CreateNewRecordButton/CreateNewRecordButton.js +1 -0
- package/dist/components/LibraryItemsList/CreateNewRecordButton/CreateNewRecordButton.js.map +1 -1
- package/dist/components/LibraryItemsList/FiltersPanel/Filter/Filter.js +2 -2
- package/dist/components/LibraryItemsList/FiltersPanel/Filter/Filter.js.map +1 -1
- package/dist/components/LibraryItemsList/FiltersPanel/Filter/Filter.utils.js +2 -2
- package/dist/components/LibraryItemsList/FiltersPanel/Filter/Filter.utils.js.map +1 -1
- package/dist/components/LibraryItemsList/shared/DeactivateRecordBtn/DeactivateRecordBtn.js +3 -3
- package/dist/components/LibraryItemsList/shared/DeactivateRecordBtn/DeactivateRecordBtn.js.map +1 -1
- package/dist/components/LinkSelect/LinkSelect.d.ts +15 -0
- package/dist/components/LinkSelect/LinkSelect.js +88 -0
- package/dist/components/LinkSelect/LinkSelect.js.map +1 -0
- package/dist/components/LinkSelect/index.d.ts +2 -0
- package/dist/components/LinkSelect/index.js +6 -0
- package/dist/components/LinkSelect/index.js.map +1 -0
- package/dist/components/RecordEdition/EditRecord/EditRecord.d.ts +1 -4
- package/dist/components/RecordEdition/EditRecord/EditRecord.js +15 -28
- package/dist/components/RecordEdition/EditRecord/EditRecord.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordButtons/EditRecordButtons.d.ts +2 -0
- package/dist/components/RecordEdition/EditRecordButtons/EditRecordButtons.js +43 -0
- package/dist/components/RecordEdition/EditRecordButtons/EditRecordButtons.js.map +1 -0
- package/dist/components/RecordEdition/EditRecordButtons/SidebarButton.d.ts +2 -0
- package/dist/components/RecordEdition/EditRecordButtons/SidebarButton.js +25 -0
- package/dist/components/RecordEdition/EditRecordButtons/SidebarButton.js.map +1 -0
- package/dist/components/RecordEdition/EditRecordButtons/index.d.ts +2 -0
- package/dist/components/RecordEdition/EditRecordButtons/index.js +6 -0
- package/dist/components/RecordEdition/EditRecordButtons/index.js.map +1 -0
- package/dist/components/RecordEdition/EditRecordContent/EditRecordContent.js +9 -0
- package/dist/components/RecordEdition/EditRecordContent/EditRecordContent.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/LinkField.d.ts +2 -2
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/LinkField.js +7 -4
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/LinkField.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/link-record-in-creation/useLinkRecordsInCreation.js +2 -2
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/link-record-in-creation/useLinkRecordsInCreation.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/link-record-in-edition/useLinkRecordsInEdition.d.ts +4 -2
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/link-record-in-edition/useLinkRecordsInEdition.js +258 -52
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/link-record-in-edition/useLinkRecordsInEdition.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardField.js +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardField.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/ValuesList/DSListSelect.js +3 -3
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/ValuesList/DSListSelect.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/TreeField.js +4 -3
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/TreeField.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/display-tree-node/TreeNodeItem.d.ts +2 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/display-tree-node/TreeNodeItem.js +2 -2
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/display-tree-node/TreeNodeItem.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/display-tree-node/useDisplayTreeNode.d.ts +2 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/display-tree-node/useDisplayTreeNode.js +2 -2
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/display-tree-node/useDisplayTreeNode.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/index.d.ts +1 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/index.js +2 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/index.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/manage-tree-node-selection/SelectTreeNodeModal.d.ts +21 -2
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/manage-tree-node-selection/SelectTreeNodeModal.js +8 -5
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/manage-tree-node-selection/SelectTreeNodeModal.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordModal/EditRecordModal.d.ts +3 -0
- package/dist/components/RecordEdition/EditRecordModal/EditRecordModal.js +5 -10
- package/dist/components/RecordEdition/EditRecordModal/EditRecordModal.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordPage/EditRecordPage.d.ts +1 -0
- package/dist/components/RecordEdition/EditRecordPage/EditRecordPage.js +5 -6
- package/dist/components/RecordEdition/EditRecordPage/EditRecordPage.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordSidebar/Breacrumb/Breadcrumb.js +2 -2
- package/dist/components/RecordEdition/EditRecordSidebar/Breacrumb/Breadcrumb.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordSidebar/EditRecordSidebar.d.ts +0 -1
- package/dist/components/RecordEdition/EditRecordSidebar/EditRecordSidebar.js +13 -12
- package/dist/components/RecordEdition/EditRecordSidebar/EditRecordSidebar.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordSidebar/ValuesVersions/ValuesVersions.js +2 -2
- package/dist/components/RecordEdition/EditRecordSidebar/ValuesVersions/ValuesVersions.js.map +1 -1
- package/dist/components/RecordEdition/constants.d.ts +2 -0
- package/dist/components/RecordEdition/constants.js +6 -0
- package/dist/components/RecordEdition/constants.js.map +1 -0
- package/dist/components/RecordEdition/editRecordReducer/editRecordReducer.d.ts +27 -1
- package/dist/components/RecordEdition/editRecordReducer/editRecordReducer.js +43 -2
- package/dist/components/RecordEdition/editRecordReducer/editRecordReducer.js.map +1 -1
- package/dist/components/RecordEdition/index.d.ts +2 -0
- package/dist/components/RecordEdition/index.js +2 -0
- package/dist/components/RecordEdition/index.js.map +1 -1
- package/dist/components/SelectRecordForLinkModal/SelectRecordForLinkModal.d.ts +2 -1
- package/dist/components/SelectRecordForLinkModal/SelectRecordForLinkModal.js +2 -2
- package/dist/components/SelectRecordForLinkModal/SelectRecordForLinkModal.js.map +1 -1
- package/dist/components/SimpleErrorBoundary/SimpleErrorBoundary.d.ts +1 -1
- package/dist/components/SimpleErrorBoundary/SimpleErrorBoundary.js.map +1 -1
- package/dist/components/UploadFiles/UploadFiles.js +3 -3
- package/dist/components/UploadFiles/UploadFiles.js.map +1 -1
- package/dist/components/index.d.ts +0 -1
- package/dist/components/index.js +0 -1
- package/dist/components/index.js.map +1 -1
- package/dist/contexts/LangContext/LangContext.d.ts +1 -2
- package/dist/contexts/LangContext/LangContext.js +2 -2
- package/dist/contexts/LangContext/LangContext.js.map +1 -1
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/useGetRecordForm/useGetRecordForm.js +1 -1
- package/dist/hooks/useGetRecordForm/useGetRecordForm.js.map +1 -1
- package/dist/hooks/useIFrameMessenger/messageHandlers.d.ts +14 -0
- package/dist/hooks/useIFrameMessenger/messageHandlers.js +118 -0
- package/dist/hooks/useIFrameMessenger/messageHandlers.js.map +1 -0
- package/dist/hooks/useIFrameMessenger/types.d.ts +147 -0
- package/dist/hooks/useIFrameMessenger/types.js +2 -0
- package/dist/hooks/useIFrameMessenger/types.js.map +1 -0
- package/dist/hooks/useIFrameMessenger/useIFrameMessenger.d.ts +11 -0
- package/dist/hooks/useIFrameMessenger/useIFrameMessenger.js +73 -0
- package/dist/hooks/useIFrameMessenger/useIFrameMessenger.js.map +1 -0
- package/dist/hooks/useRedirectToLogin/useRedirectToLogin.js +1 -1
- package/dist/hooks/useRedirectToLogin/useRedirectToLogin.js.map +1 -1
- package/dist/locales/en/shared.json +9 -1
- package/dist/locales/fr/shared.json +9 -1
- package/dist/types/attributes.d.ts +2 -1
- package/package.json +2 -3
- package/dist/components/Explorer/actions-item/useRemoveItemAction.js.map +0 -1
|
@@ -4,8 +4,9 @@ interface IUseDisplayTreeNodeProps {
|
|
|
4
4
|
attribute: RecordFormAttributeTreeAttributeFragment;
|
|
5
5
|
backendValues: RecordFormElementsValueTreeValue[];
|
|
6
6
|
removeTreeNode: (nodeValue: RecordFormElementsValueTreeValue) => void;
|
|
7
|
+
isReadOnly: boolean;
|
|
7
8
|
}
|
|
8
|
-
export declare const useDisplayTreeNode: ({ attribute, backendValues, removeTreeNode }: IUseDisplayTreeNodeProps) => {
|
|
9
|
+
export declare const useDisplayTreeNode: ({ attribute, backendValues, removeTreeNode, isReadOnly }: IUseDisplayTreeNodeProps) => {
|
|
9
10
|
TreeNodeList: JSX.Element;
|
|
10
11
|
};
|
|
11
12
|
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import TreeNodeItem from './TreeNodeItem';
|
|
3
3
|
import { TreeFieldWrapper } from './TreeFieldWrapper';
|
|
4
|
-
export const useDisplayTreeNode = ({ attribute, backendValues, removeTreeNode }) => ({
|
|
5
|
-
TreeNodeList: (_jsx(TreeFieldWrapper, { children: backendValues.map((value, index) => (_jsx(TreeNodeItem, { color: value.treeValue.record.whoAmI.color, label: value.treeValue.record.whoAmI.label, ancestors: value.treeValue.ancestors, canDelete: (attribute.required && attribute.multiple_values && backendValues.length > 1) ||
|
|
4
|
+
export const useDisplayTreeNode = ({ attribute, backendValues, removeTreeNode, isReadOnly }) => ({
|
|
5
|
+
TreeNodeList: (_jsx(TreeFieldWrapper, { children: backendValues.map((value, index) => (_jsx(TreeNodeItem, { isReadOnly: isReadOnly, color: value.treeValue.record.whoAmI.color, label: value.treeValue.record.whoAmI.label, ancestors: value.treeValue.ancestors, canDelete: (attribute.required && attribute.multiple_values && backendValues.length > 1) ||
|
|
6
6
|
(!attribute.required && attribute.multiple_values), onClickToDelete: () => removeTreeNode(value) }, index))) }))
|
|
7
7
|
});
|
|
8
8
|
//# sourceMappingURL=useDisplayTreeNode.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDisplayTreeNode.js","sourceRoot":"","sources":["../../../../../../../src/components/RecordEdition/EditRecordContent/uiElements/TreeField/display-tree-node/useDisplayTreeNode.tsx"],"names":[],"mappings":";AAIA,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAE1C,OAAO,EAAC,gBAAgB,EAAC,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"useDisplayTreeNode.js","sourceRoot":"","sources":["../../../../../../../src/components/RecordEdition/EditRecordContent/uiElements/TreeField/display-tree-node/useDisplayTreeNode.tsx"],"names":[],"mappings":";AAIA,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAE1C,OAAO,EAAC,gBAAgB,EAAC,MAAM,oBAAoB,CAAC;AASpD,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,EAC/B,SAAS,EACT,aAAa,EACb,cAAc,EACd,UAAU,EACa,EAAE,EAAE,CAAC,CAAC;IAC7B,YAAY,EAAE,CACV,KAAC,gBAAgB,cACZ,aAAa,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,CACjC,KAAC,YAAY,IAET,UAAU,EAAE,UAAU,EACtB,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,EAC1C,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,EAC1C,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,SAAS,EACpC,SAAS,EACL,CAAC,SAAS,CAAC,QAAQ,IAAI,SAAS,CAAC,eAAe,IAAI,aAAa,CAAC,MAAM,GAAG,CAAC,CAAC;gBAC7E,CAAC,CAAC,SAAS,CAAC,QAAQ,IAAI,SAAS,CAAC,eAAe,CAAC,EAEtD,eAAe,EAAE,GAAG,EAAE,CAAC,cAAc,CAAC,KAAK,CAAC,IATvC,KAAK,CAUZ,CACL,CAAC,GACa,CACtB;CACJ,CAAC,CAAC"}
|
|
@@ -3,4 +3,6 @@
|
|
|
3
3
|
// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
|
|
4
4
|
import TreeField from './TreeField';
|
|
5
5
|
export default TreeField;
|
|
6
|
+
// Export SelectTreeNodeModal for cadrage, but rename if to avoid conflict with libs/ui/src/components/SelectTreeNodeModal
|
|
7
|
+
export { SelectTreeNodeModal as SelectTreeNodeModalNext } from './manage-tree-node-selection/SelectTreeNodeModal';
|
|
6
8
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/components/RecordEdition/EditRecordContent/uiElements/TreeField/index.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,eAAe,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/components/RecordEdition/EditRecordContent/uiElements/TreeField/index.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,eAAe,SAAS,CAAC;AAEzB,0HAA0H;AAC1H,OAAO,EAAC,mBAAmB,IAAI,uBAAuB,EAAC,MAAM,kDAAkD,CAAC"}
|
|
@@ -2,11 +2,30 @@ import { RecordFormAttributeTreeAttributeFragment } from '../../../../../../_gql
|
|
|
2
2
|
import { RecordFormElementsValueTreeValue } from '../../../../../../hooks/useGetRecordForm';
|
|
3
3
|
import { ITreeNodeWithRecord } from '../../../../../../types';
|
|
4
4
|
import { FunctionComponent } from 'react';
|
|
5
|
+
type SelectTreeNodeModalBackendValue = RecordFormElementsValueTreeValue | {
|
|
6
|
+
treeValue: {
|
|
7
|
+
id: string;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
type SelectTreeNodeModalAttribute = RecordFormAttributeTreeAttributeFragment | {
|
|
11
|
+
multiple_values: boolean;
|
|
12
|
+
linked_tree: {
|
|
13
|
+
id: string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
5
16
|
interface ISelectTreeNodeModalProps {
|
|
6
17
|
title: string;
|
|
7
18
|
open: boolean;
|
|
8
|
-
attribute:
|
|
9
|
-
backendValues:
|
|
19
|
+
attribute: SelectTreeNodeModalAttribute;
|
|
20
|
+
backendValues: SelectTreeNodeModalBackendValue[];
|
|
21
|
+
/**
|
|
22
|
+
* If tree, initial node (backendValues) will be unselectable
|
|
23
|
+
* By default, they are not
|
|
24
|
+
*
|
|
25
|
+
* Would be much better to invert this property to disallowInitialNodeDeselection for instance
|
|
26
|
+
* But need to review upper usage
|
|
27
|
+
*/
|
|
28
|
+
allowInitialNodeDeselection?: boolean;
|
|
10
29
|
onConfirm: (selectedNodes: ITreeNodeWithRecord[]) => void;
|
|
11
30
|
onClose: () => void;
|
|
12
31
|
className?: string;
|
|
@@ -11,10 +11,15 @@ import { useState } from 'react';
|
|
|
11
11
|
import { FaCheck } from 'react-icons/fa';
|
|
12
12
|
const SELECT_TREE_NODE_MODAL_HEIGHT = '563px';
|
|
13
13
|
const SELECT_TREE_NODE_MODAL_WIDTH = '656px';
|
|
14
|
-
export const SelectTreeNodeModal = ({ title, open, attribute, backendValues, onConfirm, onClose, className }) => {
|
|
14
|
+
export const SelectTreeNodeModal = ({ title, open, attribute, backendValues, allowInitialNodeDeselection = false, onConfirm, onClose, className }) => {
|
|
15
15
|
const { t } = useSharedTranslation();
|
|
16
16
|
const [selectedNodes, setSelectedNode] = useState([]);
|
|
17
|
+
// Use intermediate state to store backend node ids for initial props inject,
|
|
18
|
+
// reset after first _handleOnSelect/_handleOnCheck to avoid adding backend values to selected nodes again and again
|
|
19
|
+
// Another solution would be to inject backendValues with compatible ITreeNodeWithRecord type to set selectedNodes initial state
|
|
20
|
+
const [tmpBackendNodeIds, setTmpBackendNodeIds] = useState(backendValues.map(value => value.treeValue.id));
|
|
17
21
|
const _handleOnSelect = (node, selected) => {
|
|
22
|
+
setTmpBackendNodeIds(undefined);
|
|
18
23
|
if (!attribute.multiple_values) {
|
|
19
24
|
setSelectedNode(selected ? [node] : []);
|
|
20
25
|
return;
|
|
@@ -27,6 +32,7 @@ export const SelectTreeNodeModal = ({ title, open, attribute, backendValues, onC
|
|
|
27
32
|
}
|
|
28
33
|
};
|
|
29
34
|
const _handleOnCheck = (selection) => {
|
|
35
|
+
setTmpBackendNodeIds(undefined);
|
|
30
36
|
setSelectedNode(selection.map(node => node).filter(node => !node?.disabled));
|
|
31
37
|
};
|
|
32
38
|
const _handleOnConfirm = () => {
|
|
@@ -35,10 +41,7 @@ export const SelectTreeNodeModal = ({ title, open, attribute, backendValues, onC
|
|
|
35
41
|
};
|
|
36
42
|
return (_jsx(KitModal, { className: className, width: SELECT_TREE_NODE_MODAL_WIDTH, height: SELECT_TREE_NODE_MODAL_HEIGHT, title: title, isOpen: open, close: onClose, footer: _jsxs(_Fragment, { children: [_jsx(KitButton, { icon:
|
|
37
43
|
// We can't used react-icons here because it's doesn't have the faXmark icon
|
|
38
|
-
_jsx(FontAwesomeIcon, { icon: faXmark }), onClick: onClose, children: t('global.close') }), _jsx(KitButton, { type: "primary", icon: _jsx(FaCheck, {}), onClick: _handleOnConfirm, children: t('global.confirm') })] }), showCloseIcon: true, children: _jsx(SelectTreeNode, { treeId: attribute.linked_tree.id, selectedNodes: [
|
|
39
|
-
...backendValues.map(value => value.treeValue.id),
|
|
40
|
-
...selectedNodes.map(node => node.id)
|
|
41
|
-
], disabledNodes: backendValues.map(value => value.treeValue.id), onSelect: _handleOnSelect, onCheck: _handleOnCheck, checkable: attribute.multiple_values, multiple // We want to be able to set as selected in the tree components, the nodes that are already selected and the disabled nodes
|
|
44
|
+
_jsx(FontAwesomeIcon, { icon: faXmark }), onClick: onClose, children: t('global.close') }), _jsx(KitButton, { type: "primary", icon: _jsx(FaCheck, {}), onClick: _handleOnConfirm, children: t('global.confirm') })] }), showCloseIcon: true, children: _jsx(SelectTreeNode, { treeId: attribute.linked_tree.id, selectedNodes: tmpBackendNodeIds || selectedNodes.map(node => node.id), disabledNodes: !allowInitialNodeDeselection && backendValues.map(value => value.treeValue.id) || [], onSelect: _handleOnSelect, onCheck: _handleOnCheck, checkable: attribute.multiple_values, multiple // We want to be able to set as selected in the tree components, the nodes that are already selected and the disabled nodes
|
|
42
45
|
: true, canSelectRoot: true }) }));
|
|
43
46
|
};
|
|
44
47
|
//# sourceMappingURL=SelectTreeNodeModal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectTreeNodeModal.js","sourceRoot":"","sources":["../../../../../../../src/components/RecordEdition/EditRecordContent/uiElements/TreeField/manage-tree-node-selection/SelectTreeNodeModal.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,OAAO,EAAC,MAAM,mCAAmC,CAAC;AAC1D,OAAO,EAAC,eAAe,EAAC,MAAM,gCAAgC,CAAC;AAE/D,OAAO,EAAC,cAAc,EAAC,MAAM,+BAA+B,CAAC;AAE7D,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AAEpE,OAAO,EAAC,SAAS,EAAE,QAAQ,EAAC,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"SelectTreeNodeModal.js","sourceRoot":"","sources":["../../../../../../../src/components/RecordEdition/EditRecordContent/uiElements/TreeField/manage-tree-node-selection/SelectTreeNodeModal.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,OAAO,EAAC,MAAM,mCAAmC,CAAC;AAC1D,OAAO,EAAC,eAAe,EAAC,MAAM,gCAAgC,CAAC;AAE/D,OAAO,EAAC,cAAc,EAAC,MAAM,+BAA+B,CAAC;AAE7D,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AAEpE,OAAO,EAAC,SAAS,EAAE,QAAQ,EAAC,MAAM,YAAY,CAAC;AAE/C,OAAO,EAAoB,QAAQ,EAAC,MAAM,OAAO,CAAC;AAClD,OAAO,EAAC,OAAO,EAAC,MAAM,gBAAgB,CAAC;AAEvC,MAAM,6BAA6B,GAAG,OAAO,CAAC;AAE9C,MAAM,4BAA4B,GAAG,OAAO,CAAC;AAqC7C,MAAM,CAAC,MAAM,mBA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?: possibleSubmitButtons;
|
|
16
16
|
withInfoButton?: boolean;
|
|
17
17
|
valuesVersion?: IValueVersion;
|
|
18
|
+
showSidebar?: boolean;
|
|
19
|
+
enableSidebar?: boolean;
|
|
20
|
+
autoHeight?: boolean;
|
|
18
21
|
}
|
|
19
22
|
export declare const EditRecordModal: FunctionComponent<IEditRecordModalProps>;
|
|
@@ -8,11 +8,12 @@ import styled from 'styled-components';
|
|
|
8
8
|
import { useSharedTranslation } from '../../../hooks/useSharedTranslation';
|
|
9
9
|
import { EditRecord } from '../EditRecord';
|
|
10
10
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
11
|
-
import { faXmark
|
|
11
|
+
import { faXmark } from '@fortawesome/free-solid-svg-icons';
|
|
12
12
|
import { useGetSubmitButtons } from '../hooks/useGetSubmitButtons';
|
|
13
13
|
import { useForm } from 'antd/lib/form/Form';
|
|
14
14
|
import { useCreateCancelConfirm } from '../hooks/useCreateCancelConfirm';
|
|
15
15
|
import { v4 as uuidv4 } from 'uuid';
|
|
16
|
+
import { EDIT_RECORD_MODAL_HEADER_CONTAINER_BUTTONS } from '../constants';
|
|
16
17
|
const MODAL_HEIGHT = '80vh';
|
|
17
18
|
const MODAL_WIDTH = '90vw';
|
|
18
19
|
const MODAL_MAX_WIDTH = '1200px';
|
|
@@ -48,14 +49,11 @@ const KitModalStyled = styled(KitModal) `
|
|
|
48
49
|
}
|
|
49
50
|
}
|
|
50
51
|
`;
|
|
51
|
-
export const EditRecordModal = ({ className, open, record, creationFormId, editionFormId, library, onClose, onCreate, onCreateAndEdit, valuesVersion, submitButtons = ['create'], withInfoButton = true }) => {
|
|
52
|
+
export const EditRecordModal = ({ className, open, record, creationFormId, editionFormId, library, onClose, onCreate, onCreateAndEdit, valuesVersion, showSidebar, enableSidebar, submitButtons = ['create'], withInfoButton = true, autoHeight = false }) => {
|
|
52
53
|
const { t } = useSharedTranslation();
|
|
53
54
|
const [antdForm] = useForm();
|
|
54
55
|
const [currentRecord, setCurrentRecord] = useState(record);
|
|
55
56
|
const [clickedSubmitButton, setClickedSubmitButton] = useState(null);
|
|
56
|
-
// Create refs for the buttons to pass them to the EditRecord component
|
|
57
|
-
const refreshButtonRef = useRef(null);
|
|
58
|
-
const valuesVersionsButtonRef = useRef(null);
|
|
59
57
|
const formElementId = useRef(uuidv4());
|
|
60
58
|
const isCreation = !currentRecord;
|
|
61
59
|
const closeButtonLabel = isCreation ? t('global.cancel') : t('global.close');
|
|
@@ -82,12 +80,9 @@ export const EditRecordModal = ({ className, open, record, creationFormId, editi
|
|
|
82
80
|
}
|
|
83
81
|
return onClose();
|
|
84
82
|
};
|
|
85
|
-
return (_jsx(KitModalStyled, { className: className, height: MODAL_HEIGHT, width: MODAL_WIDTH, isOpen: open, close: _handleClose, title: _jsxs(KitSpace, { children: [_jsx(KitTypography.Title, { level: "h2", style: { margin: 0 }, children: currentRecord?.label ?? t('record_edition.new_record') }),
|
|
83
|
+
return (_jsx(KitModalStyled, { 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: currentRecord?.label ?? t('record_edition.new_record') }), _jsx("div", { id: EDIT_RECORD_MODAL_HEADER_CONTAINER_BUTTONS })] }), footer: _jsx(KitSpace, { children: [
|
|
86
84
|
_jsx(KitButton, { "aria-label": closeButtonLabel, icon: _jsx(FontAwesomeIcon, { icon: faXmark }), onClick: _handleClose, children: closeButtonLabel }, "close"),
|
|
87
85
|
...displayedSubmitButtons
|
|
88
|
-
] }), closeIcon: _jsx(FontAwesomeIcon, { icon: faXmark }), showCloseIcon: true, destroyOnClose: true, children: _jsx(EditRecord, { antdForm: antdForm, formId: formId, formElementId: formElementId.current, record: currentRecord, library: library, onCreate: _handleCreate, valuesVersion: valuesVersion,
|
|
89
|
-
refresh: refreshButtonRef,
|
|
90
|
-
valuesVersions: valuesVersionsButtonRef
|
|
91
|
-
}, showSidebar: true, withInfoButton: withInfoButton }) }));
|
|
86
|
+
] }), closeIcon: _jsx(FontAwesomeIcon, { icon: faXmark }), showCloseIcon: true, destroyOnClose: true, children: _jsx(EditRecord, { antdForm: antdForm, formId: formId, formElementId: formElementId.current, record: currentRecord, library: library, onCreate: _handleCreate, valuesVersion: valuesVersion, showSidebar: showSidebar, enableSidebar: enableSidebar, withInfoButton: withInfoButton }) }));
|
|
92
87
|
};
|
|
93
88
|
//# sourceMappingURL=EditRecordModal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditRecordModal.js","sourceRoot":"","sources":["../../../../src/components/RecordEdition/EditRecordModal/EditRecordModal.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAoB,MAAM,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AAC1D,OAAO,EAAC,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,aAAa,EAAC,MAAM,YAAY,CAAC;AACxE,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AAGpE,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AACzC,OAAO,EAAC,eAAe,EAAC,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAC,OAAO,
|
|
1
|
+
{"version":3,"file":"EditRecordModal.js","sourceRoot":"","sources":["../../../../src/components/RecordEdition/EditRecordModal/EditRecordModal.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAoB,MAAM,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AAC1D,OAAO,EAAC,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,aAAa,EAAC,MAAM,YAAY,CAAC;AACxE,OAAO,MAAM,MAAM,mBAAmB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AAE,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,YAAY,EAC1C,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS,EAChD,KAAK,EAAE,WAAW,EAClB,MAAM,EAAE,IAAI,EACZ,KAAK,EAAE,YAAY,EACnB,KAAK,EACD,MAAC,QAAQ,eACL,KAAC,aAAa,CAAC,KAAK,IAAC,KAAK,EAAC,IAAI,EAAC,KAAK,EAAE,EAAC,MAAM,EAAE,CAAC,EAAC,YAC7C,aAAa,EAAE,KAAK,IAAI,CAAC,CAAC,2BAA2B,CAAC,GACrC,EACtB,cAAK,EAAE,EAAE,0CAA0C,GAAI,IAChD,EAEf,MAAM,EACF,KAAC,QAAQ,cACJ;gBACG,KAAC,SAAS,kBACM,gBAAgB,EAE5B,IAAI,EAAE,KAAC,eAAe,IAAC,IAAI,EAAE,OAAO,GAAI,EACxC,OAAO,EAAE,YAAY,YAEpB,gBAAgB,IAJb,OAAO,CAKH;gBACZ,GAAG,sBAAsB;aAC5B,GACM,EAEf,SAAS,EAAE,KAAC,eAAe,IAAC,IAAI,EAAE,OAAO,GAAI,EAC7C,aAAa,QACb,cAAc,kBAEd,KAAC,UAAU,IACP,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,EACd,aAAa,EAAE,aAAa,CAAC,OAAO,EACpC,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,aAAa,EACvB,aAAa,EAAE,aAAa,EAC5B,WAAW,EAAE,WAAW,EACxB,aAAa,EAAE,aAAa,EAC5B,cAAc,EAAE,cAAc,GAChC,GACW,CACpB,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -7,12 +7,13 @@ import { KitButton, KitDivider, KitSpace, KitTypography } from 'aristid-ds';
|
|
|
7
7
|
import styled from 'styled-components';
|
|
8
8
|
import { useSharedTranslation } from '../../../hooks/useSharedTranslation';
|
|
9
9
|
import { EditRecord } from '../EditRecord';
|
|
10
|
-
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
11
|
-
import { faXmark, faRotateRight } from '@fortawesome/free-solid-svg-icons';
|
|
12
10
|
import { useGetSubmitButtons } from '../hooks/useGetSubmitButtons';
|
|
13
11
|
import { useForm } from 'antd/lib/form/Form';
|
|
14
12
|
import { useCreateCancelConfirm } from '../hooks/useCreateCancelConfirm';
|
|
15
13
|
import { v4 as uuidv4 } from 'uuid';
|
|
14
|
+
import { EDIT_RECORD_MODAL_HEADER_CONTAINER_BUTTONS } from '../constants';
|
|
15
|
+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
16
|
+
import { faXmark } from '@fortawesome/free-solid-svg-icons';
|
|
16
17
|
const Header = styled.div `
|
|
17
18
|
grid-area: title;
|
|
18
19
|
align-self: center;
|
|
@@ -24,7 +25,7 @@ const Header = styled.div `
|
|
|
24
25
|
align-items: center;
|
|
25
26
|
`;
|
|
26
27
|
const emptyFunction = () => null;
|
|
27
|
-
export const EditRecordPage = ({ record, library, creationFormId, editionFormId, onCreate, onCreateAndEdit, valuesVersion, title, showRefreshButton = true, showHeader = true, submitButtons = ['create'], withInfoButton, onClose = emptyFunction, showSidebar, sidebarContainer }) => {
|
|
28
|
+
export const EditRecordPage = ({ record, library, creationFormId, editionFormId, onCreate, onCreateAndEdit, valuesVersion, title, showRefreshButton = true, showHeader = true, submitButtons = ['create'], withInfoButton, onClose = emptyFunction, enableSidebar, showSidebar, sidebarContainer }) => {
|
|
28
29
|
const { t } = useSharedTranslation();
|
|
29
30
|
const [currentRecord, setCurrentRecord] = useState(record);
|
|
30
31
|
const [clickedSubmitButton, setClickedSubmitButton] = useState(null);
|
|
@@ -42,8 +43,6 @@ export const EditRecordPage = ({ record, library, creationFormId, editionFormId,
|
|
|
42
43
|
}
|
|
43
44
|
return onClose();
|
|
44
45
|
};
|
|
45
|
-
// Create refs for the buttons to pass them to the EditRecord component
|
|
46
|
-
const refreshButtonRef = useRef(null);
|
|
47
46
|
const closeButtonLabel = isCreation ? t('global.cancel') : t('global.close');
|
|
48
47
|
const _handleCreate = (newRecord) => {
|
|
49
48
|
setCurrentRecord(newRecord);
|
|
@@ -57,6 +56,6 @@ export const EditRecordPage = ({ record, library, creationFormId, editionFormId,
|
|
|
57
56
|
}
|
|
58
57
|
};
|
|
59
58
|
const formId = isCreation ? creationFormId : editionFormId;
|
|
60
|
-
return (_jsxs(_Fragment, { children: [showHeader && (_jsxs(_Fragment, { children: [_jsxs(Header, { children: [title !== undefined ? (title) : (_jsx(KitTypography.Title, { level: "h2", style: { margin: 0 }, children: currentRecord?.label ?? t('record_edition.new_record') })),
|
|
59
|
+
return (_jsxs(_Fragment, { children: [showHeader && (_jsxs(_Fragment, { children: [_jsxs(Header, { children: [title !== undefined ? (title) : (_jsx(KitTypography.Title, { level: "h2", style: { margin: 0 }, children: currentRecord?.label ?? t('record_edition.new_record') })), _jsx("div", { id: EDIT_RECORD_MODAL_HEADER_CONTAINER_BUTTONS, "data-testid": EDIT_RECORD_MODAL_HEADER_CONTAINER_BUTTONS }), _jsx(KitButton, { onClick: _handleClose, icon: _jsx(FontAwesomeIcon, { icon: faXmark }), children: closeButtonLabel }), _jsx(KitSpace, { children: displayedSubmitButtons })] }), _jsx(KitDivider, { noMargin: true, color: "lightGrey" })] })), _jsx(EditRecord, { antdForm: antdForm, formId: formId, formElementId: formElementId.current, record: currentRecord, library: library, valuesVersion: valuesVersion, onCreate: _handleCreate, containerStyle: { height: 'calc(100% - 82px)' }, withInfoButton: withInfoButton, enableSidebar: enableSidebar, showSidebar: showSidebar, sidebarContainer: sidebarContainer })] }));
|
|
61
60
|
};
|
|
62
61
|
//# sourceMappingURL=EditRecordPage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditRecordPage.js","sourceRoot":"","sources":["../../../../src/components/RecordEdition/EditRecordPage/EditRecordPage.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;A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AAO,EAChB,aAAa,EAAE,aAAa,EAC5B,QAAQ,EAAE,aAAa,EACvB,cAAc,EAAE,EAAC,MAAM,EAAE,mBAAmB,EAAC,EAC7C,cAAc,EAAE,cAAc,EAC9B,aAAa,EAAE,aAAa,EAC5B,WAAW,EAAE,WAAW,EACxB,gBAAgB,EAAE,gBAAgB,GACpC,IACH,CACN,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -5,7 +5,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
5
5
|
import { useSharedTranslation } from '../../../../hooks/useSharedTranslation';
|
|
6
6
|
import { KitBreadcrumb } from 'aristid-ds';
|
|
7
7
|
import { useEditRecordReducer } from '../../editRecordReducer/useEditRecordReducer';
|
|
8
|
-
import { EditRecordReducerActionsTypes } from '../../editRecordReducer/editRecordReducer';
|
|
8
|
+
import { EditRecordReducerActionsTypes, EditRecordSidebarContentTypeMap } from '../../editRecordReducer/editRecordReducer';
|
|
9
9
|
import { localizedTranslation } from '@leav/utils';
|
|
10
10
|
import { useLang } from '../../../../hooks';
|
|
11
11
|
export const Breadcrumb = () => {
|
|
@@ -28,7 +28,7 @@ export const Breadcrumb = () => {
|
|
|
28
28
|
e.preventDefault();
|
|
29
29
|
dispatch({
|
|
30
30
|
type: EditRecordReducerActionsTypes.SET_SIDEBAR_CONTENT,
|
|
31
|
-
content:
|
|
31
|
+
content: EditRecordSidebarContentTypeMap.SUMMARY
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
34
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Breadcrumb.js","sourceRoot":"","sources":["../../../../../src/components/RecordEdition/EditRecordSidebar/Breacrumb/Breadcrumb.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAC,aAAa,EAAC,MAAM,YAAY,CAAC;AAGzC,OAAO,EAAC,oBAAoB,EAAC,MAAM,8CAA8C,CAAC;AAClF,OAAO,
|
|
1
|
+
{"version":3,"file":"Breadcrumb.js","sourceRoot":"","sources":["../../../../../src/components/RecordEdition/EditRecordSidebar/Breacrumb/Breadcrumb.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAC,aAAa,EAAC,MAAM,YAAY,CAAC;AAGzC,OAAO,EAAC,oBAAoB,EAAC,MAAM,8CAA8C,CAAC;AAClF,OAAO,EACH,6BAA6B,EAC7B,+BAA+B,EAClC,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAAC,oBAAoB,EAAC,MAAM,aAAa,CAAC;AACjD,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAElC,MAAM,CAAC,MAAM,UAAU,GAAsB,GAAG,EAAE;IAC9C,MAAM,EAAC,CAAC,EAAC,GAAG,oBAAoB,EAAE,CAAC;IACnC,MAAM,EAAC,IAAI,EAAC,GAAG,OAAO,EAAE,CAAC;IACzB,MAAM,EAAC,KAAK,EAAE,QAAQ,EAAC,GAAG,oBAAoB,EAAE,CAAC;IAEjD,IAAI,KAAK,GAAyB,EAAE,CAAC;IAErC,QAAQ,KAAK,CAAC,cAAc,EAAE,CAAC;QAC3B,KAAK,MAAM,CAAC;QACZ,KAAK,gBAAgB;YACjB,MAAM;QACV,KAAK,cAAc;YACf,KAAK,GAAG;gBACJ;oBACI,KAAK,EAAE,CAAC,CAAC,gCAAgC,EAAE;wBACvC,MAAM,EAAE,oBAAoB,CAAC,KAAK,CAAC,YAAY,EAAE,IAAI,CAAC;qBACzD,CAAC;oBACF,IAAI,EAAE,EAAE;oBACR,OAAO,EAAE,CAAC,CAAC,EAAE;wBACT,CAAC,CAAC,cAAc,EAAE,CAAC;wBACnB,QAAQ,CAAC;4BACL,IAAI,EAAE,6BAA6B,CAAC,mBAAmB;4BACvD,OAAO,EAAE,+BAA+B,CAAC,OAAO;yBACnD,CAAC,CAAC;oBACP,CAAC;iBACJ;gBACD;oBACI,KAAK,EAAE,CAAC,CAAC,0BAA0B,CAAC;iBACvC;aACJ,CAAC;YACF,MAAM;QACV;YACI,KAAK,GAAG;gBACJ;oBACI,KAAK,EAAE,CAAC,CAAC,gCAAgC,EAAE;wBACvC,MAAM,EAAE,oBAAoB,CAAC,KAAK,CAAC,YAAY,EAAE,IAAI,CAAC;qBACzD,CAAC;iBACL;aACJ,CAAC;YACF,MAAM;IACd,CAAC;IACD,OAAO,KAAC,aAAa,IAAC,KAAK,EAAE,KAAK,GAAI,CAAC;AAC3C,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -2,7 +2,6 @@ import { FunctionComponent } from 'react';
|
|
|
2
2
|
import { MetadataSubmitValueFunc } from '../EditRecordContent/_types';
|
|
3
3
|
interface IEditRecordSidebarProps {
|
|
4
4
|
onMetadataSubmit: MetadataSubmitValueFunc;
|
|
5
|
-
open: boolean;
|
|
6
5
|
sidebarContainer?: HTMLElement;
|
|
7
6
|
}
|
|
8
7
|
export declare const EditRecordSidebar: FunctionComponent<IEditRecordSidebarProps>;
|
|
@@ -7,7 +7,7 @@ import { useEditRecordReducer } from '../editRecordReducer/useEditRecordReducer'
|
|
|
7
7
|
import RecordSummary from './RecordSummary';
|
|
8
8
|
import ValuesVersions from './ValuesVersions';
|
|
9
9
|
import { createPortal } from 'react-dom';
|
|
10
|
-
import {
|
|
10
|
+
import { EditRecordSidebarContentTypeMap } from '../editRecordReducer/editRecordReducer';
|
|
11
11
|
import { KitSidePanel, KitSpace } from 'aristid-ds';
|
|
12
12
|
import { useSharedTranslation } from '../../../hooks/useSharedTranslation';
|
|
13
13
|
import { EDIT_RECORD_SIDEBAR_ID } from '../../../constants';
|
|
@@ -35,30 +35,31 @@ const StyledKitSidePanel = styled(KitSidePanel) `
|
|
|
35
35
|
`&&& section {
|
|
36
36
|
box-shadow: none;
|
|
37
37
|
}`}
|
|
38
|
+
grid-area: sidebar;
|
|
39
|
+
display: ${({ $isOpen }) => ($isOpen ? 'block' : 'none')};
|
|
38
40
|
`;
|
|
39
|
-
export const EditRecordSidebar = ({ onMetadataSubmit,
|
|
41
|
+
export const EditRecordSidebar = ({ onMetadataSubmit, sidebarContainer }) => {
|
|
40
42
|
const { t } = useSharedTranslation();
|
|
41
43
|
const { lang } = useLang();
|
|
42
|
-
const { state
|
|
44
|
+
const { state } = useEditRecordReducer();
|
|
43
45
|
const sidePanelRef = useRef(null);
|
|
44
|
-
const sidePanelTitle = state.sidebarContent ===
|
|
46
|
+
const sidePanelTitle = state.sidebarContent === EditRecordSidebarContentTypeMap.VALUE_DETAILS
|
|
45
47
|
? localizedTranslation(state.activeAttribute?.attribute.label, lang)
|
|
46
48
|
: (state.record?.label ?? state.record?.id ?? t('record_summary.new_record'));
|
|
47
|
-
const editRecordSidebarContent = (_jsx(StyledKitSidePanel, { ref: sidePanelRef, initialOpen:
|
|
49
|
+
const editRecordSidebarContent = (_jsx(StyledKitSidePanel, { ref: sidePanelRef, initialOpen: state.isOpenSidebar && state.enableSidebar, idCardProps: { title: sidePanelTitle }, id: EDIT_RECORD_SIDEBAR_ID, headerExtra: _jsx(Breadcrumb, {}), "$hideBoxShadow": !sidebarContainer, "$isOpen": state.isOpenSidebar, children: _getRecordSidebarContent(state, onMetadataSubmit) }));
|
|
48
50
|
useEffect(() => {
|
|
49
|
-
if (sidePanelRef.current) {
|
|
50
|
-
if (
|
|
51
|
+
if (sidePanelRef.current && state.enableSidebar) {
|
|
52
|
+
if (state.isOpenSidebar) {
|
|
51
53
|
sidePanelRef.current.open();
|
|
52
|
-
dispatch({
|
|
53
|
-
type: EditRecordReducerActionsTypes.SET_SIDEBAR_CONTENT,
|
|
54
|
-
content: state.sidebarContent === 'none' ? 'summary' : state.sidebarContent
|
|
55
|
-
});
|
|
56
54
|
}
|
|
57
55
|
else {
|
|
58
56
|
sidePanelRef.current.close();
|
|
59
57
|
}
|
|
60
58
|
}
|
|
61
|
-
}, [
|
|
59
|
+
}, [state.enableSidebar, state.isOpenSidebar, sidePanelRef.current]);
|
|
60
|
+
if (!state.enableSidebar) {
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
62
63
|
return sidebarContainer === undefined
|
|
63
64
|
? editRecordSidebarContent
|
|
64
65
|
: createPortal(editRecordSidebarContent, sidebarContainer);
|
|
@@ -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,EAAoB,SAAS,
|
|
1
|
+
{"version":3,"file":"EditRecordSidebar.js","sourceRoot":"","sources":["../../../../src/components/RecordEdition/EditRecordSidebar/EditRecordSidebar.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAoB,SAAS,EAAW,MAAM,EAAC,MAAM,OAAO,CAAC;AAEpE,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,EAA0B,MAAM,wCAAwC,CAAC;AAChH,OAAO,EAAC,YAAY,EAAE,QAAQ,EAAC,MAAM,YAAY,CAAC;AAElD,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,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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AAI,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"}
|
|
@@ -43,8 +43,8 @@ function ValuesVersions() {
|
|
|
43
43
|
};
|
|
44
44
|
const _handleClosePanel = () => {
|
|
45
45
|
dispatch({
|
|
46
|
-
type: EditRecordReducerActionsTypes.
|
|
47
|
-
|
|
46
|
+
type: EditRecordReducerActionsTypes.SET_SIDEBAR_IS_OPEN,
|
|
47
|
+
isOpen: !state.isOpenSidebar
|
|
48
48
|
});
|
|
49
49
|
};
|
|
50
50
|
const _handleClickReset = () => {
|
package/dist/components/RecordEdition/EditRecordSidebar/ValuesVersions/ValuesVersions.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ValuesVersions.js","sourceRoot":"","sources":["../../../../../src/components/RecordEdition/EditRecordSidebar/ValuesVersions/ValuesVersions.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,aAAa,EAAC,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAC,MAAM,EAAC,MAAM,gBAAgB,CAAC;AACtC,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAC,SAAS,EAAC,MAAM,uBAAuB,CAAC;AAEhD,OAAO,EAAC,WAAW,EAAC,MAAM,sBAAsB,CAAC;AACjD,OAAO,yBAAyB,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EAAC,6BAA6B,EAAC,MAAM,2CAA2C,CAAC;AACxF,OAAO,EAAC,oBAAoB,EAAC,MAAM,8CAA8C,CAAC;AAElF,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAA;;;;CAIzB,CAAC;AAEF,MAAM,MAAM,GAAG,MAAM,CAAC,GAAG,CAAA;wBACD,SAAS,CAAC,QAAQ;;;;;;+BAMX,SAAS,CAAC,gBAAgB;CACxD,CAAC;AAEF,MAAM,WAAW,GAAG,MAAM,CAAC,aAAa,CAAC,CAAA;;;;;CAKxC,CAAC;AAEF,SAAS,cAAc;IACnB,MAAM,EAAC,CAAC,EAAC,GAAG,oBAAoB,EAAE,CAAC;IACnC,MAAM,EAAC,KAAK,EAAE,QAAQ,EAAC,GAAG,oBAAoB,EAAE,CAAC;IACjD,MAAM,YAAY,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC;IAEpC,MAAM,oBAAoB,GAAG,CAAC,OAAsB,EAAE,EAAE;QACpD,QAAQ,CAAC;YACL,IAAI,EAAE,6BAA6B,CAAC,kBAAkB;YACtD,aAAa,EAAE,OAAO;SACzB,CAAC,CAAC;IACP,CAAC,CAAC;IAEF,MAAM,iBAAiB,GAAG,GAAG,EAAE;QAC3B,QAAQ,CAAC;YACL,IAAI,EAAE,6BAA6B,CAAC,mBAAmB;YACvD,
|
|
1
|
+
{"version":3,"file":"ValuesVersions.js","sourceRoot":"","sources":["../../../../../src/components/RecordEdition/EditRecordSidebar/ValuesVersions/ValuesVersions.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,aAAa,EAAC,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAC,MAAM,EAAC,MAAM,gBAAgB,CAAC;AACtC,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAC,SAAS,EAAC,MAAM,uBAAuB,CAAC;AAEhD,OAAO,EAAC,WAAW,EAAC,MAAM,sBAAsB,CAAC;AACjD,OAAO,yBAAyB,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EAAC,6BAA6B,EAAC,MAAM,2CAA2C,CAAC;A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Q,EACd,QAAQ,QACR,IAAI,EAAE,KAAC,MAAM,KAAG,EAChB,OAAO,EAAE,iBAAiB,GAC5B,CACL,EACD,KAAC,WAAW,IAAC,OAAO,EAAE,iBAAiB,GAAI,IACxC,IACF,EACT,KAAC,yBAAyB,IACtB,SAAS,EAAE,KAAK,CAAC,SAAS,EAC1B,eAAe,EAAE,KAAK,CAAC,aAAa,EACpC,eAAe,EAAE,oBAAoB,EACrC,QAAQ,EAAE,YAAY,GACxB,IACI,CACb,CAAC;AACN,CAAC;AAED,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
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 const EDIT_RECORD_SIDEBAR_TOGGLE_BUTON_ID = 'edit-record-side-bar-toggle-button';
|
|
5
|
+
export const EDIT_RECORD_MODAL_HEADER_CONTAINER_BUTTONS = 'edit-record-modal-header-container-buttons';
|
|
6
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/components/RecordEdition/constants.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,MAAM,CAAC,MAAM,mCAAmC,GAAG,oCAAoC,CAAC;AAExF,MAAM,CAAC,MAAM,0CAA0C,GAAG,4CAA4C,CAAC"}
|
|
@@ -8,12 +8,21 @@ export interface IRecordPropertyWithAttribute {
|
|
|
8
8
|
globalValues?: Array<RecordFormElementsValueStandardValue['payload']>;
|
|
9
9
|
calculatedValue?: RecordFormElementsValueStandardValue['payload'];
|
|
10
10
|
}
|
|
11
|
+
export declare const EditRecordSidebarContentTypeMap: {
|
|
12
|
+
readonly SUMMARY: "summary";
|
|
13
|
+
readonly VALUE_DETAILS: "valueDetails";
|
|
14
|
+
readonly VALUES_VERSIONS: "valuesVersions";
|
|
15
|
+
readonly NONE: "none";
|
|
16
|
+
};
|
|
17
|
+
export type EditRecordSidebarContentType = (typeof EditRecordSidebarContentTypeMap)[keyof typeof EditRecordSidebarContentTypeMap];
|
|
11
18
|
export interface IEditRecordReducerState {
|
|
12
19
|
record: IRecordIdentityWhoAmI;
|
|
13
20
|
libraryId: string;
|
|
14
21
|
libraryLabel: SystemTranslation | null;
|
|
15
22
|
activeAttribute: IRecordPropertyWithAttribute;
|
|
16
|
-
sidebarContent:
|
|
23
|
+
sidebarContent: EditRecordSidebarContentType;
|
|
24
|
+
enableSidebar: boolean;
|
|
25
|
+
isOpenSidebar: boolean;
|
|
17
26
|
sidebarDefaultHidden?: boolean;
|
|
18
27
|
valuesVersion: IValueVersion;
|
|
19
28
|
originValuesVersion: IValueVersion;
|
|
@@ -30,7 +39,11 @@ export declare enum EditRecordReducerActionsTypes {
|
|
|
30
39
|
SET_RECORD = "SET_RECORD",
|
|
31
40
|
SET_LIBRARY_LABEL = "SET_LIBRARY_LABEL",
|
|
32
41
|
SET_ACTIVE_VALUE = "SET_ACTIVE_VALUE",
|
|
42
|
+
INITIALIZE_SIDEBAR = "INITIALIZE_SIDEBAR",
|
|
43
|
+
SET_ENABLE_SIDEBAR = "SET_ENABLE_SIDEBAR",
|
|
33
44
|
SET_SIDEBAR_CONTENT = "SET_SIDEBAR_CONTENT",
|
|
45
|
+
SET_SIDEBAR_IS_OPEN = "SET_SIDEBAR_IS_OPEN",
|
|
46
|
+
SET_SIDEBAR_DEFAULT_HIDDEN = "SET_SIDEBAR_DEFAULT_HIDDEN",
|
|
34
47
|
SET_VALUES_VERSION = "SET_VALUES_VERSION",
|
|
35
48
|
REQUEST_REFRESH = "REQUEST_REFRESH",
|
|
36
49
|
REFRESH_DONE = "REFRESH_DONE",
|
|
@@ -47,9 +60,22 @@ export type IEditRecordReducerActions = {
|
|
|
47
60
|
type: EditRecordReducerActionsTypes.SET_ACTIVE_VALUE;
|
|
48
61
|
attribute?: IEditRecordReducerState['activeAttribute']['attribute'];
|
|
49
62
|
values?: RecordFormElementsValueStandardValue[] | RecordFormElementsValueLinkValue[] | RecordFormElementsValueTreeValue[];
|
|
63
|
+
} | {
|
|
64
|
+
type: EditRecordReducerActionsTypes.INITIALIZE_SIDEBAR;
|
|
65
|
+
enabled: IEditRecordReducerState['enableSidebar'];
|
|
66
|
+
isOpenByDefault: IEditRecordReducerState['sidebarDefaultHidden'];
|
|
67
|
+
} | {
|
|
68
|
+
type: EditRecordReducerActionsTypes.SET_ENABLE_SIDEBAR;
|
|
69
|
+
enabled: IEditRecordReducerState['enableSidebar'];
|
|
70
|
+
} | {
|
|
71
|
+
type: EditRecordReducerActionsTypes.SET_SIDEBAR_IS_OPEN;
|
|
72
|
+
isOpen: IEditRecordReducerState['isOpenSidebar'];
|
|
50
73
|
} | {
|
|
51
74
|
type: EditRecordReducerActionsTypes.SET_SIDEBAR_CONTENT;
|
|
52
75
|
content: IEditRecordReducerState['sidebarContent'];
|
|
76
|
+
} | {
|
|
77
|
+
type: EditRecordReducerActionsTypes.SET_SIDEBAR_DEFAULT_HIDDEN;
|
|
78
|
+
value: IEditRecordReducerState['sidebarDefaultHidden'];
|
|
53
79
|
} | {
|
|
54
80
|
type: EditRecordReducerActionsTypes.SET_VALUES_VERSION;
|
|
55
81
|
valuesVersion: IEditRecordReducerState['valuesVersion'];
|
|
@@ -1,10 +1,20 @@
|
|
|
1
1
|
import { TypeGuards } from '../../../components/LibraryItemsList/LibraryItemsListTable/Cell/typeGuards';
|
|
2
|
+
export const EditRecordSidebarContentTypeMap = {
|
|
3
|
+
SUMMARY: 'summary',
|
|
4
|
+
VALUE_DETAILS: 'valueDetails',
|
|
5
|
+
VALUES_VERSIONS: 'valuesVersions',
|
|
6
|
+
NONE: 'none'
|
|
7
|
+
};
|
|
2
8
|
export var EditRecordReducerActionsTypes;
|
|
3
9
|
(function (EditRecordReducerActionsTypes) {
|
|
4
10
|
EditRecordReducerActionsTypes["SET_RECORD"] = "SET_RECORD";
|
|
5
11
|
EditRecordReducerActionsTypes["SET_LIBRARY_LABEL"] = "SET_LIBRARY_LABEL";
|
|
6
12
|
EditRecordReducerActionsTypes["SET_ACTIVE_VALUE"] = "SET_ACTIVE_VALUE";
|
|
13
|
+
EditRecordReducerActionsTypes["INITIALIZE_SIDEBAR"] = "INITIALIZE_SIDEBAR";
|
|
14
|
+
EditRecordReducerActionsTypes["SET_ENABLE_SIDEBAR"] = "SET_ENABLE_SIDEBAR";
|
|
7
15
|
EditRecordReducerActionsTypes["SET_SIDEBAR_CONTENT"] = "SET_SIDEBAR_CONTENT";
|
|
16
|
+
EditRecordReducerActionsTypes["SET_SIDEBAR_IS_OPEN"] = "SET_SIDEBAR_IS_OPEN";
|
|
17
|
+
EditRecordReducerActionsTypes["SET_SIDEBAR_DEFAULT_HIDDEN"] = "SET_SIDEBAR_DEFAULT_HIDDEN";
|
|
8
18
|
EditRecordReducerActionsTypes["SET_VALUES_VERSION"] = "SET_VALUES_VERSION";
|
|
9
19
|
EditRecordReducerActionsTypes["REQUEST_REFRESH"] = "REQUEST_REFRESH";
|
|
10
20
|
EditRecordReducerActionsTypes["REFRESH_DONE"] = "REFRESH_DONE";
|
|
@@ -16,7 +26,9 @@ export const initialState = {
|
|
|
16
26
|
libraryId: null,
|
|
17
27
|
libraryLabel: null,
|
|
18
28
|
activeAttribute: null,
|
|
19
|
-
|
|
29
|
+
enableSidebar: false,
|
|
30
|
+
isOpenSidebar: false,
|
|
31
|
+
sidebarContent: EditRecordSidebarContentTypeMap.NONE,
|
|
20
32
|
sidebarDefaultHidden: false,
|
|
21
33
|
valuesVersion: null,
|
|
22
34
|
originValuesVersion: null,
|
|
@@ -33,8 +45,28 @@ const editRecordReducer = (state, action) => {
|
|
|
33
45
|
return { ...state, record: action.record };
|
|
34
46
|
case EditRecordReducerActionsTypes.SET_LIBRARY_LABEL:
|
|
35
47
|
return { ...state, libraryLabel: action.label };
|
|
48
|
+
case EditRecordReducerActionsTypes.INITIALIZE_SIDEBAR: {
|
|
49
|
+
const { enabled, isOpenByDefault } = action;
|
|
50
|
+
// If the sidebar is not enabled, don't check for isOpenByDefault
|
|
51
|
+
const isOpen = enabled && isOpenByDefault;
|
|
52
|
+
return {
|
|
53
|
+
...state,
|
|
54
|
+
enableSidebar: enabled,
|
|
55
|
+
sidebarDefaultHidden: !isOpenByDefault,
|
|
56
|
+
sidebarContent: isOpen ? EditRecordSidebarContentTypeMap.SUMMARY : EditRecordSidebarContentTypeMap.NONE,
|
|
57
|
+
isOpenSidebar: isOpen
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
case EditRecordReducerActionsTypes.SET_ENABLE_SIDEBAR:
|
|
61
|
+
return { ...state, enableSidebar: action.enabled };
|
|
62
|
+
case EditRecordReducerActionsTypes.SET_SIDEBAR_DEFAULT_HIDDEN:
|
|
63
|
+
return { ...state, sidebarDefaultHidden: action.value };
|
|
36
64
|
case EditRecordReducerActionsTypes.SET_ACTIVE_VALUE:
|
|
37
|
-
const newSidebarContent = action.attribute !== null
|
|
65
|
+
const newSidebarContent = action.attribute !== null
|
|
66
|
+
? EditRecordSidebarContentTypeMap.VALUE_DETAILS
|
|
67
|
+
: state.sidebarDefaultHidden
|
|
68
|
+
? EditRecordSidebarContentTypeMap.NONE
|
|
69
|
+
: EditRecordSidebarContentTypeMap.SUMMARY;
|
|
38
70
|
return {
|
|
39
71
|
...state,
|
|
40
72
|
activeAttribute: {
|
|
@@ -67,6 +99,14 @@ const editRecordReducer = (state, action) => {
|
|
|
67
99
|
};
|
|
68
100
|
case EditRecordReducerActionsTypes.SET_SIDEBAR_CONTENT:
|
|
69
101
|
return { ...state, sidebarContent: action.content };
|
|
102
|
+
case EditRecordReducerActionsTypes.SET_SIDEBAR_IS_OPEN:
|
|
103
|
+
return {
|
|
104
|
+
...state,
|
|
105
|
+
sidebarContent: action.isOpen
|
|
106
|
+
? EditRecordSidebarContentTypeMap.SUMMARY
|
|
107
|
+
: EditRecordSidebarContentTypeMap.NONE,
|
|
108
|
+
isOpenSidebar: action.isOpen
|
|
109
|
+
};
|
|
70
110
|
case EditRecordReducerActionsTypes.SET_VALUES_VERSION:
|
|
71
111
|
return { ...state, valuesVersion: action.valuesVersion };
|
|
72
112
|
case EditRecordReducerActionsTypes.REQUEST_REFRESH:
|
|
@@ -93,6 +133,7 @@ const editRecordReducer = (state, action) => {
|
|
|
93
133
|
case EditRecordReducerActionsTypes.CLEAR_EXTERNAL_UPDATE:
|
|
94
134
|
return { ...state, externalUpdate: { ...initialState.externalUpdate } };
|
|
95
135
|
default:
|
|
136
|
+
console.warn('Unknown action type in editRecordReducer:', action);
|
|
96
137
|
return state;
|
|
97
138
|
}
|
|
98
139
|
};
|