@scaleflex/widget-explorer 4.5.0 → 4.5.4
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/CHANGELOG.md +35 -0
- package/README.md +21 -3
- package/dist/style.css +2 -0
- package/dist/style.min.css +1 -1
- package/lib/components/ActionBar/DownloadWithExportButton.js +32 -4
- package/lib/components/AssetsList/ListView/AssetsSection/AssetsSectionTableRow.js +1 -1
- package/lib/components/Breadcrumbs/index.js +114 -6
- package/lib/components/CollectionsView/CollectionFolderIcon.js +35 -0
- package/lib/components/CollectionsView/CollectionVirtualFoldersTree/CollectionTreeSkeletion.js +26 -0
- package/lib/components/CollectionsView/CollectionVirtualFoldersTree/CollectionVirtualFoldersTree.styled.js +52 -0
- package/lib/components/CollectionsView/CollectionVirtualFoldersTree/CollectionVirtualFoldersTree.utils.js +24 -0
- package/lib/components/CollectionsView/CollectionVirtualFoldersTree/Folder.js +88 -0
- package/lib/components/CollectionsView/CollectionVirtualFoldersTree/Tree.js +50 -0
- package/lib/components/CollectionsView/CollectionVirtualFoldersTree/index.js +75 -0
- package/lib/components/CollectionsView/CollectionsSkeleton.js +30 -0
- package/lib/components/CollectionsView/CollectionsTree/ActiveCollectionContent.js +61 -0
- package/lib/components/CollectionsView/CollectionsTree/CollectionTreeItem.js +44 -0
- package/lib/components/CollectionsView/CollectionsTree/CollectionsContent.js +130 -0
- package/lib/components/CollectionsView/CollectionsTree/CollectionsTree.styled.js +84 -0
- package/lib/components/CollectionsView/CollectionsTree/index.js +47 -0
- package/lib/components/CollectionsView/CollectionsView.styled.js +38 -0
- package/lib/components/CollectionsView/VirtualFoldersGrid.js +67 -0
- package/lib/components/CollectionsView/index.js +188 -0
- package/lib/components/Details/Details.constants.js +1 -0
- package/lib/components/EmptyViewPlaceholder/EmptyViewPlaceholder.styled.js +1 -1
- package/lib/components/FileItem/FileInfo/index.js +8 -2
- package/lib/components/FileWindowPanel/FileTabs/VariationsTab/VariationsTabNavigator.js +1 -7
- package/lib/components/FileWindowPanel/FileTabs/VariationsTab/index.js +4 -1
- package/lib/components/FileWindowPanel/Header/index.js +9 -0
- package/lib/components/Filters/hooks/useFilters.js +3 -2
- package/lib/components/HeaderBar/index.js +6 -2
- package/lib/components/LabelsView/LabelsTree/LabelsTree.styled.js +86 -0
- package/lib/components/LabelsView/LabelsTree/LabelsTreeSkeleton.js +21 -0
- package/lib/components/LabelsView/LabelsTree/index.js +128 -0
- package/lib/components/LabelsView/LabelsView.styled.js +10 -0
- package/lib/components/LabelsView/index.js +139 -0
- package/lib/components/Modals/DownloadConsent/DownloadConsent.hooks.js +11 -0
- package/lib/components/Modals/TransformedDownload/TransformedDownload.hooks.js +9 -0
- package/lib/components/Views/Views.constants.js +30 -4
- package/lib/components/Views/index.js +11 -4
- package/lib/components/common/FileMetadataFieldValue/GeneralMetadataFieldValue.js +1 -1
- package/lib/components/common/Sort/Sort.constants.js +28 -1
- package/lib/defaultLocale.js +36 -1
- package/lib/slices/collections.slice.js +714 -0
- package/lib/slices/common.slice.js +15 -52
- package/lib/slices/files.slice.js +6 -3
- package/lib/slices/index.js +5 -1
- package/lib/slices/labels.slice.js +652 -0
- package/lib/slices/views.slice.js +12 -0
- package/lib/utils/prepareSearchUrl.js +10 -0
- package/package.json +8 -8
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14;
|
|
2
|
+
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
3
|
+
import { FV, PC, PSH } from '@scaleflex/widget-common';
|
|
4
|
+
import { IconButton as SfxIconButton } from '@scaleflex/ui/core';
|
|
5
|
+
import styled from 'styled-components';
|
|
6
|
+
var Container = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n gap: 16px;\n padding-bottom: 24px;\n height: 100%;\n"])));
|
|
7
|
+
var Title = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n ", "\n color: ", ";\n padding: 32px 24px 0 24px;\n"])), function (_ref) {
|
|
8
|
+
var font = _ref.theme.typography.font;
|
|
9
|
+
return font[FV.TitleH4];
|
|
10
|
+
}, function (_ref2) {
|
|
11
|
+
var palette = _ref2.theme.palette;
|
|
12
|
+
return palette[PC.TextPrimary];
|
|
13
|
+
});
|
|
14
|
+
var LabelItemIcon = styled.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: flex;\n\n svg {\n color: ", ";\n }\n"])), function (_ref3) {
|
|
15
|
+
var palette = _ref3.theme.palette;
|
|
16
|
+
return palette[PC.IconsPrimary];
|
|
17
|
+
});
|
|
18
|
+
var SearchWrapper = styled.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n padding: 0 24px 0 24px;\n"])));
|
|
19
|
+
var AddLabelBtnWrapper = styled.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n padding: 0 24px;\n height: 36px;\n\n .SfxButton-StartIcon {\n margin-right: 4px;\n }\n\n .SfxButton-Label{\n font-weight: 500;\n }\n"])));
|
|
20
|
+
var SettingsWrapper = styled.div(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n padding: 0;\n gap: 10px;\n padding: 0 24px;\n width: 100%;\n"])));
|
|
21
|
+
var NameLabel = styled.span(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n ", "\n color: ", ";\n"])), function (_ref4) {
|
|
22
|
+
var font = _ref4.theme.typography.font;
|
|
23
|
+
return font[FV.LabelMedium];
|
|
24
|
+
}, function (_ref5) {
|
|
25
|
+
var palette = _ref5.theme.palette;
|
|
26
|
+
return palette[PC.LinkStateless];
|
|
27
|
+
});
|
|
28
|
+
var SortingWrapper = styled.div(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n flex-grow: 1;\n gap: 4px;\n height: 32px;\n"])));
|
|
29
|
+
var IconButton = styled(SfxIconButton)(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n &:focus,\n &:active {\n background: transparent;\n color: ", ";\n }\n\n &:hover {\n background: ", ";\n color: ", ";\n }\n"])), function (_ref6) {
|
|
30
|
+
var palette = _ref6.theme.palette;
|
|
31
|
+
return palette[PC.LinkStateless];
|
|
32
|
+
}, function (_ref7) {
|
|
33
|
+
var palette = _ref7.theme.palette;
|
|
34
|
+
return palette[PC.BackgroundHover];
|
|
35
|
+
}, function (_ref8) {
|
|
36
|
+
var palette = _ref8.theme.palette;
|
|
37
|
+
return palette[PC.IconsPrimaryHover];
|
|
38
|
+
});
|
|
39
|
+
var SettingsBtnWrapper = styled(SfxIconButton)(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n width: 36px;\n height: 36px;\n padding: 1px 6px;\n border: 1px solid ", ";\n box-shadow: ", ";\n background: ", ";\n"])), function (_ref9) {
|
|
40
|
+
var palette = _ref9.theme.palette;
|
|
41
|
+
return palette[PC.IconsPrimary];
|
|
42
|
+
}, function (_ref10) {
|
|
43
|
+
var theme = _ref10.theme;
|
|
44
|
+
return theme.shadows[PSH.ShadowMd];
|
|
45
|
+
}, function (_ref11) {
|
|
46
|
+
var palette = _ref11.theme.palette;
|
|
47
|
+
return palette[PC.BackgroundStateless];
|
|
48
|
+
});
|
|
49
|
+
var LabelsWrapper = styled.div(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["\n overflow-y: overlay;\n"])));
|
|
50
|
+
var LabelItemLabel = styled.div(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral(["\n overflow: hidden;\n ", "\n color: ", ";\n"])), function (_ref12) {
|
|
51
|
+
var font = _ref12.theme.typography.font;
|
|
52
|
+
return font[FV.LabelMedium];
|
|
53
|
+
}, function (_ref13) {
|
|
54
|
+
var palette = _ref13.theme.palette;
|
|
55
|
+
return palette[PC.TextPrimary];
|
|
56
|
+
});
|
|
57
|
+
var LabelItem = styled.div(_templateObject13 || (_templateObject13 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n height: 36px;\n gap: 6px;\n cursor: pointer;\n border-radius: 4px;\n margin: 0 24px;\n padding-left: 17px;\n\n &:hover {\n background: ", ";\n }\n\n ", "\n\n ", "\n"])), function (_ref14) {
|
|
58
|
+
var palette = _ref14.theme.palette;
|
|
59
|
+
return palette[PC.BackgroundHover];
|
|
60
|
+
}, function (_ref15) {
|
|
61
|
+
var $bg = _ref15.$bg;
|
|
62
|
+
return $bg ? "\n ".concat(LabelItemIcon, " {\n svg {\n color: ").concat($bg, ";\n }\n }\n ") : '';
|
|
63
|
+
}, function (_ref16) {
|
|
64
|
+
var $active = _ref16.$active,
|
|
65
|
+
$bg = _ref16.$bg,
|
|
66
|
+
palette = _ref16.theme.palette;
|
|
67
|
+
return $active ? "\n background: ".concat(palette[PC.BackgroundActive], " !important;\n\n ").concat(LabelItemLabel, " {\n color: ").concat(palette[PC.AccentStateless], ";\n }\n\n ").concat(LabelItemIcon, " {\n svg {\n color: ").concat($bg || palette[PC.AccentStateless], ";\n }\n }\n ") : '';
|
|
68
|
+
});
|
|
69
|
+
var NoItemsWrapper = styled.div(_templateObject14 || (_templateObject14 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n gap: 12px;\n padding: 0 24px;\n\n svg {\n width: 150px;\n height: 60px;\n }\n"])));
|
|
70
|
+
var Styled = {
|
|
71
|
+
Container: Container,
|
|
72
|
+
Title: Title,
|
|
73
|
+
SearchWrapper: SearchWrapper,
|
|
74
|
+
AddLabelBtnWrapper: AddLabelBtnWrapper,
|
|
75
|
+
SettingsWrapper: SettingsWrapper,
|
|
76
|
+
SortingWrapper: SortingWrapper,
|
|
77
|
+
NameLabel: NameLabel,
|
|
78
|
+
SettingsBtnWrapper: SettingsBtnWrapper,
|
|
79
|
+
LabelsWrapper: LabelsWrapper,
|
|
80
|
+
LabelItem: LabelItem,
|
|
81
|
+
LabelItemIcon: LabelItemIcon,
|
|
82
|
+
LabelItemLabel: LabelItemLabel,
|
|
83
|
+
IconButton: IconButton,
|
|
84
|
+
NoItemsWrapper: NoItemsWrapper
|
|
85
|
+
};
|
|
86
|
+
export default Styled;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Skeleton } from '@scaleflex/ui/core';
|
|
2
|
+
import Styled from './LabelsTree.styled';
|
|
3
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
|
+
var LabelsTreeSkeleton = function LabelsTreeSkeleton() {
|
|
5
|
+
return /*#__PURE__*/_jsx(Styled.LabelsWrapper, {
|
|
6
|
+
children: Array(10).fill().map(function (_, index) {
|
|
7
|
+
return /*#__PURE__*/_jsxs(Styled.LabelItem, {
|
|
8
|
+
children: [/*#__PURE__*/_jsx(Styled.LabelItemIcon, {
|
|
9
|
+
children: /*#__PURE__*/_jsx(Skeleton, {
|
|
10
|
+
width: 14
|
|
11
|
+
})
|
|
12
|
+
}), /*#__PURE__*/_jsx(Styled.LabelItemLabel, {
|
|
13
|
+
children: /*#__PURE__*/_jsx(Skeleton, {
|
|
14
|
+
width: 220
|
|
15
|
+
})
|
|
16
|
+
})]
|
|
17
|
+
}, index);
|
|
18
|
+
})
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
export default LabelsTreeSkeleton;
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
2
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
4
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
5
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
7
|
+
import { useCallback, useState } from 'react';
|
|
8
|
+
import { useDispatch, useSelector } from 'react-redux';
|
|
9
|
+
import { useDebounce } from '@scaleflex/widget-common/lib/hooks';
|
|
10
|
+
import { Asc, Desc, Label } from '@scaleflex/icons';
|
|
11
|
+
import { Search, EllipsedText, TextWithHighlights } from '@scaleflex/ui/core';
|
|
12
|
+
import NoItems from '@scaleflex/widget-explorer/lib/components/NoItems';
|
|
13
|
+
import { labelsSearchTermUpdated, selectActiveLabelUuid, selectLabelsSearchTerm, selectLabelsBySearchTerm, selectLabelsArray, activateLabel, selectIsLabelsLoading } from '../../../slices/labels.slice';
|
|
14
|
+
import { useExplorer } from '../../../hooks';
|
|
15
|
+
import LabelsTreeSkeleton from './LabelsTreeSkeleton';
|
|
16
|
+
import Styled from './LabelsTree.styled';
|
|
17
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
18
|
+
var LabelsTree = function LabelsTree() {
|
|
19
|
+
var dispatch = useDispatch();
|
|
20
|
+
var _useExplorer = useExplorer(),
|
|
21
|
+
i18n = _useExplorer.i18n,
|
|
22
|
+
opts = _useExplorer.opts;
|
|
23
|
+
var activeLabelUuid = useSelector(selectActiveLabelUuid);
|
|
24
|
+
var isLabelsLoading = useSelector(selectIsLabelsLoading);
|
|
25
|
+
var labelsSearchTerm = useSelector(selectLabelsSearchTerm);
|
|
26
|
+
var debouncedLabelsSearchTerm = useDebounce(labelsSearchTerm, 300);
|
|
27
|
+
var labelsCount = useSelector(function (state) {
|
|
28
|
+
return selectLabelsArray(state).length;
|
|
29
|
+
});
|
|
30
|
+
var filteredLabels = useSelector(function (state) {
|
|
31
|
+
return selectLabelsBySearchTerm(state, debouncedLabelsSearchTerm);
|
|
32
|
+
});
|
|
33
|
+
var _useState = useState(false),
|
|
34
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
35
|
+
isDesc = _useState2[0],
|
|
36
|
+
setIsDesc = _useState2[1];
|
|
37
|
+
var showSort = opts.showSort;
|
|
38
|
+
var sortedLabels = filteredLabels.sort(function (labelA, labelB) {
|
|
39
|
+
return isDesc ? labelB === null || labelB === void 0 ? void 0 : labelB.name.localeCompare(labelA === null || labelA === void 0 ? void 0 : labelA.name) : labelA === null || labelA === void 0 ? void 0 : labelA.name.localeCompare(labelB === null || labelB === void 0 ? void 0 : labelB.name);
|
|
40
|
+
});
|
|
41
|
+
var isNoSearchedLabelsFound = (sortedLabels === null || sortedLabels === void 0 ? void 0 : sortedLabels.length) === 0;
|
|
42
|
+
var setLabelsSearchTerm = useCallback(function (_ref) {
|
|
43
|
+
var value = _ref.target.value;
|
|
44
|
+
dispatch(labelsSearchTermUpdated(value));
|
|
45
|
+
}, []);
|
|
46
|
+
var handleSortingLabels = function handleSortingLabels() {
|
|
47
|
+
setIsDesc(function (isDesc) {
|
|
48
|
+
return !isDesc;
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
var renderNoItems = function renderNoItems() {
|
|
52
|
+
if (labelsCount === 0) {
|
|
53
|
+
return /*#__PURE__*/_jsx(NoItems, {
|
|
54
|
+
iconWidth: 150,
|
|
55
|
+
iconHeight: 60,
|
|
56
|
+
secondary: i18n('labelsTreeNoLabels'),
|
|
57
|
+
mt: 64,
|
|
58
|
+
isTreeView: true
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
if ((sortedLabels || []).length === 0) {
|
|
62
|
+
return /*#__PURE__*/_jsx(Styled.NoItemsWrapper, {
|
|
63
|
+
children: /*#__PURE__*/_jsx(NoItems, {
|
|
64
|
+
noSearchResults: true,
|
|
65
|
+
smallItemsGap: true,
|
|
66
|
+
mt: 60,
|
|
67
|
+
primary: i18n('mutualizedNoResults'),
|
|
68
|
+
secondary: i18n('mutualizedTryAnotherSearch')
|
|
69
|
+
})
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
return null;
|
|
73
|
+
};
|
|
74
|
+
return /*#__PURE__*/_jsxs(Styled.Container, {
|
|
75
|
+
children: [/*#__PURE__*/_jsx(Styled.Title, {
|
|
76
|
+
children: i18n('labelsTreeTitle')
|
|
77
|
+
}), /*#__PURE__*/_jsx(Styled.SearchWrapper, {
|
|
78
|
+
children: /*#__PURE__*/_jsx(Search, {
|
|
79
|
+
value: labelsSearchTerm,
|
|
80
|
+
onChange: setLabelsSearchTerm,
|
|
81
|
+
placeholder: i18n('labelsTreeSearchPlaceholder'),
|
|
82
|
+
disabled: labelsCount === 0,
|
|
83
|
+
size: "sm",
|
|
84
|
+
fullWidth: true,
|
|
85
|
+
focusOnMount: true,
|
|
86
|
+
"data-testid": "labels-tree-search"
|
|
87
|
+
})
|
|
88
|
+
}), !isNoSearchedLabelsFound && /*#__PURE__*/_jsx(Styled.SettingsWrapper, {
|
|
89
|
+
children: showSort && /*#__PURE__*/_jsxs(Styled.SortingWrapper, {
|
|
90
|
+
children: [/*#__PURE__*/_jsx(Styled.NameLabel, {
|
|
91
|
+
children: i18n('sortOptionsByNameLabel')
|
|
92
|
+
}), /*#__PURE__*/_jsx(Styled.IconButton, {
|
|
93
|
+
color: "basic",
|
|
94
|
+
onClick: handleSortingLabels,
|
|
95
|
+
children: isDesc ? /*#__PURE__*/_jsx(Desc, {
|
|
96
|
+
size: 14
|
|
97
|
+
}) : /*#__PURE__*/_jsx(Asc, {
|
|
98
|
+
size: 14
|
|
99
|
+
})
|
|
100
|
+
})]
|
|
101
|
+
})
|
|
102
|
+
}), isLabelsLoading ? /*#__PURE__*/_jsx(LabelsTreeSkeleton, {}) : /*#__PURE__*/_jsx(Styled.LabelsWrapper, {
|
|
103
|
+
children: sortedLabels.map(function (label) {
|
|
104
|
+
return /*#__PURE__*/_jsxs(Styled.LabelItem, {
|
|
105
|
+
$active: activeLabelUuid === label.uuid,
|
|
106
|
+
$bg: label.color,
|
|
107
|
+
onClick: function onClick() {
|
|
108
|
+
return dispatch(activateLabel({
|
|
109
|
+
uuid: label.uuid
|
|
110
|
+
}));
|
|
111
|
+
},
|
|
112
|
+
children: [/*#__PURE__*/_jsx(Styled.LabelItemIcon, {
|
|
113
|
+
children: /*#__PURE__*/_jsx(Label, {})
|
|
114
|
+
}), /*#__PURE__*/_jsx(Styled.LabelItemLabel, {
|
|
115
|
+
children: /*#__PURE__*/_jsx(EllipsedText, {
|
|
116
|
+
maxLinesCount: 1,
|
|
117
|
+
children: /*#__PURE__*/_jsx(TextWithHighlights, {
|
|
118
|
+
text: label.name,
|
|
119
|
+
highlightText: debouncedLabelsSearchTerm
|
|
120
|
+
})
|
|
121
|
+
})
|
|
122
|
+
})]
|
|
123
|
+
}, label.sid);
|
|
124
|
+
})
|
|
125
|
+
}), !isLabelsLoading && renderNoItems()]
|
|
126
|
+
});
|
|
127
|
+
};
|
|
128
|
+
export default LabelsTree;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
var _templateObject, _templateObject2;
|
|
2
|
+
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
3
|
+
import styled from 'styled-components';
|
|
4
|
+
var BrowserBody = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n flex: 1;\n z-index: 1000;\n position: relative;\n display: flex;\n overflow: hidden;\n"])));
|
|
5
|
+
var ViewBody = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n overflow-y: auto;\n"])));
|
|
6
|
+
var Styled = {
|
|
7
|
+
BrowserBody: BrowserBody,
|
|
8
|
+
ViewBody: ViewBody
|
|
9
|
+
};
|
|
10
|
+
export default Styled;
|
|
@@ -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 {
|
|
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/
|
|
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 };
|
package/lib/defaultLocale.js
CHANGED
|
@@ -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
|
};
|