@bigbinary/neeto-tags-frontend 2.0.1 → 2.0.2

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.cjs.js CHANGED
@@ -713,15 +713,19 @@ var Header = function Header(_ref) {
713
713
  goToFirstPage = _ref$goToFirstPage === void 0 ? neetoCist.noop : _ref$goToFirstPage,
714
714
  _ref$tagsPath = _ref.tagsPath,
715
715
  tagsPath = _ref$tagsPath === void 0 ? "" : _ref$tagsPath,
716
- data = _ref.data;
716
+ data = _ref.data,
717
+ _ref$showFilters = _ref.showFilters,
718
+ showFilters = _ref$showFilters === void 0 ? true : _ref$showFilters;
717
719
  var _useTranslation = reactI18next.useTranslation(),
718
720
  t = _useTranslation.t;
719
721
  var history = reactRouterDom.useHistory();
720
722
  var resetPage = reactUtils.useFuncDebounce(function () {
721
723
  return goToFirstPage();
722
724
  });
723
- var ActionBlock = function ActionBlock() {
724
- return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
725
+ return /*#__PURE__*/jsxRuntime.jsx(NeetoHeader__default["default"], {
726
+ breadcrumbs: breadcrumbs,
727
+ title: title || t("neetoTags.common.tag", constants.PLURAL),
728
+ actionBlock: /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
725
729
  children: [tagsMergable && /*#__PURE__*/jsxRuntime.jsx(Button__default["default"], {
726
730
  "data-cy": "neeto-tags-merge-tags-button",
727
731
  disabled: (data === null || data === void 0 ? void 0 : data.tags.length) < constants.PLURAL.count,
@@ -736,17 +740,12 @@ var Header = function Header(_ref) {
736
740
  setPaneType(PANE_TYPES.CREATE);
737
741
  }
738
742
  })]
739
- });
740
- };
741
- return /*#__PURE__*/jsxRuntime.jsx(NeetoHeader__default["default"], {
742
- breadcrumbs: breadcrumbs,
743
- actionBlock: /*#__PURE__*/jsxRuntime.jsx(ActionBlock, {}),
744
- searchProps: {
743
+ }),
744
+ searchProps: showFilters && {
745
745
  "data-cy": "neeto-tags-search-text-input-field",
746
746
  onChange: resetPage,
747
747
  placeholder: t("neetoTags.placeholder.searchTags")
748
- },
749
- title: title || t("neetoTags.common.tag", constants.PLURAL)
748
+ }
750
749
  });
751
750
  };
752
751
 
@@ -1020,7 +1019,8 @@ var Dashboard = function Dashboard(_ref) {
1020
1019
  searchTerm = _queryParams$searchTe === void 0 ? "" : _queryParams$searchTe;
1021
1020
  var searchKeywordProps = {
1022
1021
  node: "name",
1023
- value: searchTerm
1022
+ value: searchTerm,
1023
+ key: "search_term"
1024
1024
  };
1025
1025
  var _useState = react.useState(null),
1026
1026
  _useState2 = _slicedToArray(_useState, 2),
@@ -1119,6 +1119,7 @@ var Dashboard = function Dashboard(_ref) {
1119
1119
  page: constants.DEFAULT_PAGE_INDEX
1120
1120
  }));
1121
1121
  };
1122
+ var showFilters = neetoCist.isPresent(neetoFilters) || (data === null || data === void 0 ? void 0 : data.totalCount) > 0;
1122
1123
  return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
1123
1124
  children: [/*#__PURE__*/jsxRuntime.jsxs(Container__default["default"], {
1124
1125
  children: [/*#__PURE__*/jsxRuntime.jsx(Header, {
@@ -1127,11 +1128,12 @@ var Dashboard = function Dashboard(_ref) {
1127
1128
  displayMenu: displayMenu,
1128
1129
  setPaneType: setPaneType,
1129
1130
  setSelectedTag: setSelectedTag,
1131
+ showFilters: showFilters,
1130
1132
  tagsMergable: tagsMergable,
1131
1133
  tagsPath: tagsPath,
1132
1134
  title: title,
1133
1135
  goToFirstPage: resetPage
1134
- }), ramda.isNotNil(data === null || data === void 0 ? void 0 : data.totalCount) && (data === null || data === void 0 ? void 0 : data.totalCount) > 0 && /*#__PURE__*/jsxRuntime.jsx(SubHeader__default["default"], {
1136
+ }), showFilters && /*#__PURE__*/jsxRuntime.jsx(SubHeader__default["default"], {
1135
1137
  leftActionBlock: /*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
1136
1138
  className: "neeto-ui-gray-800",
1137
1139
  "data-cy": "neeto-tags-filtered-tags-count-text",