@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.
- package/lib/esm/components/Configs/ConfigsTable.d.ts.map +1 -1
- package/lib/esm/components/Configs/ConfigsTable.js +6 -4
- package/lib/esm/components/Groups/DefualtGroupSwitch/DefaultGroupSwitch.d.ts.map +1 -1
- package/lib/esm/components/Groups/DefualtGroupSwitch/DefaultGroupSwitch.js +1 -1
- package/lib/esm/components/Groups/GroupSelect/GroupSelect.d.ts.map +1 -1
- package/lib/esm/components/Groups/GroupSelect/GroupSelect.js +54 -23
- package/lib/esm/components/Groups/GroupUserPermissionsSelect/GroupUserPermissionsSelect.d.ts.map +1 -1
- package/lib/esm/components/Groups/GroupUserPermissionsSelect/GroupUserPermissionsSelect.js +19 -14
- package/lib/esm/components/Groups/ManageGroupUsers/ManageGroupUsers.js +5 -5
- package/lib/esm/components/ManageBookmarkedAccountsTab/AddEditBookmarkModal.d.ts.map +1 -1
- package/lib/esm/components/ManageBookmarkedAccountsTab/AddEditBookmarkModal.js +15 -12
- package/lib/esm/components/ManageBookmarkedAccountsTab/BookmarkAccountSelector.d.ts.map +1 -1
- package/lib/esm/components/ManageBookmarkedAccountsTab/BookmarkAccountSelector.js +106 -67
- package/lib/esm/components/ManageBookmarkedAccountsTab/ManageGroupedBookmarkedAccountsTab.d.ts.map +1 -1
- package/lib/esm/components/ManageBookmarkedAccountsTab/ManageGroupedBookmarkedAccountsTab.js +14 -21
- package/lib/esm/components/ManageExpiredContents/ExpiredContentCategory.js +4 -4
- package/lib/esm/components/ManageExpiredContents/ExpiredContentHeader.js +1 -1
- package/lib/esm/components/ManageExpiredContents/ExpiredContentManager.d.ts.map +1 -1
- package/lib/esm/components/ManageExpiredContents/ExpiredContentManager.js +12 -12
- package/lib/esm/components/ManageExpiredContents/ExpiredContentSingleItem.js +3 -3
- package/lib/esm/components/ManageExpiredContents/ExpiredContentSingleItemView.d.ts.map +1 -1
- package/lib/esm/components/ManageExpiredContents/ExpiredContentSingleItemView.js +37 -35
- package/lib/esm/components/ManagePartnerships/NonOrgCustomerInfoModal.d.ts.map +1 -1
- package/lib/esm/components/ManagePartnerships/NonOrgCustomerInfoModal.js +8 -5
- package/lib/esm/components/ManagePartnerships/PartnershipsList.d.ts.map +1 -1
- package/lib/esm/components/ManagePartnerships/PartnershipsList.js +8 -9
- package/lib/esm/components/ManagePartnerships/PartnershipsTermsModal.d.ts.map +1 -1
- package/lib/esm/components/ManagePartnerships/PartnershipsTermsModal.js +17 -20
- package/lib/esm/components/ManagePartnerships/RequestCollaborationModal.d.ts.map +1 -1
- package/lib/esm/components/ManagePartnerships/RequestCollaborationModal.js +21 -25
- package/lib/esm/components/ManagePartnerships/Requests.d.ts.map +1 -1
- package/lib/esm/components/ManagePartnerships/Requests.js +9 -9
- package/lib/esm/components/ManagePartnerships/index.js +1 -1
- package/lib/esm/components/ManagePreferences/PreferencesHeader.d.ts.map +1 -1
- package/lib/esm/components/ManagePreferences/PreferencesHeader.js +1 -1
- package/lib/esm/components/ManagePreferences/components/PreferenceSelect.d.ts +1 -1
- package/lib/esm/components/ManagePreferences/components/PreferenceSelect.d.ts.map +1 -1
- package/lib/esm/components/ManagePreferences/components/PreferenceSelect.js +26 -27
- package/lib/esm/components/ManagePreferences/sections/PreferencesACL.js +5 -5
- package/lib/esm/components/ManagePreferences/sections/PreferencesCaseCreate.d.ts.map +1 -1
- package/lib/esm/components/ManagePreferences/sections/PreferencesCaseCreate.js +4 -5
- package/lib/esm/components/ManagePreferences/sections/PreferencesCaseSearch.d.ts.map +1 -1
- package/lib/esm/components/ManagePreferences/sections/PreferencesCaseSearch.js +3 -4
- package/lib/esm/components/ManagePreferences/sections/PreferencesCaseView.js +7 -8
- package/lib/esm/components/ManageTable/ManageTable.d.ts +3 -4
- package/lib/esm/components/ManageTable/ManageTable.d.ts.map +1 -1
- package/lib/esm/components/ManageTable/ManageTable.js +12 -18
- package/lib/esm/components/ManageTags/TagsManager.d.ts.map +1 -1
- package/lib/esm/components/ManageTags/TagsManager.js +58 -50
- package/lib/esm/components/NotificationEmails/NotificationEmailsModal.d.ts.map +1 -1
- package/lib/esm/components/NotificationEmails/NotificationEmailsModal.js +30 -23
- package/lib/esm/components/NotificationEmails/index.d.ts.map +1 -1
- package/lib/esm/components/NotificationEmails/index.js +10 -7
- package/lib/esm/components/TopContentManagement/CategoryLimit/CategoryLimit.d.ts.map +1 -1
- package/lib/esm/components/TopContentManagement/CategoryLimit/CategoryLimit.js +2 -3
- package/lib/esm/components/TopContentManagement/CategoryLimit/CategoryLimitGuidelines.js +6 -6
- package/lib/esm/components/TopContentManagement/CategoryLimit/QuestionAnswer.js +1 -1
- package/lib/esm/components/TopContentManagement/ContentUsage/ContentAccordion.d.ts.map +1 -1
- package/lib/esm/components/TopContentManagement/ContentUsage/ContentAccordion.js +7 -9
- package/lib/esm/components/TopContentManagement/ContentUsage/PerformanceMetricClickCount.d.ts +1 -0
- package/lib/esm/components/TopContentManagement/ContentUsage/PerformanceMetricClickCount.d.ts.map +1 -1
- package/lib/esm/components/TopContentManagement/ContentUsage/PerformanceMetricClickCount.js +2 -2
- package/lib/esm/components/TopContentManagement/ContentUsage/PerformanceMetrics.d.ts.map +1 -1
- package/lib/esm/components/TopContentManagement/ContentUsage/PerformanceMetrics.js +12 -10
- package/lib/esm/components/TopContentManagement/ContentUsage/PerformanceMetricsSelect.d.ts +2 -3
- package/lib/esm/components/TopContentManagement/ContentUsage/PerformanceMetricsSelect.d.ts.map +1 -1
- package/lib/esm/components/TopContentManagement/ContentUsage/PerformanceMetricsSelect.js +16 -9
- package/lib/esm/components/TopContentManagement/ContentUsage/VersionPerformanceMetrics.d.ts.map +1 -1
- package/lib/esm/components/TopContentManagement/ContentUsage/VersionPerformanceMetrics.js +15 -16
- package/lib/esm/components/TopContentManagement/NoTopContentFound.d.ts.map +1 -1
- package/lib/esm/components/TopContentManagement/NoTopContentFound.js +14 -15
- package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/AddNewCategoryDropDown.d.ts.map +1 -1
- package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/AddNewCategoryDropDown.js +47 -39
- package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/TopContentCategory.js +4 -4
- package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/TopContentCategoryNew.js +3 -3
- package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/TopContentComponent.d.ts.map +1 -1
- package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/TopContentComponent.js +4 -6
- package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/TopContentSingleItem.d.ts.map +1 -1
- package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/TopContentSingleItem.js +62 -53
- package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/TopContentSingleItemLink.d.ts.map +1 -1
- package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/TopContentSingleItemLink.js +2 -3
- package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentEditor.d.ts.map +1 -1
- package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentEditor.js +8 -9
- package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentSuggestion/TopContentSuggestion.js +2 -2
- package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentSuggestion/TopContentSuggestionHint.js +4 -5
- package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentSuggestion/TopContentSuggestionHintAccept.d.ts.map +1 -1
- package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentSuggestion/TopContentSuggestionHintAccept.js +51 -25
- package/lib/esm/components/TopContentManagement/TopContentHeader.js +1 -1
- package/lib/esm/components/TopContentManagement/TopContentProductVersionSelector.d.ts.map +1 -1
- package/lib/esm/components/TopContentManagement/TopContentProductVersionSelector.js +64 -32
- package/lib/esm/reducers/TagManagmentReducer.d.ts +1 -1
- package/lib/esm/reducers/TagManagmentReducer.d.ts.map +1 -1
- package/lib/esm/scss/_main.scss +158 -25
- package/lib/esm/scss/_pf-overrides.scss +61 -53
- package/lib/esm/scss/index.scss +4 -4
- package/package.json +12 -12
|
@@ -1,20 +1,27 @@
|
|
|
1
|
-
import {
|
|
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
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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-
|
|
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(
|
|
26
|
+
React.createElement(SingleSelectDropdown, { placeholder: placeholderText, ariaLabel: "Select Input with descriptions", options: getDropdownOptions(options), onSelect: onSelect, isDisabled: isDisabled || isLoading, selected: getSelectedDropdownOption })));
|
|
20
27
|
};
|
package/lib/esm/components/TopContentManagement/ContentUsage/VersionPerformanceMetrics.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VersionPerformanceMetrics.d.ts","sourceRoot":"","sources":["../../../../../src/components/TopContentManagement/ContentUsage/VersionPerformanceMetrics.tsx"],"names":[],"mappings":"
|
|
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,
|
|
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 = (
|
|
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,
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
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-
|
|
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-
|
|
66
|
-
React.createElement(PerformanceMetricsSelect, { placeholderText: t('select a category'), title: t('Categories'), options: flagContentEditState, optionValue: (option) => option.categoryName, onSelectCallback: (
|
|
67
|
-
React.createElement(
|
|
68
|
-
|
|
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":"
|
|
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,
|
|
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-
|
|
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-
|
|
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-
|
|
21
|
-
React.createElement(Button, { variant:
|
|
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-
|
|
42
|
-
React.createElement(Button, { isInline: true, className: "pf-
|
|
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, {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
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;
|
|
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
|
-
|
|
2
|
-
|
|
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
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
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(
|
|
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,
|
|
37
|
-
React.createElement(AccordionToggle, { id: props.category.categoryName, onClick: toggleExpanded
|
|
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-
|
|
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,
|
|
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,
|
|
19
|
-
React.createElement(AccordionToggle, { id: "addToCategoryAccordion", onClick: toggleExpanded
|
|
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,
|
|
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,
|
|
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-
|
|
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
|
|
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;
|
|
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(
|
|
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-
|
|
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
|
-
|
|
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-
|
|
327
|
-
!isEmpty((_c = content.expiryDate) !== null && _c !== void 0 ? _c : '') && !isFutureDate(content.expiryDate) && (React.createElement(Label, { isCompact: true, className: "pf-
|
|
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(
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
"
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
"
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
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,
|
|
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
|
|
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,
|
|
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"}
|