@bigbinary/neeto-folders-frontend 2.0.2 → 2.0.3

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.
@@ -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;
@@ -1322,8 +1324,7 @@ var FoldersList = function FoldersList(_ref) {
1322
1324
  var actions = useFolderActions(config);
1323
1325
  var subFolders = folderId ? folder === null || folder === void 0 ? void 0 : folder.children : folders;
1324
1326
  if (isNotPresent(subFolders)) return null;
1325
- return /*#__PURE__*/jsxs(FoldersContext, {
1326
- config: config,
1327
+ return /*#__PURE__*/jsxs(Fragment, {
1327
1328
  children: [/*#__PURE__*/jsx(Typography, {
1328
1329
  className: "my-3",
1329
1330
  style: "h4",
@@ -1368,19 +1369,32 @@ var FolderNode = function FolderNode(_ref) {
1368
1369
  var _isActive = _ref.isActive,
1369
1370
  folder = _ref.folder,
1370
1371
  link = _ref.link;
1372
+ var _useTranslation = useTranslation(),
1373
+ t = _useTranslation.t;
1374
+ var isPrivate = folder.isPrivate,
1375
+ name = folder.name;
1371
1376
  return /*#__PURE__*/jsx(NavLink, {
1372
1377
  activeClassName: "active",
1373
- className: "neeto-sidebar-folders-tree__folder-node block",
1378
+ className: "neeto-sidebar-folders-tree__folder-node",
1374
1379
  isActive: function isActive() {
1375
1380
  return _isActive;
1376
1381
  },
1377
1382
  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
1383
+ children: /*#__PURE__*/jsxs("div", {
1384
+ className: "flex items-center",
1385
+ children: [/*#__PURE__*/jsx(Typography, {
1386
+ className: "line-clamp-1 block truncate",
1387
+ component: "span",
1388
+ style: "body2",
1389
+ title: name,
1390
+ children: name
1391
+ }), isPrivate && /*#__PURE__*/jsx("span", {
1392
+ title: t("common.private"),
1393
+ children: /*#__PURE__*/jsx(Lock, {
1394
+ className: "flex-shrink-0",
1395
+ size: 20
1396
+ })
1397
+ })]
1384
1398
  })
1385
1399
  });
1386
1400
  };