@bigbinary/neeto-folders-frontend 2.0.10 → 2.0.11
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/dist/cjs/components.js +18 -5
- package/dist/cjs/components.js.map +1 -1
- package/dist/components.js +19 -6
- package/dist/components.js.map +1 -1
- package/package.json +5 -5
package/dist/components.js
CHANGED
|
@@ -34,7 +34,7 @@ import Down from '@bigbinary/neeto-icons/Down';
|
|
|
34
34
|
import Label from '@bigbinary/neetoui/Label';
|
|
35
35
|
import useHotkeys from '@bigbinary/neeto-hotkeys';
|
|
36
36
|
import Button from '@bigbinary/neetoui/Button';
|
|
37
|
-
import { noop, isNotPresent } from '@bigbinary/neeto-cist';
|
|
37
|
+
import { hyphenate, noop, isNotPresent } from '@bigbinary/neeto-cist';
|
|
38
38
|
import Radio from '@bigbinary/neetoui/Radio';
|
|
39
39
|
import { useDraggable, useDroppable, DndContext, DragOverlay, useSensors, useSensor, PointerSensor } from '@dnd-kit/core';
|
|
40
40
|
import Reorder from '@bigbinary/neeto-icons/Reorder';
|
|
@@ -526,6 +526,7 @@ var Node = function Node(_ref, ref) {
|
|
|
526
526
|
onClick: onClick,
|
|
527
527
|
ref: ref
|
|
528
528
|
})), {}, {
|
|
529
|
+
"data-cy": "".concat(hyphenate(folder.name), "-folder-node"),
|
|
529
530
|
className: classNames("relative my-1 flex cursor-pointer items-center px-2 py-1", className),
|
|
530
531
|
children: [icon, /*#__PURE__*/jsxs("div", {
|
|
531
532
|
className: "ml-2",
|
|
@@ -598,6 +599,7 @@ var _SelectableNode = function SelectableNode(_ref) {
|
|
|
598
599
|
readOnly: true,
|
|
599
600
|
checked: selection === folder.id,
|
|
600
601
|
className: "neeto-ui-radio__container",
|
|
602
|
+
"data-cy": "".concat(hyphenate(folder.name), "-folder-option"),
|
|
601
603
|
name: "move-folder-option"
|
|
602
604
|
}),
|
|
603
605
|
onClick: isDisabled ? noop : function () {
|
|
@@ -684,6 +686,7 @@ var PaneBody = function PaneBody(_ref) {
|
|
|
684
686
|
children: t("moveToFolder.title")
|
|
685
687
|
}), /*#__PURE__*/jsx(Button, {
|
|
686
688
|
className: "mr-2",
|
|
689
|
+
"data-cy": "add-new-folder-button",
|
|
687
690
|
label: t("folders.add"),
|
|
688
691
|
style: "link",
|
|
689
692
|
onClick: onAddFolder
|
|
@@ -708,23 +711,29 @@ var PaneBody = function PaneBody(_ref) {
|
|
|
708
711
|
className: "space-x-2",
|
|
709
712
|
children: [/*#__PURE__*/jsxs("div", {
|
|
710
713
|
className: "flex flex-1 space-x-2",
|
|
711
|
-
children: [/*#__PURE__*/jsx(Button, _objectSpread$8({
|
|
714
|
+
children: [/*#__PURE__*/jsx(Button, _objectSpread$8(_objectSpread$8({
|
|
712
715
|
disabled: selection === undefined,
|
|
713
716
|
label: t("common.save"),
|
|
714
717
|
style: "primary",
|
|
715
718
|
onClick: function onClick() {
|
|
716
719
|
return onSubmit(selection);
|
|
717
720
|
}
|
|
718
|
-
}, submitButtonProps)
|
|
721
|
+
}, submitButtonProps), {}, {
|
|
722
|
+
"data-cy": "save-changes-button"
|
|
723
|
+
})), /*#__PURE__*/jsx(Button, _objectSpread$8(_objectSpread$8({
|
|
719
724
|
label: t("common.cancel"),
|
|
720
725
|
style: "text",
|
|
721
726
|
onClick: onClose
|
|
722
|
-
}, cancelButtonProps)
|
|
723
|
-
|
|
727
|
+
}, cancelButtonProps), {}, {
|
|
728
|
+
"data-cy": "cancel-button"
|
|
729
|
+
}))]
|
|
730
|
+
}), onRemove && /*#__PURE__*/jsx(Button, _objectSpread$8(_objectSpread$8({
|
|
724
731
|
label: t("moveToFolder.remove"),
|
|
725
732
|
style: "tertiary",
|
|
726
733
|
onClick: onRemove
|
|
727
|
-
}, removeButtonProps)
|
|
734
|
+
}, removeButtonProps), {}, {
|
|
735
|
+
"data-cy": "remove-from-folder-button"
|
|
736
|
+
}))]
|
|
728
737
|
})]
|
|
729
738
|
});
|
|
730
739
|
};
|
|
@@ -1405,6 +1414,7 @@ var FolderTile = function FolderTile(_ref) {
|
|
|
1405
1414
|
metaInfo.push("".concat(folder.itemCount || 0, " ").concat(itemLabel).toLowerCase());
|
|
1406
1415
|
return /*#__PURE__*/jsxs(Link, {
|
|
1407
1416
|
className: "neeto-ui-bg-gray-50 neeto-ui-border-gray-200 neeto-ui-rounded-md hover:neeto-ui-border-primary-500 relative flex max-w-full items-start gap-2 border-2 p-3 transition-colors ease-in",
|
|
1417
|
+
"data-cy": "".concat(hyphenate(folder.name), "-folder-tile"),
|
|
1408
1418
|
to: link,
|
|
1409
1419
|
children: [/*#__PURE__*/jsx(Checkbox, {
|
|
1410
1420
|
checked: isSelected,
|
|
@@ -1420,6 +1430,7 @@ var FolderTile = function FolderTile(_ref) {
|
|
|
1420
1430
|
className: "flex min-w-0 flex-grow flex-col gap-2",
|
|
1421
1431
|
children: [/*#__PURE__*/jsx(Typography, {
|
|
1422
1432
|
className: "-mt-0.5 line-clamp-2 break-words pr-8",
|
|
1433
|
+
"data-cy": "folder-name",
|
|
1423
1434
|
lineHeight: "snug",
|
|
1424
1435
|
style: "body1",
|
|
1425
1436
|
title: folder.name,
|
|
@@ -1470,6 +1481,7 @@ var FoldersList = function FoldersList(_ref) {
|
|
|
1470
1481
|
children: t("folders.title")
|
|
1471
1482
|
}), /*#__PURE__*/jsx("div", {
|
|
1472
1483
|
className: "neeto-folders-grid-view-wrapper mb-10 grid w-full gap-4",
|
|
1484
|
+
"data-cy": "folders-list",
|
|
1473
1485
|
children: subFolders.map(function (folder) {
|
|
1474
1486
|
return /*#__PURE__*/createElement(FolderTile, {
|
|
1475
1487
|
actions: actions,
|
|
@@ -1520,6 +1532,7 @@ var FolderNode = function FolderNode(_ref) {
|
|
|
1520
1532
|
to: link,
|
|
1521
1533
|
children: /*#__PURE__*/jsxs("div", {
|
|
1522
1534
|
className: "flex items-center",
|
|
1535
|
+
"data-cy": "".concat(hyphenate(name), "-folder-sublink"),
|
|
1523
1536
|
children: [/*#__PURE__*/jsx(Typography, {
|
|
1524
1537
|
className: "line-clamp-1 block truncate",
|
|
1525
1538
|
component: "span",
|