@leav/ui 0.3.6-57637c6 → 0.3.6-598b136
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/attribute.js +1 -0
- package/dist/__mocks__/common/attribute.js.map +1 -1
- package/dist/__mocks__/common/value.js +1 -0
- package/dist/__mocks__/common/value.js.map +1 -1
- package/dist/__mocks__/common/view.js +6 -4
- package/dist/__mocks__/common/view.js.map +1 -1
- package/dist/_gqlTypes/index.d.ts +306 -46
- package/dist/_gqlTypes/index.js +165 -45
- package/dist/_gqlTypes/index.js.map +1 -1
- package/dist/_queries/records/getRecordColumnsValues.d.ts +1 -1
- package/dist/_queries/records/getRecordsFromLibraryQuery.js +1 -0
- package/dist/_queries/records/getRecordsFromLibraryQuery.js.map +1 -1
- package/dist/_queries/records/recordFormAttributeFragment.js +1 -0
- package/dist/_queries/records/recordFormAttributeFragment.js.map +1 -1
- package/dist/_queries/views/saveViewMutation.js +1 -1
- package/dist/_queries/views/viewDetailsFragment.js +12 -8
- package/dist/_queries/views/viewDetailsFragment.js.map +1 -1
- package/dist/_utils/index.js +4 -1
- package/dist/_utils/index.js.map +1 -1
- package/dist/antdTheme/index.d.ts +0 -3
- package/dist/antdTheme/index.js +3 -42
- package/dist/antdTheme/index.js.map +1 -1
- package/dist/components/Explorer/Explorer.d.ts +5 -4
- package/dist/components/Explorer/Explorer.js +26 -20
- package/dist/components/Explorer/Explorer.js.map +1 -1
- package/dist/components/Explorer/ExplorerTitle.d.ts +2 -0
- package/dist/components/Explorer/ExplorerTitle.js +28 -11
- package/dist/components/Explorer/ExplorerTitle.js.map +1 -1
- package/dist/components/Explorer/TableCell.js +15 -6
- package/dist/components/Explorer/TableCell.js.map +1 -1
- package/dist/components/Explorer/_constants.d.ts +4 -0
- package/dist/components/Explorer/_constants.js +17 -0
- package/dist/components/Explorer/_constants.js.map +1 -0
- package/dist/components/Explorer/_queries/useExplorerData.d.ts +12 -6
- package/dist/components/Explorer/_queries/useExplorerData.js +101 -22
- package/dist/components/Explorer/_queries/useExplorerData.js.map +1 -1
- package/dist/components/Explorer/_types.d.ts +26 -1
- package/dist/components/Explorer/{nullValuesConditions.d.ts → conditionsHelper.d.ts} +1 -0
- package/dist/components/Explorer/{nullValuesConditions.js → conditionsHelper.js} +3 -1
- package/dist/components/Explorer/conditionsHelper.js.map +1 -0
- package/dist/components/Explorer/display-view-filters/ExplorerToolBar.js +1 -1
- package/dist/components/Explorer/display-view-filters/ExplorerToolBar.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/filter-items/FilterItems.js +9 -3
- package/dist/components/Explorer/manage-view-settings/filter-items/FilterItems.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/BooleanAttributeDropdown.d.ts +2 -2
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/BooleanAttributeDropdown.js +16 -31
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/BooleanAttributeDropdown.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/ColorAttributeDropDown.d.ts +3 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/ColorAttributeDropDown.js +11 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/ColorAttributeDropDown.js.map +1 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/DateAttributeDropDown.d.ts +2 -2
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/DateAttributeDropDown.js +12 -36
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/DateAttributeDropDown.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/DateRangeAttributeDropDown.d.ts +3 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/DateRangeAttributeDropDown.js +11 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/DateRangeAttributeDropDown.js.map +1 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/EncryptedAttributeDropDown.d.ts +3 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/EncryptedAttributeDropDown.js +11 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/EncryptedAttributeDropDown.js.map +1 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/ExtendedAttributeDropDown.d.ts +3 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/ExtendedAttributeDropDown.js +11 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/ExtendedAttributeDropDown.js.map +1 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/FilterDropDown.d.ts +1 -1
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/FilterDropDown.js +56 -8
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/FilterDropDown.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/FilterValueList.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/NumericAttributeDropDown.d.ts +2 -2
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/NumericAttributeDropDown.js +7 -32
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/NumericAttributeDropDown.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/TextAttributeDropDown.d.ts +2 -2
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/TextAttributeDropDown.js +7 -32
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/TextAttributeDropDown.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/useConditionOptionsByType.d.ts +1 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/useConditionOptionsByType.js +5 -15
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/useConditionOptionsByType.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/router-menu/SettingsPanel.js +45 -5
- package/dist/components/Explorer/manage-view-settings/router-menu/SettingsPanel.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/sort-items/SortItems.js +25 -21
- package/dist/components/Explorer/manage-view-settings/sort-items/SortItems.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/store-view-settings/viewSettingsInitialState.js +12 -1
- package/dist/components/Explorer/manage-view-settings/store-view-settings/viewSettingsInitialState.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/store-view-settings/viewSettingsReducer.d.ts +14 -7
- package/dist/components/Explorer/manage-view-settings/store-view-settings/viewSettingsReducer.js +37 -32
- package/dist/components/Explorer/manage-view-settings/store-view-settings/viewSettingsReducer.js.map +1 -1
- package/dist/components/Explorer/useCreateAction.d.ts +4 -2
- package/dist/components/Explorer/useCreateAction.js +35 -2
- package/dist/components/Explorer/useCreateAction.js.map +1 -1
- package/dist/components/Explorer/useEditAction.js +3 -3
- package/dist/components/Explorer/useEditAction.js.map +1 -1
- package/dist/components/Explorer/usePrimaryActions.js +14 -7
- package/dist/components/Explorer/usePrimaryActions.js.map +1 -1
- package/dist/components/Explorer/useRemoveAction.d.ts +12 -0
- package/dist/components/Explorer/useRemoveAction.js +90 -0
- package/dist/components/Explorer/useRemoveAction.js.map +1 -0
- package/dist/components/Explorer/useSearchInput.js +1 -1
- package/dist/components/Explorer/useSearchInput.js.map +1 -1
- package/dist/components/Explorer/useViewSettingsReducer.d.ts +4 -3
- package/dist/components/Explorer/useViewSettingsReducer.js +101 -35
- package/dist/components/Explorer/useViewSettingsReducer.js.map +1 -1
- package/dist/components/LibraryItemsList/LibraryItemsListContent/LibraryItemsListContent.js +2 -2
- package/dist/components/LibraryItemsList/LibraryItemsListContent/LibraryItemsListContent.js.map +1 -1
- package/dist/components/LibraryItemsList/LibraryItemsListTable/Cell/StandardCell/StandardCell.js +7 -2
- package/dist/components/LibraryItemsList/LibraryItemsListTable/Cell/StandardCell/StandardCell.js.map +1 -1
- package/dist/components/LibraryItemsList/LibraryItemsListTable/Header/Header.js +7 -5
- package/dist/components/LibraryItemsList/LibraryItemsListTable/Header/Header.js.map +1 -1
- package/dist/components/LibraryItemsList/MenuView/MenuView.js +2 -2
- package/dist/components/LibraryItemsList/MenuView/MenuView.js.map +1 -1
- package/dist/components/LibraryItemsList/ViewPanel/EditView/EditView.js +2 -2
- package/dist/components/LibraryItemsList/ViewPanel/EditView/EditView.js.map +1 -1
- package/dist/components/LibraryItemsList/ViewPanel/View/View.js +3 -3
- package/dist/components/LibraryItemsList/ViewPanel/View/View.js.map +1 -1
- package/dist/components/LibraryItemsList/hooks/useLibraryView/useLibraryView.js +6 -4
- package/dist/components/LibraryItemsList/hooks/useLibraryView/useLibraryView.js.map +1 -1
- package/dist/components/LibraryItemsList/hooks/useSearchReducer/_types.d.ts +1 -1
- package/dist/components/LibraryItemsList/hooks/useSearchReducer/searchReducer.d.ts +1 -1
- package/dist/components/LibraryItemsList/hooks/useSearchReducer/searchReducer.js +2 -7
- package/dist/components/LibraryItemsList/hooks/useSearchReducer/searchReducer.js.map +1 -1
- package/dist/components/RecordEdition/EditRecord/EditRecord.js +6 -5
- package/dist/components/RecordEdition/EditRecord/EditRecord.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/EditRecordContent.js +4 -4
- package/dist/components/RecordEdition/EditRecordContent/EditRecordContent.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/_types.d.ts +1 -1
- package/dist/components/RecordEdition/EditRecordContent/helpers/extractFormElements/extractFormElements.d.ts +3 -1
- package/dist/components/RecordEdition/EditRecordContent/helpers/extractFormElements/extractFormElements.js +8 -2
- package/dist/components/RecordEdition/EditRecordContent/helpers/extractFormElements/extractFormElements.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/LinkField.js +2 -2
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/LinkField.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/ComputeIndicator.js +2 -4
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/ComputeIndicator.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardField.js +40 -2
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardField.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSBooleanWrapper.js +2 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSBooleanWrapper.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSColorPickerWrapper.js +39 -4
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSColorPickerWrapper.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSDatePickerWrapper.js +6 -2
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSDatePickerWrapper.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSInputEncryptedWrapper.js +5 -2
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSInputEncryptedWrapper.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSInputNumberWrapper.js +5 -2
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSInputNumberWrapper.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSInputWrapper.js +6 -2
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSInputWrapper.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSRangePickerWrapper.js +6 -2
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSRangePickerWrapper.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSRichTextWrapper.js +5 -2
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSRichTextWrapper.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/StandardFieldValue.d.ts +2 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/StandardFieldValue.js +3 -2
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/StandardFieldValue.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/ValuesList/DSListSelect.js +5 -2
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/ValuesList/DSListSelect.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/_types.d.ts +1 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/useGetPresentationValues.js +0 -5
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/useGetPresentationValues.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordModal/EditRecordModal.js +10 -4
- package/dist/components/RecordEdition/EditRecordModal/EditRecordModal.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordSidebar/EditRecordSidebar.d.ts +3 -2
- package/dist/components/RecordEdition/EditRecordSidebar/EditRecordSidebar.js +32 -15
- package/dist/components/RecordEdition/EditRecordSidebar/EditRecordSidebar.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordSidebar/PropertiesList/PropertiesList.d.ts +4 -7
- package/dist/components/RecordEdition/EditRecordSidebar/PropertiesList/PropertiesList.js +6 -8
- package/dist/components/RecordEdition/EditRecordSidebar/PropertiesList/PropertiesList.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordSidebar/RecordSummary/RecordInformations/RecordInformations.d.ts +9 -0
- package/dist/components/RecordEdition/EditRecordSidebar/RecordSummary/RecordInformations/RecordInformations.js +42 -0
- package/dist/components/RecordEdition/EditRecordSidebar/RecordSummary/RecordInformations/RecordInformations.js.map +1 -0
- package/dist/components/RecordEdition/EditRecordSidebar/RecordSummary/RecordInformations/useRecordInformations.d.ts +6 -0
- package/dist/components/RecordEdition/EditRecordSidebar/RecordSummary/RecordInformations/useRecordInformations.js +35 -0
- package/dist/components/RecordEdition/EditRecordSidebar/RecordSummary/RecordInformations/useRecordInformations.js.map +1 -0
- package/dist/components/RecordEdition/EditRecordSidebar/RecordSummary/RecordSummary.d.ts +2 -281
- package/dist/components/RecordEdition/EditRecordSidebar/RecordSummary/RecordSummary.js +25 -56
- package/dist/components/RecordEdition/EditRecordSidebar/RecordSummary/RecordSummary.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordSidebar/ValueDetails/ValueDetails.js +1 -13
- package/dist/components/RecordEdition/EditRecordSidebar/ValueDetails/ValueDetails.js.map +1 -1
- package/dist/components/RecordEdition/{EditRecordContent → EditRecordSkeleton}/EditRecordSkeleton.d.ts +1 -1
- package/dist/components/RecordEdition/{EditRecordContent → EditRecordSkeleton}/EditRecordSkeleton.js +2 -2
- package/dist/components/RecordEdition/EditRecordSkeleton/EditRecordSkeleton.js.map +1 -0
- package/dist/components/RecordEdition/EditRecordSkeleton/index.d.ts +2 -0
- package/dist/components/RecordEdition/EditRecordSkeleton/index.js +6 -0
- package/dist/components/RecordEdition/EditRecordSkeleton/index.js.map +1 -0
- package/dist/components/RecordEdition/index.d.ts +1 -0
- package/dist/components/RecordEdition/index.js +1 -0
- package/dist/components/RecordEdition/index.js.map +1 -1
- package/dist/constants.d.ts +3 -0
- package/dist/constants.js +3 -0
- package/dist/constants.js.map +1 -1
- package/dist/hooks/useExecuteSaveViewMutation/index.d.ts +1 -0
- package/dist/hooks/useExecuteSaveViewMutation/index.js +5 -0
- package/dist/hooks/useExecuteSaveViewMutation/index.js.map +1 -0
- package/dist/hooks/useExecuteSaveViewMutation/useExecuteSaveViewMutation.d.ts +6 -0
- package/dist/hooks/{useExecuteAddViewMutation/useExecuteAddViewMutation.js → useExecuteSaveViewMutation/useExecuteSaveViewMutation.js} +6 -6
- package/dist/hooks/useExecuteSaveViewMutation/useExecuteSaveViewMutation.js.map +1 -0
- package/dist/locales/en/shared.json +19 -3
- package/dist/locales/fr/shared.json +19 -3
- package/dist/types/views.d.ts +1 -1
- package/package.json +2 -2
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/SimpleFilterDropDown.d.ts +0 -3
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/SimpleFilterDropDown.js +0 -72
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/SimpleFilterDropDown.js.map +0 -1
- package/dist/components/Explorer/nullValuesConditions.js.map +0 -1
- package/dist/components/Explorer/useDeactivateAction.d.ts +0 -12
- package/dist/components/Explorer/useDeactivateAction.js +0 -52
- package/dist/components/Explorer/useDeactivateAction.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/EditRecordSkeleton.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/shared/ValueDetailsBtn/useValueDetailsButton.d.ts +0 -8
- package/dist/components/RecordEdition/EditRecordContent/shared/ValueDetailsBtn/useValueDetailsButton.js +0 -23
- package/dist/components/RecordEdition/EditRecordContent/shared/ValueDetailsBtn/useValueDetailsButton.js.map +0 -1
- package/dist/hooks/useExecuteAddViewMutation/useExecuteAddViewMutation.d.ts +0 -6
- package/dist/hooks/useExecuteAddViewMutation/useExecuteAddViewMutation.js.map +0 -1
package/dist/antdTheme/index.js
CHANGED
|
@@ -5,8 +5,8 @@ export * from './types';
|
|
|
5
5
|
// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
|
|
6
6
|
const baseTextColor = '#000000';
|
|
7
7
|
export const themeVars = {
|
|
8
|
-
primaryColor: '
|
|
9
|
-
primaryColorLighter: '
|
|
8
|
+
primaryColor: 'var(--general-colors-primary-400)',
|
|
9
|
+
primaryColorLighter: 'var(--general-colors-primary-100)',
|
|
10
10
|
defaultBg: '#ffffff',
|
|
11
11
|
invertedDefaultBg: '#000000',
|
|
12
12
|
defaultTextColor: baseTextColor,
|
|
@@ -26,55 +26,16 @@ export const themeVars = {
|
|
|
26
26
|
imageDefaultBackground: 'rgb(245, 245, 245)'
|
|
27
27
|
};
|
|
28
28
|
export const customTheme = {
|
|
29
|
-
token: {
|
|
30
|
-
colorPrimary: themeVars.primaryColor,
|
|
31
|
-
colorError: themeVars.errorColor,
|
|
32
|
-
colorBgBase: themeVars.defaultBg,
|
|
33
|
-
colorTextBase: themeVars.defaultTextColor,
|
|
34
|
-
colorBorder: themeVars.borderColor,
|
|
35
|
-
colorBorderSecondary: themeVars.borderLightColor,
|
|
36
|
-
colorSplit: themeVars.borderColor,
|
|
37
|
-
wireframe: false
|
|
38
|
-
},
|
|
39
29
|
components: {
|
|
40
30
|
Layout: {
|
|
41
31
|
headerBg: themeVars.secondaryBg,
|
|
42
32
|
controlHeight: 24 // Used by antd to compute the height of the header (2 * controlHeight)
|
|
43
33
|
},
|
|
44
|
-
Dropdown: {
|
|
45
|
-
controlItemBgHover: themeVars.activeColor,
|
|
46
|
-
colorSplit: themeVars.borderLightColor
|
|
47
|
-
},
|
|
48
34
|
Menu: {
|
|
49
35
|
colorActiveBarBorderSize: 0
|
|
50
36
|
},
|
|
51
37
|
Table: {
|
|
52
|
-
colorBgContainer: 'transparent'
|
|
53
|
-
colorFillAlter: themeVars.lightBg
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
export const dsTheme = {
|
|
58
|
-
general: {
|
|
59
|
-
colors: {
|
|
60
|
-
primary: {
|
|
61
|
-
100: '#ddf1fd',
|
|
62
|
-
200: '#98d6f8',
|
|
63
|
-
300: '#54baf4',
|
|
64
|
-
400: themeVars.primaryColor,
|
|
65
|
-
500: '#0d80c2',
|
|
66
|
-
600: '#0b6aa0',
|
|
67
|
-
700: '#08537d'
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
|
-
components: {
|
|
72
|
-
Input: {
|
|
73
|
-
colors: {
|
|
74
|
-
border: {
|
|
75
|
-
hover: customTheme.token.colorPrimary
|
|
76
|
-
}
|
|
77
|
-
}
|
|
38
|
+
colorBgContainer: 'transparent' // To avoid issues with border-radius on footer
|
|
78
39
|
}
|
|
79
40
|
}
|
|
80
41
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/antdTheme/index.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/antdTheme/index.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AAItE,cAAc,SAAS,CAAC;AAExB,sEAAsE;AACtE,MAAM,aAAa,GAAG,SAAS,CAAC;AAChC,MAAM,CAAC,MAAM,SAAS,GAAG;IACrB,YAAY,EAAE,mCAAmC;IACjD,mBAAmB,EAAE,mCAAmC;IACxD,SAAS,EAAE,SAAS;IACpB,iBAAiB,EAAE,SAAS;IAC5B,gBAAgB,EAAE,aAAa;IAC/B,wBAAwB,EAAE,SAAS;IACnC,kBAAkB,EAAE,aAAa,GAAG,IAAI;IACxC,WAAW,EAAE,SAAS;IACtB,UAAU,EAAE,SAAS;IACrB,WAAW,EAAE,SAAS;IACtB,OAAO,EAAE,SAAS;IAClB,QAAQ,EAAE,SAAS;IACnB,WAAW,EAAE,SAAS;IACtB,gBAAgB,EAAE,oBAAoB;IACtC,YAAY,EAAE,MAAM;IACpB,qBAAqB,EAAE,OAAO;IAC9B,2BAA2B,EAAE,SAAS;IACtC,YAAY,EAAE,4FAA4F;IAC1G,sBAAsB,EAAE,oBAAoB;CAC/C,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAgB;IACpC,UAAU,EAAE;QACR,MAAM,EAAE;YACJ,QAAQ,EAAE,SAAS,CAAC,WAAW;YAC/B,aAAa,EAAE,EAAE,CAAC,uEAAuE;SAC5F;QACD,IAAI,EAAE;YACF,wBAAwB,EAAE,CAAC;SAC9B;QACD,KAAK,EAAE;YACH,gBAAgB,EAAE,aAAa,CAAC,+CAA+C;SAClF;KACJ;CACJ,CAAC"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { FunctionComponent } from 'react';
|
|
2
|
-
import { DefaultViewSettings, IItemAction, IPrimaryAction } from './_types';
|
|
1
|
+
import { FunctionComponent, ReactNode } from 'react';
|
|
2
|
+
import { DefaultViewSettings, Entrypoint, IItemAction, IPrimaryAction } from './_types';
|
|
3
3
|
interface IExplorerProps {
|
|
4
|
+
entrypoint: Entrypoint;
|
|
4
5
|
noPagination?: true;
|
|
5
|
-
library: string;
|
|
6
6
|
itemActions?: IItemAction[];
|
|
7
7
|
primaryActions?: IPrimaryAction[];
|
|
8
8
|
title?: string;
|
|
9
|
-
|
|
9
|
+
emptyPlaceholder?: ReactNode;
|
|
10
|
+
defaultActionsForItem?: Array<'edit' | 'remove'>;
|
|
10
11
|
defaultPrimaryActions?: Array<'create'>;
|
|
11
12
|
defaultViewSettings?: DefaultViewSettings;
|
|
12
13
|
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { createPortal } from 'react-dom';
|
|
3
3
|
import { KitEmpty, KitSpace, KitTypography } from 'aristid-ds';
|
|
4
4
|
import styled from 'styled-components';
|
|
5
5
|
import { useExplorerData } from './_queries/useExplorerData';
|
|
6
6
|
import { DataView } from './DataView';
|
|
7
|
-
import {
|
|
7
|
+
import { useRemoveAction } from './useRemoveAction';
|
|
8
8
|
import { useEditAction } from './useEditAction';
|
|
9
9
|
import { usePrimaryActionsButton } from './usePrimaryActions';
|
|
10
10
|
import { ExplorerTitle } from './ExplorerTitle';
|
|
11
11
|
import { useCreateAction } from './useCreateAction';
|
|
12
|
-
import { SidePanel, useEditSettings, useOpenViewSettings, ViewSettingsContext
|
|
12
|
+
import { defaultPageSizeOptions, SidePanel, useEditSettings, useOpenViewSettings, ViewSettingsContext } from './manage-view-settings';
|
|
13
13
|
import { useSearchInput } from './useSearchInput';
|
|
14
14
|
import { usePagination } from './usePagination';
|
|
15
15
|
import { Loading } from '../Loading';
|
|
@@ -24,6 +24,7 @@ const ExplorerHeaderDivStyled = styled.div `
|
|
|
24
24
|
justify-content: space-between;
|
|
25
25
|
align-items: center;
|
|
26
26
|
padding-bottom: calc(var(--general-spacing-xs) * 1px);
|
|
27
|
+
padding-right: calc(var(--general-spacing-xxs) * 1px);
|
|
27
28
|
`;
|
|
28
29
|
const ExplorerPageDivStyled = styled.div `
|
|
29
30
|
display: flex;
|
|
@@ -31,13 +32,14 @@ const ExplorerPageDivStyled = styled.div `
|
|
|
31
32
|
height: 100%;
|
|
32
33
|
overflow: hidden;
|
|
33
34
|
`;
|
|
34
|
-
export const Explorer = ({
|
|
35
|
+
export const Explorer = ({ entrypoint, noPagination, itemActions, primaryActions, title, emptyPlaceholder, defaultActionsForItem = ['edit', 'remove'], defaultPrimaryActions = ['create'], defaultViewSettings }) => {
|
|
35
36
|
const { t } = useSharedTranslation();
|
|
36
37
|
const { panelElement } = useEditSettings();
|
|
37
|
-
const { loading: viewSettingsLoading, view, dispatch } = useViewSettingsReducer(defaultViewSettings);
|
|
38
|
+
const { loading: viewSettingsLoading, view, dispatch } = useViewSettingsReducer(entrypoint, defaultViewSettings);
|
|
38
39
|
const { currentPage, setNewPageSize, setNewPage } = usePagination(dispatch);
|
|
39
|
-
const { data, loading, refetch } = useExplorerData({
|
|
40
|
-
|
|
40
|
+
const { data, loading: loadingData, refetch } = useExplorerData({
|
|
41
|
+
entrypoint,
|
|
42
|
+
libraryId: view.libraryId,
|
|
41
43
|
attributeIds: view.attributesIds,
|
|
42
44
|
fulltextSearch: view.fulltextSearch,
|
|
43
45
|
pagination: noPagination ? null : { limit: view.pageSize, offset: view.pageSize * (currentPage - 1) },
|
|
@@ -45,28 +47,32 @@ export const Explorer = ({ library, itemActions, primaryActions, title, noPagina
|
|
|
45
47
|
filters: view.filters,
|
|
46
48
|
skip: viewSettingsLoading
|
|
47
49
|
}); // TODO: refresh when go back on page
|
|
48
|
-
const {
|
|
49
|
-
isEnabled: isNotEmpty(defaultActionsForItem) && defaultActionsForItem.includes('
|
|
50
|
-
});
|
|
50
|
+
const { removeAction } = useRemoveAction({
|
|
51
|
+
isEnabled: isNotEmpty(defaultActionsForItem) && defaultActionsForItem.includes('remove')
|
|
52
|
+
}, entrypoint);
|
|
51
53
|
const { editAction, editModal } = useEditAction({
|
|
52
54
|
isEnabled: isNotEmpty(defaultActionsForItem) && defaultActionsForItem.includes('edit')
|
|
53
55
|
});
|
|
54
56
|
const { createAction, createModal } = useCreateAction({
|
|
55
57
|
isEnabled: isNotEmpty(defaultPrimaryActions) && defaultPrimaryActions.includes('create'),
|
|
56
|
-
library,
|
|
58
|
+
library: view.libraryId,
|
|
59
|
+
entrypoint: view.entrypoint,
|
|
60
|
+
itemsCount: data?.totalCount ?? 0,
|
|
57
61
|
refetch
|
|
58
62
|
});
|
|
59
63
|
const { primaryButton } = usePrimaryActionsButton([createAction, ...(primaryActions ?? [])].filter(Boolean));
|
|
60
|
-
const { viewSettingsButton } = useOpenViewSettings(
|
|
64
|
+
const { viewSettingsButton } = useOpenViewSettings(view.libraryId);
|
|
61
65
|
const { searchInput } = useSearchInput({ view, dispatch });
|
|
62
66
|
const hasNoResults = data === null || data.totalCount === 0;
|
|
63
|
-
return (_jsxs(ViewSettingsContext.Provider, { value: { view, dispatch }, children: [_jsxs(ExplorerPageDivStyled, { children: [_jsxs(ExplorerHeaderDivStyled, { children: [_jsx(KitTypography.Title, { level: "h1", children: _jsx(ExplorerTitle, { library:
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
67
|
+
return (_jsxs(ViewSettingsContext.Provider, { value: { view, dispatch }, children: [_jsxs(ExplorerPageDivStyled, { children: [_jsxs(ExplorerHeaderDivStyled, { children: [_jsx(KitTypography.Title, { level: "h1", children: !viewSettingsLoading && (_jsx(ExplorerTitle, { library: view.libraryId, title: title, entrypoint: entrypoint })) /*TODO: manage loading*/ }), _jsxs(KitSpace, { size: "xs", children: [searchInput, viewSettingsButton, primaryButton] })] }), !viewSettingsLoading && _jsx(ExplorerToolBar, { libraryId: view.libraryId }), loadingData || viewSettingsLoading ? (_jsx(Loading, {})) : hasNoResults ? (_jsx(_Fragment, { children: emptyPlaceholder || _jsx(KitEmpty, { title: t('explorer.empty-data') }) })) : (_jsx(DataView, { dataGroupedFilteredSorted: data?.records ?? emptyArray, attributesProperties: data?.attributes ?? emptyObject, attributesToDisplay: ['whoAmI', ...view.attributesIds], paginationProps: entrypoint.type === 'library'
|
|
68
|
+
? {
|
|
69
|
+
pageSizeOptions: defaultPageSizeOptions,
|
|
70
|
+
currentPage,
|
|
71
|
+
pageSize: view.pageSize,
|
|
72
|
+
setNewPageSize,
|
|
73
|
+
setNewPage,
|
|
74
|
+
totalItems: data?.totalCount ?? 0
|
|
75
|
+
}
|
|
76
|
+
: undefined, itemActions: [editAction, removeAction, ...(itemActions ?? emptyArray)].filter(Boolean) }))] }), panelElement && createPortal(_jsx(SidePanel, {}), panelElement), editModal, createModal] }));
|
|
71
77
|
};
|
|
72
78
|
//# sourceMappingURL=Explorer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Explorer.js","sourceRoot":"","sources":["../../../src/components/Explorer/Explorer.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAC,YAAY,EAAC,MAAM,WAAW,CAAC;AACvC,OAAO,EAAC,QAAQ,EAAE,QAAQ,EAAE,aAAa,EAAC,MAAM,YAAY,CAAC;AAC7D,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,EAAC,eAAe,EAAC,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AACp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,CAAC,CAAC"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { FunctionComponent } from 'react';
|
|
2
|
+
import { Entrypoint } from './_types';
|
|
2
3
|
interface IExplorerTitleProps {
|
|
3
4
|
title?: string;
|
|
4
5
|
library: string;
|
|
6
|
+
entrypoint: Entrypoint;
|
|
5
7
|
}
|
|
6
8
|
export declare const ExplorerTitle: FunctionComponent<IExplorerTitleProps>;
|
|
7
9
|
export {};
|
|
@@ -3,28 +3,45 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
3
3
|
// This file is released under LGPL V3
|
|
4
4
|
// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
|
|
5
5
|
import { localizedTranslation } from '@leav/utils';
|
|
6
|
-
import {
|
|
6
|
+
import { useExplorerLibraryDetailsQuery, useExplorerLinkAttributeQuery } from '../../_gqlTypes';
|
|
7
7
|
import useLang from '../../hooks/useLang';
|
|
8
8
|
import { AntSkeleton } from 'aristid-ds';
|
|
9
9
|
// TODO: use <h1 /> tag
|
|
10
|
-
export const ExplorerTitle = ({ title, library }) => {
|
|
11
|
-
const { data, loading, error } =
|
|
10
|
+
export const ExplorerTitle = ({ title, library, entrypoint }) => {
|
|
11
|
+
const { data, loading, error } = useExplorerLibraryDetailsQuery({ variables: { libraryId: library }, skip: !!title });
|
|
12
|
+
const { data: attributeData, loading: attributeLoading, error: attributeError } = useExplorerLinkAttributeQuery({
|
|
13
|
+
skip: !!title || entrypoint.type !== 'link',
|
|
14
|
+
variables: {
|
|
15
|
+
id: entrypoint.linkAttributeId
|
|
16
|
+
}
|
|
17
|
+
});
|
|
12
18
|
const { lang } = useLang();
|
|
13
19
|
if (title) {
|
|
14
20
|
return _jsx("span", { children: title });
|
|
15
21
|
}
|
|
16
|
-
if (loading) {
|
|
22
|
+
if (loading || attributeLoading) {
|
|
17
23
|
return _jsx(AntSkeleton.Input, { style: { width: 400 }, active: true });
|
|
18
24
|
}
|
|
19
25
|
// TODO: handle error and bad library ID
|
|
20
|
-
if (error) {
|
|
21
|
-
return _jsx("span", { children: error
|
|
26
|
+
if (error || attributeError) {
|
|
27
|
+
return _jsx("span", { children: error?.message ?? attributeError?.message });
|
|
22
28
|
}
|
|
23
|
-
|
|
24
|
-
if (
|
|
25
|
-
|
|
26
|
-
|
|
29
|
+
let label;
|
|
30
|
+
if (entrypoint.type === 'library') {
|
|
31
|
+
const libraryData = data?.libraries?.list[0];
|
|
32
|
+
if (!libraryData) {
|
|
33
|
+
// TODO: make it i18n
|
|
34
|
+
return _jsx("span", { children: "Unknown library" });
|
|
35
|
+
}
|
|
36
|
+
label = libraryData.label;
|
|
27
37
|
}
|
|
28
|
-
|
|
38
|
+
else {
|
|
39
|
+
const linkAttributeData = attributeData?.attributes?.list[0];
|
|
40
|
+
if (!linkAttributeData) {
|
|
41
|
+
return _jsx("span", { children: "Unknown link attribute" });
|
|
42
|
+
}
|
|
43
|
+
label = 'label' in linkAttributeData ? linkAttributeData.label : null;
|
|
44
|
+
}
|
|
45
|
+
return _jsx("span", { children: localizedTranslation(label, lang) });
|
|
29
46
|
};
|
|
30
47
|
//# sourceMappingURL=ExplorerTitle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExplorerTitle.js","sourceRoot":"","sources":["../../../src/components/Explorer/ExplorerTitle.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,oBAAoB,EAAC,MAAM,aAAa,CAAC;AACjD,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"ExplorerTitle.js","sourceRoot":"","sources":["../../../src/components/Explorer/ExplorerTitle.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,oBAAoB,EAAC,MAAM,aAAa,CAAC;AACjD,OAAO,EAAC,8BAA8B,EAAE,6BAA6B,EAAC,MAAM,eAAe,CAAC;AAC5F,OAAO,OAAO,MAAM,mBAA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AAW,EAAE,CAAC;YACf,qBAAqB;YACrB,OAAO,6CAA4B,CAAC;QACxC,CAAC;QAED,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC;IAC9B,CAAC;SAAM,CAAC;QACJ,MAAM,iBAAiB,GAAG,aAAa,EAAE,UAAU,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;QAE7D,IAAI,CAAC,iBAAiB,EAAE,CAAC;YACrB,OAAO,oDAAmC,CAAC;QAC/C,CAAC;QAED,KAAK,GAAG,OAAO,IAAI,iBAAiB,CAAC,CAAC,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;IAC1E,CAAC;IAED,OAAO,yBAAO,oBAAoB,CAAC,KAAK,EAAE,IAAI,CAAC,GAAQ,CAAC;AAC5D,CAAC,CAAC"}
|
|
@@ -11,6 +11,7 @@ import { KitAvatar, KitSpace, KitTag, KitTypography } from 'aristid-ds';
|
|
|
11
11
|
import styled from 'styled-components';
|
|
12
12
|
import { IdCard } from './IdCard';
|
|
13
13
|
import { multiColorTagAvatarClassName, TableTagGroup } from './TableTagGroup';
|
|
14
|
+
import { ColorFactory } from 'antd/lib/color-picker/color';
|
|
14
15
|
const isStandardValue = (v, attribute) => [AttributeType.simple, AttributeType.advanced].includes(attribute.type);
|
|
15
16
|
const isStandardValues = (values, attribute) => values.every(value => isStandardValue(value, attribute));
|
|
16
17
|
const isLinkValue = (v, attribute) => [AttributeType.simple_link, AttributeType.advanced_link].includes(attribute.type);
|
|
@@ -42,6 +43,14 @@ export const TableCell = ({ values, attributeProperties }) => {
|
|
|
42
43
|
}
|
|
43
44
|
return (_jsxs(KitSpace, { size: "xxs", children: [_jsx(StyledFaCalendar, {}), value.from, " ", _jsx(FaArrowRight, {}), " ", value.to] }));
|
|
44
45
|
}, []);
|
|
46
|
+
const _getFirstValue = useCallback((value, attribute) => {
|
|
47
|
+
if (isStandardValue(value, attribute) && attribute.format === AttributeFormat.boolean) {
|
|
48
|
+
if (!value || value.valuePayload === null) {
|
|
49
|
+
return { valuePayload: false };
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return value;
|
|
53
|
+
}, []);
|
|
45
54
|
if (attributeProperties.multiple_values) {
|
|
46
55
|
if (isStandardValues(values, attributeProperties)) {
|
|
47
56
|
const tags = values.map(value => {
|
|
@@ -54,12 +63,12 @@ export const TableCell = ({ values, attributeProperties }) => {
|
|
|
54
63
|
type: value.valuePayload ? 'primary' : 'neutral'
|
|
55
64
|
};
|
|
56
65
|
case AttributeFormat.color:
|
|
57
|
-
const
|
|
66
|
+
const color = new ColorFactory(value.valueRawPayload);
|
|
58
67
|
return {
|
|
59
68
|
idCardProps: {
|
|
60
|
-
description:
|
|
69
|
+
description: value.valuePayload,
|
|
61
70
|
avatarProps: {
|
|
62
|
-
color:
|
|
71
|
+
color: color.toHexString(),
|
|
63
72
|
shape: 'square',
|
|
64
73
|
className: multiColorTagAvatarClassName
|
|
65
74
|
}
|
|
@@ -98,7 +107,7 @@ export const TableCell = ({ values, attributeProperties }) => {
|
|
|
98
107
|
}
|
|
99
108
|
}
|
|
100
109
|
else {
|
|
101
|
-
const value = values[0]; // Not multiple_values attribute should not have more than one value
|
|
110
|
+
const value = _getFirstValue(values[0], attributeProperties); // Not multiple_values attribute should not have more than one value
|
|
102
111
|
if (!value) {
|
|
103
112
|
return null;
|
|
104
113
|
}
|
|
@@ -119,8 +128,8 @@ export const TableCell = ({ values, attributeProperties }) => {
|
|
|
119
128
|
content = (_jsxs(_Fragment, { children: [_jsx(StyledFaListAlt, {}), _jsx(KitTypography.Text, { ellipsis: { tooltip: textContent }, children: textContent }, attributeProperties.id)] }));
|
|
120
129
|
break;
|
|
121
130
|
case AttributeFormat.color:
|
|
122
|
-
const
|
|
123
|
-
content = (_jsxs(_Fragment, { children: [_jsx(StyledColorChip, { "$colorTextContent":
|
|
131
|
+
const color = new ColorFactory(value.valueRawPayload);
|
|
132
|
+
content = (_jsxs(_Fragment, { children: [_jsx(StyledColorChip, { "$colorTextContent": color.toHexString() }), _jsx(KitTypography.Text, { ellipsis: { tooltip: value.valuePayload }, children: value.valuePayload }, attributeProperties.id)] }));
|
|
124
133
|
break;
|
|
125
134
|
case AttributeFormat.date_range:
|
|
126
135
|
content = _getDateRangeValueContent(value.valuePayload);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableCell.js","sourceRoot":"","sources":["../../../src/components/Explorer/TableCell.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAA+B,WAAW,EAAC,MAAM,OAAO,CAAC;AAChE,OAAO,EACH,eAAe,EAEf,aAAa,EAKhB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAC,YAAY,EAAE,UAAU,EAAE,SAAS,EAAC,MAAM,gBAAgB,CAAC;AACnE,OAAO,SAAS,MAAM,WAAW,CAAC;AAClC,OAAO,EAAC,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,aAAa,EAAC,MAAM,YAAY,CAAC;AAEtE,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAC,MAAM,EAAC,MAAM,UAAU,CAAC;AAChC,OAAO,EAAC,4BAA4B,EAAE,aAAa,EAAC,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"TableCell.js","sourceRoot":"","sources":["../../../src/components/Explorer/TableCell.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAA+B,WAAW,EAAC,MAAM,OAAO,CAAC;AAChE,OAAO,EACH,eAAe,EAEf,aAAa,EAKhB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAC,YAAY,EAAE,UAAU,EAAE,SAAS,EAAC,MAAM,gBAAgB,CAAC;AACnE,OAAO,SAAS,M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;gBACV,KAAK,eAAe,CAAC,UAAU;oBAC3B,OAAO,GAAG,yBAAyB,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;oBACxD,MAAM;gBACV;oBACI,MAAM,YAAY,GACd,mBAAmB,CAAC,MAAM,KAAK,eAAe,CAAC,SAAS,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC;oBACnG,OAAO,GAAG,CACN,KAAC,aAAa,CAAC,IAAI,IAA8B,QAAQ,EAAE,EAAC,OAAO,EAAE,YAAY,EAAC,YAC7E,YAAY,IADQ,mBAAmB,CAAC,EAAE,CAE1B,CACxB,CAAC;oBACF,MAAM;YACd,CAAC;QACL,CAAC;QAED,IAAI,WAAW,CAAC,KAAK,EAAE,mBAAmB,CAAC,EAAE,CAAC;YAC1C,OAAO,GAAG,KAAK,CAAC,WAAW,EAAE,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC;QACjD,CAAC;QAED,IAAI,WAAW,CAAC,KAAK,EAAE,mBAAmB,CAAC,EAAE,CAAC;YAC1C,OAAO,GAAG,KAAK,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC,CAAC,CAClC,KAAC,MAAM,IAA8B,IAAI,EAAE,KAAK,CAAC,WAAW,EAAE,MAAM,IAAvD,mBAAmB,CAAC,EAAE,CAAqC,CAC3E,CAAC,CAAC,CAAC,IAAI,CAAC;QACb,CAAC;QAED,OAAO,KAAC,sBAAsB,cAAE,OAAO,GAA0B,CAAC;IACtE,CAAC;AACL,CAAC,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ViewTypes } from '../../_gqlTypes';
|
|
2
|
+
import { ViewType } from './manage-view-settings/store-view-settings/viewSettingsReducer';
|
|
3
|
+
export declare const mapViewTypeFromExplorerToLegacy: Record<ViewType, ViewTypes>;
|
|
4
|
+
export declare const mapViewTypeFromLegacyToExplorer: Record<ViewTypes, ViewType>;
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
+
import { ViewTypes } from '../../_gqlTypes';
|
|
5
|
+
//TODO: this mapping is here for backward compatibility. When the old explorer is removed, we should updates types on the backend and remove this mapping
|
|
6
|
+
export const mapViewTypeFromExplorerToLegacy = {
|
|
7
|
+
table: ViewTypes.list,
|
|
8
|
+
mosaic: ViewTypes.cards,
|
|
9
|
+
timeline: ViewTypes.timeline,
|
|
10
|
+
list: ViewTypes.list
|
|
11
|
+
};
|
|
12
|
+
export const mapViewTypeFromLegacyToExplorer = {
|
|
13
|
+
[ViewTypes.list]: 'table',
|
|
14
|
+
[ViewTypes.cards]: 'mosaic',
|
|
15
|
+
[ViewTypes.timeline]: 'timeline'
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=_constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_constants.js","sourceRoot":"","sources":["../../../src/components/Explorer/_constants.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,SAAS,EAAC,MAAM,eAAe,CAAC;AAGxC,yJAAyJ;AACzJ,MAAM,CAAC,MAAM,+BAA+B,GAAgC;IACxE,KAAK,EAAE,SAAS,CAAC,IAAI;IACrB,MAAM,EAAE,SAAS,CAAC,KAAK;IACvB,QAAQ,EAAE,SAAS,CAAC,QAAQ;IAC5B,IAAI,EAAE,SAAS,CAAC,IAAI;CACvB,CAAC;AAEF,MAAM,CAAC,MAAM,+BAA+B,GAAgC;IACxE,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,OAAO;IACzB,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,QAAQ;IAC3B,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,UAAU;CACnC,CAAC"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { IExplorerData, IExplorerFilter } from '../_types';
|
|
2
|
-
import {
|
|
1
|
+
import { Entrypoint, IExplorerData, IExplorerFilter } from '../_types';
|
|
2
|
+
import { ExplorerLibraryDataQuery, ExplorerLinkDataQuery, RecordFilterInput, SortOrder } from '../../../_gqlTypes';
|
|
3
3
|
export declare const dateValuesSeparator = "\n";
|
|
4
|
-
export declare const useExplorerData: ({ libraryId, attributeIds, fulltextSearch, sorts, pagination, filters, skip }: {
|
|
4
|
+
export declare const useExplorerData: ({ entrypoint, libraryId, attributeIds, fulltextSearch, sorts, pagination, filters, skip }: {
|
|
5
|
+
entrypoint: Entrypoint;
|
|
5
6
|
libraryId: string;
|
|
6
7
|
attributeIds: string[];
|
|
7
8
|
fulltextSearch: string;
|
|
8
9
|
sorts: Array<{
|
|
9
|
-
|
|
10
|
+
field: string;
|
|
10
11
|
order: SortOrder;
|
|
11
12
|
}>;
|
|
12
13
|
pagination: null | {
|
|
@@ -18,12 +19,17 @@ export declare const useExplorerData: ({ libraryId, attributeIds, fulltextSearch
|
|
|
18
19
|
}) => {
|
|
19
20
|
data: IExplorerData;
|
|
20
21
|
loading: boolean;
|
|
21
|
-
refetch: (variables?: Partial<import("../../../_gqlTypes").Exact<{
|
|
22
|
+
refetch: ((variables?: Partial<import("../../../_gqlTypes").Exact<{
|
|
22
23
|
libraryId: import("../../../_gqlTypes").Scalars["ID"];
|
|
23
24
|
attributeIds: Array<import("../../../_gqlTypes").Scalars["ID"]> | import("../../../_gqlTypes").Scalars["ID"];
|
|
24
25
|
pagination?: import("../../../_gqlTypes").InputMaybe<import("../../../_gqlTypes").RecordsPagination>;
|
|
25
26
|
filters?: import("../../../_gqlTypes").InputMaybe<Array<import("../../../_gqlTypes").InputMaybe<RecordFilterInput>> | import("../../../_gqlTypes").InputMaybe<RecordFilterInput>>;
|
|
26
27
|
multipleSort?: import("../../../_gqlTypes").InputMaybe<Array<import("../../../_gqlTypes").RecordSortInput> | import("../../../_gqlTypes").RecordSortInput>;
|
|
27
28
|
searchQuery?: import("../../../_gqlTypes").InputMaybe<import("../../../_gqlTypes").Scalars["String"]>;
|
|
28
|
-
}>>) => Promise<import("@apollo/client").ApolloQueryResult<
|
|
29
|
+
}>>) => Promise<import("@apollo/client").ApolloQueryResult<ExplorerLibraryDataQuery>>) | ((variables?: Partial<import("../../../_gqlTypes").Exact<{
|
|
30
|
+
attributeIds: Array<import("../../../_gqlTypes").Scalars["ID"]> | import("../../../_gqlTypes").Scalars["ID"];
|
|
31
|
+
parentLibraryId: import("../../../_gqlTypes").Scalars["ID"];
|
|
32
|
+
parentRecordId?: import("../../../_gqlTypes").InputMaybe<import("../../../_gqlTypes").Scalars["String"]>;
|
|
33
|
+
linkAttributeId: import("../../../_gqlTypes").Scalars["ID"];
|
|
34
|
+
}>>) => Promise<import("@apollo/client").ApolloQueryResult<ExplorerLinkDataQuery>>);
|
|
29
35
|
};
|
|
@@ -2,14 +2,15 @@
|
|
|
2
2
|
// This file is released under LGPL V3
|
|
3
3
|
// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
|
|
4
4
|
import { localizedTranslation } from '@leav/utils';
|
|
5
|
-
import { AttributeFormat, RecordFilterCondition, RecordFilterOperator,
|
|
5
|
+
import { AttributeFormat, RecordFilterCondition, RecordFilterOperator, useExplorerLibraryDataQuery, useExplorerLinkDataQuery } from '../../../_gqlTypes';
|
|
6
6
|
import { useLang } from '../../../hooks';
|
|
7
7
|
import { useMemo } from 'react';
|
|
8
8
|
import { interleaveElement } from '../../../_utils/interleaveElement';
|
|
9
9
|
import dayjs from 'dayjs';
|
|
10
|
-
import { nullValueConditions } from '../
|
|
10
|
+
import { nullValueConditions } from '../conditionsHelper';
|
|
11
|
+
import { AttributeConditionFilter } from '../../../types';
|
|
11
12
|
export const dateValuesSeparator = '\n';
|
|
12
|
-
const
|
|
13
|
+
const _mappingLibrary = (data, libraryId, availableLangs) => {
|
|
13
14
|
const attributes = data.records.list.length
|
|
14
15
|
? data.records.list[0].properties.reduce((acc, property) => {
|
|
15
16
|
acc[property.attributeId] = {
|
|
@@ -38,6 +39,43 @@ const _mapping = (data, libraryId, availableLangs) => {
|
|
|
38
39
|
records
|
|
39
40
|
};
|
|
40
41
|
};
|
|
42
|
+
const _mappingLink = (data, libraryId, availableLangs) => {
|
|
43
|
+
const attributes = data.records.list.length
|
|
44
|
+
? (data.records.list[0].property[0]?.payload?.properties ?? []).reduce((acc, property) => {
|
|
45
|
+
acc[property.attributeId] = {
|
|
46
|
+
...property.attributeProperties,
|
|
47
|
+
label: localizedTranslation(property.attributeProperties.label, availableLangs)
|
|
48
|
+
};
|
|
49
|
+
return acc;
|
|
50
|
+
}, {})
|
|
51
|
+
: {};
|
|
52
|
+
const records = data.records.list[0].property
|
|
53
|
+
.map((linkValue) => {
|
|
54
|
+
if (!linkValue.payload) {
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
return {
|
|
58
|
+
libraryId,
|
|
59
|
+
key: linkValue.payload.whoAmI.id, // For <KitTable /> only
|
|
60
|
+
itemId: linkValue.payload.whoAmI.id, // For <KitTable /> only
|
|
61
|
+
whoAmI: {
|
|
62
|
+
label: null,
|
|
63
|
+
subLabel: null,
|
|
64
|
+
color: null,
|
|
65
|
+
preview: null,
|
|
66
|
+
...linkValue.payload.whoAmI
|
|
67
|
+
},
|
|
68
|
+
propertiesById: linkValue.payload.properties.reduce((acc, { attributeId, values }) => ({ ...acc, [attributeId]: values }), {}),
|
|
69
|
+
id_value: linkValue.id_value
|
|
70
|
+
};
|
|
71
|
+
})
|
|
72
|
+
.filter(Boolean);
|
|
73
|
+
return {
|
|
74
|
+
totalCount: records.length,
|
|
75
|
+
attributes,
|
|
76
|
+
records
|
|
77
|
+
};
|
|
78
|
+
};
|
|
41
79
|
const _getDateRequestFilters = ({ field, condition, value }) => {
|
|
42
80
|
switch (condition) {
|
|
43
81
|
case RecordFilterCondition.BETWEEN:
|
|
@@ -64,6 +102,12 @@ const _getDateRequestFilters = ({ field, condition, value }) => {
|
|
|
64
102
|
field,
|
|
65
103
|
condition: RecordFilterCondition.GREATER_THAN,
|
|
66
104
|
value: dayjs.unix(Number(value)).endOf('day').unix().toString()
|
|
105
|
+
},
|
|
106
|
+
{ operator: RecordFilterOperator.OR },
|
|
107
|
+
{
|
|
108
|
+
field,
|
|
109
|
+
condition: RecordFilterCondition.IS_EMPTY,
|
|
110
|
+
value: null
|
|
67
111
|
}
|
|
68
112
|
];
|
|
69
113
|
case RecordFilterCondition.EQUAL:
|
|
@@ -87,38 +131,73 @@ const _getDateRequestFilters = ({ field, condition, value }) => {
|
|
|
87
131
|
];
|
|
88
132
|
}
|
|
89
133
|
};
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
.filter(({ value, condition }) => value !== null || nullValueConditions.includes(condition))
|
|
94
|
-
.map(({ attribute, field, condition, value }) => attribute.format === AttributeFormat.date
|
|
95
|
-
? _getDateRequestFilters({ field, condition, value })
|
|
96
|
-
: [
|
|
134
|
+
const _getBooleanRequestFilters = ({ field, condition, value }) => {
|
|
135
|
+
if (value === 'false') {
|
|
136
|
+
return [
|
|
97
137
|
{
|
|
98
138
|
field,
|
|
99
|
-
condition,
|
|
100
|
-
value
|
|
139
|
+
condition: AttributeConditionFilter.NOT_EQUAL,
|
|
140
|
+
value: 'true'
|
|
101
141
|
}
|
|
102
|
-
]
|
|
103
|
-
|
|
104
|
-
|
|
142
|
+
];
|
|
143
|
+
}
|
|
144
|
+
return [{ field, condition, value }];
|
|
145
|
+
};
|
|
146
|
+
export const useExplorerData = ({ entrypoint, libraryId, attributeIds, fulltextSearch, sorts, pagination, filters, skip }) => {
|
|
147
|
+
const { lang: availableLangs } = useLang();
|
|
148
|
+
const queryFilters = interleaveElement({ operator: RecordFilterOperator.AND }, filters
|
|
149
|
+
.filter(({ value, condition }) => value !== null || nullValueConditions.includes(condition))
|
|
150
|
+
.map(({ attribute, field, condition, value }) => {
|
|
151
|
+
switch (attribute.format) {
|
|
152
|
+
case AttributeFormat.date:
|
|
153
|
+
return _getDateRequestFilters({ field, condition, value });
|
|
154
|
+
case AttributeFormat.boolean:
|
|
155
|
+
return _getBooleanRequestFilters({ field, condition, value });
|
|
156
|
+
default:
|
|
157
|
+
return [
|
|
158
|
+
{
|
|
159
|
+
field,
|
|
160
|
+
condition,
|
|
161
|
+
value
|
|
162
|
+
}
|
|
163
|
+
];
|
|
164
|
+
}
|
|
165
|
+
}));
|
|
166
|
+
const isLibrary = entrypoint.type === 'library';
|
|
167
|
+
const isLink = entrypoint.type === 'link';
|
|
168
|
+
const { data: linkData, loading: linkLoading, refetch: linkRefetch } = useExplorerLinkDataQuery({
|
|
169
|
+
skip: skip || !isLink,
|
|
170
|
+
variables: {
|
|
171
|
+
parentLibraryId: entrypoint.parentLibraryId,
|
|
172
|
+
parentRecordId: entrypoint.parentRecordId,
|
|
173
|
+
linkAttributeId: entrypoint.linkAttributeId,
|
|
174
|
+
attributeIds
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
const { data: libraryData, loading: libraryLoading, refetch: libraryRefetch } = useExplorerLibraryDataQuery({
|
|
178
|
+
skip: skip || !isLibrary,
|
|
105
179
|
variables: {
|
|
106
180
|
libraryId,
|
|
107
181
|
attributeIds,
|
|
108
182
|
pagination,
|
|
109
183
|
searchQuery: fulltextSearch,
|
|
110
|
-
multipleSort: sorts
|
|
111
|
-
field: attributeId,
|
|
112
|
-
order
|
|
113
|
-
})),
|
|
184
|
+
multipleSort: sorts,
|
|
114
185
|
filters: queryFilters
|
|
115
186
|
}
|
|
116
187
|
});
|
|
117
|
-
const memoizedData = useMemo(() =>
|
|
188
|
+
const memoizedData = useMemo(() => {
|
|
189
|
+
if (isLibrary) {
|
|
190
|
+
return libraryData ? _mappingLibrary(libraryData, libraryId, availableLangs) : null;
|
|
191
|
+
}
|
|
192
|
+
if (isLink) {
|
|
193
|
+
return linkData ? _mappingLink(linkData, libraryId, availableLangs) : null;
|
|
194
|
+
}
|
|
195
|
+
return null;
|
|
196
|
+
}, [libraryData, linkData]);
|
|
118
197
|
return {
|
|
119
198
|
data: memoizedData,
|
|
120
|
-
loading,
|
|
121
|
-
refetch
|
|
199
|
+
loading: isLibrary ? libraryLoading : linkLoading,
|
|
200
|
+
refetch: isLibrary ? libraryRefetch : linkRefetch
|
|
122
201
|
};
|
|
123
202
|
};
|
|
124
203
|
//# sourceMappingURL=useExplorerData.js.map
|