@bigbinary/neeto-folders-frontend 2.0.2 → 2.0.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.
@@ -30,7 +30,7 @@ import { ConfigProvider, TreeSelect as TreeSelect$1 } from 'antd';
30
30
  import classNames from 'classnames';
31
31
  import Down from '@bigbinary/neeto-icons/Down';
32
32
  import Label from '@bigbinary/neetoui/Label';
33
- import { values, isEmpty, assoc, pick } from 'ramda';
33
+ import { values, isEmpty, assoc } from 'ramda';
34
34
  import Button from '@bigbinary/neetoui/Button';
35
35
  import { noop, isNotPresent } from '@bigbinary/neeto-cist';
36
36
  import Radio from '@bigbinary/neetoui/Radio';
@@ -41,6 +41,7 @@ import { createPortal } from 'react-dom';
41
41
  import MoreDropdown from '@bigbinary/neeto-molecules/MoreDropdown';
42
42
  import Checkbox from '@bigbinary/neetoui/Checkbox';
43
43
  import Tree from '@bigbinary/neetoui/Tree';
44
+ import Lock from '@bigbinary/neeto-icons/Lock';
44
45
  import 'zustand';
45
46
 
46
47
  function ownKeys$e(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; }
@@ -111,9 +112,10 @@ var FoldersAlerts = function FoldersAlerts(_ref) {
111
112
  if (isActive && folders) {
112
113
  var path = pathToFolder(folders, item.id);
113
114
  var parent = path[path.length - 2];
114
- history.replace(buildUrl(config.folderPath, _objectSpread$d(_objectSpread$d({}, queryParams), {}, {
115
- folderId: parent ? parent.sid : ""
116
- })));
115
+ var redirectUrl = parent ? buildUrl(config.folderPath, _objectSpread$d(_objectSpread$d({}, queryParams), {}, {
116
+ folderId: parent.sid
117
+ })) : "/";
118
+ history.replace(redirectUrl);
117
119
  }
118
120
  };
119
121
  destroyFolder(item.id, {
@@ -314,7 +316,7 @@ var createInitialValues = function createInitialValues(defaults, extraAttrs) {
314
316
  var createPayload = function createPayload(values, extraAttrs) {
315
317
  var payload = {
316
318
  name: values.name,
317
- parentId: values.parentId
319
+ parentId: values.parentId || ""
318
320
  };
319
321
  extraAttrs === null || extraAttrs === void 0 || extraAttrs.forEach(function (_ref2) {
320
322
  var name = _ref2.name;
@@ -1311,10 +1313,7 @@ var FoldersList = function FoldersList(_ref) {
1311
1313
  var params = useQueryParams();
1312
1314
  var _useTranslation = useTranslation(config),
1313
1315
  t = _useTranslation.t;
1314
- var fetchParams = pick(["sortBy", "orderBy"], params);
1315
- var _useFolders = useFolders(_objectSpread$2(_objectSpread$2({}, config), {}, {
1316
- params: fetchParams
1317
- })),
1316
+ var _useFolders = useFolders(config),
1318
1317
  folders = _useFolders.folders;
1319
1318
  var _useFolder = useFolder(config),
1320
1319
  folderId = _useFolder.folderId,
@@ -1322,8 +1321,7 @@ var FoldersList = function FoldersList(_ref) {
1322
1321
  var actions = useFolderActions(config);
1323
1322
  var subFolders = folderId ? folder === null || folder === void 0 ? void 0 : folder.children : folders;
1324
1323
  if (isNotPresent(subFolders)) return null;
1325
- return /*#__PURE__*/jsxs(FoldersContext, {
1326
- config: config,
1324
+ return /*#__PURE__*/jsxs(Fragment, {
1327
1325
  children: [/*#__PURE__*/jsx(Typography, {
1328
1326
  className: "my-3",
1329
1327
  style: "h4",
@@ -1368,19 +1366,32 @@ var FolderNode = function FolderNode(_ref) {
1368
1366
  var _isActive = _ref.isActive,
1369
1367
  folder = _ref.folder,
1370
1368
  link = _ref.link;
1369
+ var _useTranslation = useTranslation(),
1370
+ t = _useTranslation.t;
1371
+ var isPrivate = folder.isPrivate,
1372
+ name = folder.name;
1371
1373
  return /*#__PURE__*/jsx(NavLink, {
1372
1374
  activeClassName: "active",
1373
- className: "neeto-sidebar-folders-tree__folder-node block",
1375
+ className: "neeto-sidebar-folders-tree__folder-node",
1374
1376
  isActive: function isActive() {
1375
1377
  return _isActive;
1376
1378
  },
1377
1379
  to: link,
1378
- children: /*#__PURE__*/jsx(Typography, {
1379
- className: "line-clamp-1 block truncate",
1380
- component: "span",
1381
- style: "body2",
1382
- title: folder.name,
1383
- children: folder.name
1380
+ children: /*#__PURE__*/jsxs("div", {
1381
+ className: "flex items-center",
1382
+ children: [/*#__PURE__*/jsx(Typography, {
1383
+ className: "line-clamp-1 block truncate",
1384
+ component: "span",
1385
+ style: "body2",
1386
+ title: name,
1387
+ children: name
1388
+ }), isPrivate && /*#__PURE__*/jsx("span", {
1389
+ title: t("common.private"),
1390
+ children: /*#__PURE__*/jsx(Lock, {
1391
+ className: "flex-shrink-0",
1392
+ size: 20
1393
+ })
1394
+ })]
1384
1395
  })
1385
1396
  });
1386
1397
  };