@bigbinary/neeto-tags-frontend 0.0.28 → 0.0.29

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 CHANGED
@@ -6849,11 +6849,14 @@ var refetchTags = function refetchTags() {
6849
6849
  };
6850
6850
 
6851
6851
  var useTagsForm = function useTagsForm(_ref) {
6852
- var isEdit = _ref.isEdit,
6853
- tagType = _ref.tagType,
6852
+ var createTags = _ref.createTags,
6853
+ goToFirstPage = _ref.goToFirstPage,
6854
+ isEdit = _ref.isEdit,
6854
6855
  onClose = _ref.onClose,
6855
- goToFirstPage = _ref.goToFirstPage;
6856
+ tagType = _ref.tagType,
6857
+ updateTags = _ref.updateTags;
6856
6858
  var tagModification = isEdit ? useUpdateTag : useCreateTag;
6859
+ var tagOperation = isEdit ? updateTags : createTags;
6857
6860
 
6858
6861
  var _tagModification = tagModification(),
6859
6862
  mutate = _tagModification.mutate,
@@ -6877,7 +6880,10 @@ var useTagsForm = function useTagsForm(_ref) {
6877
6880
 
6878
6881
  mutate(tagData, {
6879
6882
  onSuccess: function onSuccess() {
6883
+ var _tagOperation$onSucce;
6884
+
6880
6885
  !isEdit && goToFirstPage();
6886
+ tagOperation === null || tagOperation === void 0 ? void 0 : (_tagOperation$onSucce = tagOperation.onSuccess) === null || _tagOperation$onSucce === void 0 ? void 0 : _tagOperation$onSucce.callback();
6881
6887
  onClose();
6882
6888
  },
6883
6889
  onError: function onError() {
@@ -6893,11 +6899,13 @@ var useTagsForm = function useTagsForm(_ref) {
6893
6899
  };
6894
6900
 
6895
6901
  var ManageTags = function ManageTags(_ref) {
6896
- var tag = _ref.tag,
6897
- type = _ref.type,
6902
+ var createTags = _ref.createTags,
6903
+ goToFirstPage = _ref.goToFirstPage,
6898
6904
  onClose = _ref.onClose,
6905
+ tag = _ref.tag,
6899
6906
  tagType = _ref.tagType,
6900
- goToFirstPage = _ref.goToFirstPage;
6907
+ type = _ref.type,
6908
+ updateTags = _ref.updateTags;
6901
6909
  var isEdit = type === PANE_TYPES.EDIT;
6902
6910
  var initValues = isEdit ? tag : INITIAL_TAG_VALUES;
6903
6911
 
@@ -6905,10 +6913,12 @@ var ManageTags = function ManageTags(_ref) {
6905
6913
  t = _useTranslation.t;
6906
6914
 
6907
6915
  var _useTagsForm = useTagsForm({
6916
+ createTags: createTags,
6917
+ goToFirstPage: goToFirstPage,
6908
6918
  isEdit: isEdit,
6909
- tagType: tagType,
6910
6919
  onClose: onClose,
6911
- goToFirstPage: goToFirstPage
6920
+ tagType: tagType,
6921
+ updateTags: updateTags
6912
6922
  }),
6913
6923
  handleSubmit = _useTagsForm.handleSubmit;
6914
6924
 
@@ -6949,7 +6959,8 @@ var ManageTags = function ManageTags(_ref) {
6949
6959
  }))), /*#__PURE__*/React.createElement(Pane.Footer, null, /*#__PURE__*/React.createElement(ActionBlock, {
6950
6960
  className: "flex items-center space-x-2",
6951
6961
  cancelButtonProps: {
6952
- onClick: onClose
6962
+ onClick: onClose,
6963
+ disabled: false
6953
6964
  },
6954
6965
  submitButtonProps: {
6955
6966
  loading: isSubmitting
@@ -7065,15 +7076,18 @@ var EmptyState = function EmptyState(_ref) {
7065
7076
  var Dashboard = function Dashboard(_ref) {
7066
7077
  var _data$tags2, _data$tags3, _data$tags4;
7067
7078
 
7068
- var tagType = _ref.tagType,
7069
- breadcrumbs = _ref.breadcrumbs,
7079
+ var breadcrumbs = _ref.breadcrumbs,
7080
+ createTags = _ref.createTags,
7081
+ deleteTags = _ref.deleteTags,
7070
7082
  displayMenu = _ref.displayMenu,
7071
7083
  handleMenuToggle = _ref.handleMenuToggle,
7072
- tagsPath = _ref.tagsPath,
7073
7084
  kbArticleUrl = _ref.kbArticleUrl,
7074
7085
  onTagRowClick = _ref.onTagRowClick,
7075
7086
  _ref$tagsMergable = _ref.tagsMergable,
7076
- tagsMergable = _ref$tagsMergable === void 0 ? false : _ref$tagsMergable;
7087
+ tagsMergable = _ref$tagsMergable === void 0 ? false : _ref$tagsMergable,
7088
+ tagsPath = _ref.tagsPath,
7089
+ tagType = _ref.tagType,
7090
+ updateTags = _ref.updateTags;
7077
7091
 
7078
7092
  var _useState = useState(null),
7079
7093
  _useState2 = _slicedToArray(_useState, 2),
@@ -7147,7 +7161,7 @@ var Dashboard = function Dashboard(_ref) {
7147
7161
  };
7148
7162
  mutate(payload, {
7149
7163
  onSuccess: function onSuccess() {
7150
- var _data$tags;
7164
+ var _data$tags, _deleteTags$onSuccess;
7151
7165
 
7152
7166
  setIsDeleteAlertOpen(false);
7153
7167
 
@@ -7157,6 +7171,7 @@ var Dashboard = function Dashboard(_ref) {
7157
7171
  });
7158
7172
  }
7159
7173
 
7174
+ deleteTags === null || deleteTags === void 0 ? void 0 : (_deleteTags$onSuccess = deleteTags.onSuccess) === null || _deleteTags$onSuccess === void 0 ? void 0 : _deleteTags$onSuccess.callback();
7160
7175
  Toastr.success(t("deleteSuccess"));
7161
7176
  },
7162
7177
  onError: function onError(_ref2) {
@@ -7252,13 +7267,15 @@ var Dashboard = function Dashboard(_ref) {
7252
7267
  x: "100%"
7253
7268
  }
7254
7269
  })))), /*#__PURE__*/React.createElement(ManageTags, {
7255
- type: paneType,
7256
- tagType: tagType,
7257
- tag: selectedTag,
7270
+ createTags: createTags,
7271
+ goToFirstPage: goToFirstPage,
7258
7272
  onClose: function onClose() {
7259
7273
  return setPaneType(null);
7260
7274
  },
7261
- goToFirstPage: goToFirstPage
7275
+ tag: selectedTag,
7276
+ tagType: tagType,
7277
+ type: paneType,
7278
+ updateTags: updateTags
7262
7279
  }), /*#__PURE__*/React.createElement(Alert, {
7263
7280
  isOpen: isDeleteAlertOpen,
7264
7281
  title: "".concat(t("delete"), " ").concat(selectedTag === null || selectedTag === void 0 ? void 0 : selectedTag.name),
@@ -7435,12 +7452,13 @@ var MergeAlert = function MergeAlert(_ref) {
7435
7452
  var Merge = function Merge(_ref) {
7436
7453
  var _data$tags;
7437
7454
 
7438
- var tagType = _ref.tagType,
7439
- breadcrumbs = _ref.breadcrumbs,
7440
- tagsPath = _ref.tagsPath,
7441
- handleMenuToggle = _ref.handleMenuToggle,
7455
+ var breadcrumbs = _ref.breadcrumbs,
7442
7456
  displayMenu = _ref.displayMenu,
7443
- kbArticleUrl = _ref.kbArticleUrl;
7457
+ handleMenuToggle = _ref.handleMenuToggle,
7458
+ kbArticleUrl = _ref.kbArticleUrl,
7459
+ mergeTags = _ref.mergeTags,
7460
+ tagsPath = _ref.tagsPath,
7461
+ tagType = _ref.tagType;
7444
7462
 
7445
7463
  var _useState = useState({}),
7446
7464
  _useState2 = _slicedToArray(_useState, 2),
@@ -7491,8 +7509,11 @@ var Merge = function Merge(_ref) {
7491
7509
  payload: payload
7492
7510
  }, {
7493
7511
  onSuccess: function onSuccess() {
7512
+ var _mergeTags$onSuccess;
7513
+
7494
7514
  setDestinationTag("");
7495
7515
  setSourceTag("");
7516
+ mergeTags === null || mergeTags === void 0 ? void 0 : (_mergeTags$onSuccess = mergeTags.onSuccess) === null || _mergeTags$onSuccess === void 0 ? void 0 : _mergeTags$onSuccess.callback();
7496
7517
  setIsModalOpen(false);
7497
7518
  }
7498
7519
  });