@bigbinary/neeto-tags-frontend 0.0.29 → 0.0.30
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 +37 -27
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/readme.md +34 -0
package/dist/index.js
CHANGED
|
@@ -20,7 +20,7 @@ import { useHistory, Switch, Route } from 'react-router-dom';
|
|
|
20
20
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
21
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
|
-
import { MenuHorizontal
|
|
23
|
+
import { MenuHorizontal } from '@bigbinary/neeto-icons';
|
|
24
24
|
import _inheritsLoose from '@babel/runtime/helpers/esm/inheritsLoose';
|
|
25
25
|
import _extends from '@babel/runtime/helpers/esm/extends';
|
|
26
26
|
import ReactDOM from 'react-dom';
|
|
@@ -3393,20 +3393,23 @@ var title = "Tags";
|
|
|
3393
3393
|
var selectTags = "Select tags";
|
|
3394
3394
|
var selectedTags = "Selected tags";
|
|
3395
3395
|
var plcHolder = "Type to search tag…";
|
|
3396
|
-
var manage = "Manage
|
|
3396
|
+
var manage = "Manage tags";
|
|
3397
3397
|
var remove = "Remove {{tag}} tag";
|
|
3398
3398
|
var exists = "{{tag}} already exists.";
|
|
3399
|
+
var deleteTag = "Delete tag";
|
|
3399
3400
|
var edit = "Edit";
|
|
3400
|
-
var addTag = "Add
|
|
3401
|
-
var selectOrCreate = "Select or
|
|
3401
|
+
var addTag = "Add tag";
|
|
3402
|
+
var selectOrCreate = "Select or create tag";
|
|
3402
3403
|
var select = "Select {{what}}";
|
|
3403
3404
|
var search = "Search {{where}}";
|
|
3404
3405
|
var addNew = "Add {{what}}";
|
|
3405
3406
|
var tag = "Tag";
|
|
3406
|
-
var noTagsFound = "No
|
|
3407
|
+
var noTagsFound = "No tags found";
|
|
3408
|
+
var goBack = "Go back";
|
|
3407
3409
|
var deleteItem = "Are you sure you want to delete {{type}}";
|
|
3408
3410
|
var cannotBeUndone = "This action cannot be undone.";
|
|
3409
3411
|
var proceed = "Proceed";
|
|
3412
|
+
var saveChanges = "Save changes";
|
|
3410
3413
|
var cancel = "Cancel";
|
|
3411
3414
|
var name = "Name";
|
|
3412
3415
|
var required = "{{what}} is a required field.";
|
|
@@ -3421,12 +3424,12 @@ var types = {
|
|
|
3421
3424
|
string: "string"
|
|
3422
3425
|
};
|
|
3423
3426
|
var merge$1 = {
|
|
3424
|
-
sourceTag: "Source
|
|
3425
|
-
destinationTag: "Destination
|
|
3426
|
-
mergeTags: "Merge
|
|
3427
|
+
sourceTag: "Source tag",
|
|
3428
|
+
destinationTag: "Destination tag",
|
|
3429
|
+
mergeTags: "Merge tags",
|
|
3427
3430
|
merge: "Merge",
|
|
3428
3431
|
confirmation: {
|
|
3429
|
-
title: "Merge
|
|
3432
|
+
title: "Merge tags",
|
|
3430
3433
|
message: "Tag <strong>{{sourceTag}}</strong> will be merged into <strong>{{destinationTag}}</strong> tag. This will also be reflected in {{entities}} that are assigned with. This is a non-reversible operation. Do you wish to continue?"
|
|
3431
3434
|
}
|
|
3432
3435
|
};
|
|
@@ -3440,6 +3443,7 @@ var en = {
|
|
|
3440
3443
|
exists: exists,
|
|
3441
3444
|
"new": "Create new tag",
|
|
3442
3445
|
"delete": "Delete",
|
|
3446
|
+
deleteTag: deleteTag,
|
|
3443
3447
|
edit: edit,
|
|
3444
3448
|
addTag: addTag,
|
|
3445
3449
|
selectOrCreate: selectOrCreate,
|
|
@@ -3448,9 +3452,11 @@ var en = {
|
|
|
3448
3452
|
addNew: addNew,
|
|
3449
3453
|
tag: tag,
|
|
3450
3454
|
noTagsFound: noTagsFound,
|
|
3455
|
+
goBack: goBack,
|
|
3451
3456
|
deleteItem: deleteItem,
|
|
3452
3457
|
cannotBeUndone: cannotBeUndone,
|
|
3453
3458
|
proceed: proceed,
|
|
3459
|
+
saveChanges: saveChanges,
|
|
3454
3460
|
cancel: cancel,
|
|
3455
3461
|
name: name,
|
|
3456
3462
|
required: required,
|
|
@@ -6929,9 +6935,9 @@ var ManageTags = function ManageTags(_ref) {
|
|
|
6929
6935
|
style: "h2",
|
|
6930
6936
|
weight: "semibold"
|
|
6931
6937
|
}, isEdit ? t("editItem", {
|
|
6932
|
-
what: t("tag")
|
|
6938
|
+
what: t("tag").toLocaleLowerCase()
|
|
6933
6939
|
}) : t("addNew", {
|
|
6934
|
-
what: t("tag")
|
|
6940
|
+
what: t("tag").toLocaleLowerCase()
|
|
6935
6941
|
}))), /*#__PURE__*/React.createElement(Formik, {
|
|
6936
6942
|
initialValues: initValues,
|
|
6937
6943
|
validateOnBlur: false,
|
|
@@ -6947,7 +6953,7 @@ var ManageTags = function ManageTags(_ref) {
|
|
|
6947
6953
|
required: true,
|
|
6948
6954
|
autoFocus: true,
|
|
6949
6955
|
name: "name",
|
|
6950
|
-
label: "".concat(t("tag"), " ").concat(t("name")),
|
|
6956
|
+
label: "".concat(t("tag"), " ").concat(t("name").toLocaleLowerCase()),
|
|
6951
6957
|
"data-cy": "tag-name-text-field",
|
|
6952
6958
|
maxLength: 50
|
|
6953
6959
|
}), /*#__PURE__*/React.createElement(Textarea, {
|
|
@@ -6963,7 +6969,8 @@ var ManageTags = function ManageTags(_ref) {
|
|
|
6963
6969
|
disabled: false
|
|
6964
6970
|
},
|
|
6965
6971
|
submitButtonProps: {
|
|
6966
|
-
loading: isSubmitting
|
|
6972
|
+
loading: isSubmitting,
|
|
6973
|
+
label: t("saveChanges")
|
|
6967
6974
|
}
|
|
6968
6975
|
})));
|
|
6969
6976
|
}));
|
|
@@ -7198,7 +7205,7 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
7198
7205
|
setSearchTerm(value);
|
|
7199
7206
|
},
|
|
7200
7207
|
placeholder: t("search", {
|
|
7201
|
-
where: t("title")
|
|
7208
|
+
where: t("title").toLocaleLowerCase()
|
|
7202
7209
|
})
|
|
7203
7210
|
},
|
|
7204
7211
|
actionBlock: /*#__PURE__*/React.createElement(React.Fragment, null, tagsMergable && /*#__PURE__*/React.createElement(Button, {
|
|
@@ -7209,9 +7216,8 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
7209
7216
|
},
|
|
7210
7217
|
disabled: (data === null || data === void 0 ? void 0 : data.tags.length) < PLURAL.count
|
|
7211
7218
|
}), /*#__PURE__*/React.createElement(Button, {
|
|
7212
|
-
icon: Plus,
|
|
7213
7219
|
label: t("addNew", {
|
|
7214
|
-
what: t("tag")
|
|
7220
|
+
what: t("tag").toLocaleLowerCase()
|
|
7215
7221
|
}),
|
|
7216
7222
|
onClick: function onClick() {
|
|
7217
7223
|
setSelectedTag(null);
|
|
@@ -7221,12 +7227,11 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
7221
7227
|
})),
|
|
7222
7228
|
breadcrumbs: breadcrumbs
|
|
7223
7229
|
}), !(data !== null && data !== void 0 && (_data$tags2 = data.tags) !== null && _data$tags2 !== void 0 && _data$tags2.length) ? /*#__PURE__*/React.createElement(EmptyState, {
|
|
7224
|
-
title: "
|
|
7230
|
+
title: t("noTagsFound"),
|
|
7225
7231
|
kbArticleUrl: kbArticleUrl,
|
|
7226
7232
|
actionBlock: /*#__PURE__*/React.createElement(Button, {
|
|
7227
|
-
icon: Plus,
|
|
7228
7233
|
label: t("addNew", {
|
|
7229
|
-
what: t("tag")
|
|
7234
|
+
what: t("tag").toLocaleLowerCase()
|
|
7230
7235
|
}),
|
|
7231
7236
|
onClick: function onClick() {
|
|
7232
7237
|
setSelectedTag(null);
|
|
@@ -7240,7 +7245,7 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
7240
7245
|
leftActionBlock: /*#__PURE__*/React.createElement(Typography, {
|
|
7241
7246
|
component: "h4",
|
|
7242
7247
|
className: "neeto-ui-gray-800 font-semibold"
|
|
7243
|
-
}, "".concat(data === null || data === void 0 ? void 0 : (_data$tags3 = data.tags) === null || _data$tags3 === void 0 ? void 0 : _data$tags3.length, " ").concat(tagType.label, "
|
|
7248
|
+
}, "".concat(data === null || data === void 0 ? void 0 : (_data$tags3 = data.tags) === null || _data$tags3 === void 0 ? void 0 : _data$tags3.length, " ").concat(tagType.label, " tag(s)"))
|
|
7244
7249
|
}), /*#__PURE__*/React.createElement("div", {
|
|
7245
7250
|
className: "neeto-tags--table__wrapper"
|
|
7246
7251
|
}, /*#__PURE__*/React.createElement(Table, {
|
|
@@ -7278,9 +7283,9 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
7278
7283
|
updateTags: updateTags
|
|
7279
7284
|
}), /*#__PURE__*/React.createElement(Alert, {
|
|
7280
7285
|
isOpen: isDeleteAlertOpen,
|
|
7281
|
-
title:
|
|
7286
|
+
title: t("deleteTag"),
|
|
7282
7287
|
message: /*#__PURE__*/React.createElement(React.Fragment, null, t("deleteItem", {
|
|
7283
|
-
type: t("tag")
|
|
7288
|
+
type: t("tag").toLocaleLowerCase()
|
|
7284
7289
|
}), " ", /*#__PURE__*/React.createElement("strong", null, selectedTag === null || selectedTag === void 0 ? void 0 : selectedTag.name), "? ", t("cannotBeUndone")),
|
|
7285
7290
|
onSubmit: handleConfirmDelete,
|
|
7286
7291
|
onClose: handleAlertClose,
|
|
@@ -7297,6 +7302,9 @@ var List = function List(_ref) {
|
|
|
7297
7302
|
selectedTagId = _ref.selectedTagId,
|
|
7298
7303
|
type = _ref.type;
|
|
7299
7304
|
|
|
7305
|
+
var _useTranslation = useTranslation(),
|
|
7306
|
+
t = _useTranslation.t;
|
|
7307
|
+
|
|
7300
7308
|
var _useState = useState([]),
|
|
7301
7309
|
_useState2 = _slicedToArray(_useState, 2),
|
|
7302
7310
|
tags = _useState2[0],
|
|
@@ -7323,7 +7331,9 @@ var List = function List(_ref) {
|
|
|
7323
7331
|
onChange: function onChange(e) {
|
|
7324
7332
|
return setSearchTerm(e.target.value);
|
|
7325
7333
|
},
|
|
7326
|
-
placeholder: "
|
|
7334
|
+
placeholder: t("search", {
|
|
7335
|
+
where: t("tag").toLocaleLowerCase()
|
|
7336
|
+
})
|
|
7327
7337
|
}), /*#__PURE__*/React.createElement("div", {
|
|
7328
7338
|
className: "tags-merge__items"
|
|
7329
7339
|
}, tags.map(function (tag) {
|
|
@@ -7541,14 +7551,14 @@ var Merge = function Merge(_ref) {
|
|
|
7541
7551
|
}),
|
|
7542
7552
|
breadcrumbs: updatedBreadcrumbs
|
|
7543
7553
|
}), !(data !== null && data !== void 0 && (_data$tags = data.tags) !== null && _data$tags !== void 0 && _data$tags.length) ? /*#__PURE__*/React.createElement(EmptyState, {
|
|
7544
|
-
title: "
|
|
7554
|
+
title: t("noTagsFound"),
|
|
7545
7555
|
kbArticleUrl: kbArticleUrl,
|
|
7546
7556
|
actionBlock: /*#__PURE__*/React.createElement(Button, {
|
|
7547
7557
|
size: "small",
|
|
7548
7558
|
onClick: function onClick() {
|
|
7549
7559
|
return history.push(tagsPath);
|
|
7550
7560
|
},
|
|
7551
|
-
label: "
|
|
7561
|
+
label: t("goBack")
|
|
7552
7562
|
})
|
|
7553
7563
|
}) : /*#__PURE__*/React.createElement(Scrollable, {
|
|
7554
7564
|
className: "w-full"
|
|
@@ -7560,7 +7570,7 @@ var Merge = function Merge(_ref) {
|
|
|
7560
7570
|
selectedCounterTagId: destinationTag === null || destinationTag === void 0 ? void 0 : destinationTag.id,
|
|
7561
7571
|
selectedTagId: sourceTag === null || sourceTag === void 0 ? void 0 : sourceTag.id,
|
|
7562
7572
|
type: t("select", {
|
|
7563
|
-
what: t("merge.sourceTag")
|
|
7573
|
+
what: t("merge.sourceTag").toLocaleLowerCase()
|
|
7564
7574
|
})
|
|
7565
7575
|
}), /*#__PURE__*/React.createElement(List, {
|
|
7566
7576
|
tagList: data === null || data === void 0 ? void 0 : data.tags,
|
|
@@ -7568,7 +7578,7 @@ var Merge = function Merge(_ref) {
|
|
|
7568
7578
|
selectedCounterTagId: sourceTag === null || sourceTag === void 0 ? void 0 : sourceTag.id,
|
|
7569
7579
|
selectedTagId: destinationTag === null || destinationTag === void 0 ? void 0 : destinationTag.id,
|
|
7570
7580
|
type: t("select", {
|
|
7571
|
-
what: t("merge.destinationTag")
|
|
7581
|
+
what: t("merge.destinationTag").toLocaleLowerCase()
|
|
7572
7582
|
})
|
|
7573
7583
|
})))), /*#__PURE__*/React.createElement(MergeAlert, {
|
|
7574
7584
|
showModal: isModalOpen,
|