@leav/ui 0.3.6-962a6fb → 0.3.6-997b2e0

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.
Files changed (188) hide show
  1. package/dist/_gqlTypes/index.d.ts +42 -5
  2. package/dist/_gqlTypes/index.js +37 -3
  3. package/dist/_gqlTypes/index.js.map +1 -1
  4. package/dist/_utils/index.js +1 -1
  5. package/dist/_utils/index.js.map +1 -1
  6. package/dist/components/CreateDirectory/CreateDirectory.js +0 -2
  7. package/dist/components/CreateDirectory/CreateDirectory.js.map +1 -1
  8. package/dist/components/EditApplication/EditApplicationInfo/EditApplicationInfoForm/EditApplicationInfoForm.js.map +1 -1
  9. package/dist/components/EditTreeModal/EditTree/EditTreeInfo/EditTreeInfoForm/EditTreeInfoForm.d.ts +1 -1
  10. package/dist/components/EditTreeModal/EditTree/EditTreeInfo/EditTreeInfoForm/EditTreeInfoForm.js.map +1 -1
  11. package/dist/components/Explorer/DataView.d.ts +5 -3
  12. package/dist/components/Explorer/DataView.js +9 -5
  13. package/dist/components/Explorer/DataView.js.map +1 -1
  14. package/dist/components/Explorer/Explorer.d.ts +29 -2
  15. package/dist/components/Explorer/Explorer.js +52 -19
  16. package/dist/components/Explorer/Explorer.js.map +1 -1
  17. package/dist/components/Explorer/ExplorerToolbar.d.ts +2 -0
  18. package/dist/components/Explorer/ExplorerToolbar.js +10 -6
  19. package/dist/components/Explorer/ExplorerToolbar.js.map +1 -1
  20. package/dist/components/Explorer/TableCell.js +4 -4
  21. package/dist/components/Explorer/TableCell.js.map +1 -1
  22. package/dist/components/Explorer/_queries/useExplorerData.d.ts +1 -0
  23. package/dist/components/Explorer/_queries/useExplorerData.js +9 -1
  24. package/dist/components/Explorer/_queries/useExplorerData.js.map +1 -1
  25. package/dist/components/Explorer/_types.d.ts +24 -4
  26. package/dist/components/Explorer/_types.js.map +1 -1
  27. package/dist/components/Explorer/actions-item/useEditItemAction.d.ts +4 -2
  28. package/dist/components/Explorer/actions-item/useEditItemAction.js +2 -1
  29. package/dist/components/Explorer/actions-item/useEditItemAction.js.map +1 -1
  30. package/dist/components/Explorer/actions-item/useRemoveItemAction.d.ts +3 -2
  31. package/dist/components/Explorer/actions-item/useRemoveItemAction.js +9 -5
  32. package/dist/components/Explorer/actions-item/useRemoveItemAction.js.map +1 -1
  33. package/dist/components/Explorer/actions-mass/useDeactivateMassAction.d.ts +3 -2
  34. package/dist/components/Explorer/actions-mass/useDeactivateMassAction.js +2 -1
  35. package/dist/components/Explorer/actions-mass/useDeactivateMassAction.js.map +1 -1
  36. package/dist/components/Explorer/actions-mass/useDeleteLinkValues.d.ts +19 -0
  37. package/dist/components/Explorer/actions-mass/useDeleteLinkValues.js +85 -0
  38. package/dist/components/Explorer/actions-mass/useDeleteLinkValues.js.map +1 -0
  39. package/dist/components/Explorer/actions-mass/useMassActions.d.ts +1 -2
  40. package/dist/components/Explorer/actions-mass/useMassActions.js +2 -2
  41. package/dist/components/Explorer/actions-mass/useMassActions.js.map +1 -1
  42. package/dist/components/Explorer/actions-primary/useCreatePrimaryAction.d.ts +5 -3
  43. package/dist/components/Explorer/actions-primary/useCreatePrimaryAction.js +59 -25
  44. package/dist/components/Explorer/actions-primary/useCreatePrimaryAction.js.map +1 -1
  45. package/dist/components/Explorer/actions-primary/useLinkPrimaryAction.d.ts +3 -2
  46. package/dist/components/Explorer/actions-primary/useLinkPrimaryAction.js +2 -2
  47. package/dist/components/Explorer/actions-primary/useLinkPrimaryAction.js.map +1 -1
  48. package/dist/components/Explorer/actions-primary/usePrimaryActions.d.ts +7 -2
  49. package/dist/components/Explorer/actions-primary/usePrimaryActions.js +6 -4
  50. package/dist/components/Explorer/actions-primary/usePrimaryActions.js.map +1 -1
  51. package/dist/components/Explorer/link-item/LinkModal.d.ts +1 -0
  52. package/dist/components/Explorer/link-item/LinkModal.js +13 -3
  53. package/dist/components/Explorer/link-item/LinkModal.js.map +1 -1
  54. package/dist/components/Explorer/link-item/useLinkMassAction.d.ts +5 -2
  55. package/dist/components/Explorer/link-item/useLinkMassAction.js +6 -2
  56. package/dist/components/Explorer/link-item/useLinkMassAction.js.map +1 -1
  57. package/dist/components/Explorer/list-saved-views/SavedViews.d.ts +2 -0
  58. package/dist/components/Explorer/list-saved-views/SavedViews.js +74 -0
  59. package/dist/components/Explorer/list-saved-views/SavedViews.js.map +1 -0
  60. package/dist/components/Explorer/manage-view-settings/_shared/CommonFilterItem.js +8 -1
  61. package/dist/components/Explorer/manage-view-settings/_shared/CommonFilterItem.js.map +1 -1
  62. package/dist/components/Explorer/manage-view-settings/_shared/useTransformFilters.d.ts +17 -0
  63. package/dist/components/Explorer/manage-view-settings/_shared/useTransformFilters.js +93 -0
  64. package/dist/components/Explorer/manage-view-settings/_shared/useTransformFilters.js.map +1 -0
  65. package/dist/components/Explorer/manage-view-settings/configure-display/attributes/SelectVisibleAttributes.js +1 -2
  66. package/dist/components/Explorer/manage-view-settings/configure-display/attributes/SelectVisibleAttributes.js.map +1 -1
  67. package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/BooleanAttributeDropdown.js +2 -2
  68. package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/BooleanAttributeDropdown.js.map +1 -1
  69. package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/ColorAttributeDropDown.js +2 -2
  70. package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/ColorAttributeDropDown.js.map +1 -1
  71. package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/DateAttributeDropDown.js +2 -2
  72. package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/DateAttributeDropDown.js.map +1 -1
  73. package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/DateRangeAttributeDropDown.js +2 -2
  74. package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/DateRangeAttributeDropDown.js.map +1 -1
  75. package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/EncryptedAttributeDropDown.js +2 -2
  76. package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/EncryptedAttributeDropDown.js.map +1 -1
  77. package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/ExtendedAttributeDropDown.js +2 -2
  78. package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/ExtendedAttributeDropDown.js.map +1 -1
  79. package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/FilterDropDown.js +6 -1
  80. package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/FilterDropDown.js.map +1 -1
  81. package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/FilterDropdownContent.d.ts +2 -1
  82. package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/FilterDropdownContent.js +4 -3
  83. package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/FilterDropdownContent.js.map +1 -1
  84. package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/LinkAttributeDropdown.js +3 -3
  85. package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/LinkAttributeDropdown.js.map +1 -1
  86. package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/NumericAttributeDropDown.js +2 -2
  87. package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/NumericAttributeDropDown.js.map +1 -1
  88. package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/TextAttributeDropDown.js +2 -2
  89. package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/TextAttributeDropDown.js.map +1 -1
  90. package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/_types.d.ts +3 -0
  91. package/dist/components/Explorer/manage-view-settings/open-view-settings/EditSettingsContext.d.ts +1 -1
  92. package/dist/components/Explorer/manage-view-settings/open-view-settings/EditSettingsContextProvider.d.ts +1 -0
  93. package/dist/components/Explorer/manage-view-settings/open-view-settings/EditSettingsContextProvider.js.map +1 -1
  94. package/dist/components/Explorer/manage-view-settings/open-view-settings/useOpenViewSettings.d.ts +4 -3
  95. package/dist/components/Explorer/manage-view-settings/open-view-settings/useOpenViewSettings.js +19 -8
  96. package/dist/components/Explorer/manage-view-settings/open-view-settings/useOpenViewSettings.js.map +1 -1
  97. package/dist/components/Explorer/manage-view-settings/router-menu/SettingsPanel.js +7 -16
  98. package/dist/components/Explorer/manage-view-settings/router-menu/SettingsPanel.js.map +1 -1
  99. package/dist/components/Explorer/manage-view-settings/save-view/SaveViewModal.d.ts +1 -0
  100. package/dist/components/Explorer/manage-view-settings/save-view/SaveViewModal.js +11 -9
  101. package/dist/components/Explorer/manage-view-settings/save-view/SaveViewModal.js.map +1 -1
  102. package/dist/components/Explorer/manage-view-settings/save-view/ViewActionsButtons.d.ts +1 -0
  103. package/dist/components/Explorer/manage-view-settings/save-view/ViewActionsButtons.js +22 -0
  104. package/dist/components/Explorer/manage-view-settings/save-view/ViewActionsButtons.js.map +1 -0
  105. package/dist/components/Explorer/manage-view-settings/save-view/prepareViewForRequest.d.ts +3 -0
  106. package/dist/components/Explorer/manage-view-settings/save-view/prepareViewForRequest.js +24 -0
  107. package/dist/components/Explorer/manage-view-settings/save-view/prepareViewForRequest.js.map +1 -0
  108. package/dist/components/Explorer/manage-view-settings/save-view/useCreateNewView.d.ts +3 -0
  109. package/dist/components/Explorer/manage-view-settings/save-view/useCreateNewView.js +52 -0
  110. package/dist/components/Explorer/manage-view-settings/save-view/useCreateNewView.js.map +1 -0
  111. package/dist/components/Explorer/manage-view-settings/save-view/useResetView.d.ts +3 -0
  112. package/dist/components/Explorer/manage-view-settings/save-view/useResetView.js +20 -0
  113. package/dist/components/Explorer/manage-view-settings/save-view/useResetView.js.map +1 -0
  114. package/dist/components/Explorer/manage-view-settings/save-view/useShareView.d.ts +3 -0
  115. package/dist/components/Explorer/manage-view-settings/save-view/useShareView.js +64 -0
  116. package/dist/components/Explorer/manage-view-settings/save-view/useShareView.js.map +1 -0
  117. package/dist/components/Explorer/manage-view-settings/save-view/useUpdateView.d.ts +3 -0
  118. package/dist/components/Explorer/manage-view-settings/save-view/useUpdateView.js +62 -0
  119. package/dist/components/Explorer/manage-view-settings/save-view/useUpdateView.js.map +1 -0
  120. package/dist/components/Explorer/manage-view-settings/sort-items/SortItems.js +7 -9
  121. package/dist/components/Explorer/manage-view-settings/sort-items/SortItems.js.map +1 -1
  122. package/dist/components/Explorer/manage-view-settings/store-view-settings/viewSettingsInitialState.js +10 -0
  123. package/dist/components/Explorer/manage-view-settings/store-view-settings/viewSettingsInitialState.js.map +1 -1
  124. package/dist/components/Explorer/manage-view-settings/store-view-settings/viewSettingsReducer.d.ts +17 -10
  125. package/dist/components/Explorer/manage-view-settings/store-view-settings/viewSettingsReducer.js +59 -18
  126. package/dist/components/Explorer/manage-view-settings/store-view-settings/viewSettingsReducer.js.map +1 -1
  127. package/dist/components/Explorer/useLoadView.d.ts +3 -0
  128. package/dist/components/Explorer/useLoadView.js +81 -0
  129. package/dist/components/Explorer/useLoadView.js.map +1 -0
  130. package/dist/components/Explorer/useSearchInput.js +2 -1
  131. package/dist/components/Explorer/useSearchInput.js.map +1 -1
  132. package/dist/components/Explorer/useViewSettingsReducer.js +26 -112
  133. package/dist/components/Explorer/useViewSettingsReducer.js.map +1 -1
  134. package/dist/components/ImportModal/ImportModalSelectFileStep/ImportModalSelectFileStep.js +1 -2
  135. package/dist/components/ImportModal/ImportModalSelectFileStep/ImportModalSelectFileStep.js.map +1 -1
  136. package/dist/components/LibraryItemsList/DisplayOptions/DisplayOptions.js.map +1 -1
  137. package/dist/components/LibraryItemsList/LibraryItemsListTable/Cell/StandardCell/StandardCell.js +2 -2
  138. package/dist/components/LibraryItemsList/LibraryItemsListTable/Cell/StandardCell/StandardCell.js.map +1 -1
  139. package/dist/components/LibraryItemsList/MenuView/MenuView.js +1 -1
  140. package/dist/components/LibraryItemsList/MenuView/MenuView.js.map +1 -1
  141. package/dist/components/RecordEdition/EditRecord/EditRecord.js +26 -22
  142. package/dist/components/RecordEdition/EditRecord/EditRecord.js.map +1 -1
  143. package/dist/components/RecordEdition/EditRecordContent/EditRecordContent.d.ts +2 -1
  144. package/dist/components/RecordEdition/EditRecordContent/EditRecordContent.js +2 -2
  145. package/dist/components/RecordEdition/EditRecordContent/EditRecordContent.js.map +1 -1
  146. package/dist/components/RecordEdition/EditRecordContent/_types.d.ts +7 -1
  147. package/dist/components/RecordEdition/EditRecordContent/_types.js.map +1 -1
  148. package/dist/components/RecordEdition/EditRecordContent/hooks/useCreateRecordMutation.d.ts +5 -0
  149. package/dist/components/RecordEdition/EditRecordContent/hooks/useCreateRecordMutation.js +28 -0
  150. package/dist/components/RecordEdition/EditRecordContent/hooks/useCreateRecordMutation.js.map +1 -0
  151. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardField.js +7 -2
  152. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardField.js.map +1 -1
  153. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSBooleanWrapper.js.map +1 -1
  154. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSColorPickerWrapper.js +4 -6
  155. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSColorPickerWrapper.js.map +1 -1
  156. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSInputWrapper.js +1 -1
  157. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSInputWrapper.js.map +1 -1
  158. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSRangePickerWrapper.js +1 -2
  159. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSRangePickerWrapper.js.map +1 -1
  160. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSRichTextWrapper.js +1 -1
  161. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSRichTextWrapper.js.map +1 -1
  162. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/useGetPresentationValues.js +2 -1
  163. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/useGetPresentationValues.js.map +1 -1
  164. package/dist/components/RecordEdition/EditRecordSidebar/AttributeSummary/useAttributeInformations.js +1 -1
  165. package/dist/components/RecordEdition/EditRecordSidebar/AttributeSummary/useAttributeInformations.js.map +1 -1
  166. package/dist/components/RecordEdition/EditRecordSidebar/EditRecordSidebar.js +8 -1
  167. package/dist/components/RecordEdition/EditRecordSidebar/EditRecordSidebar.js.map +1 -1
  168. package/dist/components/RecordEdition/EditRecordSidebar/RecordSummary/RecordSummary.d.ts +1 -1
  169. package/dist/components/RecordEdition/EditRecordSidebar/RecordSummary/RecordSummary.js +7 -9
  170. package/dist/components/RecordEdition/EditRecordSidebar/RecordSummary/RecordSummary.js.map +1 -1
  171. package/dist/components/RecordEdition/EditRecordSidebar/ValuesSummary/ValuesSummary.js +29 -14
  172. package/dist/components/RecordEdition/EditRecordSidebar/ValuesSummary/ValuesSummary.js.map +1 -1
  173. package/dist/components/SelectTreeNode/SelectTreeNodeContent.js +2 -1
  174. package/dist/components/SelectTreeNode/SelectTreeNodeContent.js.map +1 -1
  175. package/dist/hooks/useExecuteSaveViewMutation/useExecuteSaveViewMutation.js +2 -1
  176. package/dist/hooks/useExecuteSaveViewMutation/useExecuteSaveViewMutation.js.map +1 -1
  177. package/dist/hooks/useGetRecordValuesQuery/useGetRecordValuesQuery.d.ts +1 -1
  178. package/dist/hooks/useGetRecordValuesQuery/useGetRecordValuesQuery.js +2 -2
  179. package/dist/hooks/useGetRecordValuesQuery/useGetRecordValuesQuery.js.map +1 -1
  180. package/dist/locales/en/shared.json +15 -5
  181. package/dist/locales/fr/shared.json +17 -7
  182. package/package.json +5 -5
  183. package/dist/components/Explorer/manage-view-settings/save-view/useSaveView.d.ts +0 -4
  184. package/dist/components/Explorer/manage-view-settings/save-view/useSaveView.js +0 -17
  185. package/dist/components/Explorer/manage-view-settings/save-view/useSaveView.js.map +0 -1
  186. package/dist/components/Explorer/manage-view-settings/useManageViews.d.ts +0 -3
  187. package/dist/components/Explorer/manage-view-settings/useManageViews.js +0 -48
  188. package/dist/components/Explorer/manage-view-settings/useManageViews.js.map +0 -1
@@ -7,7 +7,7 @@ import { useConditionsOptionsByType } from './useConditionOptionsByType';
7
7
  const InputStyled = styled(KitInput) `
8
8
  width: 100%;
9
9
  `;
10
- export const TextAttributeDropDown = ({ filter, onFilterChange }) => {
10
+ export const TextAttributeDropDown = ({ filter, onFilterChange, selectDropDownRef }) => {
11
11
  const { t } = useSharedTranslation();
12
12
  const { conditionOptionsByType } = useConditionsOptionsByType(filter);
13
13
  const _onConditionChanged = condition => {
@@ -23,6 +23,6 @@ export const TextAttributeDropDown = ({ filter, onFilterChange }) => {
23
23
  };
24
24
  const showSearch = filter.condition !== AttributeConditionFilter.IS_EMPTY &&
25
25
  filter.condition !== AttributeConditionFilter.IS_NOT_EMPTY;
26
- return (_jsxs(_Fragment, { children: [_jsx(KitSelect, { options: conditionOptionsByType, onChange: _onConditionChanged, value: filter.condition, "aria-label": String(t('explorer.filter-condition')) }), showSearch && (_jsx(InputStyled, { placeholder: String(t('explorer.type-a-value')), value: filter.value ?? undefined, onChange: _onInputChanged }))] }));
26
+ return (_jsxs(_Fragment, { children: [_jsx(KitSelect, { options: conditionOptionsByType, onChange: _onConditionChanged, value: filter.condition, getPopupContainer: () => selectDropDownRef?.current ?? document.body, "aria-label": String(t('explorer.filter-condition')) }), showSearch && (_jsx(InputStyled, { placeholder: String(t('explorer.type-a-value')), value: filter.value ?? undefined, onChange: _onInputChanged }))] }));
27
27
  };
28
28
  //# sourceMappingURL=TextAttributeDropDown.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TextAttributeDropDown.js","sourceRoot":"","sources":["../../../../../../src/components/Explorer/manage-view-settings/filter-items/filter-type/TextAttributeDropDown.tsx"],"names":[],"mappings":";AAIA,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAC,QAAQ,EAAE,SAAS,EAAC,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAC,wBAAwB,EAAC,MAAM,WAAW,C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EAAE,sBAAsB,EAC/B,QAAQ,EAAE,mBAAmB,EAC7B,KAAK,EAAE,MAAM,CAAC,SAAS,gBACX,MAAM,CAAC,CAAC,CAAC,2BAA2B,CAAC,CAAC,GACpD,EACD,UAAU,IAAI,CACX,KAAC,WAAW,IACR,WAAW,EAAE,MAAM,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC,EAC/C,KAAK,EAAE,MAAM,CAAC,KAAK,IAAI,SAAS,EAChC,QAAQ,EAAE,eAAe,GAC3B,CACL,IACF,CACN,CAAC;AACN,CAAC,CAAC"}
1
+ {"version":3,"file":"TextAttributeDropDown.js","sourceRoot":"","sources":["../../../../../../src/components/Explorer/manage-view-settings/filter-items/filter-type/TextAttributeDropDown.tsx"],"names":[],"mappings":";AAIA,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAC,QAAQ,EAAE,SAAS,EAAC,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAC,wBAAwB,EAAC,MAAM,WAAW,CAAC;AACnD,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AAEpE,OAAO,EAAC,0BAA0B,EAAC,MAAM,6BAA6B,CAAC;AAEvE,MAAM,WAAW,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAA;;CAEnC,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAoD,CAAC,EACnF,MAAM,EACN,cAAc,EACd,iBAAiB,EACpB,EAAE,EAAE;IACD,MAAM,EAAC,CAAC,EAAC,GAAG,oBAAoB,EAAE,CAAC;IAEnC,MAAM,EAAC,sBAAsB,EAAC,GAAG,0BAA0B,CAAC,MAAM,CAAC,CAAC;IAEpE,MAAM,mBAAmB,GAAiD,SAAS,CAAC,EAAE;QAClF,cAAc,CAAC,EAAC,GAAG,MAAM,EAAE,SAAS,EAAC,CAAC,CAAC;IAC3C,CAAC,CAAC;IAEF,kBAAkB;IAClB,MAAM,eAAe,GAAgD,KAAK,CAAC,EAAE;QACzE,MAAM,uBAAuB,GACzB,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,IAAI,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC;QAC9F,IAAI,uBAAuB,EAAE,CAAC;YAC1B,OAAO;QACX,CAAC;QACD,cAAc,CAAC,EAAC,GAAG,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,EAAC,CAAC,CAAC;IACpG,CAAC,CAAC;IAEF,MAAM,UAAU,GACZ,MAAM,CAAC,SAAS,KAAK,wBAAwB,CAAC,QAAQ;QACtD,MAAM,CAAC,SAAS,KAAK,wBAAwB,CAAC,YAAY,CAAC;IAE/D,OAAO,CACH,8BACI,KAAC,SAAS,IACN,OAAO,EAAE,sBAAsB,EAC/B,QAAQ,EAAE,mBAAmB,EAC7B,KAAK,EAAE,MAAM,CAAC,SAAS,EACvB,iBAAiB,EAAE,GAAG,EAAE,CAAC,iBAAiB,EAAE,OAAO,IAAI,QAAQ,CAAC,IAAI,gBACxD,MAAM,CAAC,CAAC,CAAC,2BAA2B,CAAC,CAAC,GACpD,EACD,UAAU,IAAI,CACX,KAAC,WAAW,IACR,WAAW,EAAE,MAAM,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC,EAC/C,KAAK,EAAE,MAAM,CAAC,KAAK,IAAI,SAAS,EAChC,QAAQ,EAAE,eAAe,GAC3B,CACL,IACF,CACN,CAAC;AACN,CAAC,CAAC"}
@@ -1,10 +1,13 @@
1
+ import { RefObject } from 'react';
1
2
  import { IExplorerFilterStandard, IExplorerFilterLink, IExplorerFilterThrough } from '../../../_types';
2
3
  export interface IFilterChildrenDropDownProps {
3
4
  filter: IExplorerFilterStandard;
4
5
  onFilterChange: (filterData: IExplorerFilterStandard) => void;
6
+ selectDropDownRef?: RefObject<HTMLDivElement>;
5
7
  }
6
8
  export interface IFilterChildrenLinkDropDownProps {
7
9
  filter: IExplorerFilterLink | IExplorerFilterThrough;
8
10
  onFilterChange: (filterData: IExplorerFilterLink | IExplorerFilterThrough) => void;
9
11
  removeThroughCondition: boolean;
12
+ selectDropDownRef?: RefObject<HTMLDivElement>;
10
13
  }
@@ -4,7 +4,7 @@ interface IActiveSettings {
4
4
  title: string;
5
5
  onClickLeftButton?: () => void;
6
6
  }
7
- export type SettingsPanelPages = 'router-menu' | 'configure-display' | 'sort-items' | 'filter-items';
7
+ export type SettingsPanelPages = 'router-menu' | 'configure-display' | 'sort-items' | 'filter-items' | 'my-views';
8
8
  export interface IEditSettingsContext {
9
9
  setActiveSettings: (params: IActiveSettings) => void;
10
10
  activeSettings: null | IActiveSettings;
@@ -2,6 +2,7 @@ import { FunctionComponent } from 'react';
2
2
  import { IEditSettingsContext } from './EditSettingsContext';
3
3
  interface IEditSettingsContextProviderProps {
4
4
  panelElement?: IEditSettingsContext['panelElement'];
5
+ children: React.ReactNode;
5
6
  }
6
7
  export declare const EditSettingsContextProvider: FunctionComponent<IEditSettingsContextProviderProps>;
7
8
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"EditSettingsContextProvider.js","sourceRoot":"","sources":["../../../../../src/components/Explorer/manage-view-settings/open-view-settings/EditSettingsContextProvider.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAoB,QAAQ,EAAC,MAAM,OAAO,CAAC;AAClD,OAAO,EAAC,mBAAmB,EAAuB,MAAM,uBAAuB,CAAC;AAMhF,MAAM,CAAC,MAAM,2BAA2B,GAAyD,CAAC,EAC9F,QAAQ,EACR,YAAY,EACf,EAAE,EAAE;IACD,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,QAAQ,CAAyC,IAAI,CAAC,CAAC;IACnG,MAAM,kBAAkB,GAAG,GAAG,EAAE,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;IAEzD,OAAO,CACH,KAAC,mBAAmB,CAAC,QAAQ,IACzB,KAAK,EAAE;YACH,cAAc;YACd,iBAAiB;YACjB,YAAY,EAAE,YAAY,IAAI,IAAI;YAClC,kBAAkB;SACrB,YAEA,QAAQ,GACkB,CAClC,CAAC;AACN,CAAC,CAAC"}
1
+ {"version":3,"file":"EditSettingsContextProvider.js","sourceRoot":"","sources":["../../../../../src/components/Explorer/manage-view-settings/open-view-settings/EditSettingsContextProvider.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAoB,QAAQ,EAAC,MAAM,OAAO,CAAC;AAClD,OAAO,EAAC,mBAAmB,EAAuB,MAAM,uBAAuB,CAAC;AAOhF,MAAM,CAAC,MAAM,2BAA2B,GAAyD,CAAC,EAC9F,QAAQ,EACR,YAAY,EACf,EAAE,EAAE;IACD,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,QAAQ,CAAyC,IAAI,CAAC,CAAC;IACnG,MAAM,kBAAkB,GAAG,GAAG,EAAE,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;IAEzD,OAAO,CACH,KAAC,mBAAmB,CAAC,QAAQ,IACzB,KAAK,EAAE;YACH,cAAc;YACd,iBAAiB;YACjB,YAAY,EAAE,YAAY,IAAI,IAAI;YAClC,kBAAkB;SACrB,YAEA,QAAQ,GACkB,CAClC,CAAC;AACN,CAAC,CAAC"}
@@ -1,11 +1,12 @@
1
1
  import { SettingsPanelPages } from './EditSettingsContext';
2
2
  import { ReactElement } from 'react';
3
3
  import { IViewSettingsState } from '../store-view-settings/viewSettingsReducer';
4
- export declare const useOpenViewSettings: ({ view, isEnabled }: {
4
+ import { FeatureHook } from '../../_types';
5
+ export declare const useOpenViewSettings: ({ view, isEnabled }: FeatureHook<{
5
6
  view: IViewSettingsState;
6
- isEnabled?: boolean;
7
- }) => {
7
+ }>) => {
8
8
  openSettingsPanel: (pageName?: SettingsPanelPages) => void;
9
9
  viewSettingsButton: ReactElement<any, string | import("react").JSXElementConstructor<any>>;
10
+ viewListButton: ReactElement<any, string | import("react").JSXElementConstructor<any>>;
10
11
  viewName: string;
11
12
  };
@@ -1,24 +1,33 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  // Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06
3
3
  // This file is released under LGPL V3
4
4
  // License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
5
- import { KitButton } from 'aristid-ds';
6
- import { FaSlidersH } from 'react-icons/fa';
5
+ import { KitButton, KitTag } from 'aristid-ds';
6
+ import { FaBars, FaSlidersH } from 'react-icons/fa';
7
7
  import { useSharedTranslation } from '../../../../hooks/useSharedTranslation';
8
8
  import { SettingsPanel } from '../router-menu/SettingsPanel';
9
9
  import { useEditSettings } from './useEditSettings';
10
10
  import { localizedTranslation } from '@leav/utils';
11
11
  import { useLang } from '../../../../hooks';
12
12
  import { useEffect, useState } from 'react';
13
+ import styled from 'styled-components';
14
+ import { MASS_SELECTION_ALL } from '../../_constants';
15
+ const ModifiedStyledKitTag = styled(KitTag) `
16
+ margin: 0;
17
+ `;
13
18
  export const useOpenViewSettings = ({ view, isEnabled = true }) => {
14
19
  const { activeSettings, setActiveSettings, closeSettingsPanel } = useEditSettings();
15
20
  const [button, setButton] = useState(null);
21
+ const [viewListButton, setViewListButton] = useState(null);
16
22
  const { t } = useSharedTranslation();
17
23
  const { lang } = useLang();
18
24
  useEffect(() => {
19
25
  if (!isEnabled) {
20
26
  closeSettingsPanel();
21
27
  }
28
+ return () => {
29
+ closeSettingsPanel();
30
+ };
22
31
  }, [isEnabled]);
23
32
  const rootPanel = { pageName: 'router-menu', title: t('explorer.settings') };
24
33
  const _changePanelPage = ({ pageName, title, onClickLeftButton }) => {
@@ -41,15 +50,17 @@ export const useOpenViewSettings = ({ view, isEnabled = true }) => {
41
50
  }
42
51
  _changePanelPage(chanelPageParams);
43
52
  };
44
- let viewName = localizedTranslation(view?.viewLabels ?? {}, lang);
45
- viewName = viewName === '' ? t('explorer.default-view') : viewName;
53
+ const viewName = localizedTranslation(view?.viewLabels ?? {}, lang);
54
+ const isMassSelectionAll = view.massSelection === MASS_SELECTION_ALL;
46
55
  useEffect(() => {
47
- setButton(_jsx(KitButton, { type: "secondary", icon: _jsx(FaSlidersH, {}), onClick: () => _openSettingsPanel(), title: String(t('explorer.settings')) /* TODO: avoid transform null to 'null' */, children: viewName }));
48
- }, [viewName]);
56
+ setButton(_jsx(KitButton, { type: "secondary", icon: _jsx(FaSlidersH, {}), onClick: () => _openSettingsPanel(), disabled: isMassSelectionAll, title: String(t('explorer.settings')) /* TODO: avoid transform null to 'null' */ }));
57
+ setViewListButton(_jsxs(KitButton, { type: "secondary", icon: _jsx(FaBars, {}), onClick: () => _openSettingsPanel('my-views'), disabled: isMassSelectionAll, title: String(t('explorer.manage-views')) /* TODO: avoid transform null to 'null' */, children: [viewName === '' ? t('explorer.manage-views') : viewName, view.viewModified && (_jsx(ModifiedStyledKitTag, { type: "error", idCardProps: { description: String(t('explorer.modified')) } }))] }));
58
+ }, [view.viewModified, viewName, isMassSelectionAll]);
49
59
  return {
50
60
  openSettingsPanel: _openSettingsPanel,
51
61
  viewSettingsButton: button,
52
- viewName
62
+ viewListButton,
63
+ viewName: viewName === '' ? t('explorer.default-view') : viewName
53
64
  };
54
65
  };
55
66
  //# sourceMappingURL=useOpenViewSettings.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useOpenViewSettings.js","sourceRoot":"","sources":["../../../../../src/components/Explorer/manage-view-settings/open-view-settings/useOpenViewSettings.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,SAAS,EAAC,MAAM,YAAY,CAAC;A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,KAAK;YACL,iBAAiB;SACpB,CAAC,CAAC;IACP,CAAC,CAAC;IAEF,MAAM,kBAAkB,GAAG,CAAC,WAA+B,aAAa,EAAE,EAAE;QACxE,MAAM,gBAAgB,GAAqB;YACvC,QAAQ;YACR,KAAK,EAAE,CAAC,CAAC,YAAY,QAAQ,EAAE,CAAC;SACnC,CAAC;QACF,IAAI,QAAQ,KAAK,SAAS,CAAC,QAAQ,EAAE,CAAC;YAClC,gBAAgB,CAAC,iBAAiB,GAAG,GAAG,EAAE;gBACtC,gBAAgB,CAAC,SAAS,CAAC,CAAC;YAChC,CAAC,CAAC;QACN,CAAC;QAED,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;IACvC,CAAC,CAAC;IAEF,IAAI,QAAQ,GAAG,oBAAoB,CAAC,IAAI,EAAE,UAAU,IAAI,EAAE,EAAE,IAAI,CAAC,CAAC;IAClE,QAAQ,GAAG,QAAQ,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;IAEnE,SAAS,CAAC,GAAG,EAAE;QACX,SAAS,CACL,KAAC,SAAS,IACN,IAAI,EAAC,WAAW,EAChB,IAAI,EAAE,KAAC,UAAU,KAAG,EACpB,OAAO,EAAE,GAAG,EAAE,CAAC,kBAAkB,EAAE,EACnC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,0CAA0C,YAE/E,QAAQ,GACD,CACf,CAAC;IACN,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEf,OAAO;QACH,iBAAiB,EAAE,kBAAkB;QACrC,kBAAkB,EAAE,MAAM;QAC1B,QAAQ;KACX,CAAC;AACN,CAAC,CAAC"}
1
+ {"version":3,"file":"useOpenViewSettings.js","sourceRoot":"","sources":["../../../../../src/components/Explorer/manage-view-settings/open-view-settings/useOpenViewSettings.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC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AC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,0CAA0C,GAClF,CACL,CAAC;QACF,iBAAiB,CACb,MAAC,SAAS,IACN,IAAI,EAAC,WAAW,EAChB,IAAI,EAAE,KAAC,MAAM,KAAG,EAChB,OAAO,EAAE,GAAG,EAAE,CAAC,kBAAkB,CAAC,UAAU,CAAC,EAC7C,QAAQ,EAAE,kBAAkB,EAC5B,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC,CAAC,0CAA0C,aAEnF,QAAQ,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC,CAAC,CAAC,QAAQ,EACvD,IAAI,CAAC,YAAY,IAAI,CAClB,KAAC,oBAAoB,IAAC,IAAI,EAAC,OAAO,EAAC,WAAW,EAAE,EAAC,WAAW,EAAE,MAAM,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,EAAC,GAAI,CACpG,IACO,CACf,CAAC;IACN,CAAC,EAAE,CAAC,IAAI,CAAC,YAAY,EAAE,QAAQ,EAAE,kBAAkB,CAAC,CAAC,CAAC;IAEtD,OAAO;QACH,iBAAiB,EAAE,kBAAkB;QACrC,kBAAkB,EAAE,MAAM;QAC1B,cAAc;QACd,QAAQ,EAAE,QAAQ,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC,CAAC,CAAC,QAAQ;KACpE,CAAC;AACN,CAAC,CAAC"}
@@ -3,17 +3,17 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
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 styled from 'styled-components';
6
- import { KitButton, KitInput, KitTypography } from 'aristid-ds';
7
- import { FaFilter, FaList, FaSave, FaShare, FaSortAlphaDown, FaUndo } from 'react-icons/fa';
6
+ import { KitInput, KitTypography } from 'aristid-ds';
7
+ import { FaFilter, FaList, FaSortAlphaDown } from 'react-icons/fa';
8
8
  import { useSharedTranslation } from '../../../../hooks/useSharedTranslation';
9
9
  import { ConfigureDisplay } from '../configure-display/ConfigureDisplay';
10
10
  import { SortItems } from '../sort-items/SortItems';
11
11
  import { SettingItem } from './SettingItem';
12
12
  import { FilterItems } from '../filter-items/FilterItems';
13
13
  import { useViewSettingsContext } from '../store-view-settings/useViewSettingsContext';
14
- import { ViewSettingsActionTypes } from '../store-view-settings/viewSettingsReducer';
15
14
  import { useOpenViewSettings } from '../open-view-settings/useOpenViewSettings';
16
- import { useSaveView } from '../save-view/useSaveView';
15
+ import { SavedViews } from '../../list-saved-views/SavedViews';
16
+ import { ViewActionsButtons } from '../save-view/ViewActionsButtons';
17
17
  const ContentWrapperStyledDiv = styled.div `
18
18
  display: flex;
19
19
  flex-direction: column;
@@ -23,23 +23,14 @@ const ContentWrapperStyledDiv = styled.div `
23
23
  const ViewNameStyledKitInput = styled(KitInput) `
24
24
  margin-bottom: calc(var(--general-spacing-s) * 1px);
25
25
  `;
26
- const FooterStyledDiv = styled.footer `
27
- display: flex;
28
- flex-direction: column;
29
- padding-bottom: calc(var(--general-spacing-xs) * 1px);
30
- `;
31
26
  const ConfigurationStyledMenu = styled.menu `
32
27
  padding: 0;
33
28
  `;
34
29
  export const SettingsPanel = ({ library, page = 'router-menu' }) => {
35
30
  const { t } = useSharedTranslation();
36
- const { view, dispatch } = useViewSettingsContext();
37
- const { openSettingsPanel, viewName } = useOpenViewSettings({ view });
38
- const { saveViewModal, toggleModal } = useSaveView();
39
- const _handleReinitView = () => {
40
- dispatch({ type: ViewSettingsActionTypes.RESTORE_INITIAL_VIEW_SETTINGS });
41
- };
31
+ const { view } = useViewSettingsContext();
32
+ const { openSettingsPanel, viewName } = useOpenViewSettings({ view, isEnabled: true });
42
33
  // TODO: look for MemoryRouter
43
- return (_jsxs(ContentWrapperStyledDiv, { children: [page === 'router-menu' && (_jsxs(_Fragment, { children: [_jsxs("nav", { children: [_jsx(ViewNameStyledKitInput, { disabled: true, value: viewName }), _jsx(KitTypography.Title, { level: "h4", children: t('explorer.router-menu') }), _jsxs(ConfigurationStyledMenu, { children: [_jsx(SettingItem, { icon: _jsx(FaList, {}), title: t('explorer.configure-display'), onClick: () => openSettingsPanel('configure-display') }), view.entrypoint.type === 'library' && (_jsxs(_Fragment, { children: [_jsx(SettingItem, { icon: _jsx(FaFilter, {}), title: t('explorer.filters'), value: String(t('explorer.active-items-number', { count: view.filters.length })), onClick: () => openSettingsPanel('filter-items') }), _jsx(SettingItem, { icon: _jsx(FaSortAlphaDown, {}), title: t('explorer.sort-items'), onClick: () => openSettingsPanel('sort-items') })] }))] })] }), saveViewModal, _jsxs(FooterStyledDiv, { children: [_jsx(KitButton, { type: "redirect", icon: _jsx(FaSave, {}), onClick: toggleModal, children: t('explorer.save-view') }), _jsx(KitButton, { type: "redirect", icon: _jsx(FaShare, {}), onClick: () => null, children: t('explorer.share-view') }), _jsx(KitButton, { type: "redirect", icon: _jsx(FaUndo, {}), onClick: _handleReinitView, children: t('explorer.reinit-view') })] })] })), page === 'configure-display' && _jsx(ConfigureDisplay, { libraryId: library }), page === 'sort-items' && _jsx(SortItems, { libraryId: library }), page === 'filter-items' && _jsx(FilterItems, { libraryId: library })] }));
34
+ return (_jsxs(ContentWrapperStyledDiv, { children: [page === 'router-menu' && (_jsxs(_Fragment, { children: [_jsxs("nav", { children: [_jsx(ViewNameStyledKitInput, { disabled: true, value: viewName }), _jsx(KitTypography.Title, { level: "h4", children: t('explorer.router-menu') }), _jsxs(ConfigurationStyledMenu, { children: [_jsx(SettingItem, { icon: _jsx(FaList, {}), title: t('explorer.configure-display'), onClick: () => openSettingsPanel('configure-display') }), view.entrypoint.type === 'library' && (_jsxs(_Fragment, { children: [_jsx(SettingItem, { icon: _jsx(FaFilter, {}), title: t('explorer.filters'), value: String(t('explorer.active-items-number', { count: view.filters.length })), onClick: () => openSettingsPanel('filter-items') }), _jsx(SettingItem, { icon: _jsx(FaSortAlphaDown, {}), title: t('explorer.sort-items'), onClick: () => openSettingsPanel('sort-items') })] }))] })] }), _jsx(ViewActionsButtons, {})] })), page === 'configure-display' && _jsx(ConfigureDisplay, { libraryId: library }), page === 'sort-items' && _jsx(SortItems, { libraryId: library }), page === 'filter-items' && _jsx(FilterItems, { libraryId: library }), page === 'my-views' && _jsx(SavedViews, {})] }));
44
35
  };
45
36
  //# sourceMappingURL=SettingsPanel.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SettingsPanel.js","sourceRoot":"","sources":["../../../../../src/components/Explorer/manage-view-settings/router-menu/SettingsPanel.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,EAAC,SAAS,EAAE,QAAQ,EAAE,aAAa,EAAC,MAAM,YAAY,CAAC;AAC9D,OAAO,EAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,EAAC,MAAM,gBAAgB,CAAC;AAC1F,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAC,gBAAgB,EAAC,MAAM,uCAAuC,CAAC;AACvE,OAAO,EAAC,SAAS,EAAC,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAC,WAAW,EAAC,MAAM,6BAA6B,CAAC;AACxD,OAAO,EAAC,sBAAsB,EAAC,MAAM,+CAA+C,CAAC;AACrF,OAAO,EAAC,uBAAuB,EAAC,MAAM,4CAA4C,CAAC;AAEnF,OAAO,EAAC,mBAAmB,EAAC,MAAM,2CAA2C,CAAC;AAC9E,OAAO,EAAC,WAAW,EAAC,MAAM,0BAA0B,CAAC;AAErD,MAAM,uBAAuB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;CAKzC,CAAC;AAEF,MAAM,sBAAsB,GAAG,MAAM,CAAC,QAA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,IAAI,KAAC,WAAW,IAAC,SAAS,EAAE,OAAO,GAAI,EAC9D,IAAI,KAAK,UAAU,IAAI,KAAC,UAAU,KAAG,IAChB,CAC7B,CAAC;AACN,CAAC,CAAC"}
@@ -1,6 +1,7 @@
1
1
  import { FunctionComponent } from 'react';
2
2
  interface ISaveViewProps {
3
3
  isOpen: boolean;
4
+ onSave: (label: Record<string, string>) => void;
4
5
  onClose: () => void;
5
6
  }
6
7
  export declare const SaveViewModal: FunctionComponent<ISaveViewProps>;
@@ -3,13 +3,12 @@ import { FaTimes, FaSave } from 'react-icons/fa';
3
3
  import { KitModal, KitButton, AntForm, KitInputWrapper, KitInput } from 'aristid-ds';
4
4
  import { useLang } from '../../../../hooks';
5
5
  import { useSharedTranslation } from '../../../../hooks/useSharedTranslation';
6
- import { useManageViews } from '../useManageViews';
7
6
  import { useViewSettingsContext } from '../store-view-settings/useViewSettingsContext';
8
- export const SaveViewModal = ({ isOpen, onClose }) => {
7
+ const sortWithDefaultAtFirst = defaultLang => (a, b) => (b === defaultLang ? 1 : 0) - (a === defaultLang ? 1 : 0);
8
+ export const SaveViewModal = ({ isOpen, onSave, onClose }) => {
9
9
  const { t } = useSharedTranslation();
10
10
  const { defaultLang, availableLangs } = useLang();
11
11
  const { view } = useViewSettingsContext();
12
- const { handleSaveView } = useManageViews();
13
12
  const [form] = AntForm.useForm();
14
13
  const _toggleModal = () => {
15
14
  if (isOpen) {
@@ -19,12 +18,12 @@ export const SaveViewModal = ({ isOpen, onClose }) => {
19
18
  };
20
19
  const _handleSaveView = () => {
21
20
  form.validateFields();
22
- const hasError = form.getFieldsError().filter(field => field.errors.length > 0).length > 0;
23
- const hasOnlyEmptyField = Object.entries(form.getFieldsValue()).filter(field => field[0] === defaultLang && !!field[1]).length === 0;
21
+ const hasError = form.getFieldsError().some(field => field.errors.length > 0);
22
+ const hasOnlyEmptyField = Object.entries(form.getFieldsValue()).some(([language, value]) => language === defaultLang && !value);
24
23
  if (hasError || hasOnlyEmptyField) {
25
24
  return;
26
25
  }
27
- handleSaveView(form.getFieldsValue());
26
+ onSave(form.getFieldsValue());
28
27
  onClose();
29
28
  };
30
29
  const _onCheck = () => {
@@ -35,8 +34,11 @@ export const SaveViewModal = ({ isOpen, onClose }) => {
35
34
  // TODO: remove appElement and put in the test : "KitModal.setAppElement(document.body) once exposed"
36
35
  , {
37
36
  // TODO: remove appElement and put in the test : "KitModal.setAppElement(document.body) once exposed"
38
- appElement: document.body, title: t('explorer.save-view'), showCloseIcon: false, close: _toggleModal, isOpen: isOpen, footer: _jsxs(_Fragment, { children: [_jsx(KitButton, { type: "secondary", onClick: _toggleModal, icon: _jsx(FaTimes, {}), children: t('global.close') }), _jsx(KitButton, { type: "primary", onClick: _handleSaveView, icon: _jsx(FaSave, {}), children: t('global.save') })] }), children: _jsx(AntForm, { name: "label", form: form, initialValues: { ...view.viewLabels }, children: _jsx(KitInputWrapper, { label: String(t('explorer.view-name')), children: availableLangs.map((lang, index) => (_jsx(AntForm.Item, { name: lang, rules: [
39
- { required: lang === defaultLang, message: String(t('errors.standard_field_required')) }
40
- ], children: _jsx(KitInput, { label: lang, required: lang === defaultLang, onMouseDown: _preventCloseSettingsPanel, onBlur: _onCheck }) }, index))) }) }) }));
37
+ appElement: document.body, title: t('explorer.save-view-as'), showCloseIcon: false, close: _toggleModal, isOpen: isOpen, footer: _jsxs(_Fragment, { children: [_jsx(KitButton, { type: "secondary", onClick: _toggleModal, icon: _jsx(FaTimes, {}), children: t('global.close') }), _jsx(KitButton, { type: "primary", onClick: _handleSaveView, icon: _jsx(FaSave, {}), children: t('global.save') })] }), children: _jsx(AntForm, { name: "label", form: form, initialValues: view.viewId ? view.viewLabels : {}, children: _jsx(KitInputWrapper, { label: String(t('explorer.view-name')), children: [...availableLangs].sort(sortWithDefaultAtFirst(defaultLang)).map(lang => (_jsx(AntForm.Item, { name: lang, rules: [
38
+ {
39
+ required: lang === defaultLang,
40
+ message: String(t('errors.standard_field_required'))
41
+ }
42
+ ], children: _jsx(KitInput, { label: lang, required: lang === defaultLang, onMouseDown: _preventCloseSettingsPanel, onBlur: _onCheck }) }, lang))) }) }) }));
41
43
  };
42
44
  //# sourceMappingURL=SaveViewModal.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SaveViewModal.js","sourceRoot":"","sources":["../../../../../src/components/Explorer/manage-view-settings/save-view/SaveViewModal.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAC,OAAO,EAAE,MAAM,EAAC,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAC,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAC,MAAM,YAAY,CAAC;AACnF,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAClC,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAC,cAAc,EAAC,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAC,sBAAsB,EAAC,MAAM,+CAA+C,CAAC;AAOrF,MAAM,CAAC,MAAM,aAAa,GAAsC,CAAC,EAAC,MAAM,EAAE,OAAO,EAAC,EAAE,EAAE;IAClF,MAAM,EAAC,CAAC,EAAC,GAAG,oBAAoB,EAAE,CAAC;IACnC,MAAM,EAAC,WAAW,EAAE,cAAc,EAAC,GAAG,OAAO,EAAE,CAAC;IAEhD,MAAM,EAAC,IAAI,EAAC,GAAG,sBAAsB,EAAE,CAAC;IACxC,MAAM,EAAC,cAAc,EAAC,GAAG,cAAc,EAAE,CAAC;IAE1C,MAAM,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAEjC,MAAM,YAAY,GAAG,GAAG,EAAE;QACtB,IAAI,MAAM,EAAE,CAAC;YACT,IAAI,CAAC,WAAW,EAAE,CAAC;QACvB,CAAC;QACD,OAAO,EAAE,CAAC;IACd,CAAC,CAAC;IAEF,MAAM,eAAe,GAAG,GAAG,EAAE;QACzB,IAAI,CAAC,cAAc,EAAE,CAAC;Q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C,aAAa,CAAC,GACT,IACb,YAGP,KAAC,OAAO,IAAC,IAAI,EAAC,OAAO,EAAC,IAAI,EAAE,IAAI,EAAE,aAAa,EAAE,EAAC,GAAG,IAAI,CAAC,UAAU,EAAC,YACjE,KAAC,eAAe,IAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,YAClD,cAAc,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,CACjC,KAAC,OAAO,CAAC,IAAI,IAET,IAAI,EAAE,IAAI,EACV,KAAK,EAAE;wBACH,EAAC,QAAQ,EAAE,IAAI,KAAK,WAAW,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,gCAAgC,CAAC,CAAC,EAAC;qBACzF,YAED,KAAC,QAAQ,IACL,KAAK,EAAE,IAAI,EACX,QAAQ,EAAE,IAAI,KAAK,WAAW,EAC9B,WAAW,EAAE,0BAA0B,EACvC,MAAM,EAAE,QAAQ,GAClB,IAXG,KAAK,CAYC,CAClB,CAAC,GACY,GACZ,GACH,CACd,CAAC;AACN,CAAC,CAAC"}
1
+ {"version":3,"file":"SaveViewModal.js","sourceRoot":"","sources":["../../../../../src/components/Explorer/manage-view-settings/save-view/SaveViewModal.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAC,OAAO,EAAE,MAAM,EAAC,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAC,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAC,MAAM,YAAY,CAAC;AACnF,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAClC,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAC,sBAAsB,EAAC,MAAM,+CAA+C,CAAC;AAQrF,MAAM,sBAAsB,GAAG,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,W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BACvD;qBACJ,YAED,KAAC,QAAQ,IACL,KAAK,EAAE,IAAI,EACX,QAAQ,EAAE,IAAI,KAAK,WAAW,EAC9B,WAAW,EAAE,0BAA0B,EACvC,MAAM,EAAE,QAAQ,GAClB,IAdG,IAAI,CAeE,CAClB,CAAC,GACY,GACZ,GACH,CACd,CAAC;AACN,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ export declare const ViewActionsButtons: () => JSX.Element;
@@ -0,0 +1,22 @@
1
+ import { jsxs as _jsxs } from "react/jsx-runtime";
2
+ // Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06
3
+ // This file is released under LGPL V3
4
+ // License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
5
+ import { useCreateNewView } from './useCreateNewView';
6
+ import styled from 'styled-components';
7
+ import { useUpdateView } from './useUpdateView';
8
+ import { useResetView } from './useResetView';
9
+ import { useShareView } from './useShareView';
10
+ const StyledFooter = styled.footer `
11
+ display: flex;
12
+ flex-direction: column;
13
+ padding-bottom: calc(var(--general-spacing-xs) * 1px);
14
+ `;
15
+ export const ViewActionsButtons = () => {
16
+ const { updateViewButton } = useUpdateView();
17
+ const { createNewViewButton } = useCreateNewView();
18
+ const { shareViewButton } = useShareView();
19
+ const { resetViewButton } = useResetView();
20
+ return (_jsxs(StyledFooter, { children: [updateViewButton, createNewViewButton, shareViewButton, resetViewButton] }));
21
+ };
22
+ //# sourceMappingURL=ViewActionsButtons.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ViewActionsButtons.js","sourceRoot":"","sources":["../../../../../src/components/Explorer/manage-view-settings/save-view/ViewActionsButtons.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,gBAAgB,EAAC,MAAM,oBAAoB,CAAC;AACpD,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAE5C,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAA;;;;CAIjC,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,EAAE;IACnC,MAAM,EAAC,gBAAgB,EAAC,GAAG,aAAa,EAAE,CAAC;IAC3C,MAAM,EAAC,mBAAmB,EAAC,GAAG,gBAAgB,EAAE,CAAC;IACjD,MAAM,EAAC,eAAe,EAAC,GAAG,YAAY,EAAE,CAAC;IACzC,MAAM,EAAC,eAAe,EAAC,GAAG,YAAY,EAAE,CAAC;IAEzC,OAAO,CACH,MAAC,YAAY,eACR,gBAAgB,EAChB,mBAAmB,EACnB,eAAe,EACf,eAAe,IACL,CAClB,CAAC;AACN,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { ViewInput } from '../../../../_gqlTypes';
2
+ import { IViewSettingsState } from '../store-view-settings/viewSettingsReducer';
3
+ export declare const prepareViewForRequest: (view: IViewSettingsState, label: Record<string, string>) => ViewInput;
@@ -0,0 +1,24 @@
1
+ import { mapViewTypeFromExplorerToLegacy } from '../../_constants';
2
+ import { isExplorerFilterThrough } from '../../_types';
3
+ export const prepareViewForRequest = (view, label) => ({
4
+ library: view.libraryId,
5
+ shared: false,
6
+ display: {
7
+ type: mapViewTypeFromExplorerToLegacy[view.viewType]
8
+ },
9
+ filters: view.filters.map(filter => isExplorerFilterThrough(filter)
10
+ ? {
11
+ field: `${filter.field}.${filter.subField}`,
12
+ value: filter.value,
13
+ condition: filter.subCondition
14
+ }
15
+ : {
16
+ field: filter.field,
17
+ value: filter.value,
18
+ condition: filter.condition
19
+ }),
20
+ sort: view.sort.map(({ field, order }) => ({ field, order })),
21
+ attributes: view.attributesIds,
22
+ label
23
+ });
24
+ //# sourceMappingURL=prepareViewForRequest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prepareViewForRequest.js","sourceRoot":"","sources":["../../../../../src/components/Explorer/manage-view-settings/save-view/prepareViewForRequest.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,+BAA+B,EAAC,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAC,uBAAuB,EAAC,MAAM,cAAc,CAAC;AAGrD,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,IAAwB,EAAE,KAA6B,EAAa,EAAE,CAAC,CAAC;IAC1G,OAAO,EAAE,IAAI,CAAC,SAAS;IACvB,MAAM,EAAE,KAAK;IACb,OAAO,EAAE;QACL,IAAI,EAAE,+BAA+B,CAAC,IAAI,CAAC,QAAQ,CAAC;KACvD;IACD,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAC/B,uBAAuB,CAAC,MAAM,CAAC;QAC3B,CAAC,CAAC;YACI,KAAK,EAAE,GAAG,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,QAAQ,EAAE;YAC3C,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,SAAS,EAAE,MAAM,CAAC,YAAY;SACjC;QACH,CAAC,CAAC;YACI,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,SAAS,EAAE,MAAM,CAAC,SAAS;SAC9B,CACV;IACD,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAC,KAAK,EAAE,KAAK,EAAC,EAAE,EAAE,CAAC,CAAC,EAAC,KAAK,EAAE,KAAK,EAAC,CAAC,CAAC;IACzD,UAAU,EAAE,IAAI,CAAC,aAAa;IAC9B,KAAK;CACR,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare const useCreateNewView: () => {
2
+ createNewViewButton: JSX.Element;
3
+ };
@@ -0,0 +1,52 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ // Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06
3
+ // This file is released under LGPL V3
4
+ // License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
5
+ import { useState } from 'react';
6
+ import { SaveViewModal } from './SaveViewModal';
7
+ import { KitButton } from 'aristid-ds';
8
+ import { FaSdCard } from 'react-icons/fa';
9
+ import { useSharedTranslation } from '../../../../hooks/useSharedTranslation';
10
+ import { useViewSettingsContext } from '../store-view-settings/useViewSettingsContext';
11
+ import { ViewSettingsActionTypes } from '../store-view-settings/viewSettingsReducer';
12
+ import useExecuteSaveViewMutation from '../../../../hooks/useExecuteSaveViewMutation';
13
+ import { prepareViewForRequest } from './prepareViewForRequest';
14
+ import { mapViewTypeFromExplorerToLegacy } from '../../_constants';
15
+ import { useTransformFilters } from '../_shared/useTransformFilters';
16
+ export const useCreateNewView = () => {
17
+ const { t } = useSharedTranslation();
18
+ const { toValidFilters } = useTransformFilters();
19
+ const { view, dispatch } = useViewSettingsContext();
20
+ const { saveView } = useExecuteSaveViewMutation();
21
+ const [isModalOpen, setIsModalOpen] = useState(false);
22
+ const _toggleModal = () => {
23
+ setIsModalOpen(!isModalOpen);
24
+ };
25
+ const _createView = async (label) => {
26
+ const mappedView = prepareViewForRequest(view, label);
27
+ const { data } = await saveView({
28
+ view: mappedView
29
+ });
30
+ if (data) {
31
+ dispatch({
32
+ type: ViewSettingsActionTypes.UPDATE_VIEWS,
33
+ payload: {
34
+ id: data.saveView.id,
35
+ ownerId: data.saveView.created_by.id,
36
+ label: data.saveView.label,
37
+ shared: data.saveView.shared,
38
+ filters: toValidFilters(data.saveView.filters),
39
+ sort: data.saveView.sort ?? [],
40
+ display: data.saveView.display ?? {
41
+ type: mapViewTypeFromExplorerToLegacy[view.viewType]
42
+ },
43
+ attributes: data.saveView?.attributes?.map(({ id }) => id) ?? []
44
+ }
45
+ });
46
+ }
47
+ };
48
+ return {
49
+ createNewViewButton: (_jsxs(_Fragment, { children: [_jsx(SaveViewModal, { isOpen: isModalOpen, onSave: _createView, onClose: _toggleModal }), _jsx(KitButton, { type: "action", icon: _jsx(FaSdCard, {}), onClick: _toggleModal, children: t('explorer.save-view-as') })] }))
50
+ };
51
+ };
52
+ //# sourceMappingURL=useCreateNewView.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCreateNewView.js","sourceRoot":"","sources":["../../../../../src/components/Explorer/manage-view-settings/save-view/useCreateNewView.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,QAAQ,EAAC,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAC,SAAS,EAAC,MAAM,YAAY,CAAC;AACrC,OAAO,EAAC,QAAQ,EAAC,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAC,sBAAsB,EAAC,MAAM,+CAA+C,CAAC;AACrF,OAAO,EAAC,uBAAuB,EAAC,MAAM,4CAA4C,CAAC;AACnF,OAAO,0BAA0B,MAAM,sCAAsC,CAAC;AAC9E,OAAO,EAAC,qBAAqB,EAAC,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAC,+BAA+B,EAAC,MAAM,kBAAkB,CAAC;AAEjE,OAAO,EAAC,mBAAmB,EAAC,MAAM,gCAAgC,CAAC;AAEnE,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,EAAE;IACjC,MAAM,EAAC,CAAC,EAAC,GAAG,oBAAoB,EAAE,CAAC;IACnC,MAAM,EAAC,cAAc,EAAC,GAAG,mBAAmB,EAAE,CAAC;IAC/C,MAAM,EAAC,IAAI,EAAE,QAAQ,EAAC,GAAG,sBAAsB,EAAE,CAAC;IAClD,MAAM,EAAC,QAAQ,EAAC,GAAG,0BAA0B,EAAE,CAAC;IAChD,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAC,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,GAAI,EAClF,KAAC,SAAS,IAAC,IAAI,EAAC,QAAQ,EAAC,IAAI,EAAE,KAAC,QAAQ,KAAG,EAAE,OAAO,EAAE,YAAY,YAC7D,CAAC,CAAC,uBAAuB,CAAC,GACnB,IACb,CACN;KACJ,CAAC;AACN,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare const useResetView: () => {
2
+ resetViewButton: JSX.Element;
3
+ };
@@ -0,0 +1,20 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ // Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06
3
+ // This file is released under LGPL V3
4
+ // License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
5
+ import { KitButton } from 'aristid-ds';
6
+ import { useSharedTranslation } from '../../../../hooks/useSharedTranslation';
7
+ import { useViewSettingsContext } from '../store-view-settings/useViewSettingsContext';
8
+ import { ViewSettingsActionTypes } from '../store-view-settings/viewSettingsReducer';
9
+ import { FaUndo } from 'react-icons/fa';
10
+ export const useResetView = () => {
11
+ const { t } = useSharedTranslation();
12
+ const { dispatch } = useViewSettingsContext();
13
+ const _resetView = () => {
14
+ dispatch({ type: ViewSettingsActionTypes.RESTORE_INITIAL_VIEW_SETTINGS });
15
+ };
16
+ return {
17
+ resetViewButton: (_jsx(KitButton, { type: "action", icon: _jsx(FaUndo, {}), onClick: _resetView, children: t('explorer.reinit-view') }))
18
+ };
19
+ };
20
+ //# sourceMappingURL=useResetView.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useResetView.js","sourceRoot":"","sources":["../../../../../src/components/Explorer/manage-view-settings/save-view/useResetView.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,SAAS,EAAC,MAAM,YAAY,CAAC;AACrC,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAC,sBAAsB,EAAC,MAAM,+CAA+C,CAAC;AACrF,OAAO,EAAC,uBAAuB,EAAC,MAAM,4CAA4C,CAAC;AACnF,OAAO,EAAC,MAAM,EAAC,MAAM,gBAAgB,CAAC;AAEtC,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,EAAE;IAC7B,MAAM,EAAC,CAAC,EAAC,GAAG,oBAAoB,EAAE,CAAC;IACnC,MAAM,EAAC,QAAQ,EAAC,GAAG,sBAAsB,EAAE,CAAC;IAE5C,MAAM,UAAU,GAAG,GAAG,EAAE;QACpB,QAAQ,CAAC,EAAC,IAAI,EAAE,uBAAuB,CAAC,6BAA6B,EAAC,CAAC,CAAC;IAC5E,CAAC,CAAC;IAEF,OAAO;QACH,eAAe,EAAE,CACb,KAAC,SAAS,IAAC,IAAI,EAAC,QAAQ,EAAC,IAAI,EAAE,KAAC,MAAM,KAAG,EAAE,OAAO,EAAE,UAAU,YACzD,CAAC,CAAC,sBAAsB,CAAC,GAClB,CACf;KACJ,CAAC;AACN,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare const useShareView: () => {
2
+ shareViewButton: JSX.Element;
3
+ };
@@ -0,0 +1,64 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ // Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06
3
+ // This file is released under LGPL V3
4
+ // License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
5
+ import { useSharedTranslation } from '../../../../hooks/useSharedTranslation';
6
+ import { KitButton } from 'aristid-ds';
7
+ import { FaShare } from 'react-icons/fa';
8
+ import { useViewSettingsContext } from '../store-view-settings/useViewSettingsContext';
9
+ import { useEffect, useState } from 'react';
10
+ import useExecuteSaveViewMutation from '../../../../hooks/useExecuteSaveViewMutation';
11
+ import { ViewSettingsActionTypes } from '../store-view-settings/viewSettingsReducer';
12
+ import { prepareViewForRequest } from './prepareViewForRequest';
13
+ import { mapViewTypeFromExplorerToLegacy } from '../../_constants';
14
+ import { useTransformFilters } from '../_shared/useTransformFilters';
15
+ import { useMeQuery } from '../../../../_gqlTypes';
16
+ export const useShareView = () => {
17
+ const { t } = useSharedTranslation();
18
+ const { view, dispatch } = useViewSettingsContext();
19
+ const { saveView } = useExecuteSaveViewMutation();
20
+ const { toValidFilters } = useTransformFilters();
21
+ const [isSharedView, setIsSharedView] = useState(false);
22
+ const [isOwnerView, setIsOwnerView] = useState(false);
23
+ const { data: userData } = useMeQuery();
24
+ useEffect(() => {
25
+ const currentView = view.savedViews.find(v => v.id === view.viewId);
26
+ if (currentView === undefined) {
27
+ return;
28
+ }
29
+ setIsSharedView(currentView.shared ?? false);
30
+ setIsOwnerView(currentView.ownerId === userData?.me?.whoAmI?.id);
31
+ }, [view.viewId]);
32
+ const _toggleShareView = async () => {
33
+ const mappedView = {
34
+ ...prepareViewForRequest(view, view.viewLabels),
35
+ shared: !isSharedView,
36
+ id: view.viewId
37
+ };
38
+ const { data } = await saveView({
39
+ view: mappedView
40
+ });
41
+ setIsSharedView(!isSharedView);
42
+ if (data) {
43
+ dispatch({
44
+ type: ViewSettingsActionTypes.UPDATE_VIEWS,
45
+ payload: {
46
+ id: data.saveView.id,
47
+ ownerId: data.saveView.created_by.id,
48
+ label: data.saveView.label,
49
+ shared: data.saveView.shared,
50
+ filters: toValidFilters(data.saveView.filters),
51
+ sort: data.saveView.sort ?? [],
52
+ display: data.saveView.display ?? {
53
+ type: mapViewTypeFromExplorerToLegacy[view.viewType]
54
+ },
55
+ attributes: data.saveView?.attributes?.map(({ id }) => id) ?? []
56
+ }
57
+ });
58
+ }
59
+ };
60
+ return {
61
+ shareViewButton: !view.viewId || (isSharedView && !isOwnerView) ? null : (_jsx(KitButton, { type: "action", icon: _jsx(FaShare, {}), onClick: _toggleShareView, children: isSharedView ? t('explorer.unshare-view') : t('explorer.share-view') }))
62
+ };
63
+ };
64
+ //# sourceMappingURL=useShareView.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useShareView.js","sourceRoot":"","sources":["../../../../../src/components/Explorer/manage-view-settings/save-view/useShareView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