@bigbinary/neeto-tags-frontend 0.0.27 → 0.0.28
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/index.js +49 -35
- package/dist/index.js.map +1 -1
- package/package.json +4 -2
package/dist/index.js
CHANGED
|
@@ -18,7 +18,7 @@ import _createClass$1 from '@babel/runtime/helpers/createClass';
|
|
|
18
18
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
19
19
|
import { useHistory, Switch, Route } from 'react-router-dom';
|
|
20
20
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
21
|
-
import { Tag, Dropdown,
|
|
21
|
+
import { Tag, Dropdown, Toastr, Pane, Typography, Button, PageLoader, Table, Alert, Input as Input$1, Modal } from '@bigbinary/neetoui';
|
|
22
22
|
import * as yup from 'yup';
|
|
23
23
|
import { MenuHorizontal, Plus } from '@bigbinary/neeto-icons';
|
|
24
24
|
import _inheritsLoose from '@babel/runtime/helpers/esm/inheritsLoose';
|
|
@@ -3396,11 +3396,12 @@ var plcHolder = "Type to search tag…";
|
|
|
3396
3396
|
var manage = "Manage Tags";
|
|
3397
3397
|
var remove = "Remove {{tag}} tag";
|
|
3398
3398
|
var exists = "{{tag}} already exists.";
|
|
3399
|
+
var edit = "Edit";
|
|
3399
3400
|
var addTag = "Add Tag";
|
|
3400
3401
|
var selectOrCreate = "Select or Create tag";
|
|
3401
3402
|
var select = "Select {{what}}";
|
|
3402
3403
|
var search = "Search {{where}}";
|
|
3403
|
-
var addNew = "Add
|
|
3404
|
+
var addNew = "Add {{what}}";
|
|
3404
3405
|
var tag = "Tag";
|
|
3405
3406
|
var noTagsFound = "No Tags Found";
|
|
3406
3407
|
var deleteItem = "Are you sure you want to delete {{type}}";
|
|
@@ -3408,11 +3409,17 @@ var cannotBeUndone = "This action cannot be undone.";
|
|
|
3408
3409
|
var proceed = "Proceed";
|
|
3409
3410
|
var cancel = "Cancel";
|
|
3410
3411
|
var name = "Name";
|
|
3412
|
+
var required = "{{what}} is a required field.";
|
|
3413
|
+
var maxLength = "{{what}} must be less than {{length}} characters.";
|
|
3414
|
+
var type = "{{what}} must be a {{type}}.";
|
|
3411
3415
|
var description = "Description";
|
|
3412
3416
|
var editItem = "Edit {{what}}";
|
|
3413
3417
|
var createSuccess = "Tag created successfully.";
|
|
3414
3418
|
var updateSuccess = "Tag updated successfully.";
|
|
3415
3419
|
var deleteSuccess = "Tag deleted successfully.";
|
|
3420
|
+
var types = {
|
|
3421
|
+
string: "string"
|
|
3422
|
+
};
|
|
3416
3423
|
var merge$1 = {
|
|
3417
3424
|
sourceTag: "Source Tag",
|
|
3418
3425
|
destinationTag: "Destination Tag",
|
|
@@ -3432,6 +3439,8 @@ var en = {
|
|
|
3432
3439
|
remove: remove,
|
|
3433
3440
|
exists: exists,
|
|
3434
3441
|
"new": "Create new tag",
|
|
3442
|
+
"delete": "Delete",
|
|
3443
|
+
edit: edit,
|
|
3435
3444
|
addTag: addTag,
|
|
3436
3445
|
selectOrCreate: selectOrCreate,
|
|
3437
3446
|
select: select,
|
|
@@ -3444,11 +3453,15 @@ var en = {
|
|
|
3444
3453
|
proceed: proceed,
|
|
3445
3454
|
cancel: cancel,
|
|
3446
3455
|
name: name,
|
|
3456
|
+
required: required,
|
|
3457
|
+
maxLength: maxLength,
|
|
3458
|
+
type: type,
|
|
3447
3459
|
description: description,
|
|
3448
3460
|
editItem: editItem,
|
|
3449
3461
|
createSuccess: createSuccess,
|
|
3450
3462
|
updateSuccess: updateSuccess,
|
|
3451
3463
|
deleteSuccess: deleteSuccess,
|
|
3464
|
+
types: types,
|
|
3452
3465
|
merge: merge$1
|
|
3453
3466
|
};
|
|
3454
3467
|
|
|
@@ -3467,18 +3480,18 @@ instance.use(initReactI18next).init({
|
|
|
3467
3480
|
var DEFAULT_PAGE_INDEX = 1;
|
|
3468
3481
|
var DEFAULT_PAGE_SIZE = 10;
|
|
3469
3482
|
var COMMON_COLUMNS = [{
|
|
3470
|
-
title: "Name",
|
|
3483
|
+
title: instance.t("Name"),
|
|
3471
3484
|
dataIndex: "name",
|
|
3472
3485
|
key: "name",
|
|
3473
3486
|
render: function render(name) {
|
|
3474
3487
|
return /*#__PURE__*/React.createElement(Tag, {
|
|
3475
3488
|
label: name,
|
|
3476
|
-
|
|
3489
|
+
style: "secondary"
|
|
3477
3490
|
});
|
|
3478
3491
|
},
|
|
3479
3492
|
width: "30%"
|
|
3480
3493
|
}, {
|
|
3481
|
-
title: "Description",
|
|
3494
|
+
title: instance.t("Description"),
|
|
3482
3495
|
dataIndex: "description",
|
|
3483
3496
|
key: "description",
|
|
3484
3497
|
render: function render(description) {
|
|
@@ -3487,8 +3500,22 @@ var COMMON_COLUMNS = [{
|
|
|
3487
3500
|
width: "40%"
|
|
3488
3501
|
}];
|
|
3489
3502
|
var TAG_SCHEMA = yup.object({
|
|
3490
|
-
name: yup.string().typeError(
|
|
3491
|
-
|
|
3503
|
+
name: yup.string().typeError(instance.t("type", {
|
|
3504
|
+
what: instance.t("name"),
|
|
3505
|
+
type: instance.t("types.string")
|
|
3506
|
+
})).required(instance.t("required", {
|
|
3507
|
+
what: instance.t("name")
|
|
3508
|
+
})).max(50, instance.t("max", {
|
|
3509
|
+
what: instance.t("name"),
|
|
3510
|
+
max: 50
|
|
3511
|
+
})),
|
|
3512
|
+
description: yup.string().typeError(instance.t("type", {
|
|
3513
|
+
what: instance.t("description"),
|
|
3514
|
+
type: instance.t("types.string")
|
|
3515
|
+
})).nullable().max(100, instance.t("max", {
|
|
3516
|
+
what: instance.t("description"),
|
|
3517
|
+
max: 255
|
|
3518
|
+
}))
|
|
3492
3519
|
});
|
|
3493
3520
|
var PANE_TYPES = {
|
|
3494
3521
|
CREATE: "CREATE_TAG",
|
|
@@ -3502,6 +3529,8 @@ var PLURAL = {
|
|
|
3502
3529
|
count: 2
|
|
3503
3530
|
};
|
|
3504
3531
|
|
|
3532
|
+
var Menu$1 = Dropdown.Menu,
|
|
3533
|
+
MenuItem = Dropdown.MenuItem;
|
|
3505
3534
|
var renderColumnData = function renderColumnData(columns, handleEdit, handleDelete) {
|
|
3506
3535
|
return [].concat(_toConsumableArray(columns), [{
|
|
3507
3536
|
id: "actions",
|
|
@@ -3512,34 +3541,25 @@ var renderColumnData = function renderColumnData(columns, handleEdit, handleDele
|
|
|
3512
3541
|
return e.stopPropagation();
|
|
3513
3542
|
}
|
|
3514
3543
|
}, /*#__PURE__*/React.createElement(Dropdown, {
|
|
3544
|
+
autoWidth: true,
|
|
3515
3545
|
icon: MenuHorizontal,
|
|
3516
3546
|
buttonProps: {
|
|
3517
3547
|
style: "text"
|
|
3518
3548
|
},
|
|
3519
3549
|
position: "bottom-end",
|
|
3520
|
-
autoWidth: true,
|
|
3521
3550
|
strategy: "fixed"
|
|
3522
|
-
}, /*#__PURE__*/React.createElement(
|
|
3523
|
-
|
|
3524
|
-
}, /*#__PURE__*/React.createElement(Button, {
|
|
3551
|
+
}, /*#__PURE__*/React.createElement(Menu$1, null, /*#__PURE__*/React.createElement(MenuItem.Button, {
|
|
3552
|
+
"data-cy": "tags-edit-button",
|
|
3525
3553
|
onClick: function onClick() {
|
|
3526
3554
|
return handleEdit(tag);
|
|
3527
|
-
}
|
|
3528
|
-
|
|
3529
|
-
style: "
|
|
3530
|
-
|
|
3531
|
-
"data-cy": "tags-edit-button"
|
|
3532
|
-
})), /*#__PURE__*/React.createElement("li", {
|
|
3533
|
-
className: "neeto-tag-dropdown__item"
|
|
3534
|
-
}, /*#__PURE__*/React.createElement(Button, {
|
|
3535
|
-
label: "Delete",
|
|
3555
|
+
}
|
|
3556
|
+
}, instance.t("edit")), /*#__PURE__*/React.createElement(MenuItem.Button, {
|
|
3557
|
+
style: "danger",
|
|
3558
|
+
"data-cy": "tags-delete-button",
|
|
3536
3559
|
onClick: function onClick() {
|
|
3537
3560
|
return handleDelete(tag);
|
|
3538
|
-
}
|
|
3539
|
-
|
|
3540
|
-
className: "neeto-tag-dropdown__button",
|
|
3541
|
-
"data-cy": "tags-delete-button"
|
|
3542
|
-
}))));
|
|
3561
|
+
}
|
|
3562
|
+
}, instance.t("delete")))));
|
|
3543
3563
|
}
|
|
3544
3564
|
}]);
|
|
3545
3565
|
};
|
|
@@ -6926,9 +6946,7 @@ var ManageTags = function ManageTags(_ref) {
|
|
|
6926
6946
|
rows: 3,
|
|
6927
6947
|
"data-cy": "tag-description-text-area",
|
|
6928
6948
|
maxLength: 255
|
|
6929
|
-
}))), /*#__PURE__*/React.createElement(Pane.Footer, {
|
|
6930
|
-
className: "flex items-center space-x-2"
|
|
6931
|
-
}, /*#__PURE__*/React.createElement(ActionBlock, {
|
|
6949
|
+
}))), /*#__PURE__*/React.createElement(Pane.Footer, null, /*#__PURE__*/React.createElement(ActionBlock, {
|
|
6932
6950
|
className: "flex items-center space-x-2",
|
|
6933
6951
|
cancelButtonProps: {
|
|
6934
6952
|
onClick: onClose
|
|
@@ -7033,6 +7051,7 @@ var EmptyState = function EmptyState(_ref) {
|
|
|
7033
7051
|
weight: "normal",
|
|
7034
7052
|
className: "mb-8 text-gray-600"
|
|
7035
7053
|
}, "For more information, please visit our", " ", /*#__PURE__*/React.createElement(Button, {
|
|
7054
|
+
size: "small",
|
|
7036
7055
|
style: "link",
|
|
7037
7056
|
label: "knowledge base.",
|
|
7038
7057
|
href: kbArticleUrl,
|
|
@@ -7168,7 +7187,6 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
7168
7187
|
})
|
|
7169
7188
|
},
|
|
7170
7189
|
actionBlock: /*#__PURE__*/React.createElement(React.Fragment, null, tagsMergable && /*#__PURE__*/React.createElement(Button, {
|
|
7171
|
-
size: "large",
|
|
7172
7190
|
style: "secondary",
|
|
7173
7191
|
label: t("merge.mergeTags"),
|
|
7174
7192
|
onClick: function onClick() {
|
|
@@ -7177,7 +7195,6 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
7177
7195
|
disabled: (data === null || data === void 0 ? void 0 : data.tags.length) < PLURAL.count
|
|
7178
7196
|
}), /*#__PURE__*/React.createElement(Button, {
|
|
7179
7197
|
icon: Plus,
|
|
7180
|
-
size: "large",
|
|
7181
7198
|
label: t("addNew", {
|
|
7182
7199
|
what: t("tag")
|
|
7183
7200
|
}),
|
|
@@ -7193,7 +7210,6 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
7193
7210
|
kbArticleUrl: kbArticleUrl,
|
|
7194
7211
|
actionBlock: /*#__PURE__*/React.createElement(Button, {
|
|
7195
7212
|
icon: Plus,
|
|
7196
|
-
size: "large",
|
|
7197
7213
|
label: t("addNew", {
|
|
7198
7214
|
what: t("tag")
|
|
7199
7215
|
}),
|
|
@@ -7405,7 +7421,6 @@ var MergeAlert = function MergeAlert(_ref) {
|
|
|
7405
7421
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
7406
7422
|
label: t("proceed"),
|
|
7407
7423
|
onClick: handleSubmit,
|
|
7408
|
-
size: "large",
|
|
7409
7424
|
loading: isSubmitting,
|
|
7410
7425
|
disabled: isSubmitting
|
|
7411
7426
|
}), /*#__PURE__*/React.createElement(Button, {
|
|
@@ -7413,8 +7428,7 @@ var MergeAlert = function MergeAlert(_ref) {
|
|
|
7413
7428
|
label: t("cancel"),
|
|
7414
7429
|
onClick: function onClick() {
|
|
7415
7430
|
return setShowModal(false);
|
|
7416
|
-
}
|
|
7417
|
-
size: "large"
|
|
7431
|
+
}
|
|
7418
7432
|
})));
|
|
7419
7433
|
};
|
|
7420
7434
|
|
|
@@ -7498,7 +7512,6 @@ var Merge = function Merge(_ref) {
|
|
|
7498
7512
|
title: t("merge.mergeTags"),
|
|
7499
7513
|
menuBarToggle: displayMenu ? handleMenuToggle : null,
|
|
7500
7514
|
actionBlock: /*#__PURE__*/React.createElement(Button, {
|
|
7501
|
-
size: "large",
|
|
7502
7515
|
disabled: !(sourceTag !== null && sourceTag !== void 0 && sourceTag.id && destinationTag !== null && destinationTag !== void 0 && destinationTag.id),
|
|
7503
7516
|
onClick: function onClick() {
|
|
7504
7517
|
setIsModalOpen(true);
|
|
@@ -7510,6 +7523,7 @@ var Merge = function Merge(_ref) {
|
|
|
7510
7523
|
title: "Tags Not Found",
|
|
7511
7524
|
kbArticleUrl: kbArticleUrl,
|
|
7512
7525
|
actionBlock: /*#__PURE__*/React.createElement(Button, {
|
|
7526
|
+
size: "small",
|
|
7513
7527
|
onClick: function onClick() {
|
|
7514
7528
|
return history.push(tagsPath);
|
|
7515
7529
|
},
|