@gisce/react-ooui 1.2.0-rc.8 → 1.2.0-rc.82
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/README.md +0 -6
- package/dist/actionbar/ActionButton.d.ts +2 -2
- package/dist/actionbar/ActionButton.d.ts.map +1 -1
- package/dist/actionbar/AttachmentsButton.d.ts +2 -2
- package/dist/actionbar/AttachmentsButton.d.ts.map +1 -1
- package/dist/actionbar/AttachmentsButtonWrapper.d.ts +2 -2
- package/dist/actionbar/AttachmentsButtonWrapper.d.ts.map +1 -1
- package/dist/actionbar/ButtonWithBadge.d.ts +2 -2
- package/dist/actionbar/ButtonWithBadge.d.ts.map +1 -1
- package/dist/actionbar/ChangeViewButton.d.ts +2 -2
- package/dist/actionbar/ChangeViewButton.d.ts.map +1 -1
- package/dist/actionbar/DashboardActionBar.d.ts +2 -2
- package/dist/actionbar/DashboardActionBar.d.ts.map +1 -1
- package/dist/actionbar/DropdownButton.d.ts +2 -2
- package/dist/actionbar/DropdownButton.d.ts.map +1 -1
- package/dist/actionbar/FormActionBar.d.ts +2 -2
- package/dist/actionbar/FormActionBar.d.ts.map +1 -1
- package/dist/actionbar/GraphActionBar.d.ts +2 -2
- package/dist/actionbar/GraphActionBar.d.ts.map +1 -1
- package/dist/actionbar/NewButton.d.ts +2 -2
- package/dist/actionbar/NewButton.d.ts.map +1 -1
- package/dist/actionbar/SearchBar.d.ts +2 -2
- package/dist/actionbar/SearchBar.d.ts.map +1 -1
- package/dist/actionbar/TreeActionBar.d.ts +2 -2
- package/dist/actionbar/TreeActionBar.d.ts.map +1 -1
- package/dist/common/ButtonWithTooltip.d.ts +2 -2
- package/dist/common/ButtonWithTooltip.d.ts.map +1 -1
- package/dist/common/DatePicker.d.ts +14 -2
- package/dist/common/DatePicker.d.ts.map +1 -1
- package/dist/common/Field.d.ts +1 -1
- package/dist/common/Field.d.ts.map +1 -1
- package/dist/context/ActionViewContext.d.ts +5 -1
- package/dist/context/ActionViewContext.d.ts.map +1 -1
- package/dist/context/ConfigContext.d.ts +7 -0
- package/dist/context/ConfigContext.d.ts.map +1 -0
- package/dist/context/ContentRootContext.d.ts.map +1 -1
- package/dist/context/FormContext.d.ts +4 -2
- package/dist/context/FormContext.d.ts.map +1 -1
- package/dist/helpers/errorHelper.d.ts +6 -0
- package/dist/helpers/errorHelper.d.ts.map +1 -0
- package/dist/helpers/formHelper.d.ts +5 -3
- package/dist/helpers/formHelper.d.ts.map +1 -1
- package/dist/helpers/iconMapper.d.ts +11 -2
- package/dist/helpers/iconMapper.d.ts.map +1 -1
- package/dist/helpers/one2manyHelper.d.ts +12 -4
- package/dist/helpers/one2manyHelper.d.ts.map +1 -1
- package/dist/helpers/searchHelper.d.ts +1 -1
- package/dist/helpers/searchHelper.d.ts.map +1 -1
- package/dist/helpers/treeHelper.d.ts +1 -1
- package/dist/helpers/treeHelper.d.ts.map +1 -1
- package/dist/hooks/useExport.d.ts +44 -0
- package/dist/hooks/useExport.d.ts.map +1 -0
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/locales/ca_ES.d.ts +2 -0
- package/dist/locales/ca_ES.d.ts.map +1 -1
- package/dist/locales/en_US.d.ts +2 -0
- package/dist/locales/en_US.d.ts.map +1 -1
- package/dist/locales/es_ES.d.ts +2 -0
- package/dist/locales/es_ES.d.ts.map +1 -1
- package/dist/react-ooui.es.js +25826 -27484
- package/dist/react-ooui.es.js.map +1 -1
- package/dist/react-ooui.umd.js +180 -215
- package/dist/react-ooui.umd.js.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/ui/ActionErrorDialog.d.ts.map +1 -1
- package/dist/ui/ErrorAlert.d.ts +6 -0
- package/dist/ui/ErrorAlert.d.ts.map +1 -0
- package/dist/ui/FavouriteButton.d.ts +2 -2
- package/dist/ui/FavouriteButton.d.ts.map +1 -1
- package/dist/ui/GoToResourceModal.d.ts +2 -2
- package/dist/ui/GoToResourceModal.d.ts.map +1 -1
- package/dist/ui/TitleHeader.d.ts +2 -2
- package/dist/ui/TitleHeader.d.ts.map +1 -1
- package/dist/views/ActionView.d.ts.map +1 -1
- package/dist/views/CurrentTabContent.d.ts +2 -2
- package/dist/views/CurrentTabContent.d.ts.map +1 -1
- package/dist/views/RootView.d.ts.map +1 -1
- package/dist/views/TabContent.d.ts +1 -1
- package/dist/views/TabContent.d.ts.map +1 -1
- package/dist/views/TabSelector.d.ts +2 -2
- package/dist/views/TabSelector.d.ts.map +1 -1
- package/dist/views/actionViews/DashboardActionView.d.ts +2 -2
- package/dist/views/actionViews/DashboardActionView.d.ts.map +1 -1
- package/dist/views/actionViews/FormActionView.d.ts +2 -2
- package/dist/views/actionViews/FormActionView.d.ts.map +1 -1
- package/dist/views/actionViews/GraphActionView.d.ts +2 -2
- package/dist/views/actionViews/GraphActionView.d.ts.map +1 -1
- package/dist/views/actionViews/TreeActionView.d.ts +2 -2
- package/dist/views/actionViews/TreeActionView.d.ts.map +1 -1
- package/dist/views/tabs/Tab.d.ts +2 -2
- package/dist/views/tabs/Tab.d.ts.map +1 -1
- package/dist/widgets/WidgetFactory.d.ts.map +1 -1
- package/dist/widgets/base/Binary.d.ts +3 -3
- package/dist/widgets/base/Binary.d.ts.map +1 -1
- package/dist/widgets/base/Boolean.d.ts +2 -2
- package/dist/widgets/base/Boolean.d.ts.map +1 -1
- package/dist/widgets/base/Button.d.ts +2 -2
- package/dist/widgets/base/Button.d.ts.map +1 -1
- package/dist/widgets/base/Char.d.ts +2 -2
- package/dist/widgets/base/Char.d.ts.map +1 -1
- package/dist/widgets/base/Date.d.ts +2 -2
- package/dist/widgets/base/Date.d.ts.map +1 -1
- package/dist/widgets/base/DateTime.d.ts +2 -2
- package/dist/widgets/base/DateTime.d.ts.map +1 -1
- package/dist/widgets/base/Email.d.ts +2 -2
- package/dist/widgets/base/Email.d.ts.map +1 -1
- package/dist/widgets/base/Float.d.ts +2 -2
- package/dist/widgets/base/Float.d.ts.map +1 -1
- package/dist/widgets/base/FloatTime.d.ts +1 -1
- package/dist/widgets/base/FloatTime.d.ts.map +1 -1
- package/dist/widgets/base/Image.d.ts +3 -3
- package/dist/widgets/base/Image.d.ts.map +1 -1
- package/dist/widgets/base/Integer.d.ts +2 -2
- package/dist/widgets/base/Integer.d.ts.map +1 -1
- package/dist/widgets/base/Label.d.ts +2 -2
- package/dist/widgets/base/Label.d.ts.map +1 -1
- package/dist/widgets/base/LinkInput.d.ts +2 -2
- package/dist/widgets/base/LinkInput.d.ts.map +1 -1
- package/dist/widgets/base/MultiSelection.d.ts +3 -3
- package/dist/widgets/base/MultiSelection.d.ts.map +1 -1
- package/dist/widgets/base/ProgressBar.d.ts +3 -3
- package/dist/widgets/base/ProgressBar.d.ts.map +1 -1
- package/dist/widgets/base/Reference.d.ts +1 -1
- package/dist/widgets/base/Reference.d.ts.map +1 -1
- package/dist/widgets/base/ReferenceTree.d.ts +8 -0
- package/dist/widgets/base/ReferenceTree.d.ts.map +1 -0
- package/dist/widgets/base/Selection.d.ts +3 -3
- package/dist/widgets/base/Selection.d.ts.map +1 -1
- package/dist/widgets/base/Separator.d.ts +2 -2
- package/dist/widgets/base/Separator.d.ts.map +1 -1
- package/dist/widgets/base/Text.d.ts +2 -2
- package/dist/widgets/base/Text.d.ts.map +1 -1
- package/dist/widgets/base/Url.d.ts +2 -2
- package/dist/widgets/base/Url.d.ts.map +1 -1
- package/dist/widgets/base/many2one/Many2one.d.ts +1 -1
- package/dist/widgets/base/many2one/Many2one.d.ts.map +1 -1
- package/dist/widgets/base/many2one/Many2oneSuffix.d.ts +2 -2
- package/dist/widgets/base/many2one/Many2oneSuffix.d.ts.map +1 -1
- package/dist/widgets/base/many2one/Many2oneSuffixModal.d.ts +2 -2
- package/dist/widgets/base/many2one/Many2oneSuffixModal.d.ts.map +1 -1
- package/dist/widgets/base/many2one/Many2oneTree.d.ts +6 -0
- package/dist/widgets/base/many2one/Many2oneTree.d.ts.map +1 -0
- package/dist/widgets/base/one2many/One2many.d.ts +2 -2
- package/dist/widgets/base/one2many/One2many.d.ts.map +1 -1
- package/dist/widgets/base/one2many/One2manyInput.d.ts.map +1 -1
- package/dist/widgets/base/one2many/One2manyTopBar.d.ts +2 -2
- package/dist/widgets/base/one2many/One2manyTopBar.d.ts.map +1 -1
- package/dist/widgets/containers/Group.d.ts.map +1 -1
- package/dist/widgets/custom/ButtonGroup.d.ts +2 -2
- package/dist/widgets/custom/ButtonGroup.d.ts.map +1 -1
- package/dist/widgets/custom/CodeEditor.d.ts +2 -2
- package/dist/widgets/custom/CodeEditor.d.ts.map +1 -1
- package/dist/widgets/custom/FiberGrid.d.ts +3 -3
- package/dist/widgets/custom/FiberGrid.d.ts.map +1 -1
- package/dist/widgets/custom/Indicator.d.ts +2 -2
- package/dist/widgets/custom/Indicator.d.ts.map +1 -1
- package/dist/widgets/custom/Markdown.d.ts +5 -0
- package/dist/widgets/custom/Markdown.d.ts.map +1 -0
- package/dist/widgets/custom/MultiCheckbox.d.ts +3 -3
- package/dist/widgets/custom/MultiCheckbox.d.ts.map +1 -1
- package/dist/widgets/custom/Radio.d.ts +3 -3
- package/dist/widgets/custom/Radio.d.ts.map +1 -1
- package/dist/widgets/custom/Steps.d.ts +3 -3
- package/dist/widgets/custom/Steps.d.ts.map +1 -1
- package/dist/widgets/custom/Switch.d.ts +2 -2
- package/dist/widgets/custom/Switch.d.ts.map +1 -1
- package/dist/widgets/custom/Tag.d.ts +5 -0
- package/dist/widgets/custom/Tag.d.ts.map +1 -0
- package/dist/widgets/custom/Tags.d.ts +3 -3
- package/dist/widgets/custom/Tags.d.ts.map +1 -1
- package/dist/widgets/custom/Timeline.d.ts +3 -3
- package/dist/widgets/custom/Timeline.d.ts.map +1 -1
- package/dist/widgets/modals/ExportModal.d.ts +4 -3
- package/dist/widgets/modals/ExportModal.d.ts.map +1 -1
- package/dist/widgets/modals/FormModal.d.ts +2 -2
- package/dist/widgets/modals/FormModal.d.ts.map +1 -1
- package/dist/widgets/modals/SearchModal.d.ts +2 -2
- package/dist/widgets/modals/SearchModal.d.ts.map +1 -1
- package/dist/widgets/modals/TranslationModal.d.ts +2 -2
- package/dist/widgets/modals/TranslationModal.d.ts.map +1 -1
- package/dist/widgets/views/Dashboard/Dashboard.d.ts.map +1 -1
- package/dist/widgets/views/Dashboard/DashboardForm.d.ts +2 -2
- package/dist/widgets/views/Dashboard/DashboardForm.d.ts.map +1 -1
- package/dist/widgets/views/Dashboard/DashboardTree.d.ts +2 -2
- package/dist/widgets/views/Dashboard/DashboardTree.d.ts.map +1 -1
- package/dist/widgets/views/DashboardGrid/DashboardGrid.d.ts +2 -2
- package/dist/widgets/views/DashboardGrid/DashboardGrid.d.ts.map +1 -1
- package/dist/widgets/views/DashboardGrid/DashboardGridItem.d.ts +2 -2
- package/dist/widgets/views/DashboardGrid/DashboardGridItem.d.ts.map +1 -1
- package/dist/widgets/views/Form.d.ts.map +1 -1
- package/dist/widgets/views/Graph/GraphChart.d.ts +2 -2
- package/dist/widgets/views/Graph/GraphChart.d.ts.map +1 -1
- package/dist/widgets/views/Graph/GraphDefaults.d.ts +36 -0
- package/dist/widgets/views/Graph/GraphDefaults.d.ts.map +1 -1
- package/dist/widgets/views/Graph/GraphIndicator.d.ts +2 -2
- package/dist/widgets/views/Graph/GraphIndicator.d.ts.map +1 -1
- package/dist/widgets/views/SearchTree.d.ts.map +1 -1
- package/dist/widgets/views/Tree.d.ts +2 -0
- package/dist/widgets/views/Tree.d.ts.map +1 -1
- package/dist/widgets/views/searchFilter/DateRangePicker.d.ts +2 -2
- package/dist/widgets/views/searchFilter/DateRangePicker.d.ts.map +1 -1
- package/dist/widgets/views/searchFilter/DateTimeRangePicker.d.ts +2 -2
- package/dist/widgets/views/searchFilter/DateTimeRangePicker.d.ts.map +1 -1
- package/dist/widgets/views/searchFilter/SearchField.d.ts +2 -2
- package/dist/widgets/views/searchFilter/SearchField.d.ts.map +1 -1
- package/dist/widgets/views/searchFilter/SearchFilter.d.ts +3 -2
- package/dist/widgets/views/searchFilter/SearchFilter.d.ts.map +1 -1
- package/package.json +11 -13
- package/src/__tests__/iconMapper.test.ts +20 -5
- package/src/__tests__/searchFilterHelper.spec.ts +7 -7
- package/src/actionbar/AttachmentsButton.tsx +22 -24
- package/src/actionbar/AttachmentsButtonWrapper.tsx +15 -12
- package/src/actionbar/ButtonWithBadge.tsx +5 -2
- package/src/actionbar/ChangeViewButton.tsx +13 -7
- package/src/actionbar/FormActionBar.tsx +73 -11
- package/src/actionbar/TreeActionBar.tsx +99 -97
- package/src/common/DatePicker.tsx +18 -13
- package/src/context/ActionViewContext.tsx +7 -4
- package/src/context/ConfigContext.tsx +9 -0
- package/src/context/ContentRootContext.tsx +123 -81
- package/src/context/FormContext.tsx +1 -4
- package/src/helpers/errorHelper.ts +27 -0
- package/src/helpers/formHelper.ts +26 -5
- package/src/helpers/iconMapper.ts +141 -108
- package/src/helpers/one2manyHelper.ts +94 -39
- package/src/helpers/searchHelper.ts +8 -7
- package/src/helpers/treeHelper.ts +17 -5
- package/src/hooks/useExport.ts +439 -0
- package/src/index.ts +6 -0
- package/src/locales/ca_ES.tsx +2 -0
- package/src/locales/en_US.tsx +2 -0
- package/src/locales/es_ES.tsx +2 -0
- package/src/stories/Binary.stories.tsx +4 -1
- package/src/stories/Boolean.stories.tsx +4 -1
- package/src/stories/Button.stories.tsx +4 -1
- package/src/stories/Char.stories.tsx +4 -1
- package/src/stories/FiberGrid.stories.tsx +4 -1
- package/src/stories/Float.stories.tsx +4 -1
- package/src/stories/FloatTime.stories.tsx +4 -1
- package/src/stories/Image.stories.tsx +4 -1
- package/src/stories/Integer.stories.tsx +4 -1
- package/src/stories/Label.stories.tsx +11 -9
- package/src/stories/Many2one.stories.tsx +4 -1
- package/src/stories/One2many.stories.tsx +4 -1
- package/src/stories/ProgressBar.stories.tsx +4 -1
- package/src/stories/Reference.stories.tsx +4 -1
- package/src/stories/Selection.stories.tsx +4 -1
- package/src/stories/Separator.stories.tsx +37 -1
- package/src/stories/Text.stories.tsx +4 -1
- package/src/stories/containers/Group.stories.tsx +28 -1
- package/src/stories/containers/NewLine.stories.tsx +4 -1
- package/src/stories/containers/Notebook.stories.tsx +31 -1
- package/src/stories/custom/ButtonGroup.stories.tsx +4 -1
- package/src/stories/custom/CodeEditor.stories.tsx +4 -1
- package/src/stories/custom/Indicator.stories.tsx +4 -1
- package/src/stories/custom/Markdown.stories.tsx +42 -0
- package/src/stories/custom/MultiCheckbox.stories.tsx +4 -1
- package/src/stories/custom/Radio.stories.tsx +4 -1
- package/src/stories/custom/Steps.stories.tsx +4 -1
- package/src/stories/custom/Switch.stories.tsx +4 -1
- package/src/stories/custom/Tag.stories.tsx +60 -0
- package/src/stories/custom/Tags.stories.tsx +4 -1
- package/src/stories/forms/PreferencesForm.stories.tsx +4 -1
- package/src/stories/mocks/models/company.ts +2 -2
- package/src/stories/mocks/models/crm_case.ts +7 -10
- package/src/stories/ui/ActionBar.stories.tsx +2 -1
- package/src/stories/ui/FavouriteButton.stories.tsx +2 -1
- package/src/stories/ui/GoToResourceModal.stories.tsx +2 -1
- package/src/stories/views/SearchTree.stories.tsx +3 -1
- package/src/stories/views/Tab.stories.tsx +3 -1
- package/src/stories/views/TabsAndContent.stories.tsx +3 -1
- package/src/stories/views/Tree.stories.jsx +9 -6
- package/src/stories/views/searchFilter/DateRangePicker.stories.tsx +3 -1
- package/src/stories/views/searchFilter/DateTimeRangePicker.stories.tsx +4 -1
- package/src/stories/views/searchFilter/PairFields.stories.tsx +4 -1
- package/src/stories/views/searchFilter/SearchFilter.stories.tsx +4 -1
- package/src/stories/views/searchFilter/examples/PartnersSearchFilter.stories.tsx +4 -1
- package/src/types/index.ts +1 -0
- package/src/ui/ActionErrorDialog.tsx +4 -21
- package/src/ui/ErrorAlert.tsx +37 -0
- package/src/ui/FavouriteButton.tsx +20 -9
- package/src/ui/GoToResourceModal.tsx +3 -3
- package/src/ui/TitleHeader.tsx +18 -4
- package/src/views/ActionView.tsx +6 -2
- package/src/views/RootView.tsx +7 -1
- package/src/views/actionViews/GraphActionView.tsx +1 -0
- package/src/views/actionViews/TreeActionView.tsx +10 -1
- package/src/views/tabs/Tab.tsx +12 -6
- package/src/widgets/WidgetFactory.tsx +6 -0
- package/src/widgets/base/Binary.tsx +8 -5
- package/src/widgets/base/Boolean.tsx +8 -7
- package/src/widgets/base/Char.tsx +14 -12
- package/src/widgets/base/Float.tsx +11 -5
- package/src/widgets/base/FloatTime.tsx +9 -5
- package/src/widgets/base/Integer.tsx +10 -5
- package/src/widgets/base/Label.tsx +12 -12
- package/src/widgets/base/LinkInput.tsx +11 -6
- package/src/widgets/base/MultiSelection.tsx +6 -2
- package/src/widgets/base/Reference.tsx +13 -3
- package/src/widgets/base/ReferenceTree.tsx +62 -0
- package/src/widgets/base/Selection.tsx +6 -2
- package/src/widgets/base/Separator.tsx +11 -3
- package/src/widgets/base/Text.tsx +14 -12
- package/src/widgets/base/many2one/Many2one.tsx +25 -31
- package/src/widgets/base/many2one/Many2oneSuffixModal.tsx +3 -3
- package/src/widgets/base/many2one/Many2oneTree.tsx +18 -0
- package/src/widgets/base/one2many/One2manyInput.tsx +79 -23
- package/src/widgets/base/one2many/One2manyTopBar.tsx +10 -1
- package/src/widgets/containers/Group.tsx +7 -4
- package/src/widgets/custom/ButtonGroup.tsx +1 -1
- package/src/widgets/custom/FiberGrid.tsx +1 -4
- package/src/widgets/custom/Indicator.tsx +16 -15
- package/src/widgets/custom/Markdown.tsx +22 -0
- package/src/widgets/custom/MultiCheckbox.tsx +1 -0
- package/src/widgets/custom/Tag.tsx +24 -0
- package/src/widgets/custom/Tags.tsx +27 -28
- package/src/widgets/custom/Timeline.tsx +9 -3
- package/src/widgets/modals/ExportModal.tsx +33 -134
- package/src/widgets/modals/FormModal.tsx +3 -3
- package/src/widgets/modals/SearchModal.tsx +29 -31
- package/src/widgets/modals/TranslationModal.tsx +3 -3
- package/src/widgets/views/Dashboard/Dashboard.tsx +15 -4
- package/src/widgets/views/Dashboard/DashboardTree.tsx +1 -0
- package/src/widgets/views/DashboardGrid/DashboardGridItem.tsx +10 -6
- package/src/widgets/views/Form.tsx +41 -39
- package/src/widgets/views/Graph/GraphChart.tsx +6 -1
- package/src/widgets/views/Graph/GraphDefaults.ts +113 -0
- package/src/widgets/views/Graph/GraphIndicator.tsx +19 -7
- package/src/widgets/views/SearchTree.tsx +3 -0
- package/src/widgets/views/Tree.tsx +112 -26
- package/src/widgets/views/searchFilter/SearchField.tsx +9 -23
- package/src/widgets/views/searchFilter/SearchFilter.tsx +17 -8
- package/dist/Config.d.ts +0 -6
- package/dist/Config.d.ts.map +0 -1
- package/dist/helpers/icons/antd_icons.d.ts +0 -4
- package/dist/helpers/icons/antd_icons.d.ts.map +0 -1
- package/dist/helpers/icons/tabler_icons.d.ts +0 -4
- package/dist/helpers/icons/tabler_icons.d.ts.map +0 -1
- package/dist/ui/Fieldset.d.ts +0 -8
- package/dist/ui/Fieldset.d.ts.map +0 -1
- package/src/Config.ts +0 -4
- package/src/helpers/icons/antd_icons.ts +0 -1583
- package/src/helpers/icons/tabler_icons.ts +0 -5367
- package/src/ui/Fieldset.tsx +0 -31
- /package/dist/{main.css → style.css} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React, { useContext } from "react";
|
|
2
|
-
import { Space, Spin } from "antd";
|
|
1
|
+
import React, { useContext, useEffect, useRef } from "react";
|
|
2
|
+
import { Space, Spin, message } from "antd";
|
|
3
3
|
import {
|
|
4
4
|
SaveOutlined,
|
|
5
5
|
RightOutlined,
|
|
@@ -63,7 +63,6 @@ function FormActionBar({ toolbar }: { toolbar: any }) {
|
|
|
63
63
|
attachments,
|
|
64
64
|
formRef,
|
|
65
65
|
setFormHasChanges,
|
|
66
|
-
searchTreeRef,
|
|
67
66
|
previousView,
|
|
68
67
|
setPreviousView,
|
|
69
68
|
goToResourceId,
|
|
@@ -331,11 +330,19 @@ function FormActionBar({ toolbar }: { toolbar: any }) {
|
|
|
331
330
|
disabled={mustDisableButtons}
|
|
332
331
|
tooltip={t("actions")}
|
|
333
332
|
items={toolbar?.action}
|
|
334
|
-
onItemClick={(action: any) => {
|
|
333
|
+
onItemClick={async (action: any) => {
|
|
335
334
|
if (!action) {
|
|
336
335
|
return;
|
|
337
336
|
}
|
|
338
337
|
|
|
338
|
+
const result = await saveDocument({
|
|
339
|
+
onFormSave,
|
|
340
|
+
});
|
|
341
|
+
|
|
342
|
+
if (!result.succeed) {
|
|
343
|
+
return;
|
|
344
|
+
}
|
|
345
|
+
|
|
339
346
|
runAction(action);
|
|
340
347
|
}}
|
|
341
348
|
/>
|
|
@@ -344,14 +351,24 @@ function FormActionBar({ toolbar }: { toolbar: any }) {
|
|
|
344
351
|
disabled={mustDisableButtons}
|
|
345
352
|
tooltip={t("reports")}
|
|
346
353
|
items={toolbar?.print}
|
|
347
|
-
onItemClick={(report: any) => {
|
|
354
|
+
onItemClick={async (report: any) => {
|
|
348
355
|
if (!report) {
|
|
349
356
|
return;
|
|
350
357
|
}
|
|
358
|
+
const result = await saveDocument({
|
|
359
|
+
onFormSave,
|
|
360
|
+
});
|
|
361
|
+
|
|
362
|
+
if (!result.succeed) {
|
|
363
|
+
return;
|
|
364
|
+
}
|
|
351
365
|
|
|
352
366
|
runAction({
|
|
353
367
|
...report,
|
|
354
|
-
datas: {
|
|
368
|
+
datas: {
|
|
369
|
+
...(report.datas || {}),
|
|
370
|
+
ids: [result.currentId as number],
|
|
371
|
+
},
|
|
355
372
|
});
|
|
356
373
|
}}
|
|
357
374
|
/>
|
|
@@ -365,6 +382,14 @@ function FormActionBar({ toolbar }: { toolbar: any }) {
|
|
|
365
382
|
return;
|
|
366
383
|
}
|
|
367
384
|
|
|
385
|
+
const result = await saveDocument({
|
|
386
|
+
onFormSave,
|
|
387
|
+
});
|
|
388
|
+
|
|
389
|
+
if (!result.succeed) {
|
|
390
|
+
return;
|
|
391
|
+
}
|
|
392
|
+
|
|
368
393
|
openRelate({
|
|
369
394
|
relateData: relate,
|
|
370
395
|
values: (formRef.current as any).getValues(),
|
|
@@ -377,8 +402,16 @@ function FormActionBar({ toolbar }: { toolbar: any }) {
|
|
|
377
402
|
<AttachmentsButton
|
|
378
403
|
disabled={mustDisableButtons}
|
|
379
404
|
attachments={attachments}
|
|
380
|
-
onAddNewAttachment={() => {
|
|
381
|
-
const
|
|
405
|
+
onAddNewAttachment={async () => {
|
|
406
|
+
const result = await saveDocument({
|
|
407
|
+
onFormSave,
|
|
408
|
+
});
|
|
409
|
+
|
|
410
|
+
if (!result.succeed) {
|
|
411
|
+
return;
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
const res_id = result.currentId as number;
|
|
382
415
|
const res_model = currentModel as string;
|
|
383
416
|
openDefaultActionForModel({
|
|
384
417
|
model: "ir.attachment",
|
|
@@ -392,8 +425,16 @@ function FormActionBar({ toolbar }: { toolbar: any }) {
|
|
|
392
425
|
initialViewType: "form",
|
|
393
426
|
});
|
|
394
427
|
}}
|
|
395
|
-
onListAllAttachments={() => {
|
|
396
|
-
const
|
|
428
|
+
onListAllAttachments={async () => {
|
|
429
|
+
const result = await saveDocument({
|
|
430
|
+
onFormSave,
|
|
431
|
+
});
|
|
432
|
+
|
|
433
|
+
if (!result.succeed) {
|
|
434
|
+
return;
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
const res_id = result.currentId as number;
|
|
397
438
|
const res_model = currentModel as string;
|
|
398
439
|
openDefaultActionForModel({
|
|
399
440
|
model: "ir.attachment",
|
|
@@ -404,7 +445,15 @@ function FormActionBar({ toolbar }: { toolbar: any }) {
|
|
|
404
445
|
initialViewType: "tree",
|
|
405
446
|
});
|
|
406
447
|
}}
|
|
407
|
-
onViewAttachmentDetails={(attachment: Attachment) => {
|
|
448
|
+
onViewAttachmentDetails={async (attachment: Attachment) => {
|
|
449
|
+
const result = await saveDocument({
|
|
450
|
+
onFormSave,
|
|
451
|
+
});
|
|
452
|
+
|
|
453
|
+
if (!result.succeed) {
|
|
454
|
+
return;
|
|
455
|
+
}
|
|
456
|
+
|
|
408
457
|
openDefaultActionForModel({
|
|
409
458
|
model: "ir.attachment",
|
|
410
459
|
res_id: attachment.id,
|
|
@@ -420,4 +469,17 @@ function separator() {
|
|
|
420
469
|
return <div className="inline-block w-2" />;
|
|
421
470
|
}
|
|
422
471
|
|
|
472
|
+
async function saveDocument({
|
|
473
|
+
onFormSave,
|
|
474
|
+
}: {
|
|
475
|
+
onFormSave?: () => Promise<{ succeed: boolean; id: number }>;
|
|
476
|
+
}): Promise<{ succeed: boolean; currentId?: number }> {
|
|
477
|
+
const result = await onFormSave?.();
|
|
478
|
+
if (result?.succeed) {
|
|
479
|
+
return { succeed: true, currentId: result.id };
|
|
480
|
+
} else {
|
|
481
|
+
return { succeed: false, currentId: undefined };
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
|
|
423
485
|
export default FormActionBar;
|
|
@@ -30,6 +30,7 @@ import { showLogInfo } from "@/helpers/logInfoHelper";
|
|
|
30
30
|
import SearchBar from "./SearchBar";
|
|
31
31
|
import { ExportModal } from "..";
|
|
32
32
|
import { mergeParams } from "@/helpers/searchHelper";
|
|
33
|
+
import { ConfigContext } from "@/context/ConfigContext";
|
|
33
34
|
|
|
34
35
|
type Props = {
|
|
35
36
|
parentContext?: any;
|
|
@@ -61,10 +62,11 @@ function TreeActionBar(props: Props) {
|
|
|
61
62
|
previousView,
|
|
62
63
|
results,
|
|
63
64
|
limit,
|
|
65
|
+
totalItems,
|
|
64
66
|
} = useContext(ActionViewContext) as ActionViewContextType;
|
|
65
67
|
|
|
66
68
|
const { parentContext = {}, treeExpandable, toolbar } = props;
|
|
67
|
-
|
|
69
|
+
const { previewFeatures } = useContext(ConfigContext);
|
|
68
70
|
const { t, lang } = useContext(LocaleContext) as LocaleContextType;
|
|
69
71
|
const contentRootContext = useContext(
|
|
70
72
|
ContentRootContext
|
|
@@ -162,9 +164,24 @@ function TreeActionBar(props: Props) {
|
|
|
162
164
|
}
|
|
163
165
|
}}
|
|
164
166
|
/>
|
|
167
|
+
{!treeExpandable && (
|
|
168
|
+
<ButtonWithBadge
|
|
169
|
+
icon={
|
|
170
|
+
<FilterOutlined
|
|
171
|
+
style={{ color: searchVisible ? "white" : undefined }}
|
|
172
|
+
/>
|
|
173
|
+
}
|
|
174
|
+
tooltip={t("advanced_search")}
|
|
175
|
+
type={searchVisible ? "primary" : "default"}
|
|
176
|
+
onClick={() => {
|
|
177
|
+
setSearchVisible?.(!searchVisible);
|
|
178
|
+
}}
|
|
179
|
+
disabled={duplicatingItem || removingItem || treeIsLoading}
|
|
180
|
+
badgeNumber={searchParams?.length}
|
|
181
|
+
/>
|
|
182
|
+
)}
|
|
165
183
|
{separator()}
|
|
166
184
|
<NewButton disabled={treeIsLoading} />
|
|
167
|
-
{separator()}
|
|
168
185
|
<ActionButton
|
|
169
186
|
icon={<CopyOutlined />}
|
|
170
187
|
tooltip={t("duplicate")}
|
|
@@ -190,22 +207,6 @@ function TreeActionBar(props: Props) {
|
|
|
190
207
|
{separator()}
|
|
191
208
|
</>
|
|
192
209
|
)}
|
|
193
|
-
{!treeExpandable && (
|
|
194
|
-
<ButtonWithBadge
|
|
195
|
-
icon={
|
|
196
|
-
<FilterOutlined
|
|
197
|
-
style={{ color: searchVisible ? "white" : undefined }}
|
|
198
|
-
/>
|
|
199
|
-
}
|
|
200
|
-
tooltip={t("advanced_search")}
|
|
201
|
-
type={searchVisible ? "primary" : "default"}
|
|
202
|
-
onClick={() => {
|
|
203
|
-
setSearchVisible?.(!searchVisible);
|
|
204
|
-
}}
|
|
205
|
-
disabled={duplicatingItem || removingItem || treeIsLoading}
|
|
206
|
-
badgeNumber={searchParams?.length}
|
|
207
|
-
/>
|
|
208
|
-
)}
|
|
209
210
|
<ActionButton
|
|
210
211
|
icon={<InfoCircleOutlined />}
|
|
211
212
|
tooltip={t("showLogs")}
|
|
@@ -278,89 +279,90 @@ function TreeActionBar(props: Props) {
|
|
|
278
279
|
});
|
|
279
280
|
}}
|
|
280
281
|
/>
|
|
281
|
-
{separator()}
|
|
282
|
-
<DropdownButton
|
|
283
|
-
icon={
|
|
284
|
-
<Icon
|
|
285
|
-
component={() => (
|
|
286
|
-
<svg
|
|
287
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
288
|
-
className="icon icon-tabler icon-tabler-database-export"
|
|
289
|
-
width="1em"
|
|
290
|
-
height="1em"
|
|
291
|
-
viewBox="0 0 24 24"
|
|
292
|
-
stroke-width="1.5"
|
|
293
|
-
fill="none"
|
|
294
|
-
stroke="currentColor"
|
|
295
|
-
stroke-linecap="round"
|
|
296
|
-
stroke-linejoin="round"
|
|
297
|
-
>
|
|
298
|
-
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
|
|
299
|
-
<ellipse cx="12" cy="6" rx="8" ry="3" />
|
|
300
|
-
<path d="M4 6v6c0 1.657 3.582 3 8 3a19.84 19.84 0 0 0 3.302 -.267m4.698 -2.733v-6" />
|
|
301
|
-
<path d="M4 12v6c0 1.599 3.335 2.905 7.538 2.995m8.462 -6.995v-2m-6 7h7m-3 -3l3 3l-3 3" />
|
|
302
|
-
</svg>
|
|
303
|
-
)}
|
|
304
|
-
/>
|
|
305
|
-
}
|
|
306
|
-
tooltip={t("export")}
|
|
307
|
-
items={[
|
|
308
|
-
{
|
|
309
|
-
id: "print_screen",
|
|
310
|
-
name: t("printScreen"),
|
|
311
|
-
},
|
|
312
|
-
{
|
|
313
|
-
id: "export",
|
|
314
|
-
name: t("advancedExport"),
|
|
315
|
-
},
|
|
316
|
-
]}
|
|
317
|
-
onItemClick={(itemClicked: any) => {
|
|
318
|
-
if (itemClicked.id === "print_screen") {
|
|
319
|
-
let idsToExport = selectedRowItems?.map((item) => item.id) || [];
|
|
320
282
|
|
|
321
|
-
|
|
322
|
-
|
|
283
|
+
{previewFeatures && (
|
|
284
|
+
<>
|
|
285
|
+
{separator()}
|
|
286
|
+
<DropdownButton
|
|
287
|
+
icon={
|
|
288
|
+
<Icon
|
|
289
|
+
component={() => (
|
|
290
|
+
<svg
|
|
291
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
292
|
+
className="icon icon-tabler icon-tabler-database-export"
|
|
293
|
+
width="1em"
|
|
294
|
+
height="1em"
|
|
295
|
+
viewBox="0 0 24 24"
|
|
296
|
+
strokeWidth="1.5"
|
|
297
|
+
fill="none"
|
|
298
|
+
stroke="currentColor"
|
|
299
|
+
strokeLinecap="round"
|
|
300
|
+
strokeLinejoin="round"
|
|
301
|
+
>
|
|
302
|
+
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
|
|
303
|
+
<ellipse cx="12" cy="6" rx="8" ry="3" />
|
|
304
|
+
<path d="M4 6v6c0 1.657 3.582 3 8 3a19.84 19.84 0 0 0 3.302 -.267m4.698 -2.733v-6" />
|
|
305
|
+
<path d="M4 12v6c0 1.599 3.335 2.905 7.538 2.995m8.462 -6.995v-2m-6 7h7m-3 -3l3 3l-3 3" />
|
|
306
|
+
</svg>
|
|
307
|
+
)}
|
|
308
|
+
/>
|
|
323
309
|
}
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
type: "ir.actions.report.xml",
|
|
330
|
-
datas: {
|
|
331
|
-
model: currentModel,
|
|
332
|
-
ids: idsToExport,
|
|
310
|
+
tooltip={t("export")}
|
|
311
|
+
items={[
|
|
312
|
+
{
|
|
313
|
+
id: "print_screen",
|
|
314
|
+
name: t("printScreen"),
|
|
333
315
|
},
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
316
|
+
{
|
|
317
|
+
id: "export",
|
|
318
|
+
name: t("advancedExport"),
|
|
319
|
+
},
|
|
320
|
+
]}
|
|
321
|
+
onItemClick={(itemClicked: any) => {
|
|
322
|
+
if (itemClicked.id === "print_screen") {
|
|
323
|
+
let idsToExport =
|
|
324
|
+
selectedRowItems?.map((item) => item.id) || [];
|
|
337
325
|
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
326
|
+
if (idsToExport.length === 0) {
|
|
327
|
+
idsToExport = results?.map((item) => item.id) || [];
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
runAction({
|
|
331
|
+
id: -1,
|
|
332
|
+
model: currentModel,
|
|
333
|
+
report_name: "printscreen.list",
|
|
334
|
+
type: "ir.actions.report.xml",
|
|
335
|
+
datas: {
|
|
336
|
+
model: currentModel,
|
|
337
|
+
ids: idsToExport,
|
|
338
|
+
},
|
|
339
|
+
});
|
|
340
|
+
return;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
setExportModalVisible(true);
|
|
344
|
+
}}
|
|
345
|
+
disabled={
|
|
346
|
+
duplicatingItem || removingItem || treeIsLoading || hasNameSearch
|
|
347
|
+
}
|
|
348
|
+
/>
|
|
349
|
+
<ExportModal
|
|
350
|
+
visible={exportModalVisible}
|
|
351
|
+
locale={lang}
|
|
352
|
+
onClose={() => setExportModalVisible(false)}
|
|
353
|
+
model={currentModel!}
|
|
354
|
+
domain={mergeParams(
|
|
355
|
+
searchTreeRef?.current?.getDomain() || [],
|
|
356
|
+
searchParams || []
|
|
357
|
+
)}
|
|
358
|
+
limit={limit}
|
|
359
|
+
totalRegisters={totalItems || 0}
|
|
360
|
+
selectedRegistersToExport={selectedRowItems}
|
|
361
|
+
visibleRegisters={results?.length || 0}
|
|
362
|
+
context={parentContext}
|
|
363
|
+
/>
|
|
364
|
+
</>
|
|
365
|
+
)}
|
|
364
366
|
</Space>
|
|
365
367
|
);
|
|
366
368
|
}
|
|
@@ -1,28 +1,29 @@
|
|
|
1
|
-
import { DatePicker as AntDatePicker } from "antd";
|
|
1
|
+
import { DatePicker as AntDatePicker, theme } from "antd";
|
|
2
2
|
|
|
3
3
|
import React from "react";
|
|
4
4
|
import Field from "@/common/Field";
|
|
5
5
|
import { WidgetProps } from "@/types";
|
|
6
|
-
import Config from "@/Config";
|
|
7
6
|
import { Date as DateOoui } from "@gisce/ooui";
|
|
8
|
-
import
|
|
7
|
+
import dayjs from "dayjs";
|
|
8
|
+
const { useToken } = theme;
|
|
9
9
|
|
|
10
10
|
type DatePickerProps = WidgetProps & {
|
|
11
11
|
showTime?: boolean;
|
|
12
12
|
};
|
|
13
13
|
|
|
14
|
-
const DatePickerConfig = {
|
|
14
|
+
export const DatePickerConfig = {
|
|
15
15
|
date: {
|
|
16
16
|
placeholder: "__/__/____",
|
|
17
|
-
dateDisplayFormat: "YYYY
|
|
17
|
+
dateDisplayFormat: "DD/MM/YYYY",
|
|
18
18
|
dateInternalFormat: "YYYY-MM-DD",
|
|
19
19
|
},
|
|
20
20
|
time: {
|
|
21
21
|
placeholder: "__/__/____ __:__:__",
|
|
22
|
-
dateDisplayFormat: "YYYY
|
|
22
|
+
dateDisplayFormat: "DD/MM/YYYY HH:mm:ss",
|
|
23
23
|
dateInternalFormat: "YYYY-MM-DD HH:mm:ss",
|
|
24
24
|
},
|
|
25
25
|
};
|
|
26
|
+
|
|
26
27
|
const DatePicker = (props: DatePickerProps) => {
|
|
27
28
|
const { ooui, showTime = false } = props;
|
|
28
29
|
const { required } = ooui;
|
|
@@ -46,8 +47,12 @@ const DatePickerInput: React.FC<DatePickerInputProps> = (
|
|
|
46
47
|
) => {
|
|
47
48
|
const { value, onChange, ooui, showTime } = props;
|
|
48
49
|
const { id, readOnly, required } = ooui as DateOoui;
|
|
49
|
-
const
|
|
50
|
-
|
|
50
|
+
const { token } = useToken();
|
|
51
|
+
|
|
52
|
+
const requiredStyle =
|
|
53
|
+
required && !readOnly
|
|
54
|
+
? { backgroundColor: token.colorPrimaryBg }
|
|
55
|
+
: undefined;
|
|
51
56
|
|
|
52
57
|
const mode = showTime ? "time" : "date";
|
|
53
58
|
|
|
@@ -65,15 +70,15 @@ const DatePickerInput: React.FC<DatePickerInputProps> = (
|
|
|
65
70
|
};
|
|
66
71
|
|
|
67
72
|
const showTimeParms = showTime
|
|
68
|
-
? { defaultValue:
|
|
73
|
+
? { defaultValue: dayjs("00:00:00", "HH:mm:ss") }
|
|
69
74
|
: undefined;
|
|
70
75
|
const dateValue = value
|
|
71
|
-
?
|
|
76
|
+
? dayjs(value, DatePickerConfig[mode].dateInternalFormat)
|
|
72
77
|
: undefined;
|
|
73
78
|
|
|
74
79
|
return (
|
|
75
80
|
<AntDatePicker
|
|
76
|
-
style={{ width: "100%" }}
|
|
81
|
+
style={{ width: "100%", ...requiredStyle }}
|
|
77
82
|
placeholder={
|
|
78
83
|
showTime
|
|
79
84
|
? DatePickerConfig.time.placeholder
|
|
@@ -81,12 +86,12 @@ const DatePickerInput: React.FC<DatePickerInputProps> = (
|
|
|
81
86
|
}
|
|
82
87
|
disabled={readOnly}
|
|
83
88
|
id={id}
|
|
89
|
+
picker={showTime ? "time" : "date"}
|
|
84
90
|
showTime={showTimeParms}
|
|
85
|
-
className={requiredClass}
|
|
86
91
|
format={DatePickerConfig[mode].dateDisplayFormat}
|
|
87
92
|
value={dateValue}
|
|
88
93
|
onChange={onValueStringChange}
|
|
89
|
-
|
|
94
|
+
/>
|
|
90
95
|
);
|
|
91
96
|
};
|
|
92
97
|
|
|
@@ -11,7 +11,7 @@ export type ActionViewContextType = {
|
|
|
11
11
|
setFormIsSaving?: (value: boolean) => void;
|
|
12
12
|
formHasChanges?: boolean;
|
|
13
13
|
setFormHasChanges?: (value: boolean) => void;
|
|
14
|
-
onFormSave?: () =>
|
|
14
|
+
onFormSave?: () => Promise<{ succeed: boolean; id: number }>;
|
|
15
15
|
formRef?: any;
|
|
16
16
|
searchTreeRef?: any;
|
|
17
17
|
onNewClicked: () => void;
|
|
@@ -53,6 +53,7 @@ export type ActionViewContextType = {
|
|
|
53
53
|
setSearchValues?: (value: any) => void;
|
|
54
54
|
limit?: number;
|
|
55
55
|
setLimit?: (value: number) => void;
|
|
56
|
+
setTitle?: (value: string) => void;
|
|
56
57
|
};
|
|
57
58
|
|
|
58
59
|
export const ActionViewContext =
|
|
@@ -66,7 +67,7 @@ const ActionViewProvider = (props: ActionViewProviderProps): any => {
|
|
|
66
67
|
const {
|
|
67
68
|
children,
|
|
68
69
|
currentView,
|
|
69
|
-
title,
|
|
70
|
+
title: titleProps,
|
|
70
71
|
setCurrentView,
|
|
71
72
|
availableViews,
|
|
72
73
|
formRef,
|
|
@@ -106,6 +107,7 @@ const ActionViewProvider = (props: ActionViewProviderProps): any => {
|
|
|
106
107
|
const [limit, setLimit] = useState<number>(
|
|
107
108
|
limitProps !== undefined ? limitProps : DEFAULT_SEARCH_LIMIT
|
|
108
109
|
);
|
|
110
|
+
const [title, setTitle] = useState<string>(titleProps);
|
|
109
111
|
|
|
110
112
|
useEffect(() => {
|
|
111
113
|
if (results && results.length > 0 && !currentItemIndex) {
|
|
@@ -139,8 +141,8 @@ const ActionViewProvider = (props: ActionViewProviderProps): any => {
|
|
|
139
141
|
}
|
|
140
142
|
}, [currentView]);
|
|
141
143
|
|
|
142
|
-
const callOnFormSave = () => {
|
|
143
|
-
(formRef.current as any)?.submitForm();
|
|
144
|
+
const callOnFormSave = async () => {
|
|
145
|
+
return await (formRef.current as any)?.submitForm();
|
|
144
146
|
};
|
|
145
147
|
|
|
146
148
|
return (
|
|
@@ -196,6 +198,7 @@ const ActionViewProvider = (props: ActionViewProviderProps): any => {
|
|
|
196
198
|
setSearchValues,
|
|
197
199
|
limit,
|
|
198
200
|
setLimit,
|
|
201
|
+
setTitle,
|
|
199
202
|
}}
|
|
200
203
|
>
|
|
201
204
|
{children}
|