@rh-support/manage 2.6.1 → 2.32.2-prodBackup

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 (96) hide show
  1. package/lib/esm/components/Configs/ConfigsTable.d.ts.map +1 -1
  2. package/lib/esm/components/Configs/ConfigsTable.js +6 -4
  3. package/lib/esm/components/Groups/DefualtGroupSwitch/DefaultGroupSwitch.d.ts.map +1 -1
  4. package/lib/esm/components/Groups/DefualtGroupSwitch/DefaultGroupSwitch.js +1 -1
  5. package/lib/esm/components/Groups/GroupSelect/GroupSelect.d.ts.map +1 -1
  6. package/lib/esm/components/Groups/GroupSelect/GroupSelect.js +54 -23
  7. package/lib/esm/components/Groups/GroupUserPermissionsSelect/GroupUserPermissionsSelect.d.ts.map +1 -1
  8. package/lib/esm/components/Groups/GroupUserPermissionsSelect/GroupUserPermissionsSelect.js +19 -14
  9. package/lib/esm/components/Groups/ManageGroupUsers/ManageGroupUsers.js +5 -5
  10. package/lib/esm/components/ManageBookmarkedAccountsTab/AddEditBookmarkModal.d.ts.map +1 -1
  11. package/lib/esm/components/ManageBookmarkedAccountsTab/AddEditBookmarkModal.js +15 -12
  12. package/lib/esm/components/ManageBookmarkedAccountsTab/BookmarkAccountSelector.d.ts.map +1 -1
  13. package/lib/esm/components/ManageBookmarkedAccountsTab/BookmarkAccountSelector.js +106 -67
  14. package/lib/esm/components/ManageBookmarkedAccountsTab/ManageGroupedBookmarkedAccountsTab.d.ts.map +1 -1
  15. package/lib/esm/components/ManageBookmarkedAccountsTab/ManageGroupedBookmarkedAccountsTab.js +14 -21
  16. package/lib/esm/components/ManageExpiredContents/ExpiredContentCategory.js +4 -4
  17. package/lib/esm/components/ManageExpiredContents/ExpiredContentHeader.js +1 -1
  18. package/lib/esm/components/ManageExpiredContents/ExpiredContentManager.d.ts.map +1 -1
  19. package/lib/esm/components/ManageExpiredContents/ExpiredContentManager.js +12 -12
  20. package/lib/esm/components/ManageExpiredContents/ExpiredContentSingleItem.js +3 -3
  21. package/lib/esm/components/ManageExpiredContents/ExpiredContentSingleItemView.d.ts.map +1 -1
  22. package/lib/esm/components/ManageExpiredContents/ExpiredContentSingleItemView.js +37 -35
  23. package/lib/esm/components/ManagePartnerships/NonOrgCustomerInfoModal.d.ts.map +1 -1
  24. package/lib/esm/components/ManagePartnerships/NonOrgCustomerInfoModal.js +8 -5
  25. package/lib/esm/components/ManagePartnerships/PartnershipsList.d.ts.map +1 -1
  26. package/lib/esm/components/ManagePartnerships/PartnershipsList.js +8 -9
  27. package/lib/esm/components/ManagePartnerships/PartnershipsTermsModal.d.ts.map +1 -1
  28. package/lib/esm/components/ManagePartnerships/PartnershipsTermsModal.js +17 -20
  29. package/lib/esm/components/ManagePartnerships/RequestCollaborationModal.d.ts.map +1 -1
  30. package/lib/esm/components/ManagePartnerships/RequestCollaborationModal.js +21 -25
  31. package/lib/esm/components/ManagePartnerships/Requests.d.ts.map +1 -1
  32. package/lib/esm/components/ManagePartnerships/Requests.js +9 -9
  33. package/lib/esm/components/ManagePartnerships/index.js +1 -1
  34. package/lib/esm/components/ManagePreferences/PreferencesHeader.d.ts.map +1 -1
  35. package/lib/esm/components/ManagePreferences/PreferencesHeader.js +1 -1
  36. package/lib/esm/components/ManagePreferences/components/PreferenceSelect.d.ts +1 -1
  37. package/lib/esm/components/ManagePreferences/components/PreferenceSelect.d.ts.map +1 -1
  38. package/lib/esm/components/ManagePreferences/components/PreferenceSelect.js +26 -27
  39. package/lib/esm/components/ManagePreferences/sections/PreferencesACL.js +5 -5
  40. package/lib/esm/components/ManagePreferences/sections/PreferencesCaseCreate.d.ts.map +1 -1
  41. package/lib/esm/components/ManagePreferences/sections/PreferencesCaseCreate.js +4 -5
  42. package/lib/esm/components/ManagePreferences/sections/PreferencesCaseSearch.d.ts.map +1 -1
  43. package/lib/esm/components/ManagePreferences/sections/PreferencesCaseSearch.js +3 -4
  44. package/lib/esm/components/ManagePreferences/sections/PreferencesCaseView.js +7 -8
  45. package/lib/esm/components/ManageTable/ManageTable.d.ts +3 -4
  46. package/lib/esm/components/ManageTable/ManageTable.d.ts.map +1 -1
  47. package/lib/esm/components/ManageTable/ManageTable.js +12 -18
  48. package/lib/esm/components/ManageTags/TagsManager.d.ts.map +1 -1
  49. package/lib/esm/components/ManageTags/TagsManager.js +58 -50
  50. package/lib/esm/components/NotificationEmails/NotificationEmailsModal.d.ts.map +1 -1
  51. package/lib/esm/components/NotificationEmails/NotificationEmailsModal.js +30 -23
  52. package/lib/esm/components/NotificationEmails/index.d.ts.map +1 -1
  53. package/lib/esm/components/NotificationEmails/index.js +10 -7
  54. package/lib/esm/components/TopContentManagement/CategoryLimit/CategoryLimit.d.ts.map +1 -1
  55. package/lib/esm/components/TopContentManagement/CategoryLimit/CategoryLimit.js +2 -3
  56. package/lib/esm/components/TopContentManagement/CategoryLimit/CategoryLimitGuidelines.js +6 -6
  57. package/lib/esm/components/TopContentManagement/CategoryLimit/QuestionAnswer.js +1 -1
  58. package/lib/esm/components/TopContentManagement/ContentUsage/ContentAccordion.d.ts.map +1 -1
  59. package/lib/esm/components/TopContentManagement/ContentUsage/ContentAccordion.js +7 -9
  60. package/lib/esm/components/TopContentManagement/ContentUsage/PerformanceMetricClickCount.d.ts +1 -0
  61. package/lib/esm/components/TopContentManagement/ContentUsage/PerformanceMetricClickCount.d.ts.map +1 -1
  62. package/lib/esm/components/TopContentManagement/ContentUsage/PerformanceMetricClickCount.js +2 -2
  63. package/lib/esm/components/TopContentManagement/ContentUsage/PerformanceMetrics.d.ts.map +1 -1
  64. package/lib/esm/components/TopContentManagement/ContentUsage/PerformanceMetrics.js +12 -10
  65. package/lib/esm/components/TopContentManagement/ContentUsage/PerformanceMetricsSelect.d.ts +2 -3
  66. package/lib/esm/components/TopContentManagement/ContentUsage/PerformanceMetricsSelect.d.ts.map +1 -1
  67. package/lib/esm/components/TopContentManagement/ContentUsage/PerformanceMetricsSelect.js +16 -9
  68. package/lib/esm/components/TopContentManagement/ContentUsage/VersionPerformanceMetrics.d.ts.map +1 -1
  69. package/lib/esm/components/TopContentManagement/ContentUsage/VersionPerformanceMetrics.js +15 -16
  70. package/lib/esm/components/TopContentManagement/NoTopContentFound.d.ts.map +1 -1
  71. package/lib/esm/components/TopContentManagement/NoTopContentFound.js +14 -15
  72. package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/AddNewCategoryDropDown.d.ts.map +1 -1
  73. package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/AddNewCategoryDropDown.js +47 -39
  74. package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/TopContentCategory.js +4 -4
  75. package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/TopContentCategoryNew.js +3 -3
  76. package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/TopContentComponent.d.ts.map +1 -1
  77. package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/TopContentComponent.js +4 -6
  78. package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/TopContentSingleItem.d.ts.map +1 -1
  79. package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/TopContentSingleItem.js +62 -53
  80. package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/TopContentSingleItemLink.d.ts.map +1 -1
  81. package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/TopContentSingleItemLink.js +2 -3
  82. package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentEditor.d.ts.map +1 -1
  83. package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentEditor.js +8 -9
  84. package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentSuggestion/TopContentSuggestion.js +2 -2
  85. package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentSuggestion/TopContentSuggestionHint.js +4 -5
  86. package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentSuggestion/TopContentSuggestionHintAccept.d.ts.map +1 -1
  87. package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentSuggestion/TopContentSuggestionHintAccept.js +51 -25
  88. package/lib/esm/components/TopContentManagement/TopContentHeader.js +1 -1
  89. package/lib/esm/components/TopContentManagement/TopContentProductVersionSelector.d.ts.map +1 -1
  90. package/lib/esm/components/TopContentManagement/TopContentProductVersionSelector.js +64 -32
  91. package/lib/esm/reducers/TagManagmentReducer.d.ts +1 -1
  92. package/lib/esm/reducers/TagManagmentReducer.d.ts.map +1 -1
  93. package/lib/esm/scss/_main.scss +158 -25
  94. package/lib/esm/scss/_pf-overrides.scss +61 -53
  95. package/lib/esm/scss/index.scss +4 -4
  96. package/package.json +12 -12
@@ -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
  }
@@ -33,14 +33,14 @@ export function TopContentCategory(props) {
33
33
  props.isExpanded !== isExpanded && setIsExpanded(props.isExpanded);
34
34
  // eslint-disable-next-line react-hooks/exhaustive-deps
35
35
  }, [props.isExpanded]);
36
- return (React.createElement("div", Object.assign({ ref: props.innerRef }, props.provided.draggableProps, props.provided.dragHandleProps), props.category.content.length > 0 && (React.createElement(AccordionItem, null,
37
- React.createElement(AccordionToggle, { id: props.category.categoryName, onClick: toggleExpanded, isExpanded: isExpanded },
36
+ return (React.createElement("div", Object.assign({ ref: props.innerRef }, props.provided.draggableProps, props.provided.dragHandleProps), props.category.content.length > 0 && (React.createElement(AccordionItem, { isExpanded: isExpanded },
37
+ React.createElement(AccordionToggle, { id: props.category.categoryName, onClick: toggleExpanded },
38
38
  React.createElement("h3", { ref: headerRef },
39
- props.isArrangingCats && (React.createElement(Icon, { size: "md", className: "pf-v5-u-mr-sm" },
39
+ props.isArrangingCats && (React.createElement(Icon, { size: "md", className: "pf-v6-u-mr-sm" },
40
40
  React.createElement(GripVerticalIcon, { style: { cursor: 'move' }, title: t('Drag') }))),
41
41
  props.category.categoryName,
42
42
  " ",
43
43
  props.category.isAttentionNeeded && React.createElement(NeedsAttention, null))),
44
- React.createElement(AccordionContent, { isHidden: !isExpanded },
44
+ React.createElement(AccordionContent, null,
45
45
  React.createElement(TopContentComponent, { category: props.category, scrollToTop: scrollToTop, categoryMode: CategoryMode.EXISTING_SECTION }))))));
46
46
  }
@@ -15,13 +15,13 @@ export function TopContentCategoryNew({ category, version }) {
15
15
  scrollToTop();
16
16
  // eslint-disable-next-line react-hooks/exhaustive-deps
17
17
  }, []);
18
- return (React.createElement(AccordionItem, null,
19
- React.createElement(AccordionToggle, { id: "addToCategoryAccordion", onClick: toggleExpanded, isExpanded: isExpanded },
18
+ return (React.createElement(AccordionItem, { isExpanded: isExpanded },
19
+ React.createElement(AccordionToggle, { id: "addToCategoryAccordion", onClick: toggleExpanded },
20
20
  React.createElement("div", { className: "reference-div", ref: addNewCategoryRef }, !getVersion(version).minor && isRegularVersion(version) ? (React.createElement(Trans, null,
21
21
  "Creating a new set for major version ",
22
22
  version)) : getVersion(version).minor ? (React.createElement(Trans, null,
23
23
  "Creating a new set for ",
24
24
  version)) : (React.createElement(Trans, null, "Add new section")))),
25
- React.createElement(AccordionContent, { isHidden: !isExpanded },
25
+ React.createElement(AccordionContent, null,
26
26
  React.createElement(TopContentComponent, { category: category, scrollToTop: scrollToTop, categoryMode: CategoryMode.NEW_SECTION }))));
27
27
  }
@@ -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":"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,CA+GlF,CAAC"}
@@ -40,22 +40,20 @@ export const TopContentComponent = (props) => {
40
40
  resetChangeInCategoryContent(topContentDispatch, topContentEditState, topContentResponse, props.category.id);
41
41
  setIsArrangingContent(false);
42
42
  };
43
- const buttons = (React.createElement("div", { className: "pf-v5-c-accordion__expanded-content-footer" },
43
+ const buttons = (React.createElement("div", { className: "pf-v6-c-accordion__expanded-content-footer" },
44
44
  !isArrangingContent && props.categoryMode !== CategoryMode.NEW_SECTION && (React.createElement("span", null,
45
- React.createElement(Button, { variant: "secondary", onClick: addContent, "data-tracking-id": "add-content-top-content" },
45
+ React.createElement(Button, { className: "pf-v6-u-mr-md", variant: "secondary", onClick: addContent, "data-tracking-id": "add-content-top-content" },
46
46
  React.createElement(Trans, null, "Add content")),
47
- ' ',
48
47
  React.createElement(Button, { variant: "secondary", onClick: arrangeSection, isDisabled: props.category.content.length < 2 },
49
48
  React.createElement(Trans, null, "Arrange section")))),
50
49
  isArrangingContent && (React.createElement("span", null,
51
- React.createElement(Button, { variant: "primary", onClick: saveArrangement },
50
+ React.createElement(Button, { className: "pf-v6-u-mr-md", variant: "primary", onClick: saveArrangement },
52
51
  React.createElement(Trans, null, "Save")),
53
- ' ',
54
52
  React.createElement(Button, { variant: "link", onClick: cancelArrangement },
55
53
  React.createElement(Trans, null, "Cancel"))))));
56
54
  return (React.createElement("div", null,
57
55
  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" },
56
+ React.createElement("ul", { id: "content-list", "aria-label": t('Content list'), className: "list-flat" },
59
57
  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
58
  React.createElement(TopContentSingleItem, { isArrangingContent: isArrangingContent, category: props.category, snapshot: snapshot, i: i, key: content.topContentId })))))),
61
59
  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,kDAAmD,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" },
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"}