@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
@@ -63,7 +63,6 @@ export function NotificationEmails() {
63
63
  yield confirmation({
64
64
  catchOnCancel: true,
65
65
  confirmText: t('Yes, I am sure'),
66
- confirmButtonVariant: ButtonVariant.danger,
67
66
  description: (React.createElement("strong", null,
68
67
  React.createElement(Trans, null, "Are you sure you want to remove this notification email?"))),
69
68
  });
@@ -74,6 +73,7 @@ export function NotificationEmails() {
74
73
  ToastNotification.addSuccessMessage(t('Notification email has been successfully removed'));
75
74
  }
76
75
  catch (e) {
76
+ console.error(e);
77
77
  // we come here if error happens or user didn't confirm the delete action
78
78
  !isEmpty(e) && ToastNotification.addDangerMessage(t('Notification email account failed to update'));
79
79
  }
@@ -130,19 +130,22 @@ export function NotificationEmails() {
130
130
  },
131
131
  ];
132
132
  const actionResolver = (rowData) => {
133
+ const email = rowData['emailAddress'] || '';
134
+ const firstName = rowData['firstName'] || '';
135
+ const lastName = rowData['lastName'] || '';
133
136
  return [
134
137
  {
135
138
  title: 'Edit',
136
139
  onClick: () => editEmail({
137
- email: rowData['email-address'].title || '',
138
- firstName: rowData['first-name'].title || '',
139
- lastName: rowData['last-name'].title || '',
140
+ email,
141
+ firstName,
142
+ lastName,
140
143
  }),
141
144
  itemKey: 'edit-notification-emails',
142
145
  },
143
146
  {
144
147
  title: 'Remove',
145
- onClick: () => removeEmail(rowData['email-address'].title),
148
+ onClick: () => removeEmail(email),
146
149
  itemKey: 'remove-notification-emails',
147
150
  },
148
151
  ];
@@ -163,12 +166,12 @@ export function NotificationEmails() {
163
166
  React.createElement("div", { className: "toolbar-left" },
164
167
  React.createElement("label", { htmlFor: "notification-emails-input" }, t('Add an Email')),
165
168
  React.createElement(TextInput, { id: "notification-email-input", placeholder: t('Enter a valid email address'), "aria-label": t('Enter a valid email address'), onChange: (_event, email) => onEmailInputBoxChange(email) }),
166
- React.createElement("span", { className: "pf-v5-u-ml-sm" },
169
+ React.createElement("span", { className: "pf-v6-u-ml-sm" },
167
170
  React.createElement(Button, { variant: ButtonVariant.primary, isInline: true, onClick: addEmail, "data-tracking-id": "email-address-add-button", isDisabled: isAddButtonDisabled },
168
171
  React.createElement(Trans, null, "Add")))),
169
172
  React.createElement("div", { className: "toolbar-right" },
170
173
  React.createElement("label", { htmlFor: "search-notification-emails-selector" }, t('Filter by')),
171
- React.createElement(SearchInput, { className: "pf-v5-u-flex-grow-1 pf-v5-c-search-input pf-v5-u-background-color-100", id: "search-notification-emails-selector", placeholder: t('Search for an existing email'), value: searchString, onChange: (_, value) => onSearchChange(value), onClear: () => onSearchChange(''), "aria-label": t('Search for an existing email') }))),
174
+ React.createElement(SearchInput, { className: "pf-v6-u-flex-grow-1 pf-v6-c-search-input pf-v6-u-background-color-100", id: "search-notification-emails-selector", placeholder: t('Search for an existing email'), value: searchString, onChange: (_, value) => onSearchChange(value), onClear: () => onSearchChange(''), "aria-label": t('Search for an existing email') }))),
172
175
  React.createElement(ManageTable, { ariaLabel: t('Table to manage Notification emails'), columns: columns, data: emailLists || [], sortInfo: { column: 'first-name', direction: 'asc' }, errorVariant: AlertVariant.warning, isFetching: accountCustomEmails.isFetching, isError: accountCustomEmails.isError, errorTitle: t('Notification emails error'), errorComponent: React.createElement(Trans, null, "Could not get notification emails"), actionResolver: emailLists && emailLists.length !== 0 ? actionResolver : null, keepPageNumberOnDataChange: keepPageNumberOnDataChange }),
173
176
  React.createElement(NotificationEmailsModal, { isOpen: isEditModalOpen, onClose: onModalClose, selectedEmailNotification: selectedEmailNotification, onUpdate: onUpdate, onAdd: onAdd, accountNumber: loggedInUserJwtToken.account_number, isAddingNotificationEmail: isAddingNotificationEmail, emailsList: (accountCustomEmails.data || []).map((e) => e.emailAddress) })));
174
177
  }
@@ -1 +1 @@
1
- {"version":3,"file":"CategoryLimit.d.ts","sourceRoot":"","sources":["../../../../../src/components/TopContentManagement/CategoryLimit/CategoryLimit.tsx"],"names":[],"mappings":"AAEA,OAAc,EAAE,EAAE,EAAY,MAAM,OAAO,CAAC;AAK5C,QAAA,MAAM,aAAa,EAAE,EAgCpB,CAAC;AAEF,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"CategoryLimit.d.ts","sourceRoot":"","sources":["../../../../../src/components/TopContentManagement/CategoryLimit/CategoryLimit.tsx"],"names":[],"mappings":"AAEA,OAAc,EAAE,EAAE,EAAY,MAAM,OAAO,CAAC;AAK5C,QAAA,MAAM,aAAa,EAAE,EAmCpB,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -13,9 +13,8 @@ const CategoryLimit = () => {
13
13
  hide();
14
14
  setModalOpen(true);
15
15
  } }, "Review guidelines."))) },
16
- React.createElement(Button, { variant: "plain" },
17
- React.createElement(Icon, { size: "md" },
18
- React.createElement(CircleInfo, null)))),
16
+ React.createElement(Button, { icon: React.createElement(Icon, { size: "md" },
17
+ React.createElement(CircleInfo, { color: "#5e40be" })), variant: "plain" })),
19
18
  React.createElement(CategoryLimitGuidelines, { isModalOpen: isModalOpen, onHideModal: onHideModal })));
20
19
  };
21
20
  export default CategoryLimit;
@@ -1,17 +1,17 @@
1
- import { Button, ButtonVariant, Modal, ModalVariant, Title, TitleSizes } from '@patternfly/react-core';
1
+ import { Button, ButtonVariant, Modal, ModalFooter, ModalVariant, Title, TitleSizes } from '@patternfly/react-core';
2
2
  import React from 'react';
3
3
  import { Trans } from 'react-i18next';
4
4
  import { CATEGORY_LIMIT, DIGIT_WORD_MAP } from '../../../constants/TopContent';
5
5
  import QuestionAnswer from './QuestionAnswer';
6
6
  export const CategoryLimitGuidelines = ({ isModalOpen, onHideModal }) => {
7
- return (React.createElement(Modal, { variant: ModalVariant.medium, id: "top-content-category-limit-guidelines", "aria-label": "top-content-category-limit-guidelines", isOpen: isModalOpen, onClose: onHideModal, actions: [
8
- React.createElement(Button, { variant: ButtonVariant.secondary, key: "close-button", onClick: onHideModal }, "Cancel"),
9
- ] },
7
+ return (React.createElement(Modal, { variant: ModalVariant.medium, id: "top-content-category-limit-guidelines", "aria-label": "top-content-category-limit-guidelines", isOpen: isModalOpen, onClose: onHideModal },
10
8
  React.createElement(Title, { headingLevel: "h1", size: TitleSizes['2xl'] },
11
9
  React.createElement(Trans, null, " Top content guideline ")),
12
10
  React.createElement(Trans, null,
13
- React.createElement("p", { className: "pf-v5-u-pt-sm" }, "Guidelines and limitations for top content resources.")),
11
+ React.createElement("p", { className: "pf-v6-u-pt-sm" }, "Guidelines and limitations for top content resources.")),
14
12
  React.createElement(QuestionAnswer, { question: "What is top content?", answer: "Top content is defined as the top resource for given product and version that will provide the most value for our customer and the highest likelihood for case deflection." }),
15
13
  React.createElement(QuestionAnswer, { question: "What is not top content", answer: "Resource that are accessible in other parts of the customer journey throughout the Customer Portal. For example, labs are not a top content resource. " }),
16
- React.createElement(QuestionAnswer, { question: "Category and link restrictions", answer: `we allow for a minimum of ${DIGIT_WORD_MAP[CATEGORY_LIMIT.MIN]} and max ${DIGIT_WORD_MAP[CATEGORY_LIMIT.MAX]} categories, and links within each category.` })));
14
+ React.createElement(QuestionAnswer, { question: "Category and link restrictions", answer: `we allow for a minimum of ${DIGIT_WORD_MAP[CATEGORY_LIMIT.MIN]} and max ${DIGIT_WORD_MAP[CATEGORY_LIMIT.MAX]} categories, and links within each category.` }),
15
+ React.createElement(ModalFooter, null,
16
+ React.createElement(Button, { variant: ButtonVariant.secondary, key: "close-button", onClick: onHideModal }, "Cancel"))));
17
17
  };
@@ -1,7 +1,7 @@
1
1
  import { Title } from '@patternfly/react-core';
2
2
  import React from 'react';
3
3
  import { Trans } from 'react-i18next';
4
- const QuestionAnswer = ({ question, answer }) => (React.createElement("div", { className: "pf-v5-u-pt-lg" },
4
+ const QuestionAnswer = ({ question, answer }) => (React.createElement("div", { className: "pf-v6-u-pt-lg" },
5
5
  React.createElement(Title, { headingLevel: "h6", size: "md" },
6
6
  React.createElement(Trans, null,
7
7
  " ",
@@ -1 +1 @@
1
- {"version":3,"file":"ContentAccordion.d.ts","sourceRoot":"","sources":["../../../../../src/components/TopContentManagement/ContentUsage/ContentAccordion.tsx"],"names":[],"mappings":"AAUA,OAAc,EAAE,EAAE,EAAY,MAAM,OAAO,CAAC;AAG5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAG3E,UAAU,MAAM;IACZ,WAAW,EAAE,oBAAoB,EAAE,CAAC;IACpC,eAAe,EAAE,MAAM,CAAC;CAC3B;AAED,eAAO,MAAM,gBAAgB,EAAE,EAAE,CAAC,MAAM,CAsEvC,CAAC"}
1
+ {"version":3,"file":"ContentAccordion.d.ts","sourceRoot":"","sources":["../../../../../src/components/TopContentManagement/ContentUsage/ContentAccordion.tsx"],"names":[],"mappings":"AAUA,OAAc,EAAE,EAAE,EAAY,MAAM,OAAO,CAAC;AAG5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAG3E,UAAU,MAAM;IACZ,WAAW,EAAE,oBAAoB,EAAE,CAAC;IACpC,eAAe,EAAE,MAAM,CAAC;CAC3B;AAED,eAAO,MAAM,gBAAgB,EAAE,EAAE,CAAC,MAAM,CAgEvC,CAAC"}
@@ -18,20 +18,18 @@ export const ContentAccordion = ({ contentList, selectedVersion }) => {
18
18
  React.createElement(Panel, { variant: "bordered" },
19
19
  React.createElement(PanelMain, null,
20
20
  React.createElement(PanelMainBody, null,
21
- React.createElement(Accordion, { isBordered: true }, contentList.map(({ contentTitle, topContentId, updatedOn, createdOn, updatedBy, createdBy, isAttentionNeeded, }) => {
21
+ React.createElement(Accordion, null, contentList.map(({ contentTitle, topContentId, updatedOn, createdOn, updatedBy, createdBy, isAttentionNeeded, }) => {
22
22
  const lastModifiedBy = t(`Last modified {{created}} by {{by}}`, {
23
23
  created: formatDate(updatedOn || createdOn),
24
24
  by: updatedBy || createdBy,
25
25
  });
26
- return (React.createElement(AccordionItem, { key: topContentId },
27
- React.createElement(AccordionToggle, { onClick: onToggle(topContentId), isExpanded: expanded === topContentId, id: contentTitle },
28
- React.createElement("span", { className: isAttentionNeeded ? 'pf-v5-u-danger-color-200' : '' },
26
+ return (React.createElement(AccordionItem, { isExpanded: expanded === topContentId, key: topContentId },
27
+ React.createElement(AccordionToggle, { onClick: onToggle(topContentId), id: contentTitle },
28
+ React.createElement("span", { className: isAttentionNeeded ? 'pf-v6-u-text-color-status-danger' : '' },
29
29
  ' ',
30
30
  contentTitle)),
31
- React.createElement(AccordionContent, { id: contentTitle, isHidden: expanded !== topContentId },
32
- React.createElement("span", { className: "pf-v5-u-font-size-sm" }, lastModifiedBy),
33
- React.createElement("br", null),
34
- React.createElement("br", null),
35
- React.createElement(PerformanceMetricClickCount, { needsAttention: isAttentionNeeded, contentId: topContentId, selectedVersion: selectedVersion }))));
31
+ React.createElement(AccordionContent, { id: contentTitle },
32
+ React.createElement("span", { className: "pf-v6-u-font-size-sm" }, lastModifiedBy),
33
+ React.createElement(PerformanceMetricClickCount, { className: "pf-v6-u-mb-sm pf-v6-u-mt-sm", needsAttention: isAttentionNeeded, contentId: topContentId, selectedVersion: selectedVersion }))));
36
34
  }))))))));
37
35
  };
@@ -1,5 +1,6 @@
1
1
  import { FC } from 'react';
2
2
  interface IProps {
3
+ className?: string;
3
4
  contentId: number;
4
5
  needsAttention: boolean;
5
6
  selectedVersion: string;
@@ -1 +1 @@
1
- {"version":3,"file":"PerformanceMetricClickCount.d.ts","sourceRoot":"","sources":["../../../../../src/components/TopContentManagement/ContentUsage/PerformanceMetricClickCount.tsx"],"names":[],"mappings":"AASA,OAAc,EAAE,EAAE,EAAqB,MAAM,OAAO,CAAC;AAKrD,UAAU,MAAM;IACZ,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,OAAO,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;CAC3B;AAED,eAAO,MAAM,2BAA2B,EAAE,EAAE,CAAC,MAAM,CAmDlD,CAAC"}
1
+ {"version":3,"file":"PerformanceMetricClickCount.d.ts","sourceRoot":"","sources":["../../../../../src/components/TopContentManagement/ContentUsage/PerformanceMetricClickCount.tsx"],"names":[],"mappings":"AASA,OAAc,EAAE,EAAE,EAAqB,MAAM,OAAO,CAAC;AAKrD,UAAU,MAAM;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,OAAO,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;CAC3B;AAED,eAAO,MAAM,2BAA2B,EAAE,EAAE,CAAC,MAAM,CAmDlD,CAAC"}
@@ -2,7 +2,7 @@ import { HelperText, HelperTextItem, Panel, PanelMain, PanelMainBody, ToggleGrou
2
2
  import React, { useMemo, useState } from 'react';
3
3
  import { Trans } from 'react-i18next';
4
4
  import { useTopContentContext } from '../../../context/TopContentProvider';
5
- export const PerformanceMetricClickCount = ({ contentId, needsAttention, selectedVersion }) => {
5
+ export const PerformanceMetricClickCount = ({ className, contentId, needsAttention, selectedVersion }) => {
6
6
  const { categoryUsage } = useTopContentContext();
7
7
  const [selectedOption, setSelectedOption] = useState(0);
8
8
  const topContentUsageMetrics = useMemo(() => {
@@ -16,7 +16,7 @@ export const PerformanceMetricClickCount = ({ contentId, needsAttention, selecte
16
16
  };
17
17
  const count = (topContentUsageMetrics === null || topContentUsageMetrics === void 0 ? void 0 : topContentUsageMetrics[selectedOption]) || 0;
18
18
  return (React.createElement(React.Fragment, null,
19
- React.createElement(ToggleGroup, { "aria-label": "performance-usage-days-selector" },
19
+ React.createElement(ToggleGroup, { className: className, "aria-label": "performance-usage-days-selector" },
20
20
  React.createElement(ToggleGroupItem, { buttonId: "last-30-days", text: "Last 30 days", isSelected: selectedOption === 0, onChange: onSelect(0) }),
21
21
  React.createElement(ToggleGroupItem, { buttonId: "last-60-days", text: "Last 60 days", isSelected: selectedOption === 1, onChange: onSelect(1) }),
22
22
  React.createElement(ToggleGroupItem, { buttonId: "last-90-days", text: "Last 90 days", isSelected: selectedOption === 2, onChange: onSelect(2) })),
@@ -1 +1 @@
1
- {"version":3,"file":"PerformanceMetrics.d.ts","sourceRoot":"","sources":["../../../../../src/components/TopContentManagement/ContentUsage/PerformanceMetrics.tsx"],"names":[],"mappings":"AACA,OAAc,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAKlC,UAAU,MAAM;IACZ,WAAW,EAAE,OAAO,CAAC;IACrB,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,cAAc,EAAE,OAAO,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;CAC3B;AACD,eAAO,MAAM,kBAAkB,EAAE,EAAE,CAAC,MAAM,CAwCzC,CAAC"}
1
+ {"version":3,"file":"PerformanceMetrics.d.ts","sourceRoot":"","sources":["../../../../../src/components/TopContentManagement/ContentUsage/PerformanceMetrics.tsx"],"names":[],"mappings":"AACA,OAAc,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAKlC,UAAU,MAAM;IACZ,WAAW,EAAE,OAAO,CAAC;IACrB,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,cAAc,EAAE,OAAO,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;CAC3B;AACD,eAAO,MAAM,kBAAkB,EAAE,EAAE,CAAC,MAAM,CA4CzC,CAAC"}
@@ -1,15 +1,17 @@
1
- import { Button, Modal, ModalVariant, Title, TitleSizes } from '@patternfly/react-core';
1
+ import { Button, Modal, ModalBody, ModalFooter, ModalHeader, ModalVariant } from '@patternfly/react-core';
2
2
  import React from 'react';
3
3
  import { Trans } from 'react-i18next';
4
4
  import { PerformanceMetricClickCount } from './PerformanceMetricClickCount';
5
5
  export const PerformanceMetrics = ({ isModalOpen, onHideModal, needsAttention, contentId, title, lastModifiedBy, selectedVersion, }) => {
6
- return (React.createElement(Modal, { variant: ModalVariant.small, id: "top-content-performance-metric", "aria-label": "top-content-performance-metric", isOpen: isModalOpen, onClose: onHideModal, actions: [
7
- React.createElement(Button, { variant: "secondary", key: "close-button", onClick: onHideModal }, "Cancel"),
8
- ] },
9
- React.createElement(Title, { headingLevel: "h1", size: TitleSizes['2xl'] },
10
- React.createElement(Trans, null, " Performance metrics ")),
11
- React.createElement("p", { className: "pf-v5-u-pb-lg pf-v5-u-pt-sm" }, "Better understand the Performance for the top content resources."),
12
- React.createElement("div", { className: "pf-v5-u-pb-xs top-content-tooltip-view-metric-label" }, title),
13
- React.createElement("div", { className: "pf-v5-u-pb-lg" }, lastModifiedBy),
14
- React.createElement(PerformanceMetricClickCount, { needsAttention: needsAttention, contentId: contentId, selectedVersion: selectedVersion })));
6
+ return (React.createElement(Modal, { variant: ModalVariant.small, id: "top-content-performance-metric", "aria-label": "top-content-performance-metric", isOpen: isModalOpen, onClose: onHideModal },
7
+ React.createElement(ModalHeader, null,
8
+ React.createElement("h2", { className: "pf-v6-u-mb-0" },
9
+ React.createElement(Trans, null, "Performance metrics"))),
10
+ React.createElement(ModalBody, null,
11
+ React.createElement("p", { className: "pf-v6-u-pb-lg pf-v6-u-pt-sm" }, "Better understand the Performance for the top content resources."),
12
+ React.createElement("div", { className: "pf-v6-u-pb-xs top-content-tooltip-view-metric-label" }, title),
13
+ React.createElement("div", { className: "pf-v6-u-pb-lg" }, lastModifiedBy),
14
+ React.createElement(PerformanceMetricClickCount, { needsAttention: needsAttention, contentId: contentId, selectedVersion: selectedVersion })),
15
+ React.createElement(ModalFooter, null,
16
+ React.createElement(Button, { variant: "secondary", key: "close-button", onClick: onHideModal }, "Cancel"))));
15
17
  };
@@ -1,9 +1,8 @@
1
- import { SelectOptionObject } from '@patternfly/react-core/deprecated';
2
- import React, { FC } from 'react';
1
+ import { FC } from 'react';
3
2
  interface IProps {
4
3
  placeholderText: string;
5
4
  title: string;
6
- onSelectCallback: (event: React.MouseEvent | React.ChangeEvent, value: string | SelectOptionObject, isPlaceholder?: boolean) => void;
5
+ onSelectCallback: (value: string, isPlaceholder?: boolean) => void;
7
6
  options: Array<any>;
8
7
  optionValue: (option: any) => string;
9
8
  isLoading?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"PerformanceMetricsSelect.d.ts","sourceRoot":"","sources":["../../../../../src/components/TopContentManagement/ContentUsage/PerformanceMetricsSelect.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAwB,kBAAkB,EAAiB,MAAM,mCAAmC,CAAC;AAC5G,OAAO,KAAK,EAAE,EAAE,EAAE,EAAY,MAAM,OAAO,CAAC;AAG5C,UAAU,MAAM;IACZ,eAAe,EAAE,MAAM,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,gBAAgB,EAAE,CACd,KAAK,EAAE,KAAK,CAAC,UAAU,GAAG,KAAK,CAAC,WAAW,EAC3C,KAAK,EAAE,MAAM,GAAG,kBAAkB,EAClC,aAAa,CAAC,EAAE,OAAO,KACtB,IAAI,CAAC;IACV,OAAO,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;IACpB,WAAW,EAAE,CAAC,MAAM,KAAA,KAAK,MAAM,CAAC;IAChC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,eAAO,MAAM,wBAAwB,EAAE,EAAE,CAAC,MAAM,CAuC/C,CAAC"}
1
+ {"version":3,"file":"PerformanceMetricsSelect.d.ts","sourceRoot":"","sources":["../../../../../src/components/TopContentManagement/ContentUsage/PerformanceMetricsSelect.tsx"],"names":[],"mappings":"AACA,OAAc,EAAE,EAAE,EAAY,MAAM,OAAO,CAAC;AAG5C,UAAU,MAAM;IACZ,eAAe,EAAE,MAAM,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,gBAAgB,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACnE,OAAO,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;IACpB,WAAW,EAAE,CAAC,MAAM,KAAA,KAAK,MAAM,CAAC;IAChC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,eAAO,MAAM,wBAAwB,EAAE,EAAE,CAAC,MAAM,CA2C/C,CAAC"}
@@ -1,20 +1,27 @@
1
- import { Select, SelectOption, SelectVariant } from '@patternfly/react-core/deprecated';
1
+ import { SingleSelectDropdown } from '@rh-support/components';
2
2
  import React, { useState } from 'react';
3
3
  import { Trans } from 'react-i18next';
4
4
  export const PerformanceMetricsSelect = ({ placeholderText, title, onSelectCallback, options, optionValue, isLoading = false, isDisabled, }) => {
5
- const [isOpen, setOpen] = useState(false);
6
5
  const [selected, setSelected] = useState(null);
7
- const onToggle = (isOpen) => setOpen(isOpen);
8
- const onSelect = (e, selected) => {
9
- setSelected(selected);
10
- onSelectCallback(e, selected);
11
- setOpen(false);
6
+ const onSelect = (selected) => {
7
+ setSelected(selected.value);
8
+ onSelectCallback(selected.value);
9
+ };
10
+ const getSelectedDropdownOption = {
11
+ label: selected,
12
+ value: selected,
13
+ };
14
+ const getDropdownOptions = (options) => {
15
+ return options.map((option) => ({
16
+ label: optionValue(option),
17
+ value: optionValue(option),
18
+ }));
12
19
  };
13
20
  return (React.createElement(React.Fragment, null,
14
- React.createElement("div", { className: "pf-v5-u-font-weight-bold" },
21
+ React.createElement("div", { className: "pf-v6-u-font-weight-bold" },
15
22
  React.createElement(Trans, null,
16
23
  " ",
17
24
  title,
18
25
  " ")),
19
- React.createElement(Select, { variant: SelectVariant.single, placeholderText: placeholderText, "aria-label": "Select Input with descriptions", onToggle: (_event, isOpen) => onToggle(isOpen), onSelect: onSelect, selections: selected, isOpen: isOpen, isDisabled: isDisabled || isLoading }, options.map((option, index) => (React.createElement(SelectOption, { key: index, value: optionValue(option) }))))));
26
+ React.createElement(SingleSelectDropdown, { placeholder: placeholderText, ariaLabel: "Select Input with descriptions", options: getDropdownOptions(options), onSelect: onSelect, isDisabled: isDisabled || isLoading, selected: getSelectedDropdownOption })));
20
27
  };
@@ -1 +1 @@
1
- {"version":3,"file":"VersionPerformanceMetrics.d.ts","sourceRoot":"","sources":["../../../../../src/components/TopContentManagement/ContentUsage/VersionPerformanceMetrics.tsx"],"names":[],"mappings":"AAKA,OAAc,EAAE,EAAE,EAAgC,MAAM,OAAO,CAAC;AAUhE,UAAU,MAAM;IACZ,WAAW,EAAE,OAAO,CAAC;IACrB,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,eAAe,EAAE,MAAM,CAAC;CAC3B;AACD,eAAO,MAAM,yBAAyB,EAAE,EAAE,CAAC,MAAM,CAsGhD,CAAC"}
1
+ {"version":3,"file":"VersionPerformanceMetrics.d.ts","sourceRoot":"","sources":["../../../../../src/components/TopContentManagement/ContentUsage/VersionPerformanceMetrics.tsx"],"names":[],"mappings":"AAcA,OAAc,EAAE,EAAE,EAAgC,MAAM,OAAO,CAAC;AAUhE,UAAU,MAAM;IACZ,WAAW,EAAE,OAAO,CAAC;IACrB,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,eAAe,EAAE,MAAM,CAAC;CAC3B;AACD,eAAO,MAAM,yBAAyB,EAAE,EAAE,CAAC,MAAM,CAsGhD,CAAC"}
@@ -8,7 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  });
9
9
  };
10
10
  import { pcm } from '@cee-eng/hydrajs';
11
- import { Button, ButtonVariant, Flex, FlexItem, Modal, ModalVariant, Title, TitleSizes } from '@patternfly/react-core';
11
+ import { Button, ButtonVariant, Flex, FlexItem, Modal, ModalBody, ModalFooter, ModalHeader, ModalVariant, } from '@patternfly/react-core';
12
12
  import { useFetch } from '@rh-support/components';
13
13
  import isEmpty from 'lodash/isEmpty';
14
14
  import React, { useEffect, useMemo, useState } from 'react';
@@ -27,7 +27,7 @@ export const VersionPerformanceMetrics = ({ isModalOpen, onHideModal, selectedVe
27
27
  const { categoryUsage } = useTopContentContext();
28
28
  const { request: getTopContent, isFetching: isTopContentLoading, data: topContent, } = useFetch(pcm.topContent.getTopContent, { initialData: [] });
29
29
  const flagContentEditState = useMemo(() => flagContentUsage(topContent, categoryUsage, selectedVersion), [topContent, categoryUsage, selectedVersion]);
30
- const onVersionSelect = (e, selectedOption) => __awaiter(void 0, void 0, void 0, function* () {
30
+ const onVersionSelect = (selectedOption) => __awaiter(void 0, void 0, void 0, function* () {
31
31
  setVersion(selectedOption);
32
32
  getTopContent &&
33
33
  (yield getTopContent({
@@ -49,21 +49,20 @@ export const VersionPerformanceMetrics = ({ isModalOpen, onHideModal, selectedVe
49
49
  onHideModal();
50
50
  };
51
51
  const versionOptions = isMajorProjectVersion ? versionDifference : [selectedVersionProp];
52
- return (React.createElement(Modal, { variant: ModalVariant.large, id: "top-content-major-version-performance-metric", "aria-label": "top-content-performance-metric", isOpen: isModalOpen, onClose: onModalClose, actions: [
53
- React.createElement(Button, { variant: ButtonVariant.secondary, key: "close-button", onClick: onModalClose },
54
- React.createElement(Trans, null, "Cancel")),
55
- ], className: "performance-metrics-modal" },
56
- React.createElement("div", { className: "sticky-header" },
57
- React.createElement(Title, { headingLevel: "h1", size: TitleSizes['2xl'] },
58
- React.createElement(Trans, null, " Performance metrics ")),
59
- React.createElement("p", { className: "pf-v5-u-pt-sm" },
52
+ return (React.createElement(Modal, { variant: ModalVariant.large, id: "top-content-major-version-performance-metric", "aria-label": "top-content-performance-metric", isOpen: isModalOpen, onClose: onModalClose, className: "performance-metrics-modal" },
53
+ React.createElement(ModalHeader, { className: "sticky-header" },
54
+ React.createElement("h2", { className: "pf-v6-u-mb-0" },
55
+ React.createElement(Trans, null, "Performance metrics")),
56
+ React.createElement("p", { className: "pf-v6-u-p-0 pf-v6-u-mb-0" },
60
57
  React.createElement(Trans, null, "Better understand the Performance for the top content resources.")),
61
- React.createElement("br", null),
62
58
  React.createElement(Flex, { justifyContent: { default: 'justifyContentSpaceBetween' } },
63
- React.createElement(FlexItem, { className: "pf-v5-u-w-50 pf-v5-u-pr-md", style: { marginRight: 'unset' } },
59
+ React.createElement(FlexItem, { className: "pf-v6-u-w-50 pf-v6-u-pr-md", style: { marginRight: 'unset' } },
64
60
  React.createElement(PerformanceMetricsSelect, { placeholderText: t(!isEmpty(versionOptions) ? 'Select a version' : 'No versions available'), title: t(`Version using ${selectedVersionProp}`), onSelectCallback: onVersionSelect, options: versionOptions, optionValue: (option) => option, isLoading: isLoading, isDisabled: isEmpty(versionOptions) })),
65
- React.createElement(FlexItem, { className: "pf-v5-u-w-50 pf-v5-u-pl-md" },
66
- React.createElement(PerformanceMetricsSelect, { placeholderText: t('select a category'), title: t('Categories'), options: flagContentEditState, optionValue: (option) => option.categoryName, onSelectCallback: (e, selectedOption) => setSelectedCategory(selectedOption), isLoading: !selectedVersion || isTopContentLoading })))),
67
- React.createElement("br", null),
68
- React.createElement(ContentAccordion, { contentList: selectedContent, selectedVersion: selectedVersion })));
61
+ React.createElement(FlexItem, { className: "pf-v6-u-w-50 pf-v6-u-pl-md" },
62
+ React.createElement(PerformanceMetricsSelect, { placeholderText: t('select a category'), title: t('Categories'), options: flagContentEditState, optionValue: (option) => option.categoryName, onSelectCallback: (selectedOption) => setSelectedCategory(selectedOption), isLoading: !selectedVersion || isTopContentLoading })))),
63
+ React.createElement(ModalBody, null,
64
+ React.createElement(ContentAccordion, { contentList: selectedContent, selectedVersion: selectedVersion })),
65
+ React.createElement(ModalFooter, null,
66
+ React.createElement(Button, { variant: ButtonVariant.secondary, key: "close-button", onClick: onModalClose },
67
+ React.createElement(Trans, null, "Cancel")))));
69
68
  };
@@ -1 +1 @@
1
- {"version":3,"file":"NoTopContentFound.d.ts","sourceRoot":"","sources":["../../../../src/components/TopContentManagement/NoTopContentFound.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,UAAU,MAAM;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,CACX,SAAS,EAAE,OAAO,EAClB,MAAM,EAAE,OAAO,EACf,OAAO,EAAE,MAAM,EACf,mCAAmC,CAAC,EAAE,OAAO,KAC5C,IAAI,CAAC;IACV,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5C,4BAA4B,EAAE,OAAO,CAAC;CACzC;AAED,wBAAgB,iBAAiB,CAAC,EAC9B,OAAO,EACP,OAAO,EACP,UAAU,EACV,aAAa,EACb,eAAe,EACf,4BAA4B,GAC/B,EAAE,MAAM,qBA8FR"}
1
+ {"version":3,"file":"NoTopContentFound.d.ts","sourceRoot":"","sources":["../../../../src/components/TopContentManagement/NoTopContentFound.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,UAAU,MAAM;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,CACX,SAAS,EAAE,OAAO,EAClB,MAAM,EAAE,OAAO,EACf,OAAO,EAAE,MAAM,EACf,mCAAmC,CAAC,EAAE,OAAO,KAC5C,IAAI,CAAC;IACV,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5C,4BAA4B,EAAE,OAAO,CAAC;CACzC;AAED,wBAAgB,iBAAiB,CAAC,EAC9B,OAAO,EACP,OAAO,EACP,UAAU,EACV,aAAa,EACb,eAAe,EACf,4BAA4B,GAC/B,EAAE,MAAM,qBA2FR"}
@@ -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,15 +10,15 @@ 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" },
21
- React.createElement(Button, { variant: isXVersion ? ButtonVariant.secondary : ButtonVariant.primary, isInline: true, onClick: () => onAddCategory(false, true, version) },
20
+ React.createElement("p", { className: "pf-v6-u-mb-md" },
21
+ React.createElement(Button, { variant: ButtonVariant.primary, isInline: true, onClick: () => onAddCategory(false, true, version) },
22
22
  React.createElement(Trans, null,
23
23
  ' ',
24
24
  "Create ",
@@ -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,qBA2EnD"}
@@ -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,48 @@ 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
+ const selected = availableCategories.find((v) => v.id === selection.key);
41
+ if (selected) {
42
+ setSelected(selection);
43
+ props.onCategoryChange(selected);
44
+ }
41
45
  };
46
+ // Fetch categories only once when component mounts
42
47
  useEffect(() => {
43
- try {
44
- fetchCategories(topContentDispatch);
45
- }
46
- catch (_a) {
47
- ToastNotification.addDangerMessage(t('There was an error loading top content categories'));
48
- }
48
+ const loadCategories = () => __awaiter(this, void 0, void 0, function* () {
49
+ try {
50
+ yield fetchCategories(topContentDispatch);
51
+ }
52
+ catch (_a) {
53
+ ToastNotification.addDangerMessage(t('There was an error loading top content categories'));
54
+ }
55
+ });
56
+ loadCategories();
49
57
  }, [topContentDispatch, t]);
50
58
  return (React.createElement("div", { className: "form-group add-new-category" },
51
59
  React.createElement("label", { htmlFor: "new-category" },
52
60
  React.createElement(Trans, null, "Category"),
53
61
  ' ',
54
62
  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))));
63
+ 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
64
  }
@@ -1 +1 @@
1
- {"version":3,"file":"TopContentCategory.d.ts","sourceRoot":"","sources":["../../../../../../src/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/TopContentCategory.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAmD,MAAM,OAAO,CAAC;AACxE,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAGhF,OAAO,EAAgB,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AAI5F,UAAU,MAAM;IACZ,QAAQ,EAAE,oBAAoB,CAAC;IAC/B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,QAAQ,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACzB,eAAe,EAAE,OAAO,CAAC;IACzB,QAAQ,EAAE,sBAAsB,CAAC;IACjC,mBAAmB,CAAC,EAAE,MAAM,IAAI,CAAC;IACjC,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;CAClC;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,qBA6D/C"}
1
+ {"version":3,"file":"TopContentCategory.d.ts","sourceRoot":"","sources":["../../../../../../src/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/TopContentCategory.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAmD,MAAM,OAAO,CAAC;AACxE,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAGhF,OAAO,EAAgB,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AAI5F,UAAU,MAAM;IACZ,QAAQ,EAAE,oBAAoB,CAAC;IAC/B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,QAAQ,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACzB,eAAe,EAAE,OAAO,CAAC;IACzB,QAAQ,EAAE,sBAAsB,CAAC;IACjC,mBAAmB,CAAC,EAAE,MAAM,IAAI,CAAC;IACjC,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;CAClC;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,qBA6E/C"}
@@ -33,14 +33,20 @@ 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
+ props.isArrangingCats ? (React.createElement("div", { id: props.category.categoryName, className: "pf-v6-c-accordion" },
38
+ React.createElement("div", { className: "pf-v6-c-accordion__item" },
39
+ React.createElement("div", { className: "pf-v6-c-accordion__toggle" },
40
+ React.createElement("h3", { ref: headerRef, className: "pf-v6-c-accordion__toggle-text" },
41
+ React.createElement(Icon, { size: "md", className: "pf-v6-u-mr-sm pf-v6-c-accordion__toggle-icon" },
42
+ React.createElement(GripVerticalIcon, { style: { cursor: 'move' }, title: t('Drag'), color: "#0066CC" })),
43
+ props.category.categoryName,
44
+ ' ',
45
+ props.category.isAttentionNeeded && React.createElement(NeedsAttention, null)))))) : (React.createElement(AccordionToggle, { id: props.category.categoryName, onClick: toggleExpanded },
38
46
  React.createElement("h3", { ref: headerRef },
39
- props.isArrangingCats && (React.createElement(Icon, { size: "md", className: "pf-v5-u-mr-sm" },
40
- React.createElement(GripVerticalIcon, { style: { cursor: 'move' }, title: t('Drag') }))),
41
47
  props.category.categoryName,
42
48
  " ",
43
- props.category.isAttentionNeeded && React.createElement(NeedsAttention, null))),
44
- React.createElement(AccordionContent, { isHidden: !isExpanded },
49
+ props.category.isAttentionNeeded && React.createElement(NeedsAttention, null)))),
50
+ React.createElement(AccordionContent, null,
45
51
  React.createElement(TopContentComponent, { category: props.category, scrollToTop: scrollToTop, categoryMode: CategoryMode.EXISTING_SECTION }))))));
46
52
  }
@@ -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
  }
@@ -1 +1 @@
1
- {"version":3,"file":"TopContentComponent.d.ts","sourceRoot":"","sources":["../../../../../../src/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/TopContentComponent.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAKxC,OAAO,EAGH,oBAAoB,EAGvB,MAAM,wCAAwC,CAAC;AAGhD,MAAM,WAAW,yBAAyB;IACtC,QAAQ,EAAE,oBAAoB,CAAC;IAC/B,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;CACxB;AAED,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,iBAAiB,CAAC,yBAAyB,CA0GlF,CAAC"}
1
+ {"version":3,"file":"TopContentComponent.d.ts","sourceRoot":"","sources":["../../../../../../src/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/TopContentComponent.tsx"],"names":[],"mappings":"AAGA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAKnD,OAAO,EAGH,oBAAoB,EAGvB,MAAM,wCAAwC,CAAC;AAGhD,MAAM,WAAW,yBAAyB;IACtC,QAAQ,EAAE,oBAAoB,CAAC;IAC/B,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;CACxB;AAED,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,iBAAiB,CAAC,yBAAyB,CAsHlF,CAAC"}