@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.
@@ -9,7 +9,8 @@
9
9
  "folder": "Folder",
10
10
  "folders": "Folders",
11
11
  "item": "Item",
12
- "items": "Items"
12
+ "items": "Items",
13
+ "private": "Private"
13
14
  },
14
15
 
15
16
  "createFolder": {
@@ -43,6 +43,7 @@ var reactDom = require('react-dom');
43
43
  var MoreDropdown = require('@bigbinary/neeto-molecules/MoreDropdown');
44
44
  var Checkbox = require('@bigbinary/neetoui/Checkbox');
45
45
  var Tree = require('@bigbinary/neetoui/Tree');
46
+ var Lock = require('@bigbinary/neeto-icons/Lock');
46
47
  require('zustand');
47
48
 
48
49
  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; }
@@ -113,9 +114,10 @@ var FoldersAlerts = function FoldersAlerts(_ref) {
113
114
  if (isActive && folders) {
114
115
  var path = utils.pathToFolder(folders, item.id);
115
116
  var parent = path[path.length - 2];
116
- history.replace(utils$1.buildUrl(config.folderPath, _objectSpread$d(_objectSpread$d({}, queryParams), {}, {
117
- folderId: parent ? parent.sid : ""
118
- })));
117
+ var redirectUrl = parent ? utils$1.buildUrl(config.folderPath, _objectSpread$d(_objectSpread$d({}, queryParams), {}, {
118
+ folderId: parent.sid
119
+ })) : "/";
120
+ history.replace(redirectUrl);
119
121
  }
120
122
  };
121
123
  destroyFolder(item.id, {
@@ -316,7 +318,7 @@ var createInitialValues = function createInitialValues(defaults, extraAttrs) {
316
318
  var createPayload = function createPayload(values, extraAttrs) {
317
319
  var payload = {
318
320
  name: values.name,
319
- parentId: values.parentId
321
+ parentId: values.parentId || ""
320
322
  };
321
323
  extraAttrs === null || extraAttrs === void 0 || extraAttrs.forEach(function (_ref2) {
322
324
  var name = _ref2.name;
@@ -1324,8 +1326,7 @@ var FoldersList = function FoldersList(_ref) {
1324
1326
  var actions = useFolderActions.useFolderActions(config);
1325
1327
  var subFolders = folderId ? folder === null || folder === void 0 ? void 0 : folder.children : folders;
1326
1328
  if (neetoCist.isNotPresent(subFolders)) return null;
1327
- return /*#__PURE__*/jsxRuntime.jsxs(FoldersContext, {
1328
- config: config,
1329
+ return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
1329
1330
  children: [/*#__PURE__*/jsxRuntime.jsx(Typography, {
1330
1331
  className: "my-3",
1331
1332
  style: "h4",
@@ -1370,19 +1371,32 @@ var FolderNode = function FolderNode(_ref) {
1370
1371
  var _isActive = _ref.isActive,
1371
1372
  folder = _ref.folder,
1372
1373
  link = _ref.link;
1374
+ var _useTranslation = useTranslation(),
1375
+ t = _useTranslation.t;
1376
+ var isPrivate = folder.isPrivate,
1377
+ name = folder.name;
1373
1378
  return /*#__PURE__*/jsxRuntime.jsx(reactRouterDom.NavLink, {
1374
1379
  activeClassName: "active",
1375
- className: "neeto-sidebar-folders-tree__folder-node block",
1380
+ className: "neeto-sidebar-folders-tree__folder-node",
1376
1381
  isActive: function isActive() {
1377
1382
  return _isActive;
1378
1383
  },
1379
1384
  to: link,
1380
- children: /*#__PURE__*/jsxRuntime.jsx(Typography, {
1381
- className: "line-clamp-1 block truncate",
1382
- component: "span",
1383
- style: "body2",
1384
- title: folder.name,
1385
- children: folder.name
1385
+ children: /*#__PURE__*/jsxRuntime.jsxs("div", {
1386
+ className: "flex items-center",
1387
+ children: [/*#__PURE__*/jsxRuntime.jsx(Typography, {
1388
+ className: "line-clamp-1 block truncate",
1389
+ component: "span",
1390
+ style: "body2",
1391
+ title: name,
1392
+ children: name
1393
+ }), isPrivate && /*#__PURE__*/jsxRuntime.jsx("span", {
1394
+ title: t("common.private"),
1395
+ children: /*#__PURE__*/jsxRuntime.jsx(Lock, {
1396
+ className: "flex-shrink-0",
1397
+ size: 20
1398
+ })
1399
+ })]
1386
1400
  })
1387
1401
  });
1388
1402
  };