@rh-support/manage 2.6.1 → 2.6.11

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 (157) hide show
  1. package/lib/esm/ManageTabs.d.ts.map +1 -1
  2. package/lib/esm/ManageTabs.js +48 -20
  3. package/lib/esm/Routes.d.ts +1 -0
  4. package/lib/esm/Routes.d.ts.map +1 -1
  5. package/lib/esm/Routes.js +6 -0
  6. package/lib/esm/components/Configs/ConfigsTable.d.ts.map +1 -1
  7. package/lib/esm/components/Configs/ConfigsTable.js +33 -9
  8. package/lib/esm/components/Groups/AddMembersModal/AddMembersModal.d.ts +12 -0
  9. package/lib/esm/components/Groups/AddMembersModal/AddMembersModal.d.ts.map +1 -0
  10. package/lib/esm/components/Groups/AddMembersModal/AddMembersModal.js +80 -0
  11. package/lib/esm/components/Groups/AddMembersModal/index.d.ts +2 -0
  12. package/lib/esm/components/Groups/AddMembersModal/index.d.ts.map +1 -0
  13. package/lib/esm/components/Groups/AddMembersModal/index.js +1 -0
  14. package/lib/esm/components/Groups/DefualtGroupSwitch/DefaultGroupSwitch.d.ts +5 -3
  15. package/lib/esm/components/Groups/DefualtGroupSwitch/DefaultGroupSwitch.d.ts.map +1 -1
  16. package/lib/esm/components/Groups/DefualtGroupSwitch/DefaultGroupSwitch.js +21 -14
  17. package/lib/esm/components/Groups/GroupSelect/GroupSelect.d.ts +1 -0
  18. package/lib/esm/components/Groups/GroupSelect/GroupSelect.d.ts.map +1 -1
  19. package/lib/esm/components/Groups/GroupSelect/GroupSelect.js +240 -105
  20. package/lib/esm/components/Groups/GroupUserPermissionsSelect/GroupUserPermissionsSelect.d.ts.map +1 -1
  21. package/lib/esm/components/Groups/GroupUserPermissionsSelect/GroupUserPermissionsSelect.js +19 -14
  22. package/lib/esm/components/Groups/ManageGroupUsers/ManageGroupUsers.d.ts.map +1 -1
  23. package/lib/esm/components/Groups/ManageGroupUsers/ManageGroupUsers.js +187 -77
  24. package/lib/esm/components/ManageBookmarkedAccountsTab/AddEditBookmarkModal.d.ts.map +1 -1
  25. package/lib/esm/components/ManageBookmarkedAccountsTab/AddEditBookmarkModal.js +15 -12
  26. package/lib/esm/components/ManageBookmarkedAccountsTab/BookmarkAccountSelector.d.ts.map +1 -1
  27. package/lib/esm/components/ManageBookmarkedAccountsTab/BookmarkAccountSelector.js +106 -67
  28. package/lib/esm/components/ManageBookmarkedAccountsTab/BookmarkGroupSelector.d.ts.map +1 -1
  29. package/lib/esm/components/ManageBookmarkedAccountsTab/ManageGroupedBookmarkedAccountsTab.d.ts.map +1 -1
  30. package/lib/esm/components/ManageBookmarkedAccountsTab/ManageGroupedBookmarkedAccountsTab.js +15 -22
  31. package/lib/esm/components/ManageCaseLabels/AddEditCaseLabelModal.d.ts +19 -0
  32. package/lib/esm/components/ManageCaseLabels/AddEditCaseLabelModal.d.ts.map +1 -0
  33. package/lib/esm/components/ManageCaseLabels/AddEditCaseLabelModal.js +97 -0
  34. package/lib/esm/components/ManageCaseLabels/ManageCaseLabelsTab.d.ts +3 -0
  35. package/lib/esm/components/ManageCaseLabels/ManageCaseLabelsTab.d.ts.map +1 -0
  36. package/lib/esm/components/ManageCaseLabels/ManageCaseLabelsTab.js +220 -0
  37. package/lib/esm/components/ManageCaseLabels/index.d.ts +2 -0
  38. package/lib/esm/components/ManageCaseLabels/index.d.ts.map +1 -0
  39. package/lib/esm/components/ManageCaseLabels/index.js +1 -0
  40. package/lib/esm/components/ManageCaseLabels/types.d.ts +6 -0
  41. package/lib/esm/components/ManageCaseLabels/types.d.ts.map +1 -0
  42. package/lib/esm/components/ManageCaseLabels/types.js +1 -0
  43. package/lib/esm/components/ManageExpiredContents/ExpiredContentCategory.js +4 -4
  44. package/lib/esm/components/ManageExpiredContents/ExpiredContentHeader.js +1 -1
  45. package/lib/esm/components/ManageExpiredContents/ExpiredContentManager.d.ts.map +1 -1
  46. package/lib/esm/components/ManageExpiredContents/ExpiredContentManager.js +12 -12
  47. package/lib/esm/components/ManageExpiredContents/ExpiredContentSingleItem.js +3 -3
  48. package/lib/esm/components/ManageExpiredContents/ExpiredContentSingleItemView.d.ts.map +1 -1
  49. package/lib/esm/components/ManageExpiredContents/ExpiredContentSingleItemView.js +43 -35
  50. package/lib/esm/components/ManagePartnerships/NonOrgCustomerInfoModal.d.ts.map +1 -1
  51. package/lib/esm/components/ManagePartnerships/NonOrgCustomerInfoModal.js +8 -5
  52. package/lib/esm/components/ManagePartnerships/PartnershipsList.d.ts.map +1 -1
  53. package/lib/esm/components/ManagePartnerships/PartnershipsList.js +19 -12
  54. package/lib/esm/components/ManagePartnerships/PartnershipsTermsModal.d.ts.map +1 -1
  55. package/lib/esm/components/ManagePartnerships/PartnershipsTermsModal.js +17 -20
  56. package/lib/esm/components/ManagePartnerships/RequestCollaborationModal.d.ts.map +1 -1
  57. package/lib/esm/components/ManagePartnerships/RequestCollaborationModal.js +39 -27
  58. package/lib/esm/components/ManagePartnerships/Requests.d.ts +1 -0
  59. package/lib/esm/components/ManagePartnerships/Requests.d.ts.map +1 -1
  60. package/lib/esm/components/ManagePartnerships/Requests.js +22 -9
  61. package/lib/esm/components/ManagePartnerships/index.js +1 -1
  62. package/lib/esm/components/ManagePreferences/PreferencesBody.d.ts.map +1 -1
  63. package/lib/esm/components/ManagePreferences/PreferencesBody.js +1 -5
  64. package/lib/esm/components/ManagePreferences/PreferencesHeader.js +1 -1
  65. package/lib/esm/components/ManagePreferences/components/PreferenceSelect.d.ts +1 -1
  66. package/lib/esm/components/ManagePreferences/components/PreferenceSelect.d.ts.map +1 -1
  67. package/lib/esm/components/ManagePreferences/components/PreferenceSelect.js +26 -27
  68. package/lib/esm/components/ManagePreferences/components/PreferenceSwitch.d.ts.map +1 -1
  69. package/lib/esm/components/ManagePreferences/components/PreferenceSwitch.js +6 -6
  70. package/lib/esm/components/ManagePreferences/sections/PreferencesACL.d.ts.map +1 -1
  71. package/lib/esm/components/ManagePreferences/sections/PreferencesACL.js +8 -9
  72. package/lib/esm/components/ManagePreferences/sections/PreferencesCaseCreate.d.ts.map +1 -1
  73. package/lib/esm/components/ManagePreferences/sections/PreferencesCaseCreate.js +77 -63
  74. package/lib/esm/components/ManagePreferences/sections/PreferencesCaseSearch.d.ts.map +1 -1
  75. package/lib/esm/components/ManagePreferences/sections/PreferencesCaseSearch.js +3 -4
  76. package/lib/esm/components/ManagePreferences/sections/PreferencesCaseView.d.ts.map +1 -1
  77. package/lib/esm/components/ManagePreferences/sections/PreferencesCaseView.js +47 -103
  78. package/lib/esm/components/ManageTable/ManageTable.d.ts +3 -4
  79. package/lib/esm/components/ManageTable/ManageTable.d.ts.map +1 -1
  80. package/lib/esm/components/ManageTable/ManageTable.js +12 -18
  81. package/lib/esm/components/ManageTags/TagsManager.d.ts.map +1 -1
  82. package/lib/esm/components/ManageTags/TagsManager.js +58 -50
  83. package/lib/esm/components/NotificationEmails/NotificationEmailsModal.d.ts.map +1 -1
  84. package/lib/esm/components/NotificationEmails/NotificationEmailsModal.js +35 -26
  85. package/lib/esm/components/NotificationEmails/index.d.ts.map +1 -1
  86. package/lib/esm/components/NotificationEmails/index.js +10 -7
  87. package/lib/esm/components/TopContentManagement/CategoryLimit/CategoryLimit.d.ts.map +1 -1
  88. package/lib/esm/components/TopContentManagement/CategoryLimit/CategoryLimit.js +2 -3
  89. package/lib/esm/components/TopContentManagement/CategoryLimit/CategoryLimitGuidelines.js +6 -6
  90. package/lib/esm/components/TopContentManagement/CategoryLimit/QuestionAnswer.js +1 -1
  91. package/lib/esm/components/TopContentManagement/ContentUsage/ContentAccordion.d.ts.map +1 -1
  92. package/lib/esm/components/TopContentManagement/ContentUsage/ContentAccordion.js +7 -9
  93. package/lib/esm/components/TopContentManagement/ContentUsage/PerformanceMetricClickCount.d.ts +1 -0
  94. package/lib/esm/components/TopContentManagement/ContentUsage/PerformanceMetricClickCount.d.ts.map +1 -1
  95. package/lib/esm/components/TopContentManagement/ContentUsage/PerformanceMetricClickCount.js +2 -2
  96. package/lib/esm/components/TopContentManagement/ContentUsage/PerformanceMetrics.d.ts.map +1 -1
  97. package/lib/esm/components/TopContentManagement/ContentUsage/PerformanceMetrics.js +12 -10
  98. package/lib/esm/components/TopContentManagement/ContentUsage/PerformanceMetricsSelect.d.ts +2 -3
  99. package/lib/esm/components/TopContentManagement/ContentUsage/PerformanceMetricsSelect.d.ts.map +1 -1
  100. package/lib/esm/components/TopContentManagement/ContentUsage/PerformanceMetricsSelect.js +16 -9
  101. package/lib/esm/components/TopContentManagement/ContentUsage/VersionPerformanceMetrics.d.ts.map +1 -1
  102. package/lib/esm/components/TopContentManagement/ContentUsage/VersionPerformanceMetrics.js +15 -16
  103. package/lib/esm/components/TopContentManagement/NoTopContentFound.d.ts.map +1 -1
  104. package/lib/esm/components/TopContentManagement/NoTopContentFound.js +14 -15
  105. package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/AddNewCategoryDropDown.d.ts.map +1 -1
  106. package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/AddNewCategoryDropDown.js +47 -39
  107. package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/TopContentCategory.d.ts.map +1 -1
  108. package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/TopContentCategory.js +12 -6
  109. package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/TopContentCategoryNew.js +3 -3
  110. package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/TopContentComponent.d.ts.map +1 -1
  111. package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/TopContentComponent.js +11 -7
  112. package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/TopContentSingleItem.d.ts.map +1 -1
  113. package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/TopContentSingleItem.js +62 -53
  114. package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/TopContentSingleItemLink.d.ts.map +1 -1
  115. package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/TopContentSingleItemLink.js +2 -3
  116. package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentEditor.d.ts.map +1 -1
  117. package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentEditor.js +8 -9
  118. package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentSuggestion/TopContentSuggestion.js +2 -2
  119. package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentSuggestion/TopContentSuggestionHint.js +4 -5
  120. package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentSuggestion/TopContentSuggestionHintAccept.d.ts.map +1 -1
  121. package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentSuggestion/TopContentSuggestionHintAccept.js +51 -25
  122. package/lib/esm/components/TopContentManagement/TopContentHeader.js +1 -1
  123. package/lib/esm/components/TopContentManagement/TopContentProductVersionSelector.d.ts.map +1 -1
  124. package/lib/esm/components/TopContentManagement/TopContentProductVersionSelector.js +64 -32
  125. package/lib/esm/constants/GroupSelectActions.d.ts +2 -1
  126. package/lib/esm/constants/GroupSelectActions.d.ts.map +1 -1
  127. package/lib/esm/constants/GroupSelectActions.js +1 -0
  128. package/lib/esm/constants/PartnershipLink.d.ts +3 -0
  129. package/lib/esm/constants/PartnershipLink.d.ts.map +1 -0
  130. package/lib/esm/constants/PartnershipLink.js +2 -0
  131. package/lib/esm/context/ExpiredContentContextProvider.d.ts.map +1 -1
  132. package/lib/esm/hooks/useCaseGroupGraphQL.d.ts +42 -0
  133. package/lib/esm/hooks/useCaseGroupGraphQL.d.ts.map +1 -0
  134. package/lib/esm/hooks/useCaseGroupGraphQL.js +117 -0
  135. package/lib/esm/hooks/useCaseLabelGraphQL.d.ts +26 -0
  136. package/lib/esm/hooks/useCaseLabelGraphQL.d.ts.map +1 -0
  137. package/lib/esm/hooks/useCaseLabelGraphQL.js +104 -0
  138. package/lib/esm/hooks/useCurrentUserContact.d.ts +8 -0
  139. package/lib/esm/hooks/useCurrentUserContact.d.ts.map +1 -0
  140. package/lib/esm/hooks/useCurrentUserContact.js +74 -0
  141. package/lib/esm/hooks/useVersionsDiffer.d.ts.map +1 -1
  142. package/lib/esm/index.d.ts.map +1 -1
  143. package/lib/esm/index.js +2 -0
  144. package/lib/esm/reducers/ExpiredContentReducer.d.ts.map +1 -1
  145. package/lib/esm/reducers/ManagePartnershipsReducer.d.ts.map +1 -1
  146. package/lib/esm/reducers/TagManagmentReducer.d.ts +1 -1
  147. package/lib/esm/reducers/TagManagmentReducer.d.ts.map +1 -1
  148. package/lib/esm/reducers/TopContentHelpers.d.ts.map +1 -1
  149. package/lib/esm/reducers/TopContentReducer.d.ts.map +1 -1
  150. package/lib/esm/reducers/TopContentReducer.js +5 -2
  151. package/lib/esm/scss/_main.scss +266 -24
  152. package/lib/esm/scss/_pf-overrides.scss +66 -53
  153. package/lib/esm/scss/index.scss +5 -4
  154. package/lib/esm/utils/caseGroupMapper.d.ts +18 -0
  155. package/lib/esm/utils/caseGroupMapper.d.ts.map +1 -0
  156. package/lib/esm/utils/caseGroupMapper.js +50 -0
  157. package/package.json +21 -22
@@ -9,7 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  };
10
10
  import { Button } from '@patternfly/react-core';
11
11
  import { ToastNotification } from '@rh-support/components';
12
- import React, { useState } from 'react';
12
+ import { isEmpty } from 'lodash';
13
+ import React, { useEffect, useState } from 'react';
13
14
  import { Draggable, Droppable } from 'react-beautiful-dnd';
14
15
  import { Trans, useTranslation } from 'react-i18next';
15
16
  import { useTopContentContext, useTopContentDispatchContext } from '../../../../context/TopContentProvider';
@@ -20,6 +21,11 @@ export const TopContentComponent = (props) => {
20
21
  const topContentDispatch = useTopContentDispatchContext();
21
22
  const { topContentEditState, topContentResponse, isSearchModeEnabled } = useTopContentContext();
22
23
  const [isArrangingContent, setIsArrangingContent] = useState(false);
24
+ const [isDisableAddContent, setIsDisableAddContent] = useState(false);
25
+ useEffect(() => {
26
+ const value = props.category.content.find((item) => isEmpty(item.contentTitle));
27
+ setIsDisableAddContent(!!value);
28
+ }, [props.category.content]);
23
29
  // we add an category with empty content to state, the rest is handled like existing categories
24
30
  const addContent = () => addTopContent(topContentDispatch, topContentEditState, props.category.id);
25
31
  const arrangeSection = () => {
@@ -40,22 +46,20 @@ export const TopContentComponent = (props) => {
40
46
  resetChangeInCategoryContent(topContentDispatch, topContentEditState, topContentResponse, props.category.id);
41
47
  setIsArrangingContent(false);
42
48
  };
43
- const buttons = (React.createElement("div", { className: "pf-v5-c-accordion__expanded-content-footer" },
49
+ const buttons = (React.createElement("div", { className: "pf-v6-c-accordion__expanded-content-footer" },
44
50
  !isArrangingContent && props.categoryMode !== CategoryMode.NEW_SECTION && (React.createElement("span", null,
45
- React.createElement(Button, { variant: "secondary", onClick: addContent, "data-tracking-id": "add-content-top-content" },
51
+ React.createElement(Button, { className: "pf-v6-u-mr-md", variant: "secondary", onClick: addContent, "data-tracking-id": "add-content-top-content", isDisabled: isDisableAddContent },
46
52
  React.createElement(Trans, null, "Add content")),
47
- ' ',
48
53
  React.createElement(Button, { variant: "secondary", onClick: arrangeSection, isDisabled: props.category.content.length < 2 },
49
54
  React.createElement(Trans, null, "Arrange section")))),
50
55
  isArrangingContent && (React.createElement("span", null,
51
- React.createElement(Button, { variant: "primary", onClick: saveArrangement },
56
+ React.createElement(Button, { className: "pf-v6-u-mr-md", variant: "primary", onClick: saveArrangement },
52
57
  React.createElement(Trans, null, "Save")),
53
- ' ',
54
58
  React.createElement(Button, { variant: "link", onClick: cancelArrangement },
55
59
  React.createElement(Trans, null, "Cancel"))))));
56
60
  return (React.createElement("div", null,
57
61
  React.createElement(Droppable, { droppableId: `${props.category.id}`, type: `drop-inner-${props.category.id}`, isDropDisabled: !isArrangingContent, key: `drop-inner-${props.category.id}` }, (provided) => (React.createElement("div", { ref: provided.innerRef },
58
- React.createElement("ul", { id: "content-list", "aria-label": t('Content list'), className: "list-flat list-flushleft" },
62
+ React.createElement("ul", { id: "content-list", "aria-label": t('Content list'), className: "list-flat" },
59
63
  props.category.content.map((content, i) => (React.createElement(Draggable, { key: `drag-inner-${i}${props.category.id}`, draggableId: `drag-inner-${i}${props.category.id}`, index: i, isDragDisabled: !isArrangingContent }, (provided, snapshot) => (React.createElement("div", Object.assign({ key: `${i}-c`, "aria-label": t('Content'), ref: provided.innerRef }, provided.draggableProps, provided.dragHandleProps),
60
64
  React.createElement(TopContentSingleItem, { isArrangingContent: isArrangingContent, category: props.category, snapshot: snapshot, i: i, key: content.topContentId })))))),
61
65
  provided.placeholder),
@@ -1 +1 @@
1
- {"version":3,"file":"TopContentSingleItem.d.ts","sourceRoot":"","sources":["../../../../../../src/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/TopContentSingleItem.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAiB,aAAa,EAAE,MAAM,0CAA0C,CAAC;AA8BtG,OAAO,KAA2D,MAAM,OAAO,CAAC;AAChF,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAM7D,OAAO,EAIH,oBAAoB,EAOvB,MAAM,wCAAwC,CAAC;AAIhD,UAAU,MAAM;IACZ,kBAAkB,EAAE,OAAO,CAAC;IAC5B,QAAQ,EAAE,oBAAoB,CAAC;IAC/B,QAAQ,CAAC,EAAE,sBAAsB,CAAC;IAClC,CAAC,EAAE,MAAM,CAAC;CACb;AAED,wBAAgB,sBAAsB,CAAC,GAAG,KAAA,OASzC;AAED,wBAAsB,cAAc,CAAC,GAAG,EAAE,MAAM,6CA2B/C;AAED,eAAO,MAAM,oBAAoB,kDAAmD,MAAM,sBAufzF,CAAC"}
1
+ {"version":3,"file":"TopContentSingleItem.d.ts","sourceRoot":"","sources":["../../../../../../src/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/TopContentSingleItem.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAiB,aAAa,EAAE,MAAM,0CAA0C,CAAC;AAiCtG,OAAO,KAAsE,MAAM,OAAO,CAAC;AAC3F,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAM7D,OAAO,EAIH,oBAAoB,EAOvB,MAAM,wCAAwC,CAAC;AAIhD,UAAU,MAAM;IACZ,kBAAkB,EAAE,OAAO,CAAC;IAC5B,QAAQ,EAAE,oBAAoB,CAAC;IAC/B,QAAQ,CAAC,EAAE,sBAAsB,CAAC;IAClC,CAAC,EAAE,MAAM,CAAC;CACb;AAED,wBAAgB,sBAAsB,CAAC,GAAG,KAAA,OASzC;AAED,wBAAsB,cAAc,CAAC,GAAG,EAAE,MAAM,6CA2B/C;AAED,eAAO,MAAM,oBAAoB,GAAI,+CAA+C,MAAM,sBAihBzF,CAAC"}
@@ -8,7 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  });
9
9
  };
10
10
  import { search } from '@cee-eng/hydrajs';
11
- import { Button, DatePicker, Flex, FlexItem, FormGroup, Icon, Label, TextInput, ValidatedOptions, } from '@patternfly/react-core';
11
+ import { Button, Card, CardBody, DatePicker, Flex, FlexItem, FormGroup, Icon, Label, TextInput, ValidatedOptions, } from '@patternfly/react-core';
12
12
  import EditAltIcon from '@patternfly/react-icons/dist/js/icons/edit-alt-icon';
13
13
  import ExclamationCircleIcon from '@patternfly/react-icons/dist/js/icons/exclamation-circle-icon';
14
14
  import GripVerticalIcon from '@patternfly/react-icons/dist/js/icons/grip-vertical-icon';
@@ -78,12 +78,13 @@ export const TopContentSingleItem = ({ isArrangingContent, category, snapshot, i
78
78
  const tagManagementEditState = useContext(TagManagementStateContext);
79
79
  const { tags: tagOptions } = tagManagementEditState;
80
80
  const ref = useRef(null);
81
+ const datePickerRef = useRef(null);
81
82
  const topContentDispatch = useTopContentDispatchContext();
82
83
  const [localContentUrl, setLocalContentUrl] = useState(content.contentUrl);
83
84
  const [localContentTitle, setLocalContentTitle] = useState(content.contentTitle);
84
85
  const [localSelectedTags, setLocalSelectedTags] = useState(content.tags || []);
85
86
  const [localExpiryDate, setLocalExpiryDate] = useState((content === null || content === void 0 ? void 0 : content.expiryDate) || '');
86
- const [newCategory, setNewCategory] = useState(undefined);
87
+ const [newCategory, setNewCategory] = useState();
87
88
  const [contentTitleIsValid, setContentTitleIsValid] = useState(true);
88
89
  const [contentUrlIsValid, setContentUrlIsValid] = useState(true);
89
90
  const [showDuplicateError, setShowDuplicateError] = useState(false);
@@ -316,59 +317,67 @@ export const TopContentSingleItem = ({ isArrangingContent, category, snapshot, i
316
317
  return (React.createElement(React.Fragment, null,
317
318
  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
319
  isArrangingContent && (React.createElement(Icon, { size: "sm" },
319
- React.createElement(GripVerticalIcon, { style: { cursor: 'move' }, title: t('Drag'), color: "#06c", className: "pf-v5-u-mr-sm" }))),
320
+ React.createElement(GripVerticalIcon, { style: { cursor: 'move' }, title: t('Drag'), color: "#06c", className: "pf-v6-u-mr-sm" }))),
320
321
  !isArrangingContent ? (React.createElement(React.Fragment, null,
321
322
  React.createElement(TopContentSingleItemLink, { url: getTopContentUrl(content.contentUrl), title: content.contentTitle, contentId: content.topContentId, needsAttention: content.isAttentionNeeded, lastModifiedBy: lastModifiedBy, selectedVersion: selectedVersion }),
322
- ' ',
323
- React.createElement(Button, { variant: "link", isInline: true, icon: React.createElement(EditAltIcon, null), onClick: editToggle, title: 'Edit' }))) : (content.contentTitle),
324
- React.createElement("div", null, lastModifiedBy),
323
+ React.createElement(Button, { className: "pf-v6-u-ml-sm", variant: "link", isInline: true, icon: React.createElement(EditAltIcon, null), onClick: editToggle, title: 'Edit' }))) : (content.contentTitle),
324
+ React.createElement("div", { className: "pf-v6-u-mt-sm" }, 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
- (!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
- content.mode === ContentMode.NEW_SECTION_CONTENT && (React.createElement(AddNewCategoryDropDown, { onCategoryChange: onAddedNewCategoryChange })),
331
- React.createElement("div", { className: "form-group" },
332
- React.createElement("label", { htmlFor: localContentTitle },
333
- "Heading",
334
- ' ',
335
- React.createElement("span", { className: "form-required", "aria-hidden": true }, "*")),
336
- React.createElement(TextInput, { isRequired: true, type: "text", maxLength: 254, required: true, value: localContentTitle, isDisabled: isFetchingSolrSearch, "aria-label": t('Copy and paste the heading for consistency'), placeholder: t('Copy and paste the heading for consistency'), onChange: (e, v) => {
337
- onContentTitleChange(v, e);
338
- }, validated: contentTitleIsValid && !isDuplicateTitle
339
- ? ValidatedOptions.default
340
- : ValidatedOptions.error }),
341
- isDuplicateTitle && (React.createElement("p", { className: "form-instructions form-invalid " },
342
- React.createElement(ExclamationCircleIcon, { color: "#c9190b", className: "pf-u-mr-sm" }),
343
- ' ',
344
- React.createElement(Trans, null, "Duplicate heading. Content with this heading is already present.")))),
345
- React.createElement("div", { className: "form-group" },
346
- React.createElement("label", { htmlFor: localContentUrl },
347
- "Link to content",
348
- ' ',
349
- React.createElement("span", { className: "form-required", "aria-hidden": true }, "*")),
350
- React.createElement(TextInput, { type: "url", maxLength: 254, isRequired: true, pattern: "^(http(s)?:\\/\\/)+[\\w\\-\\._~:\\/?#[\\]@!\\$&'\\(\\)\\*\\+,;=.]+$", value: getTopContentUrl(localContentUrl), "aria-label": t('Entering a solution or article link first will automatically generate the heading for you'), placeholder: t('Entering a solution or article link first will automatically generate the heading for you'), onChange: (evt, val) => {
351
- onContentUrlChange(val, evt);
352
- }, validated: contentUrlIsValid ? ValidatedOptions.default : ValidatedOptions.error }),
353
- showDuplicateError && (React.createElement("p", { className: "form-instructions form-invalid" },
354
- React.createElement(ExclamationCircleIcon, { color: "#c9190b", className: "pf-v5-u-mr-sm" }),
355
- " Duplicate url. This url is already added in ",
356
- formatDuplicateWarning(duplicatUrlErrorArray),
357
- "."))),
358
- React.createElement(Flex, { className: "pf-v5-u-my-lg" },
359
- React.createElement(FlexItem, { flex: { default: 'flex_1' } },
360
- React.createElement(FormGroup, { label: t('Tags') },
361
- React.createElement("div", { className: `${isEmpty(tagOptions) ? 'menu-is-disabld' : ''}` },
362
- React.createElement(TagsSelector, { tagOptions: tagOptions, onChange: handleLocalTagChange, selectedTags: localSelectedTags, placeholder: t('Select tags to improve discoverability'), id: "top-content-tag" })))),
363
- React.createElement(FlexItem, null,
364
- React.createElement(FormGroup, { label: t('Expiry date') },
365
- React.createElement(DatePicker, { onBlur: onExpiryDateChange, onChange: onExpiryDateChange, value: !isEmpty(localExpiryDate) ? localExpiryDate.split('T')[0] : '', validators: [expiryDateValidator], id: "content-expiry-date", invalidFormatText: t('Invalid date format') })))),
366
- React.createElement("span", { className: "top-content-single-item-footer" },
367
- React.createElement("span", null,
368
- React.createElement(Button, { variant: "primary", onClick: onSave, isDisabled: isSaveButtonDisabled || isSaving, isLoading: isSaving },
369
- React.createElement(Trans, null, "Save")),
370
- ' ',
371
- React.createElement(Button, { variant: "tertiary", onClick: onCancel, "data-tracking-id": "cancel-button-top-content" },
372
- React.createElement(Trans, null, "Cancel"))),
373
- React.createElement("span", { className: "content-actions" }, content.mode !== ContentMode.ADD && content.mode !== ContentMode.NEW_SECTION_CONTENT && (React.createElement(Button, { variant: "danger", "aria-label": t('Delete content'), onClick: onDelete }, "Delete"))))))));
329
+ (!isPreview || content.mode === ContentMode.ADD || content.mode === ContentMode.NEW_SECTION_CONTENT) && (React.createElement(Card, { variant: "secondary", className: "pf-v6-u-mb-md" },
330
+ React.createElement(CardBody, null,
331
+ React.createElement("form", { noValidate: true, onSubmit: onSubmit, ref: ref },
332
+ content.mode === ContentMode.NEW_SECTION_CONTENT && (React.createElement(AddNewCategoryDropDown, { onCategoryChange: onAddedNewCategoryChange })),
333
+ React.createElement("div", { className: "form-group" },
334
+ React.createElement("label", { htmlFor: localContentTitle },
335
+ "Heading",
336
+ ' ',
337
+ React.createElement("span", { className: "form-required", "aria-hidden": true }, "*")),
338
+ React.createElement(TextInput, { isRequired: true, type: "text", maxLength: 254, required: true, value: localContentTitle, isDisabled: isFetchingSolrSearch, "aria-label": t('Copy and paste the heading for consistency'), placeholder: t('Copy and paste the heading for consistency'), onChange: (e, v) => {
339
+ onContentTitleChange(v, e);
340
+ }, validated: contentTitleIsValid && !isDuplicateTitle
341
+ ? ValidatedOptions.default
342
+ : ValidatedOptions.error }),
343
+ isDuplicateTitle && (React.createElement("p", { className: "form-instructions form-invalid " },
344
+ React.createElement(ExclamationCircleIcon, { color: "#c9190b", className: "pf-u-mr-sm" }),
345
+ ' ',
346
+ React.createElement(Trans, null, "Duplicate heading. Content with this heading is already present.")))),
347
+ React.createElement("div", { className: "form-group" },
348
+ React.createElement("label", { htmlFor: localContentUrl },
349
+ "Link to content",
350
+ ' ',
351
+ React.createElement("span", { className: "form-required", "aria-hidden": true }, "*")),
352
+ React.createElement(TextInput, { type: "url", maxLength: 254, isRequired: true, pattern: "^(http(s)?:\\/\\/)+[\\w\\-\\._~:\\/?#[\\]@!\\$&'\\(\\)\\*\\+,;=.]+$", value: getTopContentUrl(localContentUrl), "aria-label": t('Entering a solution or article link first will automatically generate the heading for you'), placeholder: t('Entering a solution or article link first will automatically generate the heading for you'), onChange: (evt, val) => {
353
+ onContentUrlChange(val, evt);
354
+ }, validated: contentUrlIsValid ? ValidatedOptions.default : ValidatedOptions.error }),
355
+ showDuplicateError && (React.createElement("p", { className: "form-instructions form-invalid" },
356
+ React.createElement(ExclamationCircleIcon, { color: "#c9190b", className: "pf-v6-u-mr-sm" }),
357
+ " Duplicate url. This url is already added in",
358
+ ' ',
359
+ formatDuplicateWarning(duplicatUrlErrorArray),
360
+ "."))),
361
+ React.createElement(Flex, { className: "pf-v6-u-my-lg" },
362
+ React.createElement(FlexItem, { flex: { default: 'flex_1' } },
363
+ React.createElement(FormGroup, { label: t('Tags') },
364
+ React.createElement("div", { className: `${isEmpty(tagOptions) ? 'menu-is-disabld' : ''}` },
365
+ React.createElement(TagsSelector, { tagOptions: tagOptions, onChange: handleLocalTagChange, selectedTags: localSelectedTags, placeholder: t('Select tags to improve discoverability'), id: "top-content-tag" })))),
366
+ React.createElement(FlexItem, null,
367
+ React.createElement(FormGroup, { ref: datePickerRef, label: t('Expiry date') },
368
+ React.createElement(DatePicker, { onBlur: onExpiryDateChange, onChange: onExpiryDateChange, value: !isEmpty(localExpiryDate) ? localExpiryDate.split('T')[0] : '', validators: [expiryDateValidator], id: "content-expiry-date", invalidFormatText: t('Invalid date format'), popoverProps: {
369
+ position: 'left',
370
+ hasAutoWidth: true,
371
+ maxWidth: '22rem',
372
+ minWidth: '22rem',
373
+ appendTo: () => document.body,
374
+ } })))),
375
+ React.createElement("span", { className: "top-content-single-item-footer" },
376
+ React.createElement("span", null,
377
+ React.createElement(Button, { className: "pf-v6-u-mr-sm", variant: "primary", onClick: onSave, isDisabled: isSaveButtonDisabled || isSaving, isLoading: isSaving },
378
+ React.createElement(Trans, null, "Save")),
379
+ React.createElement(Button, { variant: "tertiary", onClick: onCancel, "data-tracking-id": "cancel-button-top-content" },
380
+ React.createElement(Trans, null, "Cancel"))),
381
+ React.createElement("span", { className: "content-actions" }, content.mode !== ContentMode.ADD &&
382
+ content.mode !== ContentMode.NEW_SECTION_CONTENT && (React.createElement(Button, { variant: "danger", "aria-label": t('Delete content'), onClick: onDelete }, "Delete"))))))))));
374
383
  };
@@ -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
  };
@@ -1 +1 @@
1
- {"version":3,"file":"TopContentEditor.d.ts","sourceRoot":"","sources":["../../../../../src/components/TopContentManagement/TopContentEditor/TopContentEditor.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAA2D,MAAM,OAAO,CAAC;AAiChF,wBAAgB,gBAAgB,sBAqX/B"}
1
+ {"version":3,"file":"TopContentEditor.d.ts","sourceRoot":"","sources":["../../../../../src/components/TopContentManagement/TopContentEditor/TopContentEditor.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAA2D,MAAM,OAAO,CAAC;AAiChF,wBAAgB,gBAAgB,sBAuX/B"}
@@ -149,13 +149,13 @@ export function TopContentEditor() {
149
149
  React.createElement(TopContentHeader, null),
150
150
  !topContentResponse.isFetching && topContentResponse.isError && (React.createElement(Alert, { isInline: true, variant: AlertVariant.danger, title: React.createElement(Trans, null, "Error loading Top Content") })),
151
151
  React.createElement(TopContentProductVersionSelector, { selectedProduct: selectedProduct, selectedVersion: selectedVersion, onProductChange: onProductChange, onVersionChange: onVersionChange }),
152
- !topContentResponse.isFetching && (React.createElement("div", { className: "toolbar" },
152
+ !topContentResponse.isFetching && (React.createElement("div", { className: "toolbar secondary-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
- 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" },
157
+ React.createElement(TagsSelector, { typeahead: true, tagOptions: tags, onChange: onTagFilterChange, selectedTags: filteredTags, disabled: isEmpty(flagContentEditState) })))),
158
+ React.createElement("div", { className: "top-content-manage-wrapper pf-v6-u-p-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 },
@@ -166,7 +166,7 @@ export function TopContentEditor() {
166
166
  provided.innerRef(el);
167
167
  topContentResultsRef.current = el;
168
168
  } }),
169
- React.createElement(Accordion, { asDefinitionList: true },
169
+ React.createElement(Accordion, { asDefinitionList: true, togglePosition: "start" },
170
170
  !topContentResponse.isFetching &&
171
171
  filteredTC.map((category, i) => (React.createElement("div", { key: `div-${i}-${category.id}` },
172
172
  category.catMode === CategoryMode.EXISTING_SECTION && (React.createElement(Draggable, { draggableId: `c${category.id}`, index: i, isDragDisabled: !isArrangingCats, key: `c-${i}-${category.id}` }, (provided, snapshot) => category.helperText ? (React.createElement(Tooltip, { content: React.createElement("div", null, category.helperText) },
@@ -179,15 +179,14 @@ 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" },
186
186
  React.createElement(Trans, null, "Add a new section")),
187
- ' ',
188
- React.createElement(Button, { variant: "secondary", onClick: arrangeSection, isDisabled: flagContentEditState.length < 2 },
187
+ React.createElement(Button, { variant: "secondary", className: "pf-v6-u-ml-sm", onClick: arrangeSection, isDisabled: flagContentEditState.length < 2 },
189
188
  React.createElement(Trans, null, "Arrange section")),
190
- isMajorOrNamedVersion(selectedVersion) && (React.createElement(Button, { variant: "link", className: "pf-v5-u-float-right", isInline: true, onClick: onOpenModal },
189
+ isMajorOrNamedVersion(selectedVersion) && (React.createElement(Button, { variant: "link", className: "pf-v6-u-float-right pf-v6-u-ml-sm", isInline: true, onClick: onOpenModal },
191
190
  React.createElement(Trans, null, "View performance"))))),
192
191
  isArrangingCats && (React.createElement(React.Fragment, null,
193
192
  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,EAAc,MAAM,wCAAwC,CAAC;AAY/F,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,qBAiNtD;kBAjNQ,gCAAgC;;;AAoNzC,OAAO,EAAE,gCAAgC,EAAE,CAAC"}