@rh-support/manage 2.5.31 → 2.5.32

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.
Files changed (82) hide show
  1. package/lib/esm/components/Configs/ConfigsTable.js +1 -1
  2. package/lib/esm/components/Groups/DefualtGroupSwitch/DefaultGroupSwitch.d.ts.map +1 -1
  3. package/lib/esm/components/Groups/DefualtGroupSwitch/DefaultGroupSwitch.js +1 -1
  4. package/lib/esm/components/Groups/GroupSelect/GroupSelect.d.ts.map +1 -1
  5. package/lib/esm/components/Groups/GroupSelect/GroupSelect.js +54 -22
  6. package/lib/esm/components/Groups/GroupUserPermissionsSelect/GroupUserPermissionsSelect.d.ts.map +1 -1
  7. package/lib/esm/components/Groups/GroupUserPermissionsSelect/GroupUserPermissionsSelect.js +19 -14
  8. package/lib/esm/components/Groups/ManageGroupUsers/ManageGroupUsers.js +3 -3
  9. package/lib/esm/components/ManageBookmarkedAccountsTab/AddEditBookmarkModal.d.ts.map +1 -1
  10. package/lib/esm/components/ManageBookmarkedAccountsTab/AddEditBookmarkModal.js +9 -9
  11. package/lib/esm/components/ManageBookmarkedAccountsTab/BookmarkAccountSelector.d.ts.map +1 -1
  12. package/lib/esm/components/ManageBookmarkedAccountsTab/BookmarkAccountSelector.js +106 -67
  13. package/lib/esm/components/ManageBookmarkedAccountsTab/ManageGroupedBookmarkedAccountsTab.d.ts.map +1 -1
  14. package/lib/esm/components/ManageBookmarkedAccountsTab/ManageGroupedBookmarkedAccountsTab.js +7 -12
  15. package/lib/esm/components/ManageExpiredContents/ExpiredContentCategory.js +3 -3
  16. package/lib/esm/components/ManageExpiredContents/ExpiredContentHeader.js +1 -1
  17. package/lib/esm/components/ManageExpiredContents/ExpiredContentManager.d.ts.map +1 -1
  18. package/lib/esm/components/ManageExpiredContents/ExpiredContentManager.js +5 -6
  19. package/lib/esm/components/ManageExpiredContents/ExpiredContentSingleItem.js +2 -2
  20. package/lib/esm/components/ManageExpiredContents/ExpiredContentSingleItemView.js +2 -2
  21. package/lib/esm/components/ManagePartnerships/NonOrgCustomerInfoModal.js +5 -5
  22. package/lib/esm/components/ManagePartnerships/PartnershipsList.d.ts.map +1 -1
  23. package/lib/esm/components/ManagePartnerships/PartnershipsList.js +5 -6
  24. package/lib/esm/components/ManagePartnerships/PartnershipsTermsModal.d.ts.map +1 -1
  25. package/lib/esm/components/ManagePartnerships/PartnershipsTermsModal.js +15 -20
  26. package/lib/esm/components/ManagePartnerships/RequestCollaborationModal.d.ts.map +1 -1
  27. package/lib/esm/components/ManagePartnerships/RequestCollaborationModal.js +9 -16
  28. package/lib/esm/components/ManagePartnerships/Requests.d.ts.map +1 -1
  29. package/lib/esm/components/ManagePartnerships/Requests.js +5 -6
  30. package/lib/esm/components/ManagePartnerships/index.js +1 -1
  31. package/lib/esm/components/ManagePreferences/PreferencesHeader.js +1 -1
  32. package/lib/esm/components/ManagePreferences/components/PreferenceSelect.d.ts +1 -1
  33. package/lib/esm/components/ManagePreferences/components/PreferenceSelect.d.ts.map +1 -1
  34. package/lib/esm/components/ManagePreferences/components/PreferenceSelect.js +26 -27
  35. package/lib/esm/components/ManagePreferences/sections/PreferencesACL.js +3 -3
  36. package/lib/esm/components/ManagePreferences/sections/PreferencesCaseCreate.d.ts.map +1 -1
  37. package/lib/esm/components/ManagePreferences/sections/PreferencesCaseCreate.js +3 -4
  38. package/lib/esm/components/ManagePreferences/sections/PreferencesCaseSearch.d.ts.map +1 -1
  39. package/lib/esm/components/ManagePreferences/sections/PreferencesCaseSearch.js +2 -3
  40. package/lib/esm/components/ManagePreferences/sections/PreferencesCaseView.js +6 -7
  41. package/lib/esm/components/ManageTable/ManageTable.d.ts +3 -4
  42. package/lib/esm/components/ManageTable/ManageTable.d.ts.map +1 -1
  43. package/lib/esm/components/ManageTable/ManageTable.js +12 -19
  44. package/lib/esm/components/ManageTags/TagsManager.d.ts.map +1 -1
  45. package/lib/esm/components/ManageTags/TagsManager.js +24 -27
  46. package/lib/esm/components/NotificationEmails/NotificationEmailsModal.d.ts.map +1 -1
  47. package/lib/esm/components/NotificationEmails/NotificationEmailsModal.js +14 -14
  48. package/lib/esm/components/NotificationEmails/index.js +2 -3
  49. package/lib/esm/components/TopContentManagement/CategoryLimit/CategoryLimit.d.ts.map +1 -1
  50. package/lib/esm/components/TopContentManagement/CategoryLimit/CategoryLimit.js +2 -3
  51. package/lib/esm/components/TopContentManagement/CategoryLimit/CategoryLimitGuidelines.js +6 -6
  52. package/lib/esm/components/TopContentManagement/CategoryLimit/QuestionAnswer.js +1 -1
  53. package/lib/esm/components/TopContentManagement/ContentUsage/ContentAccordion.d.ts.map +1 -1
  54. package/lib/esm/components/TopContentManagement/ContentUsage/ContentAccordion.js +5 -5
  55. package/lib/esm/components/TopContentManagement/ContentUsage/PerformanceMetrics.js +8 -8
  56. package/lib/esm/components/TopContentManagement/ContentUsage/PerformanceMetricsSelect.d.ts +2 -3
  57. package/lib/esm/components/TopContentManagement/ContentUsage/PerformanceMetricsSelect.d.ts.map +1 -1
  58. package/lib/esm/components/TopContentManagement/ContentUsage/PerformanceMetricsSelect.js +16 -9
  59. package/lib/esm/components/TopContentManagement/ContentUsage/VersionPerformanceMetrics.d.ts.map +1 -1
  60. package/lib/esm/components/TopContentManagement/ContentUsage/VersionPerformanceMetrics.js +11 -11
  61. package/lib/esm/components/TopContentManagement/NoTopContentFound.d.ts.map +1 -1
  62. package/lib/esm/components/TopContentManagement/NoTopContentFound.js +13 -14
  63. package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/AddNewCategoryDropDown.d.ts.map +1 -1
  64. package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/AddNewCategoryDropDown.js +46 -39
  65. package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/TopContentCategory.js +4 -4
  66. package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/TopContentCategoryNew.js +3 -3
  67. package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/TopContentComponent.js +1 -1
  68. package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/TopContentSingleItem.js +5 -5
  69. package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/TopContentSingleItemLink.d.ts.map +1 -1
  70. package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/TopContentSingleItemLink.js +2 -3
  71. package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentEditor.js +4 -4
  72. package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentSuggestion/TopContentSuggestion.js +2 -2
  73. package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentSuggestion/TopContentSuggestionHint.js +4 -5
  74. package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentSuggestion/TopContentSuggestionHintAccept.d.ts.map +1 -1
  75. package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentSuggestion/TopContentSuggestionHintAccept.js +51 -25
  76. package/lib/esm/components/TopContentManagement/TopContentHeader.js +1 -1
  77. package/lib/esm/components/TopContentManagement/TopContentProductVersionSelector.d.ts.map +1 -1
  78. package/lib/esm/components/TopContentManagement/TopContentProductVersionSelector.js +58 -29
  79. package/lib/esm/scss/_main.scss +23 -19
  80. package/lib/esm/scss/_pf-overrides.scss +50 -46
  81. package/lib/esm/scss/index.scss +4 -4
  82. package/package.json +12 -12
@@ -1,4 +1,4 @@
1
- import { Button, ButtonVariant, EmptyState, EmptyStateBody, EmptyStateHeader, EmptyStateIcon, EmptyStateVariant, } from '@patternfly/react-core';
1
+ import { Button, ButtonVariant, EmptyState, EmptyStateBody, EmptyStateVariant } from '@patternfly/react-core';
2
2
  import SearchIcon from '@patternfly/react-icons/dist/js/icons/search-icon';
3
3
  import { isNumber, isRegularVersion } from '@rh-support/utils';
4
4
  import isEmpty from 'lodash/isEmpty';
@@ -10,14 +10,14 @@ export function NoTopContentFound({ version, product, dataLength, onAddCategory,
10
10
  // 1.1, 1.x are normal semver versions but we have versions line online or dedicated that don't follw semver
11
11
  const iSemverVersion = isRegularVersion(version) && isNumber(version.split('.')[1]);
12
12
  const getCreateSetMessage = () => (React.createElement(React.Fragment, null,
13
- iSemverVersion && (React.createElement("p", { className: "pf-v5-u-mb-md" },
13
+ iSemverVersion && (React.createElement("p", { className: "pf-v6-u-mb-md" },
14
14
  React.createElement(Trans, null, "Customers can't view any content while troubleshooting this version."))),
15
- isXVersion && (React.createElement("p", { className: "pf-v5-u-mb-md" },
15
+ isXVersion && (React.createElement("p", { className: "pf-v6-u-mb-md" },
16
16
  React.createElement(Trans, null,
17
17
  "Customers will see content for ",
18
18
  xVersion,
19
19
  " when minor version content is unavailable."))),
20
- React.createElement("p", { className: "pf-v5-u-mb-md" },
20
+ React.createElement("p", { className: "pf-v6-u-mb-md" },
21
21
  React.createElement(Button, { variant: isXVersion ? ButtonVariant.secondary : ButtonVariant.primary, isInline: true, onClick: () => onAddCategory(false, true, version) },
22
22
  React.createElement(Trans, null,
23
23
  ' ',
@@ -38,21 +38,20 @@ export function NoTopContentFound({ version, product, dataLength, onAddCategory,
38
38
  xVersion),
39
39
  ' ',
40
40
  "troubleshooting this version"),
41
- React.createElement("div", { className: "pf-v5-u-mt-lg" },
42
- React.createElement(Button, { isInline: true, className: "pf-v5-c-alert__action", variant: ButtonVariant.primary, onClick: () => onAddCategory(false, true, version, true) },
41
+ React.createElement("div", { className: "pf-v6-u-mt-lg" },
42
+ React.createElement(Button, { isInline: true, className: "pf-v6-c-alert__action", variant: ButtonVariant.primary, onClick: () => onAddCategory(false, true, version, true) },
43
43
  React.createElement(Trans, null,
44
44
  "Create new set for ",
45
45
  version)))));
46
46
  const noContent = dataLength === 0 && !isContentOnlyForMajorVersion;
47
47
  const noMinorButHaveMajorContent = dataLength !== 0 && isContentOnlyForMajorVersion;
48
- return (React.createElement(EmptyState, { variant: EmptyStateVariant.xs, id: "no-content" },
49
- React.createElement(EmptyStateHeader, { titleText: React.createElement(React.Fragment, null, isEmpty(product) || isEmpty(version) ? (React.createElement(Trans, null, "No top content found")) : isRegularVersion(version) && isNumber(version.split('.')[1]) && dataLength === 0 ? (React.createElement(Trans, null,
50
- "No content available for ",
51
- version,
52
- " or ",
53
- xVersion)) : (React.createElement(Trans, null,
54
- "No content available for ",
55
- version))), icon: React.createElement(EmptyStateIcon, { icon: SearchIcon }), headingLevel: "h2" }),
48
+ return (React.createElement(EmptyState, { headingLevel: "h2", icon: SearchIcon, titleText: React.createElement(React.Fragment, null, isEmpty(product) || isEmpty(version) ? (React.createElement(Trans, null, "No top content found")) : isRegularVersion(version) && isNumber(version.split('.')[1]) && dataLength === 0 ? (React.createElement(Trans, null,
49
+ "No content available for ",
50
+ version,
51
+ " or ",
52
+ xVersion)) : (React.createElement(Trans, null,
53
+ "No content available for ",
54
+ version))), variant: EmptyStateVariant.xs, id: "no-content" },
56
55
  React.createElement(EmptyStateBody, null,
57
56
  isEmpty(product) && React.createElement(Trans, null, "Please select a product and version to edit"),
58
57
  !isEmpty(product) && isEmpty(version) && React.createElement(Trans, null, "Please select a version to edit"),
@@ -1 +1 @@
1
- {"version":3,"file":"AddNewCategoryDropDown.d.ts","sourceRoot":"","sources":["../../../../../../src/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/AddNewCategoryDropDown.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2DAA2D,CAAC;AAIhG,OAAO,KAA8B,MAAM,OAAO,CAAC;AAMnD,UAAU,MAAM;IACZ,gBAAgB,EAAE,CAAC,GAAG,EAAE,mBAAmB,KAAK,IAAI,CAAC;CACxD;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,qBAiFnD"}
1
+ {"version":3,"file":"AddNewCategoryDropDown.d.ts","sourceRoot":"","sources":["../../../../../../src/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/AddNewCategoryDropDown.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2DAA2D,CAAC;AAGhG,OAAO,KAAuC,MAAM,OAAO,CAAC;AAM5D,UAAU,MAAM;IACZ,gBAAgB,EAAE,CAAC,GAAG,EAAE,mBAAmB,KAAK,IAAI,CAAC;CACxD;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,qBA0EnD"}
@@ -1,7 +1,15 @@
1
- import { Select, SelectOption, SelectVariant } from '@patternfly/react-core/deprecated';
2
- import { ToastNotification } from '@rh-support/components';
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { SingleSelectDropdown, ToastNotification } from '@rh-support/components';
3
11
  import sortBy from 'lodash/sortBy';
4
- import React, { useEffect, useState } from 'react';
12
+ import React, { useEffect, useMemo, useState } from 'react';
5
13
  import { Trans, useTranslation } from 'react-i18next';
6
14
  import { useTopContentContext, useTopContentDispatchContext } from '../../../../context/TopContentProvider';
7
15
  import { fetchCategories } from '../../../../reducers/TopContentReducer';
@@ -9,48 +17,47 @@ export function AddNewCategoryDropDown(props) {
9
17
  const { t } = useTranslation();
10
18
  const { topContentEditState, categories } = useTopContentContext();
11
19
  const topContentDispatch = useTopContentDispatchContext();
12
- const allAddedCategories = topContentEditState.map((cat) => cat.categoryName);
13
- const availableCategories = sortBy(categories.data.filter((category) => !(allAddedCategories || []).includes(category.categoryName)), [
14
- function (obj) {
15
- return obj.categoryName.toLowerCase();
16
- },
17
- ]);
18
- const [isOpen, setIsOpen] = useState(false);
19
- const [selected, setSelected] = useState();
20
- const getCategoryOptions = (options) => {
21
- return options.map((category, id) => (React.createElement(SelectOption, { key: id, value: category }, category.categoryName)));
22
- };
23
- const onFilter = (_, value) => {
24
- if (!value)
25
- return getCategoryOptions(availableCategories);
26
- const input = new RegExp(value, 'i');
27
- const newOptions = availableCategories.filter((c) => input.test(c.categoryName));
28
- return getCategoryOptions(newOptions);
29
- };
30
- const onToggle = (isExpanded) => {
31
- setIsOpen(isExpanded);
32
- };
33
- const onSelect = (event, selection, isPlaceholder) => {
34
- setSelected(selection);
35
- props.onCategoryChange(selection);
36
- onToggle(false);
37
- };
38
- const onClearCategory = () => {
39
- props.onCategoryChange(undefined);
40
- setSelected(undefined);
20
+ const [selected, setSelected] = useState({
21
+ value: '',
22
+ label: '',
23
+ });
24
+ // Memoize available categories to prevent unnecessary recalculations
25
+ const availableCategories = useMemo(() => {
26
+ const allAddedCategories = topContentEditState.map((cat) => cat.categoryName);
27
+ return sortBy(categories.data.filter((category) => !(allAddedCategories || []).includes(category.categoryName)), [
28
+ function (obj) {
29
+ return obj.categoryName.toLowerCase();
30
+ },
31
+ ]);
32
+ }, [categories.data, topContentEditState]);
33
+ // Memoize dropdown options to prevent unnecessary recreations
34
+ const dropdownOptions = useMemo(() => availableCategories.map((category) => ({
35
+ key: category.id,
36
+ value: category.categoryName,
37
+ label: category.categoryName,
38
+ })), [availableCategories]);
39
+ const onSelect = (selection) => {
40
+ if (selection) {
41
+ setSelected(selection);
42
+ props.onCategoryChange(selection.value);
43
+ }
41
44
  };
45
+ // Fetch categories only once when component mounts
42
46
  useEffect(() => {
43
- try {
44
- fetchCategories(topContentDispatch);
45
- }
46
- catch (_a) {
47
- ToastNotification.addDangerMessage(t('There was an error loading top content categories'));
48
- }
47
+ const loadCategories = () => __awaiter(this, void 0, void 0, function* () {
48
+ try {
49
+ yield fetchCategories(topContentDispatch);
50
+ }
51
+ catch (_a) {
52
+ ToastNotification.addDangerMessage(t('There was an error loading top content categories'));
53
+ }
54
+ });
55
+ loadCategories();
49
56
  }, [topContentDispatch, t]);
50
57
  return (React.createElement("div", { className: "form-group add-new-category" },
51
58
  React.createElement("label", { htmlFor: "new-category" },
52
59
  React.createElement(Trans, null, "Category"),
53
60
  ' ',
54
61
  React.createElement("span", { className: "form-required", "aria-hidden": true }, "*")),
55
- React.createElement(Select, Object.assign({ variant: SelectVariant.typeahead, onToggle: (_event, isExpanded) => onToggle(isExpanded), isOpen: isOpen, onClear: onClearCategory, onSelect: onSelect, onFilter: onFilter, selections: selected === null || selected === void 0 ? void 0 : selected.categoryName, placeholderText: t('Select an option or enter a new category') }, (categories.isFetching && { loadingVariant: 'spinner' }), { id: "new-category", "data-tracking-id": "new-category" }), getCategoryOptions(availableCategories))));
62
+ React.createElement(SingleSelectDropdown, { id: "new-category", dataTrackingId: "new-category", selected: selected, options: dropdownOptions, isLoading: categories.isFetching, placeholder: t('Select an option or enter a new category'), onSelect: onSelect, isScrollable: true })));
56
63
  }
@@ -33,14 +33,14 @@ export function TopContentCategory(props) {
33
33
  props.isExpanded !== isExpanded && setIsExpanded(props.isExpanded);
34
34
  // eslint-disable-next-line react-hooks/exhaustive-deps
35
35
  }, [props.isExpanded]);
36
- return (React.createElement("div", Object.assign({ ref: props.innerRef }, props.provided.draggableProps, props.provided.dragHandleProps), props.category.content.length > 0 && (React.createElement(AccordionItem, null,
37
- React.createElement(AccordionToggle, { id: props.category.categoryName, onClick: toggleExpanded, isExpanded: isExpanded },
36
+ return (React.createElement("div", Object.assign({ ref: props.innerRef }, props.provided.draggableProps, props.provided.dragHandleProps), props.category.content.length > 0 && (React.createElement(AccordionItem, { isExpanded: isExpanded },
37
+ React.createElement(AccordionToggle, { id: props.category.categoryName, onClick: toggleExpanded },
38
38
  React.createElement("h3", { ref: headerRef },
39
- props.isArrangingCats && (React.createElement(Icon, { size: "md", className: "pf-v5-u-mr-sm" },
39
+ props.isArrangingCats && (React.createElement(Icon, { size: "md", className: "pf-v6-u-mr-sm" },
40
40
  React.createElement(GripVerticalIcon, { style: { cursor: 'move' }, title: t('Drag') }))),
41
41
  props.category.categoryName,
42
42
  " ",
43
43
  props.category.isAttentionNeeded && React.createElement(NeedsAttention, null))),
44
- React.createElement(AccordionContent, { isHidden: !isExpanded },
44
+ React.createElement(AccordionContent, null,
45
45
  React.createElement(TopContentComponent, { category: props.category, scrollToTop: scrollToTop, categoryMode: CategoryMode.EXISTING_SECTION }))))));
46
46
  }
@@ -15,13 +15,13 @@ export function TopContentCategoryNew({ category, version }) {
15
15
  scrollToTop();
16
16
  // eslint-disable-next-line react-hooks/exhaustive-deps
17
17
  }, []);
18
- return (React.createElement(AccordionItem, null,
19
- React.createElement(AccordionToggle, { id: "addToCategoryAccordion", onClick: toggleExpanded, isExpanded: isExpanded },
18
+ return (React.createElement(AccordionItem, { isExpanded: isExpanded },
19
+ React.createElement(AccordionToggle, { id: "addToCategoryAccordion", onClick: toggleExpanded },
20
20
  React.createElement("div", { className: "reference-div", ref: addNewCategoryRef }, !getVersion(version).minor && isRegularVersion(version) ? (React.createElement(Trans, null,
21
21
  "Creating a new set for major version ",
22
22
  version)) : getVersion(version).minor ? (React.createElement(Trans, null,
23
23
  "Creating a new set for ",
24
24
  version)) : (React.createElement(Trans, null, "Add new section")))),
25
- React.createElement(AccordionContent, { isHidden: !isExpanded },
25
+ React.createElement(AccordionContent, null,
26
26
  React.createElement(TopContentComponent, { category: category, scrollToTop: scrollToTop, categoryMode: CategoryMode.NEW_SECTION }))));
27
27
  }
@@ -40,7 +40,7 @@ export const TopContentComponent = (props) => {
40
40
  resetChangeInCategoryContent(topContentDispatch, topContentEditState, topContentResponse, props.category.id);
41
41
  setIsArrangingContent(false);
42
42
  };
43
- const buttons = (React.createElement("div", { className: "pf-v5-c-accordion__expanded-content-footer" },
43
+ const buttons = (React.createElement("div", { className: "pf-v6-c-accordion__expanded-content-footer" },
44
44
  !isArrangingContent && props.categoryMode !== CategoryMode.NEW_SECTION && (React.createElement("span", null,
45
45
  React.createElement(Button, { variant: "secondary", onClick: addContent, "data-tracking-id": "add-content-top-content" },
46
46
  React.createElement(Trans, null, "Add content")),
@@ -316,15 +316,15 @@ export const TopContentSingleItem = ({ isArrangingContent, category, snapshot, i
316
316
  return (React.createElement(React.Fragment, null,
317
317
  isPreview && content.mode !== ContentMode.ADD && content.mode !== ContentMode.NEW_SECTION_CONTENT && (React.createElement("li", { className: `push-bottom-narrow ${(snapshot === null || snapshot === void 0 ? void 0 : snapshot.isDragging) ? 'list-flat tc-drag' : ''}` },
318
318
  isArrangingContent && (React.createElement(Icon, { size: "sm" },
319
- React.createElement(GripVerticalIcon, { style: { cursor: 'move' }, title: t('Drag'), color: "#06c", className: "pf-v5-u-mr-sm" }))),
319
+ React.createElement(GripVerticalIcon, { style: { cursor: 'move' }, title: t('Drag'), color: "#06c", className: "pf-v6-u-mr-sm" }))),
320
320
  !isArrangingContent ? (React.createElement(React.Fragment, null,
321
321
  React.createElement(TopContentSingleItemLink, { url: getTopContentUrl(content.contentUrl), title: content.contentTitle, contentId: content.topContentId, needsAttention: content.isAttentionNeeded, lastModifiedBy: lastModifiedBy, selectedVersion: selectedVersion }),
322
322
  ' ',
323
323
  React.createElement(Button, { variant: "link", isInline: true, icon: React.createElement(EditAltIcon, null), onClick: editToggle, title: 'Edit' }))) : (content.contentTitle),
324
324
  React.createElement("div", null, lastModifiedBy),
325
325
  React.createElement("div", null,
326
- (content.tags || []).map((tag) => (React.createElement(Label, { isCompact: true, className: "pf-v5-u-mr-xs pf-v5-u-mt-sm", key: tag.id, color: filteredTags.some((t) => t.id === tag.id) ? 'gold' : 'grey' }, tag.tagName))),
327
- !isEmpty((_c = content.expiryDate) !== null && _c !== void 0 ? _c : '') && !isFutureDate(content.expiryDate) && (React.createElement(Label, { isCompact: true, className: "pf-v5-u-mr-xs pf-v5-u-mt-sm", color: "red" },
326
+ (content.tags || []).map((tag) => (React.createElement(Label, { isCompact: true, className: "pf-v6-u-mr-xs pf-v6-u-mt-sm", key: tag.id, color: filteredTags.some((t) => t.id === tag.id) ? 'yellow' : 'grey' }, tag.tagName))),
327
+ !isEmpty((_c = content.expiryDate) !== null && _c !== void 0 ? _c : '') && !isFutureDate(content.expiryDate) && (React.createElement(Label, { isCompact: true, className: "pf-v6-u-mr-xs pf-v6-u-mt-sm", color: "red" },
328
328
  React.createElement(Trans, null, "Outdated Content")))))),
329
329
  (!isPreview || content.mode === ContentMode.ADD || content.mode === ContentMode.NEW_SECTION_CONTENT) && (React.createElement("form", { noValidate: true, onSubmit: onSubmit, className: "card card-light push-bottom", ref: ref },
330
330
  content.mode === ContentMode.NEW_SECTION_CONTENT && (React.createElement(AddNewCategoryDropDown, { onCategoryChange: onAddedNewCategoryChange })),
@@ -351,11 +351,11 @@ export const TopContentSingleItem = ({ isArrangingContent, category, snapshot, i
351
351
  onContentUrlChange(val, evt);
352
352
  }, validated: contentUrlIsValid ? ValidatedOptions.default : ValidatedOptions.error }),
353
353
  showDuplicateError && (React.createElement("p", { className: "form-instructions form-invalid" },
354
- React.createElement(ExclamationCircleIcon, { color: "#c9190b", className: "pf-v5-u-mr-sm" }),
354
+ React.createElement(ExclamationCircleIcon, { color: "#c9190b", className: "pf-v6-u-mr-sm" }),
355
355
  " Duplicate url. This url is already added in ",
356
356
  formatDuplicateWarning(duplicatUrlErrorArray),
357
357
  "."))),
358
- React.createElement(Flex, { className: "pf-v5-u-my-lg" },
358
+ React.createElement(Flex, { className: "pf-v6-u-my-lg" },
359
359
  React.createElement(FlexItem, { flex: { default: 'flex_1' } },
360
360
  React.createElement(FormGroup, { label: t('Tags') },
361
361
  React.createElement("div", { className: `${isEmpty(tagOptions) ? 'menu-is-disabld' : ''}` },
@@ -1 +1 @@
1
- {"version":3,"file":"TopContentSingleItemLink.d.ts","sourceRoot":"","sources":["../../../../../../src/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/TopContentSingleItemLink.tsx"],"names":[],"mappings":"AAEA,OAAc,EAAE,EAAE,EAAY,MAAM,OAAO,CAAC;AAK5C,UAAU,MAAM;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;CAC3B;AAED,eAAO,MAAM,wBAAwB,EAAE,EAAE,CAAC,MAAM,CAkD/C,CAAC"}
1
+ {"version":3,"file":"TopContentSingleItemLink.d.ts","sourceRoot":"","sources":["../../../../../../src/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/TopContentSingleItemLink.tsx"],"names":[],"mappings":"AAEA,OAAc,EAAE,EAAE,EAAY,MAAM,OAAO,CAAC;AAK5C,UAAU,MAAM;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;CAC3B;AAED,eAAO,MAAM,wBAAwB,EAAE,EAAE,CAAC,MAAM,CAgD/C,CAAC"}
@@ -9,12 +9,11 @@ export const TopContentSingleItemLink = ({ title, url, needsAttention = false, c
9
9
  const onOpenModal = () => setModalOpen(true);
10
10
  const content = (React.createElement(React.Fragment, null,
11
11
  React.createElement(Trans, null, " Performance is low. This link will be removed in 7 days."),
12
- React.createElement("span", { onClick: onOpenModal, style: { color: 'var(--pf-v5-global--primary-color--100)' } },
12
+ React.createElement("span", { onClick: onOpenModal },
13
13
  React.createElement(Trans, null, "View performance metrics"))));
14
14
  return (React.createElement(React.Fragment, null,
15
15
  needsAttention && (React.createElement(Tooltip, { content: content, exitDelay: 500 },
16
- React.createElement(Button, { variant: "plain", className: "top-content-tooltip" },
17
- React.createElement(ExclamationTriangle, null)))),
16
+ React.createElement(Button, { icon: React.createElement(ExclamationTriangle, null), variant: "plain", className: "top-content-tooltip" }))),
18
17
  React.createElement("a", { className: needsAttention ? 'top-content-needs-attention' : 'pcm-manage-top-content', "data-tracking-id": "pcm-manage-top-content", href: url, target: "_blank", rel: "noopener noreferrer" }, title),
19
18
  React.createElement(PerformanceMetrics, { isModalOpen: isModalOpen, onHideModal: onHideModal, needsAttention: needsAttention, contentId: contentId, title: title, lastModifiedBy: lastModifiedBy, selectedVersion: selectedVersion })));
20
19
  };
@@ -151,11 +151,11 @@ export function TopContentEditor() {
151
151
  React.createElement(TopContentProductVersionSelector, { selectedProduct: selectedProduct, selectedVersion: selectedVersion, onProductChange: onProductChange, onVersionChange: onVersionChange }),
152
152
  !topContentResponse.isFetching && (React.createElement("div", { className: "toolbar" },
153
153
  React.createElement(TopContentSearch, { dataTrackingId: "top-content-filter-manage", topContentData: flagContentEditState, onSearch: onSearch, topContentResultsWrapperRef: topContentResultsRef, searchQuery: searchQuery, setSearchQuery: setSearchQuery, className: "toolbar-content", isDisabled: isEmpty(flagContentEditState) }),
154
- React.createElement("div", { className: "toolbar-content pf-v5-u-ml-md" },
154
+ React.createElement("div", { className: "toolbar-content pf-v6-u-ml-md" },
155
155
  React.createElement("label", { htmlFor: 'tag-selector' },
156
156
  React.createElement(Trans, null, "All tags")),
157
157
  React.createElement(TagsSelector, { tagOptions: tags, onChange: onTagFilterChange, selectedTags: filteredTags, disabled: isEmpty(flagContentEditState) })))),
158
- React.createElement("div", { className: "top-content-manage-wrapper pf-v5-u-pt-md" },
158
+ React.createElement("div", { className: "top-content-manage-wrapper pf-v6-u-pt-md" },
159
159
  !topContentResponse.isFetching && React.createElement(TopContentSuggestion, { searchQuery: searchQuery }),
160
160
  topContentResponse.isFetching ? (React.createElement(Bullseye, null,
161
161
  React.createElement(EmptyState, { variant: EmptyStateVariant.full },
@@ -179,7 +179,7 @@ export function TopContentEditor() {
179
179
  : category.id === categoryToOpen, category: category, provided: provided, innerRef: provided.innerRef, isArrangingCats: isArrangingCats, snapshot: snapshot })))),
180
180
  category.catMode === CategoryMode.NEW_SECTION && (React.createElement(TopContentCategoryNew, { category: category, key: 'new-section', version: newCategoryVersion }))))),
181
181
  provided.placeholder),
182
- React.createElement("div", { className: "pf-v5-u-p-md" },
182
+ React.createElement("div", { className: "pf-v6-u-p-md" },
183
183
  showSectionFooter && (React.createElement(React.Fragment, null,
184
184
  isCategoryLimitReached && React.createElement(CategoryLimit, null),
185
185
  React.createElement(Button, { variant: "primary", onClick: () => onAddCategory(isContentOnlyForMajorVersion, false, selectedVersion), isDisabled: isCategoryLimitReached, id: "add-new-section-topcontent", "data-tracking-id": "add-new-section-topcontent" },
@@ -187,7 +187,7 @@ export function TopContentEditor() {
187
187
  ' ',
188
188
  React.createElement(Button, { variant: "secondary", onClick: arrangeSection, isDisabled: flagContentEditState.length < 2 },
189
189
  React.createElement(Trans, null, "Arrange section")),
190
- isMajorOrNamedVersion(selectedVersion) && (React.createElement(Button, { variant: "link", className: "pf-v5-u-float-right", isInline: true, onClick: onOpenModal },
190
+ isMajorOrNamedVersion(selectedVersion) && (React.createElement(Button, { variant: "link", className: "pf-v6-u-float-right", isInline: true, onClick: onOpenModal },
191
191
  React.createElement(Trans, null, "View performance"))))),
192
192
  isArrangingCats && (React.createElement(React.Fragment, null,
193
193
  React.createElement(Button, { variant: "primary", onClick: onSaveArrangement },
@@ -34,7 +34,7 @@ export const TopContentSuggestion = ({ searchQuery = '' }) => {
34
34
  if (ref.current == null)
35
35
  return;
36
36
  setExpanded(!isEmpty(searchQuery));
37
- const containers = (_a = ref.current) === null || _a === void 0 ? void 0 : _a.querySelectorAll('div.pf-v5-c-card');
37
+ const containers = (_a = ref.current) === null || _a === void 0 ? void 0 : _a.querySelectorAll('div.pf-v6-c-card');
38
38
  const markInstance = new Mark(containers);
39
39
  markInstance.unmark({
40
40
  done: () => {
@@ -46,7 +46,7 @@ export const TopContentSuggestion = ({ searchQuery = '' }) => {
46
46
  }, [searchedContent, searchQuery]);
47
47
  if (isEmpty(searchedContent))
48
48
  return React.createElement(React.Fragment, null);
49
- return (React.createElement(Panel, { variant: "raised", className: "pf-v5-u-mx-md pf-v5-u-p-md top-content-panel", ref: ref },
49
+ return (React.createElement(Panel, { variant: "raised", className: "pf-v6-u-mx-md pf-v6-u-p-md top-content-panel", ref: ref },
50
50
  React.createElement(PanelMain, null,
51
51
  React.createElement(PanelMainBody, null,
52
52
  React.createElement(ExpandableSection, { onToggle: onToggle, isExpanded: isExpanded, toggleContent: React.createElement(Title, { headingLevel: "h6", className: "accordion_title" },
@@ -7,7 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
- import { Button, ButtonVariant, Card, CardBody, Truncate } from '@patternfly/react-core';
10
+ import { Button, Card, CardBody, Truncate } from '@patternfly/react-core';
11
11
  import { ToastNotification, useConfirmation } from '@rh-support/components';
12
12
  import React, { useState } from 'react';
13
13
  import { Trans, useTranslation } from 'react-i18next';
@@ -32,7 +32,6 @@ export const TopContentSuggestionHint = ({ resources }) => {
32
32
  yield confirmation({
33
33
  catchOnCancel: true,
34
34
  confirmText: t('Yes, I am sure'),
35
- confirmButtonVariant: ButtonVariant.danger,
36
35
  description: ignoreModalContent,
37
36
  });
38
37
  setIsRemoving(true);
@@ -50,12 +49,12 @@ export const TopContentSuggestionHint = ({ resources }) => {
50
49
  setIsRemoving(false);
51
50
  }
52
51
  });
53
- return !isAccepted ? (React.createElement(Card, { className: "pf-v5-u-m-sm card-hint" },
52
+ return !isAccepted ? (React.createElement(Card, { className: "pf-v6-u-m-sm card-hint" },
54
53
  React.createElement(CardBody, { className: "card-body" },
55
54
  React.createElement("span", { className: "hint-title", "data-testid": "suggestion-content-title" },
56
55
  React.createElement(Truncate, { content: resources === null || resources === void 0 ? void 0 : resources.resourceTitle })),
57
- React.createElement("span", { className: "pf-v5-u-float-right" },
58
- React.createElement(Button, { variant: "link", isInline: true, className: "pf-v5-u-mr-xl", onClick: () => setAccepted(true), title: "Accept" },
56
+ React.createElement("span", { className: "pf-v6-u-float-right" },
57
+ React.createElement(Button, { variant: "link", isInline: true, className: "pf-v6-u-mr-xl", onClick: () => setAccepted(true), title: "Accept" },
59
58
  React.createElement("b", null,
60
59
  React.createElement(Trans, null, "Accept"))),
61
60
  React.createElement(Button, { variant: "link", isInline: true, onClick: onIgnore, isDisabled: isRemoving },
@@ -1 +1 @@
1
- {"version":3,"file":"TopContentSuggestionHintAccept.d.ts","sourceRoot":"","sources":["../../../../../../src/components/TopContentManagement/TopContentEditor/TopContentSuggestion/TopContentSuggestionHintAccept.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAuB,mBAAmB,EAAE,MAAM,2DAA2D,CAAC;AASrH,OAAc,EAAE,EAAE,EAAgC,MAAM,OAAO,CAAC;AAgBhE,UAAU,MAAM;IACZ,QAAQ,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;IACxC,SAAS,EAAE,mBAAmB,CAAC;CAClC;AAED,eAAO,MAAM,8BAA8B,EAAE,EAAE,CAAC,MAAM,CA2PrD,CAAC"}
1
+ {"version":3,"file":"TopContentSuggestionHintAccept.d.ts","sourceRoot":"","sources":["../../../../../../src/components/TopContentManagement/TopContentEditor/TopContentSuggestion/TopContentSuggestionHintAccept.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAuB,mBAAmB,EAAE,MAAM,2DAA2D,CAAC;AAyBrH,OAAc,EAAE,EAAE,EAA6C,MAAM,OAAO,CAAC;AAgB7E,UAAU,MAAM;IACZ,QAAQ,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;IACxC,SAAS,EAAE,mBAAmB,CAAC;CAClC;AAED,eAAO,MAAM,8BAA8B,EAAE,EAAE,CAAC,MAAM,CAuTrD,CAAC"}
@@ -7,15 +7,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
- import { Button, Card, CardBody, Form, FormGroup, TextInput, Tooltip, ValidatedOptions } from '@patternfly/react-core';
11
- import { Select, SelectOption, SelectVariant } from '@patternfly/react-core/deprecated';
10
+ import { Button, Card, CardBody, Form, FormGroup, MenuToggle, Select, SelectList, SelectOption, TextInput, TextInputGroup, TextInputGroupMain, TextInputGroupUtilities, Tooltip, ValidatedOptions, } from '@patternfly/react-core';
12
11
  import PencilAltIcon from '@patternfly/react-icons/dist/js/icons/pencil-alt-icon';
13
- import { ToastNotification } from '@rh-support/components';
12
+ import { ToastNotification, useSelectKeyboardNavigator } from '@rh-support/components';
14
13
  import { getVersion, isRegularVersion, isValidUrl } from '@rh-support/utils';
15
14
  import isEmpty from 'lodash/isEmpty';
16
15
  import isUndefined from 'lodash/isUndefined';
17
16
  import trim from 'lodash/trim';
18
- import React, { useEffect, useMemo, useState } from 'react';
17
+ import React, { useEffect, useMemo, useRef, useState } from 'react';
19
18
  import { Trans, useTranslation } from 'react-i18next';
20
19
  import { CATEGORY_LIMIT } from '../../../../constants/TopContent';
21
20
  import { useTopContentContext, useTopContentDispatchContext } from '../../../../context/TopContentProvider';
@@ -31,6 +30,9 @@ export const TopContentSuggestionHintAccept = ({ onCancel, resources }) => {
31
30
  const [isSaving, setIsSaving] = useState(false);
32
31
  const [resourceTitle, setResourceTitle] = useState('');
33
32
  const [isEditClicked, setIsEditClicked] = useState(false);
33
+ const [inputValue, setInputValue] = useState('');
34
+ const [shouldFilter, setShouldFilter] = useState(false);
35
+ const textInputRef = useRef();
34
36
  const categoryToSave = useMemo(() => topContentEditState.find((category) => category.categoryId === (selected === null || selected === void 0 ? void 0 : selected.id)), [topContentEditState, selected]);
35
37
  const flagContentEditState = useMemo(() => flagContentUsage(topContentEditState, categoryUsage, selectedVersion), [topContentEditState, categoryUsage, selectedVersion]);
36
38
  const isMajorVersionOnly = isUndefined(getVersion(selectedVersion).minor);
@@ -43,18 +45,43 @@ export const TopContentSuggestionHintAccept = ({ onCancel, resources }) => {
43
45
  !isAddingCategory;
44
46
  const isCategoryLimitReached = (minorSelectedNoMinorContentButAvailableMajorContent ? [] : flagContentEditState).length >= CATEGORY_LIMIT.MAX;
45
47
  const isCategoryInList = flagContentEditState.some((c) => c.categoryId === (selected === null || selected === void 0 ? void 0 : selected.id));
46
- const onToggle = (isExpanded) => {
47
- setSelectOpen(isExpanded);
48
- };
49
- const onSelect = (event, selection, isPlaceholder) => {
50
- setSelected(selection);
51
- onToggle(false);
52
- };
53
48
  const isDisabled = isEmpty(linkToContent) ||
54
49
  isEmpty(trim(resourceTitle)) ||
55
50
  isUndefined(selected) ||
56
51
  !isValidUrl(linkToContent) ||
57
52
  (isCategoryLimitReached && !isCategoryInList);
53
+ const onToggleClick = () => {
54
+ var _a;
55
+ setSelectOpen((prev) => !prev);
56
+ if (!isSelectOpen) {
57
+ setShouldFilter(false);
58
+ }
59
+ (_a = textInputRef === null || textInputRef === void 0 ? void 0 : textInputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
60
+ };
61
+ const computeFilteredCategories = () => {
62
+ if (!categories.data)
63
+ return [];
64
+ return shouldFilter && (inputValue === null || inputValue === void 0 ? void 0 : inputValue.trim())
65
+ ? categories.data.filter((category) => category.categoryName.toLowerCase().includes(inputValue === null || inputValue === void 0 ? void 0 : inputValue.toLowerCase()))
66
+ : categories.data;
67
+ };
68
+ const { onInputKeyDown, focusedItemIndex } = useSelectKeyboardNavigator({
69
+ list: computeFilteredCategories(),
70
+ isOpen: isSelectOpen,
71
+ setIsOpen: setSelectOpen,
72
+ onSelect: (category) => onCategorySelect(category),
73
+ });
74
+ const onInputQueryChange = (_event, query) => {
75
+ if (isSelectOpen) {
76
+ setInputValue(query);
77
+ setShouldFilter(true);
78
+ }
79
+ };
80
+ const onCategorySelect = (selection) => {
81
+ setSelected(selection);
82
+ setInputValue(selection.categoryName);
83
+ setSelectOpen(false);
84
+ };
58
85
  const addContentToCategory = () => __awaiter(void 0, void 0, void 0, function* () {
59
86
  try {
60
87
  setIsSaving(true);
@@ -106,16 +133,14 @@ export const TopContentSuggestionHintAccept = ({ onCancel, resources }) => {
106
133
  addContentToCategory();
107
134
  }
108
135
  });
109
- const getCategoryOptions = (options) => {
110
- return options.map((category, id) => (React.createElement(SelectOption, { key: id, value: category }, category.categoryName)));
111
- };
112
- const onFilter = (_, value) => {
113
- if (!value)
114
- return getCategoryOptions(categories.data);
115
- const input = new RegExp(value, 'i');
116
- const newOptions = categories.data.filter((c) => input.test(c.categoryName));
117
- return getCategoryOptions(newOptions);
118
- };
136
+ const toggle = (toggleRef) => (React.createElement(MenuToggle, { ref: toggleRef, variant: "typeahead", onClick: onToggleClick, isExpanded: isSelectOpen, isDisabled: categories.isError || categories.isFetching, isFullWidth: true },
137
+ React.createElement(TextInputGroup, { isPlain: true },
138
+ React.createElement(TextInputGroupMain, { value: inputValue, onClick: onToggleClick, onChange: onInputQueryChange, onKeyDown: onInputKeyDown, autoComplete: "off", innerRef: textInputRef, placeholder: t('Select an option or enter a new category'), role: "combobox", isExpanded: isSelectOpen, "aria-controls": "select-typeahead-listbox" }),
139
+ categories.isFetching && (React.createElement(TextInputGroupUtilities, null,
140
+ React.createElement("span", { className: "pf-v6-c-spinner pf-m-md", role: "progressbar" },
141
+ React.createElement("span", { className: "pf-v6-c-spinner__clipper" }),
142
+ React.createElement("span", { className: "pf-v6-c-spinner__lead-ball" }),
143
+ React.createElement("span", { className: "pf-v6-c-spinner__tail-ball" })))))));
119
144
  useEffect(() => {
120
145
  setResourceTitle(resources.resourceTitle);
121
146
  }, [resources.resourceTitle]);
@@ -127,21 +152,22 @@ export const TopContentSuggestionHintAccept = ({ onCancel, resources }) => {
127
152
  ToastNotification.addDangerMessage(t('There was an error loading top content categories'));
128
153
  }
129
154
  }, [topContentDispatch, t]);
130
- return (React.createElement(Card, { className: "pf-v5-u-m-sm" },
155
+ return (React.createElement(Card, { className: "pf-v6-u-m-sm" },
131
156
  React.createElement(CardBody, { className: "card-hint" },
132
157
  React.createElement(Form, null,
133
158
  isEditClicked ? (React.createElement(FormGroup, { label: t('Heading'), isRequired: true, fieldId: "simple-form-email-01" },
134
159
  React.createElement(TextInput, { isRequired: true, type: "text", id: "top-content-headline-category", name: "top-content-headline-category", "data-tracking-id": "top-content-headline-category", value: resourceTitle, onChange: (_event, val) => setResourceTitle(val), placeholder: t('Copy and paste the heading for consistency'), validated: isEmpty(trim(resourceTitle)) ? ValidatedOptions.error : ValidatedOptions.default }))) : (React.createElement("span", null,
135
160
  React.createElement(Button, { variant: "link", isInline: true },
136
161
  React.createElement("u", null,
137
- React.createElement("a", { className: "hint-title pf-v5-u-font-size-md", target: "_blank", href: linkToContent, rel: "noreferrer" }, resources.resourceTitle))),
162
+ React.createElement("a", { className: "hint-title pf-v6-u-font-size-md", target: "_blank", href: linkToContent, rel: "noreferrer" }, resources.resourceTitle))),
138
163
  React.createElement(Tooltip, { content: t('Edit heading'), position: "top" },
139
164
  React.createElement(Button, { variant: "link", icon: React.createElement(PencilAltIcon, null), onClick: () => setIsEditClicked((pre) => !pre) })))),
140
165
  React.createElement(FormGroup, { label: t('Category'), isRequired: true, fieldId: "simple-form-email-01" },
141
- React.createElement(Select, Object.assign({ variant: SelectVariant.typeahead, id: "category-selection", name: "category-selection", "data-testid": "category-selection", placeholderText: t('Select an option or enter a new category'), onFilter: onFilter, onToggle: (_event, isExpanded) => onToggle(isExpanded), isOpen: isSelectOpen, onSelect: onSelect, selections: selected === null || selected === void 0 ? void 0 : selected.categoryName, isDisabled: categories.isError, loadingVariant: 'spinner' }, (categories.isFetching && { loadingVariant: 'spinner' })), getCategoryOptions(categories.data))),
166
+ React.createElement(Select, { id: "category-selection", "data-testid": "category-selection", isOpen: isSelectOpen, selected: selected === null || selected === void 0 ? void 0 : selected.categoryName, onSelect: (event, val) => onCategorySelect(val), onOpenChange: () => setSelectOpen(false), toggle: toggle, shouldFocusFirstItemOnOpen: false, isScrollable: true },
167
+ React.createElement(SelectList, null, computeFilteredCategories().map((category, index) => (React.createElement(SelectOption, { key: index, isFocused: focusedItemIndex === index, value: category, isSelected: category.id === (selected === null || selected === void 0 ? void 0 : selected.id) }, category.categoryName)))))),
142
168
  isEditClicked && (React.createElement(FormGroup, { label: t('Link to content'), isRequired: true, fieldId: "top-content-link" },
143
169
  React.createElement(TextInput, { type: "text", id: "top-content-resource-link", name: "top-content-resource-link", "data-tracking-id": "top-content-resource-link", value: linkToContent, isDisabled: true }))),
144
- React.createElement("div", { className: "pf-v5-u-mt-sm" },
170
+ React.createElement("div", { className: "pf-v6-u-mt-sm" },
145
171
  isCategoryLimitReached && !isCategoryInList && !isUndefined(selected) && React.createElement(CategoryLimit, null),
146
172
  React.createElement(Button, { variant: "primary", onClick: onSaveContent, isDisabled: isSaving || isDisabled, isLoading: isSaving, "data-tracking-id": "suggested-content-save-button" },
147
173
  React.createElement(Trans, null, "Save")),
@@ -4,6 +4,6 @@ export function TopContentHeader() {
4
4
  return (React.createElement("header", null,
5
5
  React.createElement("h2", null,
6
6
  React.createElement(Trans, null, "Top content")),
7
- React.createElement("p", { className: "pf-v5-u-mt-md pf-v5-u-mb-sm" },
7
+ React.createElement("p", { className: "pf-v6-u-mt-md pf-v6-u-mb-sm" },
8
8
  React.createElement(Trans, null, "Add, edit, or remove top content solutions and categories. You can also create a new set of top content recommendations for specific versions."))));
9
9
  }
@@ -1 +1 @@
1
- {"version":3,"file":"TopContentProductVersionSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/TopContentManagement/TopContentProductVersionSelector.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AACvE,OAAO,EAAE,QAAQ,IAAI,aAAa,EAAE,MAAM,wCAAwC,CAAC;AAInF,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAG5D,OAAO,KAA8B,MAAM,OAAO,CAAC;AAMnD,UAAU,MAAO,SAAQ,gBAAgB;IACrC,eAAe,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;IACxC,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,aAAa,CAAC,KAAK,IAAI,CAAC;IAC3D,eAAe,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,SAAS,EAAE,MAAM,CAAC;CACrB;AAQD,wBAAgB,qBAAqB,CAAC,YAAY,EAAE,aAAa,CAAC,MAAM,EAAE,CAAC,2BAG1E;AAqBD,iBAAS,gCAAgC,CAAC,KAAK,EAAE,MAAM,qBA0JtD;kBA1JQ,gCAAgC;;;AA6JzC,OAAO,EAAE,gCAAgC,EAAE,CAAC"}
1
+ {"version":3,"file":"TopContentProductVersionSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/TopContentManagement/TopContentProductVersionSelector.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AACvE,OAAO,EAAE,QAAQ,IAAI,aAAa,EAAE,MAAM,wCAAwC,CAAC;AAWnF,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAG5D,OAAO,KAAsC,MAAM,OAAO,CAAC;AAM3D,UAAU,MAAO,SAAQ,gBAAgB;IACrC,eAAe,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;IACxC,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,aAAa,CAAC,KAAK,IAAI,CAAC;IAC3D,eAAe,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,SAAS,EAAE,MAAM,CAAC;CACrB;AAQD,wBAAgB,qBAAqB,CAAC,YAAY,EAAE,aAAa,CAAC,MAAM,EAAE,CAAC,2BAG1E;AAqBD,iBAAS,gCAAgC,CAAC,KAAK,EAAE,MAAM,qBA2MtD;kBA3MQ,gCAAgC;;;AA8MzC,OAAO,EAAE,gCAAgC,EAAE,CAAC"}