@scaleflex/widget-explorer 4.5.0 → 4.5.1

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 (48) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/README.md +21 -3
  3. package/lib/components/ActionBar/DownloadWithExportButton.js +32 -4
  4. package/lib/components/AssetsList/ListView/AssetsSection/AssetsSectionTableRow.js +1 -1
  5. package/lib/components/Breadcrumbs/index.js +114 -6
  6. package/lib/components/CollectionsView/CollectionFolderIcon.js +35 -0
  7. package/lib/components/CollectionsView/CollectionVirtualFoldersTree/CollectionTreeSkeletion.js +26 -0
  8. package/lib/components/CollectionsView/CollectionVirtualFoldersTree/CollectionVirtualFoldersTree.styled.js +52 -0
  9. package/lib/components/CollectionsView/CollectionVirtualFoldersTree/CollectionVirtualFoldersTree.utils.js +24 -0
  10. package/lib/components/CollectionsView/CollectionVirtualFoldersTree/Folder.js +88 -0
  11. package/lib/components/CollectionsView/CollectionVirtualFoldersTree/Tree.js +50 -0
  12. package/lib/components/CollectionsView/CollectionVirtualFoldersTree/index.js +75 -0
  13. package/lib/components/CollectionsView/CollectionsSkeleton.js +30 -0
  14. package/lib/components/CollectionsView/CollectionsTree/ActiveCollectionContent.js +61 -0
  15. package/lib/components/CollectionsView/CollectionsTree/CollectionTreeItem.js +44 -0
  16. package/lib/components/CollectionsView/CollectionsTree/CollectionsContent.js +130 -0
  17. package/lib/components/CollectionsView/CollectionsTree/CollectionsTree.styled.js +84 -0
  18. package/lib/components/CollectionsView/CollectionsTree/index.js +47 -0
  19. package/lib/components/CollectionsView/CollectionsView.styled.js +38 -0
  20. package/lib/components/CollectionsView/VirtualFoldersGrid.js +67 -0
  21. package/lib/components/CollectionsView/index.js +188 -0
  22. package/lib/components/Details/Details.constants.js +1 -0
  23. package/lib/components/FileItem/FileInfo/index.js +8 -2
  24. package/lib/components/FileWindowPanel/FileTabs/VariationsTab/VariationsTabNavigator.js +1 -7
  25. package/lib/components/FileWindowPanel/FileTabs/VariationsTab/index.js +4 -1
  26. package/lib/components/FileWindowPanel/Header/index.js +9 -0
  27. package/lib/components/Filters/hooks/useFilters.js +3 -2
  28. package/lib/components/HeaderBar/index.js +6 -2
  29. package/lib/components/LabelsView/LabelsTree/LabelsTree.styled.js +86 -0
  30. package/lib/components/LabelsView/LabelsTree/LabelsTreeSkeleton.js +21 -0
  31. package/lib/components/LabelsView/LabelsTree/index.js +128 -0
  32. package/lib/components/LabelsView/LabelsView.styled.js +10 -0
  33. package/lib/components/LabelsView/index.js +139 -0
  34. package/lib/components/Modals/DownloadConsent/DownloadConsent.hooks.js +11 -0
  35. package/lib/components/Modals/TransformedDownload/TransformedDownload.hooks.js +9 -0
  36. package/lib/components/Views/Views.constants.js +30 -4
  37. package/lib/components/Views/index.js +11 -4
  38. package/lib/components/common/FileMetadataFieldValue/GeneralMetadataFieldValue.js +1 -1
  39. package/lib/components/common/Sort/Sort.constants.js +28 -1
  40. package/lib/defaultLocale.js +36 -1
  41. package/lib/slices/collections.slice.js +714 -0
  42. package/lib/slices/common.slice.js +15 -52
  43. package/lib/slices/files.slice.js +6 -3
  44. package/lib/slices/index.js +5 -1
  45. package/lib/slices/labels.slice.js +652 -0
  46. package/lib/slices/views.slice.js +12 -0
  47. package/lib/utils/prepareSearchUrl.js +10 -0
  48. package/package.json +8 -8
@@ -0,0 +1,139 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
5
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
6
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
+ import { useDispatch, useSelector } from 'react-redux';
8
+ import Drawer from '../Drawer';
9
+ import Details from '../Details';
10
+ import LabelsTree from './LabelsTree';
11
+ import AssetsList from '../AssetsList';
12
+ import TopSection from '../TopSection';
13
+ import Styled from './LabelsView.styled';
14
+ import { useExplorer, useIsSmallScreen } from '../../hooks';
15
+ import { detailsViewToggled, selectIsDetailsViewOpened } from '../../slices/panels.slice';
16
+ import { fetchLabelFiles, toggleLabelsTree, selectActiveLabelSid, selectIsLabelsLoading, selectIsLabelsTreeOpened, selectLabelsError, activateFirstLabel, activateLabelsView } from '../../slices/labels.slice';
17
+ import { selectIsCurrentFilesLoading } from '../../slices/files.slice';
18
+ import Sort from '../common/Sort';
19
+ import { searchOrListViewFiles, selectIsListLayout } from '../../slices/views.slice';
20
+ import ErroredViewPlaceholder from '../Views/ErroredViewPlaceholder';
21
+ import { DETAILS_SIDEBAR_WIDTHS } from '../Details/Details.constants';
22
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
23
+ var EMPTY_LABELS_VIEW_PLACEHOLDER_DATA = {
24
+ titleI18nKey: 'explorerLabelsViewEmptyTitle',
25
+ hintI18nKeys: ['explorerLabelsViewEmptyHint']
26
+ };
27
+ var LabelsView = function LabelsView() {
28
+ var dispatch = useDispatch();
29
+ var _useExplorer = useExplorer(),
30
+ opts = _useExplorer.opts,
31
+ i18n = _useExplorer.i18n;
32
+ var isLabelsLoading = useSelector(selectIsLabelsLoading);
33
+ var isFilesLoading = useSelector(selectIsCurrentFilesLoading);
34
+ var isDetailsViewOpened = useSelector(selectIsDetailsViewOpened);
35
+ var showLabelsTree = useSelector(selectIsLabelsTreeOpened);
36
+ var activeLabelSid = useSelector(selectActiveLabelSid);
37
+ var isListLayout = useSelector(selectIsListLayout);
38
+ var error = useSelector(selectLabelsError);
39
+ var isWidgetSmallSize = useIsSmallScreen();
40
+ var hideHeaderBar = opts.hideHeaderBar,
41
+ showBar = opts.showBar,
42
+ ExploreViewComponent = opts.ExploreViewComponent,
43
+ floaty = opts.floaty,
44
+ hideLeftSideBar = opts.hideLeftSideBar;
45
+ var fetchNextLabelFiles = function fetchNextLabelFiles() {
46
+ return dispatch(fetchLabelFiles());
47
+ };
48
+ var toggleLabelTree = function toggleLabelTree() {
49
+ return dispatch(toggleLabelsTree());
50
+ };
51
+ var toggleDetailsView = function toggleDetailsView() {
52
+ return dispatch(detailsViewToggled());
53
+ };
54
+ var applyLeftSideNavigation = function applyLeftSideNavigation(child, closeFunc) {
55
+ return /*#__PURE__*/_jsx(Drawer, {
56
+ direction: "e",
57
+ position: "left",
58
+ closeFn: closeFunc,
59
+ showCloseIcon: showLabelsTree,
60
+ children: child
61
+ });
62
+ };
63
+ var applyRightSideNavigation = function applyRightSideNavigation(child, closeFunc) {
64
+ return /*#__PURE__*/_jsx(Drawer, _objectSpread(_objectSpread({
65
+ direction: "w",
66
+ position: "right",
67
+ closeFn: closeFunc,
68
+ style: {
69
+ overflow: floaty ? 'inherit' : undefined
70
+ },
71
+ showCloseIcon: !floaty || isDetailsViewOpened
72
+ }, DETAILS_SIDEBAR_WIDTHS), {}, {
73
+ children: child
74
+ }));
75
+ };
76
+ var renderLeftSideNavigation = function renderLeftSideNavigation() {
77
+ return showLabelsTree && applyLeftSideNavigation(/*#__PURE__*/_jsx(LabelsTree, {}), toggleLabelTree);
78
+ };
79
+ var renderRightSideNavigation = function renderRightSideNavigation() {
80
+ return isDetailsViewOpened && applyRightSideNavigation(/*#__PURE__*/_jsx(Details, {}), toggleDetailsView);
81
+ };
82
+ var handleChangeSort = function handleChangeSort(sortedBy, order) {
83
+ dispatch(fetchLabelFiles({
84
+ labelSid: activeLabelSid,
85
+ sortBy: sortedBy,
86
+ sortOrder: order,
87
+ offset: 0,
88
+ skipPending: false
89
+ }));
90
+ };
91
+ var openFirstLabel = function openFirstLabel() {
92
+ dispatch(activateFirstLabel());
93
+ };
94
+ var handleLabelsRefresh = function handleLabelsRefresh() {
95
+ if (!activeLabelSid) {
96
+ return dispatch(activateLabelsView({
97
+ skipViewDispatch: true
98
+ }));
99
+ }
100
+ return dispatch(searchOrListViewFiles());
101
+ };
102
+ var sortProps = {
103
+ useFilesSort: true,
104
+ onChange: handleChangeSort
105
+ };
106
+ var SortElement = !!activeLabelSid && /*#__PURE__*/_jsx(Sort, _objectSpread({}, sortProps));
107
+ var renderTopSection = function renderTopSection(hideTopSection) {
108
+ return /*#__PURE__*/_jsx(TopSection, {
109
+ showTopBar: showBar && Boolean(ExploreViewComponent),
110
+ showHeaderBar: !hideHeaderBar,
111
+ SortElement: SortElement,
112
+ hideTopSection: hideTopSection,
113
+ onRefresh: handleLabelsRefresh,
114
+ showFilters: Boolean(activeLabelSid)
115
+ });
116
+ };
117
+ return /*#__PURE__*/_jsxs(_Fragment, {
118
+ children: [renderTopSection(!isWidgetSmallSize), /*#__PURE__*/_jsxs(Styled.BrowserBody, {
119
+ className: "filerobot-ProviderBrowser-body".concat(isListLayout ? ' filerobot-ProviderBrowser-body-list' : ''),
120
+ children: [!hideLeftSideBar && renderLeftSideNavigation(), /*#__PURE__*/_jsxs(Styled.ViewBody, {
121
+ className: "filerobot-ProviderBrowser-mainContent",
122
+ children: [renderTopSection(isWidgetSmallSize), !isLabelsLoading && !isFilesLoading && error ? /*#__PURE__*/_jsx(ErroredViewPlaceholder, {
123
+ title: (error === null || error === void 0 ? void 0 : error.message) || error,
124
+ description: error === null || error === void 0 ? void 0 : error.details,
125
+ backTo: openFirstLabel,
126
+ backToLabel: i18n('labelsViewGoToFirstLabel'),
127
+ error: error
128
+ }) : /*#__PURE__*/_jsx(AssetsList, {
129
+ isInitialLoading: isLabelsLoading,
130
+ fetchNextFiles: fetchNextLabelFiles,
131
+ sortProps: sortProps,
132
+ emptyViewPlaceholderData: EMPTY_LABELS_VIEW_PLACEHOLDER_DATA,
133
+ hideAccordionHeader: true
134
+ })]
135
+ }), renderRightSideNavigation()]
136
+ })]
137
+ });
138
+ };
139
+ export default LabelsView;
@@ -5,12 +5,15 @@ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object
5
5
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
6
6
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
7
  import { useCallback } from 'react';
8
+ import { useDispatch } from 'react-redux';
8
9
  import { useModal } from '@scaleflex/widget-core/lib/hooks';
9
10
  import { Terms } from '@scaleflex/icons';
10
11
  import { PC } from '@scaleflex/widget-common';
11
12
  import { useTheme } from '@scaleflex/ui/theme/hooks';
12
13
  import useExplorer from '../../../hooks/useExplorer';
13
14
  import DownloadConsentContent from './DownloadConsentContent';
15
+ import { labelsSelectionToggled } from '../../../slices/labels.slice';
16
+ import { collectionsDeselected } from '../../../slices/collections.slice';
14
17
  import { jsx as _jsx } from "react/jsx-runtime";
15
18
  var prepareModalData = function prepareModalData(_ref) {
16
19
  var theme = _ref.theme,
@@ -61,10 +64,18 @@ export var useDownloadConsentModal = function useDownloadConsentModal() {
61
64
  var toggleModal = useModal({
62
65
  isGlobalHigherLvlModal: isGlobalHigherLvlModal
63
66
  });
67
+ var dispatch = useDispatch();
64
68
  var closeDownloadConsentModal = useCallback(function () {
65
69
  toggleModal(null);
66
70
  }, []);
71
+ var handleClearSelection = function handleClearSelection() {
72
+ dispatch(labelsSelectionToggled({
73
+ uuids: []
74
+ }));
75
+ dispatch(collectionsDeselected());
76
+ };
67
77
  var triggerDownloadConsent = useCallback(function (downloadFn) {
78
+ handleClearSelection();
68
79
  if (!downloadConsent) return downloadFn();
69
80
  var isDownloadConsentChecked = false;
70
81
  var onCheckboxChange = function onCheckboxChange(isChecked) {
@@ -16,6 +16,8 @@ import { emitExportEvent, downloadItems, downloadFilesOneByOne } from '../../../
16
16
  import prepareExportedFilesLinks from '../../../utils/prepareExportedFilesLinks';
17
17
  import PdfModalContent from './PdfModalContent';
18
18
  import ImageOptions from '../../CropPanel/ImageOptions';
19
+ import { labelsSelectionToggled } from '../../../slices/labels.slice';
20
+ import { collectionsDeselected } from '../../../slices/collections.slice';
19
21
  import { jsx as _jsx } from "react/jsx-runtime";
20
22
  export var useTransformedDownload = function useTransformedDownload() {
21
23
  var dispatch = useDispatch();
@@ -26,6 +28,12 @@ export var useTransformedDownload = function useTransformedDownload() {
26
28
  preventDownloadDefaultBehavior = _useExplorer$opts.preventDownloadDefaultBehavior,
27
29
  forceDownload = _useExplorer$opts.forceDownload,
28
30
  isDownloadUsageRightsEnabled = _useExplorer$opts.isDownloadUsageRightsEnabled;
31
+ var handleClearSelection = function handleClearSelection() {
32
+ dispatch(labelsSelectionToggled({
33
+ uuids: []
34
+ }));
35
+ dispatch(collectionsDeselected());
36
+ };
29
37
  var triggerTransformedDownload = useCallback(function (filesToBeDownloaded, options) {
30
38
  /*
31
39
  * TODO: Check the following in-case BE supports it,
@@ -41,6 +49,7 @@ export var useTransformedDownload = function useTransformedDownload() {
41
49
  var transformedFiles = filesToBeDownloaded.map(function (file) {
42
50
  return getFileWithNewParams(file, transformations);
43
51
  });
52
+ handleClearSelection();
44
53
  if (!preventDownloadDefaultBehavior) {
45
54
  info(i18n('mutualizedDownloadStartedInfo'));
46
55
  /*
@@ -2,18 +2,22 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
2
2
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
3
3
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
4
4
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
5
- import { VIEW_IDS } from '@scaleflex/widget-utils/lib/constants';
6
- import { Assets, Folders } from '@scaleflex/icons';
5
+ import { PERMISSIONS, VIEW_IDS } from '@scaleflex/widget-utils/lib/constants';
6
+ import { Assets, Folders, Collections, Label } from '@scaleflex/icons';
7
7
  import AssetsView from '../AssetsView';
8
8
  import FoldersView from '../FoldersView';
9
+ import LabelsView from '../LabelsView';
10
+ import CollectionsView from '../CollectionsView';
11
+ import { activateCollectionsView, selectCollectionsActiveVirtualFolder, toggleCollectionsTree } from '../../slices/collections.slice';
12
+ import { activateLabelsView, selectActiveLabel, toggleLabelsTree } from '../../slices/labels.slice';
9
13
  import { activateFoldersView, selectCurrentFolder, toggleFoldersTree } from '../../slices/folders.slice';
10
14
  import { activateAssetsView } from '../AssetsView/AssetsView.thunks';
11
15
 
12
16
  // VIEW_IDS not in this file but inside @scaleflex/widget-utils/lib/constants
13
17
  // so it's easier to be imported from external project to be re-used in opts.
14
18
 
15
- export var VIEW_COMPONENTS = _defineProperty(_defineProperty({}, VIEW_IDS.ASSETS, AssetsView), VIEW_IDS.FOLDERS, FoldersView);
16
- export var VIEW_OPTIONS = _defineProperty(_defineProperty({}, VIEW_IDS.ASSETS, {
19
+ export var VIEW_COMPONENTS = _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, VIEW_IDS.ASSETS, AssetsView), VIEW_IDS.FOLDERS, FoldersView), VIEW_IDS.COLLECTIONS, CollectionsView), VIEW_IDS.LABELS, LabelsView);
20
+ export var VIEW_OPTIONS = _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, VIEW_IDS.ASSETS, {
17
21
  id: VIEW_IDS.ASSETS,
18
22
  i18nKey: 'viewModeAllAssetsLabel',
19
23
  icon: Assets,
@@ -26,4 +30,26 @@ export var VIEW_OPTIONS = _defineProperty(_defineProperty({}, VIEW_IDS.ASSETS, {
26
30
  activateAction: activateFoldersView,
27
31
  toggleTreeAction: toggleFoldersTree,
28
32
  activeItemSelector: selectCurrentFolder
33
+ }), VIEW_IDS.COLLECTIONS, {
34
+ id: VIEW_IDS.COLLECTIONS,
35
+ i18nKey: 'viewModeCollectionsLabel',
36
+ icon: Collections,
37
+ activateAction: activateCollectionsView,
38
+ toggleTreeAction: toggleCollectionsTree,
39
+ checkVisibility: function checkVisibility(_ref) {
40
+ var checkUserPermissions = _ref.checkUserPermissions;
41
+ return checkUserPermissions([PERMISSIONS.COLLECTIONS_LIST]);
42
+ },
43
+ activeItemSelector: selectCollectionsActiveVirtualFolder
44
+ }), VIEW_IDS.LABELS, {
45
+ id: VIEW_IDS.LABELS,
46
+ i18nKey: 'viewModeLabels',
47
+ icon: Label,
48
+ activateAction: activateLabelsView,
49
+ toggleTreeAction: toggleLabelsTree,
50
+ checkVisibility: function checkVisibility(_ref2) {
51
+ var checkUserPermissions = _ref2.checkUserPermissions;
52
+ return checkUserPermissions([PERMISSIONS.LABELS_LIST]);
53
+ },
54
+ activeItemSelector: selectActiveLabel
29
55
  });
@@ -1,12 +1,13 @@
1
1
  import { memo, useEffect } from 'react';
2
2
  import { useSelector, useDispatch } from 'react-redux';
3
- import { FMAW_URL_QUERY_PARAMS, PERMISSIONS } from '@scaleflex/widget-utils/lib/constants';
3
+ import { FMAW_URL_QUERY_PARAMS, PERMISSIONS, VIEW_IDS } from '@scaleflex/widget-utils/lib/constants';
4
4
  import { useUpdateEffect } from '@scaleflex/widget-common/lib/hooks';
5
5
  import { useContextMenu, useCore } from '@scaleflex/widget-core/lib/hooks';
6
6
  import { useExplorer, useLocateFile } from '../../hooks';
7
- import { VIEW_COMPONENTS } from './Views.constants';
8
- import { activateViewFromOutside, searchOrListViewFiles, selectActiveView, selectViewLayout } from '../../slices/views.slice';
9
- import { fetchLabels } from '../../slices/common.slice';
7
+ import { VIEW_COMPONENTS, VIEW_OPTIONS } from './Views.constants';
8
+ import { activateViewFromOutside, searchOrListViewFiles, selectActiveView, selectViewLayout, selectIsCollectionsViewAvailable } from '../../slices/views.slice';
9
+ import { fetchCollections } from '../../slices/collections.slice';
10
+ import { fetchLabels } from '../../slices/labels.slice';
10
11
  import Styled from './Views.styled';
11
12
  import { loadSearchFromOutside } from '../../slices/search.slice';
12
13
  import { loadFiltersFromOutside } from '../../slices/filters.slice';
@@ -19,6 +20,7 @@ var Views = function Views() {
19
20
  opts = _useExplorer.opts,
20
21
  getUrlQueryParam = _useExplorer.getUrlQueryParam,
21
22
  isUrlPathUpdateDismissed = _useExplorer.isUrlPathUpdateDismissed;
23
+ var isCollectionsViewAvailable = useSelector(selectIsCollectionsViewAvailable);
22
24
  var viewLayout = useSelector(selectViewLayout);
23
25
  var activeViewId = useSelector(selectActiveView);
24
26
  var locateFile = useLocateFile();
@@ -44,7 +46,12 @@ var Views = function Views() {
44
46
  }
45
47
  };
46
48
  useEffect(function () {
49
+ var _getUrlQueryParam;
50
+ var viewFromUrl = VIEW_OPTIONS[(_getUrlQueryParam = getUrlQueryParam(FMAW_URL_QUERY_PARAMS.VIEW)) === null || _getUrlQueryParam === void 0 ? void 0 : _getUrlQueryParam.toUpperCase()];
47
51
  activateViewFromUrl();
52
+ if (![activeViewId, viewFromUrl].includes(VIEW_IDS.COLLECTIONS) && !opts.defaultCollectionUuid && isCollectionsViewAvailable && checkUserPermissions([PERMISSIONS.COLLECTIONS_LIST])) {
53
+ dispatch(fetchCollections());
54
+ }
48
55
  if (checkUserPermissions([PERMISSIONS.LABELS_LIST])) {
49
56
  dispatch(fetchLabels());
50
57
  }
@@ -6,7 +6,7 @@ import isEmptyObject from '@scaleflex/widget-utils/lib/isEmptyObject';
6
6
  import { Label } from '@scaleflex/icons';
7
7
  import { EllipsedText } from '@scaleflex/ui/core';
8
8
  import getMetadataFieldVariantValue from '@scaleflex/widget-utils/lib/metadata/getMetadataFieldVariantValue';
9
- import { selectLabelsArray } from '../../../slices/common.slice';
9
+ import { selectLabelsArray } from '../../../slices/labels.slice';
10
10
  import { filterFilesByTagOnly } from '../../../slices/filters.slice';
11
11
  import { selectMetadataRegionalFilters } from '../../../slices/metadata.slice';
12
12
  import Styled from './FileMetadataFieldValue.styled';
@@ -52,10 +52,37 @@ var FOLDER_TREE_SORT_OPTIONS = [{
52
52
  i18nLabelKey: 'sortOptionsByAssetsSize',
53
53
  value: SORT_BY.SIZE
54
54
  }];
55
+ var COLLECTIONS_FOLDERS_SORT_OPTIONS = [{
56
+ i18nLabelKey: 'sortOptionsByNameLabel',
57
+ value: SORT_BY.NAME
58
+ }];
59
+ var COLLECTIONS_SORT_OPTIONS = [{
60
+ i18nLabelKey: 'sortOptionsByNameLabel',
61
+ value: SORT_BY.TITLE
62
+ }, {
63
+ i18nLabelKey: 'sortOptionsByCreatedDateLabel',
64
+ value: SORT_BY.CREATED_AT
65
+ }];
66
+ var LABELS_SORT_OPTIONS = [{
67
+ i18nLabelKey: 'labelsListLabelNameLabel',
68
+ value: SORT_BY.NAME
69
+ }, {
70
+ i18nLabelKey: 'sortOptionsByCreatedDateLabel',
71
+ value: SORT_BY.CREATED_AT
72
+ }, {
73
+ i18nLabelKey: 'labelsListColorLabel',
74
+ value: SORT_BY.COLOR
75
+ }, {
76
+ i18nLabelKey: 'listViewTableColHeaderSize',
77
+ value: SORT_BY.ASSETS_COUNT
78
+ }, {
79
+ i18nLabelKey: 'mutualizedLastModifyLabel',
80
+ value: SORT_BY.LAST_MODIFY
81
+ }];
55
82
 
56
83
  // The object's props (by & order ) be overridden with config.defaultSort if provided with any valid sort by/order value.
57
84
  var DEFAULT_SORT_OPTION = {
58
85
  by: SORT_BY.NAME,
59
86
  order: SORT_ORDER.ASC
60
87
  };
61
- export { SORT_BY, SORT_ORDER, MAIN_SORT_OPTIONS, FOLDER_TREE_SORT_OPTIONS, SEARCH_MODE_SORT_OPTIONS, DEFAULT_SORT_OPTION };
88
+ export { SORT_BY, SORT_ORDER, MAIN_SORT_OPTIONS, FOLDER_TREE_SORT_OPTIONS, SEARCH_MODE_SORT_OPTIONS, DEFAULT_SORT_OPTION, COLLECTIONS_FOLDERS_SORT_OPTIONS, COLLECTIONS_SORT_OPTIONS, LABELS_SORT_OPTIONS };
@@ -1357,5 +1357,40 @@ export default {
1357
1357
  explorerFileWindowAddPresetDescLabel: 'Description',
1358
1358
  explorerFileWindowPresetAddedInfo: 'Preset is added!',
1359
1359
  explorerFileWindowAddPresetNameRegexError: '{ , } , | , \\ , ^ , ~ , @ , spaces , ` and , characters are not allowed',
1360
- explorerFoldersViewTopBarNewFolderButton: 'Add folder'
1360
+ explorerFoldersViewTopBarNewFolderButton: 'Add folder',
1361
+ viewModeCollectionsLabel: 'Collections',
1362
+ collectionsWithCountLabel: 'Collections (%{count})',
1363
+ collectionsDefaultCollectionError: 'Collection is not found',
1364
+ collectionsDefaultCollectionErrorDescription: 'Either collection is removed/invalid or private',
1365
+ labelsDefaultLabelError: 'Label is not found',
1366
+ labelsDefaultLabelErrorDescription: 'Either label is removed/invalid or private',
1367
+ mutualizedSearchCollectionPlaceholder: 'Search',
1368
+ mutualizedNoCollectionsLabel: 'No collections yet',
1369
+ collectionDialogSearchHint: 'Search a collection',
1370
+ collectionDialogNoMatches: 'No exact matches found',
1371
+ collectionsTreeNoGroupsFoldersLabel: 'No collection groups folders',
1372
+ collectionsTreeGroupsSearchPlaceholder: 'Search groups',
1373
+ collectionsTreeBackToAllCollectionsButton: 'Back to all collections',
1374
+ collectionsViewBreadcrumbLabel: 'Collection:',
1375
+ collectionsViewBreadcrumbNotSelectedLabel: 'Not selected',
1376
+ explorerCollectionsViewEmptyText: 'Collection has no files yet',
1377
+ explorerCollectionsViewEmptyHint: 'Add the collection\'s metadata to the file to reflect here',
1378
+ explorerCollectionsViewNoCollectionsLabel: 'No assets in collections yet',
1379
+ explorerCollectionsViewManageNoCollectionsLabel: 'No collections found',
1380
+ viewModeLabels: 'Labels',
1381
+ headerBarSearchLabel: 'Search labels',
1382
+ labelsTreeNoLabels: 'No labels yet',
1383
+ labelsTreeTitle: 'Labels',
1384
+ labelsTreeSearchPlaceholder: 'Search labels',
1385
+ collectionsTreeSearchPlaceholder: 'Search collections',
1386
+ labelsTreeAllLabelsLabel: 'All labels',
1387
+ labelsMenuSearchHint: 'Search a label',
1388
+ mutualizedLabelsLabel: 'Labels',
1389
+ labelsViewBreadcrumbLabel: 'Label',
1390
+ labelsListAmountLabel: 'Amount',
1391
+ explorerLabelsViewEmptyText: 'Label has no files yet',
1392
+ explorerLabelsViewEmptyTitle: 'No labeled assets yet',
1393
+ explorerLabelsViewEmptyHint: 'Add labels to assets that you want to easily find later.',
1394
+ explorerLabelsViewManageModalNoLabelsTitle: 'No labels yet',
1395
+ collectionsTreeTitle: 'Collections'
1361
1396
  };